diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/.vsconfig b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/.vsconfig deleted file mode 100644 index 7f5f4b38fd..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/.vsconfig +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "1.0", - "components": [ - "Microsoft.Net.Component.4.6.2.TargetingPack", - "Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64", - "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", - "Microsoft.VisualStudio.Component.Windows10SDK.22621", - "Microsoft.VisualStudio.Workload.CoreEditor", - "Microsoft.VisualStudio.Workload.ManagedDesktop", - "Microsoft.VisualStudio.Workload.NativeDesktop", - "Microsoft.VisualStudio.Workload.NativeGame" - ] -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealEditor-UnrealNewtonProject1.dll b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealEditor-UnrealNewtonProject1.dll deleted file mode 100644 index aef3112cbb..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealEditor-UnrealNewtonProject1.dll and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealEditor-UnrealNewtonProject1.pdb b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealEditor-UnrealNewtonProject1.pdb deleted file mode 100644 index bdf71160af..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealEditor-UnrealNewtonProject1.pdb and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealEditor.modules b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealEditor.modules deleted file mode 100644 index e764535cf2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealEditor.modules +++ /dev/null @@ -1,7 +0,0 @@ -{ - "BuildId": "33043543", - "Modules": - { - "UnrealNewtonProject1": "UnrealEditor-UnrealNewtonProject1.dll" - } -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealNewtonProject1Editor.target b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealNewtonProject1Editor.target deleted file mode 100644 index 8147d7c4b8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Binaries/Win64/UnrealNewtonProject1Editor.target +++ /dev/null @@ -1,29670 +0,0 @@ -{ - "TargetName": "UnrealNewtonProject1Editor", - "Platform": "Win64", - "Configuration": "Development", - "TargetType": "Editor", - "IsTestTarget": false, - "Architecture": "x64", - "Project": "../../UnrealNewtonProject1.uproject", - "Launch": "$(EngineDir)/Binaries/Win64/UnrealEditor.exe", - "LaunchCmd": "$(EngineDir)/Binaries/Win64/UnrealEditor-Cmd.exe", - "Version": - { - "MajorVersion": 5, - "MinorVersion": 4, - "PatchVersion": 4, - "Changelist": 35576357, - "CompatibleChangelist": 33043543, - "IsLicenseeVersion": 0, - "IsPromotedBuild": 0, - "BranchName": "++UE5+Release-5.4", - "BuildId": "33043543" - }, - "BuildProducts": [ - { - "Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-UnrealNewtonProject1.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-UnrealNewtonProject1.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(ProjectDir)/Plugins/newton/Binaries/Win64/UnrealEditor-newton.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(ProjectDir)/Plugins/newton/Binaries/Win64/UnrealEditor-newton.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(ProjectDir)/Plugins/newton/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/AgentInterface.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/AgentInterface.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/OpenColorIO_2_3.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/OpenImageDenoise.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AIGraph.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AIGraph.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AIModule.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AIModule.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AITestSuite.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AITestSuite.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AVEncoder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AVEncoder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AVIWriter.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AVIWriter.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ActionableMessage.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ActionableMessage.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ActorPickerMode.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ActorPickerMode.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AddContentDialog.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AddContentDialog.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AdpcmAudioDecoder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AdpcmAudioDecoder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AdvancedPreviewScene.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AdvancedPreviewScene.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AdvancedWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AdvancedWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Advertising.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Advertising.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Analytics.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Analytics.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnalyticsET.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnalyticsET.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimGraph.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimGraph.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimGraphRuntime.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimGraphRuntime.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationBlueprintEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationBlueprintEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationBlueprintLibrary.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationBlueprintLibrary.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationDataController.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationDataController.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationEditMode.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationEditMode.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationEditorWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationEditorWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationModifiers.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationModifiers.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationSettings.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationSettings.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AnimationWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AppFramework.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AppFramework.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ApplicationCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ApplicationCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AssetDefinition.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AssetDefinition.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AssetRegistry.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AssetRegistry.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AssetTagsEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AssetTagsEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AssetTools.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AssetTools.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioAnalyzer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioAnalyzer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioCaptureCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioCaptureCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioCaptureRtAudio.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioCaptureRtAudio.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioCaptureWasapi.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioCaptureWasapi.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioExtensions.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioExtensions.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioFormatADPCM.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioFormatADPCM.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioFormatBink.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioFormatBink.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioFormatOgg.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioFormatOgg.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioFormatOpus.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioFormatOpus.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioFormatRad.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioFormatRad.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioLinkCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioLinkCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioLinkEngine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioLinkEngine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioMixer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioMixer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioMixerCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioMixerCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioMixerPlatformAudioLink.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioMixerPlatformAudioLink.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioMixerXAudio2.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioMixerXAudio2.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioPlatformConfiguration.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioPlatformConfiguration.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioSettingsEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AudioSettingsEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationController.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationController.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationDriver.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationDriver.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationMessages.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationMessages.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationTest.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationTest.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationWindow.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationWindow.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationWorker.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-AutomationWorker.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BSPUtils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BSPUtils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BehaviorTreeEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BehaviorTreeEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BinkAudioDecoder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BinkAudioDecoder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BlueprintEditorLibrary.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BlueprintEditorLibrary.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BlueprintGraph.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BlueprintGraph.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BlueprintRuntime.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BlueprintRuntime.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Blutility.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Blutility.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BuildPatchServices.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BuildPatchServices.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BuildSettings.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-BuildSettings.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CEF3Utils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CEF3Utils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CSVtoSVG.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CSVtoSVG.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CUDA.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CUDA.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Cascade.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Cascade.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Cbor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Cbor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Chaos.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Chaos.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ChaosCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ChaosCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ChaosSolverEngine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ChaosSolverEngine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ChaosVDData.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ChaosVDData.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ChaosVDRuntime.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ChaosVDRuntime.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CinematicCamera.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CinematicCamera.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClassViewer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClassViewer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothPainter.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothPainter.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothingSystemEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothingSystemEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothingSystemEditorInterface.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothingSystemEditorInterface.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothingSystemRuntimeCommon.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothingSystemRuntimeCommon.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothingSystemRuntimeInterface.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothingSystemRuntimeInterface.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothingSystemRuntimeNv.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ClothingSystemRuntimeNv.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Cmd.exe", - "Type": "Executable" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Cmd.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CollectionManager.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CollectionManager.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CollisionAnalyzer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CollisionAnalyzer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ColorManagement.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ColorManagement.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CommonMenuExtensions.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CommonMenuExtensions.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ComponentVisualizers.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ComponentVisualizers.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ConfigEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ConfigEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Constraints.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Constraints.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ContentBrowser.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ContentBrowser.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ContentBrowserData.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ContentBrowserData.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CookMetadata.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CookMetadata.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CookOnTheFly.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CookOnTheFly.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CookOnTheFlyNetServer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CookOnTheFlyNetServer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CookedEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CookedEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Core.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Core.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CoreOnline.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CoreOnline.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CoreUObject.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CoreUObject.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CurveAssetEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CurveAssetEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CurveEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CurveEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CurveTableEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-CurveTableEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-D3D11RHI.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-D3D11RHI.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-D3D12RHI.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-D3D12RHI.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DataLayerEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DataLayerEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DataTableEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DataTableEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DataflowCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DataflowCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DataflowEngine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DataflowEngine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DerivedDataCache.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DerivedDataCache.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DerivedDataEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DerivedDataEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DesktopPlatform.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DesktopPlatform.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DesktopWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DesktopWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DetailCustomizations.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DetailCustomizations.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DeveloperSettings.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DeveloperSettings.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DeveloperToolSettings.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DeveloperToolSettings.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DeviceManager.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DeviceManager.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DeviceProfileEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DeviceProfileEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DeviceProfileServices.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DeviceProfileServices.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DirectoryWatcher.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DirectoryWatcher.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DistCurveEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DistCurveEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Documentation.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Documentation.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DrawPrimitiveDebugger.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-DrawPrimitiveDebugger.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorAnalyticsSession.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorAnalyticsSession.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorConfig.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorConfig.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorFramework.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorFramework.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorInteractiveToolsFramework.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorInteractiveToolsFramework.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorSettingsViewer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorSettingsViewer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorStyle.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorStyle.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorSubsystem.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorSubsystem.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EditorWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Engine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Engine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EngineMessages.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EngineMessages.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EngineSettings.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EngineSettings.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EnvironmentLightingViewer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EnvironmentLightingViewer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EventLoop.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EventLoop.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ExternalImagePicker.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ExternalImagePicker.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EyeTracker.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-EyeTracker.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FieldNotification.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FieldNotification.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FieldSystemEngine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FieldSystemEngine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FileUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FileUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Foliage.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Foliage.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FoliageEdit.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FoliageEdit.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FontEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FontEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FunctionalTesting.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-FunctionalTesting.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameProjectGeneration.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameProjectGeneration.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayDebugger.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayDebugger.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayDebuggerEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayDebuggerEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayMediaEncoder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayMediaEncoder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayTags.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayTags.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayTasks.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayTasks.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayTasksEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GameplayTasksEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GeometryCollectionEngine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GeometryCollectionEngine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GeometryCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GeometryCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GeometryFramework.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GeometryFramework.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GeometryProcessingInterfaces.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GeometryProcessingInterfaces.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GraphColor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GraphColor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GraphEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-GraphEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HTTP.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HTTP.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HTTPServer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HTTPServer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HardwareTargeting.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HardwareTargeting.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HeadMountedDisplay.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HeadMountedDisplay.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HierarchicalLODOutliner.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HierarchicalLODOutliner.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HierarchicalLODUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HierarchicalLODUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Horde.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Horde.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HotReload.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HotReload.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HttpNetworkReplayStreaming.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-HttpNetworkReplayStreaming.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-IESFile.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-IESFile.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Icmp.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Icmp.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ImageCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ImageCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ImageWrapper.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ImageWrapper.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ImageWriteQueue.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ImageWriteQueue.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InputBindingEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InputBindingEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InputCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InputCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InputDevice.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InputDevice.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InstallBundleManager.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InstallBundleManager.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InteractiveToolsFramework.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InteractiveToolsFramework.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InterchangeCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InterchangeCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InterchangeEngine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InterchangeEngine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InternationalizationSettings.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-InternationalizationSettings.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-IoStoreOnDemand.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-IoStoreOnDemand.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-IoStoreUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-IoStoreUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-IrisCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-IrisCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Json.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Json.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-JsonUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-JsonUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Kismet.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Kismet.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-KismetCompiler.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-KismetCompiler.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-KismetWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-KismetWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Landscape.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Landscape.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LandscapeEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LandscapeEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LandscapeEditorUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LandscapeEditorUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LauncherPlatform.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LauncherPlatform.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LauncherServices.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LauncherServices.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Layers.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Layers.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LevelEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LevelEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LevelInstanceEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LevelInstanceEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LevelSequence.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LevelSequence.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LiveCoding.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LiveCoding.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LiveLinkInterface.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LiveLinkInterface.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LocalFileNetworkReplayStreaming.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LocalFileNetworkReplayStreaming.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Localization.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Localization.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LocalizationCommandletExecution.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LocalizationCommandletExecution.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LocalizationDashboard.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LocalizationDashboard.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LocalizationService.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LocalizationService.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LogVisualizer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-LogVisualizer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MRMesh.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MRMesh.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MainFrame.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MainFrame.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MaterialBaking.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MaterialBaking.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MaterialEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MaterialEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MaterialShaderQualitySettings.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MaterialShaderQualitySettings.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MaterialUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MaterialUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Media.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Media.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MediaAssets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MediaAssets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MediaUtils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MediaUtils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Merge.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Merge.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MergeActors.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MergeActors.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshBoneReduction.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshBoneReduction.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshBuilder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshBuilder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshBuilderCommon.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshBuilderCommon.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshConversion.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshConversion.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshConversionEngineTypes.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshConversionEngineTypes.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshDescription.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshDescription.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshMergeUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshMergeUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshPaint.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshPaint.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshReductionInterface.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshReductionInterface.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshUtilitiesCommon.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshUtilitiesCommon.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshUtilitiesEngine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MeshUtilitiesEngine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MessageLog.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MessageLog.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Messaging.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Messaging.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MessagingCommon.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MessagingCommon.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MessagingRpc.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MessagingRpc.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MoviePlayer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MoviePlayer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MoviePlayerProxy.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MoviePlayerProxy.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MovieScene.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MovieScene.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MovieSceneCapture.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MovieSceneCapture.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MovieSceneCaptureDialog.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MovieSceneCaptureDialog.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MovieSceneTools.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MovieSceneTools.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MovieSceneTracks.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-MovieSceneTracks.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NaniteBuilder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NaniteBuilder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NaniteUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NaniteUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NavigationSystem.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NavigationSystem.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Navmesh.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Navmesh.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NetCommon.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NetCommon.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NetCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NetCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NetworkFile.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NetworkFile.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NetworkFileSystem.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NetworkFileSystem.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NetworkReplayStreaming.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NetworkReplayStreaming.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Networking.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Networking.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NewLevelDialog.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NewLevelDialog.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NonRealtimeAudioRenderer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NonRealtimeAudioRenderer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NullDrv.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NullDrv.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NullNetworkReplayStreaming.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-NullNetworkReplayStreaming.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-OpenColorIOWrapper.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-OpenColorIOWrapper.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-OpenGLDrv.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-OpenGLDrv.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-OpusAudioDecoder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-OpusAudioDecoder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-OutputLog.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-OutputLog.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Overlay.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Overlay.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-OverlayEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-OverlayEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PIEPreviewDeviceProfileSelector.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PIEPreviewDeviceProfileSelector.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PIEPreviewDeviceSpecification.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PIEPreviewDeviceSpecification.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PListEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PListEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PackagesDialog.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PackagesDialog.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PacketHandler.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PacketHandler.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PakFile.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PakFile.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PakFileUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PakFileUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PerfCounters.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PerfCounters.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Persona.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Persona.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PhysicsAssetEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PhysicsAssetEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PhysicsCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PhysicsCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PhysicsUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PhysicsUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PinnedCommandList.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PinnedCommandList.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PixelInspectorModule.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PixelInspectorModule.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PlacementMode.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PlacementMode.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PortalMessages.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PortalMessages.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PortalProxies.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PortalProxies.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PortalRpc.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PortalRpc.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PortalServices.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PortalServices.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PreLoadScreen.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PreLoadScreen.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProfileVisualizer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProfileVisualizer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProfilerClient.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProfilerClient.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProfilerMessages.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProfilerMessages.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProfilerService.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProfilerService.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProjectLauncher.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProjectLauncher.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProjectSettingsViewer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProjectSettingsViewer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProjectTargetPlatformEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ProjectTargetPlatformEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Projects.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Projects.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PropertyEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PropertyEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PropertyPath.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-PropertyPath.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-QuadricMeshReduction.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-QuadricMeshReduction.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RHI.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RHI.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RHICore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RHICore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RSA.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RSA.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RadAudioDecoder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RadAudioDecoder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RawMesh.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RawMesh.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RealtimeProfiler.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RealtimeProfiler.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ReliabilityHandlerComponent.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ReliabilityHandlerComponent.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RenderCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RenderCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RenderResourceViewer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-RenderResourceViewer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Renderer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Renderer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-S3Client.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-S3Client.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SSL.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SSL.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SandboxFile.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SandboxFile.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SceneDepthPickerMode.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SceneDepthPickerMode.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SceneOutliner.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SceneOutliner.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ScreenShotComparison.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ScreenShotComparison.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ScreenShotComparisonTools.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ScreenShotComparisonTools.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ScriptDisassembler.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ScriptDisassembler.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ScriptableEditorWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ScriptableEditorWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SequenceRecorder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SequenceRecorder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Sequencer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Sequencer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SequencerCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SequencerCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SequencerWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SequencerWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Serialization.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Serialization.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SerializedRecorderInterface.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SerializedRecorderInterface.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SessionFrontend.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SessionFrontend.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SessionMessages.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SessionMessages.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SessionServices.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SessionServices.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Settings.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Settings.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SettingsEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SettingsEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ShaderCompilerCommon.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ShaderCompilerCommon.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ShaderFormatD3D.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ShaderFormatD3D.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ShaderFormatOpenGL.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ShaderFormatOpenGL.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ShaderFormatVectorVM.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ShaderFormatVectorVM.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ShaderPreprocessor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ShaderPreprocessor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SharedSettingsWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SharedSettingsWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SignalProcessing.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SignalProcessing.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SkeletalMeshDescription.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SkeletalMeshDescription.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SkeletalMeshEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SkeletalMeshEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SkeletalMeshUtilitiesCommon.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SkeletalMeshUtilitiesCommon.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SkeletonEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SkeletonEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Slate.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Slate.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SlateCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SlateCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SlateNullRenderer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SlateNullRenderer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SlateRHIRenderer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SlateRHIRenderer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SlateReflector.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SlateReflector.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Sockets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Sockets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SoundFieldRendering.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SoundFieldRendering.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SourceCodeAccess.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SourceCodeAccess.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SourceControl.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SourceControl.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SourceControlWindowExtender.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SourceControlWindowExtender.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SourceControlWindows.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SourceControlWindows.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SparseVolumeTexture.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SparseVolumeTexture.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StaticMeshDescription.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StaticMeshDescription.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StaticMeshEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StaticMeshEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StatsViewer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StatsViewer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StatusBar.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StatusBar.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StorageServerClient.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StorageServerClient.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StreamingFile.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StreamingFile.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StreamingPauseRendering.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StreamingPauseRendering.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StringTableEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StringTableEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StructViewer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-StructViewer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SubobjectDataInterface.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SubobjectDataInterface.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SubobjectEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SubobjectEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SwarmInterface.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SwarmInterface.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SynthBenchmark.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-SynthBenchmark.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TargetDeviceServices.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TargetDeviceServices.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TargetPlatform.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TargetPlatform.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TelemetryUtils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TelemetryUtils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureBuild.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureBuild.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureBuildUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureBuildUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureCompressor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureCompressor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureFormat.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureFormat.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureFormatDXT.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureFormatDXT.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureFormatIntelISPCTexComp.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureFormatIntelISPCTexComp.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureFormatUncompressed.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureFormatUncompressed.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureUtilitiesCommon.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TextureUtilitiesCommon.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TimeManagement.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TimeManagement.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ToolMenus.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ToolMenus.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ToolMenusEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ToolMenusEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ToolWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ToolWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TraceAnalysis.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TraceAnalysis.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TraceInsights.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TraceInsights.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TraceLog.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TraceLog.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TraceServices.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TraceServices.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TranslationEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TranslationEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TreeMap.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TreeMap.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TurnkeyIO.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TurnkeyIO.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TurnkeySupport.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TurnkeySupport.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TypedElementFramework.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TypedElementFramework.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TypedElementRuntime.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-TypedElementRuntime.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UATHelper.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UATHelper.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UMG.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UMG.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UMGEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UMGEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UncontrolledChangelists.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UncontrolledChangelists.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UndoHistory.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UndoHistory.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UndoHistoryEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UndoHistoryEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UniversalObjectLocator.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UniversalObjectLocator.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UniversalObjectLocatorEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UniversalObjectLocatorEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UnrealEd.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UnrealEd.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UnrealEdMessages.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UnrealEdMessages.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UnsavedAssetsTracker.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-UnsavedAssetsTracker.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VREditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VREditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VectorVM.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VectorVM.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ViewportInteraction.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ViewportInteraction.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ViewportSnapping.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-ViewportSnapping.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VirtualFileCache.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VirtualFileCache.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VirtualTexturingEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VirtualTexturingEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Virtualization.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Virtualization.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VirtualizationEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VirtualizationEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VisualGraphUtils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VisualGraphUtils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Voice.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Voice.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VorbisAudioDecoder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VorbisAudioDecoder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Voronoi.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Voronoi.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VulkanRHI.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VulkanRHI.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VulkanShaderFormat.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-VulkanShaderFormat.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WebBrowser.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WebBrowser.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WidgetCarousel.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WidgetCarousel.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WidgetRegistration.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WidgetRegistration.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WindowsPlatformEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WindowsPlatformEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WindowsPlatformFeatures.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WindowsPlatformFeatures.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WindowsTargetPlatform.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WindowsTargetPlatform.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WorkspaceMenuStructure.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WorkspaceMenuStructure.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WorldBrowser.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WorldBrowser.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WorldPartitionEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-WorldPartitionEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-XmlParser.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-XmlParser.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Zen.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor-Zen.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor.exe", - "Type": "Executable" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/UnrealEditor.version", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.10.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.11.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.12.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.5.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.6.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.7.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.8.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.9.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/tbb12.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Binaries/Win64/UnrealEditor-Paper2D.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Binaries/Win64/UnrealEditor-Paper2D.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Binaries/Win64/UnrealEditor-Paper2DEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Binaries/Win64/UnrealEditor-Paper2DEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Binaries/Win64/UnrealEditor-PaperSpriteSheetImporter.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Binaries/Win64/UnrealEditor-PaperSpriteSheetImporter.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Binaries/Win64/UnrealEditor-PaperTiledImporter.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Binaries/Win64/UnrealEditor-PaperTiledImporter.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Binaries/Win64/UnrealEditor-SmartSnapping.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Binaries/Win64/UnrealEditor-SmartSnapping.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/AI/AISupport/Binaries/Win64/UnrealEditor-AISupportModule.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/AI/AISupport/Binaries/Win64/UnrealEditor-AISupportModule.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/AI/AISupport/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/AI/EnvironmentQueryEditor/Binaries/Win64/UnrealEditor-EnvironmentQueryEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/AI/EnvironmentQueryEditor/Binaries/Win64/UnrealEditor-EnvironmentQueryEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/AI/EnvironmentQueryEditor/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ACLPlugin/Binaries/Win64/UnrealEditor-ACLPlugin.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ACLPlugin/Binaries/Win64/UnrealEditor-ACLPlugin.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ACLPlugin/Binaries/Win64/UnrealEditor-ACLPluginEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ACLPlugin/Binaries/Win64/UnrealEditor-ACLPluginEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ACLPlugin/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/AnimationData/Binaries/Win64/UnrealEditor-AnimationData.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/AnimationData/Binaries/Win64/UnrealEditor-AnimationData.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/AnimationData/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/AnimationModifierLibrary/Binaries/Win64/UnrealEditor-AnimationModifierLibrary.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/AnimationModifierLibrary/Binaries/Win64/UnrealEditor-AnimationModifierLibrary.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/AnimationModifierLibrary/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/BlendSpaceMotionAnalysis/Binaries/Win64/UnrealEditor-BlendSpaceMotionAnalysis.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/BlendSpaceMotionAnalysis/Binaries/Win64/UnrealEditor-BlendSpaceMotionAnalysis.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/BlendSpaceMotionAnalysis/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRigSpline/Binaries/Win64/UnrealEditor-ControlRigSpline.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRigSpline/Binaries/Win64/UnrealEditor-ControlRigSpline.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRigSpline/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRig/Binaries/Win64/UnrealEditor-ControlRig.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRig/Binaries/Win64/UnrealEditor-ControlRig.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRig/Binaries/Win64/UnrealEditor-ControlRigDeveloper.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRig/Binaries/Win64/UnrealEditor-ControlRigDeveloper.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRig/Binaries/Win64/UnrealEditor-ControlRigEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRig/Binaries/Win64/UnrealEditor-ControlRigEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRig/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/IKRig/Binaries/Win64/UnrealEditor-IKRig.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/IKRig/Binaries/Win64/UnrealEditor-IKRig.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/IKRig/Binaries/Win64/UnrealEditor-IKRigDeveloper.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/IKRig/Binaries/Win64/UnrealEditor-IKRigDeveloper.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/IKRig/Binaries/Win64/UnrealEditor-IKRigEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/IKRig/Binaries/Win64/UnrealEditor-IKRigEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/IKRig/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-Bridge.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-Bridge.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-MegascansPlugin.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-MegascansPlugin.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Cameras/CameraShakePreviewer/Binaries/Win64/UnrealEditor-CameraShakePreviewer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Cameras/CameraShakePreviewer/Binaries/Win64/UnrealEditor-CameraShakePreviewer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Cameras/CameraShakePreviewer/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Cameras/GameplayCameras/Binaries/Win64/UnrealEditor-GameplayCameras.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Cameras/GameplayCameras/Binaries/Win64/UnrealEditor-GameplayCameras.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Cameras/GameplayCameras/Binaries/Win64/UnrealEditor-GameplayCamerasEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Cameras/GameplayCameras/Binaries/Win64/UnrealEditor-GameplayCamerasEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Cameras/GameplayCameras/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/ChaosCloth/Binaries/Win64/UnrealEditor-ChaosCloth.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/ChaosCloth/Binaries/Win64/UnrealEditor-ChaosCloth.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/ChaosCloth/Binaries/Win64/UnrealEditor-ChaosClothEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/ChaosCloth/Binaries/Win64/UnrealEditor-ChaosClothEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/ChaosCloth/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/ChaosVD/Binaries/Win64/UnrealEditor-ChaosVD.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/ChaosVD/Binaries/Win64/UnrealEditor-ChaosVD.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/ChaosVD/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/CmdLinkServer/Binaries/Win64/UnrealEditor-CmdLinkServer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/CmdLinkServer/Binaries/Win64/UnrealEditor-CmdLinkServer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/CmdLinkServer/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Compression/OodleNetwork/Binaries/Win64/UnrealEditor-OodleNetworkHandlerComponent.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Compression/OodleNetwork/Binaries/Win64/UnrealEditor-OodleNetworkHandlerComponent.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Compression/OodleNetwork/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/AnimationSharing/Binaries/Win64/UnrealEditor-AnimationSharing.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/AnimationSharing/Binaries/Win64/UnrealEditor-AnimationSharing.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/AnimationSharing/Binaries/Win64/UnrealEditor-AnimationSharingEd.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/AnimationSharing/Binaries/Win64/UnrealEditor-AnimationSharingEd.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/AnimationSharing/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/CLionSourceCodeAccess/Binaries/Win64/UnrealEditor-CLionSourceCodeAccess.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/CLionSourceCodeAccess/Binaries/Win64/UnrealEditor-CLionSourceCodeAccess.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/CLionSourceCodeAccess/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/DumpGPUServices/Binaries/Win64/UnrealEditor-DumpGPUServices.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/DumpGPUServices/Binaries/Win64/UnrealEditor-DumpGPUServices.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/DumpGPUServices/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/GitSourceControl/Binaries/Win64/UnrealEditor-GitSourceControl.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/GitSourceControl/Binaries/Win64/UnrealEditor-GitSourceControl.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/GitSourceControl/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/N10XSourceCodeAccess/Binaries/Win64/UnrealEditor-N10XSourceCodeAccess.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/N10XSourceCodeAccess/Binaries/Win64/UnrealEditor-N10XSourceCodeAccess.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/N10XSourceCodeAccess/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PerforceSourceControl/Binaries/Win64/UnrealEditor-PerforceSourceControl.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PerforceSourceControl/Binaries/Win64/UnrealEditor-PerforceSourceControl.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PerforceSourceControl/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PixWinPlugin/Binaries/Win64/UnrealEditor-PixWinPlugin.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PixWinPlugin/Binaries/Win64/UnrealEditor-PixWinPlugin.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PixWinPlugin/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PlasticSourceControl/Binaries/Win64/UnrealEditor-PlasticSourceControl.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PlasticSourceControl/Binaries/Win64/UnrealEditor-PlasticSourceControl.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PlasticSourceControl/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PluginUtils/Binaries/Win64/UnrealEditor-PluginUtils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PluginUtils/Binaries/Win64/UnrealEditor-PluginUtils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PluginUtils/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PropertyAccessNode/Binaries/Win64/UnrealEditor-PropertyAccessNode.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PropertyAccessNode/Binaries/Win64/UnrealEditor-PropertyAccessNode.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PropertyAccessNode/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/RenderDocPlugin/Binaries/Win64/UnrealEditor-RenderDocPlugin.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/RenderDocPlugin/Binaries/Win64/UnrealEditor-RenderDocPlugin.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/RenderDocPlugin/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/RiderSourceCodeAccess/Binaries/Win64/UnrealEditor-RiderSourceCodeAccess.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/RiderSourceCodeAccess/Binaries/Win64/UnrealEditor-RiderSourceCodeAccess.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/RiderSourceCodeAccess/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/SubversionSourceControl/Binaries/Win64/UnrealEditor-SubversionSourceControl.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/SubversionSourceControl/Binaries/Win64/UnrealEditor-SubversionSourceControl.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/SubversionSourceControl/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/TextureFormatOodle/Binaries/Win64/UnrealEditor-TextureFormatOodle.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/TextureFormatOodle/Binaries/Win64/UnrealEditor-TextureFormatOodle.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/TextureFormatOodle/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/TraceDataFiltering/Binaries/Win64/UnrealEditor-TraceDataFiltering.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/TraceDataFiltering/Binaries/Win64/UnrealEditor-TraceDataFiltering.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/TraceDataFiltering/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/UObjectPlugin/Binaries/Win64/UnrealEditor-UObjectPlugin.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/UObjectPlugin/Binaries/Win64/UnrealEditor-UObjectPlugin.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/UObjectPlugin/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/VisualStudioCodeSourceCodeAccess/Binaries/Win64/UnrealEditor-VisualStudioCodeSourceCodeAccess.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/VisualStudioCodeSourceCodeAccess/Binaries/Win64/UnrealEditor-VisualStudioCodeSourceCodeAccess.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/VisualStudioCodeSourceCodeAccess/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/VisualStudioSourceCodeAccess/Binaries/Win64/UnrealEditor-VisualStudioSourceCodeAccess.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/VisualStudioSourceCodeAccess/Binaries/Win64/UnrealEditor-VisualStudioSourceCodeAccess.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/VisualStudioSourceCodeAccess/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/AssetManagerEditor/Binaries/Win64/UnrealEditor-AssetManagerEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/AssetManagerEditor/Binaries/Win64/UnrealEditor-AssetManagerEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/AssetManagerEditor/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/BlueprintHeaderView/Binaries/Win64/UnrealEditor-BlueprintHeaderView.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/BlueprintHeaderView/Binaries/Win64/UnrealEditor-BlueprintHeaderView.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/BlueprintHeaderView/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ChangelistReview/Binaries/Win64/UnrealEditor-ChangelistReview.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ChangelistReview/Binaries/Win64/UnrealEditor-ChangelistReview.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ChangelistReview/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserAssetDataSource/Binaries/Win64/UnrealEditor-ContentBrowserAssetDataSource.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserAssetDataSource/Binaries/Win64/UnrealEditor-ContentBrowserAssetDataSource.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserAssetDataSource/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserClassDataSource/Binaries/Win64/UnrealEditor-ContentBrowserClassDataSource.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserClassDataSource/Binaries/Win64/UnrealEditor-ContentBrowserClassDataSource.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserClassDataSource/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserFileDataSource/Binaries/Win64/UnrealEditor-ContentBrowserFileDataSource.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserFileDataSource/Binaries/Win64/UnrealEditor-ContentBrowserFileDataSource.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserFileDataSource/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/CryptoKeys/Binaries/Win64/UnrealEditor-CryptoKeys.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/CryptoKeys/Binaries/Win64/UnrealEditor-CryptoKeys.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/CryptoKeys/Binaries/Win64/UnrealEditor-CryptoKeysOpenSSL.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/CryptoKeys/Binaries/Win64/UnrealEditor-CryptoKeysOpenSSL.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/CryptoKeys/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/CurveEditorTools/Binaries/Win64/UnrealEditor-CurveEditorTools.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/CurveEditorTools/Binaries/Win64/UnrealEditor-CurveEditorTools.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/CurveEditorTools/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/DataValidation/Binaries/Win64/UnrealEditor-DataValidation.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/DataValidation/Binaries/Win64/UnrealEditor-DataValidation.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/DataValidation/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EditorDebugTools/Binaries/Win64/UnrealEditor-EditorDebugTools.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EditorDebugTools/Binaries/Win64/UnrealEditor-EditorDebugTools.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EditorDebugTools/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EditorScriptingUtilities/Binaries/Win64/UnrealEditor-EditorScriptingUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EditorScriptingUtilities/Binaries/Win64/UnrealEditor-EditorScriptingUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EditorScriptingUtilities/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EngineAssetDefinitions/Binaries/Win64/UnrealEditor-EngineAssetDefinitions.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EngineAssetDefinitions/Binaries/Win64/UnrealEditor-EngineAssetDefinitions.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EngineAssetDefinitions/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/FacialAnimation/Binaries/Win64/UnrealEditor-FacialAnimation.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/FacialAnimation/Binaries/Win64/UnrealEditor-FacialAnimation.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/FacialAnimation/Binaries/Win64/UnrealEditor-FacialAnimationEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/FacialAnimation/Binaries/Win64/UnrealEditor-FacialAnimationEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/FacialAnimation/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GameplayTagsEditor/Binaries/Win64/UnrealEditor-GameplayTagsEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GameplayTagsEditor/Binaries/Win64/UnrealEditor-GameplayTagsEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GameplayTagsEditor/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GeometryMode/Binaries/Win64/UnrealEditor-BspMode.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GeometryMode/Binaries/Win64/UnrealEditor-BspMode.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GeometryMode/Binaries/Win64/UnrealEditor-GeometryMode.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GeometryMode/Binaries/Win64/UnrealEditor-GeometryMode.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GeometryMode/Binaries/Win64/UnrealEditor-TextureAlignMode.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GeometryMode/Binaries/Win64/UnrealEditor-TextureAlignMode.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GeometryMode/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/Localization/PortableObjectFileDataSource/Binaries/Win64/UnrealEditor-PortableObjectFileDataSource.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/Localization/PortableObjectFileDataSource/Binaries/Win64/UnrealEditor-PortableObjectFileDataSource.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/Localization/PortableObjectFileDataSource/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MaterialAnalyzer/Binaries/Win64/UnrealEditor-MaterialAnalyzer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MaterialAnalyzer/Binaries/Win64/UnrealEditor-MaterialAnalyzer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MaterialAnalyzer/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MeshLODToolset/Binaries/Win64/UnrealEditor-MeshLODToolset.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MeshLODToolset/Binaries/Win64/UnrealEditor-MeshLODToolset.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MeshLODToolset/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MobileLauncherProfileWizard/Binaries/Win64/UnrealEditor-MobileLauncherProfileWizard.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MobileLauncherProfileWizard/Binaries/Win64/UnrealEditor-MobileLauncherProfileWizard.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MobileLauncherProfileWizard/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ModelingToolsEditorMode/Binaries/Win64/UnrealEditor-ModelingToolsEditorMode.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ModelingToolsEditorMode/Binaries/Win64/UnrealEditor-ModelingToolsEditorMode.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ModelingToolsEditorMode/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ObjectMixer/LightMixer/Binaries/Win64/UnrealEditor-LightMixer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ObjectMixer/LightMixer/Binaries/Win64/UnrealEditor-LightMixer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ObjectMixer/LightMixer/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ObjectMixer/ObjectMixer/Binaries/Win64/UnrealEditor-ObjectMixerEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ObjectMixer/ObjectMixer/Binaries/Win64/UnrealEditor-ObjectMixerEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ObjectMixer/ObjectMixer/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/PluginBrowser/Binaries/Win64/UnrealEditor-PluginBrowser.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/PluginBrowser/Binaries/Win64/UnrealEditor-PluginBrowser.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/PluginBrowser/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ProxyLODPlugin/Binaries/Win64/UnrealEditor-ProxyLODMeshReduction.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ProxyLODPlugin/Binaries/Win64/UnrealEditor-ProxyLODMeshReduction.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ProxyLODPlugin/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/SequencerAnimTools/Binaries/Win64/UnrealEditor-SequencerAnimTools.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/SequencerAnimTools/Binaries/Win64/UnrealEditor-SequencerAnimTools.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/SequencerAnimTools/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/SpeedTreeImporter/Binaries/Win64/UnrealEditor-SpeedTreeImporter.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/SpeedTreeImporter/Binaries/Win64/UnrealEditor-SpeedTreeImporter.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/SpeedTreeImporter/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/UVEditor/Binaries/Win64/UnrealEditor-UVEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/UVEditor/Binaries/Win64/UnrealEditor-UVEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/UVEditor/Binaries/Win64/UnrealEditor-UVEditorTools.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/UVEditor/Binaries/Win64/UnrealEditor-UVEditorTools.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/UVEditor/Binaries/Win64/UnrealEditor-UVEditorToolsEditorOnly.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/UVEditor/Binaries/Win64/UnrealEditor-UVEditorToolsEditorOnly.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/UVEditor/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/WorldPartitionHLODUtilities/Binaries/Win64/UnrealEditor-WorldPartitionHLODUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/WorldPartitionHLODUtilities/Binaries/Win64/UnrealEditor-WorldPartitionHLODUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/WorldPartitionHLODUtilities/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/EnhancedInput/Binaries/Win64/UnrealEditor-EnhancedInput.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/EnhancedInput/Binaries/Win64/UnrealEditor-EnhancedInput.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/EnhancedInput/Binaries/Win64/UnrealEditor-InputBlueprintNodes.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/EnhancedInput/Binaries/Win64/UnrealEditor-InputBlueprintNodes.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/EnhancedInput/Binaries/Win64/UnrealEditor-InputEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/EnhancedInput/Binaries/Win64/UnrealEditor-InputEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/EnhancedInput/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/DatasmithContent/Binaries/Win64/UnrealEditor-DatasmithContent.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/DatasmithContent/Binaries/Win64/UnrealEditor-DatasmithContent.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/DatasmithContent/Binaries/Win64/UnrealEditor-DatasmithContentEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/DatasmithContent/Binaries/Win64/UnrealEditor-DatasmithContentEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/DatasmithContent/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/GLTFExporter/Binaries/Win64/UnrealEditor-GLTFExporter.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/GLTFExporter/Binaries/Win64/UnrealEditor-GLTFExporter.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/GLTFExporter/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/VariantManagerContent/Binaries/Win64/UnrealEditor-VariantManagerContent.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/VariantManagerContent/Binaries/Win64/UnrealEditor-VariantManagerContent.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/VariantManagerContent/Binaries/Win64/UnrealEditor-VariantManagerContentEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/VariantManagerContent/Binaries/Win64/UnrealEditor-VariantManagerContentEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/VariantManagerContent/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/VariantManager/Binaries/Win64/UnrealEditor-VariantManager.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/VariantManager/Binaries/Win64/UnrealEditor-VariantManager.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/VariantManager/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/AutomationUtils/Binaries/Win64/UnrealEditor-AutomationUtils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/AutomationUtils/Binaries/Win64/UnrealEditor-AutomationUtils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/AutomationUtils/Binaries/Win64/UnrealEditor-AutomationUtilsEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/AutomationUtils/Binaries/Win64/UnrealEditor-AutomationUtilsEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/AutomationUtils/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/BackChannel/Binaries/Win64/UnrealEditor-BackChannel.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/BackChannel/Binaries/Win64/UnrealEditor-BackChannel.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/BackChannel/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosCaching/Binaries/Win64/UnrealEditor-ChaosCaching.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosCaching/Binaries/Win64/UnrealEditor-ChaosCaching.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosCaching/Binaries/Win64/UnrealEditor-ChaosCachingEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosCaching/Binaries/Win64/UnrealEditor-ChaosCachingEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosCaching/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosEditor/Binaries/Win64/UnrealEditor-FractureEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosEditor/Binaries/Win64/UnrealEditor-FractureEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosEditor/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosNiagara/Binaries/Win64/UnrealEditor-ChaosNiagara.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosNiagara/Binaries/Win64/UnrealEditor-ChaosNiagara.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosNiagara/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosSolverPlugin/Binaries/Win64/UnrealEditor-ChaosSolverEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosSolverPlugin/Binaries/Win64/UnrealEditor-ChaosSolverEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosSolverPlugin/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosUserDataPT/Binaries/Win64/UnrealEditor-ChaosUserDataPT.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosUserDataPT/Binaries/Win64/UnrealEditor-ChaosUserDataPT.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosUserDataPT/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/CharacterAI/Binaries/Win64/UnrealEditor-CharacterAI.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/CharacterAI/Binaries/Win64/UnrealEditor-CharacterAI.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/CharacterAI/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/CharacterFXEditor/BaseCharacterFXEditor/Binaries/Win64/UnrealEditor-BaseCharacterFXEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/CharacterFXEditor/BaseCharacterFXEditor/Binaries/Win64/UnrealEditor-BaseCharacterFXEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/CharacterFXEditor/BaseCharacterFXEditor/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Dataflow/Binaries/Win64/UnrealEditor-DataflowAssetTools.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Dataflow/Binaries/Win64/UnrealEditor-DataflowAssetTools.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Dataflow/Binaries/Win64/UnrealEditor-DataflowEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Dataflow/Binaries/Win64/UnrealEditor-DataflowEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Dataflow/Binaries/Win64/UnrealEditor-DataflowEnginePlugin.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Dataflow/Binaries/Win64/UnrealEditor-DataflowEnginePlugin.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Dataflow/Binaries/Win64/UnrealEditor-DataflowNodes.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Dataflow/Binaries/Win64/UnrealEditor-DataflowNodes.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Dataflow/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Fracture/Binaries/Win64/UnrealEditor-FractureEngine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Fracture/Binaries/Win64/UnrealEditor-FractureEngine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Fracture/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/FullBodyIK/Binaries/Win64/UnrealEditor-FullBodyIK.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/FullBodyIK/Binaries/Win64/UnrealEditor-FullBodyIK.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/FullBodyIK/Binaries/Win64/UnrealEditor-PBIK.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/FullBodyIK/Binaries/Win64/UnrealEditor-PBIK.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/FullBodyIK/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryCollectionPlugin/Binaries/Win64/UnrealEditor-GeometryCollectionEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryCollectionPlugin/Binaries/Win64/UnrealEditor-GeometryCollectionEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryCollectionPlugin/Binaries/Win64/UnrealEditor-GeometryCollectionNodes.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryCollectionPlugin/Binaries/Win64/UnrealEditor-GeometryCollectionNodes.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryCollectionPlugin/Binaries/Win64/UnrealEditor-GeometryCollectionSequencer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryCollectionPlugin/Binaries/Win64/UnrealEditor-GeometryCollectionSequencer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryCollectionPlugin/Binaries/Win64/UnrealEditor-GeometryCollectionTracks.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryCollectionPlugin/Binaries/Win64/UnrealEditor-GeometryCollectionTracks.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryCollectionPlugin/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryFlow/Binaries/Win64/UnrealEditor-GeometryFlowCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryFlow/Binaries/Win64/UnrealEditor-GeometryFlowCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryFlow/Binaries/Win64/UnrealEditor-GeometryFlowMeshProcessing.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryFlow/Binaries/Win64/UnrealEditor-GeometryFlowMeshProcessing.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryFlow/Binaries/Win64/UnrealEditor-GeometryFlowMeshProcessingEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryFlow/Binaries/Win64/UnrealEditor-GeometryFlowMeshProcessingEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryFlow/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/LocalizableMessage/Binaries/Win64/UnrealEditor-LocalizableMessage.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/LocalizableMessage/Binaries/Win64/UnrealEditor-LocalizableMessage.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/LocalizableMessage/Binaries/Win64/UnrealEditor-LocalizableMessageBlueprint.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/LocalizableMessage/Binaries/Win64/UnrealEditor-LocalizableMessageBlueprint.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/LocalizableMessage/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor-GeometryProcessingAdapters.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor-GeometryProcessingAdapters.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor-MeshModelingToolsEditorOnlyExp.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor-MeshModelingToolsEditorOnlyExp.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor-MeshModelingToolsExp.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor-MeshModelingToolsExp.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor-ModelingEditorUI.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor-ModelingEditorUI.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor-SkeletalMeshModifiers.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor-SkeletalMeshModifiers.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanProjectUtilities/Binaries/Win64/UnrealEditor-MetaHumanProjectUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanProjectUtilities/Binaries/Win64/UnrealEditor-MetaHumanProjectUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanProjectUtilities/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/OpenImageDenoise/Binaries/Win64/UnrealEditor-OpenImageDenoise.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/OpenImageDenoise/Binaries/Win64/UnrealEditor-OpenImageDenoise.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/OpenImageDenoise/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlanarCutPlugin/Binaries/Win64/UnrealEditor-PlanarCut.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlanarCutPlugin/Binaries/Win64/UnrealEditor-PlanarCut.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlanarCutPlugin/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlatformCrypto/Binaries/Win64/UnrealEditor-PlatformCrypto.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlatformCrypto/Binaries/Win64/UnrealEditor-PlatformCrypto.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlatformCrypto/Binaries/Win64/UnrealEditor-PlatformCryptoOpenSSL.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlatformCrypto/Binaries/Win64/UnrealEditor-PlatformCryptoOpenSSL.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlatformCrypto/Binaries/Win64/UnrealEditor-PlatformCryptoTypes.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlatformCrypto/Binaries/Win64/UnrealEditor-PlatformCryptoTypes.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlatformCrypto/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PythonScriptPlugin/Binaries/Win64/UnrealEditor-PythonScriptPlugin.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PythonScriptPlugin/Binaries/Win64/UnrealEditor-PythonScriptPlugin.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PythonScriptPlugin/Binaries/Win64/UnrealEditor-PythonScriptPluginPreload.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PythonScriptPlugin/Binaries/Win64/UnrealEditor-PythonScriptPluginPreload.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PythonScriptPlugin/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/SkeletalReduction/Binaries/Win64/UnrealEditor-SkeletalMeshReduction.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/SkeletalReduction/Binaries/Win64/UnrealEditor-SkeletalMeshReduction.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/SkeletalReduction/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/Binaries/Win64/UnrealEditor-StructUtils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/Binaries/Win64/UnrealEditor-StructUtils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/Binaries/Win64/UnrealEditor-StructUtilsEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/Binaries/Win64/UnrealEditor-StructUtilsEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/Binaries/Win64/UnrealEditor-StructUtilsEngine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/Binaries/Win64/UnrealEditor-StructUtilsEngine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/Binaries/Win64/UnrealEditor-StructUtilsNodes.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/Binaries/Win64/UnrealEditor-StructUtilsNodes.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/Binaries/Win64/UnrealEditor-StructUtilsTestSuite.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/Binaries/Win64/UnrealEditor-StructUtilsTestSuite.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StudioTelemetry/Binaries/Win64/UnrealEditor-AnalyticsHorde.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StudioTelemetry/Binaries/Win64/UnrealEditor-AnalyticsHorde.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StudioTelemetry/Binaries/Win64/UnrealEditor-AnalyticsLog.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StudioTelemetry/Binaries/Win64/UnrealEditor-AnalyticsLog.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StudioTelemetry/Binaries/Win64/UnrealEditor-StudioTelemetry.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StudioTelemetry/Binaries/Win64/UnrealEditor-StudioTelemetry.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StudioTelemetry/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ToolPresets/Binaries/Win64/UnrealEditor-ToolPresetAsset.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ToolPresets/Binaries/Win64/UnrealEditor-ToolPresetAsset.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ToolPresets/Binaries/Win64/UnrealEditor-ToolPresetEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ToolPresets/Binaries/Win64/UnrealEditor-ToolPresetEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ToolPresets/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/FX/NiagaraSimCaching/Binaries/Win64/UnrealEditor-NiagaraSimCaching.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/FX/NiagaraSimCaching/Binaries/Win64/UnrealEditor-NiagaraSimCaching.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/FX/NiagaraSimCaching/Binaries/Win64/UnrealEditor-NiagaraSimCachingEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/FX/NiagaraSimCaching/Binaries/Win64/UnrealEditor-NiagaraSimCachingEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/FX/NiagaraSimCaching/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-Niagara.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-Niagara.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraAnimNotifies.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraAnimNotifies.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraBlueprintNodes.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraBlueprintNodes.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraEditorWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraEditorWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraShader.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraShader.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraVertexFactories.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor-NiagaraVertexFactories.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/FastBuildController/Binaries/Win64/UnrealEditor-FastBuildController.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/FastBuildController/Binaries/Win64/UnrealEditor-FastBuildController.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/FastBuildController/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Importers/AlembicImporter/Binaries/Win64/UnrealEditor-AlembicImporter.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Importers/AlembicImporter/Binaries/Win64/UnrealEditor-AlembicImporter.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Importers/AlembicImporter/Binaries/Win64/UnrealEditor-AlembicLibrary.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Importers/AlembicImporter/Binaries/Win64/UnrealEditor-AlembicLibrary.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Importers/AlembicImporter/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Editor/Binaries/Win64/UnrealEditor-InterchangeEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Editor/Binaries/Win64/UnrealEditor-InterchangeEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Editor/Binaries/Win64/UnrealEditor-InterchangeEditorPipelines.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Editor/Binaries/Win64/UnrealEditor-InterchangeEditorPipelines.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Editor/Binaries/Win64/UnrealEditor-InterchangeEditorUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Editor/Binaries/Win64/UnrealEditor-InterchangeEditorUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Editor/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-GLTFCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-GLTFCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeCommon.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeCommon.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeCommonParser.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeCommonParser.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeDispatcher.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeDispatcher.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeExport.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeExport.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeFactoryNodes.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeFactoryNodes.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeFbxParser.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeFbxParser.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeImport.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeImport.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeMessages.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeMessages.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeNodes.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangeNodes.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangePipelines.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor-InterchangePipelines.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AndroidMedia/Binaries/Win64/UnrealEditor-AndroidMediaEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AndroidMedia/Binaries/Win64/UnrealEditor-AndroidMediaEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AndroidMedia/Binaries/Win64/UnrealEditor-AndroidMediaFactory.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AndroidMedia/Binaries/Win64/UnrealEditor-AndroidMediaFactory.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AndroidMedia/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AvfMedia/Binaries/Win64/UnrealEditor-AvfMediaEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AvfMedia/Binaries/Win64/UnrealEditor-AvfMediaEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AvfMedia/Binaries/Win64/UnrealEditor-AvfMediaFactory.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AvfMedia/Binaries/Win64/UnrealEditor-AvfMediaFactory.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AvfMedia/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-ExrReaderGpu.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-ExrReaderGpu.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-ImgMedia.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-ImgMedia.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-ImgMediaEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-ImgMediaEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-ImgMediaEngine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-ImgMediaEngine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-ImgMediaFactory.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-ImgMediaFactory.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-OpenExrWrapper.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor-OpenExrWrapper.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaCompositing/Binaries/Win64/UnrealEditor-MediaCompositing.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaCompositing/Binaries/Win64/UnrealEditor-MediaCompositing.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaCompositing/Binaries/Win64/UnrealEditor-MediaCompositingEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaCompositing/Binaries/Win64/UnrealEditor-MediaCompositingEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaCompositing/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaPlate/Binaries/Win64/UnrealEditor-MediaPlate.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaPlate/Binaries/Win64/UnrealEditor-MediaPlate.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaPlate/Binaries/Win64/UnrealEditor-MediaPlateEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaPlate/Binaries/Win64/UnrealEditor-MediaPlateEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaPlate/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaPlayerEditor/Binaries/Win64/UnrealEditor-MediaPlayerEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaPlayerEditor/Binaries/Win64/UnrealEditor-MediaPlayerEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaPlayerEditor/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WebMMedia/Binaries/Win64/UnrealEditor-WebMMedia.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WebMMedia/Binaries/Win64/UnrealEditor-WebMMedia.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WebMMedia/Binaries/Win64/UnrealEditor-WebMMediaEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WebMMedia/Binaries/Win64/UnrealEditor-WebMMediaEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WebMMedia/Binaries/Win64/UnrealEditor-WebMMediaFactory.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WebMMedia/Binaries/Win64/UnrealEditor-WebMMediaFactory.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WebMMedia/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WmfMedia/Binaries/Win64/UnrealEditor-WmfMedia.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WmfMedia/Binaries/Win64/UnrealEditor-WmfMedia.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WmfMedia/Binaries/Win64/UnrealEditor-WmfMediaEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WmfMedia/Binaries/Win64/UnrealEditor-WmfMediaEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WmfMedia/Binaries/Win64/UnrealEditor-WmfMediaFactory.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WmfMedia/Binaries/Win64/UnrealEditor-WmfMediaFactory.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WmfMedia/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/MeshPainting/Binaries/Win64/UnrealEditor-MeshPaintEditorMode.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/MeshPainting/Binaries/Win64/UnrealEditor-MeshPaintEditorMode.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/MeshPainting/Binaries/Win64/UnrealEditor-MeshPaintingToolset.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/MeshPainting/Binaries/Win64/UnrealEditor-MeshPaintingToolset.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/MeshPainting/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Messaging/TcpMessaging/Binaries/Win64/UnrealEditor-TcpMessaging.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Messaging/TcpMessaging/Binaries/Win64/UnrealEditor-TcpMessaging.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Messaging/TcpMessaging/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Messaging/UdpMessaging/Binaries/Win64/UnrealEditor-UdpMessaging.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Messaging/UdpMessaging/Binaries/Win64/UnrealEditor-UdpMessaging.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Messaging/UdpMessaging/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/ActorSequence/Binaries/Win64/UnrealEditor-ActorSequence.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/ActorSequence/Binaries/Win64/UnrealEditor-ActorSequence.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/ActorSequence/Binaries/Win64/UnrealEditor-ActorSequenceEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/ActorSequence/Binaries/Win64/UnrealEditor-ActorSequenceEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/ActorSequence/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/LevelSequenceEditor/Binaries/Win64/UnrealEditor-LevelSequenceEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/LevelSequenceEditor/Binaries/Win64/UnrealEditor-LevelSequenceEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/LevelSequenceEditor/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/SequencerScripting/Binaries/Win64/UnrealEditor-SequencerScripting.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/SequencerScripting/Binaries/Win64/UnrealEditor-SequencerScripting.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/SequencerScripting/Binaries/Win64/UnrealEditor-SequencerScriptingEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/SequencerScripting/Binaries/Win64/UnrealEditor-SequencerScriptingEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/SequencerScripting/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/TemplateSequence/Binaries/Win64/UnrealEditor-TemplateSequence.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/TemplateSequence/Binaries/Win64/UnrealEditor-TemplateSequence.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/TemplateSequence/Binaries/Win64/UnrealEditor-TemplateSequenceEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/TemplateSequence/Binaries/Win64/UnrealEditor-TemplateSequenceEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/TemplateSequence/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineBase/Binaries/Win64/UnrealEditor-OnlineBase.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineBase/Binaries/Win64/UnrealEditor-OnlineBase.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineBase/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineServices/Binaries/Win64/UnrealEditor-OnlineServicesCommon.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineServices/Binaries/Win64/UnrealEditor-OnlineServicesCommon.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineServices/Binaries/Win64/UnrealEditor-OnlineServicesCommonEngineUtils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineServices/Binaries/Win64/UnrealEditor-OnlineServicesCommonEngineUtils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineServices/Binaries/Win64/UnrealEditor-OnlineServicesInterface.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineServices/Binaries/Win64/UnrealEditor-OnlineServicesInterface.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineServices/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystemNull/Binaries/Win64/UnrealEditor-OnlineSubsystemNull.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystemNull/Binaries/Win64/UnrealEditor-OnlineSubsystemNull.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystemNull/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystemUtils/Binaries/Win64/UnrealEditor-OnlineBlueprintSupport.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystemUtils/Binaries/Win64/UnrealEditor-OnlineBlueprintSupport.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystemUtils/Binaries/Win64/UnrealEditor-OnlineSubsystemUtils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystemUtils/Binaries/Win64/UnrealEditor-OnlineSubsystemUtils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystemUtils/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystem/Binaries/Win64/UnrealEditor-OnlineSubsystem.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystem/Binaries/Win64/UnrealEditor-OnlineSubsystem.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystem/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Portal/LauncherChunkInstaller/Binaries/Win64/UnrealEditor-LauncherChunkInstaller.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Portal/LauncherChunkInstaller/Binaries/Win64/UnrealEditor-LauncherChunkInstaller.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Portal/LauncherChunkInstaller/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/RenderGraphInsights/Binaries/Win64/UnrealEditor-RenderGraphInsights.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/RenderGraphInsights/Binaries/Win64/UnrealEditor-RenderGraphInsights.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/RenderGraphInsights/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ActorLayerUtilities/Binaries/Win64/UnrealEditor-ActorLayerUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ActorLayerUtilities/Binaries/Win64/UnrealEditor-ActorLayerUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ActorLayerUtilities/Binaries/Win64/UnrealEditor-ActorLayerUtilitiesEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ActorLayerUtilities/Binaries/Win64/UnrealEditor-ActorLayerUtilitiesEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ActorLayerUtilities/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidDeviceProfileSelector/Binaries/Win64/UnrealEditor-AndroidDeviceProfileCommandlets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidDeviceProfileSelector/Binaries/Win64/UnrealEditor-AndroidDeviceProfileCommandlets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidDeviceProfileSelector/Binaries/Win64/UnrealEditor-AndroidDeviceProfileSelector.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidDeviceProfileSelector/Binaries/Win64/UnrealEditor-AndroidDeviceProfileSelector.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidDeviceProfileSelector/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidFileServer/Binaries/Win64/UnrealEditor-AndroidFileServer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidFileServer/Binaries/Win64/UnrealEditor-AndroidFileServer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidFileServer/Binaries/Win64/UnrealEditor-AndroidFileServerEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidFileServer/Binaries/Win64/UnrealEditor-AndroidFileServerEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidFileServer/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidPermission/Binaries/Win64/UnrealEditor-AndroidPermission.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidPermission/Binaries/Win64/UnrealEditor-AndroidPermission.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidPermission/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AppleImageUtils/Binaries/Win64/UnrealEditor-AppleImageUtils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AppleImageUtils/Binaries/Win64/UnrealEditor-AppleImageUtils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AppleImageUtils/Binaries/Win64/UnrealEditor-AppleImageUtilsBlueprintSupport.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AppleImageUtils/Binaries/Win64/UnrealEditor-AppleImageUtilsBlueprintSupport.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AppleImageUtils/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ArchVisCharacter/Binaries/Win64/UnrealEditor-ArchVisCharacter.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ArchVisCharacter/Binaries/Win64/UnrealEditor-ArchVisCharacter.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ArchVisCharacter/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AssetTags/Binaries/Win64/UnrealEditor-AssetTags.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AssetTags/Binaries/Win64/UnrealEditor-AssetTags.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AssetTags/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioCapture/Binaries/Win64/UnrealEditor-AudioCapture.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioCapture/Binaries/Win64/UnrealEditor-AudioCapture.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioCapture/Binaries/Win64/UnrealEditor-AudioCaptureEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioCapture/Binaries/Win64/UnrealEditor-AudioCaptureEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioCapture/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioSynesthesia/Binaries/Win64/UnrealEditor-AudioSynesthesia.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioSynesthesia/Binaries/Win64/UnrealEditor-AudioSynesthesia.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioSynesthesia/Binaries/Win64/UnrealEditor-AudioSynesthesiaCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioSynesthesia/Binaries/Win64/UnrealEditor-AudioSynesthesiaCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioSynesthesia/Binaries/Win64/UnrealEditor-AudioSynesthesiaEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioSynesthesia/Binaries/Win64/UnrealEditor-AudioSynesthesiaEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioSynesthesia/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioWidgets/Binaries/Win64/UnrealEditor-AudioWidgets.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioWidgets/Binaries/Win64/UnrealEditor-AudioWidgets.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioWidgets/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/CableComponent/Binaries/Win64/UnrealEditor-CableComponent.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/CableComponent/Binaries/Win64/UnrealEditor-CableComponent.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/CableComponent/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ChunkDownloader/Binaries/Win64/UnrealEditor-ChunkDownloader.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ChunkDownloader/Binaries/Win64/UnrealEditor-ChunkDownloader.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ChunkDownloader/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/CustomMeshComponent/Binaries/Win64/UnrealEditor-CustomMeshComponent.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/CustomMeshComponent/Binaries/Win64/UnrealEditor-CustomMeshComponent.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/CustomMeshComponent/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ExampleDeviceProfileSelector/Binaries/Win64/UnrealEditor-ExampleDeviceProfileSelector.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ExampleDeviceProfileSelector/Binaries/Win64/UnrealEditor-ExampleDeviceProfileSelector.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ExampleDeviceProfileSelector/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/Binaries/Win64/UnrealEditor-GeometryCache.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/Binaries/Win64/UnrealEditor-GeometryCache.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/Binaries/Win64/UnrealEditor-GeometryCacheEd.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/Binaries/Win64/UnrealEditor-GeometryCacheEd.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/Binaries/Win64/UnrealEditor-GeometryCacheSequencer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/Binaries/Win64/UnrealEditor-GeometryCacheSequencer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/Binaries/Win64/UnrealEditor-GeometryCacheStreamer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/Binaries/Win64/UnrealEditor-GeometryCacheStreamer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/Binaries/Win64/UnrealEditor-GeometryCacheTracks.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/Binaries/Win64/UnrealEditor-GeometryCacheTracks.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryProcessing/Binaries/Win64/UnrealEditor-DynamicMesh.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryProcessing/Binaries/Win64/UnrealEditor-DynamicMesh.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryProcessing/Binaries/Win64/UnrealEditor-GeometryAlgorithms.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryProcessing/Binaries/Win64/UnrealEditor-GeometryAlgorithms.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryProcessing/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GooglePAD/Binaries/Win64/UnrealEditor-GooglePAD.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GooglePAD/Binaries/Win64/UnrealEditor-GooglePAD.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GooglePAD/Binaries/Win64/UnrealEditor-GooglePADEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GooglePAD/Binaries/Win64/UnrealEditor-GooglePADEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GooglePAD/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/InputDebugging/Binaries/Win64/UnrealEditor-InputDebugging.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/InputDebugging/Binaries/Win64/UnrealEditor-InputDebugging.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/InputDebugging/Binaries/Win64/UnrealEditor-InputDebuggingEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/InputDebugging/Binaries/Win64/UnrealEditor-InputDebuggingEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/InputDebugging/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/LocationServicesBPLibrary/Binaries/Win64/UnrealEditor-LocationServicesBPLibrary.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/LocationServicesBPLibrary/Binaries/Win64/UnrealEditor-LocationServicesBPLibrary.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/LocationServicesBPLibrary/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-MeshModelingTools.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-MeshModelingTools.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-MeshModelingToolsEditorOnly.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-MeshModelingToolsEditorOnly.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-ModelingComponents.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-ModelingComponents.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-ModelingComponentsEditorOnly.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-ModelingComponentsEditorOnly.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-ModelingOperators.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-ModelingOperators.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-ModelingOperatorsEditorOnly.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor-ModelingOperatorsEditorOnly.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundEngine.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundEngine.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundEngineTest.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundEngineTest.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundFrontend.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundFrontend.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundGenerator.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundGenerator.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundGraphCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundGraphCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundStandardNodes.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor-MetasoundStandardNodes.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MobilePatchingUtils/Binaries/Win64/UnrealEditor-MobilePatchingUtils.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MobilePatchingUtils/Binaries/Win64/UnrealEditor-MobilePatchingUtils.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MobilePatchingUtils/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MsQuic/Binaries/Win64/UnrealEditor-MsQuicRuntime.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MsQuic/Binaries/Win64/UnrealEditor-MsQuicRuntime.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MsQuic/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ProceduralMeshComponent/Binaries/Win64/UnrealEditor-ProceduralMeshComponent.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ProceduralMeshComponent/Binaries/Win64/UnrealEditor-ProceduralMeshComponent.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ProceduralMeshComponent/Binaries/Win64/UnrealEditor-ProceduralMeshComponentEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ProceduralMeshComponent/Binaries/Win64/UnrealEditor-ProceduralMeshComponentEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ProceduralMeshComponent/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/PropertyAccess/Binaries/Win64/UnrealEditor-PropertyAccessEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/PropertyAccess/Binaries/Win64/UnrealEditor-PropertyAccessEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/PropertyAccess/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ResonanceAudio/Binaries/Win64/UnrealEditor-ResonanceAudio.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ResonanceAudio/Binaries/Win64/UnrealEditor-ResonanceAudio.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ResonanceAudio/Binaries/Win64/UnrealEditor-ResonanceAudioEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ResonanceAudio/Binaries/Win64/UnrealEditor-ResonanceAudioEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ResonanceAudio/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/RigVM/Binaries/Win64/UnrealEditor-RigVM.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/RigVM/Binaries/Win64/UnrealEditor-RigVM.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/RigVM/Binaries/Win64/UnrealEditor-RigVMDeveloper.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/RigVM/Binaries/Win64/UnrealEditor-RigVMDeveloper.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/RigVM/Binaries/Win64/UnrealEditor-RigVMEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/RigVM/Binaries/Win64/UnrealEditor-RigVMEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/RigVM/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/SignificanceManager/Binaries/Win64/UnrealEditor-SignificanceManager.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/SignificanceManager/Binaries/Win64/UnrealEditor-SignificanceManager.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/SignificanceManager/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/SoundFields/Binaries/Win64/UnrealEditor-SoundFields.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/SoundFields/Binaries/Win64/UnrealEditor-SoundFields.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/SoundFields/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Synthesis/Binaries/Win64/UnrealEditor-Synthesis.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Synthesis/Binaries/Win64/UnrealEditor-Synthesis.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Synthesis/Binaries/Win64/UnrealEditor-SynthesisEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Synthesis/Binaries/Win64/UnrealEditor-SynthesisEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Synthesis/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WaveTable/Binaries/Win64/UnrealEditor-WaveTable.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WaveTable/Binaries/Win64/UnrealEditor-WaveTable.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WaveTable/Binaries/Win64/UnrealEditor-WaveTableEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WaveTable/Binaries/Win64/UnrealEditor-WaveTableEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WaveTable/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WebMMoviePlayer/Binaries/Win64/UnrealEditor-WebMMoviePlayer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WebMMoviePlayer/Binaries/Win64/UnrealEditor-WebMMoviePlayer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WebMMoviePlayer/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WindowsDeviceProfileSelector/Binaries/Win64/UnrealEditor-WindowsDeviceProfileSelector.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WindowsDeviceProfileSelector/Binaries/Win64/UnrealEditor-WindowsDeviceProfileSelector.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WindowsDeviceProfileSelector/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WindowsMoviePlayer/Binaries/Win64/UnrealEditor-WindowsMoviePlayer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WindowsMoviePlayer/Binaries/Win64/UnrealEditor-WindowsMoviePlayer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WindowsMoviePlayer/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Windows/XInputDevice/Binaries/Win64/UnrealEditor-XInputDevice.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Windows/XInputDevice/Binaries/Win64/UnrealEditor-XInputDevice.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Windows/XInputDevice/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/Tests/InterchangeTests/Binaries/Win64/UnrealEditor-InterchangeTestEditor.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Tests/InterchangeTests/Binaries/Win64/UnrealEditor-InterchangeTestEditor.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Tests/InterchangeTests/Binaries/Win64/UnrealEditor-InterchangeTests.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Tests/InterchangeTests/Binaries/Win64/UnrealEditor-InterchangeTests.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Tests/InterchangeTests/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/TraceUtilities/Binaries/Win64/UnrealEditor-EditorTraceUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/TraceUtilities/Binaries/Win64/UnrealEditor-EditorTraceUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/TraceUtilities/Binaries/Win64/UnrealEditor-TraceUtilities.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/TraceUtilities/Binaries/Win64/UnrealEditor-TraceUtilities.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/TraceUtilities/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-CacheTrackRecorder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-CacheTrackRecorder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakeMovieScene.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakeMovieScene.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakeRecorder.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakeRecorder.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakeRecorderSources.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakeRecorderSources.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakeSequencer.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakeSequencer.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakeTrackRecorders.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakeTrackRecorders.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakesCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor-TakesCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/WorldMetrics/Binaries/Win64/UnrealEditor-CsvMetrics.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/WorldMetrics/Binaries/Win64/UnrealEditor-CsvMetrics.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/WorldMetrics/Binaries/Win64/UnrealEditor-WorldMetricsCore.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/WorldMetrics/Binaries/Win64/UnrealEditor-WorldMetricsCore.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/WorldMetrics/Binaries/Win64/UnrealEditor-WorldMetricsTest.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/WorldMetrics/Binaries/Win64/UnrealEditor-WorldMetricsTest.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/WorldMetrics/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, - { - "Path": "$(EngineDir)/Plugins/XGEController/Binaries/Win64/UnrealEditor-XGEController.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/XGEController/Binaries/Win64/UnrealEditor-XGEController.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/XGEController/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - } - ], - "RuntimeDependencies": [ - { - "Path": "$(ProjectDir)/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.dll", - "Type": "NonUFS" - }, - { - "Path": "$(ProjectDir)/Plugins/newton/newton.uplugin", - "Type": "UFS" - }, - { - "Path": "$(ProjectDir)/UnrealNewtonProject1.uproject", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/DbgHelp/dbghelp.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/FreeImage/Win64/FreeImage.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/MsQuic/v220/win64/msquic.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Ogg/Win64/VS2015/libogg_64.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_asyncio.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_bz2.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_ctypes.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_ctypes_test.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_decimal.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_elementtree.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_hashlib.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_lzma.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_msi.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_multiprocessing.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_overlapped.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_queue.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_socket.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_sqlite3.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_ssl.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_testbuffer.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_testcapi.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_testconsole.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_testimportmultiple.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_testinternalcapi.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_testmultiphase.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_tkinter.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_uuid.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/_zoneinfo.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/libcrypto-3.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/libffi-8.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/libssl-3.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/py.ico", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/pyc.ico", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/pyd.ico", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/pyexpat.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/python_lib.cat", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/python_tools.cat", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/select.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/sqlite3.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/tcl86t.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/tk86t.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/unicodedata.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/DLLs/winsound.pyd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/LICENSE.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/__future__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/__hello__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/__phello__/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/__phello__/ham/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/__phello__/ham/eggs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/__phello__/spam.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_aix_support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_bootsubprocess.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_collections_abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_compat_pickle.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_compression.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_markupbase.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_osx_support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_py_abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_pydecimal.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_pyio.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_sitebuiltins.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_strptime.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_threading_local.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/_weakrefset.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/aifc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/antigravity.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/argparse.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ast.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asynchat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/base_events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/base_futures.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/base_subprocess.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/base_tasks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/constants.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/coroutines.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/exceptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/format_helpers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/futures.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/locks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/log.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/mixins.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/proactor_events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/protocols.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/queues.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/runners.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/selector_events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/sslproto.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/staggered.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/streams.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/subprocess.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/taskgroups.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/tasks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/threads.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/timeouts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/transports.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/trsock.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/unix_events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/windows_events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncio/windows_utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/asyncore.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/base64.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/bdb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/bisect.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/bz2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/cProfile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/calendar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/cgi.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/cgitb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/chunk.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/cmd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/code.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/codecs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/codeop.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/collections/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/collections/abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/colorsys.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/compileall.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/concurrent/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/concurrent/futures/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/concurrent/futures/_base.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/concurrent/futures/process.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/concurrent/futures/thread.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/configparser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/contextlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/contextvars.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/copy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/copyreg.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/crypt.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/csv.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/_aix.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/_endian.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/macholib/README.ctypes", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/macholib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/macholib/dyld.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/macholib/dylib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/macholib/fetch_macholib", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/macholib/fetch_macholib.bat", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/macholib/framework.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_anon.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_array_in_pointer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_arrays.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_as_parameter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_bitfields.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_buffers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_bytes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_byteswap.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_callbacks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_cast.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_cfuncs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_checkretval.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_delattr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_errno.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_find.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_frombuffer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_funcptr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_functions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_incomplete.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_init.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_internals.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_keeprefs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_libc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_loading.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_macholib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_memfunctions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_numbers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_objects.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_parameters.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_pep3118.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_pickling.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_pointers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_prototypes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_python_api.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_random_things.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_refcounts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_repr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_returnfuncptrs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_simplesubclasses.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_sizes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_slicing.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_stringptr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_strings.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_struct_fields.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_structures.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_unaligned_structures.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_unicode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_values.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_varsize_struct.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_win32.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/test/test_wintypes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ctypes/wintypes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/curses/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/curses/ascii.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/curses/has_key.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/curses/panel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/curses/textpad.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/dataclasses.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/datetime.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/dbm/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/dbm/dumb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/dbm/gnu.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/dbm/ndbm.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/decimal.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/difflib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/dis.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/README", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/_msvccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/archive_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/bcppcompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/ccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/cmd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/bdist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/bdist_dumb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/bdist_rpm.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/build.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/build_clib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/build_ext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/build_py.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/build_scripts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/check.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/clean.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/command_template", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/config.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/install.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/install_data.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/install_egg_info.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/install_headers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/install_lib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/install_scripts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/register.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/sdist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/command/upload.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/config.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/core.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/cygwinccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/debug.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/dep_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/dir_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/dist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/errors.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/extension.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/fancy_getopt.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/file_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/filelist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/log.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/msvc9compiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/msvccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/spawn.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/sysconfig.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/Setup.sample", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/includetest.rst", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_archive_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_bdist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_bdist_dumb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_bdist_rpm.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_build.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_build_clib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_build_ext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_build_py.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_build_scripts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_check.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_clean.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_cmd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_config.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_config_cmd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_core.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_cygwinccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_dep_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_dir_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_dist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_extension.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_file_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_filelist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_install.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_install_data.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_install_headers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_install_lib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_install_scripts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_log.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_msvc9compiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_msvccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_register.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_sdist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_spawn.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_sysconfig.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_text_file.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_unixccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_upload.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/tests/test_versionpredicate.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/text_file.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/unixccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/distutils/versionpredicate.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/doctest.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/_encoded_words.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/_header_value_parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/_parseaddr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/_policybase.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/architecture.rst", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/base64mime.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/charset.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/contentmanager.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/encoders.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/errors.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/feedparser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/generator.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/header.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/headerregistry.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/iterators.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/message.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/mime/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/mime/application.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/mime/audio.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/mime/base.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/mime/image.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/mime/message.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/mime/multipart.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/mime/nonmultipart.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/mime/text.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/policy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/quoprimime.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/email/utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/aliases.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/ascii.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/base64_codec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/big5.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/big5hkscs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/bz2_codec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/charmap.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp037.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1006.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1026.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1125.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1140.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1250.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1251.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1252.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1253.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1254.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1255.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1256.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1257.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp1258.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp273.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp424.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp437.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp500.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp720.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp737.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp775.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp850.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp852.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp855.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp856.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp857.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp858.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp860.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp861.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp862.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp863.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp864.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp865.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp866.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp869.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp874.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp875.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp932.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp949.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/cp950.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/euc_jis_2004.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/euc_jisx0213.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/euc_jp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/euc_kr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/gb18030.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/gb2312.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/gbk.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/hex_codec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/hp_roman8.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/hz.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/idna.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso2022_jp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso2022_jp_1.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso2022_jp_2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso2022_jp_2004.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso2022_jp_3.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso2022_jp_ext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso2022_kr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_1.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_10.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_11.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_13.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_14.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_15.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_16.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_3.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_4.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_5.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_6.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_7.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_8.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/iso8859_9.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/johab.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/koi8_r.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/koi8_t.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/koi8_u.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/kz1048.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/latin_1.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/mac_arabic.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/mac_croatian.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/mac_cyrillic.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/mac_farsi.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/mac_greek.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/mac_iceland.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/mac_latin2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/mac_roman.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/mac_romanian.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/mac_turkish.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/mbcs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/oem.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/palmos.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/ptcp154.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/punycode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/quopri_codec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/raw_unicode_escape.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/rot_13.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/shift_jis.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/shift_jis_2004.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/shift_jisx0213.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/tis_620.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/undefined.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/unicode_escape.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/utf_16.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/utf_16_be.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/utf_16_le.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/utf_32.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/utf_32_be.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/utf_32_le.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/utf_7.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/utf_8.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/utf_8_sig.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/uu_codec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/encodings/zlib_codec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ensurepip/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ensurepip/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ensurepip/_bundled/pip-24.0-py3-none-any.whl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ensurepip/_bundled/setuptools-65.5.0-py3-none-any.whl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ensurepip/_uninstall.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/enum.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/filecmp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/fileinput.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/fnmatch.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/fractions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ftplib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/functools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/genericpath.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/getopt.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/getpass.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/gettext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/glob.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/graphlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/gzip.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/hashlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/heapq.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/hmac.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/html/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/html/entities.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/html/parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/http/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/http/client.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/http/cookiejar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/http/cookies.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/http/server.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/CREDITS.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/ChangeLog", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/HISTORY.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/README.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/folder.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/idle.ico", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/idle_16.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/idle_16.png", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/idle_256.png", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/idle_32.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/idle_32.png", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/idle_48.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/idle_48.png", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/minusnode.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/openfolder.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/plusnode.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/python.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/Icons/tk.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/NEWS2x.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/News3.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/README.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/TODO.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/autocomplete.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/autocomplete_w.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/autoexpand.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/browser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/calltip.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/calltip_w.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/codecontext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/colorizer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/config-extensions.def", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/config-highlight.def", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/config-keys.def", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/config-main.def", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/config.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/config_key.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/configdialog.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/debugger.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/debugger_r.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/debugobj.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/debugobj_r.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/delegator.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/dynoption.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/editor.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/extend.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/filelist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/format.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/grep.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/help.html", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/help.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/help_about.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/history.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/hyperparser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle.bat", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle.pyw", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/README.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/example_noext", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/example_stub.pyi", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/htest.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/mock_idle.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/mock_tk.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/template.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_autocomplete.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_autocomplete_w.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_autoexpand.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_browser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_calltip.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_calltip_w.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_codecontext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_colorizer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_config.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_config_key.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_configdialog.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_debugger.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_debugger_r.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_debugobj.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_debugobj_r.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_delegator.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_editmenu.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_editor.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_filelist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_format.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_grep.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_help.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_help_about.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_history.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_hyperparser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_iomenu.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_macosx.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_mainmenu.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_multicall.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_outwin.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_parenmatch.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_pathbrowser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_percolator.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_pyparse.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_pyshell.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_query.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_redirector.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_replace.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_rpc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_run.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_runscript.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_scrolledlist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_search.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_searchbase.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_searchengine.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_sidebar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_squeezer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_stackviewer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_statusbar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_text.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_textview.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_tooltip.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_tree.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_undo.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_warning.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_window.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_zoomheight.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/test_zzdummy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/idle_test/tkinter_testing_utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/iomenu.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/macosx.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/mainmenu.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/multicall.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/outwin.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/parenmatch.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/pathbrowser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/percolator.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/pyparse.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/pyshell.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/query.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/redirector.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/replace.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/rpc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/run.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/runscript.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/scrolledlist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/search.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/searchbase.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/searchengine.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/sidebar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/squeezer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/stackviewer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/statusbar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/textview.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/tooltip.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/tree.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/undo.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/window.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/zoomheight.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/idlelib/zzdummy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/imaplib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/imghdr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/imp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/_abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/_bootstrap.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/_bootstrap_external.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/machinery.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/metadata/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/metadata/_adapters.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/metadata/_collections.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/metadata/_functools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/metadata/_itertools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/metadata/_meta.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/metadata/_text.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/readers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/resources/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/resources/_adapters.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/resources/_common.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/resources/_itertools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/resources/_legacy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/resources/abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/resources/readers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/resources/simple.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/simple.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/importlib/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/inspect.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/io.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ipaddress.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/json/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/json/decoder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/json/encoder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/json/scanner.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/json/tool.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/keyword.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/Grammar.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/PatternGrammar.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/btm_matcher.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/btm_utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixer_base.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixer_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_apply.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_asserts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_basestring.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_buffer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_dict.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_except.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_exec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_execfile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_exitfunc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_filter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_funcattrs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_future.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_getcwdu.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_has_key.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_idioms.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_import.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_imports.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_imports2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_input.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_intern.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_isinstance.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_itertools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_itertools_imports.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_long.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_map.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_metaclass.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_methodattrs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_ne.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_next.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_nonzero.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_numliterals.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_operator.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_paren.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_print.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_raise.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_raw_input.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_reduce.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_reload.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_renames.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_repr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_set_literal.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_standarderror.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_sys_exc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_throw.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_tuple_params.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_types.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_unicode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_urllib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_ws_comma.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_xrange.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_xreadlines.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/fixes/fix_zip.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/main.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/patcomp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/pgen2/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/pgen2/conv.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/pgen2/driver.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/pgen2/grammar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/pgen2/literals.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/pgen2/parse.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/pgen2/pgen.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/pgen2/token.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/pgen2/tokenize.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/pygram.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/pytree.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/refactor.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/README", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/bom.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/crlf.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/different_encoding.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/false_encoding.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/fixers/bad_order.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/fixers/myfixes/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/fixers/myfixes/fix_last.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/fixers/myfixes/fix_preorder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/fixers/no_fixer_cls.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/fixers/parrot_example.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/infinite_recursion.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/py2_test_grammar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/data/py3_test_grammar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/pytree_idempotency.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/test_all_fixers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/test_fixers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/test_main.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/test_parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/test_pytree.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/test_refactor.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lib2to3/tests/test_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/linecache.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/locale.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/logging/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/logging/config.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/logging/handlers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/lzma.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/mailbox.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/mailcap.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/mimetypes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/modulefinder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/msilib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/msilib/schema.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/msilib/sequence.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/msilib/text.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/connection.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/context.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/dummy/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/dummy/connection.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/forkserver.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/heap.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/managers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/pool.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/popen_fork.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/popen_forkserver.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/popen_spawn_posix.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/popen_spawn_win32.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/process.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/queues.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/reduction.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/resource_sharer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/resource_tracker.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/shared_memory.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/sharedctypes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/spawn.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/synchronize.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/multiprocessing/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/netrc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/nntplib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ntpath.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/nturl2path.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/numbers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/opcode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/operator.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/optparse.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/os.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pathlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pdb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pickle.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pickletools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pipes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pkgutil.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/platform.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/plistlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/poplib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/posixpath.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pprint.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/profile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pstats.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pty.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/py_compile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pyclbr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pydoc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pydoc_data/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pydoc_data/_pydoc.css", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/pydoc_data/topics.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/queue.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/quopri.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/random.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/re/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/re/_casefix.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/re/_compiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/re/_constants.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/re/_parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/reprlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/rlcompleter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/runpy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/sched.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/secrets.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/selectors.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/shelve.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/shlex.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/shutil.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/signal.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/README.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/_distutils_hack/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/_distutils_hack/override.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/distutils-precedence.pth", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip-24.0.dist-info/AUTHORS.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip-24.0.dist-info/INSTALLER", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip-24.0.dist-info/LICENSE.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip-24.0.dist-info/METADATA", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip-24.0.dist-info/RECORD", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip-24.0.dist-info/REQUESTED", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip-24.0.dist-info/WHEEL", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip-24.0.dist-info/entry_points.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip-24.0.dist-info/top_level.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/__pip-runner__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/build_env.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cache.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/autocompletion.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/base_command.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/cmdoptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/command_context.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/main.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/main_parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/progress_bars.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/req_command.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/spinners.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/cli/status_codes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/cache.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/check.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/completion.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/configuration.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/debug.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/download.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/freeze.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/hash.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/help.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/index.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/inspect.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/install.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/list.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/search.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/show.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/uninstall.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/commands/wheel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/configuration.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/distributions/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/distributions/base.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/distributions/installed.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/distributions/sdist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/distributions/wheel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/exceptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/index/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/index/collector.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/index/package_finder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/index/sources.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/locations/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/locations/_distutils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/locations/_sysconfig.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/locations/base.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/main.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/metadata/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/metadata/_json.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/metadata/base.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/metadata/pkg_resources.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/candidate.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/direct_url.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/format_control.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/index.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/installation_report.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/link.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/scheme.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/search_scope.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/selection_prefs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/target_python.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/models/wheel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/network/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/network/auth.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/network/cache.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/network/download.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/network/lazy_wheel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/network/session.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/network/utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/network/xmlrpc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/build/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/build/build_tracker.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/build/metadata.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/build/wheel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/check.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/freeze.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/install/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/install/wheel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/operations/prepare.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/pyproject.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/req/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/req/constructors.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/req/req_file.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/req/req_install.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/req/req_set.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/req/req_uninstall.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/base.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/self_outdated_check.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/_jaraco_text.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/_log.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/appdirs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/compatibility_tags.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/datetime.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/deprecation.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/egg_link.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/encoding.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/entrypoints.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/filesystem.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/filetypes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/glibc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/hashes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/logging.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/misc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/models.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/packaging.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/setuptools_build.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/subprocess.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/temp_dir.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/unpacking.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/urls.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/virtualenv.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/utils/wheel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/vcs/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/vcs/bazaar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/vcs/git.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/vcs/mercurial.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/vcs/subversion.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/vcs/versioncontrol.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_internal/wheel_builder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/cache.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/controller.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/certifi/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/certifi/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/certifi/cacert.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/certifi/core.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/certifi/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/big5freq.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/big5prober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/chardistribution.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/charsetgroupprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/charsetprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/cli/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/cli/chardetect.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/codingstatemachine.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/codingstatemachinedict.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/cp949prober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/enums.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/escprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/escsm.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/eucjpprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/euckrfreq.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/euckrprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/euctwfreq.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/euctwprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/gb2312freq.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/gb2312prober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/hebrewprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/jisfreq.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/johabfreq.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/johabprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/jpcntx.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/langbulgarianmodel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/langgreekmodel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/langhebrewmodel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/langhungarianmodel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/langrussianmodel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/langthaimodel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/langturkishmodel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/latin1prober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/macromanprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/mbcharsetprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/mbcsgroupprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/mbcssm.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/metadata/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/metadata/languages.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/resultdict.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/sbcharsetprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/sbcsgroupprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/sjisprober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/universaldetector.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/utf1632prober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/utf8prober.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/chardet/version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/ansi.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/ansitowin32.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/initialise.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/tests/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/tests/ansi_test.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/tests/ansitowin32_test.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/tests/initialise_test.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/tests/isatty_test.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/tests/utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/tests/winterm_test.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/win32.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/colorama/winterm.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/database.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/index.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/locators.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/manifest.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/markers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/metadata.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/resources.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/scripts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/t32.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/t64-arm.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/t64.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/w32.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/w64-arm.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/w64.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distlib/wheel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distro/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distro/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distro/distro.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/distro/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/idna/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/idna/codec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/idna/compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/idna/core.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/idna/idnadata.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/idna/intranges.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/idna/package_data.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/idna/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/idna/uts46data.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/msgpack/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/msgpack/exceptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/msgpack/ext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/msgpack/fallback.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/__about__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/_manylinux.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/_musllinux.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/_structures.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/markers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/requirements.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/specifiers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/tags.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/packaging/version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/platformdirs/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/platformdirs/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/platformdirs/android.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/platformdirs/api.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/platformdirs/macos.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/platformdirs/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/platformdirs/unix.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/platformdirs/version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/platformdirs/windows.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/cmdline.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/console.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/filter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/bbcode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/groff.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/html.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/img.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/irc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/latex.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/other.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/pangomarkup.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/rtf.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/svg.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/terminal.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/formatters/terminal256.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/lexer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/lexers/python.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/modeline.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/plugin.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/regexopt.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/scanner.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/sphinxext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/style.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/token.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/unistring.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pygments/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/actions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/common.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/core.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/diagram/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/exceptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/helpers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/results.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/testing.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/unicode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyparsing/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyproject_hooks/_compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/__version__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/_internal_utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/adapters.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/api.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/auth.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/certs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/cookies.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/exceptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/help.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/hooks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/models.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/packages.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/sessions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/status_codes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/structures.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/requests/utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/resolvelib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/resolvelib/compat/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/resolvelib/compat/collections_abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/resolvelib/providers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/resolvelib/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/resolvelib/reporters.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/resolvelib/resolvers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/resolvelib/structs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_cell_widths.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_export_format.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_extension.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_fileno.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_inspect.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_log_render.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_loop.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_null_file.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_palettes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_pick.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_ratio.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_spinners.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_stack.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_timer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_win32_console.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_windows.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/_wrap.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/align.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/ansi.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/bar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/box.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/cells.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/color.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/color_triplet.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/columns.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/console.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/constrain.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/containers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/control.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/default_styles.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/diagnose.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/emoji.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/errors.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/file_proxy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/filesize.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/highlighter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/json.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/jupyter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/layout.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/live.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/live_render.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/logging.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/markup.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/measure.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/padding.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/pager.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/palette.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/panel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/pretty.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/progress.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/progress_bar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/prompt.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/protocol.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/region.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/repr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/rule.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/scope.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/screen.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/segment.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/spinner.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/status.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/style.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/styled.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/syntax.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/table.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/terminal_theme.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/text.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/theme.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/themes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/traceback.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/rich/tree.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/six.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/_asyncio.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/_utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/after.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/before.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/before_sleep.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/nap.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/retry.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/stop.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/tornadoweb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tenacity/wait.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tomli/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tomli/_parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tomli/_re.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tomli/_types.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/tomli/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/truststore/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/truststore/_api.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/truststore/_macos.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/truststore/_openssl.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/truststore/_ssl_constants.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/truststore/_windows.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/truststore/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/typing_extensions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/_collections.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/_version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/connection.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/exceptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/fields.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/filepost.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/packages/six.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/request.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/response.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/connection.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/queue.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/request.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/response.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/retry.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/url.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/urllib3/util/wait.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/vendor.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/webencodings/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/webencodings/labels.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/webencodings/mklabels.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/webencodings/tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/_vendor/webencodings/x_user_defined.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pip/py.typed", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/appdirs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/importlib_resources/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_adapters.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_common.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_itertools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_legacy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/importlib_resources/abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/importlib_resources/readers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/importlib_resources/simple.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/jaraco/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/jaraco/context.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/jaraco/functools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/jaraco/text/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/more_itertools/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/more_itertools/more.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/more_itertools/recipes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/packaging/__about__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/packaging/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/packaging/_manylinux.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/packaging/_musllinux.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/packaging/markers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/packaging/tags.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/packaging/utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/packaging/version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/pyparsing/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/pyparsing/actions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/pyparsing/common.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/pyparsing/core.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/pyparsing/diagram/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/pyparsing/exceptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/pyparsing/helpers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/pyparsing/results.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/pyparsing/testing.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/pyparsing/unicode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/pyparsing/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/_vendor/zipp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/pkg_resources/extern/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools-65.5.0.dist-info/INSTALLER", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools-65.5.0.dist-info/LICENSE", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools-65.5.0.dist-info/METADATA", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools-65.5.0.dist-info/RECORD", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools-65.5.0.dist-info/REQUESTED", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools-65.5.0.dist-info/WHEEL", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools-65.5.0.dist-info/entry_points.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools-65.5.0.dist-info/top_level.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_deprecation_warning.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/_collections.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/_functools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/_macos_compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/_msvccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/archive_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/bcppcompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/ccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/cmd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/_framework_compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/bdist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/bdist_dumb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/bdist_rpm.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/build.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/build_clib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/build_ext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/build_py.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/build_scripts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/check.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/clean.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/config.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/install.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/install_data.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/install_egg_info.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/install_headers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/install_lib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/install_scripts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/py37compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/register.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/sdist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/command/upload.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/config.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/core.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/cygwinccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/debug.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/dep_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/dir_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/dist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/errors.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/extension.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/fancy_getopt.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/file_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/filelist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/log.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/msvc9compiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/msvccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/py38compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/py39compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/spawn.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/sysconfig.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/text_file.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/unixccompiler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_distutils/versionpredicate.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_entry_points.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_imp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_importlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_itertools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_path.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_reqs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_metadata/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_metadata/_adapters.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_metadata/_collections.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_metadata/_compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_metadata/_functools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_metadata/_itertools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_metadata/_meta.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_metadata/_text.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_resources/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_resources/_adapters.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_resources/_common.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_resources/_compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_resources/_itertools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_resources/_legacy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_resources/abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_resources/readers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/importlib_resources/simple.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/jaraco/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/jaraco/context.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/jaraco/functools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/jaraco/text/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/more_itertools/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/more_itertools/more.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/ordered_set.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/packaging/__about__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/packaging/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/packaging/_manylinux.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/packaging/_musllinux.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/packaging/_structures.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/packaging/markers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/packaging/requirements.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/packaging/specifiers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/packaging/tags.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/packaging/utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/packaging/version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/pyparsing/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/pyparsing/actions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/pyparsing/common.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/pyparsing/core.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/pyparsing/diagram/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/pyparsing/exceptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/pyparsing/helpers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/pyparsing/results.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/pyparsing/testing.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/pyparsing/unicode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/pyparsing/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/tomli/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/tomli/_parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/tomli/_re.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/tomli/_types.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/typing_extensions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/_vendor/zipp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/archive_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/build_meta.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/cli-32.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/cli-64.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/cli-arm64.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/cli.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/alias.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/bdist_egg.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/bdist_rpm.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/build.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/build_clib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/build_ext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/build_py.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/develop.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/dist_info.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/easy_install.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/editable_wheel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/egg_info.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/install.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/install_egg_info.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/install_lib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/install_scripts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/launcher manifest.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/py36compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/register.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/rotate.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/saveopts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/sdist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/setopt.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/test.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/upload.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/command/upload_docs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/config/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/config/_apply_pyprojecttoml.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/config/_validate_pyproject/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/config/_validate_pyproject/error_reporting.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/config/_validate_pyproject/extra_validations.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_validations.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/config/_validate_pyproject/formats.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/config/expand.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/config/pyprojecttoml.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/config/setupcfg.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/dep_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/depends.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/discovery.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/dist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/errors.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/extension.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/extern/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/glob.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/gui-32.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/gui-64.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/gui-arm64.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/gui.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/installer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/launch.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/logging.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/monkey.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/msvc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/namespaces.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/package_index.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/py34compat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/sandbox.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/script (dev).tmpl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/script.tmpl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/unicode_utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/wheel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site-packages/setuptools/windows_support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/site.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/smtpd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/smtplib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/sndhdr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/socket.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/socketserver.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/sqlite3/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/sqlite3/dbapi2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/sqlite3/dump.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/sre_compile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/sre_constants.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/sre_parse.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/ssl.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/stat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/statistics.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/string.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/stringprep.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/struct.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/subprocess.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/sunau.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/symtable.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/sysconfig.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tabnanny.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tarfile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/telnetlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tempfile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/.ruff.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/Sine-1000Hz-300ms.aif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/_test_atexit.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/_test_eintr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/_test_embed_set_config.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/_test_embed_structseq.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/_test_multiprocessing.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/_test_venv_multiprocessing.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/archiver_tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-alaw.aifc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm16.aiff", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm16.au", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm16.wav", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm24.aiff", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm24.au", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm24.wav", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm32.aiff", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm32.au", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm32.wav", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm8.aiff", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm8.au", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-pcm8.wav", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-ulaw.aifc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiodata/pluck-ulaw.au", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiotest.au", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audiotests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/audit-tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/autotest.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/bisect_cmd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/allsans.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/badcert.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/badkey.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/capath/4e1295a3.0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/capath/5ed36f99.0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/capath/6e88d7b8.0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/capath/99d0fa06.0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/capath/b1930218.0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/capath/ceff1710.0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/ffdh3072.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/idnsans.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/keycert.passwd.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/keycert.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/keycert2.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/keycert3.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/keycert4.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/keycertecc.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/make_ssl_certs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/nokia.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/nosan.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/nullbytecert.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/nullcert.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/pycacert.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/pycakey.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/revocation.crl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/secp384r1.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/selfsigned_pythontestdotnet.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/ssl_cert.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/ssl_key.passwd.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/ssl_key.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/certdata/talos-2019-0758.pem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/big5-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/big5.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/big5hkscs-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/big5hkscs.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/cp949-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/cp949.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/euc_jisx0213-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/euc_jisx0213.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/euc_jp-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/euc_jp.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/euc_kr-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/euc_kr.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/gb18030-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/gb18030.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/gb2312-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/gb2312.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/gbk-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/gbk.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/hz-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/hz.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/iso2022_jp-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/iso2022_jp.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/iso2022_kr-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/iso2022_kr.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/johab-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/johab.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/shift_jis-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/shift_jis.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/shift_jisx0213-utf8.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cjkencodings/shift_jisx0213.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/clinic.test.c", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/cmath_testcases.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/configdata/cfgparser.1", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/configdata/cfgparser.2", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/configdata/cfgparser.3", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/crashers/README", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/crashers/bogus_code_obj.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/crashers/gc_inspection.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/crashers/infinite_loop_re.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/crashers/mutation_inside_cyclegc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/crashers/recursive_call.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/crashers/trace_at_recursion_limit.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/crashers/underlying_dict.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/curses_tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/data/README", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/datetimetester.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/abs.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/add.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/and.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/base.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/clamp.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/class.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/compare.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/comparetotal.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/comparetotmag.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/copy.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/copyabs.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/copynegate.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/copysign.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddAbs.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddAdd.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddAnd.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddBase.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddCanonical.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddClass.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddCompare.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddCompareSig.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddCompareTotal.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddCompareTotalMag.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddCopy.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddCopyAbs.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddCopyNegate.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddCopySign.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddDivide.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddDivideInt.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddEncode.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddFMA.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddInvert.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddLogB.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddMax.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddMaxMag.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddMin.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddMinMag.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddMinus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddMultiply.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddNextMinus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddNextPlus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddNextToward.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddOr.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddPlus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddQuantize.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddReduce.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddRemainder.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddRemainderNear.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddRotate.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddSameQuantum.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddScaleB.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddShift.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddSubtract.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddToIntegral.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ddXor.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/decDouble.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/decQuad.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/decSingle.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/divide.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/divideint.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqAbs.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqAdd.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqAnd.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqBase.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqCanonical.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqClass.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqCompare.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqCompareSig.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqCompareTotal.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqCompareTotalMag.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqCopy.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqCopyAbs.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqCopyNegate.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqCopySign.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqDivide.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqDivideInt.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqEncode.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqFMA.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqInvert.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqLogB.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqMax.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqMaxMag.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqMin.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqMinMag.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqMinus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqMultiply.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqNextMinus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqNextPlus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqNextToward.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqOr.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqPlus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqQuantize.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqReduce.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqRemainder.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqRemainderNear.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqRotate.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqSameQuantum.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqScaleB.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqShift.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqSubtract.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqToIntegral.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dqXor.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dsBase.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/dsEncode.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/exp.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/extra.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/fma.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/inexact.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/invert.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/ln.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/log10.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/logb.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/max.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/maxmag.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/min.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/minmag.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/minus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/multiply.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/nextminus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/nextplus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/nexttoward.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/or.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/plus.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/power.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/powersqrt.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/quantize.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/randomBound32.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/randoms.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/reduce.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/remainder.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/remainderNear.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/rescale.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/rotate.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/rounding.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/samequantum.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/scaleb.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/shift.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/squareroot.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/subtract.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/testall.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/tointegral.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/tointegralx.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/decimaltestdata/xor.decTest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dis_module.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/assert_usable.d", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/assert_usable.stp", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/call_stack.d", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/call_stack.d.expected", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/call_stack.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/call_stack.stp", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/call_stack.stp.expected", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/gc.d", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/gc.d.expected", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/gc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/gc.stp", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/gc.stp.expected", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/instance.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/line.d", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/line.d.expected", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/dtracedata/line.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/empty.vbs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/encoded_modules/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/encoded_modules/module_iso_8859_1.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/encoded_modules/module_koi8_r.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/exception_hierarchy.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/floating_points.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/fork_wait.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/formatfloat_testcases.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/ieee754.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python-raw.jpg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.bmp", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.exr", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.jpg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.pbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.pgm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.png", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.ppm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.ras", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.sgi", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.tiff", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.webp", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imghdrdata/python.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/imp_dummy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/leakers/README.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/leakers/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/leakers/test_ctypes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/leakers/test_selftype.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/cmdline.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/filter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/findtests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/logger.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/main.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/mypy.ini", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/pgo.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/refleak.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/result.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/results.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/run_workers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/runtests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/save_env.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/setup.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/single.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/testresult.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/win_utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/libregrtest/worker.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/list_tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/lock_tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/mailcap.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/mapping_tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/math_testcases.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/memory_watchdog.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/mime.types", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/mock_socket.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/mp_fork_bomb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/mp_preload.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/multibytecodec_support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/pickletester.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/profilee.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/pstats.pck", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/pyclbr_input.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/pydoc_mod.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/pydocfodder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/pythoninfo.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/randv2_32.pck", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/randv2_64.pck", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/randv3.pck", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/re_tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/recursion.tar", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/regrtest.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/regrtestdata/import_from_tests/test_regrtest_a.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/regrtestdata/import_from_tests/test_regrtest_b/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/regrtestdata/import_from_tests/test_regrtest_b/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/regrtestdata/import_from_tests/test_regrtest_c.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/relimport.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/reperf.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/seq_tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/signalinterproctester.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/sndhdrdata/README", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/sndhdrdata/sndhdr.8svx", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/sndhdrdata/sndhdr.aifc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/sndhdrdata/sndhdr.aiff", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/sndhdrdata/sndhdr.au", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/sndhdrdata/sndhdr.hcom", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/sndhdrdata/sndhdr.sndt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/sndhdrdata/sndhdr.voc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/sndhdrdata/sndhdr.wav", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/sortperf.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/ssl_servers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/ssltests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/string_tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/subprocessdata/fd_status.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/subprocessdata/input_reader.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/subprocessdata/qcat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/subprocessdata/qgrep.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/subprocessdata/sigchild_ignore.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/bytecode_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/hashlib_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/import_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/interpreters.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/logging_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/os_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/pty_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/script_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/socket_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/threading_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/support/warnings_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test___all__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test__locale.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test__opcode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test__osx_support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test__xxsubinterpreters.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_abstract_numbers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_aifc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_argparse.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_array.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asdl_parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ast.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncgen.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asynchat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/echo.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/echo2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/echo3.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/functional.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_base_events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_buffered_proto.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_context.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_futures.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_futures2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_locks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_pep492.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_proactor_events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_protocols.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_queues.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_runners.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_selector_events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_sendfile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_server.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_sock_lowlevel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_ssl.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_sslproto.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_streams.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_subprocess.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_taskgroups.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_tasks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_threads.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_timeouts.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_transports.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_unix_events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_waitfor.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_windows_events.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/test_windows_utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncio/utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_asyncore.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_atexit.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_audioop.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_audit.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_augassign.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_base64.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_baseexception.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_bdb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_bigaddrspace.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_bigmem.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_binascii.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_binop.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_bisect.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_bool.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_buffer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_bufio.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_builtin.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_bytes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_bz2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_c_locale_coercion.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_calendar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_call.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_capi/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_capi/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_capi/test_codecs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_capi/test_eval_code_ex.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_capi/test_getargs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_capi/test_misc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_capi/test_structmembers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_capi/test_unicode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_cgi.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_cgitb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_charmapcodec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_check_c_globals.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_class.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_clinic.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_cmath.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_cmd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_cmd_line.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_cmd_line_script.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_code.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_code_module.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codeccallbacks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecencodings_cn.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecencodings_hk.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecencodings_iso2022.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecencodings_jp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecencodings_kr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecencodings_tw.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecmaps_cn.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecmaps_hk.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecmaps_jp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecmaps_kr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecmaps_tw.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codecs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_codeop.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_collections.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_colorsys.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_compare.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_compile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_compileall.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_complex.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_concurrent_futures/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_concurrent_futures/executor.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_concurrent_futures/test_as_completed.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_concurrent_futures/test_deadlock.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_concurrent_futures/test_future.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_concurrent_futures/test_init.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_concurrent_futures/test_process_pool.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_concurrent_futures/test_shutdown.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_concurrent_futures/test_thread_pool.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_concurrent_futures/test_wait.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_concurrent_futures/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_configparser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_contains.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_context.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_contextlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_contextlib_async.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_copy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_copyreg.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_coroutines.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_cppext/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_cppext/extension.cpp", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_cppext/setup.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_cprofile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_crashers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_crypt.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_csv.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ctypes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_curses.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dataclasses/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dataclasses/dataclass_module_1.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dataclasses/dataclass_module_1_str.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dataclasses/dataclass_module_2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dataclasses/dataclass_module_2_str.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dataclasses/dataclass_textanno.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_datetime.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dbm.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dbm_dumb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dbm_gnu.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dbm_ndbm.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_decimal.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_decorators.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_defaultdict.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_deque.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_descr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_descrtut.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_devpoll.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dict.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dict_version.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dictcomps.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dictviews.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_difflib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_difflib_expect.html", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dis.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_distutils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/doctest_aliases.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/doctest_lineno.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/sample_doctest.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/sample_doctest_no_docstrings.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/sample_doctest_no_doctests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/test_doctest.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/test_doctest.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/test_doctest2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/test_doctest2.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/test_doctest3.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_doctest/test_doctest4.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_docxmlrpc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dtrace.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dynamic.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_dynamicclassattribute.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_eintr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_01.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_02.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_03.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_04.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_05.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_06.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_07.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_08.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_09.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_10.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_11.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_12.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_12a.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_13.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_14.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_15.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_16.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_17.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_18.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_19.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_20.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_21.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_22.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_23.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_24.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_25.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_26.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_27.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_28.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_29.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_30.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_31.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_32.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_33.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_34.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_35.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_36.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_37.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_38.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_39.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_40.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_41.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_42.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_43.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_44.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_45.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_46.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/msg_47.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.bmp", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.exr", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.jpg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.pbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.pgm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.png", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.ppm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.ras", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.sgi", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.tiff", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.webp", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/python.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/sndhdr.aifc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/sndhdr.aiff", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/sndhdr.au", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/data/sndhdr.wav", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test__encoded_words.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test__header_value_parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_asian_codecs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_contentmanager.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_defect_handling.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_email.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_generator.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_headerregistry.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_inversion.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_message.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_pickleable.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_policy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/test_utils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_email/torture_test.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_embed.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ensurepip.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_enum.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_enumerate.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_eof.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_epoll.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_errno.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_except_star.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_exception_group.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_exception_hierarchy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_exception_variations.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_exceptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_extcall.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_faulthandler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_fcntl.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_file.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_file_eintr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_filecmp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_fileinput.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_fileio.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_fileutils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_finalization.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_float.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_flufl.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_fnmatch.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_fork1.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_format.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_fractions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_frame.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_frozen.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_fstring.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ftplib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_funcattrs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_functools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/badsyntax_future10.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/badsyntax_future3.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/badsyntax_future4.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/badsyntax_future5.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/badsyntax_future6.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/badsyntax_future7.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/badsyntax_future8.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/badsyntax_future9.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/future_test1.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/future_test2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/test_future.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/test_future_flags.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/test_future_multiple_features.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/test_future_multiple_imports.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_future_stmt/test_future_single_import.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_gc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_gdb/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_gdb/gdb_sample.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_gdb/test_backtrace.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_gdb/test_cfunction.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_gdb/test_cfunction_full.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_gdb/test_misc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_gdb/test_pretty_print.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_gdb/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_generator_stop.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_generators.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_genericalias.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_genericclass.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_genericpath.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_genexps.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_getopt.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_getpass.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_getpath.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_gettext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_glob.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_global.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_grammar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_graphlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_grp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_gzip.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_hash.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_hashlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_heapq.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_hmac.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_html.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_htmlparser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_http_cookiejar.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_http_cookies.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_httplib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_httpservers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_idle.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_imaplib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_imghdr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_imp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/basic.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/basic2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/binding.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/binding2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/from_cycle1.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/from_cycle2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/indirect.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/rebinding.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/rebinding2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/source.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/subpackage.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/subpkg2/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/subpkg2/parent/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/subpkg2/parent/child.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/subpkg/subpackage2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/subpkg/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/use.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/circular_imports/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/double_const.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/package2/submodule1.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/package2/submodule2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/package/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/package/submodule.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/unwritable/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_import/data/unwritable/x.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/builtin/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/builtin/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/builtin/test_finder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/builtin/test_loader.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data01/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data01/binary.file", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data01/subdirectory/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data01/subdirectory/binary.file", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data01/utf-16.file", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data01/utf-8.file", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data02/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data02/one/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data02/one/resource1.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data02/two/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data02/two/resource2.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data03/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data03/namespace/portion1/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data03/namespace/portion2/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data03/namespace/resource1.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data/example-21.12-py3-none-any.whl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data/example-21.12-py3.6.egg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/data/example2-1.0.0-py3-none-any.whl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/extension/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/extension/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/extension/test_case_sensitivity.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/extension/test_finder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/extension/test_loader.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/extension/test_path_hook.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/fixtures.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/frozen/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/frozen/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/frozen/test_finder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/frozen/test_loader.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/import_/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/import_/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/import_/test___loader__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/import_/test___package__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/import_/test_api.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/import_/test_caching.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/import_/test_fromlist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/import_/test_meta_path.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/import_/test_packages.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/import_/test_path.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/import_/test_relative_imports.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/both_portions/foo/one.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/both_portions/foo/two.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/missing_directory.zip", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test/empty", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/nested_portion1.zip", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/one.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/portion1/foo/one.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/portion2/foo/two.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/project1/parent/child/one.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/project2/parent/child/two.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/project3/parent/child/three.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespace_pkgs/top_level_portion1.zip", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespacedata01/binary.file", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespacedata01/utf-16.file", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/namespacedata01/utf-8.file", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/partial/cfimport.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/partial/pool_in_threads.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/resources/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/resources/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/source/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/source/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/source/test_case_sensitivity.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/source/test_file_loader.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/source/test_finder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/source/test_path_hook.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/source/test_source_encoding.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/stubs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_abc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_api.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_compatibilty_files.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_contents.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_files.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_lazy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_locks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_main.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_metadata_api.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_namespace_pkgs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_open.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_path.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_pkg_import.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_read.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_reader.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_resource.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_spec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_threaded_import.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_windows.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/test_zip.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/threaded_import_hangers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/update-zips.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/zipdata01/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/zipdata01/ziptestdata.zip", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/zipdata02/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_importlib/zipdata02/ziptestdata.zip", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_index.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_inspect/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_inspect/inspect_fodder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_inspect/inspect_fodder2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_inspect/inspect_stock_annotations.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_inspect/inspect_stringized_annotations.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_inspect/inspect_stringized_annotations_2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_inspect/test_inspect.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_int.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_int_literal.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_interpreters.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_io.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ioctl.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ipaddress.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_isinstance.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_iter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_iterlen.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_itertools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_decode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_default.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_dump.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_encode_basestring_ascii.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_enum.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_fail.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_float.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_indent.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_pass1.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_pass2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_pass3.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_recursion.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_scanstring.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_separators.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_speedups.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_tool.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_json/test_unicode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_keyword.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_keywordonlyarg.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_kqueue.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_largefile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_launcher.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_lib2to3.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_linecache.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_list.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_listcomps.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_lltrace.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_locale.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_logging.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_long.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_longexp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_lzma.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_mailbox.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_mailcap.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_marshal.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_math.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_memoryio.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_memoryview.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_metaclass.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_mimetypes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_minidom.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_mmap.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_module/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_module/bad_getattr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_module/bad_getattr2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_module/bad_getattr3.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_module/final_a.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_module/final_b.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_module/good_getattr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_modulefinder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_msilib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multibytecodec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_fork/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_fork/test_manager.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_fork/test_misc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_fork/test_processes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_fork/test_threads.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_forkserver/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_forkserver/test_manager.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_forkserver/test_misc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_forkserver/test_processes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_forkserver/test_threads.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_main_handling.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_spawn/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_spawn/test_manager.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_spawn/test_misc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_spawn/test_processes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_multiprocessing_spawn/test_threads.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_named_expressions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_netrc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_nis.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_nntplib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ntpath.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_numeric_tower.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_opcache.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_opcodes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_openpty.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_operator.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_optparse.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ordered_dict.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_os.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ossaudiodev.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_osx_env.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pathlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_patma.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pdb.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_peepholer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_peg_generator/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_peg_generator/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_peg_generator/test_c_parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_peg_generator/test_first_sets.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_peg_generator/test_grammar_validator.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_peg_generator/test_pegen.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pep646_syntax.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pickle.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_picklebuffer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pickletools.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pipes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pkg.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pkgutil.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_platform.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_plistlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_poll.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_popen.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_poplib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_positional_only_arg.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_posix.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_posixpath.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pow.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pprint.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_print.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_profile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_property.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pstats.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pty.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pulldom.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pwd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_py_compile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pyclbr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pydoc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_pyexpat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_queue.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_quopri.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_raise.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_random.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_range.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_re.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_readline.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_regrtest.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_repl.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_reprlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_resource.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_richcmp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_rlcompleter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_robotparser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_runpy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sax.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sched.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_scope.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_script_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_secrets.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_select.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_selectors.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_set.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_setcomps.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_shelve.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_shlex.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_shutil.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_signal.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_site.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_slice.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_smtpd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_smtplib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_smtpnet.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sndhdr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_socket.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_socketserver.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sort.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_source_encoding.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_spwd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sqlite3/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sqlite3/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sqlite3/test_backup.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sqlite3/test_dbapi.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sqlite3/test_dump.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sqlite3/test_factory.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sqlite3/test_hooks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sqlite3/test_regression.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sqlite3/test_transactions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sqlite3/test_types.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sqlite3/test_userfunctions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ssl.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_stable_abi_ctypes.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_startfile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_stat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_statistics.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_strftime.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_string.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_string_literals.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_stringprep.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_strptime.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_strtod.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_struct.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_structseq.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_subclassinit.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_subprocess.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sunau.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sundry.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_super.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_symtable.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_syntax.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sys.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sys_setprofile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sys_settrace.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_sysconfig.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_syslog.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tabnanny.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tarfile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tcl.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_telnetlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tempfile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_termios.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_textwrap.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_thread.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_threadedtempfile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_threading.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_threading_local.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_threadsignals.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_time.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_timeit.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_timeout.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tix.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tk.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tokenize.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/burntsushi.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/array-missing-comma.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/array-of-tables/overwrite-array-in-parent.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/array-of-tables/overwrite-bool-with-aot.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/array/file-end-after-val.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/array/unclosed-after-item.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/array/unclosed-empty.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/basic-str-ends-in-escape.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/boolean/invalid-false-casing.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/boolean/invalid-true-casing.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/dates-and-times/invalid-day.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/dotted-keys/access-non-table.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/dotted-keys/extend-defined-aot.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/dotted-keys/extend-defined-table-with-subtable.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/dotted-keys/extend-defined-table.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table-missing-comma.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table/define-twice-in-subtable.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table/define-twice.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table/file-end-after-key-val.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table/mutate.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table/override-val-in-table.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table/override-val-with-array.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table/override-val-with-table.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table/overwrite-implicitly.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table/overwrite-value-in-inner-array.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table/overwrite-value-in-inner-table.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/inline-table/unclosed-empty.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/invalid-comment-char.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/invalid-escaped-unicode.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/invalid-hex.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/keys-and-vals/ends-early-table-def.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/keys-and-vals/ends-early.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/keys-and-vals/no-value.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/keys-and-vals/only-ws-after-dot.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/keys-and-vals/overwrite-with-deep-table.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/literal-str/unclosed.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/missing-closing-double-square-bracket.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/missing-closing-square-bracket.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/multiline-basic-str/carriage-return.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/multiline-basic-str/escape-only.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/multiline-basic-str/file-ends-after-opening.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/multiline-basic-str/last-line-escape.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/multiline-basic-str/unclosed-ends-in-whitespace-escape.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/multiline-literal-str/file-ends-after-opening.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/multiline-literal-str/unclosed.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/non-scalar-escaped.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/table/eof-after-opening.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/table/redefine-1.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/table/redefine-2.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/unclosed-multiline-string.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/invalid/unclosed-string.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/apostrophes-in-literal-string.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/apostrophes-in-literal-string.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/array/array-subtables.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/array/array-subtables.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/array/open-parent-table.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/array/open-parent-table.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/boolean.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/boolean.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/dates-and-times/datetimes.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/dates-and-times/datetimes.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/dates-and-times/localtime.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/dates-and-times/localtime.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/empty-inline-table.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/empty-inline-table.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/five-quotes.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/five-quotes.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/hex-char.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/hex-char.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/multiline-basic-str/ends-in-whitespace-escape.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/multiline-basic-str/ends-in-whitespace-escape.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/no-newlines.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/no-newlines.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/trailing-comma.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/data/valid/trailing-comma.toml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/test_data.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/test_error.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tomllib/test_misc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/test_fixcid.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/test_freeze.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/test_gprof2html.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/test_i18n.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/test_lll.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/test_md5sum.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/test_pathfix.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/test_pdeps.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/test_pindent.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/test_reindent.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tools/test_sundry.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_trace.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_traceback.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tracemalloc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ttk_guionly.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ttk_textonly.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tty.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_tuple.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_turtle.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_type_annotations.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_type_cache.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_type_comments.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_typechecks.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_types.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_typing.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_ucn.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_unary.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_unicode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_unicode_file.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_unicode_file_functions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_unicode_identifiers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_unicodedata.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_unittest.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_univnewlines.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_unpack.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_unpack_ex.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_unparse.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_urllib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_urllib2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_urllib2_localnet.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_urllib2net.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_urllib_response.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_urllibnet.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_urlparse.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_userdict.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_userlist.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_userstring.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_utf8_mode.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_utf8source.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_uu.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_uuid.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_venv.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_wait3.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_wait4.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_warnings/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_warnings/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_warnings/data/import_warning.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_warnings/data/stacklevel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_wave.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_weakref.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_weakset.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_webbrowser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_winconsoleio.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_winreg.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_winsound.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_with.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_wsgiref.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_xdrlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_xml_dom_minicompat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_xml_etree.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_xml_etree_c.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_xmlrpc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_xmlrpc_net.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_xxlimited.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_xxtestfuzz.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_yield_from.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zipapp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zipfile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zipfile64.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zipimport.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zipimport_support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zoneinfo/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zoneinfo/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zoneinfo/_support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zoneinfo/data/update_test_data.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zoneinfo/data/zoneinfo_data.json", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/test_zoneinfo/test_zoneinfo.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/testcodec.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/testtar.tar", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/testtar.tar.xz", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tf_inherit_check.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/time_hashlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tokenizedata/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tokenizedata/bad_coding.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tokenizedata/bad_coding2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tokenizedata/badsyntax_3131.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tokenizedata/badsyntax_pep3120.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tokenizedata/coding20731.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tokenizedata/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tokenizedata/tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tokenizedata/tokenize_tests-utf8-coding-cookie-and-no-utf8-bom-sig.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tokenizedata/tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tokenizedata/tokenize_tests.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tracedmodules/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/tracedmodules/testmod.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/_typed_dict_helper.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/ann_module.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/ann_module2.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/ann_module3.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/ann_module4.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/ann_module5.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/ann_module6.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/ann_module7.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/ann_module8.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/ann_module9.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/typinganndata/mod_generics_cache.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/win_console_handler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/README", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/c14nComment.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/c14nPrefix.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/c14nPrefixQname.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/c14nPrefixQnameXpathElem.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/c14nQname.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/c14nQnameElem.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/c14nQnameXpathElem.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/c14nTrim.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/doc.dtd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/doc.xsl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inC14N1.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inC14N2.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inC14N3.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inC14N4.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inC14N5.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inC14N6.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inNsContent.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inNsDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inNsPushdown.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inNsRedecl.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inNsSort.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inNsSuperfluous.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/inNsXml.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N1_c14nComment.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N1_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N2_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N2_c14nTrim.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N3_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N3_c14nPrefix.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N3_c14nTrim.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N4_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N4_c14nTrim.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N5_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N5_c14nTrim.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inC14N6_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsContent_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsContent_c14nPrefixQnameXpathElem.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsContent_c14nQnameElem.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsContent_c14nQnameXpathElem.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsDefault_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsDefault_c14nPrefix.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsPushdown_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsPushdown_c14nPrefix.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsRedecl_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsRedecl_c14nPrefix.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsSort_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsSort_c14nPrefix.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsSuperfluous_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsSuperfluous_c14nPrefix.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsXml_c14nDefault.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsXml_c14nPrefix.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsXml_c14nPrefixQname.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/out_inNsXml_c14nQname.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/c14n-20/world.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/expat224_utf8_bug.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/simple-ns.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/simple.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/test.xml", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltestdata/test.xml.out", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/xmltests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/zip_cp437_header.zip", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/zipdir.zip", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/ziptestdata/README.md", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/ziptestdata/exe_with_z64", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/ziptestdata/exe_with_zip", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/ziptestdata/header.sh", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/test/ziptestdata/testdata_module_inside_zip.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/textwrap.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/this.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/threading.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/timeit.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/colorchooser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/commondialog.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/constants.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/dialog.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/dnd.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/filedialog.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/font.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/messagebox.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/scrolledtext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/simpledialog.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/README", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/test_colorchooser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/test_font.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/test_geometry_managers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/test_images.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/test_loadtk.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/test_messagebox.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/test_misc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/test_simpledialog.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/test_text.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/test_variables.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_tkinter/test_widgets.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_ttk/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_ttk/test_extensions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_ttk/test_style.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/test_ttk/test_widgets.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/test/widget_tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/tix.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tkinter/ttk.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/token.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tokenize.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tomllib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tomllib/_parser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tomllib/_re.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tomllib/_types.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/trace.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/traceback.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tracemalloc.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/tty.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtle.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/bytedesign.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/chaos.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/clock.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/colormixer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/forest.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/fractalcurves.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/lindenmayer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/minimal_hanoi.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/nim.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/paint.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/peace.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/penrose.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/planet_and_moon.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/rosette.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/round_dance.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/sorting_animate.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/tree.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/turtle.cfg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/two_canvases.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/turtledemo/yinyang.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/types.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/typing.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/_log.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/async_case.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/case.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/loader.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/main.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/mock.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/result.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/runner.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/signals.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/suite.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/_test_warnings.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/dummy.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_assertions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_async_case.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_break.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_case.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_discovery.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_functiontestcase.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_loader.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_program.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_result.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_runner.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_setups.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_skipping.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/test_suite.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/support.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/testasync.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/testcallable.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/testhelpers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/testmagicmethods.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/testmock.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/testpatch.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/testsealable.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/testsentinel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/test/testmock/testwith.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/unittest/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/urllib/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/urllib/error.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/urllib/parse.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/urllib/request.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/urllib/response.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/urllib/robotparser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/uu.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/uuid.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/venv/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/venv/__main__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/venv/scripts/common/Activate.ps1", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/venv/scripts/common/activate", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/venv/scripts/nt/activate.bat", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/venv/scripts/nt/deactivate.bat", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/venv/scripts/nt/python.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/venv/scripts/nt/pythonw.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/venv/scripts/posix/activate.csh", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/venv/scripts/posix/activate.fish", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/warnings.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/wave.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/weakref.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/webbrowser.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/wsgiref/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/wsgiref/handlers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/wsgiref/headers.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/wsgiref/simple_server.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/wsgiref/types.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/wsgiref/util.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/wsgiref/validate.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xdrlib.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/dom/NodeFilter.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/dom/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/dom/domreg.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/dom/expatbuilder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/dom/minicompat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/dom/minidom.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/dom/pulldom.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/dom/xmlbuilder.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/etree/ElementInclude.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/etree/ElementPath.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/etree/ElementTree.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/etree/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/etree/cElementTree.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/parsers/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/parsers/expat.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/sax/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/sax/_exceptions.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/sax/expatreader.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/sax/handler.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/sax/saxutils.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xml/sax/xmlreader.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xmlrpc/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xmlrpc/client.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/xmlrpc/server.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/zipapp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/zipfile.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/zipimport.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/zoneinfo/__init__.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/zoneinfo/_common.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/zoneinfo/_tzpath.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Lib/zoneinfo/_zoneinfo.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/NEWS.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Scripts/pip.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Scripts/pip3.11.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Scripts/pip3.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/beer.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/eiffel.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/hanoi.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/life.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/markov.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/mcast.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/queens.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/redemo.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/rpython.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/rpythond.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/sortvisu.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/spreadsheet.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/demo/vector.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/i18n/makelocalealias.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/i18n/msgfmt.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/i18n/pygettext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/2to3.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/abitype.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/analyze_dxp.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/byext.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/byteyears.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/checkpip.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/cleanfuture.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/combinerefs.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/copytime.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/crlf.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/db2pickle.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/deepfreeze.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/diff.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/dutree.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/eptags.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/find-uname.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/find_recursionlimit.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/finddiv.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/findlinksto.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/findnocoding.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/fixcid.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/fixdiv.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/fixheader.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/fixnotice.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/fixps.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/freeze_modules.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/generate_global_objects.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/generate_opcode_h.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/generate_re_casefix.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/generate_sre_constants.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/generate_stdlib_module_names.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/generate_token.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/get-remote-certificate.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/google.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/gprof2html.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/highlight.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/ifdef.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/import_diagnostics.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/lfcr.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/linktree.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/lll.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/mailerdaemon.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/make_ctype.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/md5sum.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/mkreal.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/ndiff.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/nm2def.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/objgraph.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/parse_html5_entities.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/parseentities.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/patchcheck.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/pathfix.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/pdeps.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/pep384_macrocheck.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/pickle2db.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/pindent.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/ptags.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/pydoc3.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/pysource.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/reindent-rst.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/reindent.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/rgrep.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/run_tests.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/smelly.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/stable_abi.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/startuptime.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/suff.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/summarize_stats.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/texi2html.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/umarshal.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/untabify.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/update_file.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/var_access_benchmark.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/verify_ensurepip_wheels.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/which.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/Tools/scripts/win_add2path.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/python.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/python3.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/python311.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/pythonw.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/dde1.4/pkgIndex.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/dde1.4/tcldde14.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/nmake/nmakehlp.c", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/nmake/rules.vc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/nmake/targets.vc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/nmake/tcl.nmake", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/nmake/x86_64-w64-mingw32-nmakehlp.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/reg1.3/pkgIndex.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/reg1.3/tclreg13.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/auto.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/clock.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/ascii.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/big5.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cns11643.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp1250.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp1251.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp1252.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp1253.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp1254.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp1255.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp1256.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp1257.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp1258.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp437.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp737.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp775.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp850.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp852.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp855.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp857.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp860.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp861.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp862.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp863.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp864.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp865.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp866.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp869.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp874.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp932.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp936.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp949.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/cp950.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/dingbats.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/ebcdic.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/euc-cn.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/euc-jp.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/euc-kr.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/gb12345.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/gb1988.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/gb2312-raw.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/gb2312.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso2022-jp.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso2022-kr.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso2022.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-1.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-10.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-11.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-13.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-14.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-15.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-16.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-2.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-3.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-4.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-5.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-6.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-7.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-8.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/iso8859-9.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/jis0201.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/jis0208.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/jis0212.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/koi8-r.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/koi8-u.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/ksc5601.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macCentEuro.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macCroatian.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macCyrillic.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macDingbats.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macGreek.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macIceland.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macJapan.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macRoman.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macRomania.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macThai.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macTurkish.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/macUkraine.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/shiftjis.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/symbol.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/encoding/tis-620.enc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/history.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/http1.0/http.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/http1.0/pkgIndex.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/init.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/af.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/af_za.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ar.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ar_in.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ar_jo.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ar_lb.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ar_sy.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/be.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/bg.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/bn.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/bn_in.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ca.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/cs.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/da.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/de.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/de_at.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/de_be.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/el.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_au.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_be.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_bw.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_ca.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_gb.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_hk.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_ie.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_in.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_nz.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_ph.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_sg.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_za.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/en_zw.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/eo.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_ar.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_bo.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_cl.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_co.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_cr.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_do.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_ec.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_gt.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_hn.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_mx.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_ni.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_pa.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_pe.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_pr.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_py.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_sv.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_uy.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/es_ve.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/et.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/eu.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/eu_es.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/fa.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/fa_in.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/fa_ir.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/fi.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/fo.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/fo_fo.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/fr.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/fr_be.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/fr_ca.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/fr_ch.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ga.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ga_ie.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/gl.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/gl_es.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/gv.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/gv_gb.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/he.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/hi.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/hi_in.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/hr.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/hu.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/id.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/id_id.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/is.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/it.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/it_ch.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ja.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/kl.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/kl_gl.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ko.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ko_kr.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/kok.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/kok_in.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/kw.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/kw_gb.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/lt.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/lv.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/mk.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/mr.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/mr_in.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ms.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ms_my.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/mt.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/nb.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/nl.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/nl_be.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/nn.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/pl.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/pt.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/pt_br.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ro.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ru.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ru_ua.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/sh.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/sk.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/sl.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/sq.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/sr.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/sv.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/sw.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ta.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/ta_in.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/te.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/te_in.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/th.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/tr.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/uk.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/vi.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/zh.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/zh_cn.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/zh_hk.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/zh_sg.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/msgs/zh_tw.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/opt0.4/optparse.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/opt0.4/pkgIndex.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/package.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/parray.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/safe.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tclIndex", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tm.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Abidjan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Accra", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Addis_Ababa", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Algiers", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Asmara", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Asmera", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Bamako", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Bangui", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Banjul", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Bissau", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Blantyre", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Brazzaville", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Bujumbura", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Cairo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Casablanca", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Ceuta", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Conakry", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Dakar", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Dar_es_Salaam", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Djibouti", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Douala", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/El_Aaiun", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Freetown", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Gaborone", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Harare", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Johannesburg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Juba", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Kampala", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Khartoum", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Kigali", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Kinshasa", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Lagos", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Libreville", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Lome", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Luanda", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Lubumbashi", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Lusaka", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Malabo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Maputo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Maseru", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Mbabane", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Mogadishu", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Monrovia", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Nairobi", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Ndjamena", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Niamey", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Nouakchott", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Ouagadougou", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Porto-Novo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Sao_Tome", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Timbuktu", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Tripoli", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Tunis", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Africa/Windhoek", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Adak", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Anchorage", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Anguilla", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Antigua", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Araguaina", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/Buenos_Aires", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/Catamarca", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/ComodRivadavia", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/Cordoba", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/Jujuy", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/La_Rioja", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/Mendoza", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/Rio_Gallegos", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/Salta", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/San_Juan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/San_Luis", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/Tucuman", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Argentina/Ushuaia", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Aruba", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Asuncion", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Atikokan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Atka", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Bahia", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Bahia_Banderas", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Barbados", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Belem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Belize", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Blanc-Sablon", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Boa_Vista", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Bogota", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Boise", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Buenos_Aires", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Cambridge_Bay", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Campo_Grande", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Cancun", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Caracas", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Catamarca", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Cayenne", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Cayman", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Chicago", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Chihuahua", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Coral_Harbour", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Cordoba", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Costa_Rica", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Creston", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Cuiaba", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Curacao", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Danmarkshavn", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Dawson", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Dawson_Creek", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Denver", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Detroit", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Dominica", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Edmonton", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Eirunepe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/El_Salvador", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Ensenada", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Fort_Nelson", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Fort_Wayne", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Fortaleza", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Glace_Bay", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Godthab", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Goose_Bay", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Grand_Turk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Grenada", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Guadeloupe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Guatemala", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Guayaquil", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Guyana", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Halifax", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Havana", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Hermosillo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Indiana/Indianapolis", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Indiana/Knox", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Indiana/Marengo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Indiana/Petersburg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Indiana/Tell_City", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Indiana/Vevay", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Indiana/Vincennes", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Indiana/Winamac", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Indianapolis", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Inuvik", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Iqaluit", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Jamaica", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Jujuy", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Juneau", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Kentucky/Louisville", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Kentucky/Monticello", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Knox_IN", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Kralendijk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/La_Paz", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Lima", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Los_Angeles", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Louisville", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Lower_Princes", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Maceio", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Managua", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Manaus", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Marigot", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Martinique", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Matamoros", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Mazatlan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Mendoza", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Menominee", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Merida", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Metlakatla", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Mexico_City", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Miquelon", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Moncton", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Monterrey", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Montevideo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Montreal", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Montserrat", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Nassau", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/New_York", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Nipigon", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Nome", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Noronha", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/North_Dakota/Beulah", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/North_Dakota/Center", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/North_Dakota/New_Salem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Nuuk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Ojinaga", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Panama", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Pangnirtung", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Paramaribo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Phoenix", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Port-au-Prince", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Port_of_Spain", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Porto_Acre", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Porto_Velho", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Puerto_Rico", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Punta_Arenas", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Rainy_River", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Rankin_Inlet", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Recife", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Regina", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Resolute", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Rio_Branco", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Rosario", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Santa_Isabel", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Santarem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Santiago", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Santo_Domingo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Sao_Paulo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Scoresbysund", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Shiprock", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Sitka", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/St_Barthelemy", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/St_Johns", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/St_Kitts", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/St_Lucia", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/St_Thomas", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/St_Vincent", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Swift_Current", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Tegucigalpa", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Thule", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Thunder_Bay", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Tijuana", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Toronto", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Tortola", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Vancouver", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Virgin", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Whitehorse", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Winnipeg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Yakutat", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/America/Yellowknife", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/Casey", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/Davis", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/DumontDUrville", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/Macquarie", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/Mawson", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/McMurdo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/Palmer", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/Rothera", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/South_Pole", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/Syowa", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/Troll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Antarctica/Vostok", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Arctic/Longyearbyen", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Aden", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Almaty", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Amman", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Anadyr", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Aqtau", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Aqtobe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Ashgabat", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Ashkhabad", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Atyrau", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Baghdad", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Bahrain", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Baku", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Bangkok", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Barnaul", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Beirut", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Bishkek", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Brunei", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Calcutta", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Chita", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Choibalsan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Chongqing", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Chungking", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Colombo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Dacca", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Damascus", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Dhaka", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Dili", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Dubai", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Dushanbe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Famagusta", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Gaza", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Harbin", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Hebron", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Ho_Chi_Minh", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Hong_Kong", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Hovd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Irkutsk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Istanbul", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Jakarta", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Jayapura", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Jerusalem", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Kabul", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Kamchatka", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Karachi", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Kashgar", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Kathmandu", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Katmandu", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Khandyga", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Kolkata", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Krasnoyarsk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Kuala_Lumpur", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Kuching", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Kuwait", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Macao", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Macau", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Magadan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Makassar", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Manila", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Muscat", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Nicosia", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Novokuznetsk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Novosibirsk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Omsk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Oral", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Phnom_Penh", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Pontianak", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Pyongyang", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Qatar", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Qostanay", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Qyzylorda", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Rangoon", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Riyadh", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Saigon", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Sakhalin", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Samarkand", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Seoul", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Shanghai", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Singapore", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Srednekolymsk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Taipei", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Tashkent", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Tbilisi", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Tehran", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Tel_Aviv", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Thimbu", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Thimphu", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Tokyo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Tomsk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Ujung_Pandang", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Ulaanbaatar", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Ulan_Bator", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Urumqi", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Ust-Nera", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Vientiane", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Vladivostok", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Yakutsk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Yangon", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Yekaterinburg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Asia/Yerevan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/Azores", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/Bermuda", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/Canary", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/Cape_Verde", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/Faeroe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/Faroe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/Jan_Mayen", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/Madeira", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/Reykjavik", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/South_Georgia", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/St_Helena", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Atlantic/Stanley", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/ACT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Adelaide", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Brisbane", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Broken_Hill", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Canberra", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Currie", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Darwin", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Eucla", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Hobart", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/LHI", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Lindeman", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Lord_Howe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Melbourne", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/NSW", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/North", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Perth", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Queensland", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/South", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Sydney", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Tasmania", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Victoria", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/West", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Australia/Yancowinna", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Brazil/Acre", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Brazil/DeNoronha", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Brazil/East", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Brazil/West", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/CET", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/CST6CDT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Canada/Atlantic", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Canada/Central", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Canada/East-Saskatchewan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Canada/Eastern", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Canada/Mountain", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Canada/Newfoundland", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Canada/Pacific", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Canada/Saskatchewan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Canada/Yukon", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Chile/Continental", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Chile/EasterIsland", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Cuba", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/EET", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/EST", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/EST5EDT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Egypt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Eire", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+1", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+10", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+11", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+12", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+2", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+3", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+4", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+5", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+6", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+7", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+8", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT+9", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-1", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-10", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-11", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-12", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-13", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-14", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-2", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-3", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-4", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-5", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-6", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-7", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-8", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT-9", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/GMT0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/Greenwich", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/UCT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/UTC", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/Universal", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Etc/Zulu", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Amsterdam", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Andorra", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Astrakhan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Athens", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Belfast", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Belgrade", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Berlin", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Bratislava", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Brussels", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Bucharest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Budapest", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Busingen", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Chisinau", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Copenhagen", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Dublin", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Gibraltar", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Guernsey", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Helsinki", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Isle_of_Man", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Istanbul", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Jersey", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Kaliningrad", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Kiev", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Kirov", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Lisbon", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Ljubljana", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/London", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Luxembourg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Madrid", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Malta", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Mariehamn", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Minsk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Monaco", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Moscow", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Nicosia", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Oslo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Paris", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Podgorica", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Prague", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Riga", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Rome", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Samara", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/San_Marino", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Sarajevo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Saratov", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Simferopol", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Skopje", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Sofia", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Stockholm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Tallinn", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Tirane", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Tiraspol", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Ulyanovsk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Uzhgorod", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Vaduz", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Vatican", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Vienna", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Vilnius", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Volgograd", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Warsaw", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Zagreb", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Zaporozhye", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Europe/Zurich", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/GB", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/GB-Eire", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/GMT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/GMT+0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/GMT-0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/GMT0", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Greenwich", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/HST", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Hongkong", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Iceland", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Indian/Antananarivo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Indian/Chagos", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Indian/Christmas", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Indian/Cocos", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Indian/Comoro", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Indian/Kerguelen", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Indian/Mahe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Indian/Maldives", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Indian/Mauritius", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Indian/Mayotte", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Indian/Reunion", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Iran", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Israel", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Jamaica", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Japan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Kwajalein", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Libya", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/MET", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/MST", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/MST7MDT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Mexico/BajaNorte", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Mexico/BajaSur", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Mexico/General", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/NZ", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/NZ-CHAT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Navajo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/PRC", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/PST8PDT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Apia", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Auckland", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Bougainville", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Chatham", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Chuuk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Easter", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Efate", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Enderbury", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Fakaofo", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Fiji", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Funafuti", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Galapagos", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Gambier", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Guadalcanal", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Guam", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Honolulu", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Johnston", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Kanton", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Kiritimati", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Kosrae", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Kwajalein", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Majuro", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Marquesas", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Midway", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Nauru", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Niue", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Norfolk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Noumea", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Pago_Pago", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Palau", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Pitcairn", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Pohnpei", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Ponape", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Port_Moresby", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Rarotonga", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Saipan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Samoa", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Tahiti", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Tarawa", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Tongatapu", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Truk", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Wake", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Wallis", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Pacific/Yap", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Poland", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Portugal", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/ROC", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/ROK", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Singapore", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/AST4", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/AST4ADT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/CST6", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/CST6CDT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/EST5", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/EST5EDT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/HST10", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/MST7", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/MST7MDT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/PST8", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/PST8PDT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/YST9", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/SystemV/YST9YDT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Turkey", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/UCT", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Alaska", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Aleutian", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Arizona", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Central", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/East-Indiana", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Eastern", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Hawaii", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Indiana-Starke", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Michigan", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Mountain", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Pacific", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Pacific-New", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/US/Samoa", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/UTC", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Universal", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/W-SU", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/WET", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/tzdata/Zulu", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8.6/word.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl86t.lib", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8/8.4/platform-1.0.18.tm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8/8.4/platform/shell-1.1.4.tm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8/8.5/msgcat-1.6.1.tm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8/8.5/tcltest-2.5.3.tm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tcl8/8.6/http-2.9.5.tm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tclConfig.sh", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tclooConfig.sh", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tclstub86.lib", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Balloon.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/BtnBox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/CObjView.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/ChkList.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/ComboBox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Compat.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Console.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Control.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/DefSchm.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/DialogS.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/DirBox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/DirDlg.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/DirList.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/DirTree.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/DragDrop.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/DtlList.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/EFileBox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/EFileDlg.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Event.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/FileBox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/FileCbx.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/FileDlg.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/FileEnt.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/FloatEnt.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Grid.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/HList.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/HListDD.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/IconView.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Init.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/LabEntry.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/LabFrame.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/LabWidg.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/ListNBk.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Makefile", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Meter.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/MultView.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/NoteBook.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/OldUtil.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/OptMenu.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/PanedWin.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/PopMenu.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Primitiv.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/ResizeH.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/SGrid.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/SHList.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/SListBox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/STList.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/SText.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/SWidget.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/SWindow.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Select.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Shell.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/SimpDlg.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/StackWin.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/StatBar.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/StdBBox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/StdShell.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/TList.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Tix.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Tree.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Utils.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/VResize.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/VStack.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/VTree.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/Variable.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/WInfo.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/act_fold.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/act_fold.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/act_fold.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/balarrow.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/cbxarrow.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/ck_def.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/ck_off.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/ck_on.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/cross.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/decr.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/drop.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/file.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/file.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/file.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/folder.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/folder.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/folder.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/harddisk.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/hourglas.mask", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/hourglas.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/incr.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/info.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/info.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/maximize.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/minimize.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/minus.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/minus.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/minus.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/minusarm.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/minusarm.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/minusarm.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/mktransgif.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/network.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/no_entry.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/no_entry.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/openfile.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/openfold.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/openfold.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/openfold.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/plus.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/plus.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/plus.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/plusarm.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/plusarm.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/plusarm.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/resize1.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/resize2.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/restore.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/srcfile.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/srcfile.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/srcfile.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/system.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/textfile.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/textfile.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/textfile.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/tick.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/warning.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/bitmaps/warning.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/MkChoose.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/MkDirLis.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/MkSample.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/MkScroll.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/about.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/bold.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/capital.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/centerj.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/code.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/combobox.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/combobox.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/drivea.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/drivea.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/exit.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/filebox.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/filebox.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/harddisk.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/harddisk.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/italic.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/justify.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/leftj.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/netw.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/netw.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/network.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/network.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/optmenu.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/rightj.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/select.xpm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/tix.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/bitmaps/underlin.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/AllSampl.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/ArrowBtn.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/Balloon.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/BtnBox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/CObjView.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/ChkList.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/CmpImg.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/CmpImg1.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/CmpImg2.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/CmpImg3.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/CmpImg4.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/ComboBox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/Control.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/DirDlg.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/DirList.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/DirTree.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/DragDrop.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/DynTree.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/EFileDlg.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/EditGrid.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/FileDlg.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/FileEnt.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/HList1.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/LabEntry.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/LabFrame.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/ListNBK.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/Meter.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/NoteBook.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/OptMenu.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/PanedWin.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/PopMenu.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/SGrid0.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/SGrid1.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/SHList.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/SHList2.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/SListBox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/STList1.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/STList2.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/STList3.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/SText.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/SWindow.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/Sample.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/Select.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/StdBBox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/Tree.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/Xpm.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/samples/Xpm1.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/tclIndex", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/tixwidgets.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/demos/widget", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/fs.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pkgIndex.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/10Point.fs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/10Point.fsc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/12Point.fs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/12Point.fsc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/14Point.fs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/14Point.fsc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/Bisque.cs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/Bisque.csc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/Blue.cs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/Blue.csc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/Gray.cs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/Gray.csc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/Makefile", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/Old12Pt.fs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/Old14Pt.fs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/SGIGray.cs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/SGIGray.csc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/TK.cs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/TK.csc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/TK.fs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/TK.fsc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/TixGray.cs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/TixGray.csc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/TkWin.cs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/TkWin.csc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/TkWin.fs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/TkWin.fsc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/WmDefault.cs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/WmDefault.csc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/WmDefault.fs", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/WmDefault.fsc", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/WmDefault.py", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/WmDefault.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/WmDefault.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/pkgIndex.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/pref/tixmkpref", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/tix84.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tix8.4.3/tix84.lib", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/bgerror.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/button.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/choosedir.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/clrpick.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/comdlg.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/console.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/README", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/anilabel.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/aniwave.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/arrow.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/bind.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/bitmap.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/browse", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/button.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/check.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/clrpick.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/colors.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/combo.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/cscroll.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/ctext.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/dialog1.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/dialog2.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/en.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/entry1.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/entry2.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/entry3.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/filebox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/floor.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/fontchoose.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/form.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/goldberg.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/hello", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/hscale.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/icon.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/image1.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/image2.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/earth.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/earthmenu.png", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/earthris.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/flagdown.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/flagup.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/gray25.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/letters.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/noletter.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/ouster.png", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/pattern.xbm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/tcllogo.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/images/teapot.ppm", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/items.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/ixset", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/knightstour.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/label.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/labelframe.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/license.terms", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/mclist.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/menu.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/menubu.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/msgbox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/nl.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/paned1.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/paned2.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/pendulum.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/plot.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/puzzle.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/radio.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/rmt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/rolodex", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/ruler.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/sayings.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/search.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/spin.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/square", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/states.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/style.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/tclIndex", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/tcolor", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/text.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/textpeer.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/timer", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/toolbar.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/tree.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/ttkbut.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/ttkmenu.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/ttknote.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/ttkpane.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/ttkprogress.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/ttkscale.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/twind.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/unicodeout.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/vscale.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/demos/widget", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/dialog.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/entry.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/focus.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/fontchooser.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/iconlist.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/icons.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/README", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/logo.eps", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/logo100.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/logo64.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/logoLarge.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/logoMed.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/pwrdLogo.eps", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/pwrdLogo100.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/pwrdLogo150.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/pwrdLogo175.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/pwrdLogo200.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/pwrdLogo75.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/images/tai-ku.gif", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/license.terms", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/listbox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/megawidget.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/menu.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/mkpsenc.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgbox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/cs.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/da.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/de.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/el.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/en.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/en_gb.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/eo.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/es.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/fr.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/hu.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/it.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/nl.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/pl.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/pt.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/ru.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/msgs/sv.msg", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/obsolete.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/optMenu.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/palette.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/panedwindow.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/pkgIndex.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/safetk.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/scale.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/scrlbar.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/spinbox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/tclIndex", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/tearoff.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/text.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/tk.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/tkfbox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/altTheme.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/aquaTheme.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/button.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/clamTheme.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/classicTheme.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/combobox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/cursors.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/defaults.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/entry.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/fonts.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/menubutton.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/notebook.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/panedwindow.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/progress.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/scale.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/scrollbar.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/sizegrip.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/spinbox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/treeview.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/ttk.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/utils.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/vistaTheme.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/winTheme.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/ttk/xpTheme.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/unsupported.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk8.6/xmfbox.tcl", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tk86t.lib", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/tcl/tkstub86.lib", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/vcruntime140.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Python3/Win64/vcruntime140_1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/ShaderConductor/Win64/ShaderConductor.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/ShaderConductor/Win64/dxcompiler.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/ShaderConductor/Win64/dxil.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Vorbis/Win64/VS2015/libvorbis_64.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Windows/DirectX/x64/d3dcompiler_47.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/Windows/WinPixEventRuntime/x64/WinPixEventRuntime.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/libsndfile/Win64/libsndfile-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/MSVCP100.DLL", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/MSVCR100.DLL", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/apr_crypto_openssl-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/apr_dbd_odbc-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/apr_dbm_db-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/apr_ldap-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/changelog.txt", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/diff.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/diff3.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/diff4.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/_tbl_simple.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/adobe-stdenc.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/adobe-symbol.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/adobe-zdingbats.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/big5.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cns11643-plane1.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cns11643-plane14.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cns11643-plane2.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp037.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp038.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp10000.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp10006.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp10007.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp10029.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp1006.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp10079.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp10081.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp1026.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp273.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp274.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp275.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp277.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp278.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp280.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp281.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp284.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp285.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp290.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp297.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp420.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp423.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp424.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp437.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp500.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp737.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp775.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp850.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp851.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp852.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp855.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp856.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp857.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp860.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp861.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp862.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp863.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp864.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp865.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp866.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp868.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp869.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp870.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp871.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp874.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp875.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp880.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp891.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp903.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp904.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp905.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp918.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp932.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp936.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp949.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/cp950.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/dec-mcs.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-at-de-a.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-at-de.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-ca-fr.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-dk-no-a.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-dk-no.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-es-a.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-es-s.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-es.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-fi-se-a.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-fi-se.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-fr.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-it.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-pt.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-uk.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ebcdic-us.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/euc-jp.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/euc-kr.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/euc-tw.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/gb12345.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/gb2312.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/gb_2312-80.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/hp-roman8.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-10646-ucs-2.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-10646-ucs-4.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-2022-cn.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-2022-jp-2.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-2022-jp.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-2022-kr.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-1.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-10.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-13.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-14.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-15.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-2.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-3.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-4.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-5.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-6.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-7.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-8.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-8859-9.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-10.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-102.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-103.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-11.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-111.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-121.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-122.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-123.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-128.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-13.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-139.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-14.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-141.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-142.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-143.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-146.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-147.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-15.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-150.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-151.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-152.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-153.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-154.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-155.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-158.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-16.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-17.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-18.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-19.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-2.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-21.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-25.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-27.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-37.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-4.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-47.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-49.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-50.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-51.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-54.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-55.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-57.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-60.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-61.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-69.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-70.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-8-1.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-8-2.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-84.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-85.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-86.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-88.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-89.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-9-1.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-9-2.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-90.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-91.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-92.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-93.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-94.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-95.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-96.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-98.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso-ir-99.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso646-dk.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/iso646-kr.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/jis_x0201.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/jis_x0208-1983.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/jis_x0212-1990.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/johab.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/koi8-r.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/koi8-ru.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/koi8-u.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ksx1001.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-ce.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-croatian.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-cyrillic.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-dingbats.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-greek.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-iceland.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-japan.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-roman.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-romania.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-thai.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-turkish.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/mac-ukraine.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/macintosh.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/osd_ebcdic_df04_1.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/osd_ebcdic_df04_15.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/shift_jis.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ucs2-internal.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/ucs4-internal.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/unicode-1-1-utf-7.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/us-ascii.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/utf-16.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/utf-8.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/windows-1250.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/windows-1251.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/windows-1252.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/windows-1253.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/windows-1254.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/windows-1255.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/windows-1256.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/windows-1257.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/iconv/windows-1258.so", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libapr-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libapriconv-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libaprutil-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libdb62.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libeay32.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsasl.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libserf-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsvn_client-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsvn_delta-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsvn_diff-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsvn_fs-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsvn_ra-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsvn_repos-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsvn_subr-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsvn_swig_perl-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsvn_swig_py-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsvn_wc-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/libsvnjavahl-1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/license/APR-Iconv.license", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/license/APR-Util.license", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/license/APR.license", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/license/Berkeley-DB.license", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/license/CyrusSASL.license", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/license/OpenSSL.license", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/license/Serf.license", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/license/Subversion.license", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/license/Swig.license", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/license/ZLib.license", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/saslANONYMOUS.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/saslCRAMMD5.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/saslDIGESTMD5.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/saslLOGIN.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/saslNTLM.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/saslOTP.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/saslPLAIN.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/saslSASLDB.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/saslSCRAM.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/saslSRP.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/ssleay32.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svn-populate-node-origins-index.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svn.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnadmin.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnauthz-validate.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnauthz.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnbench.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svndumpfilter.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnfsfs.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnlook.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnmucc.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnraisetreeconflict.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnrdump.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnserve.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnsync.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/svnversion.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/ThirdParty/svn/Win64/zlib1.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/AgentInterface.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/AgentInterface.pdb", - "Type": "DebugNonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/EpicWebHelper.exe", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/OpenColorIO_2_3.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/OpenImageDenoise.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.10.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.11.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.12.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.5.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.6.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.7.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.8.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/oo2tex_win64_2.9.9.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Binaries/Win64/tbb12.dll", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Content/Renderer/TessellationTable.bin", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Content/SlateDebug/Fonts/LastResort.tps", - "Type": "DebugNonUFS" - }, - { - "Path": "$(EngineDir)/Content/SlateDebug/Fonts/LastResort.ttf", - "Type": "DebugNonUFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/DeveloperDirectoryContent.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/EditorGroupBorder.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/ErrorFilter.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/ExcludedTestsFilter.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/Fail.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/GameGroupBorder.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/Groups.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/InProcess.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/NoSessionWarning.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/NotEnoughParticipants.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/NotRun.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/Participant.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/ParticipantsWarning.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/RefreshTests.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/RefreshWorkers.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/RunTests.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/SmokeTest.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/SmokeTestFilter.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/SmokeTestParent.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/StopTests.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/Success.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/TrackTestHistory.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/VisualCommandlet.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/Warning.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Automation/WarningFilter.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Checkerboard.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/BoxShadow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Button.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Button_Disabled.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Button_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Button_Pressed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Check.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/CheckBox.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/CheckBox_Checked.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/CheckBox_Checked_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/CheckBox_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/CheckBox_Undetermined.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/CheckBox_Undetermined_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Checker.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Circle.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ColorGradingWheel.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ColorPicker_Mode_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ColorPicker_Separator.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ColorPicker_SliderHandle.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ColorSpectrum.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ColorWheel.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ColumnHeader.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ColumnHeaderMenuButton_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ColumnHeaderMenuButton_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ColumnHeader_Arrow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ColumnHeader_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ComboArrow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/CursorPing.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/DarkGroupBorder.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/DebugBorder.PNG", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Delimiter.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/DownArrow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/DropZoneIndicator_Above.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/DropZoneIndicator_Below.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/DropZoneIndicator_Onto.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/EditableTextSelectionBackground.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/EventMessage_Default.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ExpansionButton_CloseOverlay.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/GroupBorder.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/GroupBorder_Shape.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/HeaderSplitterGrip.PNG", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/LastColumnHeader_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/LeftArrow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/LightGroupBorder.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/NoiseBackground.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/PlainBorder.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ProfileVisualizer_Mono.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ProfileVisualizer_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ProfileVisualizer_Selected.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ProgressBar_Background.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ProgressBar_Fill.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ProgressBar_Marquee.PNG", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/RadioButton_SelectedBack_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/RadioButton_Selected_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/RadioButton_Unselected_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/RoundedSelection_16x.PNG", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ScrollBorderShadowBottom.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ScrollBorderShadowTop.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ScrollBoxShadowBottom.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ScrollBoxShadowLeft.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ScrollBoxShadowRight.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/ScrollBoxShadowTop.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Scrollbar_Background_Horizontal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Scrollbar_Background_Vertical.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Scrollbar_Thumb.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SearchGlass.PNG", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Selection.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Selector.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Separator.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SmallCheck.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SmallCheckBox.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SmallCheckBox_Checked.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SmallCheckBox_Checked_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SmallCheckBox_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SmallCheckBox_Undetermined.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SmallCheckBox_Undetermined_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SortDownArrow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SortDownArrows.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SortUpArrow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SortUpArrows.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SpinArrows.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Spinbox.PNG", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Spinbox_Fill.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Spinbox_Fill_Dark.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Spinbox_Fill_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Spinbox_Fill_Hovered_Dark.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Spinbox_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SplitterHandleHighlight.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/SubmenuArrow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TableViewHeader.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TableViewMajorColumn.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TextBlockHighlightShape.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TextBlockHighlightShape_Empty.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TextBox.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TextBoxLabelBorder.PNG", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TextBox_Dark.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TextBox_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TextBox_Hovered_Dark.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TextBox_ReadOnly.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TextBox_Special.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TextBox_Special_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Throbber_Piece.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TreeArrow_Collapsed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TreeArrow_Collapsed_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TreeArrow_Expanded.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/TreeArrow_Expanded_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/UpArrow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/VerticalBoxDragIndicator.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/VerticalBoxDragIndicatorShort.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/VolumeControl_High.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/VolumeControl_Low.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/VolumeControl_Mid.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/VolumeControl_Muted.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/VolumeControl_Off.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/WhiteGroupBorder.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowBackground.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowBorder.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Close_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Close_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Close_Pressed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Maximize_Disabled.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Maximize_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Maximize_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Maximize_Pressed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Minimize_Disabled.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Minimize_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Minimize_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Minimize_Pressed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Restore_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Restore_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowButton_Restore_Pressed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowOutline.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowTitle.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowTitle_Flashing.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/Window/WindowTitle_Inactive.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Common/X.PNG", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/CrashTracker/MouseCursor.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/CrashTracker/Record.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Cursor/invisible.cur", - "Type": "NonUFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/AppTabContentArea.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/AppTabWellSeparator.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/AppTab_Active.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/AppTab_ColorOverlay.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/AppTab_ColorOverlayIcon.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/AppTab_Foreground.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/AppTab_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/AppTab_Inactive.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/CloseApp_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/CloseApp_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/CloseApp_Pressed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/DockingIndicator_Center.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/OuterDockingIndicator.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/ShowTabwellButton_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/ShowTabwellButton_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/ShowTabwellButton_Pressed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/TabContentArea.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/TabWellSeparator.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/Tab_Active.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/Tab_ColorOverlay.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/Tab_ColorOverlayIcon.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/Tab_Foreground.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/Tab_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/Tab_Inactive.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Docking/Tab_Shape.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/DroidSans.tps", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/DroidSansFallback.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/DroidSansMono.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Noto.tps", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/NotoNaskhArabicUI-Regular.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/NotoSansThai-Regular.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Roboto-Black.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Roboto-BlackItalic.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Roboto-Bold.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Roboto-BoldCondensed.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Roboto-BoldCondensedItalic.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Roboto-BoldItalic.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Roboto-Italic.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Roboto-Light.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Roboto-Medium.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Roboto-Regular.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Fonts/Roboto.tps", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/BackIcon.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Cross_12x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/DefaultAppIcon.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Edit/icon_Edit_Copy_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Edit/icon_Edit_Cut_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Edit/icon_Edit_Delete_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Edit/icon_Edit_Duplicate_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Edit/icon_Edit_Paste_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Edit/icon_Edit_Rename_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Empty_14x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/NextIcon.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/SmallRoundedButton.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/SmallRoundedButtonBottom.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/SmallRoundedButtonCentre.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/SmallRoundedButtonLeft.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/SmallRoundedButtonRight.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/SmallRoundedButtonTop.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_025x_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_025x_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_025x_Pressed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_05x_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_05x_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_05x_Pressed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_1x_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_1x_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_1x_Pressed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_Screen_Rotation_Hovered.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_Screen_Rotation_Normal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PIEWindow/WindowButton_Screen_Rotation_Pressed.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/PlusSymbol_12x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/GroupBorder-16Gray.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Average_Event_Graph_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Border_L_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Border_R_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Border_TB_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Cull_Events_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Culled_12x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Custom_Tooltip_12x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Data_Capture_40x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Events_Flat_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Events_Flat_Coalesced_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Events_Hierarchial_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_FPS_Chart_40x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Filter_Events_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Filter_Presets_Tab_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Filtered_12x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Graph_View_Tab_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Has_Culled_Children_12x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_History_Back_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_History_Fwd_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_LoadMultiple_Profiler_40x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Load_Profiler_40x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Max_Event_Graph_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Settings_40x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_Tab_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/Profiler_ThreadView_SampleBorder_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_Calls_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_CollapseAll_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_CollapseSelection_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_CollapseThread_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_CopyToClipboard_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_CulledEvents_12x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_Disconnect_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_Event_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_ExpandAll_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_ExpandHotPath_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_ExpandSelection_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_ExpandThread_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_GameThread_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_GenericFilter_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_GenericGroup_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_HotPath_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_Memory_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_Number_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_OpenEventGraph_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_RenderThread_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_ResetColumn_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_ResetToDefault_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_SelectStack_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_SetRoot_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_ShowGraphData_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_SortAscending_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_SortBy_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_SortDescending_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_ViewColumn_32x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_mem_40x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_stats_40x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/Profiler/profiler_sync_40x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/TrashCan.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/TrashCan_Small.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/cursor_cardinal_cross.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/cursor_grab.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/denied_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/ellipsis_12x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/eyedropper_16px.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_Downloads_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_error_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_generic_toolbar.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_help_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_info_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_redo_16px.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_tab_Tools_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_tab_WidgetReflector_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_tab_WidgetReflector_40x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_tab_toolbar_16px.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_undo_16px.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/icon_warning_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/notificationlist_fail.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/notificationlist_success.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Icons/toolbar_expand_16x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/All_Platforms_128x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/All_Platforms_24x.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Instance_Commandlet.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Instance_Editor.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Instance_Game.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Instance_Other.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Instance_Server.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Instance_Unknown.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Launcher_Advanced.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Launcher_Back.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Launcher_Build.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Launcher_Delete.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Launcher_Deploy.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Launcher_EditSettings.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Launcher_Launch.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Launcher/Launcher_Run.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/MessageLog/Log_Error.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/MessageLog/Log_Note.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/MessageLog/Log_Warning.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Border.PNG", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Button.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/DashedBorder.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/HyperlinkDotted.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/HyperlinkUnderline.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Menu_Background.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Menu_Background_Inverted_Border_Bold.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Notification_Border_Flash.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/ActionMenuButtonBG.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/ArrowBox.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/ArrowLeft.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Arrow_D.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Arrow_L.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Arrow_R.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Arrow_U.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/BoxEdgeHighlight.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/CalloutBox.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/CalloutBox2.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/CalloutBox3.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Callout_Background.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Callout_Glow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Callout_Outline.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/CircleBox.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/CircleBox2.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/CodeBlock_Background.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/CodeBlock_Glow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/CodeBlock_Outline.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DiamondBox.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DiamondBox_B.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DiamondBox_T.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DottedCircleBox_L.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DottedCircleBox_LR.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DottedCircleBox_LR_E.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DottedCircleBox_L_E.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DottedCircleBox_R.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DottedCircleBox_R_E.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DottedSquareBox_L.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DottedSquareBox_LR.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DottedSquareBox_LR_E.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DottedSquareBox_R.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/DottedSquareBox_R_E.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Hat.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Outer/alertOutline.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Outer/alertSolid.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/PrePost_RoundedBox.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/PrePost_RoundedBox_B.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/PrePost_RoundedBox_T.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/QMark.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Roboto-Bold.ttf", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/RoundedBoxBorder.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/RoundedTileFaded.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/RoundedTile_Background.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/RoundedTile_Glow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/RoundedTile_Outline.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/SolidWhite.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/SquareBox.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/SquareBox_Solid_L.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/SquigglyBox.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Tile_Highlight.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/Underline.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/bigdot.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/blank.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/pin/pin.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/pin/pin_glow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/pin/pin_head.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/pin/pin_head_glow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/pin/pin_highlight.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/pin/pin_shadow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/pin/pin_stick.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/pin/ping.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/selectionbar/selectionbar_0.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/selectionbar/selectionbar_1.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/selectionbar/selectionbar_2.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/Tiles/smalldot.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/ToolBar_Background.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/ToolTip_Background.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/ToolTip_BrightBackground.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Old/White.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Advanced.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/AllSavedAssets.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/AutomationTools.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/CPP.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Calendar.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Console.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Copy.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Cut.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Dash_Horizontal.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Dash_Vertical.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Delete.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Developer.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/DropTargetBackground.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Duplicate.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/EyeDropper.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Favorite.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/FilterAuto.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/FlipHorizontal.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/FlipVertical.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Group_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Info.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Layout.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Linked.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/LookAt.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Merge.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Monitor.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Normalize.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/OutputLog.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/ParentHierarchy.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Paste.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/PlayerController.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Preferences.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/ProjectLauncher.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Recent.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Redo.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Rename.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Role.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Rotate180.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Rotate90Clockwise.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Rotate90Counterclockwise.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Search_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/SessionFrontend.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/SortDown.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/SortUp.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Test.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/UELogo.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/UELogo.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Undo.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/UndoHistory.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Unlinked.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/UnsavedAssets.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/UnsavedAssetsWarning.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Update.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/Visualizer.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/alert-circle.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/alert-triangle-64.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/alert-triangle-large.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/alert-triangle.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/arrow-down.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/arrow-left.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/arrow-right.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/arrow-up.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/badge-modified.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/blueprint.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/box-perspective.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/bullet-point.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/caret-down.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/caret-right.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/check-circle-large.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/check-circle.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/check.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/checker.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/chevron-down.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/chevron-left.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/chevron-right.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/chevron-up.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/circle-arrow-down.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/circle-arrow-left.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/circle-arrow-right.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/circle-arrow-up.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/close-circle.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/close-small.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/close.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/curve-editor-append-key-20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/cylinder.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/delete-outline.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/drag-handle.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/edit.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/ellipsis-vertical-narrow.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/export.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/export_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/fieldnotify_off.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/fieldnotify_on.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/file-tree-open.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/file-tree.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/file.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/filled-circle.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/filter.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/folder-cleanup.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/folder-closed.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/folder-open.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/folder-plus.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/folder-virtual-closed.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/folder-virtual-open.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/help.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/hidden.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/import.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/import_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/layout-header-body.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/layout-spreadsheet.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/lock-unlocked.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/lock.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/menu.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/minus-circle.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/minus.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/play.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/plus-circle.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/plus.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/pyriamid.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/refresh.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/reject.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/save-modified.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/save.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/search.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/server.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/settings.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/sphere.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/stop.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/tile.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/unreal-circle-thick.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/unreal-circle-thin.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/unreal-small.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/visible.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/world.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Common/x-circle.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/CheckBox/CheckBoxIndeterminate_12.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/CheckBox/CheckBoxIndeterminate_14.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/CheckBox/check.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/CheckBox/indeterminate.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/CheckBox/radio-off.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/CheckBox/radio-on.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/ComboBox/corner-dropdown.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/ComboBox/wide-chevron-down.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/FilterBar/FilterColorSegment.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/NumericEntryBox/NarrowDecorator.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/ProgressBar/ProgressMarquee.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/SegmentedBox/left.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/SegmentedBox/left.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/SegmentedBox/right.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/SegmentedBox/right.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/TableView/sort-down-arrow.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/TableView/sort-down-arrows.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/TableView/sort-up-arrow.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/TableView/sort-up-arrows.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/Window/close.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/Window/maximize.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/Window/minimize.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/CoreWidgets/Window/restore.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Docking/DockTab_Active.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Docking/DockTab_Foreground.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Docking/DockTab_Hover.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Docking/Dock_Tab_Active.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Docking/drawer-shadow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Docking/pin.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Docking/show-tab-well.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/AllTracks_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/AutoScrollDown_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/AutoScrollRight_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Callees.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Callees_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Callers.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Callers_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Connection.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/ControlsFirst.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/ControlsLast.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/ControlsNext.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/ControlsPrevious.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Counter.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Counter_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/CpuGpuTracks_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Filter.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/FilterConfig.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Frames.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Frames_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Function.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/HotPath_12.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/InfoTag_12.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Log.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Log_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/MemAllocTable.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/MemInvestigation.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/MemInvestigation_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/MemTags.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/MemTags_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Memory.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/NetStats.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/NetStats_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Networking.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/PacketContent.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/PacketContent_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Packets.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Packets_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/PluginTracks_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Session.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/SizeLarge.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/SizeLarge_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/SizeMedium.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/SizeMedium_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/SizeSmall.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/SizeSmall_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/SpecialTracks_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Tasks.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Tasks_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Timer.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Timer_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Timing.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/Timing_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/TraceStore.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/TraceStore_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/UTrace.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/UnrealInsights.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/ViewMode_20.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Insights/ZeroCountFilter.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Launcher/PaperAirplane.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/Notifications/Throbber.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_Added.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_BranchModifiedBadge.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_CheckCircleLine.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_CheckIn.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_CheckInAvailable.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_CheckInAvailableRewound.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_CheckedBranch.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_CheckedBranchBadge.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_CheckedOther.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_CheckedOtherBadge.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_ConflictResolution_Clear.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_ConflictResolution_OpenExternal.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_Conflicted.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_ConflictedState.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_Diff.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_DiskSize.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_File.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_LineCircle.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_MarkedForAdd.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_Modified.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_ModifiedLocally.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_NewerVersion.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_Promote.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_Promote_Large.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_Removed.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_Rewind.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_Rewound.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_StatusLocalUpToDate.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_StatusLocalUpload.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_StatusRemoteDownload.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_StatusRemoteUpToDate.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_Sync.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_SyncAndCheckOut.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_VerticalLine.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_VerticalLineDashed.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/RC_VerticalLineStart.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_Action_Diff.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_Action_Integrate.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_Branched.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_Changelist.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_CheckedOut.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_ContentAdd.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_DlgCheckedOutOther.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_DlgNotCurrent.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_DlgReadOnly.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_Lock.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_MarkedForDelete.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_ModifiedOtherBranch.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SCC_NotInDepot.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/SourceControl.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/Status/RevisionControl.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/Status/RevisionControlBadgeConnected.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/Status/RevisionControlBadgeWarning.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/icon_SCC_Change_Source_Control_Settings.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/icon_SCC_History.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/SourceControl/icon_SCC_Revert.svg", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Starship/StatusBar/drawer-shadow-bottom.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Testing/BrushWireframe.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Testing/DefaultPawn_16px.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Testing/FlatColorSquare.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Testing/Hyperlink.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Testing/Lit.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Testing/NewLevelBlank.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Testing/TestRotation.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Testing/Unlit.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Testing/Wireframe.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Tutorials/TutorialBorder.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Content/Slate/Tutorials/TutorialShadow.png", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Extras/GPUDumpViewer/GPUDumpViewer.html", - "Type": "DebugNonUFS" - }, - { - "Path": "$(EngineDir)/Extras/GPUDumpViewer/OpenGPUDumpViewer.bat", - "Type": "DebugNonUFS" - }, - { - "Path": "$(EngineDir)/Extras/GPUDumpViewer/OpenGPUDumpViewer.sh", - "Type": "DebugNonUFS" - }, - { - "Path": "$(EngineDir)/Plugins/2D/Paper2D/Paper2D.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/AI/AISupport/AISupport.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/AI/EnvironmentQueryEditor/EnvironmentQueryEditor.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ACLPlugin/ACLPlugin.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/AnimationData/AnimationData.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/AnimationModifierLibrary/AnimationModifierLibrary.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/BlendSpaceMotionAnalysis/BlendSpaceMotionAnalysis.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRigModules/ControlRigModules.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRigSpline/ControlRigSpline.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/ControlRig/ControlRig.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Animation/IKRig/IKRig.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Bridge/Bridge.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Cameras/CameraShakePreviewer/CameraShakePreviewer.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Cameras/GameplayCameras/GameplayCameras.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/ChaosCloth/ChaosCloth.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/ChaosVD/ChaosVD.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/CmdLinkServer/CmdLinkServer.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Compression/OodleNetwork/OodleNetwork.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/AnimationSharing/AnimationSharing.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/CLionSourceCodeAccess/CLionSourceCodeAccess.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/DumpGPUServices/DumpGPUServices.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/GitSourceControl/GitSourceControl.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/N10XSourceCodeAccess/N10XSourceCodeAccess.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PerforceSourceControl/PerforceSourceControl.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PixWinPlugin/PixWinPlugin.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PlasticSourceControl/PlasticSourceControl.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PluginUtils/PluginUtils.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/PropertyAccessNode/PropertyAccessNode.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/RenderDocPlugin/RenderDocPlugin.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/RiderSourceCodeAccess/RiderSourceCodeAccess.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/SubversionSourceControl/SubversionSourceControl.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/TextureFormatOodle/TextureFormatOodle.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/TraceDataFiltering/TraceDataFilters.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/UObjectPlugin/UObjectPlugin.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/VisualStudioCodeSourceCodeAccess/VisualStudioCodeSourceCodeAccess.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Developer/VisualStudioSourceCodeAccess/VisualStudioSourceCodeAccess.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/AssetManagerEditor/AssetManagerEditor.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/BlueprintHeaderView/BlueprintHeaderView.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ChangelistReview/ChangelistReview.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserAssetDataSource/ContentBrowserAssetDataSource.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserClassDataSource/ContentBrowserClassDataSource.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ContentBrowser/ContentBrowserFileDataSource/ContentBrowserFileDataSource.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/CryptoKeys/CryptoKeys.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/CurveEditorTools/CurveEditorTools.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/DataValidation/DataValidation.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EditorDebugTools/EditorDebugTools.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EditorScriptingUtilities/EditorScriptingUtilities.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/EngineAssetDefinitions/EngineAssetDefinitions.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/FacialAnimation/FacialAnimation.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GameplayTagsEditor/GameplayTagsEditor.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/GeometryMode/GeometryMode.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/Localization/PortableObjectFileDataSource/PortableObjectFileDataSource.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MaterialAnalyzer/MaterialAnalyzer.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MeshLODToolset/MeshLODToolset.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/MobileLauncherProfileWizard/MobileLauncherProfileWizard.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ModelingToolsEditorMode/ModelingToolsEditorMode.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ObjectMixer/LightMixer/LightMixer.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ObjectMixer/ObjectMixer/ObjectMixer.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/PluginBrowser/PluginBrowser.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/ProxyLODPlugin/ProxyLODPlugin.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/SequencerAnimTools/SequencerAnimTools.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/SpeedTreeImporter/SpeedTreeImporter.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/UVEditor/UVEditor.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Editor/WorldPartitionHLODUtilities/WorldPartitionHLODUtilities.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/EnhancedInput/EnhancedInput.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/DatasmithContent/DatasmithContent.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/GLTFExporter/GLTFExporter.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/VariantManagerContent/VariantManagerContent.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Enterprise/VariantManager/VariantManager.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/AutomationUtils/AutomationUtils.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/BackChannel/BackChannel.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosCaching/ChaosCaching.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosEditor/ChaosEditor.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosNiagara/ChaosNiagara.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosSolverPlugin/ChaosSolverPlugin.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ChaosUserDataPT/ChaosUserDataPT.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/CharacterAI/CharacterAI.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/CharacterFXEditor/BaseCharacterFXEditor/BaseCharacterFXEditor.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Dataflow/Dataflow.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/Fracture/Fracture.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/FullBodyIK/FullBodyIK.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryCollectionPlugin/GeometryCollectionPlugin.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/GeometryFlow/GeometryFlow.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/LocalizableMessage/LocalizableMessage.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/MeshModelingToolsetExp.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanProjectUtilities/MetaHumanProjectUtilities.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/OpenImageDenoise/OpenImageDenoise.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlanarCutPlugin/PlanarCut.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PlatformCrypto/PlatformCrypto.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/PythonScriptPlugin/PythonScriptPlugin.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/SkeletalReduction/SkeletalReduction.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StructUtils/StructUtils.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/StudioTelemetry/StudioTelemetry.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Experimental/ToolPresets/ToolPresets.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/FX/NiagaraSimCaching/NiagaraSimCaching.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/FX/Niagara/Niagara.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/FastBuildController/FastBuildController.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Importers/AlembicImporter/AlembicImporter.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Editor/InterchangeEditor.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Interchange.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AndroidMedia/AndroidMedia.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Media/AvfMedia/AvfMedia.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Media/ImgMedia/ImgMedia.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaCompositing/MediaCompositing.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaPlate/MediaPlate.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Media/MediaPlayerEditor/MediaPlayerEditor.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WebMMedia/WebMMedia.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Media/WmfMedia/WmfMedia.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/MeshPainting/MeshPainting.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Messaging/TcpMessaging/TcpMessaging.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Messaging/UdpMessaging/UdpMessaging.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/ActorSequence/ActorSequence.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/LevelSequenceEditor/LevelSequenceEditor.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/SequencerScripting/SequencerScripting.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/MovieScene/TemplateSequence/TemplateSequence.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Online/Android/OnlineSubsystemGooglePlay/OnlineSubsystemGooglePlay.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Online/IOS/OnlineSubsystemIOS/OnlineSubsystemIOS.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineBase/OnlineBase.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineServices/OnlineServices.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystemNull/OnlineSubsystemNull.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystemUtils/OnlineSubsystemUtils.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Online/OnlineSubsystem/OnlineSubsystem.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Portal/LauncherChunkInstaller/LauncherChunkInstaller.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/RenderGraphInsights/RenderGraphInsights.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ActorLayerUtilities/ActorLayerUtilities.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidDeviceProfileSelector/AndroidDeviceProfileSelector.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidFileServer/AndroidFileServer.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AndroidPermission/AndroidPermission.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AppleImageUtils/AppleImageUtils.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ArchVisCharacter/ArchVisCharacter.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AssetTags/AssetTags.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioCapture/AudioCapture.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioSynesthesia/AudioSynesthesia.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/AudioWidgets/AudioWidgets.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/CableComponent/CableComponent.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ChunkDownloader/ChunkDownloader.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/CustomMeshComponent/CustomMeshComponent.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ExampleDeviceProfileSelector/ExampleDeviceProfileSelector.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryCache/GeometryCache.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GeometryProcessing/GeometryProcessing.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/GooglePAD/GooglePAD.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/InputDebugging/InputDebugging.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/LocationServicesBPLibrary/LocationServicesBPLibrary.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MeshModelingToolset/MeshModelingToolset.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Metasound/Metasound.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MobilePatchingUtils/MobilePatchingUtils.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/MsQuic/MsQuic.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ProceduralMeshComponent/ProceduralMeshComponent.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/PropertyAccess/PropertyAccessEditor.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/ResonanceAudio/ResonanceAudio.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/RigVM/RigVM.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/SignificanceManager/SignificanceManager.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/SoundFields/SoundFields.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Synthesis/Synthesis.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WaveTable/WaveTable.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WebMMoviePlayer/WebMMoviePlayer.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WindowsDeviceProfileSelector/WindowsDeviceProfileSelector.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/WindowsMoviePlayer/WindowsMoviePlayer.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Runtime/Windows/XInputDevice/XInputDevice.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/Tests/InterchangeTests/InterchangeTests.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/TraceUtilities/TraceUtilities.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/VirtualProduction/Takes/Takes.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/WorldMetrics/WorldMetrics.uplugin", - "Type": "UFS" - }, - { - "Path": "$(EngineDir)/Plugins/XGEController/XGEController.uplugin", - "Type": "UFS" - } - ], - "BuildPlugins": [ - "ACLPlugin", - "AISupport", - "ActorLayerUtilities", - "ActorSequence", - "AlembicImporter", - "AndroidDeviceProfileSelector", - "AndroidFileServer", - "AndroidMedia", - "AndroidMoviePlayer", - "AndroidPermission", - "AnimationData", - "AnimationModifierLibrary", - "AnimationSharing", - "AppleImageUtils", - "AppleMoviePlayer", - "ArchVisCharacter", - "AssetManagerEditor", - "AssetTags", - "AudioCapture", - "AudioSynesthesia", - "AudioWidgets", - "AutomationUtils", - "AvfMedia", - "BackChannel", - "BaseCharacterFXEditor", - "BlendSpaceMotionAnalysis", - "BlueprintHeaderView", - "Bridge", - "CLionSourceCodeAccess", - "CableComponent", - "CameraShakePreviewer", - "ChangelistReview", - "ChaosCaching", - "ChaosCloth", - "ChaosEditor", - "ChaosNiagara", - "ChaosSolverPlugin", - "ChaosUserDataPT", - "ChaosVD", - "CharacterAI", - "ChunkDownloader", - "CmdLinkServer", - "CodeLiteSourceCodeAccess", - "ContentBrowserAssetDataSource", - "ContentBrowserClassDataSource", - "ContentBrowserFileDataSource", - "ControlRig", - "ControlRigModules", - "ControlRigSpline", - "CryptoKeys", - "CurveEditorTools", - "CustomMeshComponent", - "DataValidation", - "Dataflow", - "DatasmithContent", - "DumpGPUServices", - "EditorDebugTools", - "EditorScriptingUtilities", - "EngineAssetDefinitions", - "EnhancedInput", - "EnvironmentQueryEditor", - "ExampleDeviceProfileSelector", - "FacialAnimation", - "FastBuildController", - "Fracture", - "FullBodyIK", - "GLTFExporter", - "GameplayCameras", - "GameplayTagsEditor", - "GeometryCache", - "GeometryCollectionPlugin", - "GeometryFlow", - "GeometryMode", - "GeometryProcessing", - "GitSourceControl", - "GoogleCloudMessaging", - "GooglePAD", - "IKRig", - "IOSDeviceProfileSelector", - "ImgMedia", - "InputDebugging", - "Interchange", - "InterchangeEditor", - "InterchangeTests", - "KDevelopSourceCodeAccess", - "LauncherChunkInstaller", - "LevelSequenceEditor", - "LightMixer", - "LinuxDeviceProfileSelector", - "LocalizableMessage", - "LocationServicesBPLibrary", - "MacGraphicsSwitching", - "MaterialAnalyzer", - "MediaCompositing", - "MediaPlate", - "MediaPlayerEditor", - "MeshLODToolset", - "MeshModelingToolset", - "MeshModelingToolsetExp", - "MeshPainting", - "MetaHumanProjectUtilities", - "Metasound", - "MobileLauncherProfileWizard", - "MobilePatchingUtils", - "ModelingToolsEditorMode", - "MsQuic", - "N10XSourceCodeAccess", - "Niagara", - "NiagaraSimCaching", - "NullSourceCodeAccess", - "ObjectMixer", - "OnlineBase", - "OnlineServices", - "OnlineSubsystem", - "OnlineSubsystemGooglePlay", - "OnlineSubsystemIOS", - "OnlineSubsystemNull", - "OnlineSubsystemUtils", - "OodleNetwork", - "OpenImageDenoise", - "Paper2D", - "PerforceSourceControl", - "PixWinPlugin", - "PlanarCut", - "PlasticSourceControl", - "PlatformCrypto", - "PluginBrowser", - "PluginUtils", - "PortableObjectFileDataSource", - "ProceduralMeshComponent", - "PropertyAccessEditor", - "PropertyAccessNode", - "ProxyLODPlugin", - "PythonScriptPlugin", - "RenderDocPlugin", - "RenderGraphInsights", - "ResonanceAudio", - "RiderSourceCodeAccess", - "RigVM", - "SequencerAnimTools", - "SequencerScripting", - "SignificanceManager", - "SkeletalReduction", - "SoundFields", - "SpeedTreeImporter", - "StructUtils", - "StudioTelemetry", - "SubversionSourceControl", - "Synthesis", - "Takes", - "TcpMessaging", - "TemplateSequence", - "TextureFormatOodle", - "ToolPresets", - "TraceDataFilters", - "TraceUtilities", - "UObjectPlugin", - "UVEditor", - "UdpMessaging", - "VariantManager", - "VariantManagerContent", - "VisualStudioCodeSourceCodeAccess", - "VisualStudioSourceCodeAccess", - "WaveTable", - "WebMMedia", - "WebMMoviePlayer", - "WindowsDeviceProfileSelector", - "WindowsMoviePlayer", - "WmfMedia", - "WorldMetrics", - "WorldPartitionHLODUtilities", - "XCodeSourceCodeAccess", - "XGEController", - "XInputDevice", - "newton" - ], - "AdditionalProperties": [ - { - "Name": "SDK", - "Value": "Not Applicable" - } - ] -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Config/DefaultEditor.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Config/DefaultEditor.ini deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Config/DefaultEngine.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Config/DefaultEngine.ini deleted file mode 100644 index 1c377e8d25..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Config/DefaultEngine.ini +++ /dev/null @@ -1,234 +0,0 @@ - - -[/Script/EngineSettings.GameMapsSettings] -GameDefaultMap=/Game/level_01_firstMap.level_01_firstMap -EditorStartupMap=/Game/level_01_firstMap.level_01_firstMap - -[/Script/WindowsTargetPlatform.WindowsTargetSettings] -DefaultGraphicsRHI=DefaultGraphicsRHI_DX12 --D3D12TargetedShaderFormats=PCD3D_SM5 -+D3D12TargetedShaderFormats=PCD3D_SM6 --D3D11TargetedShaderFormats=PCD3D_SM5 -+D3D11TargetedShaderFormats=PCD3D_SM5 -Compiler=Default -AudioSampleRate=48000 -AudioCallbackBufferFrameSize=1024 -AudioNumBuffersToEnqueue=1 -AudioMaxChannels=0 -AudioNumSourceWorkers=4 -SpatializationPlugin= -SourceDataOverridePlugin= -ReverbPlugin= -OcclusionPlugin= -CompressionOverrides=(bOverrideCompressionTimes=False,DurationThreshold=5.000000,MaxNumRandomBranches=0,SoundCueQualityIndex=0) -CacheSizeKB=65536 -MaxChunkSizeOverrideKB=0 -bResampleForDevice=False -MaxSampleRate=48000.000000 -HighSampleRate=32000.000000 -MedSampleRate=24000.000000 -LowSampleRate=12000.000000 -MinSampleRate=8000.000000 -CompressionQualityModifier=1.000000 -AutoStreamingThreshold=0.000000 -SoundCueCookQualityIndex=-1 - -[/Script/Engine.RendererSettings] -r.Mobile.ShadingPath=0 -r.Mobile.AllowDeferredShadingOpenGL=False -r.Mobile.SupportGPUScene=False -r.Mobile.AntiAliasing=1 -r.Mobile.FloatPrecisionMode=0 -r.Mobile.AllowDitheredLODTransition=False -r.Mobile.VirtualTextures=False -r.DiscardUnusedQuality=False -r.AllowOcclusionQueries=True -r.MinScreenRadiusForLights=0.030000 -r.MinScreenRadiusForDepthPrepass=0.030000 -r.MinScreenRadiusForCSMDepth=0.010000 -r.PrecomputedVisibilityWarning=False -r.TextureStreaming=True -Compat.UseDXT5NormalMaps=False -r.VirtualTextures=False -r.VT.EnableAutoImport=True -r.VirtualTexturedLightmaps=False -r.VT.AnisotropicFiltering=False -bEnableVirtualTextureOpacityMask=False -r.VT.TileSize=128 -r.VT.TileBorderSize=4 -r.vt.FeedbackFactor=16 -WorkingColorSpaceChoice=sRGB -RedChromaticityCoordinate=(X=0.640000,Y=0.330000) -GreenChromaticityCoordinate=(X=0.300000,Y=0.600000) -BlueChromaticityCoordinate=(X=0.150000,Y=0.060000) -WhiteChromaticityCoordinate=(X=0.312700,Y=0.329000) -r.ClearCoatNormal=False -r.DynamicGlobalIlluminationMethod=1 -r.ReflectionMethod=1 -r.ReflectionCaptureResolution=128 -r.ReflectionEnvironmentLightmapMixBasedOnRoughness=True -r.Lumen.HardwareRayTracing=False -r.Lumen.HardwareRayTracing.LightingMode=0 -r.Lumen.TranslucencyReflections.FrontLayer.EnableForProject=False -r.Lumen.TraceMeshSDFs=1 -r.Lumen.Reflections.HardwareRayTracing.Translucent.Refraction.EnableForProject=True -r.Shadow.Virtual.Enable=1 -r.RayTracing=False -r.RayTracing.Shadows=False -r.RayTracing.UseTextureLod=False -r.PathTracing=True -r.GenerateMeshDistanceFields=True -r.DistanceFields.DefaultVoxelDensity=0.200000 -r.Nanite.ProjectEnabled=True -r.AllowStaticLighting=True -r.NormalMapsForStaticLighting=False -r.ForwardShading=False -r.VertexFoggingForOpaque=True -r.SeparateTranslucency=True -r.TranslucentSortPolicy=0 -TranslucentSortAxis=(X=0.000000,Y=-1.000000,Z=0.000000) -r.LocalFogVolume.ApplyOnTranslucent=False -xr.VRS.FoveationLevel=0 -xr.VRS.DynamicFoveation=False -r.CustomDepth=1 -r.CustomDepthTemporalAAJitter=True -r.PostProcessing.PropagateAlpha=0 -r.DefaultFeature.Bloom=True -r.DefaultFeature.AmbientOcclusion=True -r.DefaultFeature.AmbientOcclusionStaticFraction=True -r.DefaultFeature.AutoExposure=False -r.DefaultFeature.AutoExposure.Method=0 -r.DefaultFeature.AutoExposure.Bias=1.000000 -r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True -r.DefaultFeature.LocalExposure.HighlightContrastScale=0.800000 -r.DefaultFeature.LocalExposure.ShadowContrastScale=0.800000 -r.DefaultFeature.MotionBlur=False -r.DefaultFeature.LensFlare=False -r.TemporalAA.Upsampling=True -r.AntiAliasingMethod=0 -r.MSAACount=4 -r.DefaultFeature.LightUnits=1 -r.DefaultBackBufferPixelFormat=4 -r.ScreenPercentage.Default=100.000000 -r.ScreenPercentage.Default.Desktop.Mode=1 -r.ScreenPercentage.Default.Mobile.Mode=0 -r.ScreenPercentage.Default.VR.Mode=0 -r.ScreenPercentage.Default.PathTracer.Mode=0 -r.Shadow.UnbuiltPreviewInGame=True -r.StencilForLODDither=False -r.EarlyZPass=3 -r.EarlyZPassOnlyMaterialMasking=False -r.Shadow.CSMCaching=False -r.DBuffer=True -r.ClearSceneMethod=1 -r.VelocityOutputPass=0 -r.Velocity.EnableVertexDeformation=2 -r.SelectiveBasePassOutputs=False -bDefaultParticleCutouts=False -fx.GPUSimulationTextureSizeX=1024 -fx.GPUSimulationTextureSizeY=1024 -r.AllowGlobalClipPlane=False -r.GBufferFormat=1 -r.MorphTarget.Mode=True -r.MorphTarget.MaxBlendWeight=5.000000 -r.SupportSkyAtmosphere=True -r.SupportSkyAtmosphereAffectsHeightFog=True -r.SupportLocalFogVolumes=True -r.SupportCloudShadowOnForwardLitTranslucent=False -r.LightFunctionAtlas.Format=0 -r.VolumetricFog.LightFunction=True -r.Deferred.UsesLightFunctionAtlas=False -r.SingleLayerWater.UsesLightFunctionAtlas=False -r.Translucent.UsesLightFunctionAtlas=False -r.Translucent.UsesIESProfiles=False -r.Translucent.UsesRectLights=False -r.GPUCrashDebugging=False -vr.InstancedStereo=False -r.MobileHDR=True -vr.MobileMultiView=False -r.Mobile.UseHWsRGBEncoding=False -vr.RoundRobinOcclusion=False -r.MeshStreaming=False -r.HeterogeneousVolumes=True -r.HeterogeneousVolumes.Shadows=False -r.Translucency.HeterogeneousVolumes=False -r.WireframeCullThreshold=5.000000 -r.SupportStationarySkylight=True -r.SupportLowQualityLightmaps=True -r.SupportPointLightWholeSceneShadows=True -r.Shadow.TranslucentPerObject.ProjectEnabled=False -r.Water.SingleLayerWater.SupportCloudShadow=False -r.Substrate=False -r.Substrate.OpaqueMaterialRoughRefraction=False -r.Substrate.Debug.AdvancedVisualizationShaders=False -r.Material.RoughDiffuse=False -r.Material.EnergyConservation=False -r.OIT.SortedPixels=False -r.HairStrands.LODMode=True -r.SkinCache.CompileShaders=False -r.SkinCache.SkipCompilingGPUSkinVF=False -r.SkinCache.DefaultBehavior=1 -r.SkinCache.SceneMemoryLimitInMB=128.000000 -r.Mobile.EnableStaticAndCSMShadowReceivers=True -r.Mobile.EnableMovableLightCSMShaderCulling=True -r.Mobile.Forward.EnableLocalLights=1 -r.Mobile.Forward.EnableClusteredReflections=False -r.Mobile.EnableNoPrecomputedLightingCSMShader=True -r.Mobile.AllowDistanceFieldShadows=True -r.Mobile.AllowMovableDirectionalLights=True -r.Mobile.EnableMovableSpotlightsShadow=False -r.GPUSkin.Support16BitBoneIndex=False -r.GPUSkin.Limit2BoneInfluences=False -r.SupportDepthOnlyIndexBuffers=True -r.SupportReversedIndexBuffers=True -r.Mobile.AmbientOcclusion=False -r.Mobile.DBuffer=False -r.GPUSkin.UnlimitedBoneInfluences=False -r.GPUSkin.AlwaysUseDeformerForUnlimitedBoneInfluences=False -r.GPUSkin.UnlimitedBoneInfluencesThreshold=8 -DefaultBoneInfluenceLimit=(Default=0,PerPlatform=()) -MaxSkinBones=(Default=65536,PerPlatform=(("Mobile", 256))) -r.Mobile.PlanarReflectionMode=0 -r.Mobile.SupportsGen4TAA=True -bStreamSkeletalMeshLODs=(Default=False,PerPlatform=()) -bDiscardSkeletalMeshOptionalLODs=(Default=False,PerPlatform=()) -VisualizeCalibrationColorMaterialPath=/Engine/EngineMaterials/PPM_DefaultCalibrationColor.PPM_DefaultCalibrationColor -VisualizeCalibrationCustomMaterialPath=None -VisualizeCalibrationGrayscaleMaterialPath=/Engine/EngineMaterials/PPM_DefaultCalibrationGrayscale.PPM_DefaultCalibrationGrayscale - -[/Script/LinuxTargetPlatform.LinuxTargetSettings] --TargetedRHIs=SF_VULKAN_SM5 -+TargetedRHIs=SF_VULKAN_SM6 - -[/Script/HardwareTargeting.HardwareTargetingSettings] -TargetedHardwareClass=Desktop -AppliedTargetedHardwareClass=Desktop -DefaultGraphicsPerformance=Scalable -AppliedDefaultGraphicsPerformance=Scalable - -[/Script/WorldPartitionEditor.WorldPartitionEditorSettings] -CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet' - -[/Script/Engine.UserInterfaceSettings] -bAuthorizeAutomaticWidgetVariableCreation=False -FontDPIPreset=Standard -FontDPI=72 - -[/Script/Engine.Engine] -+ActiveGameNameRedirects=(OldGameName="TP_Blank",NewGameName="/Script/UnrealNewtonProject1") -+ActiveGameNameRedirects=(OldGameName="/Script/TP_Blank",NewGameName="/Script/UnrealNewtonProject1") - -[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings] -bEnablePlugin=True -bAllowNetworkConnection=True -SecurityToken=852EA54349AB9CFF1454ABA79727F69F -bIncludeInShipping=False -bAllowExternalStartInShipping=False -bCompileAFSProject=False -bUseCompression=False -bLogFiles=False -bReportStats=False -ConnectionType=USBOnly -bUseManualIPAddress=False -ManualIPAddress= - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Config/DefaultGame.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Config/DefaultGame.ini deleted file mode 100644 index 453ad7a373..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Config/DefaultGame.ini +++ /dev/null @@ -1,10 +0,0 @@ - -[/Script/EngineSettings.GeneralProjectSettings] -ProjectID=E99D23AC43FF0BB10262909CE1258613 - -[StartupActions] -bAddPacks=True -InsertPack=(PackSource="StarterContent.upack",PackName="StarterContent") - -[SectionsToSave] -+Section=StartupActions diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Config/DefaultInput.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Config/DefaultInput.ini deleted file mode 100644 index 4cc36056b3..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Config/DefaultInput.ini +++ /dev/null @@ -1,85 +0,0 @@ -[/Script/Engine.InputSettings] --AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) --AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) --AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) --AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) --AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) --AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) --AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) -+AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -bAltEnterTogglesFullscreen=True -bF11TogglesFullscreen=True -bUseMouseForTouch=False -bEnableMouseSmoothing=True -bEnableFOVScaling=True -bCaptureMouseOnLaunch=True -bEnableLegacyInputScales=True -bEnableMotionControls=True -bFilterInputByPlatformUser=False -bShouldFlushPressedKeysOnViewportFocusLost=True -bAlwaysShowTouchInterface=False -bShowConsoleOnFourFingerTap=True -bEnableGestureRecognizer=False -bUseAutocorrect=False -DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown -DefaultViewportMouseLockMode=LockOnCapture -FOVScale=0.011110 -DoubleClickTime=0.200000 -DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput -DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent -DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks --ConsoleKeys=Tilde -+ConsoleKeys=Tilde -+ConsoleKeys=Caret - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Floor_400x400.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Floor_400x400.uasset deleted file mode 100644 index 568b3e23f3..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Floor_400x400.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Pillar_50x500.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Pillar_50x500.uasset deleted file mode 100644 index 46aed7dcff..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Pillar_50x500.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/SM_AssetPlatform.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/SM_AssetPlatform.uasset deleted file mode 100644 index 1f0f0bec38..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/SM_AssetPlatform.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_400x200.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_400x200.uasset deleted file mode 100644 index a7aeff7e29..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_400x200.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_400x300.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_400x300.uasset deleted file mode 100644 index 959fd41047..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_400x300.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_400x400.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_400x400.uasset deleted file mode 100644 index 9ad5e36ac4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_400x400.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_500x500.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_500x500.uasset deleted file mode 100644 index 96e5e9baf2..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_500x500.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Door_400x300.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Door_400x300.uasset deleted file mode 100644 index 8b60b28fd4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Door_400x300.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Door_400x400.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Door_400x400.uasset deleted file mode 100644 index 55b60cbb97..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Door_400x400.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Window_400x300.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Window_400x300.uasset deleted file mode 100644 index cb91768f93..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Window_400x300.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Window_400x400.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Window_400x400.uasset deleted file mode 100644 index 1d2259dfb9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Architecture/Wall_Window_400x400.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Collapse01.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Collapse01.uasset deleted file mode 100644 index 9c68be4d22..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Collapse01.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Collapse02.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Collapse02.uasset deleted file mode 100644 index 5bd3fec056..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Collapse02.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Collapse_Cue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Collapse_Cue.uasset deleted file mode 100644 index 4548e1e082..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Collapse_Cue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Explosion01.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Explosion01.uasset deleted file mode 100644 index 2ec32d825b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Explosion01.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Explosion02.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Explosion02.uasset deleted file mode 100644 index 98174ab3f5..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Explosion02.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Explosion_Cue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Explosion_Cue.uasset deleted file mode 100644 index 7984fafb2c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Explosion_Cue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire01.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire01.uasset deleted file mode 100644 index 0c495f4f1e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire01.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire01_Cue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire01_Cue.uasset deleted file mode 100644 index 86861b6275..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire01_Cue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire_Sparks01.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire_Sparks01.uasset deleted file mode 100644 index 1479dad651..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire_Sparks01.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire_Sparks01_Cue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire_Sparks01_Cue.uasset deleted file mode 100644 index f93b729a0c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Fire_Sparks01_Cue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light01.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light01.uasset deleted file mode 100644 index 8e02bab543..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light01.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light01_Cue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light01_Cue.uasset deleted file mode 100644 index a1658708ac..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light01_Cue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light02.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light02.uasset deleted file mode 100644 index 907cd0e5c9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light02.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light02_Cue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light02_Cue.uasset deleted file mode 100644 index 1a63569538..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Light02_Cue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Smoke01.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Smoke01.uasset deleted file mode 100644 index 023a555633..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Smoke01.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Smoke01_Cue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Smoke01_Cue.uasset deleted file mode 100644 index b7d7bad2ad..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Smoke01_Cue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Background_Cue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Background_Cue.uasset deleted file mode 100644 index fc9649f44d..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Background_Cue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Birds01.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Birds01.uasset deleted file mode 100644 index 900fc5e7b7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Birds01.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Music01.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Music01.uasset deleted file mode 100644 index d40400394c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Music01.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Music_Cue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Music_Cue.uasset deleted file mode 100644 index 1bba60df04..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Music_Cue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Wind05.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Wind05.uasset deleted file mode 100644 index 36bf8d98bf..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Wind05.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Wind06.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Wind06.uasset deleted file mode 100644 index 0867c74927..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Starter_Wind06.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Steam01.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Steam01.uasset deleted file mode 100644 index a1ee8a7b4a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Steam01.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Steam01_Cue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Steam01_Cue.uasset deleted file mode 100644 index 2ef161fdca..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Audio/Steam01_Cue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/FogBrightnessLUT.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/FogBrightnessLUT.uasset deleted file mode 100644 index 6babc5b63b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/FogBrightnessLUT.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Arrows.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Arrows.uasset deleted file mode 100644 index 55151f59ea..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Arrows.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Skybox_Black.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Skybox_Black.uasset deleted file mode 100644 index 1e8f009f75..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Skybox_Black.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Skybox_HDRI.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Skybox_HDRI.uasset deleted file mode 100644 index c81172b579..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Skybox_HDRI.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Skybox_Master.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Skybox_Master.uasset deleted file mode 100644 index e47d5e08b3..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/M_LightStage_Skybox_Master.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/SM_Arrows.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/SM_Arrows.uasset deleted file mode 100644 index 94e62036e0..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/SM_Arrows.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/Skybox.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/Skybox.uasset deleted file mode 100644 index 54dc67ab32..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/Skybox.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/SunlightColorLUT.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/SunlightColorLUT.uasset deleted file mode 100644 index e2c376571a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Assets/SunlightColorLUT.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/BP_LightStudio.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/BP_LightStudio.uasset deleted file mode 100644 index b85ba861d1..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/BP_LightStudio.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset deleted file mode 100644 index b5b40a2377..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Explosion.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Explosion.uasset deleted file mode 100644 index 3e9202989c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Explosion.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Fire.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Fire.uasset deleted file mode 100644 index a0c45b8989..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Fire.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Smoke.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Smoke.uasset deleted file mode 100644 index bb648c95fc..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Smoke.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Sparks.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Sparks.uasset deleted file mode 100644 index 1c27dc47eb..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Sparks.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Steam.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Steam.uasset deleted file mode 100644 index 45417c88a7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_Effect_Steam.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_WallSconce.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_WallSconce.uasset deleted file mode 100644 index 3f29873dcf..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Blueprints/Blueprint_WallSconce.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset deleted file mode 100644 index bea801c20e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Advanced_Lighting.umap b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Advanced_Lighting.umap deleted file mode 100644 index ebf696685b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Advanced_Lighting.umap and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Advanced_Lighting_BuiltData.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Advanced_Lighting_BuiltData.uasset deleted file mode 100644 index f3802b7cc4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Advanced_Lighting_BuiltData.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Minimal_Default.umap b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Minimal_Default.umap deleted file mode 100644 index 378270c2aa..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Minimal_Default.umap and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Minimal_Default_BuiltData.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Minimal_Default_BuiltData.uasset deleted file mode 100644 index 6ed4a76600..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/Minimal_Default_BuiltData.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/StarterMap.umap b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/StarterMap.umap deleted file mode 100644 index 3d551474af..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/StarterMap.umap and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/StarterMap_BuiltData.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/StarterMap_BuiltData.uasset deleted file mode 100644 index d679016976..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Maps/StarterMap_BuiltData.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_AssetPlatform.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_AssetPlatform.uasset deleted file mode 100644 index 49627770d2..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_AssetPlatform.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Basic_Floor.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Basic_Floor.uasset deleted file mode 100644 index 6b05cb4b52..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Basic_Floor.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Basic_Wall.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Basic_Wall.uasset deleted file mode 100644 index dd5ae24f68..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Basic_Wall.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Clay_Beveled.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Clay_Beveled.uasset deleted file mode 100644 index 2b8a349d44..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Clay_Beveled.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Clay_New.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Clay_New.uasset deleted file mode 100644 index e519245256..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Clay_New.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Clay_Old.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Clay_Old.uasset deleted file mode 100644 index bd493235cb..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Clay_Old.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Cut_Stone.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Cut_Stone.uasset deleted file mode 100644 index 2ff69bc83a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Cut_Stone.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Hewn_Stone.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Hewn_Stone.uasset deleted file mode 100644 index d1d7e6794c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Brick_Hewn_Stone.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ceramic_Tile_Checker.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ceramic_Tile_Checker.uasset deleted file mode 100644 index e5f059004c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ceramic_Tile_Checker.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_CobbleStone_Pebble.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_CobbleStone_Pebble.uasset deleted file mode 100644 index 958dd1b645..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_CobbleStone_Pebble.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_CobbleStone_Rough.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_CobbleStone_Rough.uasset deleted file mode 100644 index fb1c6d3f72..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_CobbleStone_Rough.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_CobbleStone_Smooth.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_CobbleStone_Smooth.uasset deleted file mode 100644 index 642aaaaa14..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_CobbleStone_Smooth.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_ColorGrid_LowSpec.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_ColorGrid_LowSpec.uasset deleted file mode 100644 index 4b25f74384..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_ColorGrid_LowSpec.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Grime.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Grime.uasset deleted file mode 100644 index 3be6070dd3..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Grime.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Panels.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Panels.uasset deleted file mode 100644 index d843626469..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Panels.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Poured.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Poured.uasset deleted file mode 100644 index 34661dab8a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Poured.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Tiles.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Tiles.uasset deleted file mode 100644 index 26e716354b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Concrete_Tiles.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Glass.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Glass.uasset deleted file mode 100644 index 7168e4f598..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Glass.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ground_Grass.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ground_Grass.uasset deleted file mode 100644 index 1cbe2a55fa..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ground_Grass.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ground_Gravel.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ground_Gravel.uasset deleted file mode 100644 index 7d3d68f293..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ground_Gravel.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ground_Moss.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ground_Moss.uasset deleted file mode 100644 index ff1f454d05..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Ground_Moss.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Brushed_Nickel.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Brushed_Nickel.uasset deleted file mode 100644 index e34b60616d..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Brushed_Nickel.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Burnished_Steel.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Burnished_Steel.uasset deleted file mode 100644 index 5091518e90..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Burnished_Steel.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Chrome.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Chrome.uasset deleted file mode 100644 index 2997cde331..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Chrome.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Copper.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Copper.uasset deleted file mode 100644 index 2f3841c613..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Copper.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Gold.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Gold.uasset deleted file mode 100644 index 0fc3df3a00..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Gold.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Rust.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Rust.uasset deleted file mode 100644 index 8402144da3..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Rust.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Steel.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Steel.uasset deleted file mode 100644 index e303340d5b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Metal_Steel.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Basalt.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Basalt.uasset deleted file mode 100644 index d2cf1ba95c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Basalt.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Marble_Polished.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Marble_Polished.uasset deleted file mode 100644 index d177e32f1e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Marble_Polished.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Sandstone.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Sandstone.uasset deleted file mode 100644 index 4ca7e317bf..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Sandstone.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Slate.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Slate.uasset deleted file mode 100644 index 53f6bb877a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Rock_Slate.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Checker_Dot.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Checker_Dot.uasset deleted file mode 100644 index 041b0f8ead..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Checker_Dot.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Hex_Tile.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Hex_Tile.uasset deleted file mode 100644 index f1023688a4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Hex_Tile.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Hex_Tile_Pulse.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Hex_Tile_Pulse.uasset deleted file mode 100644 index 570262a019..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Hex_Tile_Pulse.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Panel.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Panel.uasset deleted file mode 100644 index 1afccae39b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Tech_Panel.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Water_Lake.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Water_Lake.uasset deleted file mode 100644 index 88a6333780..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Water_Lake.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Water_Ocean.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Water_Ocean.uasset deleted file mode 100644 index 1ff0460a90..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Water_Ocean.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Floor_Walnut_Polished.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Floor_Walnut_Polished.uasset deleted file mode 100644 index 8bbba08d1e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Floor_Walnut_Polished.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Floor_Walnut_Worn.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Floor_Walnut_Worn.uasset deleted file mode 100644 index 229a2949e6..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Floor_Walnut_Worn.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Oak.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Oak.uasset deleted file mode 100644 index d722444f25..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Oak.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Pine.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Pine.uasset deleted file mode 100644 index b02101c987..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Pine.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Walnut.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Walnut.uasset deleted file mode 100644 index 6e763410e5..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Materials/M_Wood_Walnut.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Burst.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Burst.uasset deleted file mode 100644 index 12caa0a3ba..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Burst.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Dust_Particle.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Dust_Particle.uasset deleted file mode 100644 index 4f665d0377..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Dust_Particle.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Fire_SubUV.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Fire_SubUV.uasset deleted file mode 100644 index 73f3eaabbc..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Fire_SubUV.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Heat_Distortion.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Heat_Distortion.uasset deleted file mode 100644 index d34ee5895c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Heat_Distortion.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Radial_Gradient.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Radial_Gradient.uasset deleted file mode 100644 index 9829b9a121..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Radial_Gradient.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Spark.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Spark.uasset deleted file mode 100644 index 6f6f69946b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_Spark.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_explosion_subUV.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_explosion_subUV.uasset deleted file mode 100644 index 1af76e6a4c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_explosion_subUV.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_radial_ramp.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_radial_ramp.uasset deleted file mode 100644 index b0228262c8..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_radial_ramp.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_smoke_subUV.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_smoke_subUV.uasset deleted file mode 100644 index 2086e5f0de..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/M_smoke_subUV.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/m_flare_01.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/m_flare_01.uasset deleted file mode 100644 index 824b44b5d4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/Materials/m_flare_01.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Ambient_Dust.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Ambient_Dust.uasset deleted file mode 100644 index 38b6cabf3b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Ambient_Dust.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Explosion.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Explosion.uasset deleted file mode 100644 index 8f6e03a8ad..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Explosion.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Fire.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Fire.uasset deleted file mode 100644 index 3fb74a8bff..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Fire.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Smoke.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Smoke.uasset deleted file mode 100644 index a6014dfbdb..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Smoke.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Sparks.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Sparks.uasset deleted file mode 100644 index 8a6dc37094..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Sparks.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Steam_Lit.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Steam_Lit.uasset deleted file mode 100644 index 3e96da7a52..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Particles/P_Steam_Lit.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/MaterialSphere.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/MaterialSphere.uasset deleted file mode 100644 index 6a2538f098..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/MaterialSphere.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Bush.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Bush.uasset deleted file mode 100644 index eaa4a2a55c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Bush.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Chair.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Chair.uasset deleted file mode 100644 index 76ef00f7cf..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Chair.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Door.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Door.uasset deleted file mode 100644 index 714d0f61e3..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Door.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Frame.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Frame.uasset deleted file mode 100644 index 2a2dff889f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Frame.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Lamp.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Lamp.uasset deleted file mode 100644 index 3eb6663ce2..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Lamp.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Rock.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Rock.uasset deleted file mode 100644 index 2d59537cbf..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Rock.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Shelf.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Shelf.uasset deleted file mode 100644 index 2444258416..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Shelf.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Statue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Statue.uasset deleted file mode 100644 index 775313d2cd..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_Statue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_StatueGlass.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_StatueGlass.uasset deleted file mode 100644 index d1592b36e6..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_StatueGlass.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_TableRound.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_TableRound.uasset deleted file mode 100644 index b0084288db..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/Materials/M_TableRound.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Bush.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Bush.uasset deleted file mode 100644 index 060a3766b3..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Bush.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Chair.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Chair.uasset deleted file mode 100644 index e062426303..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Chair.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_CornerFrame.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_CornerFrame.uasset deleted file mode 100644 index 57101518a0..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_CornerFrame.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Couch.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Couch.uasset deleted file mode 100644 index cc7d4088f5..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Couch.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Door.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Door.uasset deleted file mode 100644 index 22c9bfc44e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Door.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_DoorFrame.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_DoorFrame.uasset deleted file mode 100644 index ab5e96fb5a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_DoorFrame.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_GlassWindow.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_GlassWindow.uasset deleted file mode 100644 index 93863f48e0..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_GlassWindow.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Lamp_Ceiling.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Lamp_Ceiling.uasset deleted file mode 100644 index 4e55f048c5..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Lamp_Ceiling.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Lamp_Wall.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Lamp_Wall.uasset deleted file mode 100644 index a1b112ff75..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Lamp_Wall.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_PillarFrame.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_PillarFrame.uasset deleted file mode 100644 index 7cafefebf6..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_PillarFrame.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_PillarFrame300.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_PillarFrame300.uasset deleted file mode 100644 index c681a0a397..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_PillarFrame300.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Rock.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Rock.uasset deleted file mode 100644 index 419f4d52ea..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Rock.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Shelf.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Shelf.uasset deleted file mode 100644 index 7ebb820759..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Shelf.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Stairs.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Stairs.uasset deleted file mode 100644 index d0e84ccc02..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Stairs.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Statue.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Statue.uasset deleted file mode 100644 index d0e5b8d84f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_Statue.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_TableRound.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_TableRound.uasset deleted file mode 100644 index 317b8ffb32..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_TableRound.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_WindowFrame.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_WindowFrame.uasset deleted file mode 100644 index bfc9f90287..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Props/SM_WindowFrame.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Cone.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Cone.uasset deleted file mode 100644 index 200f0a2ad0..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Cone.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Cube.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Cube.uasset deleted file mode 100644 index 4d169fe10a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Cube.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Cylinder.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Cylinder.uasset deleted file mode 100644 index 06541d9fc4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Cylinder.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_NarrowCapsule.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_NarrowCapsule.uasset deleted file mode 100644 index 0322b3108a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_NarrowCapsule.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Pipe.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Pipe.uasset deleted file mode 100644 index f2549a38a1..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Pipe.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Pipe_180.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Pipe_180.uasset deleted file mode 100644 index b15233037f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Pipe_180.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Pipe_90.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Pipe_90.uasset deleted file mode 100644 index db79ad40bc..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Pipe_90.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Plane.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Plane.uasset deleted file mode 100644 index f338efa1c5..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Plane.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_QuadPyramid.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_QuadPyramid.uasset deleted file mode 100644 index e228f15ae7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_QuadPyramid.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Sphere.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Sphere.uasset deleted file mode 100644 index 0b7fc69f33..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Sphere.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Torus.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Torus.uasset deleted file mode 100644 index cfbaac4d03..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Torus.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_TriPyramid.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_TriPyramid.uasset deleted file mode 100644 index f28d85712b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_TriPyramid.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Trim.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Trim.uasset deleted file mode 100644 index 09091611de..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Trim.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Trim_90_In.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Trim_90_In.uasset deleted file mode 100644 index 6e33a90789..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Trim_90_In.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Trim_90_Out.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Trim_90_Out.uasset deleted file mode 100644 index 8125f773b9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Trim_90_Out.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Tube.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Tube.uasset deleted file mode 100644 index b2e9a438e2..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Tube.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Wedge_A.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Wedge_A.uasset deleted file mode 100644 index b99fde7c12..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Wedge_A.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Wedge_B.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Wedge_B.uasset deleted file mode 100644 index 2e8f430ad4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_Wedge_B.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_WideCapsule.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_WideCapsule.uasset deleted file mode 100644 index 830b90d54c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Shapes/Shape_WideCapsule.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Beveled_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Beveled_D.uasset deleted file mode 100644 index 8ea92271f9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Beveled_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Beveled_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Beveled_M.uasset deleted file mode 100644 index 995cc82705..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Beveled_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Beveled_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Beveled_N.uasset deleted file mode 100644 index bf6633df5f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Beveled_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_New_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_New_D.uasset deleted file mode 100644 index 5d32850911..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_New_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_New_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_New_M.uasset deleted file mode 100644 index e386e9dc9c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_New_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_New_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_New_N.uasset deleted file mode 100644 index f4dc14a93e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_New_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Old_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Old_D.uasset deleted file mode 100644 index acec5205ec..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Old_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Old_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Old_N.uasset deleted file mode 100644 index 49fac3f6d4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Clay_Old_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Cut_Stone_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Cut_Stone_D.uasset deleted file mode 100644 index 1f76e633dd..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Cut_Stone_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Cut_Stone_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Cut_Stone_N.uasset deleted file mode 100644 index 9cf63cee3f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Cut_Stone_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Hewn_Stone_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Hewn_Stone_D.uasset deleted file mode 100644 index cf67614149..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Hewn_Stone_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Hewn_Stone_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Hewn_Stone_M.uasset deleted file mode 100644 index 81c5fcf537..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Hewn_Stone_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Hewn_Stone_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Hewn_Stone_N.uasset deleted file mode 100644 index 27c49b5d70..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Brick_Hewn_Stone_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Burst_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Burst_M.uasset deleted file mode 100644 index 35b26fce7e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Burst_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Bush_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Bush_D.uasset deleted file mode 100644 index d539936703..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Bush_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Bush_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Bush_N.uasset deleted file mode 100644 index a9f1c7e3b8..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Bush_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ceramic_Tile_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ceramic_Tile_M.uasset deleted file mode 100644 index 82142181a9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ceramic_Tile_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ceramic_Tile_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ceramic_Tile_N.uasset deleted file mode 100644 index 343aeb8c9e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ceramic_Tile_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Chair_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Chair_M.uasset deleted file mode 100644 index 40e1e6fb6b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Chair_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Chair_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Chair_N.uasset deleted file mode 100644 index af1c8a4eaa..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Chair_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Checker_Noise_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Checker_Noise_M.uasset deleted file mode 100644 index 58b5668271..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Checker_Noise_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Pebble_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Pebble_D.uasset deleted file mode 100644 index bc3db66c83..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Pebble_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Pebble_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Pebble_M.uasset deleted file mode 100644 index 7a953e9640..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Pebble_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Pebble_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Pebble_N.uasset deleted file mode 100644 index 46da5475e5..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Pebble_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Rough_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Rough_D.uasset deleted file mode 100644 index 1bc4666936..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Rough_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Rough_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Rough_N.uasset deleted file mode 100644 index 935d1aff43..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Rough_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Smooth_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Smooth_D.uasset deleted file mode 100644 index 44e5597001..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Smooth_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Smooth_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Smooth_M.uasset deleted file mode 100644 index 165106fed1..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Smooth_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Smooth_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Smooth_N.uasset deleted file mode 100644 index 4207398cd1..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_CobbleStone_Smooth_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Grime_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Grime_D.uasset deleted file mode 100644 index d6667d2ba7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Grime_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Panels_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Panels_D.uasset deleted file mode 100644 index 75134e3436..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Panels_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Panels_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Panels_N.uasset deleted file mode 100644 index 6db04328a7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Panels_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Poured_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Poured_D.uasset deleted file mode 100644 index f2d651cd3a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Poured_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Poured_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Poured_N.uasset deleted file mode 100644 index edc2e1b79c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Poured_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_D.uasset deleted file mode 100644 index b98f3a74ad..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_M.uasset deleted file mode 100644 index cc1fe760b0..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_N.uasset deleted file mode 100644 index d5d6b3a24b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_Variation_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_Variation_M.uasset deleted file mode 100644 index 5edef8feb3..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Concrete_Tiles_Variation_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Detail_Rocky_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Detail_Rocky_N.uasset deleted file mode 100644 index a80dc77fdf..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Detail_Rocky_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Door_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Door_M.uasset deleted file mode 100644 index b5eec21628..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Door_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Door_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Door_N.uasset deleted file mode 100644 index 93e2c30365..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Door_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Dust_Particle_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Dust_Particle_D.uasset deleted file mode 100644 index d80b3a043c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Dust_Particle_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Explosion_SubUV.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Explosion_SubUV.uasset deleted file mode 100644 index d30f8428cd..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Explosion_SubUV.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Fire_SubUV.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Fire_SubUV.uasset deleted file mode 100644 index 6e87ac7246..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Fire_SubUV.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Fire_Tiled_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Fire_Tiled_D.uasset deleted file mode 100644 index 825765f0e1..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Fire_Tiled_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Frame_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Frame_M.uasset deleted file mode 100644 index 4aeac1c1bd..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Frame_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Frame_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Frame_N.uasset deleted file mode 100644 index b1a335dd4d..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Frame_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Gradinet_01.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Gradinet_01.uasset deleted file mode 100644 index a71d3ddd54..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Gradinet_01.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Grass_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Grass_D.uasset deleted file mode 100644 index 0ce49d33d2..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Grass_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Grass_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Grass_N.uasset deleted file mode 100644 index c69da0d6f2..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Grass_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Gravel_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Gravel_D.uasset deleted file mode 100644 index 3064541eb1..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Gravel_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Gravel_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Gravel_N.uasset deleted file mode 100644 index e9f55a7114..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Gravel_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Moss_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Moss_N.uasset deleted file mode 100644 index 898e6ee73e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Ground_Moss_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Lamp_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Lamp_M.uasset deleted file mode 100644 index e1958b0e9c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Lamp_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Lamp_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Lamp_N.uasset deleted file mode 100644 index 77e47bda94..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Lamp_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_MacroVariation.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_MacroVariation.uasset deleted file mode 100644 index dca6463fa6..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_MacroVariation.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Aluminum_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Aluminum_D.uasset deleted file mode 100644 index 225628a02c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Aluminum_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Copper_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Copper_D.uasset deleted file mode 100644 index df0cacb1b7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Copper_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Gold_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Gold_D.uasset deleted file mode 100644 index 0762c01889..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Gold_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Gold_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Gold_N.uasset deleted file mode 100644 index 938e7c37dc..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Gold_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Rust_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Rust_D.uasset deleted file mode 100644 index 2a47b538c9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Rust_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Rust_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Rust_N.uasset deleted file mode 100644 index c94e24d4c0..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Rust_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Steel_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Steel_D.uasset deleted file mode 100644 index bc8ee97e88..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Steel_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Steel_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Steel_N.uasset deleted file mode 100644 index bd90253a6b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Metal_Steel_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Perlin_Noise_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Perlin_Noise_M.uasset deleted file mode 100644 index a71f39ddaa..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Perlin_Noise_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_RockMesh_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_RockMesh_M.uasset deleted file mode 100644 index 91a8dbe0d7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_RockMesh_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_RockMesh_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_RockMesh_N.uasset deleted file mode 100644 index cf183466f2..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_RockMesh_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Basalt_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Basalt_D.uasset deleted file mode 100644 index 15197b243c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Basalt_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Basalt_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Basalt_N.uasset deleted file mode 100644 index 17ac16e6f2..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Basalt_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Marble_Polished_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Marble_Polished_D.uasset deleted file mode 100644 index cc564e59c4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Marble_Polished_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Sandstone_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Sandstone_D.uasset deleted file mode 100644 index efc7c83518..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Sandstone_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Sandstone_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Sandstone_N.uasset deleted file mode 100644 index 942331bb46..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Sandstone_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Slate_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Slate_D.uasset deleted file mode 100644 index b460e816ad..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Slate_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Slate_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Slate_N.uasset deleted file mode 100644 index 3eb6b14ce7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Slate_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Smooth_Granite_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Smooth_Granite_D.uasset deleted file mode 100644 index 9c11db261f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Rock_Smooth_Granite_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Shelf_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Shelf_M.uasset deleted file mode 100644 index 40bea03472..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Shelf_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Shelf_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Shelf_N.uasset deleted file mode 100644 index 5cb6c715b9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Shelf_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Single_Tile_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Single_Tile_N.uasset deleted file mode 100644 index ddc0828356..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Single_Tile_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Smoke_SubUV.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Smoke_SubUV.uasset deleted file mode 100644 index 5c8a2d915f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Smoke_SubUV.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Smoke_Tiled_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Smoke_Tiled_D.uasset deleted file mode 100644 index aad7a5ea5c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Smoke_Tiled_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Spark_Core.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Spark_Core.uasset deleted file mode 100644 index 3881b885a1..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Spark_Core.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Statue_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Statue_M.uasset deleted file mode 100644 index d43158a051..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Statue_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Statue_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Statue_N.uasset deleted file mode 100644 index 787d2d5099..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Statue_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_TableRound_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_TableRound_M.uasset deleted file mode 100644 index a76573e0de..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_TableRound_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_TableRound_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_TableRound_N.uasset deleted file mode 100644 index 619c4201e4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_TableRound_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Dot_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Dot_M.uasset deleted file mode 100644 index fb692b3bd8..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Dot_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Dot_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Dot_N.uasset deleted file mode 100644 index 50d81c2030..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Dot_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Hex_Tile_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Hex_Tile_M.uasset deleted file mode 100644 index 502170b310..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Hex_Tile_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Hex_Tile_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Hex_Tile_N.uasset deleted file mode 100644 index 549633cf0c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Hex_Tile_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Panel_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Panel_M.uasset deleted file mode 100644 index 192a8e4d81..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Panel_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Panel_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Panel_N.uasset deleted file mode 100644 index b12087e7d5..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Tech_Panel_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Water_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Water_M.uasset deleted file mode 100644 index 63e9b4e1ba..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Water_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Water_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Water_N.uasset deleted file mode 100644 index dc83c1b016..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Water_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Floor_Walnut_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Floor_Walnut_D.uasset deleted file mode 100644 index 0598d9ec91..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Floor_Walnut_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Floor_Walnut_M.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Floor_Walnut_M.uasset deleted file mode 100644 index 1af473f0d7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Floor_Walnut_M.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Floor_Walnut_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Floor_Walnut_N.uasset deleted file mode 100644 index dae4bb423b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Floor_Walnut_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Oak_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Oak_D.uasset deleted file mode 100644 index c5494a9318..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Oak_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Oak_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Oak_N.uasset deleted file mode 100644 index 71543aa30e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Oak_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Pine_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Pine_D.uasset deleted file mode 100644 index eac50af4eb..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Pine_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Pine_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Pine_N.uasset deleted file mode 100644 index 051a794e75..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Pine_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Walnut_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Walnut_D.uasset deleted file mode 100644 index bc3c3df891..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Walnut_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Walnut_N.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Walnut_N.uasset deleted file mode 100644 index 856a1f86cf..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_Wood_Walnut_N.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_ground_Moss_D.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_ground_Moss_D.uasset deleted file mode 100644 index 2b9ca5b38a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/StarterContent/Textures/T_ground_Moss_D.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/21/G9ZFKF504TPGUZEIIM4OON.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/21/G9ZFKF504TPGUZEIIM4OON.uasset deleted file mode 100644 index bf9a8b3b6e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/21/G9ZFKF504TPGUZEIIM4OON.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/35/UY1AO3DNTM80KQQWH6809U.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/35/UY1AO3DNTM80KQQWH6809U.uasset deleted file mode 100644 index 029ed42cf5..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/35/UY1AO3DNTM80KQQWH6809U.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/EA/R5ZS7N6OEOJ0JCXIYW7L6E.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/EA/R5ZS7N6OEOJ0JCXIYW7L6E.uasset deleted file mode 100644 index e752615f25..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/EA/R5ZS7N6OEOJ0JCXIYW7L6E.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/KS/RJP3YGPC5WSGM5XC1FID1Z.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/KS/RJP3YGPC5WSGM5XC1FID1Z.uasset deleted file mode 100644 index 1e52226576..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/KS/RJP3YGPC5WSGM5XC1FID1Z.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/X2/NH3IA1N41B3GPG8R8T80O2.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/X2/NH3IA1N41B3GPG8R8T80O2.uasset deleted file mode 100644 index cc7fd1238c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/X2/NH3IA1N41B3GPG8R8T80O2.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/XN/06L1E61GZR15PQ2F4KK068.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/XN/06L1E61GZR15PQ2F4KK068.uasset deleted file mode 100644 index 4611aa19e9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/0/XN/06L1E61GZR15PQ2F4KK068.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/24/UAV7LP2672YYYQCGSH24XL.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/24/UAV7LP2672YYYQCGSH24XL.uasset deleted file mode 100644 index 965496bd7c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/24/UAV7LP2672YYYQCGSH24XL.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/70/I3JC7VE85H6TR3IWWJ39CO.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/70/I3JC7VE85H6TR3IWWJ39CO.uasset deleted file mode 100644 index 76102b7dcf..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/70/I3JC7VE85H6TR3IWWJ39CO.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/8G/K2GFIK87MXBJLMYJA1GBEB.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/8G/K2GFIK87MXBJLMYJA1GBEB.uasset deleted file mode 100644 index 2e0e5099ab..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/8G/K2GFIK87MXBJLMYJA1GBEB.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/I2/9AJ7A0ZZ7LMFKT1Q5FZI14.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/I2/9AJ7A0ZZ7LMFKT1Q5FZI14.uasset deleted file mode 100644 index c200f28a52..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/I2/9AJ7A0ZZ7LMFKT1Q5FZI14.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/JJ/63AX2YIQ5U63UDQDKPB4KH.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/JJ/63AX2YIQ5U63UDQDKPB4KH.uasset deleted file mode 100644 index 72a8580f37..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/JJ/63AX2YIQ5U63UDQDKPB4KH.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/UA/ZJQELNBRQVG6DF8QTGPR52.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/UA/ZJQELNBRQVG6DF8QTGPR52.uasset deleted file mode 100644 index ea662f2358..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/UA/ZJQELNBRQVG6DF8QTGPR52.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/VI/86NIFXJJJK8PUWR9O5L2QB.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/VI/86NIFXJJJK8PUWR9O5L2QB.uasset deleted file mode 100644 index 5e29c39a83..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/VI/86NIFXJJJK8PUWR9O5L2QB.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/XO/PKAZ4J4LMOPUEU2VT1PBEH.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/XO/PKAZ4J4LMOPUEU2VT1PBEH.uasset deleted file mode 100644 index a8c09810f4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/XO/PKAZ4J4LMOPUEU2VT1PBEH.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/Z7/RZUAE9W3WHA9CANL6NKHYG.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/Z7/RZUAE9W3WHA9CANL6NKHYG.uasset deleted file mode 100644 index 1cd024a997..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/1/Z7/RZUAE9W3WHA9CANL6NKHYG.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/3M/GUABCDTNOQOGPR0C1MDU8G.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/3M/GUABCDTNOQOGPR0C1MDU8G.uasset deleted file mode 100644 index 6acf9247d7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/3M/GUABCDTNOQOGPR0C1MDU8G.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/5P/225HDGWQ1QKNR0EJ653JEX.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/5P/225HDGWQ1QKNR0EJ653JEX.uasset deleted file mode 100644 index a8f58948f4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/5P/225HDGWQ1QKNR0EJ653JEX.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/8C/HI8J2ZCOVV0YJPZAB6VDUO.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/8C/HI8J2ZCOVV0YJPZAB6VDUO.uasset deleted file mode 100644 index 90619285ca..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/8C/HI8J2ZCOVV0YJPZAB6VDUO.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/DO/QI65QUTOO00QDLLO1WC0LK.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/DO/QI65QUTOO00QDLLO1WC0LK.uasset deleted file mode 100644 index d7b3bc9b86..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/DO/QI65QUTOO00QDLLO1WC0LK.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/DT/4P57YK669E36RD1J3ZNM4G.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/DT/4P57YK669E36RD1J3ZNM4G.uasset deleted file mode 100644 index cdc70d512c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/DT/4P57YK669E36RD1J3ZNM4G.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/HJ/G6PKSHZJZOZ5RS1UJWQKLO.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/HJ/G6PKSHZJZOZ5RS1UJWQKLO.uasset deleted file mode 100644 index aac2b52360..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/HJ/G6PKSHZJZOZ5RS1UJWQKLO.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/HV/TVPMMZVVMDQZ6PJGS2SRQS.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/HV/TVPMMZVVMDQZ6PJGS2SRQS.uasset deleted file mode 100644 index 9091d256a9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/HV/TVPMMZVVMDQZ6PJGS2SRQS.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/JG/Y4SCIPR5SGJ0UMJVVK7HPC.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/JG/Y4SCIPR5SGJ0UMJVVK7HPC.uasset deleted file mode 100644 index 79bfde4431..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/JG/Y4SCIPR5SGJ0UMJVVK7HPC.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/K6/UQAP499DFZ56ZF9SVC1560.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/K6/UQAP499DFZ56ZF9SVC1560.uasset deleted file mode 100644 index 8da9094a24..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/K6/UQAP499DFZ56ZF9SVC1560.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/Q6/GEF7NCDSJL1OM7D9IHAQVD.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/Q6/GEF7NCDSJL1OM7D9IHAQVD.uasset deleted file mode 100644 index 4222b2fc77..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/Q6/GEF7NCDSJL1OM7D9IHAQVD.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/V3/6EYOVKS2D1UBESFA4MUL0K.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/V3/6EYOVKS2D1UBESFA4MUL0K.uasset deleted file mode 100644 index 30b82f8e61..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/V3/6EYOVKS2D1UBESFA4MUL0K.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/V4/CS9HBIOJX9LNNOSHEFI1GO.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/V4/CS9HBIOJX9LNNOSHEFI1GO.uasset deleted file mode 100644 index 974b0ba812..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/2/V4/CS9HBIOJX9LNNOSHEFI1GO.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/4V/R9FKDAG63K7P0FRORKBQ90.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/4V/R9FKDAG63K7P0FRORKBQ90.uasset deleted file mode 100644 index 9e7fc6445e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/4V/R9FKDAG63K7P0FRORKBQ90.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/AL/11DHA3CGY98L5ZXBYPMMOP.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/AL/11DHA3CGY98L5ZXBYPMMOP.uasset deleted file mode 100644 index 43f3912975..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/AL/11DHA3CGY98L5ZXBYPMMOP.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/FG/LDJZHUAC2LB2OOKARBM7ZY.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/FG/LDJZHUAC2LB2OOKARBM7ZY.uasset deleted file mode 100644 index a755df4525..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/FG/LDJZHUAC2LB2OOKARBM7ZY.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/FR/OFLZ2XZQPCAR38FF7YQ6T3.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/FR/OFLZ2XZQPCAR38FF7YQ6T3.uasset deleted file mode 100644 index 04e6a9484d..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/FR/OFLZ2XZQPCAR38FF7YQ6T3.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/H9/CFIZYB88NMILCQBS16JBWQ.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/H9/CFIZYB88NMILCQBS16JBWQ.uasset deleted file mode 100644 index 7aa3cf459d..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/H9/CFIZYB88NMILCQBS16JBWQ.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/HT/BUWMRW6TOGEL9S23B0FSNA.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/HT/BUWMRW6TOGEL9S23B0FSNA.uasset deleted file mode 100644 index f36d3c43ad..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/HT/BUWMRW6TOGEL9S23B0FSNA.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/N9/7TVRLQII1OY4W5DP1ZRSJ9.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/N9/7TVRLQII1OY4W5DP1ZRSJ9.uasset deleted file mode 100644 index fb378bd5c3..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/N9/7TVRLQII1OY4W5DP1ZRSJ9.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/PL/NWGJBFRK4LFVK5EXPX1CR2.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/PL/NWGJBFRK4LFVK5EXPX1CR2.uasset deleted file mode 100644 index 9459a71886..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/PL/NWGJBFRK4LFVK5EXPX1CR2.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/SF/ILRQRZGYL6PI56FI39UF7V.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/SF/ILRQRZGYL6PI56FI39UF7V.uasset deleted file mode 100644 index 400b287129..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/3/SF/ILRQRZGYL6PI56FI39UF7V.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/2K/QBTJLK6VDKPA2ZC6SI40KT.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/2K/QBTJLK6VDKPA2ZC6SI40KT.uasset deleted file mode 100644 index dcb4075953..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/2K/QBTJLK6VDKPA2ZC6SI40KT.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/3M/9LENS7Y4U7R4JGAZLDFRTM.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/3M/9LENS7Y4U7R4JGAZLDFRTM.uasset deleted file mode 100644 index 9a402c0b30..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/3M/9LENS7Y4U7R4JGAZLDFRTM.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/43/26XZF4LWKF89LXRYUA9C8I.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/43/26XZF4LWKF89LXRYUA9C8I.uasset deleted file mode 100644 index 298160d3c7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/43/26XZF4LWKF89LXRYUA9C8I.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/91/T0BHJ4XEJPYUXXGBO6ZGE0.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/91/T0BHJ4XEJPYUXXGBO6ZGE0.uasset deleted file mode 100644 index d17b98b5dc..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/91/T0BHJ4XEJPYUXXGBO6ZGE0.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/HF/9T7A4DI8L7WVHH3M3ZV0X4.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/HF/9T7A4DI8L7WVHH3M3ZV0X4.uasset deleted file mode 100644 index af7b6f7267..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/HF/9T7A4DI8L7WVHH3M3ZV0X4.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/S6/U8WWPQB9AFRAYAKNS94A1S.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/S6/U8WWPQB9AFRAYAKNS94A1S.uasset deleted file mode 100644 index 0c7ee21e0b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/S6/U8WWPQB9AFRAYAKNS94A1S.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/SO/CUHOMK0WKGOL1SZ3NUNEZD.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/SO/CUHOMK0WKGOL1SZ3NUNEZD.uasset deleted file mode 100644 index 6b1f0692f9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/SO/CUHOMK0WKGOL1SZ3NUNEZD.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/UL/IR7TW0W7PU2BYAWXMN1MFY.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/UL/IR7TW0W7PU2BYAWXMN1MFY.uasset deleted file mode 100644 index e9fdd9c980..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/UL/IR7TW0W7PU2BYAWXMN1MFY.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/UR/FKW0LLPZDXUM4LRBSERZ7W.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/UR/FKW0LLPZDXUM4LRBSERZ7W.uasset deleted file mode 100644 index a18d707dee..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/UR/FKW0LLPZDXUM4LRBSERZ7W.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/YK/H5MFRC62UUMKAKQ6B0XO1V.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/YK/H5MFRC62UUMKAKQ6B0XO1V.uasset deleted file mode 100644 index e5e098a2b4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/4/YK/H5MFRC62UUMKAKQ6B0XO1V.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/66/2DUJH8YELSCEC3TEYYT1HH.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/66/2DUJH8YELSCEC3TEYYT1HH.uasset deleted file mode 100644 index d83a003b29..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/66/2DUJH8YELSCEC3TEYYT1HH.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/6J/KWKNXI5AI9BX7GIGI1KWVP.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/6J/KWKNXI5AI9BX7GIGI1KWVP.uasset deleted file mode 100644 index 61921af824..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/6J/KWKNXI5AI9BX7GIGI1KWVP.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/B0/28GTDR5X6OIMV44DTNYHMR.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/B0/28GTDR5X6OIMV44DTNYHMR.uasset deleted file mode 100644 index 5fe133d36d..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/B0/28GTDR5X6OIMV44DTNYHMR.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/BD/UDG9IHJV17ROB9PO9IPOQD.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/BD/UDG9IHJV17ROB9PO9IPOQD.uasset deleted file mode 100644 index 7f2e7c4c09..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/BD/UDG9IHJV17ROB9PO9IPOQD.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/EA/9XWXW8NNI9V1K4XBA100IR.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/EA/9XWXW8NNI9V1K4XBA100IR.uasset deleted file mode 100644 index b743cf2c0c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/EA/9XWXW8NNI9V1K4XBA100IR.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/RM/ORLQSBTY11JWF483Q3UFB5.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/RM/ORLQSBTY11JWF483Q3UFB5.uasset deleted file mode 100644 index b76e3cd4ec..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/RM/ORLQSBTY11JWF483Q3UFB5.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/T7/5E4ES7A54XGRDJLBM3JJK7.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/T7/5E4ES7A54XGRDJLBM3JJK7.uasset deleted file mode 100644 index 2c0773b353..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/T7/5E4ES7A54XGRDJLBM3JJK7.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/X0/QV83DNJUR5CJXJ24K3ZIHP.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/X0/QV83DNJUR5CJXJ24K3ZIHP.uasset deleted file mode 100644 index 15edf32016..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/5/X0/QV83DNJUR5CJXJ24K3ZIHP.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/3T/591VMRNF07RXBADF6B7YRL.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/3T/591VMRNF07RXBADF6B7YRL.uasset deleted file mode 100644 index c1a7e47267..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/3T/591VMRNF07RXBADF6B7YRL.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/75/ILYWRS1EIRGDL0T362G4PY.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/75/ILYWRS1EIRGDL0T362G4PY.uasset deleted file mode 100644 index 81eaa42eb9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/75/ILYWRS1EIRGDL0T362G4PY.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/9Q/TJ6CDG2M7J3THM28X1K5W7.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/9Q/TJ6CDG2M7J3THM28X1K5W7.uasset deleted file mode 100644 index a7a63dcb34..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/9Q/TJ6CDG2M7J3THM28X1K5W7.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/AV/KTFXF8YCL1MKQNLT43NF69.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/AV/KTFXF8YCL1MKQNLT43NF69.uasset deleted file mode 100644 index 7d9dfdb085..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/AV/KTFXF8YCL1MKQNLT43NF69.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/CV/84O91MOP73CBPD6JD75S31.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/CV/84O91MOP73CBPD6JD75S31.uasset deleted file mode 100644 index f082544c6e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/CV/84O91MOP73CBPD6JD75S31.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/DB/KLZ59UPDVOACO2P0E99RV7.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/DB/KLZ59UPDVOACO2P0E99RV7.uasset deleted file mode 100644 index f4da99c491..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/DB/KLZ59UPDVOACO2P0E99RV7.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/GB/VKUYCIN49ZEC2BZI5UG3F6.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/GB/VKUYCIN49ZEC2BZI5UG3F6.uasset deleted file mode 100644 index e24b1b43ca..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/GB/VKUYCIN49ZEC2BZI5UG3F6.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/NJ/QNTSUW6U6P8OC6EWY91E98.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/NJ/QNTSUW6U6P8OC6EWY91E98.uasset deleted file mode 100644 index a22690998d..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/NJ/QNTSUW6U6P8OC6EWY91E98.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/QE/TYKZJI261KARC87V6F9OZF.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/QE/TYKZJI261KARC87V6F9OZF.uasset deleted file mode 100644 index a15b10d970..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/QE/TYKZJI261KARC87V6F9OZF.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/U3/1UOH4ATCU5E7ME07PXM1Y7.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/U3/1UOH4ATCU5E7ME07PXM1Y7.uasset deleted file mode 100644 index 64ab780303..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/U3/1UOH4ATCU5E7ME07PXM1Y7.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/U9/T1LKOUWKFUFVKR0TKPSCPW.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/U9/T1LKOUWKFUFVKR0TKPSCPW.uasset deleted file mode 100644 index 8e92f72e6b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/U9/T1LKOUWKFUFVKR0TKPSCPW.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/X4/K602AZ90437QLCIFLC071G.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/X4/K602AZ90437QLCIFLC071G.uasset deleted file mode 100644 index 39f4dc2146..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/6/X4/K602AZ90437QLCIFLC071G.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/56/LN65F8LBJD0WDN1WHLJ396.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/56/LN65F8LBJD0WDN1WHLJ396.uasset deleted file mode 100644 index 5ac06ba121..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/56/LN65F8LBJD0WDN1WHLJ396.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/AH/AFP4UZOLZ0MUI3QXYSIWFM.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/AH/AFP4UZOLZ0MUI3QXYSIWFM.uasset deleted file mode 100644 index 425b05f377..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/AH/AFP4UZOLZ0MUI3QXYSIWFM.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/CV/7GAHOL28VWVW1ME3PJ3686.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/CV/7GAHOL28VWVW1ME3PJ3686.uasset deleted file mode 100644 index aa51275348..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/CV/7GAHOL28VWVW1ME3PJ3686.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/ER/KKVHPHZY3EB725PQWR8DYQ.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/ER/KKVHPHZY3EB725PQWR8DYQ.uasset deleted file mode 100644 index ea0b9ef480..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/ER/KKVHPHZY3EB725PQWR8DYQ.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/IX/57NWEK11WI7P7GSY2EA6IE.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/IX/57NWEK11WI7P7GSY2EA6IE.uasset deleted file mode 100644 index 55594eb141..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/IX/57NWEK11WI7P7GSY2EA6IE.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/IZ/MOW2D3HG1SE17K4EFA1HD2.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/IZ/MOW2D3HG1SE17K4EFA1HD2.uasset deleted file mode 100644 index b201d2ff8c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/IZ/MOW2D3HG1SE17K4EFA1HD2.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/NN/DHY5PMTENTDHG4G8KYMXPC.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/NN/DHY5PMTENTDHG4G8KYMXPC.uasset deleted file mode 100644 index 819422a4f9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/7/NN/DHY5PMTENTDHG4G8KYMXPC.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/3Y/VMLSAVQW68GVJG01OOAH62.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/3Y/VMLSAVQW68GVJG01OOAH62.uasset deleted file mode 100644 index 97d782f5d6..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/3Y/VMLSAVQW68GVJG01OOAH62.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/6K/ZSI6B5FHUK1Z9M7MPXECD9.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/6K/ZSI6B5FHUK1Z9M7MPXECD9.uasset deleted file mode 100644 index 6c843cad44..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/6K/ZSI6B5FHUK1Z9M7MPXECD9.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/CD/DYKOSO3U3EABMHYDKWCDKH.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/CD/DYKOSO3U3EABMHYDKWCDKH.uasset deleted file mode 100644 index 2c15e3d507..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/CD/DYKOSO3U3EABMHYDKWCDKH.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/EL/0WQS5FBD0VGH2CF8D6DK77.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/EL/0WQS5FBD0VGH2CF8D6DK77.uasset deleted file mode 100644 index e9973faad7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/EL/0WQS5FBD0VGH2CF8D6DK77.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/VB/I2U95YF34PXX4NGRD34ZH7.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/VB/I2U95YF34PXX4NGRD34ZH7.uasset deleted file mode 100644 index 701ad553a5..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/VB/I2U95YF34PXX4NGRD34ZH7.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/Z8/G6SXMLQJEHEL78K1SGVLP0.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/Z8/G6SXMLQJEHEL78K1SGVLP0.uasset deleted file mode 100644 index ad71432cf0..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/8/Z8/G6SXMLQJEHEL78K1SGVLP0.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/0E/Y1F7ENIRO0RN59WM6CRYPP.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/0E/Y1F7ENIRO0RN59WM6CRYPP.uasset deleted file mode 100644 index 14b00f7063..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/0E/Y1F7ENIRO0RN59WM6CRYPP.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/4U/IC6NTT9J96IU4B19BFQ6LA.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/4U/IC6NTT9J96IU4B19BFQ6LA.uasset deleted file mode 100644 index 0916abb202..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/4U/IC6NTT9J96IU4B19BFQ6LA.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/A7/0VTJ4VQG5LXC7QEYZT0QSH.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/A7/0VTJ4VQG5LXC7QEYZT0QSH.uasset deleted file mode 100644 index 631fc9284f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/A7/0VTJ4VQG5LXC7QEYZT0QSH.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/A8/7H3P0KG6PSJZKZOXN5HDCN.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/A8/7H3P0KG6PSJZKZOXN5HDCN.uasset deleted file mode 100644 index f86aa5e364..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/A8/7H3P0KG6PSJZKZOXN5HDCN.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/AU/DUGNPH9QUECKA2YIT7U2MT.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/AU/DUGNPH9QUECKA2YIT7U2MT.uasset deleted file mode 100644 index df7da1b1f9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/AU/DUGNPH9QUECKA2YIT7U2MT.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/CA/ROKBUARWWBJVQQ9LXEHWD5.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/CA/ROKBUARWWBJVQQ9LXEHWD5.uasset deleted file mode 100644 index 8f0c323427..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/CA/ROKBUARWWBJVQQ9LXEHWD5.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/GY/9FAN5HK69SIZU92B479UUC.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/GY/9FAN5HK69SIZU92B479UUC.uasset deleted file mode 100644 index 4d8e13b2c9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/GY/9FAN5HK69SIZU92B479UUC.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/HA/T0LTQ86LNLVAFTYN5UKU3Q.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/HA/T0LTQ86LNLVAFTYN5UKU3Q.uasset deleted file mode 100644 index 48316c85a1..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/HA/T0LTQ86LNLVAFTYN5UKU3Q.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/LA/LX35SWRHHDIA4RI26C0WPV.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/LA/LX35SWRHHDIA4RI26C0WPV.uasset deleted file mode 100644 index c06e817b9d..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/LA/LX35SWRHHDIA4RI26C0WPV.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/OG/DFKUB4MQINU2L1YUVT7MXP.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/OG/DFKUB4MQINU2L1YUVT7MXP.uasset deleted file mode 100644 index 5a7d30df87..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/OG/DFKUB4MQINU2L1YUVT7MXP.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/UW/NTP7BPD3QBBZHBYSCZ9HXH.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/UW/NTP7BPD3QBBZHBYSCZ9HXH.uasset deleted file mode 100644 index 17eaa2e42a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/9/UW/NTP7BPD3QBBZHBYSCZ9HXH.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/3V/71KXRG03P0KFZT8OTMPWZ8.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/3V/71KXRG03P0KFZT8OTMPWZ8.uasset deleted file mode 100644 index e21dd5b82d..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/3V/71KXRG03P0KFZT8OTMPWZ8.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/4E/MS6FHNNF8XS4RKO7RKM42O.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/4E/MS6FHNNF8XS4RKO7RKM42O.uasset deleted file mode 100644 index 857a9a9be2..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/4E/MS6FHNNF8XS4RKO7RKM42O.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/78/UX3AVJ63ENQBPGR01218RP.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/78/UX3AVJ63ENQBPGR01218RP.uasset deleted file mode 100644 index b68b319b42..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/78/UX3AVJ63ENQBPGR01218RP.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/EG/8T088KLKKH8ZUK2SNG5PYB.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/EG/8T088KLKKH8ZUK2SNG5PYB.uasset deleted file mode 100644 index 675dbcfdea..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/EG/8T088KLKKH8ZUK2SNG5PYB.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/MG/DJ0BEX0UCE5KWJST5ZNZZO.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/MG/DJ0BEX0UCE5KWJST5ZNZZO.uasset deleted file mode 100644 index 465f8f1dda..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/MG/DJ0BEX0UCE5KWJST5ZNZZO.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/QQ/3D9MY5ZW4NQ5MG3UZJJAF6.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/QQ/3D9MY5ZW4NQ5MG3UZJJAF6.uasset deleted file mode 100644 index c9382a9dfb..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/QQ/3D9MY5ZW4NQ5MG3UZJJAF6.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/VL/MPPFYK36TQBU2DBT4STL93.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/VL/MPPFYK36TQBU2DBT4STL93.uasset deleted file mode 100644 index d3b7411c8d..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/VL/MPPFYK36TQBU2DBT4STL93.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/YB/EOY5EHYOGR9MBBF7NELCSI.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/YB/EOY5EHYOGR9MBBF7NELCSI.uasset deleted file mode 100644 index 91631ea053..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/A/YB/EOY5EHYOGR9MBBF7NELCSI.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/15/A6A40EV2NOYVA98JGJYC3H.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/15/A6A40EV2NOYVA98JGJYC3H.uasset deleted file mode 100644 index b50d87a3f3..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/15/A6A40EV2NOYVA98JGJYC3H.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/2Q/TSYZ1MCOJLTCS8YDLYPH9S.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/2Q/TSYZ1MCOJLTCS8YDLYPH9S.uasset deleted file mode 100644 index 3f21ca94ea..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/2Q/TSYZ1MCOJLTCS8YDLYPH9S.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/3L/X6CZON0U6L06MHASP99021.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/3L/X6CZON0U6L06MHASP99021.uasset deleted file mode 100644 index fc2fc5397e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/3L/X6CZON0U6L06MHASP99021.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/3P/SFXGN47DD9NBAZQUTWE2T9.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/3P/SFXGN47DD9NBAZQUTWE2T9.uasset deleted file mode 100644 index 915ce8a9de..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/3P/SFXGN47DD9NBAZQUTWE2T9.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/8O/OE10P0QM81C0PABXSVKOZ2.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/8O/OE10P0QM81C0PABXSVKOZ2.uasset deleted file mode 100644 index 512da3e015..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/8O/OE10P0QM81C0PABXSVKOZ2.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/E5/HEL6UKUE9ZLH5W9YV8W8A6.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/E5/HEL6UKUE9ZLH5W9YV8W8A6.uasset deleted file mode 100644 index 4791841a69..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/E5/HEL6UKUE9ZLH5W9YV8W8A6.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/L5/IDG1NREU33G6CA13TKVG32.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/L5/IDG1NREU33G6CA13TKVG32.uasset deleted file mode 100644 index c50c90d3e4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/L5/IDG1NREU33G6CA13TKVG32.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/MV/58O33MTWM8CHE7JXRFFJ45.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/MV/58O33MTWM8CHE7JXRFFJ45.uasset deleted file mode 100644 index 58a7968ee1..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/MV/58O33MTWM8CHE7JXRFFJ45.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/OM/ZSE5471B2YQQTSHCUOMCWR.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/OM/ZSE5471B2YQQTSHCUOMCWR.uasset deleted file mode 100644 index 320c6fd0ca..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/OM/ZSE5471B2YQQTSHCUOMCWR.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/QF/IYIR8FI85VQBIV6MBTOWR9.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/QF/IYIR8FI85VQBIV6MBTOWR9.uasset deleted file mode 100644 index 514f3fb539..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/QF/IYIR8FI85VQBIV6MBTOWR9.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/RW/OWYLBRFJGRHR1FW3PFGY57.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/RW/OWYLBRFJGRHR1FW3PFGY57.uasset deleted file mode 100644 index d2ff4c1b17..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/RW/OWYLBRFJGRHR1FW3PFGY57.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/U0/62EDB8DZMRCOEKI3ZBE9UY.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/U0/62EDB8DZMRCOEKI3ZBE9UY.uasset deleted file mode 100644 index a2d80d625e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/U0/62EDB8DZMRCOEKI3ZBE9UY.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/YQ/WYGLWSZ12R8RJKVOFZZI9I.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/YQ/WYGLWSZ12R8RJKVOFZZI9I.uasset deleted file mode 100644 index bf8fa71095..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/B/YQ/WYGLWSZ12R8RJKVOFZZI9I.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/01/B87Q9BNZPGN5V9B39F09YN.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/01/B87Q9BNZPGN5V9B39F09YN.uasset deleted file mode 100644 index d267234758..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/01/B87Q9BNZPGN5V9B39F09YN.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/GQ/E87XU7VBZQHDS8KKXWKQJE.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/GQ/E87XU7VBZQHDS8KKXWKQJE.uasset deleted file mode 100644 index 907c794903..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/GQ/E87XU7VBZQHDS8KKXWKQJE.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/PF/EDII011KFQO4VBOZM94Z7O.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/PF/EDII011KFQO4VBOZM94Z7O.uasset deleted file mode 100644 index 0273057fe5..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/PF/EDII011KFQO4VBOZM94Z7O.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/QD/R5VF6CU367UHPEX2I7KYOF.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/QD/R5VF6CU367UHPEX2I7KYOF.uasset deleted file mode 100644 index 7bc0195715..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/QD/R5VF6CU367UHPEX2I7KYOF.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/UG/ZEU3RWQTAJHY4UX1ARVXZ2.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/UG/ZEU3RWQTAJHY4UX1ARVXZ2.uasset deleted file mode 100644 index 3530e6158c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/UG/ZEU3RWQTAJHY4UX1ARVXZ2.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/ZD/AVP3WAJY52L1P3VUPLRRDF.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/ZD/AVP3WAJY52L1P3VUPLRRDF.uasset deleted file mode 100644 index f087227155..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/ZD/AVP3WAJY52L1P3VUPLRRDF.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/ZF/YTSE9T9XG5Z18HFSP1CGGL.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/ZF/YTSE9T9XG5Z18HFSP1CGGL.uasset deleted file mode 100644 index a892f34625..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/C/ZF/YTSE9T9XG5Z18HFSP1CGGL.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/11/R2FZQK9SOWNL3W5K5U7A23.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/11/R2FZQK9SOWNL3W5K5U7A23.uasset deleted file mode 100644 index e8a6c84d2a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/11/R2FZQK9SOWNL3W5K5U7A23.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/5L/Q1AWTL2CASI5N1DVZMPOH9.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/5L/Q1AWTL2CASI5N1DVZMPOH9.uasset deleted file mode 100644 index face3e99c9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/5L/Q1AWTL2CASI5N1DVZMPOH9.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/EG/GJ28RYDZ73DETW6U1XWXFH.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/EG/GJ28RYDZ73DETW6U1XWXFH.uasset deleted file mode 100644 index 617991a123..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/EG/GJ28RYDZ73DETW6U1XWXFH.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/G9/4S7L0W752EF0E7956CKVZL.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/G9/4S7L0W752EF0E7956CKVZL.uasset deleted file mode 100644 index 24ded2d9f7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/G9/4S7L0W752EF0E7956CKVZL.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/U5/8K80CD87JXYAWLWDFQKCM2.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/U5/8K80CD87JXYAWLWDFQKCM2.uasset deleted file mode 100644 index 15a759e13e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/U5/8K80CD87JXYAWLWDFQKCM2.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/YB/7UKX5MPQDJ5050HJ5CG8JT.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/YB/7UKX5MPQDJ5050HJ5CG8JT.uasset deleted file mode 100644 index da855b2fa6..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/D/YB/7UKX5MPQDJ5050HJ5CG8JT.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/54/K6F3LMVPG7M2S2WEHJG28B.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/54/K6F3LMVPG7M2S2WEHJG28B.uasset deleted file mode 100644 index a35419775b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/54/K6F3LMVPG7M2S2WEHJG28B.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/5P/G1TH8OAN1YI1RN2IHZ8ROY.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/5P/G1TH8OAN1YI1RN2IHZ8ROY.uasset deleted file mode 100644 index bbb0192cae..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/5P/G1TH8OAN1YI1RN2IHZ8ROY.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/LK/4FPZZ441Z3V44B7S7VFQDO.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/LK/4FPZZ441Z3V44B7S7VFQDO.uasset deleted file mode 100644 index b79b299d87..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/LK/4FPZZ441Z3V44B7S7VFQDO.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/NU/IXV6JD13O3I54XVTLJ11DU.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/NU/IXV6JD13O3I54XVTLJ11DU.uasset deleted file mode 100644 index f02f30cdcc..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/NU/IXV6JD13O3I54XVTLJ11DU.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/OI/JFLWD8BDAQEK154QSUZFOC.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/OI/JFLWD8BDAQEK154QSUZFOC.uasset deleted file mode 100644 index cd897d686b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/OI/JFLWD8BDAQEK154QSUZFOC.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/QR/JVG8TXBV5BJK6WIUMQ73E1.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/QR/JVG8TXBV5BJK6WIUMQ73E1.uasset deleted file mode 100644 index 4bdd363ea8..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/QR/JVG8TXBV5BJK6WIUMQ73E1.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/RF/580BERTFPTP0Q3C7UKHFHO.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/RF/580BERTFPTP0Q3C7UKHFHO.uasset deleted file mode 100644 index 653418954c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/RF/580BERTFPTP0Q3C7UKHFHO.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/RQ/AAM632DERLJTRXL2JSNPT0.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/RQ/AAM632DERLJTRXL2JSNPT0.uasset deleted file mode 100644 index 5cea2b123b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/RQ/AAM632DERLJTRXL2JSNPT0.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/TF/R86YM05RHH1G9KE362HTHH.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/TF/R86YM05RHH1G9KE362HTHH.uasset deleted file mode 100644 index 53744817d7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/TF/R86YM05RHH1G9KE362HTHH.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/ZN/NHAR8YTDMDHOA2BHRHIR6W.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/ZN/NHAR8YTDMDHOA2BHRHIR6W.uasset deleted file mode 100644 index 47d1fce5eb..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/E/ZN/NHAR8YTDMDHOA2BHRHIR6W.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/10/ML2MXAOZYU1XT2KO05LRKK.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/10/ML2MXAOZYU1XT2KO05LRKK.uasset deleted file mode 100644 index d0dc749a5b..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/10/ML2MXAOZYU1XT2KO05LRKK.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/2C/6JCDNGPPWFA3DXHI9Z4SI6.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/2C/6JCDNGPPWFA3DXHI9Z4SI6.uasset deleted file mode 100644 index dbdcc59fa9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/2C/6JCDNGPPWFA3DXHI9Z4SI6.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/4L/S04XUXPYYKA55H5QCM4D6U.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/4L/S04XUXPYYKA55H5QCM4D6U.uasset deleted file mode 100644 index 6a0b2cf837..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/4L/S04XUXPYYKA55H5QCM4D6U.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/5F/55ME347L37EPYQVUX8M40Q.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/5F/55ME347L37EPYQVUX8M40Q.uasset deleted file mode 100644 index 5faf00262f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalActors__/level_03_landscape/F/5F/55ME347L37EPYQVUX8M40Q.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/0/MU/E2H089WKZX4JBJXX4T96KB.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/0/MU/E2H089WKZX4JBJXX4T96KB.uasset deleted file mode 100644 index 9c96aaa88c..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/0/MU/E2H089WKZX4JBJXX4T96KB.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/2/QJ/BRXA03UO5LPOW2S0US6IB1.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/2/QJ/BRXA03UO5LPOW2S0US6IB1.uasset deleted file mode 100644 index 584a804f77..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/2/QJ/BRXA03UO5LPOW2S0US6IB1.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/2/VX/0AA25M1L1QDIV02869QBK8.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/2/VX/0AA25M1L1QDIV02869QBK8.uasset deleted file mode 100644 index 29136e649e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/2/VX/0AA25M1L1QDIV02869QBK8.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/3/FA/TZBXMF6LC98KE7EA0BC3BV.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/3/FA/TZBXMF6LC98KE7EA0BC3BV.uasset deleted file mode 100644 index c57c33bc44..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/3/FA/TZBXMF6LC98KE7EA0BC3BV.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/7/DY/EPD6AIPJCOOI69V9ZXYOFA.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/7/DY/EPD6AIPJCOOI69V9ZXYOFA.uasset deleted file mode 100644 index 0ab45355d9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/7/DY/EPD6AIPJCOOI69V9ZXYOFA.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/8/0B/ZM5QALZZQBAZU40PY8DQ63.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/8/0B/ZM5QALZZQBAZU40PY8DQ63.uasset deleted file mode 100644 index 52a3fc0188..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/__ExternalObjects__/level_03_landscape/8/0B/ZM5QALZZQBAZU40PY8DQ63.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/blueprints/testBox.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/blueprints/testBox.uasset deleted file mode 100644 index 315f7f689f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/blueprints/testBox.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/blueprints/testSphere.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/blueprints/testSphere.uasset deleted file mode 100644 index 233682c4b1..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/blueprints/testSphere.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/level_01_firstMap.umap b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/level_01_firstMap.umap deleted file mode 100644 index 05126e0d7e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/level_01_firstMap.umap and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/level_03_landscape.umap b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/level_03_landscape.umap deleted file mode 100644 index cdc68f8365..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/level_03_landscape.umap and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/level_03_landscape_HLOD0_Instancing.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/level_03_landscape_HLOD0_Instancing.uasset deleted file mode 100644 index 7ab15ebc60..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content/level_03_landscape_HLOD0_Instancing.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Linux/x86_64-unknown-linux-gnu/libExampleLibrary.so b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Linux/x86_64-unknown-linux-gnu/libExampleLibrary.so deleted file mode 100644 index 7b5b590d6d..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Linux/x86_64-unknown-linux-gnu/libExampleLibrary.so and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.dll b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.dll deleted file mode 100644 index 38d65ef835..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.dll and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.lib b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.lib deleted file mode 100644 index 3a067aa89f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.lib and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.pdb b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.pdb deleted file mode 100644 index c4feaac7b7..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.pdb and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/Win64/UnrealEditor-newton.dll b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/Win64/UnrealEditor-newton.dll deleted file mode 100644 index 81092e6b25..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/Win64/UnrealEditor-newton.dll and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/Win64/UnrealEditor-newton.pdb b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/Win64/UnrealEditor-newton.pdb deleted file mode 100644 index 17f0fb4176..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/Win64/UnrealEditor-newton.pdb and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/Win64/UnrealEditor.modules b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/Win64/UnrealEditor.modules deleted file mode 100644 index bbbbc75c94..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Binaries/Win64/UnrealEditor.modules +++ /dev/null @@ -1,7 +0,0 @@ -{ - "BuildId": "33043543", - "Modules": - { - "newton": "UnrealEditor-newton.dll" - } -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Content/NewtonTransparentMaterial.uasset b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Content/NewtonTransparentMaterial.uasset deleted file mode 100644 index 0651ddbaf8..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Content/NewtonTransparentMaterial.uasset and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Resources/Icon128.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Resources/Icon128.png deleted file mode 100644 index 1231d4aad4..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Resources/Icon128.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Resources/newtonIcon.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Resources/newtonIcon.png deleted file mode 100644 index 64bdf3c6e6..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Resources/newtonIcon.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Resources/newtonIconDown.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Resources/newtonIconDown.png deleted file mode 100644 index b4b17f7326..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Resources/newtonIconDown.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.sln b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.sln deleted file mode 100644 index 184008e8a7..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.sln +++ /dev/null @@ -1,44 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.11.35222.181 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExampleLibrary", "ExampleLibrary.vcxproj", "{9B50F1F8-0116-442C-A071-F5C3A120A5CB}" - ProjectSection(ProjectDependencies) = postProject - {57EAF94C-1149-4125-8427-FBA4050B9B71} = {57EAF94C-1149-4125-8427-FBA4050B9B71} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hacd", "Public\thirdParty\hacd\hacd.vcxproj", "{57EAF94C-1149-4125-8427-FBA4050B9B71}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9B50F1F8-0116-442C-A071-F5C3A120A5CB}.Debug|x64.ActiveCfg = Debug|x64 - {9B50F1F8-0116-442C-A071-F5C3A120A5CB}.Debug|x64.Build.0 = Debug|x64 - {9B50F1F8-0116-442C-A071-F5C3A120A5CB}.Debug|x86.ActiveCfg = Debug|Win32 - {9B50F1F8-0116-442C-A071-F5C3A120A5CB}.Debug|x86.Build.0 = Debug|Win32 - {9B50F1F8-0116-442C-A071-F5C3A120A5CB}.Release|x64.ActiveCfg = Release|x64 - {9B50F1F8-0116-442C-A071-F5C3A120A5CB}.Release|x64.Build.0 = Release|x64 - {9B50F1F8-0116-442C-A071-F5C3A120A5CB}.Release|x86.ActiveCfg = Release|Win32 - {9B50F1F8-0116-442C-A071-F5C3A120A5CB}.Release|x86.Build.0 = Release|Win32 - {57EAF94C-1149-4125-8427-FBA4050B9B71}.Debug|x64.ActiveCfg = Debug|x64 - {57EAF94C-1149-4125-8427-FBA4050B9B71}.Debug|x64.Build.0 = Debug|x64 - {57EAF94C-1149-4125-8427-FBA4050B9B71}.Debug|x86.ActiveCfg = Debug|Win32 - {57EAF94C-1149-4125-8427-FBA4050B9B71}.Debug|x86.Build.0 = Debug|Win32 - {57EAF94C-1149-4125-8427-FBA4050B9B71}.Release|x64.ActiveCfg = Release|x64 - {57EAF94C-1149-4125-8427-FBA4050B9B71}.Release|x64.Build.0 = Release|x64 - {57EAF94C-1149-4125-8427-FBA4050B9B71}.Release|x86.ActiveCfg = Release|Win32 - {57EAF94C-1149-4125-8427-FBA4050B9B71}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {B5D12B04-18BF-4AD0-A32C-73FB37CDD3C4} - EndGlobalSection -EndGlobal diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.vcxproj b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.vcxproj deleted file mode 100644 index 0c3296f1b3..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.vcxproj +++ /dev/null @@ -1,479 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create - ndCoreStdafx.h - Create - ndCoreStdafx.h - Create - ndCoreStdafx.h - Create - ndCoreStdafx.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {57eaf94c-1149-4125-8427-fba4050b9b71} - - - - {9B50F1F8-0116-442C-A071-F5C3A120A5CB} - Win32Proj - ExampleLibrary - 10.0 - - - - DynamicLibrary - true - v143 - Unicode - - - DynamicLibrary - true - v143 - Unicode - - - DynamicLibrary - false - v143 - true - Unicode - - - DynamicLibrary - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)$(Platform)\Release\ - $(ShortProjectName)\$(Platform)\Release\ - - - true - $(SolutionDir)$(Platform)\Release\ - $(ShortProjectName)\$(Platform)\Release\ - - - false - $(SolutionDir)$(Platform)\Release\ - $(ShortProjectName)\$(Platform)\Release\ - - - false - $(SolutionDir)$(Platform)\Release\ - $(ShortProjectName)\$(Platform)\Release\ - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_D_SINGLE_LIBRARY;_D_CORE_DLL;_D_NEWTON_DLL;_D_COLLISION_DLL;_D_CORE_EXPORT_DLL;_D_NEWTON_EXPORT_DLL;_D_COLLISION_EXPORT_DLL;%(PreprocessorDefinitions) - true - Public/dCore;Public/dCollision;Public/dNewton;Public/dNewton/dJoints;Public/dNewton/dIkSolver;Public/dNewton/dModels;Public/dNewton/dModels/dVehicle;Public/thirdParty/hacd/src/VHACD_Lib/inc;Public/thirdParty/hacd/src/VHACD_Lib/public - ndCoreStdafx.h - - - Windows - true - /DELAYLOAD:$(TargetName)$(TargetExt);%(DelayLoadDLLs) - - - copy "$(TargetPath)" "$(SolutionDir)..\..\..\Binaries\ThirdParty\newtonLibrary\Win64\" - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_D_SINGLE_LIBRARY;_D_CORE_DLL;_D_NEWTON_DLL;_D_COLLISION_DLL;_D_CORE_EXPORT_DLL;_D_NEWTON_EXPORT_DLL;_D_COLLISION_EXPORT_DLL;%(PreprocessorDefinitions) - true - Public/dCore;Public/dCollision;Public/dNewton;Public/dNewton/dJoints;Public/dNewton/dIkSolver;Public/dNewton/dModels;Public/dNewton/dModels/dVehicle;Public/thirdParty/hacd/src/VHACD_Lib/inc;Public/thirdParty/hacd/src/VHACD_Lib/public - ndCoreStdafx.h - - - Windows - true - /DELAYLOAD:$(TargetName)$(TargetExt);%(DelayLoadDLLs) - - - copy "$(TargetPath)" "$(SolutionDir)..\..\..\Binaries\ThirdParty\newtonLibrary\Win64\" - - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_D_SINGLE_LIBRARY;_D_CORE_DLL;_D_NEWTON_DLL;_D_COLLISION_DLL;_D_CORE_EXPORT_DLL;_D_NEWTON_EXPORT_DLL;_D_COLLISION_EXPORT_DLL;%(PreprocessorDefinitions) - true - Public/dCore;Public/dCollision;Public/dNewton;Public/dNewton/dJoints;Public/dNewton/dIkSolver;Public/dNewton/dModels;Public/dNewton/dModels/dVehicle;Public/thirdParty/hacd/src/VHACD_Lib/inc;Public/thirdParty/hacd/src/VHACD_Lib/public - ndCoreStdafx.h - - - Windows - true - true - true - /DELAYLOAD:$(TargetName)$(TargetExt);%(DelayLoadDLLs) - - - copy "$(TargetPath)" "$(SolutionDir)..\..\..\Binaries\ThirdParty\newtonLibrary\Win64\" - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_D_SINGLE_LIBRARY;_D_CORE_DLL;_D_NEWTON_DLL;_D_COLLISION_DLL;_D_CORE_EXPORT_DLL;_D_NEWTON_EXPORT_DLL;_D_COLLISION_EXPORT_DLL;%(PreprocessorDefinitions) - true - Public/dCore;Public/dCollision;Public/dNewton;Public/dNewton/dJoints;Public/dNewton/dIkSolver;Public/dNewton/dModels;Public/dNewton/dModels/dVehicle;Public/thirdParty/hacd/src/VHACD_Lib/inc;Public/thirdParty/hacd/src/VHACD_Lib/public - ndCoreStdafx.h - - - Windows - true - true - true - /DELAYLOAD:$(TargetName)$(TargetExt);%(DelayLoadDLLs) - - - copy "$(TargetPath)" "$(SolutionDir)..\..\..\Binaries\ThirdParty\newtonLibrary\Win64\" - - - - - - \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.vcxproj.filters b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.vcxproj.filters deleted file mode 100644 index 32512f4c87..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.vcxproj.filters +++ /dev/null @@ -1,878 +0,0 @@ - - - - - {b49cbae5-57d7-402f-9f91-5b6806c17804} - - - {01b9338e-378d-4408-8662-ef2c0f02e73c} - - - {617907a9-a8e7-4c71-98c5-b29141b295b6} - - - {f4f47fbe-0810-46af-849b-3795c297a19a} - - - {c2a3595f-d705-493c-9445-f95c3c2f4efb} - - - {7df86ceb-a130-4c52-967f-e4022e3051b0} - - - {7b59c058-ead7-49b0-95b2-49150c326de6} - - - {6c37992d-a487-4215-a54f-4a6a2d830aec} - - - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dNewton - - - dNewton - - - dNewton - - - dNewton - - - dNewton - - - dNewton - - - dNewton - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dModels - - - dNewton\dModels - - - dNewton\dModels - - - dNewton\dModels - - - dNewton\dModels - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dIkSolver - - - dNewton\dIkSolver - - - dNewton\dIkSolver - - - dNewton\dIkSolver - - - dNewton\dIkSolver - - - dNewton\dIkSolver - - - thirdParty - - - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCore - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dCollision - - - dNewton - - - dNewton - - - dNewton - - - dNewton - - - dNewton - - - dNewton - - - dNewton - - - dNewton - - - dNewton - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dJoints - - - dNewton\dModels - - - dNewton\dModels - - - dNewton\dModels - - - dNewton\dModels - - - dNewton\dModels - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dModels\dVehicle - - - dNewton\dIkSolver - - - dNewton\dIkSolver - - - dNewton\dIkSolver - - - dNewton\dIkSolver - - - dNewton\dIkSolver - - - dNewton\dIkSolver - - - thirdParty - - - - - dCore - - - \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.xcworkspace/contents.xcworkspacedata b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7db3612070..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/ExampleLibrary.xcodeproj/project.pbxproj b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/ExampleLibrary.xcodeproj/project.pbxproj deleted file mode 100644 index 9ca62248ee..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/ExampleLibrary.xcodeproj/project.pbxproj +++ /dev/null @@ -1,249 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 49FF3DF51CD3A3B900F014D8 /* ExampleLibrary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49FF3DF31CD3A3B900F014D8 /* ExampleLibrary.cpp */; }; - 49FF3DF61CD3A3B900F014D8 /* ExampleLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = 49FF3DF41CD3A3B900F014D8 /* ExampleLibrary.h */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 49FF3DEC1CD3A38F00F014D8 /* libExampleLibrary.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libExampleLibrary.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; - 49FF3DF31CD3A3B900F014D8 /* ExampleLibrary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExampleLibrary.cpp; path = ../ExampleLibrary.cpp; sourceTree = ""; }; - 49FF3DF41CD3A3B900F014D8 /* ExampleLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExampleLibrary.h; path = ../ExampleLibrary.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 49FF3DE91CD3A38E00F014D8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 49FF3DE31CD3A38E00F014D8 = { - isa = PBXGroup; - children = ( - 49FF3DF31CD3A3B900F014D8 /* ExampleLibrary.cpp */, - 49FF3DF41CD3A3B900F014D8 /* ExampleLibrary.h */, - 49FF3DED1CD3A38F00F014D8 /* Products */, - ); - sourceTree = ""; - }; - 49FF3DED1CD3A38F00F014D8 /* Products */ = { - isa = PBXGroup; - children = ( - 49FF3DEC1CD3A38F00F014D8 /* libExampleLibrary.dylib */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 49FF3DEA1CD3A38E00F014D8 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 49FF3DF61CD3A3B900F014D8 /* ExampleLibrary.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 49FF3DEB1CD3A38E00F014D8 /* ExampleLibrary */ = { - isa = PBXNativeTarget; - buildConfigurationList = 49FF3DF01CD3A38F00F014D8 /* Build configuration list for PBXNativeTarget "ExampleLibrary" */; - buildPhases = ( - 49FF3DE81CD3A38E00F014D8 /* Sources */, - 49FF3DE91CD3A38E00F014D8 /* Frameworks */, - 49FF3DEA1CD3A38E00F014D8 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ExampleLibrary; - productName = ExampleLibrary; - productReference = 49FF3DEC1CD3A38F00F014D8 /* libExampleLibrary.dylib */; - productType = "com.apple.product-type.library.dynamic"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 49FF3DE41CD3A38E00F014D8 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0730; - ORGANIZATIONNAME = "Epic Games"; - TargetAttributes = { - 49FF3DEB1CD3A38E00F014D8 = { - CreatedOnToolsVersion = 7.3; - }; - }; - }; - buildConfigurationList = 49FF3DE71CD3A38E00F014D8 /* Build configuration list for PBXProject "ExampleLibrary" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 49FF3DE31CD3A38E00F014D8; - productRefGroup = 49FF3DED1CD3A38F00F014D8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 49FF3DEB1CD3A38E00F014D8 /* ExampleLibrary */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 49FF3DE81CD3A38E00F014D8 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 49FF3DF51CD3A3B900F014D8 /* ExampleLibrary.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 49FF3DEE1CD3A38F00F014D8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - 49FF3DEF1CD3A38F00F014D8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - }; - name = Release; - }; - 49FF3DF11CD3A38F00F014D8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - EXECUTABLE_PREFIX = lib; - INSTALL_PATH = "@rpath"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 49FF3DF21CD3A38F00F014D8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - EXECUTABLE_PREFIX = lib; - INSTALL_PATH = "@rpath"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 49FF3DE71CD3A38E00F014D8 /* Build configuration list for PBXProject "ExampleLibrary" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 49FF3DEE1CD3A38F00F014D8 /* Debug */, - 49FF3DEF1CD3A38F00F014D8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 49FF3DF01CD3A38F00F014D8 /* Build configuration list for PBXNativeTarget "ExampleLibrary" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 49FF3DF11CD3A38F00F014D8 /* Debug */, - 49FF3DF21CD3A38F00F014D8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 49FF3DE41CD3A38E00F014D8 /* Project object */; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/Win32/Release/ExampleLibrary.vcxproj.FileListAbsolute.txt b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/Win32/Release/ExampleLibrary.vcxproj.FileListAbsolute.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/Win32/hacd/Release/hacd.vcxproj.FileListAbsolute.txt b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/Win32/hacd/Release/hacd.vcxproj.FileListAbsolute.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/ExampleLibrary.dll.recipe b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/ExampleLibrary.dll.recipe deleted file mode 100644 index 60a4bfd45c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/ExampleLibrary.dll.recipe +++ /dev/null @@ -1,11 +0,0 @@ - - - - - C:\Unreal Projects\newtonPlugin\Plugins\newton\Source\ThirdParty\newtonLibrary\x64\Release\ExampleLibrary.dll - - - - - - \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/ExampleLibrary.vcxproj.FileListAbsolute.txt b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/ExampleLibrary.vcxproj.FileListAbsolute.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/vc143.pdb b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/vc143.pdb deleted file mode 100644 index 93c00f3082..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/vc143.pdb and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/hacd/Release/hacd.lib.recipe b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/hacd/Release/hacd.lib.recipe deleted file mode 100644 index a53f9611dc..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/hacd/Release/hacd.lib.recipe +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/hacd/Release/hacd.vcxproj.FileListAbsolute.txt b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/hacd/Release/hacd.vcxproj.FileListAbsolute.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Mac/Release/libExampleLibrary.dylib b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Mac/Release/libExampleLibrary.dylib deleted file mode 100644 index 88165a937a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Mac/Release/libExampleLibrary.dylib and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodiesInAabbNotify.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodiesInAabbNotify.h deleted file mode 100644 index 41fe40ab05..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodiesInAabbNotify.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODIES_IN_AABB_NOTIFY_H__ -#define __ND_BODIES_IN_AABB_NOTIFY_H__ - -#include "ndCollisionStdafx.h" - - -D_MSV_NEWTON_ALIGN_32 -class ndBodiesInAabbNotify : public ndClassAlloc -{ - public: - ndBodiesInAabbNotify() - :m_bodyArray() - { - } - - virtual ~ndBodiesInAabbNotify() - { - } - - virtual void Reset() - { - m_bodyArray.SetCount(0); - } - - virtual void OnOverlap(const ndBody* const body) - { - m_bodyArray.PushBack(body); - } - - ndArray m_bodyArray; -} D_GCC_NEWTON_ALIGN_32; - - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBody.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBody.cpp deleted file mode 100644 index 9b4f500a6b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBody.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndBody.h" -#include "ndContact.h" -#include "ndBodyNotify.h" - -ndUnsigned32 ndBody::m_uniqueIdCount = 0; - -ndBody::ndBody() - :ndContainersFreeListAlloc() - ,m_matrix(ndGetIdentityMatrix()) - ,m_veloc(ndVector::m_zero) - ,m_omega(ndVector::m_zero) - ,m_localCentreOfMass(ndVector::m_wOne) - ,m_globalCentreOfMass(ndVector::m_wOne) - ,m_minAabb(ndVector::m_wOne) - ,m_maxAabb(ndVector::m_wOne) - ,m_rotation() - ,m_notifyCallback(nullptr) - ,m_deletedNode(nullptr) - ,m_uniqueId(m_uniqueIdCount) - ,m_flags(0) - ,m_isStatic(0) - ,m_autoSleep(1) - ,m_equilibrium(0) - ,m_equilibrium0(0) - ,m_isJointFence0(0) - ,m_isJointFence1(0) - ,m_isConstrained(0) - ,m_sceneForceUpdate(1) - ,m_sceneEquilibrium(0) -{ - m_uniqueIdCount++; - m_transformIsDirty = 1; -} - -ndBody::ndBody(const ndBody& src) - :ndContainersFreeListAlloc() - ,m_matrix(src.m_matrix) - ,m_veloc(src.m_veloc) - ,m_omega(src.m_omega) - ,m_localCentreOfMass(src.m_localCentreOfMass) - ,m_globalCentreOfMass(src.m_globalCentreOfMass) - ,m_minAabb(src.m_minAabb) - ,m_maxAabb(src.m_maxAabb) - ,m_rotation(src.m_rotation) - ,m_notifyCallback(nullptr) - ,m_deletedNode(nullptr) - ,m_uniqueId(m_uniqueIdCount) - ,m_flags(0) - ,m_isStatic(0) - ,m_autoSleep(src.m_autoSleep) - ,m_equilibrium(0) - ,m_equilibrium0(0) - ,m_isJointFence0(0) - ,m_isJointFence1(0) - ,m_isConstrained(0) - ,m_sceneForceUpdate(1) - ,m_sceneEquilibrium(0) -{ - m_uniqueIdCount++; - m_transformIsDirty = 1; - if (src.m_notifyCallback) - { - SetNotifyCallback(src.m_notifyCallback->Clone()); - } -} - -ndBody::~ndBody() -{ - ndAssert(!m_deletedNode); - if (m_notifyCallback) - { - delete m_notifyCallback; - } -} - -void ndBody::SetCentreOfMass(const ndVector& com) -{ - m_localCentreOfMass.m_x = com.m_x; - m_localCentreOfMass.m_y = com.m_y; - m_localCentreOfMass.m_z = com.m_z; - m_localCentreOfMass.m_w = ndFloat32(1.0f); - m_globalCentreOfMass = m_matrix.TransformVector(m_localCentreOfMass); -} - -void ndBody::SetNotifyCallback(ndBodyNotify* const notify) -{ - if (notify != m_notifyCallback) - { - if (m_notifyCallback) - { - delete m_notifyCallback; - } - m_notifyCallback = notify; - if (m_notifyCallback) - { - m_notifyCallback->m_body = this; - } - } -} - -void ndBody::SetOmegaNoSleep(const ndVector& omega) -{ - m_omega = omega; -} - -void ndBody::SetOmega(const ndVector& omega) -{ - m_equilibrium = 0; - SetOmegaNoSleep(omega); -} - -void ndBody::SetVelocityNoSleep(const ndVector& veloc) -{ - m_veloc = veloc; -} - -void ndBody::SetVelocity(const ndVector& veloc) -{ - m_equilibrium = 0; - SetVelocityNoSleep(veloc); -} - -void ndBody::SetMatrixNoSleep(const ndMatrix& matrix) -{ - m_matrix = matrix; - ndAssert(m_matrix.TestOrthogonal(ndFloat32(1.0e-4f))); - - m_rotation = ndQuaternion(m_matrix); - m_globalCentreOfMass = m_matrix.TransformVector(m_localCentreOfMass); -} - -void ndBody::SetMatrixAndCentreOfMass(const ndQuaternion& rotation, const ndVector& globalcom) -{ - m_rotation = rotation; - ndAssert(m_rotation.DotProduct(m_rotation).GetScalar() > ndFloat32(0.9999f)); - m_globalCentreOfMass = globalcom; - m_matrix = ndCalculateMatrix(rotation, m_matrix.m_posit); - m_matrix.m_posit = m_globalCentreOfMass - m_matrix.RotateVector(m_localCentreOfMass); -} - -void ndBody::SetMatrix(const ndMatrix& matrix) -{ - m_equilibrium = 0; - m_transformIsDirty = 1; - m_sceneForceUpdate = 1; - SetMatrixNoSleep(matrix); -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBody.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBody.h deleted file mode 100644 index 1070564f48..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBody.h +++ /dev/null @@ -1,203 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODY_H_ -#define __ND_BODY_H_ - -#include "ndCollisionStdafx.h" -#include "ndShapeInstance.h" -#include "ndBodyListView.h" - -class ndContact; -class ndBodyNotify; -class ndBodyDynamic; -class ndBodySentinel; -class ndBodySphFluid; -class ndBodyKinematic; -class ndRayCastNotify; -class ndBodyParticleSet; -class ndBodyTriggerVolume; -class ndBodyPlayerCapsule; -class ndBodyKinematicBase; -class ndJointBilateralConstraint; - -D_MSV_NEWTON_ALIGN_32 -class ndBody : public ndContainersFreeListAlloc -{ - public: - D_BASE_CLASS_REFLECTION(ndBody) - - D_COLLISION_API ndBody(); - D_COLLISION_API ndBody(const ndBody& src); - D_COLLISION_API virtual ~ndBody(); - - virtual ndBody* GetAsBody() { return this;} - virtual ndBodyDynamic* GetAsBodyDynamic() { return nullptr; } - virtual ndBodySentinel* GetAsBodySentinel() { return nullptr; } - virtual ndBodySphFluid* GetAsBodySphFluid() { return nullptr; } - virtual ndBodyKinematic* GetAsBodyKinematic() { return nullptr; } - virtual ndBodyParticleSet* GetAsBodyParticleSet() { return nullptr; } - virtual ndBodyPlayerCapsule* GetAsBodyPlayerCapsule() { return nullptr; } - virtual ndBodyTriggerVolume* GetAsBodyTriggerVolume() { return nullptr; } - virtual ndBodyKinematicBase* GetAsBodyKinematicSpecial() { return nullptr; } - - ndUnsigned32 GetId() const; - void GetAABB(ndVector& p0, ndVector& p1) const; - - virtual ndFloat32 GetInvMass() const; - virtual bool RayCast(ndRayCastNotify& callback, const ndFastRay& ray, const ndFloat32 maxT) const = 0; - - const ndVector& GetCentreOfMass() const; - D_COLLISION_API virtual void SetCentreOfMass(const ndVector& com); - - ndVector GetOmega() const; - ndMatrix GetMatrix() const; - ndVector GetVelocity() const; - ndVector GetPosition() const; - ndQuaternion GetRotation() const; - ndVector GetGlobalGetCentreOfMass() const; - - ndBodyNotify* GetNotifyCallback() const; - D_COLLISION_API virtual void SetNotifyCallback(ndBodyNotify* const notify); - D_COLLISION_API virtual void SetOmega(const ndVector& veloc); - D_COLLISION_API virtual void SetVelocity(const ndVector& veloc); - D_COLLISION_API virtual void SetMatrix(const ndMatrix& matrix); - D_COLLISION_API ndVector GetVelocityAtPoint(const ndVector& point) const; - - D_COLLISION_API void SetOmegaNoSleep(const ndVector& veloc); - D_COLLISION_API void SetVelocityNoSleep(const ndVector& veloc); - D_COLLISION_API void SetMatrixNoSleep(const ndMatrix& matrix); - D_COLLISION_API void SetMatrixAndCentreOfMass(const ndQuaternion& rotation, const ndVector& globalcom); - - protected: - virtual void AttachContact(ndContact* const) {} - virtual void DetachContact(ndContact* const) {} - virtual ndContact* FindContact(const ndBody* const) const { return nullptr; } - - ndMatrix m_matrix; - ndVector m_veloc; - ndVector m_omega; - ndVector m_localCentreOfMass; - ndVector m_globalCentreOfMass; - ndVector m_minAabb; - ndVector m_maxAabb; - ndQuaternion m_rotation; - ndBodyNotify* m_notifyCallback; - ndSpecialList::ndNode* m_deletedNode; - - ndUnsigned32 m_uniqueId; - union - { - ndUnsigned32 m_flags; - struct - { - ndUnsigned32 m_isDynamics : 1; - ndUnsigned32 m_skeletonMark : 1; - ndUnsigned32 m_skeletonMark0 : 1; - ndUnsigned32 m_skeletonMark1 : 1; - ndUnsigned32 m_contactTestOnly : 1; - ndUnsigned32 m_transformIsDirty : 1; - ndUnsigned32 m_equilibriumOverride : 1; - }; - }; - - ndUnsigned8 m_isStatic; - ndUnsigned8 m_autoSleep; - ndUnsigned8 m_equilibrium; - ndUnsigned8 m_equilibrium0; - ndUnsigned8 m_isJointFence0; - ndUnsigned8 m_isJointFence1; - ndUnsigned8 m_isConstrained; - ndUnsigned8 m_sceneForceUpdate; - ndUnsigned8 m_sceneEquilibrium; - - D_COLLISION_API static ndUnsigned32 m_uniqueIdCount; - - friend class ndWorld; - friend class ndScene; - friend class ndConstraint; - friend class ndBodyPlayerCapsuleImpulseSolver; -} D_GCC_NEWTON_ALIGN_32; - -inline ndUnsigned32 ndBody::GetId() const -{ - return m_uniqueId; -} - -inline ndBodyNotify* ndBody::GetNotifyCallback() const -{ - return m_notifyCallback; -} - -inline ndMatrix ndBody::GetMatrix() const -{ - return m_matrix; -} - -inline ndVector ndBody::GetPosition() const -{ - return m_matrix.m_posit; -} - -inline ndQuaternion ndBody::GetRotation() const -{ - return m_rotation; -} - -inline ndVector ndBody::GetGlobalGetCentreOfMass() const -{ - return m_globalCentreOfMass; -} - -inline ndVector ndBody::GetVelocity() const -{ - return m_veloc; -} - -inline ndVector ndBody::GetOmega() const -{ - return m_omega; -} - -inline void ndBody::GetAABB(ndVector& p0, ndVector& p1) const -{ - p0 = m_minAabb; - p1 = m_maxAabb; -} - -inline const ndVector& ndBody::GetCentreOfMass() const -{ - return m_localCentreOfMass; -} - -inline ndVector ndBody::GetVelocityAtPoint(const ndVector& point) const -{ - return m_veloc + m_omega.CrossProduct(point - m_globalCentreOfMass); -} - -inline ndFloat32 ndBody::GetInvMass() const -{ - return ndFloat32(0.0f); -} - - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematic.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematic.cpp deleted file mode 100644 index 9d7560b77b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematic.cpp +++ /dev/null @@ -1,725 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndScene.h" -#include "ndContact.h" -#include "ndShapeNull.h" -#include "ndRayCastNotify.h" -#include "ndBodyKinematic.h" -#include "ndShapeCompound.h" -#include "ndJointBilateralConstraint.h" - -#define D_MINIMUM_MASS ndFloat32(1.0e-5f) -#define D_INFINITE_MASS ndFloat32(1.0e15f) - -ndVector ndBodyKinematic::m_velocTol(ndVector(ndFloat32(1.0e-8f)) & ndVector::m_triplexMask); - -ndBodyKinematic::ndContactkey::ndContactkey(ndUnsigned32 tag0, ndUnsigned32 tag1) - :m_tagLow(ndMin(tag0, tag1)) - ,m_tagHigh(ndMax(tag0, tag1)) -{ - ndAssert(m_tagLow < m_tagHigh); -} - -bool ndBodyKinematic::ndContactkey::operator== (const ndContactkey& key) const -{ - return m_tag == key.m_tag; -} - -bool ndBodyKinematic::ndContactkey::operator< (const ndContactkey& key) const -{ - return m_tag < key.m_tag; -} - -bool ndBodyKinematic::ndContactkey::operator> (const ndContactkey& key) const -{ - return m_tag > key.m_tag; -} - -ndBodyKinematic::ndContactMap::ndContactMap() - :ndTree>() -{ -} - -ndBodyKinematic::ndContactMap::~ndContactMap() -{ -} - -ndContact* ndBodyKinematic::ndContactMap::FindContact(const ndBody* const body0, const ndBody* const body1) const -{ - ndContactkey key(body0->GetId(), body1->GetId()); - ndNode* const node = Find(key); - return node ? node->GetInfo() : nullptr; -} - -void ndBodyKinematic::ndContactMap::AttachContact(ndContact* const contact) -{ - ndBody* const body0 = contact->GetBody0(); - ndBody* const body1 = contact->GetBody1(); - ndContactkey key(body0->GetId(), body1->GetId()); - ndAssert(!Find(key)); - Insert(contact, key); -} - -void ndBodyKinematic::ndContactMap::DetachContact(ndContact* const contact) -{ - ndBody* const body0 = contact->GetBody0(); - ndBody* const body1 = contact->GetBody1(); - ndContactkey key(body0->GetId(), body1->GetId()); - ndAssert(Find(key)); - Remove(key); -} - -ndBodyKinematic::ndBodyKinematic() - :ndBody() - ,m_inertiaPrincipalAxis(ndGetIdentityMatrix()) - ,m_invWorldInertiaMatrix(ndGetZeroMatrix()) - ,m_shapeInstance(new ndShapeNull) - ,m_mass(ndVector::m_zero) - ,m_invMass(ndVector::m_zero) - ,m_accel(ndVector::m_zero) - ,m_alpha(ndVector::m_zero) - ,m_gyroAlpha(ndVector::m_zero) - ,m_gyroTorque(ndVector::m_zero) - ,m_gyroRotation() - ,m_jointList() - ,m_contactList() - ,m_lock() - ,m_scene(nullptr) - ,m_islandParent(nullptr) - ,m_sceneNode(nullptr) - ,m_skeletonContainer(nullptr) - ,m_spetialUpdateNode(nullptr) - ,m_maxAngleStep(ndFloat32 (90.0f) * ndDegreeToRad) - ,m_maxLinearStep(ndFloat32 (1.0f)) - ,m_weigh(ndFloat32 (0.0f)) - ,m_index(0) - ,m_bodyNodeIndex(-1) - ,m_buildSkelIndex(0) - ,m_sceneNodeIndex(-1) - ,m_buildBodyNodeIndex(-1) - ,m_buildSceneNodeIndex(-1) -{ - m_invWorldInertiaMatrix[3][3] = ndFloat32(1.0f); - m_shapeInstance.m_ownerBody = this; - SetMassMatrix(ndVector::m_zero); -} - -ndBodyKinematic::ndBodyKinematic(const ndBodyKinematic& src) - :ndBody(src) - ,m_inertiaPrincipalAxis(src.m_inertiaPrincipalAxis) - ,m_invWorldInertiaMatrix(src.m_invWorldInertiaMatrix) - ,m_shapeInstance(src.m_shapeInstance) - ,m_mass(ndVector::m_zero) - ,m_invMass(ndVector::m_zero) - ,m_accel(ndVector::m_zero) - ,m_alpha(ndVector::m_zero) - ,m_gyroAlpha(ndVector::m_zero) - ,m_gyroTorque(ndVector::m_zero) - ,m_gyroRotation() - ,m_jointList() - ,m_contactList() - ,m_lock() - ,m_scene(nullptr) - ,m_islandParent(nullptr) - ,m_sceneNode(nullptr) - ,m_skeletonContainer(nullptr) - ,m_spetialUpdateNode(nullptr) - ,m_maxAngleStep(ndFloat32(90.0f)* ndDegreeToRad) - ,m_maxLinearStep(ndFloat32(1.0f)) - ,m_weigh(ndFloat32(0.0f)) - ,m_index(0) - ,m_bodyNodeIndex(-1) - ,m_buildSkelIndex(0) - ,m_sceneNodeIndex(-1) - ,m_buildBodyNodeIndex(-1) - ,m_buildSceneNodeIndex(-1) -{ -} - -ndBodyKinematic::~ndBodyKinematic() -{ - ndAssert(m_scene == nullptr); - ndAssert(m_sceneNode == nullptr); - ndAssert(m_spetialUpdateNode == nullptr); -} - -void ndBodyKinematic::SetSleepState(bool state) -{ - m_equilibrium = ndUnsigned8 (state ? 1 : 0); - if ((m_invMass.m_w > ndFloat32(0.0f)) && (m_veloc.DotProduct(m_veloc).GetScalar() < ndFloat32(1.0e-10f)) && (m_omega.DotProduct(m_omega).GetScalar() < ndFloat32(1.0e-10f))) - { - ndVector invalidateVeloc(ndFloat32(10.0f)); - ndContactMap::Iterator it(m_contactList); - for (it.Begin(); it; it ++) - { - ndContact* const contactJoint = *it; - contactJoint->m_positAcc = invalidateVeloc; - } - } -} - -void ndBodyKinematic::SetCollisionShape(const ndShapeInstance& shapeInstance) -{ - m_shapeInstance = shapeInstance; - m_shapeInstance.m_ownerBody = this; - if (m_shapeInstance.GetShape()->GetAsShapeCompound()) - { - m_shapeInstance.GetShape()->GetAsShapeCompound()->SetSubShapeOwner(this); - } -} - -ndContact* ndBodyKinematic::FindContact(const ndBody* const otherBody) const -{ - ndScopeSpinLock lock(m_lock); - return m_contactList.FindContact(this, otherBody); -} - -void ndBodyKinematic::AttachContact(ndContact* const contact) -{ - ndScopeSpinLock lock(m_lock); - ndAssert((this == contact->GetBody0()) || (this == contact->GetBody1())); - if (m_invMass.m_w > ndFloat32(0.0f)) - { - m_equilibrium = 0; - } - - m_contactList.AttachContact(contact); -} - -void ndBodyKinematic::DetachContact(ndContact* const contact) -{ - ndScopeSpinLock lock(m_lock); - ndAssert((this == contact->GetBody0()) || (this == contact->GetBody1())); - //m_equilibrium = ndUnsigned8(contact->m_body0->m_equilibrium & contact->m_body1->m_equilibrium); - if (contact->IsActive() && m_invMass.m_w > ndFloat32(0.0f)) - { - m_equilibrium = 0; - } - m_contactList.DetachContact(contact); -} - -ndBodyKinematic::ndJointList::ndNode* ndBodyKinematic::AttachJoint(ndJointBilateralConstraint* const joint) -{ - m_equilibrium = 0; - #ifdef _DEBUG - ndBody* const body0 = joint->GetBody0(); - ndBody* const body1 = joint->GetBody1(); - for (ndJointList::ndNode* node = m_jointList.GetFirst(); node; node = node->GetNext()) - { - ndJointBilateralConstraint* const bodyJoint = node->GetInfo(); - ndBody* const bodyInJoint0 = bodyJoint->GetBody0(); - ndBody* const bodyInJoint1 = bodyJoint->GetBody1(); - bool test = (body0 == bodyInJoint0) && (body1 == bodyInJoint1); - test = test || ((body1 == bodyInJoint0) && (body0 == bodyInJoint1)); - test = test && (body1->GetInvMass() > ndFloat32(0.0f)); - test = test && bodyJoint->IsActive(); - if (test) - { - ndTrace(("warning body %d and body %d already connected by a biletaral joint\n", body0->GetId(), body1->GetId())); - ndAssert(0); - } - } - #endif - - return m_jointList.Append(joint); -} - -void ndBodyKinematic::DetachJoint(ndJointList::ndNode* const node) -{ - m_equilibrium = 0; -#ifdef _DEBUG - bool found = false; - for (ndJointList::ndNode* nodeptr = m_jointList.GetFirst(); nodeptr; nodeptr = nodeptr->GetNext()) - { - found = found || nodeptr; - } - ndAssert(found); -#endif - m_jointList.Remove(node); -} - -void ndBodyKinematic::SetMassMatrix(ndFloat32 mass, const ndShapeInstance& shapeInstance, bool fullInertia) -{ - ndMatrix inertia(shapeInstance.CalculateInertia()); - - ndVector origin(inertia.m_posit); - for (ndInt32 i = 0; i < 3; ++i) - { - inertia[i] = inertia[i].Scale(mass); - } - - // although the engine fully supports asymmetric inertia, I will ignore cross inertia for now - SetCentreOfMass(origin); - - if (!fullInertia) - { - ndMatrix matrix (inertia); - ndVector eigenValues(matrix.EigenVectors()); - inertia = ndGetIdentityMatrix(); - inertia[0][0] = eigenValues[0]; - inertia[1][1] = eigenValues[1]; - inertia[2][2] = eigenValues[2]; - } - SetMassMatrix(mass, inertia); -} - -void ndBodyKinematic::SetMassMatrix(ndFloat32 mass, const ndMatrix& inertia) -{ - mass = ndAbs(mass); - ndShape* const shape = m_shapeInstance.GetShape(); - - m_inertiaPrincipalAxis = ndGetIdentityMatrix(); - if ((mass < D_MINIMUM_MASS) || shape->GetAsShapeStaticMesh()) - { - mass = D_INFINITE_MASS * 2.0f; - } - - if (mass >= D_INFINITE_MASS) - { - m_mass.m_x = D_INFINITE_MASS; - m_mass.m_y = D_INFINITE_MASS; - m_mass.m_z = D_INFINITE_MASS; - m_mass.m_w = D_INFINITE_MASS; - m_invMass = ndVector::m_zero; - } - else - { - ndVector eigenValues(inertia[0][0], inertia[1][1], inertia[2][2], ndFloat32(0.0f)); - if (!((inertia[0][1] == ndFloat32(0.0f)) && (inertia[0][2] == ndFloat32(0.0f)) && (inertia[1][2] == ndFloat32(0.0f)))) - { - m_inertiaPrincipalAxis = inertia; - eigenValues = m_inertiaPrincipalAxis.EigenVectors(); - } - - ndFloat32 Ixx = ndAbs(eigenValues[0]); - ndFloat32 Iyy = ndAbs(eigenValues[1]); - ndFloat32 Izz = ndAbs(eigenValues[2]); - - ndFloat32 Ixx1 = ndClamp(Ixx, ndFloat32(0.0001f) * mass, ndFloat32(10000.0f) * mass); - ndFloat32 Iyy1 = ndClamp(Iyy, ndFloat32(0.0001f) * mass, ndFloat32(10000.0f) * mass); - ndFloat32 Izz1 = ndClamp(Izz, ndFloat32(0.0001f) * mass, ndFloat32(10000.0f) * mass); - - ndAssert(Ixx1 > ndFloat32(0.0f)); - ndAssert(Iyy1 > ndFloat32(0.0f)); - ndAssert(Izz1 > ndFloat32(0.0f)); - - m_mass.m_x = Ixx1; - m_mass.m_y = Iyy1; - m_mass.m_z = Izz1; - m_mass.m_w = mass; - - m_invMass.m_x = ndFloat32(1.0f) / Ixx1; - m_invMass.m_y = ndFloat32(1.0f) / Iyy1; - m_invMass.m_z = ndFloat32(1.0f) / Izz1; - m_invMass.m_w = ndFloat32(1.0f) / mass; - } - -//#ifdef _DEBUG -#if 0 - dgBodyMasterList& me = *m_world; - for (dgBodyMasterList::dNode* refNode = me.GetFirst(); refNode; refNode = refNode->GetNext()) { - dgBody* const body0 = refNode->GetInfo().GetBody(); - dVector invMass(body0->GetInvMass()); - if (invMass.m_w != 0.0f) { - for (; refNode; refNode = refNode->GetNext()) { - dgBody* const body1 = refNode->GetInfo().GetBody(); - dVector invMass1(body1->GetInvMass()); - dAssert(invMass1.m_w != 0.0f); - } - break; - } - } -#endif -} - -bool ndBodyKinematic::RayCast(ndRayCastNotify& callback, const ndFastRay& ray, ndFloat32 maxT) const -{ - ndVector l0(ray.m_p0); - ndVector l1(ray.m_p0 + ray.m_diff.Scale(ndMin(maxT, ndFloat32(1.0f)))); - - bool state = false; - if (ndRayBoxClip(l0, l1, m_minAabb, m_maxAabb)) - { - const ndMatrix& globalMatrix = m_shapeInstance.GetGlobalMatrix(); - ndVector localP0(globalMatrix.UntransformVector(l0) & ndVector::m_triplexMask); - ndVector localP1(globalMatrix.UntransformVector(l1) & ndVector::m_triplexMask); - ndVector p1p0(localP1 - localP0); - ndAssert(p1p0.m_w == ndFloat32(0.0f)); - if (p1p0.DotProduct(p1p0).GetScalar() > ndFloat32(1.0e-12f)) - { - if (m_shapeInstance.GetCollisionMode()) - { - ndContactPoint contactOut; - ndFloat32 t = m_shapeInstance.RayCast(callback, localP0, localP1, this, contactOut); - if (t < ndFloat32(1.0f)) - { - ndAssert(localP0.m_w == localP1.m_w); - ndVector p(globalMatrix.TransformVector(localP0 + (localP1 - localP0).Scale(t))); - t = ray.m_diff.DotProduct(p - ray.m_p0).GetScalar() / ray.m_diff.DotProduct(ray.m_diff).GetScalar(); - if (t < maxT) - { - ndAssert(t >= ndFloat32(0.0f)); - ndAssert(t <= ndFloat32(1.0f)); - contactOut.m_body0 = this; - contactOut.m_body1 = this; - contactOut.m_point = p; - contactOut.m_normal = globalMatrix.RotateVector(contactOut.m_normal); - state = callback.OnRayCastAction(contactOut, t) < ndFloat32 (1.0f); - } - } - } - } - } - return state; -} - -void ndBodyKinematic::UpdateCollisionMatrix() -{ - m_transformIsDirty = 1; - m_shapeInstance.SetGlobalMatrix(m_shapeInstance.GetLocalMatrix() * m_matrix); - m_shapeInstance.CalculateAabb(m_shapeInstance.GetGlobalMatrix(), m_minAabb, m_maxAabb); -} - -void ndBodyKinematic::SetMatrixUpdateScene(const ndMatrix& matrix) -{ - SetMatrix(matrix); - ndScene* const scene = GetScene(); - if (scene) - { - ndUnsigned8 sceneEquilibrium = 1; - ndUnsigned8 sceneForceUpdate = m_sceneForceUpdate; - if (ndUnsigned8(!m_equilibrium) | sceneForceUpdate) - { - ndBvhLeafNode* const bodyNode = scene->m_bvhSceneManager.GetLeafNode(this); - ndAssert(bodyNode->GetAsSceneBodyNode()); - ndAssert(!bodyNode->GetLeft()); - ndAssert(!bodyNode->GetRight()); - ndAssert(!GetCollisionShape().GetShape()->GetAsShapeNull()); - - UpdateCollisionMatrix(); - const ndInt32 test = ndBoxInclusionTest(m_minAabb, m_maxAabb, bodyNode->m_minBox, bodyNode->m_maxBox); - if (!test) - { - bodyNode->SetAabb(m_minAabb, m_maxAabb); - } - sceneEquilibrium = ndUnsigned8(!sceneForceUpdate & (test != 0)); - } - m_sceneForceUpdate = 0; - m_sceneEquilibrium = sceneEquilibrium; - } -} - -ndMatrix ndBodyKinematic::CalculateInvInertiaMatrix() const -{ - const ndVector invIxx(m_invMass[0]); - const ndVector invIyy(m_invMass[1]); - const ndVector invIzz(m_invMass[2]); - - const ndMatrix matrix(m_inertiaPrincipalAxis * m_matrix); - return ndMatrix( - matrix.m_front.Scale(matrix.m_front[0]) * invIxx + - matrix.m_up.Scale(matrix.m_up[0]) * invIyy + - matrix.m_right.Scale(matrix.m_right[0]) * invIzz, - - matrix.m_front.Scale(matrix.m_front[1]) * invIxx + - matrix.m_up.Scale(matrix.m_up[1]) * invIyy + - matrix.m_right.Scale(matrix.m_right[1]) * invIzz, - - matrix.m_front.Scale(matrix.m_front[2]) * invIxx + - matrix.m_up.Scale(matrix.m_up[2]) * invIyy + - matrix.m_right.Scale(matrix.m_right[2]) * invIzz, - ndVector::m_wOne); -} - -ndMatrix ndBodyKinematic::CalculateInertiaMatrix() const -{ - const ndVector Ixx(m_mass.m_x); - const ndVector Iyy(m_mass.m_y); - const ndVector Izz(m_mass.m_z); - - const ndMatrix matrix(m_inertiaPrincipalAxis * m_matrix); - return ndMatrix( - matrix.m_front.Scale(matrix.m_front[0]) * Ixx + - matrix.m_up.Scale(matrix.m_up[0]) * Iyy + - matrix.m_right.Scale(matrix.m_right[0]) * Izz, - - matrix.m_front.Scale(matrix.m_front[1]) * Ixx + - matrix.m_up.Scale(matrix.m_up[1]) * Iyy + - matrix.m_right.Scale(matrix.m_right[1]) * Izz, - - matrix.m_front.Scale(matrix.m_front[2]) * Ixx + - matrix.m_up.Scale(matrix.m_up[2]) * Iyy + - matrix.m_right.Scale(matrix.m_right[2]) * Izz, - ndVector::m_wOne); -} - -ndVector ndBodyKinematic::CalculateLinearMomentum() const -{ - return m_veloc.Scale(m_mass.m_w); -} - -ndVector ndBodyKinematic::CalculateAngularMomentum() const -{ - const ndVector localOmega(m_inertiaPrincipalAxis.UnrotateVector (m_matrix.UnrotateVector(m_omega))); - const ndVector localAngularMomentum(m_mass * localOmega); - return m_matrix.RotateVector(m_inertiaPrincipalAxis.RotateVector(localAngularMomentum)); -} - -ndJacobian ndBodyKinematic::CalculateNetForce() const -{ - ndJacobian force; - - force.m_linear = GetForce(); - force.m_angular = GetTorque(); - for (ndJointList::ndNode* node = GetJointList().GetFirst(); node; node = node->GetNext()) - { - ndJointBilateralConstraint* const joint = node->GetInfo(); - if (joint->GetBody0() == this) - { - force.m_linear += joint->GetForceBody0(); - force.m_angular += joint->GetTorqueBody0(); - } - else - { - ndAssert(joint->GetBody1() == this); - force.m_linear += joint->GetForceBody1(); - force.m_angular += joint->GetTorqueBody1(); - } - } - - const ndBodyKinematic::ndContactMap& contactMap = GetContactMap(); - ndBodyKinematic::ndContactMap::Iterator it(contactMap); - for (it.Begin(); it; it++) - { - ndContact* const fronterContact = it.GetNode()->GetInfo(); - if (fronterContact->IsActive()) - { - if (fronterContact->GetBody0() == this) - { - force.m_linear += fronterContact->GetForceBody0(); - force.m_angular += fronterContact->GetTorqueBody0(); - } - else - { - ndAssert(fronterContact->GetBody1() == this); - force.m_linear += fronterContact->GetForceBody1(); - force.m_angular += fronterContact->GetTorqueBody1(); - } - } - } - return force; -} - -ndFloat32 ndBodyKinematic::TotalEnergy() const -{ - ndVector energy (m_veloc.DotProduct(CalculateLinearMomentum()) + m_veloc.DotProduct(CalculateAngularMomentum())); - return energy.AddHorizontal().GetScalar()* ndFloat32(0.5f); -} - -void ndBodyKinematic::ClearMemory() -{ - -} - -void ndBodyKinematic::IntegrateVelocity(ndFloat32 timestep) -{ - ndAssert(m_veloc.m_w == ndFloat32(0.0f)); - ndAssert(m_omega.m_w == ndFloat32(0.0f)); - m_globalCentreOfMass += m_veloc.Scale(timestep); - - const ndFloat32 omegaMag2 = m_omega.DotProduct(m_omega).GetScalar(); - -#ifdef _DEBUG - const ndFloat32 angular2 = omegaMag2 * timestep * timestep; - const ndFloat32 linear2 = m_veloc.DotProduct(m_veloc).GetScalar() * timestep * timestep;; - const ndFloat32 maxAngularStep2 = m_maxAngleStep * m_maxAngleStep; - const ndFloat32 maxLinearStep2 = m_maxLinearStep * m_maxLinearStep; - if ((angular2 > maxAngularStep2) || (linear2 > maxLinearStep2)) - { - ndTrace(("warning body %d w(%f %f %f) v(%f %f %f) with very high velocity or angular velocity, may be unstable\n", - m_uniqueId, - m_omega.m_x, m_omega.m_y, m_omega.m_z, - m_veloc.m_x, m_veloc.m_y, m_veloc.m_z)); - //ndAssert(0); - } -#endif - - const ndFloat32 tol = (ndFloat32(0.0125f) * ndDegreeToRad); - const ndFloat32 tol2 = tol * tol; - if (omegaMag2 > tol2) - { - const ndFloat32 omegaAngle = ndSqrt(omegaMag2); - const ndVector omegaAxis(m_omega.Scale(ndFloat32 (1.0f)/ omegaAngle)); - const ndQuaternion rotationStep(omegaAxis, omegaAngle * timestep); - const ndQuaternion rotation(m_rotation * rotationStep); - m_rotation = rotation.Normalize(); - ndAssert((m_rotation.DotProduct(m_rotation).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-5f)); - m_matrix = ndCalculateMatrix(m_rotation, m_matrix.m_posit); - } - - m_matrix.m_posit = m_globalCentreOfMass - m_matrix.RotateVector(m_localCentreOfMass); - ndAssert(m_matrix.TestOrthogonal()); -} - -void ndBodyKinematic::IntegrateExternalForce(ndFloat32 timestep) -{ - if (!m_equilibrium && (m_invMass.m_w > ndFloat32(0.0f))) - { - const ndVector accel(GetForce().Scale(m_invMass.m_w)); - const ndVector torque(GetTorque()); - - // using simple backward Euler or implicit integration, this is. - // f'(t + dt) = (f(t + dt) - f(t)) / dt - - // therefore: - // f(t + dt) = f(t) + f'(t + dt) * dt - - // approximate f'(t + dt) by expanding the Taylor of f(w + dt) - // f(w + dt) = f(w) + f'(w) * dt + f''(w) * dt^2 / 2! + .... - - // assume dt^2 is negligible, therefore we can truncate the expansion to - // f(w + dt) ~= f(w) + f'(w) * dt - - // calculating dw as the f'(w) = d(wx, wy, wz) | dt - // dw/dt = a = (Tl - (wl x (wl * Il)) * Il^-1 - - // expanding f(w) - // f'(wx) = Ix * ax = Tx - (Iz - Iy) * wy * wz - // f'(wy) = Iy * ay = Ty - (Ix - Iz) * wz * wx - // f'(wz) = Iz * az = Tz - (Iy - Ix) * wx * wy - // - // calculation the expansion - // Ix * ax = (Tx - (Iz - Iy) * wy * wz) - ((Iz - Iy) * wy * az + (Iz - Iy) * ay * wz) * dt - // Iy * ay = (Ty - (Ix - Iz) * wz * wx) - ((Ix - Iz) * wz * ax + (Ix - Iz) * az * wx) * dt - // Iz * az = (Tz - (Iy - Ix) * wx * wy) - ((Iy - Ix) * wx * ay + (Iy - Ix) * ax * wy) * dt - // - // factorizing a we get - // Ix * ax + (Iz - Iy) * dwy * az + (Iz - Iy) * dwz * ay = Tx - (Iz - Iy) * wy * wz - // Iy * ay + (Ix - Iz) * dwz * ax + (Ix - Iz) * dwx * az = Ty - (Ix - Iz) * wz * wx - // Iz * az + (Iy - Ix) * dwx * ay + (Iy - Ix) * dwy * ax = Tz - (Iy - Ix) * wx * wy - - const ndMatrix matrix(m_inertiaPrincipalAxis * m_matrix); - - ndVector localOmega(matrix.UnrotateVector(m_omega)); - const ndVector localAngularMomentum(m_mass * localOmega); - const ndVector angularMomentum(matrix.RotateVector(localAngularMomentum)); - const ndVector gyroTorque(m_omega.CrossProduct(angularMomentum)); - const ndVector localTorque(matrix.UnrotateVector(torque - gyroTorque)); - // and solving for alpha we get the angular acceleration at t + dt - - // derivative at half time step. (similar to midpoint Euler so that it does not loses too much energy) - const ndVector dw(localOmega.Scale(ndFloat32(0.5f) * timestep)); - - // calculates Jacobian matrix ( - // dWx / dwx, dWx / dwy, dWx / dwz - // dWy / dwx, dWy / dwy, dWy / dwz - // dWz / dwx, dWz / dwy, dWz / dwz - // - // dWx / dwx = Ix, dWx / dwy = (Iz - Iy) * wz * dt, dWx / dwz = (Iz - Iy) * wy * dt) - // dWy / dwx = (Ix - Iz) * wz * dt, dWy / dwy = Iy, dWy / dwz = (Ix - Iz) * wx * dt - // dWz / dwx = (Iy - Ix) * wy * dt, dWz / dwy = (Iy - Ix) * wx * dt, dWz / dwz = Iz - const ndMatrix jacobianMatrix( - ndVector(m_mass.m_x, (m_mass.m_z - m_mass.m_y) * dw.m_z, (m_mass.m_z - m_mass.m_y) * dw.m_y, ndFloat32(0.0f)), - ndVector((m_mass.m_x - m_mass.m_z) * dw.m_z, m_mass.m_y, (m_mass.m_x - m_mass.m_z) * dw.m_x, ndFloat32(0.0f)), - ndVector((m_mass.m_y - m_mass.m_x) * dw.m_y, (m_mass.m_y - m_mass.m_x) * dw.m_x, m_mass.m_z, ndFloat32(0.0f)), - ndVector::m_wOne); - - const ndVector gradientStep (jacobianMatrix.SolveByGaussianElimination(localTorque.Scale(timestep))); - localOmega += gradientStep; - - const ndVector alpha(matrix.RotateVector(localTorque * m_invMass)); - - SetAccel(accel); - SetAlpha(alpha); - m_veloc += accel.Scale(timestep); - m_omega = matrix.RotateVector(localOmega); - } - else - { - SetAccel(ndVector::m_zero); - SetAlpha(ndVector::m_zero); - } -} - -void ndBodyKinematic::EvaluateSleepState(ndFloat32 freezeSpeed2, ndFloat32) -{ - m_isJointFence0 = 1; - if (m_isStatic) - { - m_equilibrium = 1; - } - else - { - ndInt32 count = 0; - ndUnsigned8 equilibrium = (m_invMass.m_w == ndFloat32(0.0f)) ? 1 : (m_autoSleep & ~m_equilibriumOverride); - const ndVector isMovingMask(m_veloc + m_omega); - const ndVector mask(isMovingMask.TestZero()); - const ndInt32 test = mask.GetSignMask() & 7; - if (test != 7) - { - const ndFloat32 speed2 = m_veloc.DotProduct(m_veloc).GetScalar(); - const ndFloat32 omega2 = m_omega.DotProduct(m_omega).GetScalar(); - ndUnsigned32 equilibriumTest = ndUnsigned32((speed2 < freezeSpeed2) && (omega2 < freezeSpeed2)); - - if (equilibriumTest) - { - const ndFloat32 velocityDragCoeff = (count <= 1) ? D_FREEZZING_VELOCITY_DRAG : ndFloat32(0.9999f); - const ndVector velocDragVect(velocityDragCoeff, velocityDragCoeff, velocityDragCoeff, ndFloat32(0.0f)); - const ndVector veloc(m_veloc * velocDragVect); - const ndVector omega(m_omega * velocDragVect); - const ndVector velocMask(veloc.DotProduct(veloc) > m_velocTol); - const ndVector omegaMask(omega.DotProduct(omega) > m_velocTol); - m_veloc = velocMask & veloc; - m_omega = omegaMask & omega; - } - - equilibrium &= equilibriumTest; - } - m_isJointFence0 = equilibrium; - if (equilibrium & ~m_isConstrained) - { - m_equilibrium = equilibrium; - } - } -} - -void ndBodyKinematic::InitSurrogateBody(ndBodyKinematic* const surrogate) const -{ - surrogate->m_veloc = m_veloc; - surrogate->m_omega = m_omega; - surrogate->m_matrix = m_matrix; - surrogate->m_localCentreOfMass = m_localCentreOfMass; - surrogate->m_globalCentreOfMass = m_globalCentreOfMass; - - surrogate->m_mass = m_mass; - surrogate->m_accel = m_accel; - surrogate->m_alpha = m_alpha; - surrogate->m_invMass = m_invMass; - surrogate->m_gyroAlpha = m_gyroAlpha; - surrogate->m_gyroTorque = m_gyroTorque; - surrogate->m_gyroRotation = m_gyroRotation; - surrogate->m_invWorldInertiaMatrix = m_invWorldInertiaMatrix; - surrogate->m_inertiaPrincipalAxis = m_inertiaPrincipalAxis; -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematic.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematic.h deleted file mode 100644 index dd22d028f8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematic.h +++ /dev/null @@ -1,547 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODY_KINEMATIC_H__ -#define __ND_BODY_KINEMATIC_H__ - -#include "ndCollisionStdafx.h" -#include "ndBody.h" -#include "ndConstraint.h" -#include "ndBodyListView.h" - -class ndScene; -class ndModel; -class ndSkeletonContainer; -class ndJointBilateralConstraint; - -#define D_FREEZZING_VELOCITY_DRAG ndFloat32 (0.9f) -#define D_SOLVER_MAX_ACCEL_ERROR (D_FREEZE_MAG * ndFloat32 (0.5f)) - -D_MSV_NEWTON_ALIGN_32 -class ndBodyKinematic : public ndBody -{ - class ndContactkey - { - public: - ndContactkey(ndUnsigned32 tag0, ndUnsigned32 tag1); - - bool operator> (const ndContactkey& key) const; - bool operator< (const ndContactkey& key) const; - bool operator== (const ndContactkey& key) const; - private: - union - { - ndUnsigned64 m_tag; - class - { - public: - ndUnsigned32 m_tagLow; - ndUnsigned32 m_tagHigh; - }; - }; - }; - - public: - class ndJointList : public ndList> - { - public: - ndJointList() - :ndList>() - { - } - }; - - class ndContactMap: public ndTree> - { - public: - D_COLLISION_API ndContact* FindContact(const ndBody* const body0, const ndBody* const body1) const; - - private: - ndContactMap(); - ~ndContactMap(); - void AttachContact(ndContact* const contact); - void DetachContact(ndContact* const contact); - friend class ndBodyKinematic; - }; - - D_CLASS_REFLECTION(ndBodyKinematic,ndBody) - - D_COLLISION_API ndBodyKinematic(); - D_COLLISION_API ndBodyKinematic(const ndBodyKinematic& src); - D_COLLISION_API virtual ~ndBodyKinematic(); - - ndScene* GetScene() const; - - ndUnsigned32 GetIndex() const; - ndFloat32 GetInvMass() const; - const ndVector GetInvInertia() const; - const ndVector& GetMassMatrix() const; - const ndMatrix& GetInvInertiaMatrix() const; - - ndVector GetGyroAlpha() const; - ndVector GetGyroTorque() const; - - bool GetSleepState() const; - void RestoreSleepState(bool state); - D_COLLISION_API void SetSleepState(bool state); - - bool GetAutoSleep() const; - void SetAutoSleep(bool state); - ndFloat32 GetMaxLinearStep() const; - ndFloat32 GetMaxAngularStep() const; - void SetDebugMaxLinearAndAngularIntegrationStep(ndFloat32 angleInRadian, ndFloat32 stepInUnitPerSeconds); - - virtual ndFloat32 GetLinearDamping() const; - virtual void SetLinearDamping(ndFloat32 linearDamp); - - virtual ndVector GetCachedDamping() const; - virtual ndVector GetAngularDamping() const; - virtual void SetAngularDamping(const ndVector& angularDamp); - - D_COLLISION_API ndShapeInstance& GetCollisionShape(); - D_COLLISION_API const ndShapeInstance& GetCollisionShape() const; - D_COLLISION_API virtual void SetCollisionShape(const ndShapeInstance& shapeInstance); - D_COLLISION_API virtual bool RayCast(ndRayCastNotify& callback, const ndFastRay& ray, const ndFloat32 maxT) const; - - D_COLLISION_API ndVector CalculateLinearMomentum() const; - D_COLLISION_API virtual ndVector CalculateAngularMomentum() const; - D_COLLISION_API ndFloat32 TotalEnergy() const; - - D_COLLISION_API void ClearMemory(); - D_COLLISION_API virtual void IntegrateVelocity(ndFloat32 timestep); - D_COLLISION_API void SetMatrixUpdateScene(const ndMatrix& matrix); - D_COLLISION_API virtual ndContact* FindContact(const ndBody* const otherBody) const; - - D_COLLISION_API ndJacobian CalculateNetForce() const; - D_COLLISION_API ndMatrix CalculateInertiaMatrix() const; - D_COLLISION_API virtual ndMatrix CalculateInvInertiaMatrix() const; - D_COLLISION_API virtual void SetMassMatrix(ndFloat32 mass, const ndMatrix& inertia); - D_COLLISION_API void SetMassMatrix(ndFloat32 mass, const ndShapeInstance& shapeInstance, bool fullInertia = false); - D_COLLISION_API virtual void InitSurrogateBody(ndBodyKinematic* const surrogate) const; - - void UpdateInvInertiaMatrix(); - void SetMassMatrix(const ndVector& massMatrix); - void SetMassMatrix(ndFloat32 Ixx, ndFloat32 Iyy, ndFloat32 Izz, ndFloat32 mass); - - ndMatrix GetPrincipalAxis() const; - void GetMassMatrix(ndFloat32& Ixx, ndFloat32& Iyy, ndFloat32& Izz, ndFloat32& mass); - - virtual ndBodyKinematic* GetAsBodyKinematic(); - - ndSkeletonContainer* GetSkeleton() const; - void SetSkeleton(ndSkeletonContainer* const skeleton); - - virtual ndVector GetForce() const; - virtual ndVector GetTorque() const; - - virtual void SetForce(const ndVector& force); - virtual void SetTorque(const ndVector& torque); - - virtual void AddImpulse(const ndVector& pointVeloc, const ndVector& pointPosit, ndFloat32 timestep); - virtual void ApplyImpulsePair(const ndVector& linearImpulse, const ndVector& angularImpulse, ndFloat32 timestep); - virtual void ApplyImpulsesAtPoint(ndInt32 count, const ndVector* const impulseArray, const ndVector* const pointArray, ndFloat32 timestep); - - ndVector GetAccel() const; - ndVector GetAlpha() const; - void SetAccel(const ndVector& accel); - void SetAlpha(const ndVector& alpha); - - ndJointList& GetJointList(); - ndContactMap& GetContactMap(); - const ndJointList& GetJointList() const; - const ndContactMap& GetContactMap() const; - - protected: - D_COLLISION_API virtual void AttachContact(ndContact* const contact); - D_COLLISION_API virtual void DetachContact(ndContact* const contact); - - D_COLLISION_API virtual void DetachJoint(ndJointList::ndNode* const node); - D_COLLISION_API virtual ndJointList::ndNode* AttachJoint(ndJointBilateralConstraint* const joint); - - D_COLLISION_API virtual void IntegrateExternalForce(ndFloat32 timestep); - - void SetAccel(const ndJacobian& accel); - virtual void SpecialUpdate(ndFloat32 timestep); - virtual void IntegrateGyroSubstep(const ndVector& timestep); - virtual void ApplyExternalForces(ndInt32 threadIndex, ndFloat32 timestep); - virtual ndJacobian IntegrateForceAndToque(const ndVector& force, const ndVector& torque, const ndVector& timestep) const; - - void UpdateCollisionMatrix(); - void PrepareStep(ndInt32 index); - void SetSceneNodes(ndScene* const scene, ndBodyListView::ndNode* const node); - - virtual void AddDampingAcceleration(ndFloat32 timestep); - - D_COLLISION_API virtual void EvaluateSleepState(ndFloat32 freezeSpeed2, ndFloat32 freezeAccel2); - - virtual void SetAcceleration(const ndVector& accel, const ndVector& alpha); - - ndMatrix m_inertiaPrincipalAxis; - ndMatrix m_invWorldInertiaMatrix; - ndShapeInstance m_shapeInstance; - ndVector m_mass; - ndVector m_invMass; - ndVector m_accel; - ndVector m_alpha; - ndVector m_gyroAlpha; - ndVector m_gyroTorque; - ndQuaternion m_gyroRotation; - ndJointList m_jointList; - ndContactMap m_contactList; - mutable ndSpinLock m_lock; - ndScene* m_scene; - ndBodyKinematic* m_islandParent; - ndBodyListView::ndNode* m_sceneNode; - ndSkeletonContainer* m_skeletonContainer; - ndSpecialList::ndNode* m_spetialUpdateNode; - - ndFloat32 m_maxAngleStep; - ndFloat32 m_maxLinearStep; - ndFloat32 m_weigh; - ndInt32 m_index; - ndInt32 m_bodyNodeIndex; - ndInt32 m_buildSkelIndex; - ndInt32 m_sceneNodeIndex; - ndInt32 m_buildBodyNodeIndex; - ndInt32 m_buildSceneNodeIndex; - - D_COLLISION_API static ndVector m_velocTol; - - friend class ndWorld; - friend class ndScene; - friend class ndContact; - friend class ndIkSolver; - friend class ndBvhLeafNode; - friend class ndDynamicsUpdate; - friend class ndWorldSceneSycl; - friend class ndWorldSceneCuda; - friend class ndBvhSceneManager; - friend class ndSkeletonContainer; - friend class ndModelArticulation; - friend class ndDynamicsUpdateSoa; - friend class ndDynamicsUpdateAvx2; - friend class ndDynamicsUpdateSycl; - friend class ndDynamicsUpdateCuda; - friend class ndJointBilateralConstraint; -} D_GCC_NEWTON_ALIGN_32; - - -class ndBodySentinel : public ndBodyKinematic -{ - ndBodySentinel* GetAsBodySentinel() { return this; } -}; - -inline ndUnsigned32 ndBodyKinematic::GetIndex() const -{ - return ndUnsigned32(m_index); -} - -inline ndFloat32 ndBodyKinematic::GetInvMass() const -{ - return m_invMass.m_w; -} - -inline const ndVector ndBodyKinematic::GetInvInertia() const -{ - return m_invMass & ndVector::m_triplexMask; -} - -inline const ndVector& ndBodyKinematic::GetMassMatrix() const -{ - return m_mass; -} - -inline const ndMatrix& ndBodyKinematic::GetInvInertiaMatrix() const -{ - return m_invWorldInertiaMatrix; -} - -inline ndVector ndBodyKinematic::GetGyroAlpha() const -{ - return m_gyroAlpha; -} - -inline ndVector ndBodyKinematic::GetGyroTorque() const -{ - return m_gyroTorque; -} - -inline void ndBodyKinematic::GetMassMatrix(ndFloat32& Ixx, ndFloat32& Iyy, ndFloat32& Izz, ndFloat32& mass) -{ - Ixx = m_mass.m_x; - Iyy = m_mass.m_y; - Izz = m_mass.m_z; - mass = m_mass.m_w; -} - -inline void ndBodyKinematic::SetMassMatrix(const ndVector& massMatrix) -{ - ndMatrix inertia(ndGetIdentityMatrix()); - inertia[0][0] = massMatrix.m_x; - inertia[1][1] = massMatrix.m_y; - inertia[2][2] = massMatrix.m_z; - SetMassMatrix(massMatrix.m_w, inertia); -} - -inline void ndBodyKinematic::SetMassMatrix(ndFloat32 Ixx, ndFloat32 Iyy, ndFloat32 Izz, ndFloat32 mass) -{ - SetMassMatrix(ndVector(Ixx, Iyy, Izz, mass)); -} - -inline ndMatrix ndBodyKinematic::GetPrincipalAxis() const -{ - return m_inertiaPrincipalAxis; -} - -inline ndBodyKinematic* ndBodyKinematic::GetAsBodyKinematic() -{ - return this; -} - -inline ndScene* ndBodyKinematic::GetScene() const -{ - return m_scene; -} - -inline void ndBodyKinematic::SetSceneNodes(ndScene* const scene, ndBodyListView::ndNode* const node) -{ - m_scene = scene; - m_sceneNode = node; -} - -inline ndVector ndBodyKinematic::GetForce() const -{ - return ndVector::m_zero; -} - -inline ndVector ndBodyKinematic::GetTorque() const -{ - return ndVector::m_zero; -} - -inline void ndBodyKinematic::SetForce(const ndVector&) -{ -} - -inline void ndBodyKinematic::SetTorque(const ndVector&) -{ -} - -inline ndVector ndBodyKinematic::GetAccel() const -{ - return m_accel; -} - -inline void ndBodyKinematic::SetAccel(const ndVector& accel) -{ - m_accel = accel; -} - -inline ndVector ndBodyKinematic::GetAlpha() const -{ - return m_alpha; -} - -inline void ndBodyKinematic::SetAlpha(const ndVector& alpha) -{ - m_alpha = alpha; -} - -inline void ndBodyKinematic::AddDampingAcceleration(ndFloat32) -{ -} - -inline void ndBodyKinematic::SetAccel(const ndJacobian& accel) -{ - SetAccel(accel.m_linear); - SetAlpha(accel.m_angular); -} - -inline void ndBodyKinematic::PrepareStep(ndInt32 index) -{ - m_index = index; - m_isJointFence0 = 1; - m_isJointFence1 = 1; - m_isConstrained = 0; - m_buildSkelIndex = 0; - m_islandParent = this; - m_weigh = ndFloat32(0.0f); - m_isStatic = ndUnsigned8(m_invMass.m_w == ndFloat32(0.0f)); - m_equilibrium = ndUnsigned8 (m_isStatic | m_equilibrium); - m_equilibrium0 = m_equilibrium; -} - -inline ndBodyKinematic::ndContactMap& ndBodyKinematic::GetContactMap() -{ - return m_contactList; -} - -inline const ndBodyKinematic::ndContactMap& ndBodyKinematic::GetContactMap() const -{ - return m_contactList; -} - -inline ndBodyKinematic::ndJointList& ndBodyKinematic::GetJointList() -{ - return m_jointList; -} - -inline const ndBodyKinematic::ndJointList& ndBodyKinematic::GetJointList() const -{ - return m_jointList; -} - -inline ndShapeInstance& ndBodyKinematic::GetCollisionShape() -{ - return (ndShapeInstance&)m_shapeInstance; -} - -inline const ndShapeInstance& ndBodyKinematic::GetCollisionShape() const -{ - return m_shapeInstance; -} - -inline bool ndBodyKinematic::GetAutoSleep() const -{ - return m_autoSleep ? true : false; -} - -inline bool ndBodyKinematic::GetSleepState() const -{ - return m_equilibrium ? true : false; -} - -inline void ndBodyKinematic::RestoreSleepState(bool state) -{ - m_equilibrium = ndUnsigned8 (state ? 1 : 0); -} - -inline void ndBodyKinematic::SetAutoSleep(bool state) -{ - m_autoSleep = ndUnsigned8 (state ? 1 : 0); - SetSleepState(false); -} - -inline ndSkeletonContainer* ndBodyKinematic::GetSkeleton() const -{ - return m_skeletonContainer; -} - -inline void ndBodyKinematic::SetSkeleton(ndSkeletonContainer* const skeleton) -{ - m_skeletonContainer = skeleton; -} - -inline ndFloat32 ndBodyKinematic::GetMaxLinearStep() const -{ - return m_maxLinearStep; -} - -inline ndFloat32 ndBodyKinematic::GetMaxAngularStep() const -{ - return m_maxAngleStep; -} - -inline void ndBodyKinematic::SetDebugMaxLinearAndAngularIntegrationStep(ndFloat32 angleInRadian, ndFloat32 stepInUnitPerSeconds) -{ - m_maxLinearStep = ndMax(ndAbs(stepInUnitPerSeconds), ndFloat32(1.0f)); - m_maxAngleStep = ndMax(ndAbs(angleInRadian), ndFloat32(90.0f) * ndDegreeToRad); -} - -inline void ndBodyKinematic::SetLinearDamping(ndFloat32) -{ -} - -inline ndFloat32 ndBodyKinematic::GetLinearDamping() const -{ - return ndFloat32(0.0f); -} - -inline void ndBodyKinematic::SetAngularDamping(const ndVector&) -{ -} - -inline ndVector ndBodyKinematic::GetAngularDamping() const -{ - return ndVector::m_zero; -} - -inline ndVector ndBodyKinematic::GetCachedDamping() const -{ - return ndVector::m_one; -} - -inline void ndBodyKinematic::UpdateInvInertiaMatrix() -{ - ndAssert(m_invWorldInertiaMatrix[0][3] == ndFloat32(0.0f)); - ndAssert(m_invWorldInertiaMatrix[1][3] == ndFloat32(0.0f)); - ndAssert(m_invWorldInertiaMatrix[2][3] == ndFloat32(0.0f)); - ndAssert(m_invWorldInertiaMatrix[3][3] == ndFloat32(1.0f)); - - m_invWorldInertiaMatrix = CalculateInvInertiaMatrix(); - - ndAssert(m_invWorldInertiaMatrix[0][3] == ndFloat32(0.0f)); - ndAssert(m_invWorldInertiaMatrix[1][3] == ndFloat32(0.0f)); - ndAssert(m_invWorldInertiaMatrix[2][3] == ndFloat32(0.0f)); - ndAssert(m_invWorldInertiaMatrix[3][3] == ndFloat32(1.0f)); -} - -inline void ndBodyKinematic::IntegrateGyroSubstep(const ndVector&) -{ -} - -inline ndJacobian ndBodyKinematic::IntegrateForceAndToque(const ndVector&, const ndVector&, const ndVector&) const -{ - ndJacobian step; - step.m_linear = ndVector::m_zero; - step.m_angular = ndVector::m_zero; - return step; -} - -inline void ndBodyKinematic::AddImpulse(const ndVector&, const ndVector&, ndFloat32) -{ -} - -inline void ndBodyKinematic::ApplyImpulsePair(const ndVector&, const ndVector&, ndFloat32) -{ -} - -inline void ndBodyKinematic::ApplyImpulsesAtPoint(ndInt32, const ndVector* const, const ndVector* const, ndFloat32) -{ -} - -inline void ndBodyKinematic::SpecialUpdate(ndFloat32) -{ - ndAssert(0); -} - -inline void ndBodyKinematic::ApplyExternalForces(ndInt32, ndFloat32) -{ -} - -inline void ndBodyKinematic::SetAcceleration(const ndVector&, const ndVector&) -{ - m_accel = ndVector::m_zero; - m_alpha = ndVector::m_zero; -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematicBase.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematicBase.cpp deleted file mode 100644 index 56baee8ff3..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematicBase.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndBodyKinematicBase.h" - -ndBodyKinematicBase::ndBodyKinematicBase() - :ndBodyKinematic() -{ - m_contactTestOnly = 1; -} - -ndBodyKinematicBase::~ndBodyKinematicBase() -{ -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematicBase.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematicBase.h deleted file mode 100644 index c30f3290a7..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyKinematicBase.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODY_KINEMATIC_SPETIAL_H__ -#define __ND_BODY_KINEMATIC_SPETIAL_H__ - -#include "ndCollisionStdafx.h" -#include "ndBodyKinematic.h" - -D_MSV_NEWTON_ALIGN_32 -class ndBodyKinematicBase : public ndBodyKinematic -{ - public: - D_CLASS_REFLECTION(ndBodyKinematicBase,ndBodyKinematic) - D_COLLISION_API ndBodyKinematicBase(); - D_COLLISION_API virtual ~ndBodyKinematicBase(); - - void SpecialUpdate(ndFloat32 timestep); - ndBodyKinematicBase* GetAsBodyKinematicSpecial(); -} D_GCC_NEWTON_ALIGN_32; - -inline ndBodyKinematicBase* ndBodyKinematicBase::GetAsBodyKinematicSpecial() -{ - return this; -} - -inline void ndBodyKinematicBase::SpecialUpdate(ndFloat32) -{ - ndAssert(0); -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyListView.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyListView.cpp deleted file mode 100644 index 43b6b1a98b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyListView.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndBodyListView.h" -#include "ndBodyKinematic.h" - -ndBodyListView::ndBodyListView(const ndBodyListView& src) - :ndList, ndContainersFreeListAlloc*>>() - ,m_view(1024) - ,m_listIsDirty(1) -{ - ndNode* nextNode; - ndBodyListView* const stealData = (ndBodyListView*)&src; - for (ndNode* node = stealData->GetFirst(); node; node = nextNode) - { - nextNode = node->GetNext(); - stealData->Unlink(node); - Append(node); - } - m_view.Swap(stealData->m_view); -} - -bool ndBodyListView::UpdateView() -{ - bool ret = false; - if (m_listIsDirty) - { - D_TRACKTIME(); - ret = true; - m_listIsDirty = 0; - ndInt32 index = 0; - m_view.SetCount(GetCount()); - for (ndNode* node = GetFirst(); node; node = node->GetNext()) - { - m_view[index] = node->GetInfo()->GetAsBodyKinematic(); - index++; - } - } - return ret; -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyListView.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyListView.h deleted file mode 100644 index aeb210cfc4..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyListView.h +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_LIST_VIEW_H__ -#define __ND_LIST_VIEW_H__ - -#include "ndCollisionStdafx.h" - -class ndBody; -class ndBodyKinematic; - -template -class ndSpecialList : public ndList> -{ - public: - ndSpecialList(); -}; - -template -class ndSharedList : public ndList, ndContainersFreeListAlloc*>> -{ - public: - ndSharedList(); -}; - -//class ndBodyList : public ndList, ndContainersFreeListAlloc*>> -class ndBodyList : public ndSharedList -{ - public: - ndBodyList(); -}; - -class ndBodyListView: public ndList, ndContainersFreeListAlloc*>> -{ - public: - ndBodyListView(); - ndBodyListView(const ndBodyListView& src); - - ndArray& GetView(); - const ndArray& GetView() const; - - bool UpdateView(); - bool IsListDirty() const; - void RemoveItem(ndNode* const node); - ndNode* AddItem(ndSharedPtr item); - - ndArray m_view; - ndUnsigned8 m_listIsDirty; -}; - -template -ndSpecialList::ndSpecialList() - :ndList>() -{ -} - -template -ndSharedList::ndSharedList() - :ndList, ndContainersFreeListAlloc*>>() -{ -} - -inline ndBodyList::ndBodyList() - //:ndList, ndContainersFreeListAlloc*>>() - :ndSharedList() -{ -} - -inline ndBodyListView::ndBodyListView() - :ndList, ndContainersFreeListAlloc*>>() - ,m_view(1024) - ,m_listIsDirty(1) -{ -} - -inline ndArray& ndBodyListView::GetView() -{ - return m_view; -} - -inline const ndArray& ndBodyListView::GetView() const -{ - return m_view; -} - -inline ndBodyListView::ndNode* ndBodyListView::AddItem(ndSharedPtr item) -{ - m_listIsDirty = 1; - return Append(item); -} - -inline void ndBodyListView::RemoveItem(ndNode* const node) -{ - m_listIsDirty = 1; - Remove(node); -} - -inline bool ndBodyListView::IsListDirty() const -{ - return m_listIsDirty ? true : false; -} -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyNotify.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyNotify.cpp deleted file mode 100644 index 47f10ca942..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyNotify.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndBodyNotify.h" -#include "ndBodyKinematic.h" - - -ndBodyNotify::ndBodyNotify(const ndBodyNotify& src) - :ndContainersFreeListAlloc() - ,m_defaultGravity(src.m_defaultGravity) - ,m_body(src.m_body) -{ -} - -ndBodyNotify::ndBodyNotify(const ndVector& defaultGravity) - :ndContainersFreeListAlloc() - ,m_defaultGravity(defaultGravity) - ,m_body(nullptr) -{ -} - -ndBodyNotify::~ndBodyNotify() -{ -} - -ndBodyNotify* ndBodyNotify::Clone() const -{ - return new ndBodyNotify(*this); -} - -ndBody* ndBodyNotify::GetBody() -{ - return m_body; -} - -const ndBody* ndBodyNotify::GetBody() const -{ - return m_body; -} - -void* ndBodyNotify::GetUserData() const -{ - return nullptr; -} - -ndBodyNotify* ndBodyNotify::GetAsBodyNotify() -{ - return this; -} - -ndUrdfBodyNotify* ndBodyNotify::GetAsUrdfBodyNotify() -{ - return nullptr; -} - -ndVector ndBodyNotify::GetGravity() const -{ - return m_defaultGravity; -} - -void ndBodyNotify::SetGravity(const ndVector & defaultGravity) -{ - m_defaultGravity = defaultGravity; -} - -void ndBodyNotify::OnTransform(ndInt32, const ndMatrix&) -{ -} - -bool ndBodyNotify::OnSceneAabbOverlap(const ndBody* const) const -{ - return true; -} - -void ndBodyNotify::OnApplyExternalForce(ndInt32, ndFloat32) -{ - ndBodyKinematic* const body = GetBody()->GetAsBodyKinematic(); - ndAssert(body); - if (body->GetInvMass() > 0.0f) - { - ndVector massMatrix(body->GetMassMatrix()); - ndVector force (m_defaultGravity.Scale(massMatrix.m_w)); - body->SetForce(force); - body->SetTorque(ndVector::m_zero); - - //ndVector L(body->CalculateAngularMomentum()); - //dTrace(("%f %f %f\n", L.m_x, L.m_y, L.m_z)); - } -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyNotify.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyNotify.h deleted file mode 100644 index a1227f2cc9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyNotify.h +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODY_NOTIFY_H__ -#define __ND_BODY_NOTIFY_H__ - -#include "ndCollisionStdafx.h" - -class ndBody; -class ndUrdfBodyNotify; - -D_MSV_NEWTON_ALIGN_32 -class ndBodyNotify : public ndContainersFreeListAlloc -{ - public: - D_BASE_CLASS_REFLECTION(ndBodyNotify) - - D_COLLISION_API ndBodyNotify(const ndBodyNotify& src); - D_COLLISION_API ndBodyNotify(const ndVector& defaultGravity); - D_COLLISION_API virtual ~ndBodyNotify(); - D_COLLISION_API virtual ndBodyNotify* Clone() const; - - D_COLLISION_API ndBody* GetBody(); - D_COLLISION_API const ndBody* GetBody() const; - D_COLLISION_API virtual void* GetUserData() const; - - D_COLLISION_API virtual ndBodyNotify* GetAsBodyNotify(); - D_COLLISION_API virtual ndUrdfBodyNotify* GetAsUrdfBodyNotify(); - - D_COLLISION_API ndVector GetGravity() const; - D_COLLISION_API void SetGravity(const ndVector& defaultGravity); - - D_COLLISION_API virtual bool OnSceneAabbOverlap(const ndBody* const otherBody) const; - D_COLLISION_API virtual void OnTransform(ndInt32 threadIndex, const ndMatrix& matrix); - D_COLLISION_API virtual void OnApplyExternalForce(ndInt32 threadIndex, ndFloat32 timestep); - - private: - ndVector m_defaultGravity; - ndBody* m_body; - friend class ndBody; -} D_GCC_NEWTON_ALIGN_32; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyParticleSet.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyParticleSet.cpp deleted file mode 100644 index f0654ce61e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyParticleSet.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndBodyParticleSet.h" - -ndBodyParticleSet::ndBodyParticleSet() - :ndBody() - ,ndBackgroundTask() - ,m_box0(ndFloat32(-1e10f)) - ,m_box1(ndFloat32(1e10f)) - ,m_gravity(ndVector::m_zero) - ,m_posit(1024) - ,m_veloc(1024) - ,m_listNode(nullptr) - ,m_radius(ndFloat32 (0.125f)) - ,m_timestep(ndFloat32(0.0f)) - ,m_updateInBackground(true) -{ -} - -ndBodyParticleSet::~ndBodyParticleSet() -{ -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyParticleSet.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyParticleSet.h deleted file mode 100644 index 0f99843e4e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyParticleSet.h +++ /dev/null @@ -1,126 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODY_PARTICLE_SET_H__ -#define __ND_BODY_PARTICLE_SET_H__ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndBody.h" - -//#define D_USE_NEW_FLUID - -D_MSV_NEWTON_ALIGN_32 -class ndBodyParticleSet: public ndBody, public ndBackgroundTask -{ - public: - D_COLLISION_API ndBodyParticleSet(); - D_COLLISION_API virtual ~ndBodyParticleSet (); - - const ndVector GetGravity() const; - void SetGravity(const ndVector& gravity); - - ndArray& GetVelocity(); - ndArray& GetPositions(); - const ndArray& GetVelocity() const; - const ndArray& GetPositions() const; - virtual ndBodyParticleSet* GetAsBodyParticleSet(); - - bool GetAsynUpdate() const; - void SetAsynUpdate(bool update); - ndFloat32 GetParticleRadius() const; - virtual void SetParticleRadius(ndFloat32 radius); - - D_COLLISION_API virtual void Update(const ndScene* const scene, ndFloat32 timestep) = 0; - - protected: - ndVector m_box0; - ndVector m_box1; - ndVector m_gravity; - ndArray m_posit; - ndArray m_veloc; - ndBodyList::ndNode* m_listNode; - ndFloat32 m_radius; - ndFloat32 m_timestep; - bool m_updateInBackground; - friend class ndWorld; - friend class ndScene; -} D_GCC_NEWTON_ALIGN_32 ; - -inline ndBodyParticleSet* ndBodyParticleSet::GetAsBodyParticleSet() -{ - return this; -} - -inline ndFloat32 ndBodyParticleSet::GetParticleRadius() const -{ - return m_radius; -} - -inline void ndBodyParticleSet::SetParticleRadius(ndFloat32 raidus) -{ - m_radius = raidus; -} - -inline ndArray& ndBodyParticleSet::GetPositions() -{ - return m_posit; -} - -inline const ndArray& ndBodyParticleSet::GetPositions() const -{ - return m_posit; -} - -inline ndArray& ndBodyParticleSet::GetVelocity() -{ - return m_veloc; -} - -inline const ndArray& ndBodyParticleSet::GetVelocity() const -{ - return m_veloc; -} - -inline const ndVector ndBodyParticleSet::GetGravity() const -{ - return m_gravity; -} - -inline void ndBodyParticleSet::SetGravity(const ndVector& gravity) -{ - m_gravity = gravity & ndVector::m_triplexMask; -} - -inline bool ndBodyParticleSet::GetAsynUpdate() const -{ - return m_updateInBackground; -} - -inline void ndBodyParticleSet::SetAsynUpdate(bool updatType) -{ - m_updateInBackground = updatType; -} - - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyPlayerCapsule.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyPlayerCapsule.cpp deleted file mode 100644 index c06beb34f1..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyPlayerCapsule.cpp +++ /dev/null @@ -1,773 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndBody.h" -#include "ndScene.h" -#include "ndContact.h" -#include "ndShapeCapsule.h" -#include "ndContactSolver.h" -#include "ndBodyPlayerCapsule.h" - -#define D_DESCRETE_MOTION_STEPS 4 -#define D_PLAYER_MAX_CONTACTS 8 -#define D_PLAYER_MAX_ROWS (3 * D_PLAYER_MAX_CONTACTS) - -#define D_MAX_COLLIONSION_STEPS 8 -#define D_SLOP_JUMP_ANGLE ndFloat32(0.8f) -#define D_MAX_COLLISION_PENETRATION ndFloat32 (5.0e-3f) - -D_MSV_NEWTON_ALIGN_32 -class ndBodyPlayerCapsuleContactSolver -{ - public: - ndBodyPlayerCapsuleContactSolver(ndBodyPlayerCapsule* const player); - void CalculateContacts(); - - ndContactPoint m_contactBuffer[D_PLAYER_MAX_ROWS]; - ndBodyPlayerCapsule* m_player; - ndInt32 m_contactCount; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndBodyPlayerCapsuleImpulseSolver -{ - public: - ndBodyPlayerCapsuleImpulseSolver(ndBodyPlayerCapsule* const controller); - - ndVector CalculateImpulse(); - void Reset(ndBodyPlayerCapsule* const controller); - - void AddAngularRows(); - ndInt32 AddLinearRow(const ndVector& dir, const ndVector& r, ndFloat32 speed, ndFloat32 low, ndFloat32 high, ndInt32 normalIndex = -1); - ndInt32 AddContactRow(const ndContactPoint* const contact, const ndVector& dir, const ndVector& r, ndFloat32 speed, ndFloat32 low, ndFloat32 high, ndInt32 normalIndex = -1); - void ApplyReaction(ndFloat32 timestep); - - ndMatrix m_invInertia; - ndVector m_veloc; - ndJacobianPair m_jacobianPairs[D_PLAYER_MAX_ROWS]; - ndContactPoint* m_contactPoint[D_PLAYER_MAX_ROWS]; - ndFloat32 m_rhs[D_PLAYER_MAX_ROWS]; - ndFloat32 m_low[D_PLAYER_MAX_ROWS]; - ndFloat32 m_high[D_PLAYER_MAX_ROWS]; - ndInt32 m_normalIndex[D_PLAYER_MAX_ROWS]; - ndFloat32 m_impulseMag[D_PLAYER_MAX_ROWS]; - ndFloat32 m_mass; - ndFloat32 m_invMass; - ndInt32 m_rowCount; -} D_GCC_NEWTON_ALIGN_32; - - -ndBodyPlayerCapsule::ndBodyPlayerCapsule() - :ndBodyKinematicBase() -{ -} - -ndBodyPlayerCapsule::ndBodyPlayerCapsule(const ndMatrix& localAxis, ndFloat32 mass, ndFloat32 radius, ndFloat32 height, ndFloat32 stepHeight) - :ndBodyKinematicBase() -{ - Init(localAxis, mass, radius, height, stepHeight); -} - -ndBodyPlayerCapsule::~ndBodyPlayerCapsule() -{ -} - -void ndBodyPlayerCapsule::Init(const ndMatrix& localAxis, ndFloat32 mass, ndFloat32 radius, ndFloat32 height, ndFloat32 stepHeight) -{ - //m_contactTestOnly = 1; - m_impulse = ndVector::m_zero; - m_headingAngle = ndFloat32(0.0f); - m_forwardSpeed = ndFloat32(0.0f); - m_lateralSpeed = ndFloat32(0.0f); - m_stepHeight = ndFloat32(0.0f); - m_contactPatch = ndFloat32(0.0f); - m_height = height; - m_radius = radius; - m_weistScale = ndFloat32(3.0f); - m_crouchScale = ndFloat32(0.5f); - m_isAirbone = false; - m_isOnFloor = false; - m_isCrouched = false; - - ndMatrix shapeMatrix(localAxis); - shapeMatrix.m_posit = shapeMatrix.m_front.Scale(height * 0.5f); - shapeMatrix.m_posit.m_w = 1.0f; - - height = ndMax(height - 2.0f * radius / m_weistScale, ndFloat32(0.1f)); - ndShapeInstance instance(new ndShapeCapsule(radius / m_weistScale, radius / m_weistScale, height)); - instance.SetLocalMatrix(shapeMatrix); - instance.SetScale(ndVector(ndFloat32(1.0f), m_weistScale, m_weistScale, ndFloat32(0.0f))); - ndBodyKinematic::SetCollisionShape(instance); - - SetMassMatrix(mass, instance); - m_invMass = GetInvMass(); - m_mass = ndBodyKinematic::m_mass.m_w; - - m_localFrame = shapeMatrix; - m_localFrame.m_posit = ndVector::m_wOne; - m_contactPatch = radius / m_weistScale; - m_stepHeight = ndMax(stepHeight, m_contactPatch * ndFloat32(2.0f)); -} - -void ndBodyPlayerCapsule::ResolveStep(ndBodyPlayerCapsuleContactSolver& contactSolver, ndFloat32 timestep) -{ - ndMatrix matrix(m_matrix); - ndVector savedVeloc(m_veloc); - - ndMatrix startMatrix(matrix); - ndBodyPlayerCapsuleImpulseSolver impulseSolver(this); - - bool hasStartMatrix = false; - const ndFloat32 invTimeStep = ndFloat32 (1.0f) / timestep; - for (ndInt32 j = 0; !hasStartMatrix && (j < 4); ++j) - { - hasStartMatrix = true; - contactSolver.CalculateContacts(); - ndInt32 count = contactSolver.m_contactCount; - for (ndInt32 i = count - 1; i >= 0; i--) - { - const ndVector& point = contactSolver.m_contactBuffer[i].m_point; - const ndVector localPointpoint(m_localFrame.UntransformVector(startMatrix.UntransformVector(point))); - if (localPointpoint.m_x < m_stepHeight) - { - count--; - contactSolver.m_contactBuffer[i] = contactSolver.m_contactBuffer[count]; - } - } - - if (count) - { - hasStartMatrix = false; - - SetVelocity(ndVector::m_zero); - impulseSolver.Reset(this); - - ndVector com(startMatrix.TransformVector(GetCentreOfMass())); - for (ndInt32 i = 0; i < count; ++i) - { - ndVector point(contactSolver.m_contactBuffer[i].m_point); - ndVector normal(contactSolver.m_contactBuffer[i].m_normal); - ndFloat32 speed = ndMin((contactSolver.m_contactBuffer[i].m_penetration + D_MAX_COLLISION_PENETRATION), ndFloat32(0.25f)) * invTimeStep; - impulseSolver.AddLinearRow(normal, point - com, speed, 0.0f, 1.0e12f); - } - - impulseSolver.AddAngularRows(); - ndVector veloc(impulseSolver.CalculateImpulse().Scale(m_invMass)); - SetVelocity(veloc); - ndBodyKinematic::IntegrateVelocity(timestep); - startMatrix = GetMatrix(); - } - } - - if (hasStartMatrix) - { - // clip player velocity along the high contacts - ndMatrix coodinateMatrix(m_localFrame * startMatrix); - ndFloat32 scaleSpeedFactor = 1.5f; - ndFloat32 forwardSpeed = m_forwardSpeed * scaleSpeedFactor; - ndFloat32 lateralSpeed = m_lateralSpeed * scaleSpeedFactor; - ndFloat32 maxSpeed = ndMax(ndAbs(forwardSpeed), ndAbs(lateralSpeed)); - ndFloat32 stepFriction = 1.0f + m_mass * maxSpeed; - - SetVelocity(savedVeloc); - impulseSolver.Reset(this); - ndInt32 index = impulseSolver.AddLinearRow(coodinateMatrix[0], ndVector::m_zero, ndFloat32 (0.0f), ndFloat32(0.0f), ndFloat32(1.0e12f)); - impulseSolver.AddLinearRow(coodinateMatrix[1], ndVector::m_zero, -forwardSpeed, -stepFriction, stepFriction, index); - impulseSolver.AddLinearRow(coodinateMatrix[2], ndVector::m_zero, lateralSpeed, -stepFriction, stepFriction, index); - ndVector veloc(savedVeloc + impulseSolver.CalculateImpulse().Scale(m_invMass)); - - bool advanceIsBlocked = true; - for (ndInt32 j = 0; advanceIsBlocked && (j < 4); ++j) - { - advanceIsBlocked = false; - SetVelocity(veloc); - ndBodyKinematic::IntegrateVelocity(timestep); - contactSolver.CalculateContacts(); - if (contactSolver.m_contactCount) - { - ndMatrix stepMatrix (GetMatrix()); - ndInt32 count = contactSolver.m_contactCount; - - // filter by position - for (ndInt32 i = count - 1; i >= 0; i--) - { - const ndVector& point = contactSolver.m_contactBuffer[i].m_point; - ndVector localPointpoint(m_localFrame.UntransformVector(stepMatrix.UntransformVector(point))); - if (localPointpoint.m_x < m_stepHeight) - { - count--; - contactSolver.m_contactBuffer[i] = contactSolver.m_contactBuffer[count]; - } - } - - if (count) - { - ndVector com(stepMatrix.TransformVector(GetCentreOfMass())); - advanceIsBlocked = true; - - impulseSolver.Reset(this); - for (ndInt32 i = 0; i < count; ++i) - { - ndVector point(contactSolver.m_contactBuffer[i].m_point); - ndVector normal(contactSolver.m_contactBuffer[i].m_normal); - impulseSolver.AddLinearRow(normal, point - com, 0.0f, 0.0f, 1.0e12f); - } - - impulseSolver.AddAngularRows(); - veloc += impulseSolver.CalculateImpulse().Scale(m_invMass); - SetMatrix(startMatrix); - } - } - } - - SetVelocity(veloc); - SetMatrix(startMatrix); - ndBodyKinematic::IntegrateVelocity(timestep); - contactSolver.CalculateContacts(); - if (contactSolver.m_contactCount) - { - ndMatrix stepMatrix(GetMatrix()); - - ndFloat32 maxHigh = 0.0f; - for (ndInt32 i = 0; i < contactSolver.m_contactCount; ++i) - { - ndVector point (contactSolver.m_contactBuffer[i].m_point); - point = m_localFrame.UntransformVector(stepMatrix.UntransformVector(point)); - if ((point.m_x < m_stepHeight) && (point.m_x > m_contactPatch)) - { - ndVector normal(contactSolver.m_contactBuffer[i].m_normal); - ndFloat32 relSpeed = normal.DotProduct(veloc).GetScalar(); - if (relSpeed < ndFloat32(-1.0e-2f)) - { - maxHigh = ndMax(point.m_x, maxHigh); - } - } - } - - if (maxHigh > 0.0f) - { - ndVector step(stepMatrix.RotateVector(m_localFrame.RotateVector(ndVector(maxHigh, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f))))); - matrix.m_posit += step; - } - } - } - - SetVelocity(savedVeloc); - SetMatrix(matrix); -} - -void ndBodyPlayerCapsule::UpdatePlayerStatus(ndBodyPlayerCapsuleContactSolver& contactSolver) -{ - m_isAirbone = true; - m_isOnFloor = false; - contactSolver.CalculateContacts(); - ndMatrix matrix(m_localFrame * GetMatrix()); - for (ndInt32 i = 0; i < contactSolver.m_contactCount; ++i) - { - m_isAirbone = false; - const ndContactPoint* const contact = &contactSolver.m_contactBuffer[i]; - ndVector point(contact->m_point); - ndVector localPoint(matrix.UntransformVector(point)); - if (localPoint.m_x < m_contactPatch) - { - ndVector normal(contact->m_normal); - ndVector localNormal(matrix.UnrotateVector(normal)); - //if (localNormal.m_x > ndFloat32 (0.95f)) - if (localNormal.m_x > D_SLOP_JUMP_ANGLE) - { - m_isOnFloor = true; - } - } - } - - if (m_isAirbone || !m_isOnFloor) - { - m_equilibriumOverride = 1; - } -} - -ndBodyPlayerCapsule::dCollisionState ndBodyPlayerCapsule::TestPredictCollision(const ndBodyPlayerCapsuleContactSolver& contactSolver, const ndVector& veloc) const -{ - for (ndInt32 i = 0; i < contactSolver.m_contactCount; ++i) - { - const ndContactPoint* const contact = &contactSolver.m_contactBuffer[i]; - if (contact->m_penetration >= D_MAX_COLLISION_PENETRATION) - { - return m_deepPenetration; - } - } - - for (ndInt32 i = 0; i < contactSolver.m_contactCount; ++i) - { - const ndContactPoint* const contact = &contactSolver.m_contactBuffer[i]; - ndFloat32 projecSpeed = veloc.DotProduct(contact->m_normal).GetScalar(); - if (projecSpeed < ndFloat32(0.0f)) - { - return m_colliding; - } - } - return m_freeMovement; -} - -ndFloat32 ndBodyPlayerCapsule::PredictTimestep(ndBodyPlayerCapsuleContactSolver& contactSolver, ndFloat32 timestep) -{ - ndMatrix matrix(m_matrix); - ndVector veloc(GetVelocity()); - ndBodyKinematic::IntegrateVelocity(timestep); - dCollisionState playerCollide = TestPredictCollision(contactSolver, veloc); - SetMatrix(matrix); - - if (playerCollide == m_deepPenetration) - { - ndFloat32 savedTimeStep = timestep; - timestep *= 0.5f; - ndFloat32 dt = timestep; - for (ndInt32 i = 0; i < D_MAX_COLLIONSION_STEPS; ++i) - { - ndBodyKinematic::IntegrateVelocity(timestep); - contactSolver.CalculateContacts(); - SetMatrix(matrix); - - dt *= 0.5f; - playerCollide = TestPredictCollision(contactSolver, veloc); - if (playerCollide == m_colliding) - { - return timestep; - } - if (playerCollide == m_deepPenetration) - { - timestep -= dt; - } - else - { - timestep += dt; - } - } - if (timestep > dt * 2.0f) - { - return timestep; - } - - dt = savedTimeStep / D_MAX_COLLIONSION_STEPS; - timestep = dt; - for (ndInt32 i = 1; i < D_MAX_COLLIONSION_STEPS; ++i) - { - ndBodyKinematic::IntegrateVelocity(timestep); - contactSolver.CalculateContacts(); - SetMatrix(matrix); - playerCollide = TestPredictCollision(contactSolver, veloc); - if (playerCollide != m_freeMovement) - { - return timestep; - } - timestep += dt; - } - } - - return timestep; -} - -void ndBodyPlayerCapsule::ResolveInterpenetrations(ndBodyPlayerCapsuleContactSolver& contactSolver, ndBodyPlayerCapsuleImpulseSolver& impulseSolver) -{ - ndVector savedVeloc(GetVelocity()); - - ndFloat32 timestep = ndFloat32 (0.1f); - ndFloat32 invTimestep = ndFloat32(1.0f) / timestep; - - ndFloat32 penetration = D_MAX_COLLISION_PENETRATION * 10.0f; - for (ndInt32 j = 0; (j < 8) && (penetration > D_MAX_COLLISION_PENETRATION); ++j) - { - SetVelocity(ndVector::m_zero); - ndMatrix matrix(GetMatrix()); - ndVector com(matrix.TransformVector(GetCentreOfMass())); - - impulseSolver.Reset(this); - for (ndInt32 i = 0; i < contactSolver.m_contactCount; ++i) - { - ndContactPoint* const contact = &contactSolver.m_contactBuffer[i]; - ndVector point(contact->m_point); - ndVector normal(contact->m_normal); - ndInt32 index = impulseSolver.AddContactRow(contact, normal, point - com, 0.0f, 0.0f, 1.0e12f); - - ndFloat32 impulse = invTimestep * ndClamp(contact->m_penetration - D_MAX_COLLISION_PENETRATION * 0.5f, ndFloat32(0.0f), ndFloat32(0.5f)); - impulseSolver.m_rhs[index] = impulse; - } - - impulseSolver.AddAngularRows(); - - ndVector veloc(impulseSolver.CalculateImpulse().Scale(m_invMass)); - SetVelocity(veloc); - ndBodyKinematic::IntegrateVelocity(timestep); - - penetration = 0.0f; - contactSolver.CalculateContacts(); - for (ndInt32 i = 0; i < contactSolver.m_contactCount; ++i) - { - penetration = ndMax(contactSolver.m_contactBuffer[i].m_penetration, penetration); - } - } - - SetVelocity(savedVeloc); -} - -void ndBodyPlayerCapsule::ResolveCollision(ndBodyPlayerCapsuleContactSolver& contactSolver, ndFloat32 timestep) -{ - contactSolver.CalculateContacts(); - if (!contactSolver.m_contactCount) - { - return; - } - - ndFloat32 maxPenetration = 0.0f; - for (ndInt32 i = 0; i < contactSolver.m_contactCount; ++i) - { - maxPenetration = ndMax(contactSolver.m_contactBuffer[i].m_penetration, maxPenetration); - } - - ndMatrix matrix(GetMatrix()); - ndBodyPlayerCapsuleImpulseSolver impulseSolver(this); - if (maxPenetration > D_MAX_COLLISION_PENETRATION) - { - ResolveInterpenetrations(contactSolver, impulseSolver); - matrix = GetMatrix(); - } - - ndVector veloc (GetVelocity()); - const ndMatrix frameMatrix(m_localFrame * matrix); - ndVector com(matrix.TransformVector(GetCentreOfMass())); - - impulseSolver.Reset(this); - ndVector surfaceVeloc(0.0f); - const ndFloat32 contactPatchHigh = m_contactPatch * ndFloat32(0.995f); - - for (ndInt32 i = 0; i < contactSolver.m_contactCount; ++i) - { - ndContactPoint* const contact = &contactSolver.m_contactBuffer[i]; - ndVector point(contact->m_point); - ndVector normal(contact->m_normal); - const ndInt32 normalIndex = impulseSolver.AddContactRow(contact, normal, point - com, ndFloat32 (0.0f), ndFloat32(0.0f), ndFloat32(1.0e12f)); - ndVector localPoint(frameMatrix.UntransformVector(point)); - - if (localPoint.m_x < contactPatchHigh) - { - ndFloat32 friction = ContactFrictionCallback(point, normal, 0, contact->m_body1); - if (friction > 0.0f) - { - // add lateral traction friction - ndVector sideDir(frameMatrix.m_up.CrossProduct(normal).Normalize()); - impulseSolver.AddContactRow(contact, sideDir, point - com, -m_lateralSpeed, -friction, friction, normalIndex); - - // add longitudinal traction friction - ndVector frontDir(normal.CrossProduct(sideDir)); - impulseSolver.AddContactRow(contact, frontDir, point - com, -m_forwardSpeed, -friction, friction, normalIndex); - } - } - } - - impulseSolver.AddAngularRows(); - - veloc += impulseSolver.CalculateImpulse().Scale(m_invMass); - impulseSolver.ApplyReaction(timestep); - - SetVelocity(veloc); -} - -ndBodyPlayerCapsuleImpulseSolver::ndBodyPlayerCapsuleImpulseSolver(ndBodyPlayerCapsule* const controller) -{ - m_mass = controller->GetMassMatrix().m_w; - m_invMass = controller->GetInvMass(); - m_invInertia = controller->GetInvInertiaMatrix(); - Reset(controller); -} - -void ndBodyPlayerCapsuleImpulseSolver::Reset(ndBodyPlayerCapsule* const controller) -{ - m_rowCount = 0; - m_veloc = controller->GetVelocity(); -} - -ndBodyPlayerCapsuleContactSolver::ndBodyPlayerCapsuleContactSolver(ndBodyPlayerCapsule* const player) - :m_player(player) - ,m_contactCount(0) -{ -} - -void ndBodyPlayerCapsuleContactSolver::CalculateContacts() -{ - m_contactCount = 0; - ndScene* const scene = m_player->GetScene(); - ndContactNotify* const contactNotify = m_player->GetScene()->GetContactNotify(); - ndBodyKinematic::ndContactMap::Iterator it(m_player->GetContactMap()); - for (it.Begin(); it; it++) - { - const ndContact* const srcContact = *it; - if (srcContact->IsActive()) - { - ndBodyKinematic* body0 = srcContact->GetBody0(); - ndBodyKinematic* body1 = srcContact->GetBody1(); - if (body1 == m_player) - { - ndSwap(body0, body1); - } - ndContact contact; - contact.SetBodies(body0, body1); - contact.m_material = contactNotify->GetMaterial(&contact, body0->GetCollisionShape(), body1->GetCollisionShape()); - - ndContactPoint contactBuffer[D_MAX_CONTATCS]; - ndContactSolver contactSolver(&contact, scene->GetContactNotify(), ndFloat32(1.0f), 0); - contactSolver.m_instance0.SetGlobalMatrix(contactSolver.m_instance0.GetLocalMatrix() * body0->GetMatrix()); - contactSolver.m_instance1.SetGlobalMatrix(contactSolver.m_instance1.GetLocalMatrix() * body1->GetMatrix()); - contactSolver.m_separatingVector = srcContact->m_separatingVector; - //contactSolver.m_timestep = ndFloat32 (1.0f); - //contactSolver.m_ccdMode = 0; - contactSolver.m_intersectionTestOnly = 0; - contactSolver.m_contactBuffer = contactBuffer; - const ndInt32 count = contactSolver.CalculateContactsDiscrete (); - for (ndInt32 i = 0; i < count; ++i) - { - m_contactBuffer[m_contactCount] = contactBuffer[i]; - m_contactCount++; - ndAssert(m_contactCount < ndInt32 (sizeof(m_contactBuffer) / sizeof(m_contactBuffer[0]))); - } - } - } -} - -ndInt32 ndBodyPlayerCapsuleImpulseSolver::AddLinearRow(const ndVector& dir, const ndVector& r, ndFloat32 speed, ndFloat32 low, ndFloat32 high, ndInt32 normalIndex) -{ - m_contactPoint[m_rowCount] = nullptr; - m_jacobianPairs[m_rowCount].m_jacobianM0.m_linear = dir; - m_jacobianPairs[m_rowCount].m_jacobianM0.m_angular = r.CrossProduct(dir); - m_jacobianPairs[m_rowCount].m_jacobianM1.m_linear = ndVector::m_zero; - m_jacobianPairs[m_rowCount].m_jacobianM1.m_angular = ndVector::m_zero; - - m_low[m_rowCount] = low; - m_high[m_rowCount] = high; - m_normalIndex[m_rowCount] = (normalIndex == -1) ? 0 : normalIndex - m_rowCount; - m_rhs[m_rowCount] = speed - m_veloc.DotProduct(m_jacobianPairs[m_rowCount].m_jacobianM0.m_linear).GetScalar(); - m_rowCount++; - ndAssert(m_rowCount < D_PLAYER_MAX_ROWS); - return m_rowCount - 1; -} - -ndVector ndBodyPlayerCapsuleImpulseSolver::CalculateImpulse() -{ - ndFloat32 massMatrix[D_PLAYER_MAX_ROWS][D_PLAYER_MAX_ROWS]; - const ndBodyKinematic* bodyArray[D_PLAYER_MAX_ROWS]; - for (ndInt32 i = 0; i < m_rowCount; ++i) - { - bodyArray[i] = m_contactPoint[i] ? m_contactPoint[i]->m_body0 : nullptr; - } - - for (ndInt32 i = 0; i < m_rowCount; ++i) - { - ndJacobianPair jInvMass(m_jacobianPairs[i]); - - jInvMass.m_jacobianM0.m_linear = jInvMass.m_jacobianM0.m_linear.Scale(m_invMass); - jInvMass.m_jacobianM0.m_angular = m_invInertia.RotateVector(jInvMass.m_jacobianM0.m_angular); - if (bodyArray[i]) - { - ndFloat32 invMass = bodyArray[i]->GetInvMass(); - ndMatrix invInertia(bodyArray[i]->GetInvInertiaMatrix()); - jInvMass.m_jacobianM1.m_linear = jInvMass.m_jacobianM1.m_linear.Scale(invMass); - jInvMass.m_jacobianM1.m_angular = invInertia.RotateVector(jInvMass.m_jacobianM1.m_angular); - } - else - { - jInvMass.m_jacobianM1.m_linear = ndVector::m_zero; - jInvMass.m_jacobianM1.m_angular = ndVector::m_zero; - } - - ndVector tmp( - jInvMass.m_jacobianM0.m_linear * m_jacobianPairs[i].m_jacobianM0.m_linear + - jInvMass.m_jacobianM0.m_angular * m_jacobianPairs[i].m_jacobianM0.m_angular + - jInvMass.m_jacobianM1.m_linear * m_jacobianPairs[i].m_jacobianM1.m_linear + - jInvMass.m_jacobianM1.m_angular * m_jacobianPairs[i].m_jacobianM1.m_angular); - ndFloat32 a00 = (tmp.m_x + tmp.m_y + tmp.m_z) * ndFloat32 (1.0004f); - - massMatrix[i][i] = a00; - - m_impulseMag[i] = 0.0f; - for (ndInt32 j = i + 1; j < m_rowCount; ++j) - { - ndVector tmp1( - jInvMass.m_jacobianM0.m_linear * m_jacobianPairs[j].m_jacobianM0.m_linear + - jInvMass.m_jacobianM0.m_angular * m_jacobianPairs[j].m_jacobianM0.m_angular); - if (bodyArray[i] == bodyArray[j]) - { - tmp1 += jInvMass.m_jacobianM1.m_linear * m_jacobianPairs[j].m_jacobianM1.m_linear; - tmp1 += jInvMass.m_jacobianM1.m_angular * m_jacobianPairs[j].m_jacobianM1.m_angular; - } - - ndFloat32 a01 = tmp1.m_x + tmp1.m_y + tmp1.m_z; - massMatrix[i][j] = a01; - massMatrix[j][i] = a01; - } - } - - ndAssert(ndTestPSDmatrix(m_rowCount, D_PLAYER_MAX_ROWS, &massMatrix[0][0])); - ndGaussSeidelLcpSor(m_rowCount, D_PLAYER_MAX_ROWS, &massMatrix[0][0], m_impulseMag, m_rhs, m_normalIndex, m_low, m_high, ndFloat32(1.0e-6f), 32, ndFloat32(1.1f)); - - ndVector netImpulse(0.0f); - for (ndInt32 i = 0; i < m_rowCount; ++i) - { - netImpulse += m_jacobianPairs[i].m_jacobianM0.m_linear.Scale(m_impulseMag[i]); - } - return netImpulse; -} - -ndInt32 ndBodyPlayerCapsuleImpulseSolver::AddContactRow(const ndContactPoint* const contact, const ndVector& dir, const ndVector& r, ndFloat32 speed, ndFloat32 low, ndFloat32 high, ndInt32 normalIndex) -{ - ndAssert(contact->m_body1); - if (contact->m_body1->GetInvMass() == ndFloat32 (0.0f)) - { - return AddLinearRow(dir, r, speed, low, high, normalIndex); - } - - ndVector omega(contact->m_body1->GetOmega()); - ndVector veloc(contact->m_body1->GetVelocity()); - ndMatrix matrix(contact->m_body1->GetMatrix()); - ndVector com(matrix.TransformVector(contact->m_body1->GetCentreOfMass())); - - ndVector p1(contact->m_point); - ndVector r1(p1 - com); - ndVector dir1(dir.Scale(-1.0f)); - - m_contactPoint[m_rowCount] = (ndContactPoint*)contact; - m_jacobianPairs[m_rowCount].m_jacobianM0.m_linear = dir; - m_jacobianPairs[m_rowCount].m_jacobianM0.m_angular = r.CrossProduct(dir); - m_jacobianPairs[m_rowCount].m_jacobianM1.m_linear = dir1; - m_jacobianPairs[m_rowCount].m_jacobianM1.m_angular = r1.CrossProduct(dir1); - - m_low[m_rowCount] = low; - m_high[m_rowCount] = high; - m_normalIndex[m_rowCount] = (normalIndex == -1) ? 0 : normalIndex - m_rowCount; - - ndVector reactionSpeed( - m_veloc * m_jacobianPairs[m_rowCount].m_jacobianM0.m_linear + - veloc * m_jacobianPairs[m_rowCount].m_jacobianM1.m_linear + - omega * m_jacobianPairs[m_rowCount].m_jacobianM1.m_angular); - m_rhs[m_rowCount] = speed - reactionSpeed.AddHorizontal().GetScalar(); - - m_rowCount++; - ndAssert(m_rowCount < D_PLAYER_MAX_ROWS); - return m_rowCount - 1; -} - -void ndBodyPlayerCapsuleImpulseSolver::AddAngularRows() -{ - for (ndInt32 i = 0; i < 3; ++i) - { - m_contactPoint[m_rowCount] = nullptr; - m_jacobianPairs[m_rowCount].m_jacobianM1.m_linear = ndVector::m_zero; - m_jacobianPairs[m_rowCount].m_jacobianM1.m_angular = ndVector::m_zero; - m_jacobianPairs[m_rowCount].m_jacobianM0.m_linear = ndVector::m_zero; - m_jacobianPairs[m_rowCount].m_jacobianM0.m_angular = ndVector::m_zero; - m_jacobianPairs[m_rowCount].m_jacobianM0.m_angular[i] = ndFloat32(1.0f); - m_rhs[m_rowCount] = ndFloat32(0.0f); - m_low[m_rowCount] = ndFloat32(-1.0e12f); - m_high[m_rowCount] = ndFloat32(1.0e12f); - m_impulseMag[m_rowCount] = ndFloat32(0.0f); - m_normalIndex[m_rowCount] = 0; - m_rowCount++; - ndAssert(m_rowCount < D_PLAYER_MAX_ROWS); - } -} - -void ndBodyPlayerCapsuleImpulseSolver::ApplyReaction(ndFloat32 timestep) -{ - ndFloat32 invTimeStep = 0.1f / timestep; - for (ndInt32 i = 0; i < m_rowCount; ++i) - { - if (m_contactPoint[i]) - { - ndBodyKinematic* const body0 = ((ndBodyKinematic*)m_contactPoint[i]->m_body0); - ndBodyKinematic* const body1 = ((ndBodyKinematic*)m_contactPoint[i]->m_body1); - ndVector force(m_jacobianPairs[i].m_jacobianM1.m_linear.Scale(m_impulseMag[i] * invTimeStep)); - ndVector torque(m_jacobianPairs[i].m_jacobianM1.m_angular.Scale(m_impulseMag[i] * invTimeStep)); - body1->SetForce(force + body1->GetForce()); - body1->SetTorque(torque + body1->GetTorque()); - body0->m_equilibriumOverride = 1; - } - } -} - -void ndBodyPlayerCapsule::SpecialUpdate(ndFloat32 timestep) -{ - ndBodyPlayerCapsuleContactSolver contactSolver(this); - ndFloat32 timeLeft = timestep; - const ndFloat32 timeEpsilon = timestep * (1.0f / 16.0f); - - m_equilibriumOverride = 0; - m_impulse = ndVector::m_zero; - ApplyInputs(timestep); - -#if 0 - #if 1 - static FILE* file = fopen("log.bin", "wb"); - if (file) { - fwrite(&m_headingAngle, sizeof(m_headingAngle), 1, file); - fwrite(&m_forwardSpeed, sizeof(m_forwardSpeed), 1, file); - fwrite(&m_lateralSpeed, sizeof(m_lateralSpeed), 1, file); - fflush(file); - } - #else - static FILE* file = fopen("log.bin", "rb"); - if (file) { - fread(&m_headingAngle, sizeof(m_headingAngle), 1, file); - fread(&m_forwardSpeed, sizeof(m_forwardSpeed), 1, file); - fread(&m_lateralSpeed, sizeof(m_lateralSpeed), 1, file); - } - #endif -#endif - m_equilibrium0 = 0; - - // set player orientation - ndMatrix matrix(ndYawMatrix(GetHeadingAngle())); - matrix.m_posit = m_matrix.m_posit; - SetMatrix(matrix); - - // set play desired velocity - ndVector veloc(GetVelocity() + m_impulse.Scale(m_invMass)); - SetVelocity(veloc); - - // determine if player has to step over obstacles lower than step hight - UpdateInvInertiaMatrix(); - ResolveStep(contactSolver, timestep); - - // advance player until it hit a collision point, until there is not more time left - for (ndInt32 i = 0; (i < D_DESCRETE_MOTION_STEPS) && (timeLeft > timeEpsilon); ++i) - { - if (timeLeft > timeEpsilon) - { - ResolveCollision(contactSolver, timestep); - } - - ndFloat32 predicetdTime = PredictTimestep(contactSolver, timeLeft); - ndBodyKinematic::IntegrateVelocity(predicetdTime); - timeLeft -= predicetdTime; - } - - UpdatePlayerStatus(contactSolver); -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyPlayerCapsule.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyPlayerCapsule.h deleted file mode 100644 index 28c218b7c9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyPlayerCapsule.h +++ /dev/null @@ -1,167 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODY_PLAYER_CAPSULE_H__ -#define __ND_BODY_PLAYER_CAPSULE_H__ - -#include "ndCollisionStdafx.h" -#include "ndBodyKinematicBase.h" - -class ndBodyPlayerCapsuleContactSolver; -class ndBodyPlayerCapsuleImpulseSolver; - -D_MSV_NEWTON_ALIGN_32 -class ndBodyPlayerCapsule : public ndBodyKinematicBase -{ - public: - D_CLASS_REFLECTION(ndBodyPlayerCapsule, ndBodyKinematicBase) - - D_COLLISION_API ndBodyPlayerCapsule(); - D_COLLISION_API ndBodyPlayerCapsule(const ndMatrix& localAxis, ndFloat32 mass, ndFloat32 radius, ndFloat32 height, ndFloat32 stepHeight); - D_COLLISION_API virtual ~ndBodyPlayerCapsule(); - - ndBodyPlayerCapsule* GetAsBodyPlayerCapsule(); - - ndFloat32 GetForwardSpeed() const; - void SetForwardSpeed(ndFloat32 speed); - - ndFloat32 GetLateralSpeed() const; - void SetLateralSpeed(ndFloat32 speed); - - ndFloat32 GetHeadingAngle() const; - void SetHeadingAngle(ndFloat32 angle); - - bool IsOnFloor() const; - - virtual void ApplyInputs(ndFloat32 timestep); - virtual ndFloat32 ContactFrictionCallback(const ndVector& position, const ndVector& normal, ndInt32 contactId, const ndBodyKinematic* const otherbody) const; - - private: - enum dCollisionState - { - m_colliding, - m_freeMovement, - m_deepPenetration, - }; - - virtual void IntegrateExternalForce(ndFloat32 timestep); - virtual void SetCollisionShape(const ndShapeInstance& shapeInstance); - void UpdatePlayerStatus(ndBodyPlayerCapsuleContactSolver& contactSolver); - void ResolveStep(ndBodyPlayerCapsuleContactSolver& contactSolver, ndFloat32 timestep); - void ResolveCollision(ndBodyPlayerCapsuleContactSolver& contactSolver, ndFloat32 timestep); - ndFloat32 PredictTimestep(ndBodyPlayerCapsuleContactSolver& contactSolver, ndFloat32 timestep); - dCollisionState TestPredictCollision(const ndBodyPlayerCapsuleContactSolver& contactSolver, const ndVector& veloc) const; - void ResolveInterpenetrations(ndBodyPlayerCapsuleContactSolver& contactSolver, ndBodyPlayerCapsuleImpulseSolver& impulseSolver); - void IntegrateVelocity(ndFloat32 timestep); - - D_COLLISION_API virtual void SpecialUpdate(ndFloat32 timestep); - D_COLLISION_API void Init(const ndMatrix& localAxis, ndFloat32 mass, ndFloat32 radius, ndFloat32 height, ndFloat32 stepHeight); - - protected: - ndMatrix m_localFrame; - ndVector m_impulse; - ndFloat32 m_mass; - ndFloat32 m_invMass; - ndFloat32 m_headingAngle; - ndFloat32 m_forwardSpeed; - ndFloat32 m_lateralSpeed; - ndFloat32 m_stepHeight; - ndFloat32 m_contactPatch; - ndFloat32 m_height; - ndFloat32 m_radius; - ndFloat32 m_weistScale; - ndFloat32 m_crouchScale; - bool m_isAirbone; - bool m_isOnFloor; - bool m_isCrouched; -} D_GCC_NEWTON_ALIGN_32; - -inline ndBodyPlayerCapsule* ndBodyPlayerCapsule::GetAsBodyPlayerCapsule() -{ - return this; -} - -inline void ndBodyPlayerCapsule::SetCollisionShape(const ndShapeInstance&) -{ - // ignore the changing collision shape; -} - -inline void ndBodyPlayerCapsule::ApplyInputs(ndFloat32) -{ -} - -inline ndFloat32 ndBodyPlayerCapsule::ContactFrictionCallback(const ndVector&, const ndVector&, ndInt32, const ndBodyKinematic* const) const -{ - return ndFloat32 (2.0f); -} - -inline ndFloat32 ndBodyPlayerCapsule::GetForwardSpeed() const -{ - return -m_forwardSpeed; -} - -inline void ndBodyPlayerCapsule::SetForwardSpeed(ndFloat32 speed) -{ - m_forwardSpeed = -speed; -} - -inline ndFloat32 ndBodyPlayerCapsule::GetLateralSpeed() const -{ - return -m_lateralSpeed; -} - -inline void ndBodyPlayerCapsule::SetLateralSpeed(ndFloat32 speed) -{ - m_lateralSpeed = -speed; -} - -inline ndFloat32 ndBodyPlayerCapsule::GetHeadingAngle() const -{ - return m_headingAngle; -} - -inline void ndBodyPlayerCapsule::SetHeadingAngle(ndFloat32 angle) -{ - //m_headingAngle = dClamp(angle, ndFloat32(-dPi), ndFloat32(dPi)); - const ndFloat32 interpolation = ndFloat32(0.3f); - ndFloat32 deltaAngle = ndAnglesAdd(angle, -m_headingAngle) * interpolation; - ndFloat32 headingAngle = ndAnglesAdd(m_headingAngle, deltaAngle); - //dTrace(("%f %f %f\n", angle * dRadToDegree, m_headingAngle * dRadToDegree, headingAngle * dRadToDegree)); - m_headingAngle = headingAngle; -} - -inline void ndBodyPlayerCapsule::IntegrateVelocity(ndFloat32) -{ - m_accel = ndVector::m_zero; - m_alpha = ndVector::m_zero; -} - -inline bool ndBodyPlayerCapsule::IsOnFloor() const -{ - return m_isOnFloor; -} - -inline void ndBodyPlayerCapsule::IntegrateExternalForce(ndFloat32) -{ - // do nothing -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid.cpp deleted file mode 100644 index 6d174ecbf2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid.cpp +++ /dev/null @@ -1,2380 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndScene.h" -#include "ndBodySphFluid.h" - -#ifndef D_USE_NEW_FLUID - -//#define D_USE_YZ_PLANE_BUCKETS - - -#define D_SPH_HASH_BITS 8 -#define D_SPH_BUFFER_GRANULARITY 4096 - -#define D_PARTICLE_BUCKET_SIZE 32 -#define D_GRID_SIZE_SCALER (1.0f) - -#if 0 - -class ndBodySphFluid::ndGridHash -{ - public: - enum ndGridType - { - m_adjacentGrid = 0, - m_homeGrid = 1, - }; - - ndGridHash() - { - } - - ndGridHash(ndUnsigned64 gridHash) - :m_gridHash(gridHash) - { - } - -#ifdef D_USE_YZ_PLANE_BUCKETS - ndGridHash(ndInt32 y, ndInt32 z) - { - m_gridHash = 0; - m_y = ndUnsigned64(y); - m_z = ndUnsigned64(z); - } - - ndGridHash(const ndVector& grid, ndInt32 particleIndex) - { - ndAssert(grid.m_y >= ndFloat32(0.0f)); - ndAssert(grid.m_z >= ndFloat32(0.0f)); - ndAssert(grid.m_y < ndFloat32(1 << (D_SPH_HASH_BITS * 2))); - ndAssert(grid.m_z < ndFloat32(1 << (D_SPH_HASH_BITS * 2))); - - ndVector hash(grid.GetInt()); - - m_gridHash = 0; - m_y = ndUnsigned64(hash.m_iy); - m_z = ndUnsigned64(hash.m_iz); - - m_cellType = m_adjacentGrid; - m_particleIndex = ndUnsigned64(particleIndex); - } -#else - ndGridHash(ndInt32 x, ndInt32 z) - { - m_gridHash = 0; - m_x = ndUnsigned64(x); - m_z = ndUnsigned64(z); - } - - ndGridHash(const ndVector& grid, ndInt32 particleIndex) - { - ndAssert(grid.m_x >= ndFloat32(0.0f)); - ndAssert(grid.m_z >= ndFloat32(0.0f)); - ndAssert(grid.m_x < ndFloat32(1 << (D_SPH_HASH_BITS * 2))); - ndAssert(grid.m_z < ndFloat32(1 << (D_SPH_HASH_BITS * 2))); - - ndVector hash(grid.GetInt()); - - m_gridHash = 0; - m_x = ndUnsigned64(hash.m_ix); - m_z = ndUnsigned64(hash.m_iz); - - m_cellType = m_adjacentGrid; - m_particleIndex = ndUnsigned64(particleIndex); - } -#endif - - union - { - struct - { -#ifdef D_USE_YZ_PLANE_BUCKETS - ndUnsigned64 m_y : D_SPH_HASH_BITS * 2; - ndUnsigned64 m_z : D_SPH_HASH_BITS * 2; -#else - ndUnsigned64 m_x : D_SPH_HASH_BITS * 2; - ndUnsigned64 m_z : D_SPH_HASH_BITS * 2; -#endif - ndUnsigned64 m_particleIndex : 23; - ndUnsigned64 m_cellType : 1; - }; - struct - { -#ifdef D_USE_YZ_PLANE_BUCKETS - ndUnsigned64 m_yLow : D_SPH_HASH_BITS; - ndUnsigned64 m_yHigh : D_SPH_HASH_BITS; - ndUnsigned64 m_zLow : D_SPH_HASH_BITS; - ndUnsigned64 m_zHigh : D_SPH_HASH_BITS; -#else - ndUnsigned64 m_xLow : D_SPH_HASH_BITS; - ndUnsigned64 m_xHigh : D_SPH_HASH_BITS; - ndUnsigned64 m_zLow : D_SPH_HASH_BITS; - ndUnsigned64 m_zHigh : D_SPH_HASH_BITS; -#endif - }; - ndUnsigned64 m_gridHash : D_SPH_HASH_BITS * 2 * 2; - }; -}; - -class ndBodySphFluid::ndParticlePair -{ - public: - ndInt32 m_neighborg[D_PARTICLE_BUCKET_SIZE]; -}; - -class ndBodySphFluid::ndParticleKernelDistance -{ - public: - ndFloat32 m_dist[D_PARTICLE_BUCKET_SIZE]; -}; - -class ndBodySphFluid::ndWorkingBuffers -{ - #define D_SPH_GRID_X_RESOLUTION 4 - - public: - ndWorkingBuffers() - :m_accel(D_SPH_BUFFER_GRANULARITY) - ,m_locks(D_SPH_BUFFER_GRANULARITY) - ,m_pairCount(D_SPH_BUFFER_GRANULARITY) - ,m_gridScans(D_SPH_BUFFER_GRANULARITY) - ,m_density(D_SPH_BUFFER_GRANULARITY) - ,m_invDensity(D_SPH_BUFFER_GRANULARITY) - ,m_pairs(D_SPH_BUFFER_GRANULARITY) - ,m_hashGridMap(D_SPH_BUFFER_GRANULARITY) - ,m_hashGridMapScratchBuffer(D_SPH_BUFFER_GRANULARITY) - ,m_kernelDistance(D_SPH_BUFFER_GRANULARITY) - ,m_worlToGridOrigin(ndFloat32 (1.0f)) - ,m_worlToGridScale(ndFloat32(1.0f)) - ,m_hashGridSize(ndFloat32(0.0f)) - ,m_hashInvGridSize(ndFloat32(0.0f)) - { - for (ndInt32 i = 0; i < D_MAX_THREADS_COUNT; ++i) - { - m_partialsGridScans[i].Resize(D_SPH_BUFFER_GRANULARITY); - } - } - - ~ndWorkingBuffers() - { - } - - void SetWorldToGridMapping(ndFloat32 gridSize, const ndVector& maxP, const ndVector& minP) - { -#ifdef D_USE_YZ_PLANE_BUCKETS - m_worlToGridOrigin = minP.m_x; - ndFloat32 gridCount = ndFloor((maxP.m_x - minP.m_x) / gridSize + ndFloat32(1.0f)); - m_worlToGridScale = ndFloat32(1<< D_SPH_GRID_X_RESOLUTION) * gridCount / (maxP.m_x - minP.m_x); -#else - m_worlToGridOrigin = minP.m_y; - ndFloat32 gridCount = ndFloor((maxP.m_y - minP.m_y) / gridSize + ndFloat32(1.0f)); - m_worlToGridScale = ndFloat32(1 << D_SPH_GRID_X_RESOLUTION) * (ndFloat32)gridCount / (maxP.m_y - minP.m_y); -#endif - } - - ndInt32 WorldToGrid(const ndVector& point) const - { -#ifdef D_USE_YZ_PLANE_BUCKETS - ndInt32 val = ndInt32((point.m_x - m_worlToGridOrigin) * m_worlToGridScale); -#else - ndInt32 val = ndInt32((point.m_y - m_worlToGridOrigin) * m_worlToGridScale); -#endif - ndAssert(val >= 0); - return val; - } - - ndArray m_accel; - ndArray m_locks; - ndArray m_pairCount; - ndArray m_gridScans; - ndArray m_density; - ndArray m_invDensity; - ndArray m_pairs; - ndArray m_hashGridMap; - ndArray m_hashGridMapScratchBuffer; - ndArray m_kernelDistance; - ndArray m_partialsGridScans[D_MAX_THREADS_COUNT]; - ndFloat32 m_worlToGridOrigin; - ndFloat32 m_worlToGridScale; - ndFloat32 m_hashGridSize; - ndFloat32 m_hashInvGridSize; -}; - -ndBodySphFluid::ndBodySphFluid() - :ndBodyParticleSet() - ,m_workingBuffers(new ndWorkingBuffers) - ,m_mass(ndFloat32(1.0f)) - ,m_viscosity(ndFloat32 (1.05f)) - ,m_restDensity(ndFloat32(1000.0f)) - ,m_gasConstant(ndFloat32(1.0f)) -{ - SetRestDensity(m_restDensity); -} - -ndBodySphFluid::~ndBodySphFluid() -{ - delete m_workingBuffers; -} - -void ndBodySphFluid::SortBuckets(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - - class ndKey_low - { - public: - ndKey_low(void* const context) - :m_fluid((ndBodySphFluid*)context) - ,m_data(*m_fluid->m_workingBuffers) - ,m_point(m_fluid->GetPositions()) - { - } - - ndInt32 GetKey(const ndGridHash& cell) const - { - ndInt32 index = ndInt32(cell.m_particleIndex); - ndUnsigned32 key = ndUnsigned32(m_data.WorldToGrid(m_point[index])); - return ndInt32(key & 0xff); - } - - ndBodySphFluid* m_fluid; - ndWorkingBuffers& m_data; - const ndArray& m_point; - }; - - class ndKey_middle - { - public: - ndKey_middle(void* const context) - :m_fluid((ndBodySphFluid*)context) - ,m_data(*m_fluid->m_workingBuffers) - ,m_point(m_fluid->GetPositions()) - { - } - - ndInt32 GetKey(const ndGridHash& cell) const - { - ndInt32 index = ndInt32 (cell.m_particleIndex); - ndUnsigned32 key = ndUnsigned32(m_data.WorldToGrid(m_point[index])); - return ndInt32((key >> 8) & 0xff); - } - - ndBodySphFluid* m_fluid; - ndWorkingBuffers& m_data; - const ndArray& m_point; - }; - - class ndKey_high - { - public: - ndKey_high(void* const context) - :m_fluid((ndBodySphFluid*)context) - ,m_data(*m_fluid->m_workingBuffers) - ,m_point(m_fluid->GetPositions()) - { - } - - ndInt32 GetKey(const ndGridHash& cell) const - { - ndInt32 index = ndInt32(cell.m_particleIndex); - ndUnsigned32 key = ndUnsigned32(m_data.WorldToGrid(m_point[index])); - return ndInt32((key >> 16) & 0xff); - } - - ndBodySphFluid* m_fluid; - ndWorkingBuffers& m_data; - const ndArray& m_point; - }; - - ndWorkingBuffers& data = *m_workingBuffers; - const ndInt32 keySize = data.WorldToGrid(m_box1); - - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, this); - if (keySize >= 256) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, this); - } - if (keySize >= (256 * 256)) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, this); - } - -#ifdef _DEBUG - const ndArray& point = GetPositions(); - for (int i = 1; i < data.m_hashGridMap.GetCount(); ++i) - { - ndGridHash cell0(data.m_hashGridMap[i - 1]); - ndGridHash cell1(data.m_hashGridMap[i + 0]); - const ndVector p0(point[ndInt32(cell0.m_particleIndex)]); - const ndVector p1(point[ndInt32(cell1.m_particleIndex)]); - ndInt32 key0 = data.WorldToGrid(p0); - ndInt32 key1 = data.WorldToGrid(p1); - ndAssert(key0 <= key1); - } -#endif -} - -void ndBodySphFluid::SortCellBuckects(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); -#ifdef D_USE_YZ_PLANE_BUCKETS - class ndKey_ylow - { - public: - ndKey_ylow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_yLow); - } - }; - - class ndKey_yhigh - { - public: - ndKey_yhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_yHigh); - } - }; -#else - class ndKey_xlow - { - public: - ndKey_xlow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_xLow); - } - }; - - class ndKey_xhigh - { - public: - ndKey_xhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_xHigh); - } - }; - -#endif - - class ndKey_zlow - { - public: - ndKey_zlow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_zLow); - } - }; - - class ndKey_zhigh - { - public: - ndKey_zhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_zHigh); - } - }; - - ndWorkingBuffers& data = *m_workingBuffers; - //const ndVector boxSize((m_box1 - m_box0).Scale(ndFloat32(1.0f) / GetSphGridSize()).GetInt()); - const ndVector boxSize((m_box1 - m_box0).Scale(data.m_hashInvGridSize).GetInt()); - -#ifdef D_USE_YZ_PLANE_BUCKETS - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - if (boxSize.m_iy > (1 << D_SPH_HASH_BITS)) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - } -#else - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - if (boxSize.m_ix > (1 << D_SPH_HASH_BITS)) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - } -#endif - - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - if (boxSize.m_iz > (1 << D_SPH_HASH_BITS)) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - } - -#ifdef _DEBUG - for (int i = 1; i < data.m_hashGridMap.GetCount(); ++i) - { - ndGridHash cell0(data.m_hashGridMap[i - 1]); - ndGridHash cell1(data.m_hashGridMap[i + 0]); -#ifdef D_USE_YZ_PLANE_BUCKETS - ndUnsigned64 key0 = (cell0.m_z << (D_SPH_HASH_BITS * 2)) + cell0.m_y; - ndUnsigned64 key1 = (cell1.m_z << (D_SPH_HASH_BITS * 2)) + cell1.m_y; -#else - ndUnsigned64 key0 = (cell0.m_z << (D_SPH_HASH_BITS * 2)) + cell0.m_x; - ndUnsigned64 key1 = (cell1.m_z << (D_SPH_HASH_BITS * 2)) + cell1.m_x; -#endif - ndAssert(key0 <= key1); - } -#endif -} - -void ndBodySphFluid::CalculateScans(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - ndInt32 sums[D_MAX_THREADS_COUNT + 1]; - ndInt32 scans[D_MAX_THREADS_COUNT + 1]; - - auto CountGridScans = ndMakeObject::ndFunction([&data, &scans](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(CountGridScans); - const ndGridHash* const hashGridMap = &data.m_hashGridMap[0]; - - const ndInt32 start = scans[threadIndex]; - const ndInt32 end = scans[threadIndex + 1]; - ndArray& gridScans = data.m_partialsGridScans[threadIndex]; - ndUnsigned64 gridHash0 = hashGridMap[start].m_gridHash; - - ndInt32 count = 0; - gridScans.SetCount(0); - for (ndInt32 i = start; i < end; ++i) - { - ndUnsigned64 gridHash = hashGridMap[i].m_gridHash; - if (gridHash != gridHash0) - { - gridScans.PushBack(count); - count = 0; - gridHash0 = gridHash; - } - count++; - } - gridScans.PushBack(count); - }); - - auto CalculateScans = ndMakeObject::ndFunction([&data, &scans, &sums](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(CalculateScans); - ndArray& gridScans = data.m_gridScans; - const ndArray& partialScan = data.m_partialsGridScans[threadIndex]; - const ndInt32 base = sums[threadIndex]; - ndInt32 sum = scans[threadIndex]; - for (ndInt32 i = 0; i < partialScan.GetCount(); ++i) - { - gridScans[base + i] = sum; - sum += partialScan[i]; - } - }); - - memset(scans, 0, sizeof(scans)); - const ndInt32 threadCount = threadPool->GetThreadCount(); - - ndInt32 particleCount = data.m_hashGridMap.GetCount(); - - ndInt32 acc0 = 0; - ndInt32 stride = particleCount / threadCount; - const ndGridHash* const hashGridMap = &data.m_hashGridMap[0]; - for (ndInt32 threadIndex = 0; threadIndex < threadCount; threadIndex++) - { - scans[threadIndex] = acc0; - acc0 += stride; - while (acc0 < particleCount && (hashGridMap[acc0].m_gridHash == hashGridMap[acc0 - 1].m_gridHash)) - { - acc0++; - } - } - scans[threadCount] = particleCount; - threadPool->ParallelExecute(CountGridScans); - - ndInt32 scansCount = 0; - - for (ndInt32 i = 0; i < threadCount; ++i) - { - sums[i] = scansCount; - scansCount += data.m_partialsGridScans[i].GetCount(); - } - sums[threadCount] = scansCount; - - data.m_gridScans.SetCount(scansCount + 1); - threadPool->ParallelExecute(CalculateScans); - - data.m_gridScans[scansCount] = scans[threadCount]; -} - -void ndBodySphFluid::SortGrids(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - SortBuckets(threadPool); - SortCellBuckects(threadPool); - - #ifdef _DEBUG - ndWorkingBuffers& data = *m_workingBuffers; - for (ndInt32 i = 0; i < (data.m_hashGridMap.GetCount() - 1); ++i) - { - const ndGridHash& entry0 = data.m_hashGridMap[i + 0]; - const ndGridHash& entry1 = data.m_hashGridMap[i + 1]; - ndUnsigned64 gridHashA = entry0.m_gridHash; - ndUnsigned64 gridHashB = entry1.m_gridHash; - ndAssert(gridHashA <= gridHashB); - } - #endif -} - -void ndBodySphFluid::BuildBuckets(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - ndInt32 countReset = data.m_locks.GetCount(); - data.m_pairs.SetCount(m_posit.GetCount()); - data.m_locks.SetCount(m_posit.GetCount()); - data.m_pairCount.SetCount(m_posit.GetCount()); - data.m_kernelDistance.SetCount(m_posit.GetCount()); - for (ndInt32 i = countReset; i < data.m_locks.GetCount(); ++i) - { - data.m_locks[i].Unlock(); - } - for (ndInt32 i = 0; i < data.m_pairCount.GetCount(); ++i) - { - data.m_pairCount[i] = 0; - } - - auto AddPairs = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(AddPairs); - const ndArray& hashGridMap = data.m_hashGridMap; - const ndArray& gridScans = data.m_gridScans; - const ndFloat32 diameter = ndFloat32(1.5f) * ndFloat32(2.0f) * GetParticleRadius(); - const ndFloat32 diameter2 = diameter * diameter; - const ndInt32 windowsTest = data.WorldToGrid(ndVector (data.m_worlToGridOrigin + diameter)) + 1; - - ndArray& locks = data.m_locks; - ndArray& pairCount = data.m_pairCount; - ndArray& pair = data.m_pairs; - ndArray& distance = data.m_kernelDistance; - - auto ProccessCell = [this, &data, &hashGridMap, &pair, &pairCount, &locks, &distance, windowsTest, diameter2](ndInt32 start, ndInt32 count) - { - const ndInt32 count0 = count - 1; - for (ndInt32 i = 0; i < count0; ++i) - { - const ndGridHash hash0 = hashGridMap[start + i]; - const ndInt32 particle0 = ndInt32(hash0.m_particleIndex); - const ndInt32 x0 = data.WorldToGrid(m_posit[particle0]); - const bool homeGridTest0 = (hash0.m_cellType == ndGridHash::m_homeGrid); - for (ndInt32 j = i + 1; j < count; ++j) - { - const ndGridHash hash1 = hashGridMap[start + j]; - const ndInt32 particle1 = ndInt32(hash1.m_particleIndex); - ndAssert(particle0 != particle1); - const ndInt32 x1 = data.WorldToGrid(m_posit[particle1]); - const ndInt32 sweeptTest = ((x1 - x0) >= windowsTest); - if (sweeptTest) - { - break; - } - ndAssert(particle0 != particle1); - const bool homeGridTest1 = (hash1.m_cellType == ndGridHash::m_homeGrid); - const ndInt32 test = homeGridTest0 | homeGridTest1; - if (test) - { - const ndVector p1p0(m_posit[particle0] - m_posit[particle1]); - const ndFloat32 dist2(p1p0.DotProduct(p1p0).GetScalar()); - if (dist2 < diameter2) - { - const ndFloat32 dist = ndSqrt(ndMax(dist2, ndFloat32(1.0e-8f))); - { - ndSpinLock lock(locks[particle0]); - ndInt8 neigborCount = pairCount[particle0]; - if (neigborCount < D_PARTICLE_BUCKET_SIZE) - { - ndInt8 isUnique = 1; - ndInt32* const neighborg = pair[particle0].m_neighborg; - for (ndInt32 k = neigborCount - 1; k >= 0; --k) - { - isUnique = isUnique & (neighborg[k] != particle1); - } - //ndAssert(isUnique); - - neighborg[neigborCount] = particle1; - distance[particle0].m_dist[neigborCount] = dist; - pairCount[particle0] = neigborCount + isUnique; - } - } - - { - ndSpinLock lock(locks[particle1]); - ndInt8 neigborCount = pairCount[particle1]; - if (neigborCount < D_PARTICLE_BUCKET_SIZE) - { - ndInt8 isUnique = 1; - ndInt32* const neighborg = pair[particle1].m_neighborg; - for (ndInt32 k = neigborCount - 1; k >= 0; --k) - { - isUnique = isUnique & (neighborg[k] != particle0); - } - //ndAssert(isUnique); - - neighborg[neigborCount] = particle0; - distance[particle1].m_dist[neigborCount] = dist; - pairCount[particle1] = neigborCount + isUnique; - } - } - } - } - } - } - }; - - const ndInt32 scansCount = gridScans.GetCount() - 1; - for (ndInt32 i = threadIndex; i < scansCount; i += threadCount) - { - const ndInt32 start = gridScans[i]; - const ndInt32 count = gridScans[i + 1] - start; - ProccessCell(start, count); - } - }); - - auto AddPairs_new = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(AddPairs); - const ndArray& hashGridMap = data.m_hashGridMap; - const ndArray& gridScans = data.m_gridScans; - const ndFloat32 diameter = ndFloat32(1.5f) * ndFloat32(2.0f) * GetParticleRadius(); - const ndFloat32 diameter2 = diameter * diameter; - const ndInt32 windowsTest = data.WorldToGrid(ndVector(data.m_worlToGridOrigin + diameter)) + 1; - - ndArray& locks = data.m_locks; - ndArray& pairCount = data.m_pairCount; - ndArray& pair = data.m_pairs; - ndArray& distance = data.m_kernelDistance; - - auto ProccessCell = [this, &data, &hashGridMap, &pair, &pairCount, &locks, &distance, windowsTest, diameter2](ndInt32 start, ndInt32 count) - { - const ndInt32 count0 = count - 1; - for (ndInt32 i = 0; i < count0; ++i) - { - const ndGridHash hash0 = hashGridMap[start + i]; - const ndInt32 particle0 = ndInt32(hash0.m_particleIndex); - const ndInt32 x0 = data.WorldToGrid(m_posit[particle0]); - const bool homeGridTest0 = (hash0.m_cellType == ndGridHash::m_homeGrid); - for (ndInt32 j = i + 1; j < count; ++j) - { - const ndGridHash hash1 = hashGridMap[start + j]; - const ndInt32 particle1 = ndInt32(hash1.m_particleIndex); - ndAssert(particle0 != particle1); - const ndInt32 x1 = data.WorldToGrid(m_posit[particle1]); - const ndInt32 sweeptTest = ((x1 - x0) >= windowsTest); - if (sweeptTest) - { - break; - } - ndAssert(particle0 != particle1); - const ndVector p1p0(m_posit[particle0] - m_posit[particle1]); - const ndFloat32 dist2(p1p0.DotProduct(p1p0).GetScalar()); - if (dist2 < diameter2) - { - const bool homeGridTest1 = (hash1.m_cellType == ndGridHash::m_homeGrid); - if (homeGridTest0 && homeGridTest1) - { - ndInt8 neigborCount0 = pairCount[particle0]; - const ndFloat32 dist = ndSqrt(ndMax(dist2, ndFloat32(1.0e-8f))); - if (neigborCount0 < D_PARTICLE_BUCKET_SIZE) - { - pair[particle0].m_neighborg[neigborCount0] = particle1; - distance[particle0].m_dist[neigborCount0] = dist; - pairCount[particle0] = neigborCount0 + 1; - } - - ndInt8 neigborCount1 = pairCount[particle1]; - if (neigborCount1 < D_PARTICLE_BUCKET_SIZE) - { - pair[particle1].m_neighborg[neigborCount1] = particle0; - distance[particle1].m_dist[neigborCount1] = dist; - pairCount[particle1] = neigborCount1 + 1; - } - - } - else if (homeGridTest0) - { - ndAssert(!homeGridTest1); - ndInt8 neigborCount0 = pairCount[particle0]; - const ndFloat32 dist = ndSqrt(ndMax(dist2, ndFloat32(1.0e-8f))); - if (neigborCount0 < D_PARTICLE_BUCKET_SIZE) - { - pair[particle0].m_neighborg[neigborCount0] = particle1; - distance[particle0].m_dist[neigborCount0] = dist; - pairCount[particle0] = neigborCount0 + 1; - } - } - else if (homeGridTest1) - { - ndAssert(!homeGridTest0); - ndInt8 neigborCount1 = pairCount[particle1]; - const ndFloat32 dist = ndSqrt(ndMax(dist2, ndFloat32(1.0e-8f))); - if (neigborCount1 < D_PARTICLE_BUCKET_SIZE) - { - pair[particle1].m_neighborg[neigborCount1] = particle0; - distance[particle1].m_dist[neigborCount1] = dist; - pairCount[particle1] = neigborCount1 + 1; - } - } - } - } - } - }; - - const ndInt32 scansCount = gridScans.GetCount() - 1; - for (ndInt32 i = threadIndex; i < scansCount; i += threadCount) - { - const ndInt32 start = gridScans[i]; - const ndInt32 count = gridScans[i + 1] - start; - ProccessCell(start, count); - } - }); - -//#ifdef _DEBUG -#if 0 - ndTree filter; - for (ndInt32 i = 0; i < data.m_hashGridMap.GetCount(); ++i) - { - if (data.m_hashGridMap[i].m_cellType == ndGridHash::m_homeGrid) - { - ndAssert(filter.Insert(ndInt32 (data.m_hashGridMap[i].m_particleIndex))); - } - } -#endif - - threadPool->ParallelExecute(AddPairs); - - //threadPool->ParallelExecute(AddPairs_new); -} - -void ndBodySphFluid::CalculateParticlesDensity(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - data.m_density.SetCount(m_posit.GetCount()); - data.m_invDensity.SetCount(m_posit.GetCount()); - - auto CalculateDensity = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CalculateDensity); - const ndArray& posit = m_posit; - - const ndFloat32 h = ndFloat32(1.5f) * ndFloat32(2.0f) * GetParticleRadius(); - const ndFloat32 h2 = h * h; - const ndFloat32 kernelMagicConst = ndFloat32(315.0f) / (ndFloat32(64.0f) * ndPi * ndPow(h, ndFloat32 (9.0f))); - const ndFloat32 kernelConst = m_mass * kernelMagicConst; - const ndFloat32 selfDensity = kernelConst * h2 * h2 * h2; - - const ndStartEnd startEnd(posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndInt32 count = data.m_pairCount[i]; - const ndParticleKernelDistance& distance = data.m_kernelDistance[i]; - ndFloat32 density = selfDensity; - for (ndInt32 j = 0; j < count; ++j) - { - const ndFloat32 d = distance.m_dist[j]; - const ndFloat32 dist2 = h2 - d * d; - ndAssert(dist2 > ndFloat32(0.0f)); - const ndFloat32 dist6 = dist2 * dist2 * dist2; - density += kernelConst * dist6; - } - ndAssert(density > ndFloat32(0.0f)); - data.m_density[i] = density; - data.m_invDensity[i] = ndFloat32(1.0f) / density; - } - }); - - threadPool->ParallelExecute(CalculateDensity); -} - -void ndBodySphFluid::CalculateAccelerations(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - data.m_accel.SetCount(m_posit.GetCount()); - - auto CalculateAcceleration = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CalculateAcceleration); - const ndVector epsilon2 (ndFloat32(1.0e-12f)); - - const ndArray& veloc = m_veloc; - const ndArray& posit = m_posit; - const ndFloat32* const density = &data.m_density[0]; - const ndFloat32* const invDensity = &data.m_invDensity[0]; - - const ndFloat32 h = ndFloat32(1.5f) * ndFloat32(2.0f) * GetParticleRadius(); - //const ndFloat32 u = m_viscosity; - const ndVector kernelConst(m_mass * ndFloat32(45.0f) / (ndPi * ndPow(h, ndFloat32 (6.0f)))); - - const ndFloat32 viscosity = m_viscosity; - const ndFloat32 restDensity = m_restDensity; - const ndFloat32 gasConstant = m_gasConstant; - - const ndVector gravity(m_gravity); - const ndStartEnd startEnd(posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i0 = startEnd.m_start; i0 < startEnd.m_end; ++i0) - { - const ndVector p0(posit[i0]); - const ndVector v0(veloc[i0]); - - const ndInt32 count = data.m_pairCount[i0]; - const ndParticlePair& pairs = data.m_pairs[i0]; - ndParticleKernelDistance& distance = data.m_kernelDistance[i0]; - const ndFloat32 pressureI0 = density[i0] - restDensity; - - ndVector forceAcc(ndVector::m_zero); - for (ndInt32 j = 0; j < count; ++j) - { - const ndInt32 i1 = pairs.m_neighborg[j]; - const ndVector p10(posit[i1] - p0); - const ndVector dot(p10.DotProduct(p10) + epsilon2); - const ndVector unitDir(p10 * dot.InvSqrt()); - - ndAssert(unitDir.m_w == ndFloat32(0.0f)); - - // kernel distance - const ndFloat32 dist = distance.m_dist[j]; - const ndFloat32 kernelDist = h - dist; - ndAssert(kernelDist >= ndFloat32(0.0f)); - - // calculate pressure - const ndFloat32 kernelDist2 = kernelDist * kernelDist; - const ndFloat32 pressureI1 = density[i1] - restDensity; - const ndVector force(gasConstant * kernelDist2 * invDensity[i1] * (pressureI0 + pressureI1)); - forceAcc += force * unitDir; - - // calculate viscosity acceleration - const ndVector v01(veloc[i1] - v0); - forceAcc += v01 * ndVector(kernelDist * viscosity * invDensity[j]); - } - const ndVector accel(gravity + ndVector(invDensity[i0]) * kernelConst * forceAcc); - data.m_accel[i0] = accel; - } - }); - - threadPool->ParallelExecute(CalculateAcceleration); -} - -void ndBodySphFluid::IntegrateParticles(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - auto IntegrateParticles = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(IntegrateParticles); - const ndArray& accel = data.m_accel; - ndArray& veloc = m_veloc; - ndArray& posit = m_posit; - - //const ndVector timestep (ndFloat32 (0.003f)); - //const ndVector timestep(m_timestep); - //const ndVector timestep(m_timestep * 0.5f); - const ndVector timestep(m_timestep * 0.25f); - - const ndStartEnd startEnd(posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - veloc[i] = veloc[i] + accel[i] * timestep; - posit[i] = posit[i] + veloc[i] * timestep; - if (posit[i].m_y <= 1.0f) - { - posit[i].m_y = 1.0f; - veloc[i].m_y = 0.0f; - } - } - }); - - threadPool->ParallelExecute(IntegrateParticles); -} - -void ndBodySphFluid::CaculateAabb(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - class ndBox - { - public: - ndBox() - :m_min(ndFloat32(1.0e10f)) - ,m_max(ndFloat32(-1.0e10f)) - { - } - ndVector m_min; - ndVector m_max; - }; - - ndBox boxes[D_MAX_THREADS_COUNT]; - auto CalculateAabb = ndMakeObject::ndFunction([this, &boxes](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CalculateAabb); - ndBox box; - const ndArray& posit = m_posit; - const ndStartEnd startEnd(posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - box.m_min = box.m_min.GetMin(posit[i]); - box.m_max = box.m_max.GetMax(posit[i]); - } - boxes[threadIndex] = box; - }); - - threadPool->ParallelExecute(CalculateAabb); - - ndBox box; - const ndInt32 threadCount = threadPool->GetThreadCount(); - for (ndInt32 i = 0; i < threadCount; ++i) - { - box.m_min = box.m_min.GetMin(boxes[i].m_min); - box.m_max = box.m_max.GetMax(boxes[i].m_max); - } - - ndWorkingBuffers& data = *m_workingBuffers; - //const ndFloat32 diameter = ndFloat32(2.0f) * GetParticleRadius(); - const ndFloat32 diameter = ndFloat32(1.5f) * ndFloat32(2.0f) * GetParticleRadius(); - const ndFloat32 gridSize = diameter * D_GRID_SIZE_SCALER; - - data.m_hashGridSize = gridSize; - data.m_hashInvGridSize = ndFloat32(1.0f) / gridSize; - - const ndVector grid(data.m_hashGridSize); - const ndVector invGrid(data.m_hashInvGridSize); - - // add one grid padding to the aabb - box.m_min -= grid; - box.m_max += (grid + grid); - - // quantize the aabb to integers of the gird size - box.m_min = grid * (box.m_min * invGrid).Floor(); - box.m_max = grid * (box.m_max * invGrid).Floor(); - - // make sure the w component is zero. - m_box0 = box.m_min & ndVector::m_triplexMask; - m_box1 = box.m_max & ndVector::m_triplexMask; - data.SetWorldToGridMapping(gridSize, m_box1, m_box0); -} - -void ndBodySphFluid::CreateGrids(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - class ndGridNeighborInfo - { - public: - ndGridNeighborInfo() - { - //ndGridHash stepsCode; - m_neighborDirs[0][0] = ndGridHash(0, 0); - m_neighborDirs[0][1] = ndGridHash(0, 0); - m_neighborDirs[0][2] = ndGridHash(0, 0); - m_neighborDirs[0][3] = ndGridHash(0, 0); - - m_counter[0] = 1; - m_isPadd[0][0] = 0; - m_isPadd[0][1] = 1; - m_isPadd[0][2] = 1; - m_isPadd[0][3] = 1; - - //ndGridHash stepsCode_y; - m_neighborDirs[1][0] = ndGridHash(0, 0); - m_neighborDirs[1][1] = ndGridHash(1, 0); - m_neighborDirs[1][2] = ndGridHash(0, 0); - m_neighborDirs[1][3] = ndGridHash(0, 0); - - m_counter[1] = 2; - m_isPadd[1][0] = 0; - m_isPadd[1][1] = 0; - m_isPadd[1][2] = 1; - m_isPadd[1][3] = 1; - - //ndGridHash stepsCode_z; - m_neighborDirs[2][0] = ndGridHash(0, 0); - m_neighborDirs[2][1] = ndGridHash(0, 1); - m_neighborDirs[2][2] = ndGridHash(0, 0); - m_neighborDirs[2][3] = ndGridHash(0, 0); - - m_counter[2] = 2; - m_isPadd[2][0] = 0; - m_isPadd[2][1] = 0; - m_isPadd[2][2] = 1; - m_isPadd[2][3] = 1; - - //ndGridHash stepsCode_yz; - m_neighborDirs[3][0] = ndGridHash(0, 0); - m_neighborDirs[3][1] = ndGridHash(1, 0); - m_neighborDirs[3][2] = ndGridHash(0, 1); - m_neighborDirs[3][3] = ndGridHash(1, 1); - - m_counter[3] = 4; - m_isPadd[3][0] = 0; - m_isPadd[3][1] = 0; - m_isPadd[3][2] = 0; - m_isPadd[3][3] = 0; - } - - ndGridHash m_neighborDirs[4][4]; - ndInt8 m_isPadd[4][4]; - ndInt8 m_counter[4]; - }; - - ndGridNeighborInfo neiborghood; - ndWorkingBuffers& data = *m_workingBuffers; - - auto CountGrids = ndMakeObject::ndFunction([this, &data, &neiborghood](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CountGrids); - const ndVector origin(m_box0); - const ndVector invGridSize(data.m_hashInvGridSize); - //const ndVector particleBox(ndFloat32(1.5f) * GetParticleRadius()); - const ndVector particleBox(ndFloat32(0.5f) * data.m_hashGridSize); - - const ndVector* const posit = &m_posit[0]; - ndInt32* const scans = &data.m_gridScans[0]; - - const ndStartEnd startEnd(m_posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndVector gridPosit(posit[i] - origin); - const ndVector p0(gridPosit - particleBox); - const ndVector p1(gridPosit + particleBox); - const ndGridHash box0Hash(p0 * invGridSize, i); - const ndGridHash box1Hash(p1 * invGridSize, i); - const ndGridHash codeHash(box1Hash.m_gridHash - box0Hash.m_gridHash); - -#ifdef D_USE_YZ_PLANE_BUCKETS - ndAssert(codeHash.m_y <= 1); - ndAssert(codeHash.m_z <= 1); - const ndUnsigned32 code = ndUnsigned32(codeHash.m_z * 2 + codeHash.m_y); -#else - ndAssert(codeHash.m_x <= 1); - ndAssert(codeHash.m_z <= 1); - const ndUnsigned32 code = ndUnsigned32(codeHash.m_z * 2 + codeHash.m_x); -#endif - scans[i] = neiborghood.m_counter[code]; - } - }); - - auto CreateGrids = ndMakeObject::ndFunction([this, &data, &neiborghood](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CreateGrids); - const ndVector origin(m_box0); - ndGridHash* const dst = &data.m_hashGridMap[0]; - const ndInt32* const scans = &data.m_gridScans[0]; - const ndVector* const posit = &m_posit[0]; - const ndVector invGridSize(data.m_hashInvGridSize); - //const ndVector particleBox(ndFloat32(1.5f)* GetParticleRadius()); - const ndVector particleBox(ndFloat32(0.5f)* data.m_hashGridSize); - - const ndStartEnd startEnd(m_posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndVector gridPosit(posit[i] - origin); - const ndVector gridPosit0(gridPosit - particleBox); - const ndVector gridPosit1(gridPosit + particleBox); - const ndGridHash centerHash(gridPosit* invGridSize, i); - const ndGridHash box0Hash(gridPosit0 * invGridSize, i); - const ndGridHash box1Hash(gridPosit1 * invGridSize, i); - const ndGridHash codeHash(box1Hash.m_gridHash - box0Hash.m_gridHash); - - const ndInt32 base = scans[i]; - const ndInt32 count = scans[i + 1] - base; - -#ifdef D_USE_YZ_PLANE_BUCKETS - ndAssert(codeHash.m_y <= 1); - ndAssert(codeHash.m_z <= 1); - const ndInt32 code = ndInt32(codeHash.m_z * 2 + codeHash.m_y); -#else - ndAssert(codeHash.m_x <= 1); - ndAssert(codeHash.m_z <= 1); - const ndInt32 code = ndInt32(codeHash.m_z * 2 + codeHash.m_x); -#endif - const ndGridHash* const neigborgh = &neiborghood.m_neighborDirs[code][0]; - ndAssert(count == neiborghood.m_counter[code]); - for (ndInt32 j = 0; j < count; ++ j) - { - ndGridHash quadrand(box0Hash); - quadrand.m_gridHash += neigborgh[j].m_gridHash; - quadrand.m_cellType = ndGridHash::ndGridType(quadrand.m_gridHash == centerHash.m_gridHash); - ndAssert(quadrand.m_cellType == ((quadrand.m_gridHash == centerHash.m_gridHash) ? ndGridHash::m_homeGrid : ndGridHash::m_adjacentGrid)); - dst[base + j] = quadrand; - } - } - }); - - data.m_gridScans.SetCount(m_posit.GetCount() + 1); - data.m_gridScans[m_posit.GetCount()] = 0; - threadPool->ParallelExecute(CountGrids); - - ndInt32 gridCount = 0; - const ndInt32 itemsCount = data.m_gridScans.GetCount() & (-8); - for (ndInt32 i = 0; i < itemsCount; i += 8) - { - for (ndInt32 j = 0; j < 8; ++j) - { - ndInt32 count = data.m_gridScans[i + j]; - data.m_gridScans[i + j] = gridCount; - gridCount += count; - } - } - for (ndInt32 j = itemsCount; j < data.m_gridScans.GetCount(); ++j) - { - ndInt32 count = data.m_gridScans[j]; - data.m_gridScans[j] = gridCount; - gridCount += count; - } - - data.m_hashGridMap.SetCount(gridCount); - threadPool->ParallelExecute(CreateGrids); - data.m_hashGridMapScratchBuffer.SetCount(gridCount); - - //ndAssert(TraceHashes()); -} - -bool ndBodySphFluid::TraceHashes() const -{ -#if 0 - ndWorkingBuffers& data = *m_workingBuffers; - ndGridHash* xxxx = &data.m_hashGridMap[0]; - for (int i = 0; i < data.m_hashGridMap.GetCount(); i++) - { - ndTrace(("id(%d)\tx(%d)\tz(%d)\n", xxxx[i].m_particleIndex, xxxx[i].m_x, xxxx[i].m_z)); - } -#endif - - return true; -} - -void ndBodySphFluid::Update(const ndScene* const scene, ndFloat32 timestep) -{ - if (TaskState() == ndBackgroundTask::m_taskCompleted) - { - if (m_posit.GetCount()) - { - m_timestep = timestep; - ((ndScene*)scene)->SendBackgroundTask(this); - if (!m_updateInBackground) - { - Sync(); - } - } - } -} - -void ndBodySphFluid::Execute(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndAssert(sizeof(ndGridHash) == sizeof(ndUnsigned64)); - - CaculateAabb(threadPool); - CreateGrids(threadPool); - SortGrids(threadPool); - CalculateScans(threadPool); - BuildBuckets(threadPool); - CalculateParticlesDensity(threadPool); - CalculateAccelerations(threadPool); - IntegrateParticles(threadPool); -} - -#else - -class ndBodySphFluid::ndGridHash -{ - public: - enum ndGridType - { - m_adjacentGrid = 0, - m_homeGrid = 1, - }; - - ndGridHash() - { - } - - ndGridHash(ndUnsigned64 gridHash) - :m_gridHash(gridHash) - { - } - -#ifdef D_USE_YZ_PLANE_BUCKETS - ndGridHash(ndInt32 y, ndInt32 z) - { - m_gridHash = 0; - m_y = ndUnsigned64(y); - m_z = ndUnsigned64(z); - } - - ndGridHash(const ndVector& grid, ndInt32 particleIndex) - { - ndAssert(grid.m_y >= ndFloat32(0.0f)); - ndAssert(grid.m_z >= ndFloat32(0.0f)); - ndAssert(grid.m_y < ndFloat32(1 << (D_SPH_HASH_BITS * 2))); - ndAssert(grid.m_z < ndFloat32(1 << (D_SPH_HASH_BITS * 2))); - - ndVector hash(grid.GetInt()); - - m_gridHash = 0; - m_y = ndUnsigned64(hash.m_iy); - m_z = ndUnsigned64(hash.m_iz); - - m_cellType = m_adjacentGrid; - m_particleIndex = ndUnsigned64(particleIndex); - } -#else - ndGridHash(ndInt32 x, ndInt32 z) - { - m_gridHash = 0; - m_x = ndUnsigned64(x); - m_z = ndUnsigned64(z); - } - - ndGridHash(const ndVector& grid, ndInt32 particleIndex) - { - ndAssert(grid.m_x >= ndFloat32(0.0f)); - ndAssert(grid.m_z >= ndFloat32(0.0f)); - ndAssert(grid.m_x < ndFloat32(1 << (D_SPH_HASH_BITS * 2))); - ndAssert(grid.m_z < ndFloat32(1 << (D_SPH_HASH_BITS * 2))); - - ndVector hash(grid.GetInt()); - - m_gridHash = 0; - m_x = ndUnsigned64(hash.m_ix); - m_z = ndUnsigned64(hash.m_iz); - - m_cellType = m_adjacentGrid; - m_particleIndex = ndUnsigned64(particleIndex); - } -#endif - - union - { - struct - { -#ifdef D_USE_YZ_PLANE_BUCKETS - ndUnsigned64 m_y : D_SPH_HASH_BITS * 2; - ndUnsigned64 m_z : D_SPH_HASH_BITS * 2; -#else - ndUnsigned64 m_x : D_SPH_HASH_BITS * 2; - ndUnsigned64 m_z : D_SPH_HASH_BITS * 2; -#endif - ndUnsigned64 m_particleIndex : 23; - ndUnsigned64 m_cellType : 1; - }; - struct - { -#ifdef D_USE_YZ_PLANE_BUCKETS - ndUnsigned64 m_yLow : D_SPH_HASH_BITS; - ndUnsigned64 m_yHigh : D_SPH_HASH_BITS; - ndUnsigned64 m_zLow : D_SPH_HASH_BITS; - ndUnsigned64 m_zHigh : D_SPH_HASH_BITS; -#else - ndUnsigned64 m_xLow : D_SPH_HASH_BITS; - ndUnsigned64 m_xHigh : D_SPH_HASH_BITS; - ndUnsigned64 m_zLow : D_SPH_HASH_BITS; - ndUnsigned64 m_zHigh : D_SPH_HASH_BITS; -#endif - }; - ndUnsigned64 m_gridHash : D_SPH_HASH_BITS * 2 * 2; - }; -}; - -class ndBodySphFluid::ndParticlePair -{ - public: - ndInt32 m_neighborg[D_PARTICLE_BUCKET_SIZE]; -}; - -class ndBodySphFluid::ndParticleKernelDistance -{ - public: - ndFloat32 m_dist[D_PARTICLE_BUCKET_SIZE]; -}; - -class ndBodySphFluid::ndWorkingBuffers -{ -#define D_SPH_GRID_X_RESOLUTION 4 - - public: - ndWorkingBuffers() - :m_accel(D_SPH_BUFFER_GRANULARITY) - , m_locks(D_SPH_BUFFER_GRANULARITY) - , m_pairCount(D_SPH_BUFFER_GRANULARITY) - , m_gridScans(D_SPH_BUFFER_GRANULARITY) - , m_density(D_SPH_BUFFER_GRANULARITY) - , m_invDensity(D_SPH_BUFFER_GRANULARITY) - , m_pairs(D_SPH_BUFFER_GRANULARITY) - , m_hashGridMap(D_SPH_BUFFER_GRANULARITY) - , m_hashGridMapScratchBuffer(D_SPH_BUFFER_GRANULARITY) - , m_kernelDistance(D_SPH_BUFFER_GRANULARITY) - , m_worlToGridOrigin(ndFloat32(1.0f)) - , m_worlToGridScale(ndFloat32(1.0f)) - , m_hashGridSize(ndFloat32(0.0f)) - , m_hashInvGridSize(ndFloat32(0.0f)) - , m_particleDiameter(ndFloat32(0.0f)) - { - for (ndInt32 i = 0; i < D_MAX_THREADS_COUNT; ++i) - { - m_partialsGridScans[i].Resize(D_SPH_BUFFER_GRANULARITY); - } - } - - ~ndWorkingBuffers() - { - } - - void SetWorldToGridMapping(ndFloat32 gridSize, const ndVector& maxP, const ndVector& minP) - { -#ifdef D_USE_YZ_PLANE_BUCKETS - m_worlToGridOrigin = minP.m_x; - ndFloat32 gridCount = ndFloor((maxP.m_x - minP.m_x) / gridSize + ndFloat32(1.0f)); - m_worlToGridScale = ndFloat32(1 << D_SPH_GRID_X_RESOLUTION) * gridCount / (maxP.m_x - minP.m_x); -#else - m_worlToGridOrigin = minP.m_y; - ndFloat32 gridCount = ndFloor((maxP.m_y - minP.m_y) / gridSize + ndFloat32(1.0f)); - m_worlToGridScale = ndFloat32(1 << D_SPH_GRID_X_RESOLUTION) * (ndFloat32)gridCount / (maxP.m_y - minP.m_y); -#endif - } - - ndInt32 WorldToGrid(const ndVector& point) const - { -#ifdef D_USE_YZ_PLANE_BUCKETS - ndInt32 val = ndInt32((point.m_x - m_worlToGridOrigin) * m_worlToGridScale); -#else - ndInt32 val = ndInt32((point.m_y - m_worlToGridOrigin) * m_worlToGridScale); -#endif - ndAssert(val >= 0); - return val; - } - - ndArray m_accel; - ndArray m_locks; - ndArray m_pairCount; - ndArray m_gridScans; - ndArray m_density; - ndArray m_invDensity; - ndArray m_pairs; - ndArray m_hashGridMap; - ndArray m_hashGridMapScratchBuffer; - ndArray m_kernelDistance; - ndArray m_partialsGridScans[D_MAX_THREADS_COUNT]; - ndFloat32 m_worlToGridOrigin; - ndFloat32 m_worlToGridScale; - ndFloat32 m_hashGridSize; - ndFloat32 m_hashInvGridSize; - ndFloat32 m_particleDiameter; -}; - -ndBodySphFluid::ndBodySphFluid() - :ndBodyParticleSet() - ,m_workingBuffers(new ndWorkingBuffers) - ,m_mass(ndFloat32(1.0f)) - ,m_viscosity(ndFloat32(1.05f)) - ,m_restDensity(ndFloat32(1000.0f)) - ,m_gasConstant(ndFloat32(1.0f)) -{ - SetRestDensity(m_restDensity); -} - -ndBodySphFluid::~ndBodySphFluid() -{ - delete m_workingBuffers; -} - -void ndBodySphFluid::SortBuckets(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - - class ndKey_low - { - public: - ndKey_low(void* const context) - :m_fluid((ndBodySphFluid*)context) - , m_data(*m_fluid->m_workingBuffers) - , m_point(m_fluid->GetPositions()) - { - } - - ndInt32 GetKey(const ndGridHash& cell) const - { - ndInt32 index = ndInt32(cell.m_particleIndex); - ndUnsigned32 key = ndUnsigned32(m_data.WorldToGrid(m_point[index])); - return ndInt32(key & 0xff); - } - - ndBodySphFluid* m_fluid; - ndWorkingBuffers& m_data; - const ndArray& m_point; - }; - - class ndKey_middle - { - public: - ndKey_middle(void* const context) - :m_fluid((ndBodySphFluid*)context) - , m_data(*m_fluid->m_workingBuffers) - , m_point(m_fluid->GetPositions()) - { - } - - ndInt32 GetKey(const ndGridHash& cell) const - { - ndInt32 index = ndInt32(cell.m_particleIndex); - ndUnsigned32 key = ndUnsigned32(m_data.WorldToGrid(m_point[index])); - return ndInt32((key >> 8) & 0xff); - } - - ndBodySphFluid* m_fluid; - ndWorkingBuffers& m_data; - const ndArray& m_point; - }; - - class ndKey_high - { - public: - ndKey_high(void* const context) - :m_fluid((ndBodySphFluid*)context) - , m_data(*m_fluid->m_workingBuffers) - , m_point(m_fluid->GetPositions()) - { - } - - ndInt32 GetKey(const ndGridHash& cell) const - { - ndInt32 index = ndInt32(cell.m_particleIndex); - ndUnsigned32 key = ndUnsigned32(m_data.WorldToGrid(m_point[index])); - return ndInt32((key >> 16) & 0xff); - } - - ndBodySphFluid* m_fluid; - ndWorkingBuffers& m_data; - const ndArray& m_point; - }; - - ndWorkingBuffers& data = *m_workingBuffers; - const ndInt32 keySize = data.WorldToGrid(m_box1); - - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, this); - if (keySize >= 256) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, this); - } - if (keySize >= (256 * 256)) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, this); - } - -#ifdef _DEBUG - const ndArray& point = GetPositions(); - for (int i = 1; i < data.m_hashGridMap.GetCount(); ++i) - { - ndGridHash cell0(data.m_hashGridMap[i - 1]); - ndGridHash cell1(data.m_hashGridMap[i + 0]); - const ndVector p0(point[ndInt32(cell0.m_particleIndex)]); - const ndVector p1(point[ndInt32(cell1.m_particleIndex)]); - ndInt32 key0 = data.WorldToGrid(p0); - ndInt32 key1 = data.WorldToGrid(p1); - ndAssert(key0 <= key1); - } -#endif -} - -void ndBodySphFluid::SortCellBuckects(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); -#ifdef D_USE_YZ_PLANE_BUCKETS - class ndKey_ylow - { - public: - ndKey_ylow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_yLow); - } - }; - - class ndKey_yhigh - { - public: - ndKey_yhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_yHigh); - } - }; -#else - class ndKey_xlow - { - public: - ndKey_xlow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_xLow); - } - }; - - class ndKey_xhigh - { - public: - ndKey_xhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_xHigh); - } - }; - -#endif - - class ndKey_zlow - { - public: - ndKey_zlow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_zLow); - } - }; - - class ndKey_zhigh - { - public: - ndKey_zhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_zHigh); - } - }; - - ndWorkingBuffers& data = *m_workingBuffers; - const ndVector boxSize((m_box1 - m_box0).Scale(data.m_hashInvGridSize).GetInt()); - -#ifdef D_USE_YZ_PLANE_BUCKETS - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - if (boxSize.m_iy > (1 << D_SPH_HASH_BITS)) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - } -#else - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - if (boxSize.m_ix > (1 << D_SPH_HASH_BITS)) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - } -#endif - - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - if (boxSize.m_iz > (1 << D_SPH_HASH_BITS)) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - } - -#ifdef _DEBUG - for (int i = 1; i < data.m_hashGridMap.GetCount(); ++i) - { - ndGridHash cell0(data.m_hashGridMap[i - 1]); - ndGridHash cell1(data.m_hashGridMap[i + 0]); -#ifdef D_USE_YZ_PLANE_BUCKETS - ndUnsigned64 key0 = (cell0.m_z << (D_SPH_HASH_BITS * 2)) + cell0.m_y; - ndUnsigned64 key1 = (cell1.m_z << (D_SPH_HASH_BITS * 2)) + cell1.m_y; -#else - ndUnsigned64 key0 = (cell0.m_z << (D_SPH_HASH_BITS * 2)) + cell0.m_x; - ndUnsigned64 key1 = (cell1.m_z << (D_SPH_HASH_BITS * 2)) + cell1.m_x; -#endif - ndAssert(key0 <= key1); - } -#endif -} - -void ndBodySphFluid::CalculateScans(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - ndInt32 sums[D_MAX_THREADS_COUNT + 1]; - ndInt32 scans[D_MAX_THREADS_COUNT + 1]; - - auto CountGridScans = ndMakeObject::ndFunction([&data, &scans](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(CountGridScans); - const ndGridHash* const hashGridMap = &data.m_hashGridMap[0]; - - const ndInt32 start = scans[threadIndex]; - const ndInt32 end = scans[threadIndex + 1]; - ndArray& gridScans = data.m_partialsGridScans[threadIndex]; - ndUnsigned64 gridHash0 = hashGridMap[start].m_gridHash; - - ndInt32 count = 0; - gridScans.SetCount(0); - for (ndInt32 i = start; i < end; ++i) - { - ndUnsigned64 gridHash = hashGridMap[i].m_gridHash; - if (gridHash != gridHash0) - { - gridScans.PushBack(count); - count = 0; - gridHash0 = gridHash; - } - count++; - } - gridScans.PushBack(count); - }); - - auto CalculateScans = ndMakeObject::ndFunction([&data, &scans, &sums](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(CalculateScans); - ndArray& gridScans = data.m_gridScans; - const ndArray& partialScan = data.m_partialsGridScans[threadIndex]; - const ndInt32 base = sums[threadIndex]; - ndInt32 sum = scans[threadIndex]; - for (ndInt32 i = 0; i < partialScan.GetCount(); ++i) - { - gridScans[base + i] = sum; - sum += partialScan[i]; - } - }); - - memset(scans, 0, sizeof(scans)); - const ndInt32 threadCount = threadPool->GetThreadCount(); - - ndInt32 particleCount = ndInt32(data.m_hashGridMap.GetCount()); - - ndInt32 acc0 = 0; - ndInt32 stride = particleCount / threadCount; - const ndGridHash* const hashGridMap = &data.m_hashGridMap[0]; - for (ndInt32 threadIndex = 0; threadIndex < threadCount; threadIndex++) - { - scans[threadIndex] = acc0; - acc0 += stride; - while (acc0 < particleCount && (hashGridMap[acc0].m_gridHash == hashGridMap[acc0 - 1].m_gridHash)) - { - acc0++; - } - } - scans[threadCount] = particleCount; - threadPool->ParallelExecute(CountGridScans); - - ndInt32 scansCount = 0; - - for (ndInt32 i = 0; i < threadCount; ++i) - { - sums[i] = scansCount; - scansCount += ndInt32(data.m_partialsGridScans[i].GetCount()); - } - sums[threadCount] = scansCount; - - data.m_gridScans.SetCount(scansCount + 1); - threadPool->ParallelExecute(CalculateScans); - - data.m_gridScans[scansCount] = scans[threadCount]; -} - -void ndBodySphFluid::SortGrids(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - SortBuckets(threadPool); - SortCellBuckects(threadPool); - -#ifdef _DEBUG - ndWorkingBuffers& data = *m_workingBuffers; - for (ndInt32 i = 0; i < (data.m_hashGridMap.GetCount() - 1); ++i) - { - const ndGridHash& entry0 = data.m_hashGridMap[i + 0]; - const ndGridHash& entry1 = data.m_hashGridMap[i + 1]; - ndUnsigned64 gridHashA = entry0.m_gridHash; - ndUnsigned64 gridHashB = entry1.m_gridHash; - ndAssert(gridHashA <= gridHashB); - } -#endif -} - -//void ndBodySphFluid::BuildBuckets(ndThreadPool* const threadPool) -void ndBodySphFluid::BuildBuckets(ndThreadPool* const) -{ - //#ifdef _DEBUG -#if 0 - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - ndInt32 countReset = ndInt32(data.m_locks.GetCount()); - data.m_pairs.SetCount(m_posit.GetCount()); - data.m_locks.SetCount(m_posit.GetCount()); - data.m_pairCount.SetCount(m_posit.GetCount()); - data.m_kernelDistance.SetCount(m_posit.GetCount()); - for (ndInt32 i = countReset; i < data.m_locks.GetCount(); ++i) - { - data.m_locks[i].Unlock(); - } - for (ndInt32 i = 0; i < data.m_pairCount.GetCount(); ++i) - { - data.m_pairCount[i] = 0; - } - - auto AddPairs = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(AddPairs); - const ndArray& hashGridMap = data.m_hashGridMap; - const ndArray& gridScans = data.m_gridScans; - //const ndFloat32 diameter = ndFloat32(1.5f) * ndFloat32(2.0f) * GetParticleRadius(); - const ndFloat32 diameter = data.m_particleDiameter; - const ndFloat32 diameter2 = diameter * diameter; - const ndInt32 windowsTest = data.WorldToGrid(ndVector(data.m_worlToGridOrigin + diameter)) + 1; - - ndArray& locks = data.m_locks; - ndArray& pairCount = data.m_pairCount; - ndArray& pair = data.m_pairs; - ndArray& distance = data.m_kernelDistance; - - auto ProccessCell = [this, &data, &hashGridMap, &pair, &pairCount, &locks, &distance, windowsTest, diameter2](ndInt32 start, ndInt32 count) - { - const ndInt32 count0 = count - 1; - for (ndInt32 i = 0; i < count0; ++i) - { - const ndGridHash hash0 = hashGridMap[start + i]; - const ndInt32 particle0 = ndInt32(hash0.m_particleIndex); - const ndInt32 x0 = data.WorldToGrid(m_posit[particle0]); - const bool homeGridTest0 = (hash0.m_cellType == ndGridHash::m_homeGrid); - for (ndInt32 j = i + 1; j < count; ++j) - { - const ndGridHash hash1 = hashGridMap[start + j]; - const ndInt32 particle1 = ndInt32(hash1.m_particleIndex); - ndAssert(particle0 != particle1); - const ndInt32 x1 = data.WorldToGrid(m_posit[particle1]); - const ndInt32 sweeptTest = ((x1 - x0) >= windowsTest); - if (sweeptTest) - { - break; - } - ndAssert(particle0 != particle1); - const bool homeGridTest1 = (hash1.m_cellType == ndGridHash::m_homeGrid); - const ndInt32 test = homeGridTest0 | homeGridTest1; - if (test) - { - const ndVector p1p0(m_posit[particle0] - m_posit[particle1]); - const ndFloat32 dist2(p1p0.DotProduct(p1p0).GetScalar()); - if (dist2 <= diameter2) - { - const ndFloat32 dist = ndSqrt(ndMax(dist2, ndFloat32(1.0e-8f))); - { - ndSpinLock lock(locks[particle0]); - ndInt8 neigborCount = pairCount[particle0]; - if (neigborCount < D_PARTICLE_BUCKET_SIZE) - { - ndInt8 isUnique = 1; - ndInt32* const neighborg = pair[particle0].m_neighborg; - for (ndInt32 k = neigborCount - 1; k >= 0; --k) - { - isUnique = isUnique & (neighborg[k] != particle1); - } - //ndAssert(isUnique); - - neighborg[neigborCount] = particle1; - distance[particle0].m_dist[neigborCount] = dist; - pairCount[particle0] = neigborCount + isUnique; - } - } - - { - ndSpinLock lock(locks[particle1]); - ndInt8 neigborCount = pairCount[particle1]; - if (neigborCount < D_PARTICLE_BUCKET_SIZE) - { - ndInt8 isUnique = 1; - ndInt32* const neighborg = pair[particle1].m_neighborg; - for (ndInt32 k = neigborCount - 1; k >= 0; --k) - { - isUnique = isUnique & (neighborg[k] != particle0); - } - //ndAssert(isUnique); - - neighborg[neigborCount] = particle0; - distance[particle1].m_dist[neigborCount] = dist; - pairCount[particle1] = neigborCount + isUnique; - } - } - } - } - } - } - }; - - const ndInt32 scansCount = ndInt32(gridScans.GetCount()) - 1; - for (ndInt32 i = threadIndex; i < scansCount; i += threadCount) - { - const ndInt32 start = gridScans[i]; - const ndInt32 count = gridScans[i + 1] - start; - ProccessCell(start, count); - } - }); - - auto AddPairs_new = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(AddPairs); - const ndArray& hashGridMap = data.m_hashGridMap; - const ndArray& gridScans = data.m_gridScans; - const ndFloat32 diameter = data.m_particleDiameter; - const ndFloat32 diameter2 = diameter * diameter; - const ndInt32 windowsTest = data.WorldToGrid(ndVector(data.m_worlToGridOrigin + diameter)) + 1; - - ndArray& locks = data.m_locks; - ndArray& pairCount = data.m_pairCount; - ndArray& pair = data.m_pairs; - ndArray& distance = data.m_kernelDistance; - - auto ProccessCell = [this, &data, &hashGridMap, &pair, &pairCount, &locks, &distance, windowsTest, diameter2](ndInt32 start, ndInt32 count) - { - const ndInt32 count0 = count - 1; - for (ndInt32 i = 0; i < count0; ++i) - { - const ndGridHash hash0 = hashGridMap[start + i]; - const ndInt32 particle0 = ndInt32(hash0.m_particleIndex); - const ndInt32 x0 = data.WorldToGrid(m_posit[particle0]); - const bool homeGridTest0 = (hash0.m_cellType == ndGridHash::m_homeGrid); - for (ndInt32 j = i + 1; j < count; ++j) - { - const ndGridHash hash1 = hashGridMap[start + j]; - const ndInt32 particle1 = ndInt32(hash1.m_particleIndex); - ndAssert(particle0 != particle1); - const ndInt32 x1 = data.WorldToGrid(m_posit[particle1]); - const ndInt32 sweeptTest = ((x1 - x0) >= windowsTest); - if (sweeptTest) - { - break; - } - ndAssert(particle0 != particle1); - const ndVector p1p0(m_posit[particle0] - m_posit[particle1]); - const ndFloat32 dist2(p1p0.DotProduct(p1p0).GetScalar()); - if (dist2 < diameter2) - { - const bool homeGridTest1 = (hash1.m_cellType == ndGridHash::m_homeGrid); - if (homeGridTest0 && homeGridTest1) - { - ndInt8 neigborCount0 = pairCount[particle0]; - const ndFloat32 dist = ndSqrt(ndMax(dist2, ndFloat32(1.0e-8f))); - if (neigborCount0 < D_PARTICLE_BUCKET_SIZE) - { - pair[particle0].m_neighborg[neigborCount0] = particle1; - distance[particle0].m_dist[neigborCount0] = dist; - pairCount[particle0] = neigborCount0 + 1; - } - - ndInt8 neigborCount1 = pairCount[particle1]; - if (neigborCount1 < D_PARTICLE_BUCKET_SIZE) - { - pair[particle1].m_neighborg[neigborCount1] = particle0; - distance[particle1].m_dist[neigborCount1] = dist; - pairCount[particle1] = neigborCount1 + 1; - } - - } - else if (homeGridTest0) - { - ndAssert(!homeGridTest1); - ndInt8 neigborCount0 = pairCount[particle0]; - const ndFloat32 dist = ndSqrt(ndMax(dist2, ndFloat32(1.0e-8f))); - if (neigborCount0 < D_PARTICLE_BUCKET_SIZE) - { - pair[particle0].m_neighborg[neigborCount0] = particle1; - distance[particle0].m_dist[neigborCount0] = dist; - pairCount[particle0] = neigborCount0 + 1; - } - } - else if (homeGridTest1) - { - ndAssert(!homeGridTest0); - ndInt8 neigborCount1 = pairCount[particle1]; - const ndFloat32 dist = ndSqrt(ndMax(dist2, ndFloat32(1.0e-8f))); - if (neigborCount1 < D_PARTICLE_BUCKET_SIZE) - { - pair[particle1].m_neighborg[neigborCount1] = particle0; - distance[particle1].m_dist[neigborCount1] = dist; - pairCount[particle1] = neigborCount1 + 1; - } - } - } - } - } - }; - - const ndInt32 scansCount = ndInt32(gridScans.GetCount()) - 1; - for (ndInt32 i = threadIndex; i < scansCount; i += threadCount) - { - const ndInt32 start = gridScans[i]; - const ndInt32 count = gridScans[i + 1] - start; - ProccessCell(start, count); - } - }); - - ndTree filter; - for (ndInt32 i = 0; i < data.m_hashGridMap.GetCount(); ++i) - { - if (data.m_hashGridMap[i].m_cellType == ndGridHash::m_homeGrid) - { - ndAssert(filter.Insert(ndInt32(data.m_hashGridMap[i].m_particleIndex))); - } - } - - - threadPool->ParallelExecute(AddPairs); - //threadPool->ParallelExecute(AddPairs_new); -#endif -} - -void ndBodySphFluid::CalculateParticlesDensity(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - data.m_density.SetCount(m_posit.GetCount()); - data.m_invDensity.SetCount(m_posit.GetCount()); - - auto CalculateDensity = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CalculateDensity); - const ndArray& posit = m_posit; - - const ndFloat32 h = data.m_particleDiameter; - const ndFloat32 h2 = h * h; - const ndFloat32 kernelConst = ndFloat32(315.0f) / (ndFloat32(64.0f) * ndPi * ndPow(h, ndFloat32 (9.0f))); - const ndFloat32 kernelMassConst = m_mass * kernelConst; - //const ndFloat32 selfDensity = kernelConst * h2 * h2 * h2; - const ndFloat32 selfVolume = h2 * h2 * h2; - - const ndStartEnd startEnd(ndInt32(posit.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndInt32 count = data.m_pairCount[i]; - const ndParticleKernelDistance& distance = data.m_kernelDistance[i]; - //ndFloat32 density = selfDensity; - ndFloat32 volume = selfVolume; - for (ndInt32 j = 0; j < count; ++j) - { - const ndFloat32 dist = distance.m_dist[j]; - const ndFloat32 dist2 = h2 - dist * dist; - ndAssert(dist2 >= ndFloat32(0.0f)); - const ndFloat32 dist6 = dist2 * dist2 * dist2; - //density += kernelConst * dist6; - volume += dist6; - } - //density = kernelConst * density; - ndFloat32 density = kernelMassConst * volume; - data.m_density[i] = density; - data.m_invDensity[i] = ndFloat32(1.0f) / density; - } - }); - - threadPool->ParallelExecute(CalculateDensity); -} - -void ndBodySphFluid::CalculateAccelerations(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - data.m_accel.SetCount(m_posit.GetCount()); - - auto CalculateAcceleration = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CalculateAcceleration); - const ndVector epsilon2(ndFloat32(1.0e-12f)); - - const ndArray& veloc = m_veloc; - const ndArray& posit = m_posit; - const ndFloat32* const density = &data.m_density[0]; - const ndFloat32* const invDensity = &data.m_invDensity[0]; - - //const ndFloat32 u = m_viscosity; - const ndFloat32 h = data.m_particleDiameter; - const ndVector kernelConst(ndFloat32(45.0f) / (ndPi * ndPow(h, ndFloat32 (6.0f)))); - - //const ndFloat32 viscosity = m_viscosity; - const ndFloat32 restDensity = m_restDensity; - const ndFloat32 gasConstant = m_gasConstant; - - //const ndVector gravity(m_gravity); - const ndVector gravity(ndVector::m_zero); - const ndStartEnd startEnd(ndInt32(posit.GetCount()), threadIndex, threadCount); - for (ndInt32 i0 = startEnd.m_start; i0 < startEnd.m_end; ++i0) - { - const ndVector p0(posit[i0]); - const ndVector v0(veloc[i0]); - ndVector forceAcc(ndVector::m_zero); - - const ndParticlePair& pairs = data.m_pairs[i0]; - ndParticleKernelDistance& distance = data.m_kernelDistance[i0]; - const ndFloat32 pressureI0 = gasConstant * (density[i0] - restDensity); - - const ndInt32 count = data.m_pairCount[i0]; - for (ndInt32 j = 0; j < count; ++j) - { - const ndInt32 i1 = pairs.m_neighborg[j]; - const ndVector p10(p0 - posit[i1]); - //const ndVector p10(posit[i1] - p0); - const ndVector dot(p10.DotProduct(p10) + epsilon2); - const ndVector unitDir(p10 * dot.InvSqrt()); - - ndAssert(p10.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(ndSqrt (dot.GetScalar()) - distance.m_dist[j]) < ndFloat32(1.0e-4f)); - - // kernel distance - const ndFloat32 dist = h - distance.m_dist[j]; - ndAssert(dist >= ndFloat32(0.0f)); - const ndFloat32 kernelValue = dist * dist; - - // calculate pressure - const ndFloat32 pressureI1 = gasConstant * (density[i1] - restDensity); - const ndFloat32 averagePressure = ndFloat32 (0.5f) * invDensity[i1] * (pressureI1 + pressureI0); - const ndVector forcePresure(m_mass * averagePressure * kernelValue); - - //// calculate viscosity acceleration - //const ndVector v01(veloc[i1] - v0); - //forceAcc += v01 * ndVector(kernelDist * viscosity * invDensity[j]); - - const ndVector force(forcePresure * unitDir); - forceAcc += force; - } - - const ndVector accel(gravity + forceAcc); - //const ndVector accel(gravity + ndVector(invDensity[i0]) * forceAcc); - data.m_accel[i0] = accel; - } - }); - - threadPool->ParallelExecute(CalculateAcceleration); -} - -void ndBodySphFluid::IntegrateParticles(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - auto IntegrateParticles = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(IntegrateParticles); - const ndArray& accel = data.m_accel; - ndArray& veloc = m_veloc; - ndArray& posit = m_posit; - - //const ndVector timestep (ndFloat32 (0.003f)); - //const ndVector timestep(m_timestep); - //const ndVector timestep(m_timestep * 0.5f); - const ndVector timestep(m_timestep * 0.25f); - - const ndStartEnd startEnd(ndInt32(posit.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - veloc[i] = veloc[i] + accel[i] * timestep; - posit[i] = posit[i] + veloc[i] * timestep; - if (posit[i].m_y <= 1.0f) - { - posit[i].m_y = 1.0f; - veloc[i].m_y = 0.0f; - } - } - }); - - threadPool->ParallelExecute(IntegrateParticles); -} - -void ndBodySphFluid::CaculateAabb(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - class ndBox - { - public: - ndBox() - :m_min(ndFloat32(1.0e10f)) - , m_max(ndFloat32(-1.0e10f)) - { - } - ndVector m_min; - ndVector m_max; - }; - - ndBox boxes[D_MAX_THREADS_COUNT]; - auto CalculateAabb = ndMakeObject::ndFunction([this, &boxes](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CalculateAabb); - ndBox box; - const ndArray& posit = m_posit; - const ndStartEnd startEnd(ndInt32(posit.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - box.m_min = box.m_min.GetMin(posit[i]); - box.m_max = box.m_max.GetMax(posit[i]); - } - boxes[threadIndex] = box; - }); - - threadPool->ParallelExecute(CalculateAabb); - - ndBox box; - const ndInt32 threadCount = threadPool->GetThreadCount(); - for (ndInt32 i = 0; i < threadCount; ++i) - { - box.m_min = box.m_min.GetMin(boxes[i].m_min); - box.m_max = box.m_max.GetMax(boxes[i].m_max); - } - - ndWorkingBuffers& data = *m_workingBuffers; - const ndFloat32 diameter = ndFloat32(2.0f) * GetParticleRadius(); - const ndFloat32 gridSize = ndFloat32(4.0f) * diameter * D_GRID_SIZE_SCALER; - - data.m_hashGridSize = gridSize; - data.m_particleDiameter = diameter; - data.m_hashInvGridSize = ndFloat32(1.0f) / gridSize; - - const ndVector grid(data.m_hashGridSize); - const ndVector invGrid(data.m_hashInvGridSize); - - // add one grid padding to the aabb - box.m_min -= grid; - box.m_max += (grid + grid); - - // quantize the aabb to integers of the gird size - box.m_min = grid * (box.m_min * invGrid).Floor(); - box.m_max = grid * (box.m_max * invGrid).Floor(); - - // make sure the w component is zero. - m_box0 = box.m_min & ndVector::m_triplexMask; - m_box1 = box.m_max & ndVector::m_triplexMask; - data.SetWorldToGridMapping(gridSize, m_box1, m_box0); -} - -void ndBodySphFluid::CreateGrids(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - class ndGridNeighborInfo - { - public: - ndGridNeighborInfo() - { - //ndGridHash stepsCode; - m_neighborDirs[0][0] = ndGridHash(0, 0); - m_neighborDirs[0][1] = ndGridHash(0, 0); - m_neighborDirs[0][2] = ndGridHash(0, 0); - m_neighborDirs[0][3] = ndGridHash(0, 0); - - m_counter[0] = 1; - m_isPadd[0][0] = 0; - m_isPadd[0][1] = 1; - m_isPadd[0][2] = 1; - m_isPadd[0][3] = 1; - - //ndGridHash stepsCode_y; - m_neighborDirs[1][0] = ndGridHash(0, 0); - m_neighborDirs[1][1] = ndGridHash(1, 0); - m_neighborDirs[1][2] = ndGridHash(0, 0); - m_neighborDirs[1][3] = ndGridHash(0, 0); - - m_counter[1] = 2; - m_isPadd[1][0] = 0; - m_isPadd[1][1] = 0; - m_isPadd[1][2] = 1; - m_isPadd[1][3] = 1; - - //ndGridHash stepsCode_z; - m_neighborDirs[2][0] = ndGridHash(0, 0); - m_neighborDirs[2][1] = ndGridHash(0, 1); - m_neighborDirs[2][2] = ndGridHash(0, 0); - m_neighborDirs[2][3] = ndGridHash(0, 0); - - m_counter[2] = 2; - m_isPadd[2][0] = 0; - m_isPadd[2][1] = 0; - m_isPadd[2][2] = 1; - m_isPadd[2][3] = 1; - - //ndGridHash stepsCode_yz; - m_neighborDirs[3][0] = ndGridHash(0, 0); - m_neighborDirs[3][1] = ndGridHash(1, 0); - m_neighborDirs[3][2] = ndGridHash(0, 1); - m_neighborDirs[3][3] = ndGridHash(1, 1); - - m_counter[3] = 4; - m_isPadd[3][0] = 0; - m_isPadd[3][1] = 0; - m_isPadd[3][2] = 0; - m_isPadd[3][3] = 0; - } - - ndGridHash m_neighborDirs[4][4]; - ndInt8 m_isPadd[4][4]; - ndInt8 m_counter[4]; - }; - - ndGridNeighborInfo neiborghood; - ndWorkingBuffers& data = *m_workingBuffers; - - auto CountGrids = ndMakeObject::ndFunction([this, &data, &neiborghood](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CountGrids); - const ndVector origin(m_box0); - const ndVector invGridSize(data.m_hashInvGridSize); - const ndVector particleBox(data.m_particleDiameter); - - const ndVector* const posit = &m_posit[0]; - ndInt32* const scans = &data.m_gridScans[0]; - - const ndStartEnd startEnd(ndInt32(m_posit.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndVector gridPosit(posit[i] - origin); - const ndVector p0(gridPosit - particleBox); - const ndVector p1(gridPosit + particleBox); - const ndGridHash box0Hash(p0 * invGridSize, i); - const ndGridHash box1Hash(p1 * invGridSize, i); - const ndGridHash codeHash(box1Hash.m_gridHash - box0Hash.m_gridHash); - -#ifdef D_USE_YZ_PLANE_BUCKETS - ndAssert(codeHash.m_y <= 1); - ndAssert(codeHash.m_z <= 1); - const ndUnsigned32 code = ndUnsigned32(codeHash.m_z * 2 + codeHash.m_y); -#else - ndAssert(codeHash.m_x <= 1); - ndAssert(codeHash.m_z <= 1); - const ndUnsigned32 code = ndUnsigned32(codeHash.m_z * 2 + codeHash.m_x); -#endif - scans[i] = neiborghood.m_counter[code]; - } - }); - - auto CreateGrids = ndMakeObject::ndFunction([this, &data, &neiborghood](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CreateGrids); - const ndVector origin(m_box0); - ndGridHash* const dst = &data.m_hashGridMap[0]; - const ndInt32* const scans = &data.m_gridScans[0]; - const ndVector* const posit = &m_posit[0]; - const ndVector invGridSize(data.m_hashInvGridSize); - const ndVector particleBox(data.m_particleDiameter); - - const ndStartEnd startEnd(ndInt32(m_posit.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndVector gridPosit(posit[i] - origin); - const ndVector gridPosit0(gridPosit - particleBox); - const ndVector gridPosit1(gridPosit + particleBox); - const ndGridHash centerHash(gridPosit * invGridSize, i); - const ndGridHash box0Hash(gridPosit0 * invGridSize, i); - const ndGridHash box1Hash(gridPosit1 * invGridSize, i); - const ndGridHash codeHash(box1Hash.m_gridHash - box0Hash.m_gridHash); - - const ndInt32 base = scans[i]; - const ndInt32 count = scans[i + 1] - base; - -#ifdef D_USE_YZ_PLANE_BUCKETS - ndAssert(codeHash.m_y <= 1); - ndAssert(codeHash.m_z <= 1); - const ndInt32 code = ndInt32(codeHash.m_z * 2 + codeHash.m_y); -#else - ndAssert(codeHash.m_x <= 1); - ndAssert(codeHash.m_z <= 1); - const ndInt32 code = ndInt32(codeHash.m_z * 2 + codeHash.m_x); -#endif - const ndGridHash* const neigborgh = &neiborghood.m_neighborDirs[code][0]; - ndAssert(count == neiborghood.m_counter[code]); - for (ndInt32 j = 0; j < count; ++j) - { - ndGridHash quadrand(box0Hash); - quadrand.m_gridHash += neigborgh[j].m_gridHash; - quadrand.m_cellType = ndGridHash::ndGridType(quadrand.m_gridHash == centerHash.m_gridHash); - ndAssert(quadrand.m_cellType == ((quadrand.m_gridHash == centerHash.m_gridHash) ? ndGridHash::m_homeGrid : ndGridHash::m_adjacentGrid)); - dst[base + j] = quadrand; - } - } - }); - - data.m_gridScans.SetCount(m_posit.GetCount() + 1); - data.m_gridScans[m_posit.GetCount()] = 0; - threadPool->ParallelExecute(CountGrids); - - ndInt32 gridCount = 0; - const ndInt32 itemsCount = ndInt32 (data.m_gridScans.GetCount()) & (-8); - for (ndInt32 i = 0; i < itemsCount; i += 8) - { - for (ndInt32 j = 0; j < 8; ++j) - { - ndInt32 count = data.m_gridScans[i + j]; - data.m_gridScans[i + j] = gridCount; - gridCount += count; - } - } - for (ndInt32 j = itemsCount; j < data.m_gridScans.GetCount(); ++j) - { - ndInt32 count = data.m_gridScans[j]; - data.m_gridScans[j] = gridCount; - gridCount += count; - } - - data.m_hashGridMap.SetCount(gridCount); - threadPool->ParallelExecute(CreateGrids); - data.m_hashGridMapScratchBuffer.SetCount(gridCount); - - //ndAssert(TraceHashes()); -} - -bool ndBodySphFluid::TraceHashes() const -{ -#if 0 - ndWorkingBuffers& data = *m_workingBuffers; - ndGridHash* xxxx = &data.m_hashGridMap[0]; - for (int i = 0; i < data.m_hashGridMap.GetCount(); i++) - { - ndTrace(("id(%d)\tx(%d)\tz(%d)\n", xxxx[i].m_particleIndex, xxxx[i].m_x, xxxx[i].m_z)); - } -#endif - - return true; -} - -void ndBodySphFluid::Update(const ndScene* const scene, ndFloat32 timestep) -{ - if (TaskState() == ndBackgroundTask::m_taskCompleted) - { - if (m_posit.GetCount()) - { - m_timestep = timestep; - ((ndScene*)scene)->SendBackgroundTask(this); - if (!m_updateInBackground) - { - Sync(); - } - } - } -} - -void ndBodySphFluid::Execute(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndAssert(sizeof(ndGridHash) == sizeof(ndUnsigned64)); - - CaculateAabb(threadPool); - CreateGrids(threadPool); - SortGrids(threadPool); - CalculateScans(threadPool); - BuildBuckets(threadPool); - CalculateParticlesDensity(threadPool); - CalculateAccelerations(threadPool); - IntegrateParticles(threadPool); -} - -#endif - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid.h deleted file mode 100644 index 7f0b5840ea..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid.h +++ /dev/null @@ -1,145 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODY_SPH_FLUID_H__ -#define __ND_BODY_SPH_FLUID_H__ - -#include "ndBodyParticleSet.h" - -#ifndef D_USE_NEW_FLUID - -D_MSV_NEWTON_ALIGN_32 -class ndBodySphFluid: public ndBodyParticleSet -{ - public: - D_COLLISION_API ndBodySphFluid(); - D_COLLISION_API virtual ~ndBodySphFluid (); - - ndFloat32 GetViscosity() const; - void SetViscosity(ndFloat32 viscosity); - - //ndFloat32 GetParticleMass() const; - //void SetParticleMass(ndFloat32 mass); - - void SetParticleRadius(ndFloat32 radius); - - ndFloat32 GetRestDensity() const; - void SetRestDensity(ndFloat32 resDensity); - - ndFloat32 GetGasConstant() const; - void SetGasConstant(ndFloat32 gasConst); - - virtual ndBodySphFluid* GetAsBodySphFluid(); - D_COLLISION_API void Execute(ndThreadPool* const threadPool); - - protected: - D_COLLISION_API virtual void Update(const ndScene* const scene, ndFloat32 timestep); - virtual bool RayCast(ndRayCastNotify& callback, const ndFastRay& ray, const ndFloat32 maxT) const; - - private: - class ndGridHash; - class ndParticlePair; - class ndWorkingBuffers; - class ndParticleKernelDistance; - - void SortGrids(ndThreadPool* const threadPool); - void BuildBuckets(ndThreadPool* const threadPool); - void CreateGrids(ndThreadPool* const threadPool); - void CaculateAabb(ndThreadPool* const threadPool); - void SortBuckets(ndThreadPool* const threadPool); - void CalculateScans(ndThreadPool* const threadPool); - void SortCellBuckects(ndThreadPool* const threadPool); - void IntegrateParticles(ndThreadPool* const threadPool); - void CalculateAccelerations(ndThreadPool* const threadPool); - void CalculateParticlesDensity(ndThreadPool* const threadPool); - - bool TraceHashes() const; - - ndWorkingBuffers* m_workingBuffers; - ndFloat32 m_mass; - ndFloat32 m_viscosity; - ndFloat32 m_restDensity; - ndFloat32 m_gasConstant; - -} D_GCC_NEWTON_ALIGN_32 ; - -inline bool ndBodySphFluid::RayCast(ndRayCastNotify&, const ndFastRay&, const ndFloat32) const -{ - return false; -} - -inline ndBodySphFluid* ndBodySphFluid::GetAsBodySphFluid() -{ - return this; -} - -inline ndFloat32 ndBodySphFluid::GetViscosity() const -{ - return m_viscosity; -} - -inline void ndBodySphFluid::SetViscosity(ndFloat32 viscosity) -{ - m_viscosity = viscosity; -} - -//inline ndFloat32 ndBodySphFluid::GetParticleMass() const -//{ -// return m_mass; -//} - -//inline void ndBodySphFluid::SetParticleMass(ndFloat32 mass) -//{ -// m_mass = mass; -//} - -inline ndFloat32 ndBodySphFluid::GetRestDensity() const -{ - return m_restDensity; -} - -inline void ndBodySphFluid::SetRestDensity(ndFloat32 restDensity) -{ - ndFloat32 r = GetParticleRadius(); - ndFloat32 volume = ndPi * ndFloat32(4.0f / 3.0f) * r * r * r; - m_restDensity = restDensity; - m_mass = volume * m_restDensity; -} - -inline void ndBodySphFluid::SetParticleRadius(ndFloat32 radius) -{ - ndBodyParticleSet::SetParticleRadius(radius); - SetRestDensity(m_restDensity); -} - -inline ndFloat32 ndBodySphFluid::GetGasConstant() const -{ - return m_gasConstant; -} - -inline void ndBodySphFluid::SetGasConstant(ndFloat32 gasConst) -{ - m_gasConstant = gasConst; -} - -#endif - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid_New.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid_New.cpp deleted file mode 100644 index 3e9c3a9b9a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid_New.cpp +++ /dev/null @@ -1,775 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndScene.h" -#include "ndBodySphFluid_New.h" - -#ifdef D_USE_NEW_FLUID - -#define D_SPH_HASH_BITS 7 -#define D_SPH_BUFFER_GRANULARITY 4096 - -#define D_PARTICLE_BUCKET_SIZE 32 -//#define D_GRID_SIZE_SCALER (2.0f) -#define D_GRID_SIZE_SCALER (4.0f) - -class ndBodySphFluid::ndGridHash -{ - public: - enum ndGridType - { - m_adajacent = 0, - m_homeGrid = 1, - }; - - ndGridHash() - { - } - - ndGridHash(ndUnsigned64 gridHash) - :m_gridHash(gridHash) - { - } - - ndGridHash(ndInt32 x, ndInt32 y, ndInt32 z, ndInt32 particleIndex) - { - m_gridHash = 0; - m_x = ndUnsigned64(x); - m_y = ndUnsigned64(y); - m_z = ndUnsigned64(z); - m_particleIndex = ndUnsigned64(particleIndex); - } - - ndGridHash(const ndVector& grid, ndInt32 particleIndex) - { - ndAssert(grid.m_x >= ndFloat32(0.0f)); - ndAssert(grid.m_y >= ndFloat32(0.0f)); - ndAssert(grid.m_z >= ndFloat32(0.0f)); - ndAssert(grid.m_x < ndFloat32(1 << (D_SPH_HASH_BITS * 2))); - ndAssert(grid.m_y < ndFloat32(1 << (D_SPH_HASH_BITS * 2))); - ndAssert(grid.m_z < ndFloat32(1 << (D_SPH_HASH_BITS * 2))); - - ndVector hash(grid.GetInt()); - - m_gridHash = 0; - m_x = ndUnsigned64(hash.m_ix); - m_y = ndUnsigned64(hash.m_iy); - m_z = ndUnsigned64(hash.m_iz); - m_particleIndex = ndUnsigned64(particleIndex); - } - - union - { - struct - { - ndUnsigned64 m_x : D_SPH_HASH_BITS * 2; - ndUnsigned64 m_y : D_SPH_HASH_BITS * 2; - ndUnsigned64 m_z : D_SPH_HASH_BITS * 2; - ndUnsigned64 m_particleIndex : 64 - 3 * 2 * D_SPH_HASH_BITS - 1; - ndUnsigned64 m_cellType : 1; - }; - struct - { - ndUnsigned64 m_xLow : D_SPH_HASH_BITS; - ndUnsigned64 m_xHigh : D_SPH_HASH_BITS; - ndUnsigned64 m_yLow : D_SPH_HASH_BITS; - ndUnsigned64 m_yHigh : D_SPH_HASH_BITS; - ndUnsigned64 m_zLow : D_SPH_HASH_BITS; - ndUnsigned64 m_zHigh : D_SPH_HASH_BITS; - }; - ndUnsigned64 m_gridHash : 3 * 2 * D_SPH_HASH_BITS; - }; -}; - -class ndBodySphFluid::ndParticlePair -{ - public: - ndInt32 m_neighborg[D_PARTICLE_BUCKET_SIZE]; -}; - -class ndBodySphFluid::ndParticleKernelDistance -{ - public: - ndFloat32 m_dist[D_PARTICLE_BUCKET_SIZE]; -}; - -class ndBodySphFluid::ndWorkingBuffers -{ - public: - ndWorkingBuffers() - :m_accel(D_SPH_BUFFER_GRANULARITY) - ,m_pairCount(D_SPH_BUFFER_GRANULARITY) - ,m_gridScans(D_SPH_BUFFER_GRANULARITY) - ,m_density(D_SPH_BUFFER_GRANULARITY) - ,m_invDensity(D_SPH_BUFFER_GRANULARITY) - ,m_pairs(D_SPH_BUFFER_GRANULARITY) - ,m_hashGridMap(D_SPH_BUFFER_GRANULARITY) - ,m_hashGridMapScratchBuffer(D_SPH_BUFFER_GRANULARITY) - ,m_hashGridSize(ndFloat32 (0.0f)) - ,m_hashInvGridSize(ndFloat32(0.0f)) - { - for (ndInt32 i = 0; i < D_MAX_THREADS_COUNT; ++i) - { - m_partialsGridScans[i].Resize(D_SPH_BUFFER_GRANULARITY); - } - } - - ~ndWorkingBuffers() - { - } - - ndArray m_accel; - ndArray m_pairCount; - ndArray m_gridScans; - ndArray m_density; - ndArray m_invDensity; - ndArray m_pairs; - ndArray m_hashGridMap; - ndArray m_hashGridMapScratchBuffer; - ndArray m_kernelDistance; - ndArray m_partialsGridScans[D_MAX_THREADS_COUNT]; - ndFloat32 m_hashGridSize; - ndFloat32 m_hashInvGridSize; -}; - -ndBodySphFluid::ndBodySphFluid() - :ndBodyParticleSet() - ,m_workingBuffers(new ndWorkingBuffers) - ,m_mass(ndFloat32(0.02f)) - ,m_viscosity(ndFloat32 (1.05f)) - ,m_restDensity(ndFloat32(1000.0f)) - ,m_gasConstant(ndFloat32(1.0f)) -{ -} - -ndBodySphFluid::~ndBodySphFluid() -{ - delete m_workingBuffers; -} - -void ndBodySphFluid::CalculateScans(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - ndInt32 sums[D_MAX_THREADS_COUNT + 1]; - ndInt32 scans[D_MAX_THREADS_COUNT + 1]; - - auto CountGridScans = ndMakeObject::ndFunction([&data, &scans](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(CountGridScans); - const ndGridHash* const hashGridMap = &data.m_hashGridMap[0]; - - const ndInt32 start = scans[threadIndex]; - const ndInt32 end = scans[threadIndex + 1]; - ndArray& gridScans = data.m_partialsGridScans[threadIndex]; - ndUnsigned64 gridHash0 = hashGridMap[start].m_gridHash; - - ndInt32 count = 0; - gridScans.SetCount(0); - for (ndInt32 i = start; i < end; ++i) - { - ndUnsigned64 gridHash = hashGridMap[i].m_gridHash; - if (gridHash != gridHash0) - { - gridScans.PushBack(count); - count = 0; - gridHash0 = gridHash; - } - count++; - } - gridScans.PushBack(count); - }); - - auto CalculateScans = ndMakeObject::ndFunction([&data, &scans, &sums](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(CalculateScans); - ndArray& gridScans = data.m_gridScans; - const ndArray& partialScan = data.m_partialsGridScans[threadIndex]; - const ndInt32 base = sums[threadIndex]; - ndInt32 sum = scans[threadIndex]; - for (ndInt32 i = 0; i < partialScan.GetCount(); ++i) - { - gridScans[base + i] = sum; - sum += partialScan[i]; - } - }); - - memset(scans, 0, sizeof(scans)); - const ndInt32 threadCount = threadPool->GetThreadCount(); - - ndInt32 acc0 = 0; - ndInt32 cellsCount = data.m_hashGridMap.GetCount(); - ndInt32 stride = cellsCount / threadCount; - const ndGridHash* const hashGridMap = &data.m_hashGridMap[0]; - for (ndInt32 threadIndex = 0; threadIndex < threadCount; threadIndex++) - { - scans[threadIndex] = acc0; - acc0 += stride; - while (acc0 < cellsCount && (hashGridMap[acc0].m_gridHash == hashGridMap[acc0 - 1].m_gridHash)) - { - acc0++; - } - } - scans[threadCount] = cellsCount; - threadPool->ParallelExecute(CountGridScans); - - ndInt32 scansCount = 0; - for (ndInt32 i = 0; i < threadCount; ++i) - { - sums[i] = scansCount; - scansCount += data.m_partialsGridScans[i].GetCount(); - } - sums[threadCount] = scansCount; - - data.m_gridScans.SetCount(scansCount + 1); - threadPool->ParallelExecute(CalculateScans); - - data.m_gridScans[scansCount] = scans[threadCount]; -} - -void ndBodySphFluid::SortGrids(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - class ndKey_xlow - { - public: - ndKey_xlow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_xLow); - } - }; - - class ndKey_xhigh - { - public: - ndKey_xhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_xHigh); - } - }; - - class ndKey_ylow - { - public: - ndKey_ylow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_yLow); - } - }; - - class ndKey_yhigh - { - public: - ndKey_yhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_yHigh); - } - }; - - class ndKey_zlow - { - public: - ndKey_zlow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_zLow); - } - }; - - class ndKey_zhigh - { - public: - ndKey_zhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return ndInt32(cell.m_zHigh); - } - }; - - ndWorkingBuffers& data = *m_workingBuffers; - const ndVector boxSize((m_box1 - m_box0).Scale(data.m_hashInvGridSize).GetInt()); - data.m_hashGridMapScratchBuffer.SetCount(data.m_hashGridMap.GetCount()); - - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - if (boxSize.m_ix > (1 << D_SPH_HASH_BITS)) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - } - - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - if (boxSize.m_iy > (1 << D_SPH_HASH_BITS)) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - } - - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - if (boxSize.m_iz > (1 << D_SPH_HASH_BITS)) - { - ndCountingSort(*threadPool, data.m_hashGridMap, data.m_hashGridMapScratchBuffer, nullptr, nullptr); - } - -#ifdef _DEBUG - for (int i = 1; i < data.m_hashGridMap.GetCount(); ++i) - { - ndGridHash cell0(data.m_hashGridMap[i - 1]); - ndGridHash cell1(data.m_hashGridMap[i + 0]); - ndUnsigned64 key0 = cell0.m_gridHash; - ndUnsigned64 key1 = cell1.m_gridHash; - ndAssert(key0 <= key1); - } -#endif -} - -void ndBodySphFluid::BuildBuckets(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - data.m_pairs.SetCount(m_posit.GetCount()); - - data.m_pairCount.SetCount(m_posit.GetCount()); - data.m_kernelDistance.SetCount(m_posit.GetCount()); - for (ndInt32 i = 0; i < data.m_pairCount.GetCount(); ++i) - { - data.m_pairCount[i] = 0; - } - - auto BuildBuckets = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(AddPairs); - const ndArray& gridScans = data.m_gridScans; - const ndArray& hashGridMap = data.m_hashGridMap; - - const ndFloat32 diameter = ndFloat32 (2.0f) * GetParticleRadius(); - const ndFloat32 diameter2 = diameter * diameter; - ndArray& pairCount = data.m_pairCount; - ndArray& pair = data.m_pairs; - ndArray& distance = data.m_kernelDistance; - - auto ProccessCellInSameGrid = [this, &data, &hashGridMap, &pairCount, &pair, &distance, diameter2](ndInt32 start, ndInt32 count) - { - for (ndInt32 i = count - 1; i > 0; --i) - { - const ndGridHash& grid0(hashGridMap[start + i]); - ndInt32 particle0 = ndInt32(grid0.m_particleIndex); - for (ndInt32 j = i - 1; j >= 0; --j) - { - const ndGridHash& grid1(hashGridMap[start + j]); - ndInt32 particle1 = ndInt32(grid1.m_particleIndex); - - const ndVector p1p0(m_posit[particle0] - m_posit[particle1]); - - ndFloat32 radios2 = p1p0.DotProduct(p1p0).GetScalar(); - if (radios2 < diameter2) - { - radios2 = ndMax(radios2, ndFloat32(1.0e-8f)); - ndFloat32 dist = ndSqrt(radios2); - ndInt8 index0 = pairCount[particle0]; - if (index0 < D_PARTICLE_BUCKET_SIZE) - { - distance[particle0].m_dist[index0] = dist; - pair[particle0].m_neighborg[index0] = ndInt32(particle1); - pairCount[particle0] = index0 + 1; - } - - ndInt8 index1 = pairCount[particle1]; - if (index1 < D_PARTICLE_BUCKET_SIZE) - { - distance[particle1].m_dist[index1] = dist; - pair[particle1].m_neighborg[index1] = ndInt32(particle0); - pairCount[particle1] = index1 + 1; - } - } - } - } - }; - - const ndStartEnd startEnd(gridScans.GetCount() - 1, threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndInt32 start = gridScans[i + 0]; - const ndInt32 count = gridScans[i + 1] - start; - ProccessCellInSameGrid(start, count); - } - }); - - threadPool->ParallelExecute(BuildBuckets); -} - -void ndBodySphFluid::CalculateParticlesDensity(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - data.m_density.SetCount(m_posit.GetCount()); - data.m_invDensity.SetCount(m_posit.GetCount()); - - auto CalculateDensity = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CalculateDensity); - const ndArray& posit = m_posit; - - const ndFloat32 h = ndFloat32 (2.0f) * GetParticleRadius(); - const ndFloat32 h2 = h * h; - const ndFloat32 kernelMagicConst = ndFloat32(315.0f) / (ndFloat32(64.0f) * ndPi * ndPow(h, 9)); - const ndFloat32 kernelConst = m_mass * kernelMagicConst; - const ndFloat32 selfDensity = kernelConst * h2 * h2 * h2; - - const ndStartEnd startEnd(posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndInt32 count = data.m_pairCount[i]; - const ndParticleKernelDistance& distance = data.m_kernelDistance[i]; - ndFloat32 density = selfDensity; - for (ndInt32 j = 0; j < count; ++j) - { - const ndFloat32 d = distance.m_dist[j]; - const ndFloat32 dist2 = h2 - d * d; - ndAssert(dist2 > ndFloat32(0.0f)); - const ndFloat32 dist6 = dist2 * dist2 * dist2; - density += kernelConst * dist6; - } - ndAssert(density > ndFloat32(0.0f)); - data.m_density[i] = density; - data.m_invDensity[i] = ndFloat32(1.0f) / density; - } - }); - - threadPool->ParallelExecute(CalculateDensity); -} - -void ndBodySphFluid::CalculateAccelerations(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - data.m_accel.SetCount(m_posit.GetCount()); - - auto CalculateAcceleration = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CalculateAcceleration); - const ndVector epsilon2 (ndFloat32(1.0e-12f)); - - const ndArray& veloc = m_veloc; - const ndArray& posit = m_posit; - const ndFloat32* const density = &data.m_density[0]; - const ndFloat32* const invDensity = &data.m_invDensity[0]; - - const ndFloat32 h = ndFloat32 (2.0f) * GetParticleRadius(); - //const ndFloat32 u = m_viscosity; - const ndVector kernelConst(m_mass * ndFloat32(45.0f) / (ndPi * ndPow(h, 6))); - - const ndFloat32 viscosity = m_viscosity; - const ndFloat32 restDensity = m_restDensity; - const ndFloat32 gasConstant = ndFloat32(0.5f) * m_gasConstant; - - const ndVector gravity(m_gravity); - const ndStartEnd startEnd(posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i0 = startEnd.m_start; i0 < startEnd.m_end; ++i0) - { - const ndVector p0(posit[i0]); - const ndVector v0(veloc[i0]); - - const ndInt32 count = data.m_pairCount[i0]; - const ndParticlePair& pairs = data.m_pairs[i0]; - ndParticleKernelDistance& distance = data.m_kernelDistance[i0]; - const ndFloat32 pressureI0 = density[i0] - restDensity; - - ndVector forceAcc(ndVector::m_zero); - for (ndInt32 j = 0; j < count; ++j) - { - const ndInt32 i1 = pairs.m_neighborg[j]; - const ndVector p10(posit[i1] - p0); - const ndVector dot(p10.DotProduct(p10) + epsilon2); - const ndVector unitDir(p10 * dot.InvSqrt()); - - ndAssert(unitDir.m_w == ndFloat32(0.0f)); - - // kernel distance - const ndFloat32 dist = distance.m_dist[j]; - const ndFloat32 kernelDist = h - dist; - ndAssert(kernelDist >= ndFloat32(0.0f)); - - // calculate pressure - const ndFloat32 kernelDist2 = kernelDist * kernelDist; - const ndFloat32 pressureI1 = density[i1] - restDensity; - const ndVector force(gasConstant * kernelDist2 * invDensity[i1] * (pressureI0 + pressureI1)); - forceAcc += force * unitDir; - - // calculate viscosity acceleration - const ndVector v01(veloc[i1] - v0); - forceAcc += v01 * ndVector(kernelDist * viscosity * invDensity[j]); - } - const ndVector accel(gravity + ndVector(invDensity[i0]) * kernelConst * forceAcc); - data.m_accel[i0] = accel; - } - }); - - threadPool->ParallelExecute(CalculateAcceleration); -} - -void ndBodySphFluid::IntegrateParticles(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - auto IntegrateParticles = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(IntegrateParticles); - const ndArray& accel = data.m_accel; - ndArray& veloc = m_veloc; - ndArray& posit = m_posit; - - //const ndVector timestep(m_timestep); - //ndVector halfTime(timestep * ndVector::m_half); - const ndVector timestep (ndFloat32 (0.003f)); - - const ndStartEnd startEnd(posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - veloc[i] = veloc[i] + accel[i] * timestep; - posit[i] = posit[i] + veloc[i] * timestep; - if (posit[i].m_y <= 1.0f) - { - posit[i].m_y = 1.0f; - veloc[i].m_y = 0.0f; - } - } - }); - - threadPool->ParallelExecute(IntegrateParticles); -} - -void ndBodySphFluid::CaculateAabb(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - class ndBox - { - public: - ndBox() - :m_min(ndFloat32(1.0e10f)) - ,m_max(ndFloat32(-1.0e10f)) - { - } - ndVector m_min; - ndVector m_max; - }; - - ndBox boxes[D_MAX_THREADS_COUNT]; - auto CalculateAabb = ndMakeObject::ndFunction([this, &boxes](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CalculateAabb); - ndBox box; - const ndArray& posit = m_posit; - const ndStartEnd startEnd(posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - box.m_min = box.m_min.GetMin(posit[i]); - box.m_max = box.m_max.GetMax(posit[i]); - } - boxes[threadIndex] = box; - }); - - threadPool->ParallelExecute(CalculateAabb); - - ndBox box; - const ndInt32 threadCount = threadPool->GetThreadCount(); - for (ndInt32 i = 0; i < threadCount; ++i) - { - box.m_min = box.m_min.GetMin(boxes[i].m_min); - box.m_max = box.m_max.GetMax(boxes[i].m_max); - } - - ndWorkingBuffers& data = *m_workingBuffers; - const ndFloat32 diameter = ndFloat32 (2.0f) * GetParticleRadius(); - const ndFloat32 gridSize = diameter * D_GRID_SIZE_SCALER; - - data.m_hashGridSize = gridSize; - data.m_hashInvGridSize = ndFloat32(1.0f) / gridSize; - - const ndVector grid(data.m_hashGridSize); - const ndVector invGrid(data.m_hashInvGridSize); - - // add one grid padding to the aabb - box.m_min -= grid; - box.m_max += (grid + grid); - - // quantize the aabb to integers of the gird size - box.m_min = grid * (box.m_min * invGrid).Floor(); - box.m_max = grid * (box.m_max * invGrid).Floor(); - - // make sure the w component is zero. - m_box0 = box.m_min & ndVector::m_triplexMask; - m_box1 = box.m_max & ndVector::m_triplexMask; -} - -void ndBodySphFluid::CreateGrids(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndWorkingBuffers& data = *m_workingBuffers; - - auto CountGrids = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CountGrids); - const ndVector origin(m_box0); - const ndVector invGridSize(data.m_hashInvGridSize); - const ndVector particleBox(ndFloat32(1.5f) * GetParticleRadius()); - const ndVector* const posit = &m_posit[0]; - ndInt32* const scans = &data.m_gridScans[0]; - - const ndStartEnd startEnd(m_posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndVector gridPosit(posit[i] - origin); - const ndVector gridPosit0(gridPosit - particleBox); - const ndVector gridPosit1(gridPosit + particleBox); - - //const ndGridHash hash(gridPosit * invGridSize, i); - const ndGridHash box0Hash(gridPosit0 * invGridSize, i); - const ndGridHash box1Hash(gridPosit1 * invGridSize, i); - - ndInt32 dx = ndInt32(box1Hash.m_x - box0Hash.m_x + 1); - ndInt32 dy = ndInt32(box1Hash.m_y - box0Hash.m_y + 1); - ndInt32 dz = ndInt32(box1Hash.m_z - box0Hash.m_z + 1); - ndAssert(dx >= 1); - ndAssert(dy >= 1); - ndAssert(dz >= 1); - ndAssert(dx <= 2); - ndAssert(dy <= 2); - ndAssert(dz <= 2); - ndInt32 count = dz * dy * dx; - scans[i] = count; - } - }); - - auto CreateGrids = ndMakeObject::ndFunction([this, &data](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(CreateGrids); - const ndVector origin(m_box0); - const ndVector invGridSize(data.m_hashInvGridSize); - const ndVector particleBox(ndFloat32(1.5f) * GetParticleRadius()); - const ndVector* const posit = &m_posit[0]; - ndInt32* const scans = &data.m_gridScans[0]; - ndGridHash* const dst = &data.m_hashGridMap[0]; - - const ndStartEnd startEnd(m_posit.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndVector gridPosit(posit[i] - origin); - const ndVector gridPosit0(gridPosit - particleBox); - const ndVector gridPosit1(gridPosit + particleBox); - const ndGridHash centerHash(gridPosit * invGridSize, i); - const ndGridHash box0Hash(gridPosit0 * invGridSize, i); - const ndGridHash box1Hash(gridPosit1 * invGridSize, i); - - ndInt32 base = scans[i]; - for (ndInt32 z = ndInt32(box0Hash.m_z); z <= ndInt32(box1Hash.m_z); z++) - { - for (ndInt32 y = ndInt32(box0Hash.m_y); y <= ndInt32(box1Hash.m_y); y++) - { - for (ndInt32 x = ndInt32(box0Hash.m_x); x <= ndInt32(box1Hash.m_x); x++) - { - ndGridHash hash(x, y, z, i); - hash.m_cellType = (hash.m_gridHash == centerHash.m_gridHash) ? ndGridHash::m_homeGrid : ndGridHash::m_adajacent; - dst[base] = hash; - base++; - } - } - } - ndAssert(base == scans[i + 1]); - } - }); - - data.m_gridScans.SetCount(m_posit.GetCount() + 1); - data.m_gridScans[m_posit.GetCount()] = 0; - threadPool->ParallelExecute(CountGrids); - - ndInt32 gridCount = 0; - const ndInt32 itemsCount = data.m_gridScans.GetCount() & (-8); - for (ndInt32 i = 0; i < itemsCount; i += 8) - { - for (ndInt32 j = 0; j < 8; ++j) - { - ndInt32 count = data.m_gridScans[i + j]; - data.m_gridScans[i + j] = gridCount; - gridCount += count; - } - } - for (ndInt32 j = itemsCount; j < data.m_gridScans.GetCount(); ++j) - { - ndInt32 count = data.m_gridScans[j]; - data.m_gridScans[j] = gridCount; - gridCount += count; - } - - data.m_hashGridMap.SetCount(gridCount); - //data.m_hashGridMapScratchBuffer.SetCount(gridCount); - threadPool->ParallelExecute(CreateGrids); -} - -bool ndBodySphFluid::TraceHashes() const -{ -#if 0 - ndWorkingBuffers& data = *m_workingBuffers; - ndGridHash* xxxx = &data.m_hashGridMap[0]; - for (int i = 0; i < data.m_hashGridMap.GetCount(); i++) - { - ndTrace(("id(%d)\tx(%d)\tz(%d)\n", xxxx[i].m_particleIndex, xxxx[i].m_x, xxxx[i].m_z)); - } -#endif - - return true; -} - -void ndBodySphFluid::Update(const ndScene* const scene, ndFloat32 timestep) -{ - if (TaskState() == ndBackgroundTask::m_taskCompleted) - { - if (m_posit.GetCount()) - { - m_timestep = timestep; - ((ndScene*)scene)->SendBackgroundTask(this); - if (!m_updateInBackground) - { - Sync(); - } - } - } -} - -void ndBodySphFluid::Execute(ndThreadPool* const threadPool) -{ - D_TRACKTIME(); - ndAssert(sizeof(ndGridHash) == sizeof(ndUnsigned64)); - - CaculateAabb(threadPool); - CreateGrids(threadPool); - SortGrids(threadPool); - CalculateScans(threadPool); - BuildBuckets(threadPool); - CalculateParticlesDensity(threadPool); - CalculateAccelerations(threadPool); - IntegrateParticles(threadPool); -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid_New.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid_New.h deleted file mode 100644 index c989a17c61..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodySphFluid_New.h +++ /dev/null @@ -1,144 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODY_SPH_NEW_FLUID_H__ -#define __ND_BODY_SPH_NEW_FLUID_H__ - -#include "ndBodyParticleSet.h" - -#ifdef D_USE_NEW_FLUID - -D_MSV_NEWTON_ALIGN_32 -class ndBodySphFluid: public ndBodyParticleSet -{ - public: - D_COLLISION_API ndBodySphFluid(); - D_COLLISION_API virtual ~ndBodySphFluid (); - - ndFloat32 GetViscosity() const; - void SetViscosity(ndFloat32 viscosity); - - ndFloat32 GetRestDensity() const; - void SetRestDensity(ndFloat32 resDensity); - - ndFloat32 GetGasConstant() const; - void SetGasConstant(ndFloat32 gasConst); - void SetParticleRadius(ndFloat32 radius); - virtual ndBodySphFluid* GetAsBodySphFluid(); - - D_COLLISION_API void Execute(ndThreadPool* const threadPool); - - protected: - D_COLLISION_API virtual void Update(const ndScene* const scene, ndFloat32 timestep); - virtual bool RayCast(ndRayCastNotify& callback, const ndFastRay& ray, const ndFloat32 maxT) const; - - private: - enum ndGridType - { - ndAdjacentGrid = 0, - ndHomeGrid = 1, - }; - - class ndGridHash; - class ndParticlePair; - class ndWorkingBuffers; - class ndParticleKernelDistance; - - void SortGrids(ndThreadPool* const threadPool); - void CreateGrids(ndThreadPool* const threadPool); - void BuildBuckets(ndThreadPool* const threadPool); - void CaculateAabb(ndThreadPool* const threadPool); - void CalculateScans(ndThreadPool* const threadPool); - void IntegrateParticles(ndThreadPool* const threadPool); - void CalculateAccelerations(ndThreadPool* const threadPool); - void CalculateParticlesDensity(ndThreadPool* const threadPool); - - bool TraceHashes() const; - - ndWorkingBuffers* m_workingBuffers; - ndFloat32 m_mass; - ndFloat32 m_viscosity; - ndFloat32 m_restDensity; - ndFloat32 m_gasConstant; - -} D_GCC_NEWTON_ALIGN_32 ; - -inline bool ndBodySphFluid::RayCast(ndRayCastNotify&, const ndFastRay&, const ndFloat32) const -{ - return false; -} - -inline ndBodySphFluid* ndBodySphFluid::GetAsBodySphFluid() -{ - return this; -} - -inline ndFloat32 ndBodySphFluid::GetViscosity() const -{ - return m_viscosity; -} - -inline void ndBodySphFluid::SetViscosity(ndFloat32 viscosity) -{ - m_viscosity = viscosity; -} - -inline ndFloat32 ndBodySphFluid::GetParticleMass() const -{ - return m_mass; -} - -inline void ndBodySphFluid::SetParticleMass(ndFloat32 mass) -{ - m_mass = mass; -} - -inline ndFloat32 ndBodySphFluid::GetRestDensity() const -{ - return m_restDensity; -} - -inline void ndBodySphFluid::SetRestDensity(ndFloat32 restDensity) -{ - ndFloat32 r = GetParticleRadius(); - ndFloat32 volume = ndPi * ndFloat32(4.0f / 3.0f) * r * r * r; - m_restDensity = restDensity; - m_mass = volume * m_restDensity; -} - -inline void ndBodySphFluid::SetParticleRadius(ndFloat32 radius) -{ - ndBodyParticleSet::SetParticleRadius(radius); - SetRestDensity(m_restDensity); -} - -inline ndFloat32 ndBodySphFluid::GetGasConstant() const -{ - return m_gasConstant; -} - -inline void ndBodySphFluid::SetGasConstant(ndFloat32 gasConst) -{ - m_gasConstant = gasConst; -} -#endif - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyTriggerVolume.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyTriggerVolume.cpp deleted file mode 100644 index f2679b85a0..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyTriggerVolume.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndBodyTriggerVolume.h" - -ndBodyTriggerVolume::ndBodyTriggerVolume() - :ndBodyKinematicBase() -{ -} - -ndBodyTriggerVolume::~ndBodyTriggerVolume() -{ -} - -void ndBodyTriggerVolume::SpecialUpdate(ndFloat32 timestep) -{ - const ndContactMap& contactMap = GetContactMap(); - - ndBodyKinematic::ndContactMap::Iterator it(contactMap); - for (it.Begin(); it; it++) - { - const ndContact* const contact = *it; - if (contact->IsActive() && contact->IsInTrigger()) - { - ndBodyKinematic* const body0 = contact->GetBody0(); - ndBodyKinematic* const body1 = contact->GetBody1(); - OnTrigger((body1 == this) ? body0 : body1, timestep); - } - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyTriggerVolume.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyTriggerVolume.h deleted file mode 100644 index 8e47748c98..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBodyTriggerVolume.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODY_TRIGGER_VOLUME_H__ -#define __ND_BODY_TRIGGER_VOLUME_H__ - -#include "ndCollisionStdafx.h" -#include "ndBodyKinematicBase.h" - -D_MSV_NEWTON_ALIGN_32 -class ndBodyTriggerVolume : public ndBodyKinematicBase -{ - public: - D_CLASS_REFLECTION(ndBodyTriggerVolume, ndBodyKinematicBase) - D_COLLISION_API ndBodyTriggerVolume(); - D_COLLISION_API virtual ~ndBodyTriggerVolume(); - - ndBodyTriggerVolume* GetAsBodyTriggerVolume(); - - virtual void OnTrigger(ndBodyKinematic* const body, ndFloat32 timestep); - virtual void OnTriggerEnter(ndBodyKinematic* const body, ndFloat32 timestep); - virtual void OnTriggerExit(ndBodyKinematic* const body, ndFloat32 timestep); - - D_COLLISION_API virtual void SpecialUpdate(ndFloat32 timestep); - - private: - virtual void IntegrateExternalForce(ndFloat32 timestep); - -} D_GCC_NEWTON_ALIGN_32; - -inline ndBodyTriggerVolume* ndBodyTriggerVolume::GetAsBodyTriggerVolume() -{ - return this; -} - -inline void ndBodyTriggerVolume::OnTriggerEnter(ndBodyKinematic* const, ndFloat32) -{ - //dAssert(0); -} - -inline void ndBodyTriggerVolume::OnTrigger(ndBodyKinematic* const, ndFloat32) -{ - //dAssert(0); -} - -inline void ndBodyTriggerVolume::OnTriggerExit(ndBodyKinematic* const, ndFloat32) -{ - //dAssert(0); -} - -inline void ndBodyTriggerVolume::IntegrateExternalForce(ndFloat32) -{ -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBvhNode.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBvhNode.cpp deleted file mode 100644 index 5c7f052c04..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBvhNode.cpp +++ /dev/null @@ -1,1431 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndBvhNode.h" -#include "ndBodyKinematic.h" - -#define D_AABB_QUANTIZATION ndFloat32 (4.0f) -#define D_AABB_INV_QUANTIZATION (ndFloat32 (1.0f) / D_AABB_QUANTIZATION) - -ndVector ndBvhNode::m_aabbQuantization(D_AABB_QUANTIZATION, D_AABB_QUANTIZATION, D_AABB_QUANTIZATION, ndFloat32 (0.0f)); -ndVector ndBvhNode::m_aabbInvQuantization(D_AABB_INV_QUANTIZATION, D_AABB_INV_QUANTIZATION, D_AABB_INV_QUANTIZATION, ndFloat32(0.0f)); - -ndBvhLeafNode::ndBvhLeafNode(ndBodyKinematic* const body) - :ndBvhNode(nullptr) - ,m_body(body) -{ -#ifdef _DEBUG - static ndInt32 nodeId = 0; - m_nodeId = nodeId; - nodeId++; -#endif - - SetAabb(body->m_minAabb, body->m_maxAabb); -} - -ndBvhLeafNode::ndBvhLeafNode(const ndBvhLeafNode& src) - :ndBvhNode(src) - ,m_body(src.m_body) -{ -#ifdef _DEBUG - m_nodeId = src.m_nodeId; -#endif - SetAabb(src.m_minBox, src.m_maxBox); -} - -ndBvhLeafNode::~ndBvhLeafNode() -{ -} - -ndBvhNode* ndBvhLeafNode::Clone() const -{ - ndBvhNode* const node = new ndBvhLeafNode(*this); - return node; -} - -ndBvhInternalNode::ndBvhInternalNode() - :ndBvhNode(nullptr) - ,m_left(nullptr) - ,m_right(nullptr) -{ -#ifdef _DEBUG - static ndInt32 nodeId = 1000000; - m_nodeId = nodeId; - nodeId++; -#endif -} - -ndBvhInternalNode::ndBvhInternalNode(const ndBvhInternalNode& src) - :ndBvhNode(src) - ,m_left(nullptr) - ,m_right(nullptr) -{ -#ifdef _DEBUG - m_nodeId = src.m_nodeId; -#endif -} - -ndBvhNode* ndBvhInternalNode::Clone() const -{ - ndBvhNode* const node = new ndBvhInternalNode(*this); - return node; -} - -ndBvhInternalNode::~ndBvhInternalNode() -{ -} - -bool ndBvhInternalNode::SanityCheck(ndUnsigned32 level) const -{ - ndAssert(m_left->m_parent == this); - ndAssert(m_right->m_parent == this); - - ndBvhNode::SanityCheck(level); - m_left->SanityCheck(level + 1); - m_right->SanityCheck(level + 1); - return true; -} - -#ifdef _DEBUG -bool ndBvhNode::SanityCheck(ndUnsigned32 level) const -{ - char margin[512]; - level = ndMin(level, ndUnsigned32(sizeof(margin) / 2 - 1)); - - for (ndUnsigned32 i = 0; i < level; ++i) - { - margin[i * 2] = ' '; - margin[i * 2 + 1] = ' '; - } - margin[level * 2] = 0; - //if (GetBody()) - //{ - // ndTrace(("%s nodeId:%d depth:%d id:%d\n", margin, m_nodeId, m_depthLevel, GetBody()->GetId())); - //} - //else - //{ - // ndTrace(("%s nodeId:%d depth:%d\n", margin, m_nodeId, m_depthLevel)); - //} - ndAssert(!m_parent || (m_depthLevel < m_parent->m_depthLevel)); - ndAssert(!m_parent || ndBoxInclusionTest(m_minBox, m_maxBox, m_parent->m_minBox, m_parent->m_maxBox)); - return true; -} - -#else -bool ndBvhNode::SanityCheck(ndUnsigned32) const -{ - return true; -} -#endif - - -ndBvhNodeArray::ndBvhNodeArray() - :ndArray(1024) - ,m_isDirty(1) - ,m_scansCount(0) -{ -} - -ndBvhNodeArray::ndBvhNodeArray(const ndBvhNodeArray& src) - :ndArray(1024) - ,m_isDirty(1) - ,m_scansCount(0) -{ - Swap((ndBvhNodeArray&)src); -} - -ndBvhNodeArray::~ndBvhNodeArray() -{ - CleanUp(); -} - -void ndBvhNodeArray::CleanUp() -{ - for (ndInt32 i = ndInt32(GetCount()) - 1; i >= 0; --i) - { - ndBvhNode* const node = (*this)[i]; - ndAssert(node->m_isDead); - delete node; - } - SetCount(0); -} - -void ndBvhNodeArray::Swap(ndBvhNodeArray& src) -{ - ndArray::Swap(src); - - ndSwap(m_isDirty, src.m_isDirty); - ndSwap(m_scansCount, src.m_scansCount); - for (ndInt32 i = 0; i < ndInt32 (sizeof(m_scans) / sizeof(m_scans[0])); ++i) - { - ndSwap(m_scans[i], src.m_scans[i]); - } -} - -ndBvhSceneManager::ndBvhSceneManager() - :m_workingArray() - ,m_bvhBuildState() -{ -} - -ndBvhSceneManager::ndBvhSceneManager(const ndBvhSceneManager& src) - :m_workingArray(src.m_workingArray) - ,m_bvhBuildState(src.m_bvhBuildState) -{ -} - -ndBvhSceneManager::~ndBvhSceneManager() -{ - CleanUp(); -} - -ndBvhNode* ndBvhSceneManager::AddBody(ndBodyKinematic* const body, ndBvhNode* root) -{ - m_workingArray.m_isDirty = 1; - ndBvhLeafNode* const bodyNode = new ndBvhLeafNode(body); - ndBvhInternalNode* sceneNode = new ndBvhInternalNode(); - - sceneNode->m_isDead = 0; - m_workingArray.PushBack(sceneNode); - body->m_sceneNodeIndex = ndInt32(m_workingArray.GetCount()) - 1; - - bodyNode->m_isDead = 0; - m_workingArray.PushBack(bodyNode); - body->m_bodyNodeIndex = ndInt32(m_workingArray.GetCount()) - 1; - - if (m_workingArray.GetCount() > 2) - { - ndAssert(root); - ndBvhInternalNode* childNode = sceneNode; - childNode->m_minBox = bodyNode->m_minBox; - childNode->m_maxBox = bodyNode->m_maxBox; - childNode->m_left = bodyNode; - bodyNode->m_parent = childNode; - - ndUnsigned32 depth = 0; - ndBvhNode* rootNode = root; - ndBvhNode* parent = rootNode; - while (1) - { - sceneNode = parent->GetAsSceneTreeNode(); - if (sceneNode && ndBoxInclusionTest(childNode->m_minBox, childNode->m_maxBox, parent->m_minBox, parent->m_maxBox)) - { - const ndVector minLeftBox (sceneNode->m_left->m_minBox.GetMin(childNode->m_minBox)); - const ndVector maxLeftBox (sceneNode->m_left->m_maxBox.GetMax(childNode->m_maxBox)); - const ndVector minRightBox(sceneNode->m_right->m_minBox.GetMin(childNode->m_minBox)); - const ndVector maxRightBox(sceneNode->m_right->m_maxBox.GetMax(childNode->m_maxBox)); - const ndVector leftSize(maxLeftBox - minLeftBox); - const ndVector rightSize(maxRightBox - minRightBox); - const ndFloat32 leftArea = leftSize.DotProduct(leftSize.ShiftTripleRight()).GetScalar(); - const ndFloat32 rightArea = rightSize.DotProduct(rightSize.ShiftTripleRight()).GetScalar(); - - parent = (leftArea < rightArea) ? sceneNode->m_left : sceneNode->m_right; - depth++; - } - else - { - if (parent->m_parent) - { - if (parent->m_parent->GetLeft() == parent) - { - parent->m_parent->GetAsSceneTreeNode()->m_left = childNode; - } - else - { - parent->m_parent->GetAsSceneTreeNode()->m_right = childNode; - } - childNode->m_right = parent; - childNode->m_parent = parent->m_parent; - parent->m_parent = childNode; - - const ndVector minBox(childNode->m_left->m_minBox.GetMin(childNode->m_right->m_minBox)); - const ndVector maxBox(childNode->m_left->m_maxBox.GetMax(childNode->m_right->m_maxBox)); - childNode->m_minBox = minBox; - childNode->m_maxBox = maxBox; - } - else - { - const ndVector minBox(parent->m_minBox.GetMin(childNode->m_minBox)); - const ndVector maxBox(parent->m_maxBox.GetMax(childNode->m_maxBox)); - childNode->m_minBox = minBox; - childNode->m_maxBox = maxBox; - childNode->m_right = parent; - childNode->m_parent = nullptr; - parent->m_parent = childNode; - rootNode = childNode; - } - break; - } - } - #ifdef _DEBUG - //ndAssert(depth < 128); - if (depth >= 256) - { - ndTrace(("This may be a pathological scene, consider balancing the scene\n")); - } - #endif - return rootNode; - } - else - { - return bodyNode; - } -} - -void ndBvhSceneManager::RemoveBody(ndBodyKinematic* const body) -{ - m_workingArray.m_isDirty = 1; - ndBvhLeafNode* const bodyNode = (ndBvhLeafNode*)m_workingArray[body->m_bodyNodeIndex]; - ndBvhInternalNode* const sceneNode = (ndBvhInternalNode*)m_workingArray[body->m_sceneNodeIndex]; - ndAssert(bodyNode->GetAsSceneBodyNode()); - ndAssert(sceneNode->GetAsSceneTreeNode()); - bodyNode->Kill(); - sceneNode->Kill(); -} - -ndBvhLeafNode* ndBvhSceneManager::GetLeafNode(ndBodyKinematic* const body) const -{ - ndAssert(m_workingArray[body->m_bodyNodeIndex] && m_workingArray[body->m_bodyNodeIndex]->GetAsSceneBodyNode()); - return (ndBvhLeafNode*)m_workingArray[body->m_bodyNodeIndex]; -} - - -void ndBvhSceneManager::CleanUp() -{ - m_workingArray.CleanUp(); -} - -void ndBvhSceneManager::Update(ndThreadPool& threadPool) -{ - ndBvhNodeArray& nodeArray = m_workingArray; - - if (nodeArray.m_isDirty && nodeArray.GetCount()) - { - D_TRACKTIME(); - const ndInt32 count = ndInt32(nodeArray.GetCount()); - nodeArray.SetCount(count * 2); - ndBvhNode** const src = &nodeArray[0]; - ndBvhNode** const tmp = &nodeArray[count]; - - class ndSortSceneNodeKey - { - public: - ndSortSceneNodeKey(const void* const) - { - m_keyCode[0] = 0; - m_keyCode[1] = 1; - m_keyCode[2] = 2; - m_keyCode[3] = 2; - } - - ndInt32 GetKey(const ndBvhNode* const node) const - { - ndUnsigned32 code = ndUnsigned32(node->m_isDead * 2 + (((ndBvhNode*)node)->GetAsSceneBodyNode() ? 1 : 0)); - return m_keyCode[code]; - } - - ndInt32 m_keyCode[4]; - }; - - ndUnsigned32 scans[5]; - ndCountingSortInPlace(threadPool, src, tmp, count, scans, nullptr); - - const ndInt32 alivedStart = ndInt32(scans[2]); - const ndInt32 deadCount = ndInt32(scans[3]) - alivedStart; - for (ndInt32 i = 0; i < deadCount; ++i) - { - ndBvhNode* const node = nodeArray[alivedStart + i]; - delete node; - } - nodeArray.SetCount(alivedStart); - - if (nodeArray.GetCount()) - { - ndAtomic iterator(0); - auto EnumerateNodes = ndMakeObject::ndFunction([&iterator, &nodeArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(MarkCellBounds); - ndBvhNode** const nodes = &nodeArray[0]; - const ndInt32 baseCount = ndInt32(nodeArray.GetCount()) / 2; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < baseCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((baseCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : baseCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBvhLeafNode* const bodyNode = (ndBvhLeafNode*)nodes[baseCount + i + j]; - ndAssert(nodes[i + j]->GetAsSceneTreeNode()); - ndAssert(nodes[baseCount + i + j]->GetAsSceneBodyNode()); - - ndBodyKinematic* const body = bodyNode->m_body; - body->m_sceneNodeIndex = i + j; - body->m_bodyNodeIndex = baseCount + i + j; - } - } - }); - threadPool.ParallelExecute(EnumerateNodes); - } - nodeArray.m_isDirty = 0; - } -} - -ndBuildBvhTreeBuildState::ndBuildBvhTreeBuildState() - :m_size(ndVector::m_zero) - ,m_origin(ndVector::m_zero) - ,m_cellBuffer0(1024) - ,m_cellBuffer1(1024) - ,m_cellCounts0(1024) - ,m_cellCounts1(1024) - ,m_tempNodeBuffer(1024) - ,m_root(nullptr) - ,m_srcArray(nullptr) - ,m_tmpArray(nullptr) - ,m_parentsArray(nullptr) - ,m_depthLevel(0) - ,m_leafNodesCount(0) - ,m_state(m_beginBuild) -{ -} - -void ndBuildBvhTreeBuildState::Init(ndInt32 maxCount) -{ - m_depthLevel = 1; - m_tempNodeBuffer.SetCount(ndInt32(4 * (maxCount + 4))); - - m_root = nullptr; - m_srcArray = &m_tempNodeBuffer[0]; - m_tmpArray = &m_srcArray[2 * (maxCount + 4)]; - m_parentsArray = &m_srcArray[maxCount]; - m_leafNodesCount = maxCount; -} - -void ndBvhSceneManager::UpdateScene(ndThreadPool& threadPool) -{ - D_TRACKTIME(); - - ndInt32 start = 0; - ndInt32 count = 0; - ndAtomic iterator(0); - auto UpdateSceneBvh = ndMakeObject::ndFunction([this, &iterator, &start, &count](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(UpdateSceneBvh); - ndBvhInternalNode** const nodes = (ndBvhInternalNode**)&m_workingArray[start]; - const ndInt32 itemsCount = count; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < itemsCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((itemsCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : itemsCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBvhInternalNode* const node = nodes[i + j]; - ndAssert(node && node->GetAsSceneNode()); - - const ndVector minBox(node->m_left->m_minBox.GetMin(node->m_right->m_minBox)); - const ndVector maxBox(node->m_left->m_maxBox.GetMax(node->m_right->m_maxBox)); - if (!ndBoxInclusionTest(minBox, maxBox, node->m_minBox, node->m_maxBox)) - { - node->m_minBox = minBox; - node->m_maxBox = maxBox; - } - } - } - }); - - const ndBvhNodeArray& array = m_workingArray; - for (ndInt32 i = 0; i < ndInt32(array.m_scansCount); ++i) - { - start = ndInt32(array.m_scans[i]); - count = ndInt32(array.m_scans[i + 1] - start); - threadPool.ParallelExecute(UpdateSceneBvh); - } -} - -bool ndBvhSceneManager::BuildBvhTreeInitNodes(ndThreadPool& threadPool) -{ - D_TRACKTIME(); - ndAtomic iterator(0); - auto CopyBodyNodes = ndMakeObject::ndFunction([this, &iterator](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CopyBodyNodes); - - ndBvhNodeArray& nodeArray = m_workingArray; - const ndInt32 baseCount = ndInt32(nodeArray.GetCount()) / 2; - ndBvhNode** const srcArray = m_bvhBuildState.m_srcArray; - ndBvhLeafNode** const bodySceneNodes = (ndBvhLeafNode**)&nodeArray[baseCount]; - - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < baseCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((baseCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : baseCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBvhLeafNode* const node = bodySceneNodes[i + j]; - ndAssert(node && node->GetAsSceneBodyNode()); - ndBodyKinematic* const body = node->GetBody(); - - node->m_bhvLinked = 0; - node->m_depthLevel = 0; - node->m_parent = nullptr; - node->SetAabb(body->m_minAabb, body->m_maxAabb); - srcArray[i + j] = node; - } - } - }); - - ndAtomic iterator1(0); - auto CopySceneNode = ndMakeObject::ndFunction([this, &iterator1](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CopySceneNode); - ndBvhNodeArray& nodeArray = m_workingArray; - - ndBvhInternalNode** const sceneNodes = (ndBvhInternalNode**)&nodeArray[0]; - ndBvhNode** const parentsArray = m_bvhBuildState.m_parentsArray; - - const ndInt32 baseCount = ndInt32(nodeArray.GetCount()) / 2; - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < baseCount; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((baseCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : baseCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBvhInternalNode* const node = sceneNodes[i + j]; - ndAssert(node && node->GetAsSceneTreeNode()); - - parentsArray[i + j] = node; - node->m_bhvLinked = 0; - node->m_depthLevel = 0; - node->m_parent = nullptr; - } - } - }); - - Update(threadPool); - - bool ret = false; - ndBvhNodeArray& nodeArray = m_workingArray; - - if (nodeArray.GetCount()) - { - ret = true; - m_bvhBuildState.Init(ndInt32(nodeArray.GetCount()) / 2); - threadPool.ParallelExecute(CopyBodyNodes); - threadPool.ParallelExecute(CopySceneNode); - } - return ret; -} - -void ndBvhSceneManager::BuildBvhTreeCalculateLeafBoxes(ndThreadPool& threadPool) -{ - D_TRACKTIME(); - ndVector boxes[D_MAX_THREADS_COUNT][2]; - ndFloat32 boxSizes[D_MAX_THREADS_COUNT]; - - ndAtomic iterator(0); - auto CalculateBoxSize = ndMakeObject::ndFunction([this, &iterator, &boxSizes, &boxes](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(CalculateBoxSize); - ndVector minP(ndFloat32(1.0e15f)); - ndVector maxP(ndFloat32(-1.0e15f)); - ndFloat32 minSize = ndFloat32(1.0e15f); - - ndBvhNode** const srcArray = m_bvhBuildState.m_srcArray; - - const ndInt32 leafNodesCount = m_bvhBuildState.m_leafNodesCount; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < leafNodesCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((leafNodesCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : leafNodesCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndBvhNode* const node = srcArray[i + j]; - ndAssert(((ndBvhNode*)node)->GetAsSceneBodyNode()); - minP = minP.GetMin(node->m_minBox); - maxP = maxP.GetMax(node->m_maxBox); - const ndVector size(node->m_maxBox - node->m_minBox); - ndFloat32 maxDim = ndMax(ndMax(size.m_x, size.m_y), size.m_z); - minSize = ndMin(maxDim, minSize); - } - } - boxes[threadIndex][0] = minP; - boxes[threadIndex][1] = maxP; - boxSizes[threadIndex] = minSize; - }); - threadPool.ParallelExecute(CalculateBoxSize); - - ndVector minP(ndFloat32(1.0e15f)); - ndVector maxP(ndFloat32(-1.0e15f)); - ndFloat32 minBoxSize = ndFloat32(1.0e15f); - const ndInt32 threadCount = threadPool.GetThreadCount(); - for (ndInt32 i = 0; i < threadCount; ++i) - { - minP = minP.GetMin(boxes[i][0]); - maxP = maxP.GetMax(boxes[i][1]); - minBoxSize = ndMin(minBoxSize, boxSizes[i]); - } - - m_bvhBuildState.m_origin = minP; - m_bvhBuildState.m_size = ndVector::m_triplexMask & ndVector(minBoxSize); -} - -ndInt32 ndBvhSceneManager::BuildSmallBvhTree(ndThreadPool& threadPool, ndBvhNode** const parentsArray, ndInt32 bashCount) -{ - ndInt32 depthLevel[D_MAX_THREADS_COUNT]; - ndAtomic iterator(0); - auto SmallBhvNodes = ndMakeObject::ndFunction([this, &iterator, parentsArray, bashCount, &depthLevel](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(SmallBhvNodes); - - const ndCellScanPrefix* const srcCellNodes = &m_bvhBuildState.m_cellCounts0[0]; - const ndCellScanPrefix* const newParentsDest = &m_bvhBuildState.m_cellCounts1[0]; - const ndBottomUpCell* const nodesCells = &m_bvhBuildState.m_cellBuffer0[0]; - - ndAssert(m_bvhBuildState.m_cellCounts0.GetCount() == m_bvhBuildState.m_cellCounts1.GetCount()); - - auto MakeTwoNodesTree = [](ndBvhInternalNode* const root, ndBvhNode* const left, ndBvhNode* const right) - { - left->m_bhvLinked = 1; - right->m_bhvLinked = 1; - root->m_bhvLinked = 1; - root->m_left = left; - root->m_right = right; - - left->m_parent = root; - right->m_parent = root; - root->m_parent = nullptr; - - root->m_minBox = left->m_minBox.GetMin(right->m_minBox); - root->m_maxBox = left->m_maxBox.GetMax(right->m_maxBox); - }; - - auto MakeThreeNodesTree = [](ndBvhInternalNode* const root, ndBvhInternalNode* const subRoot, ndBvhNode* const node0, ndBvhNode* const node1, ndBvhNode* const node2) - { - class ndNodeOrder - { - public: - ndVector m_p0; - ndVector m_p1; - ndBvhNode* m_node0; - ndBvhNode* m_node1; - ndBvhNode* m_node2; - ndFloat32 m_area; - }; - - ndNodeOrder order[3]; - - order[0].m_node0 = node0; - order[0].m_node1 = node1; - order[0].m_node2 = node2; - - order[1].m_node0 = node1; - order[1].m_node1 = node2; - order[1].m_node2 = node0; - - order[2].m_node0 = node2; - order[2].m_node1 = node0; - order[2].m_node2 = node1; - - for (ndInt32 i = 0; i < 3; ++i) - { - order[i].m_p0 = order[i].m_node0->m_minBox.GetMin(order[i].m_node1->m_minBox); - order[i].m_p1 = order[i].m_node0->m_maxBox.GetMax(order[i].m_node1->m_maxBox); - const ndVector size(order[i].m_p1 - order[i].m_p0); - order[i].m_area = size.DotProduct(size.ShiftTripleRight()).GetScalar(); - } - - if (order[2].m_area < order[1].m_area) - { - ndSwap(order[1], order[2]); - } - if (order[1].m_area < order[0].m_area) - { - ndSwap(order[1], order[0]); - } - - root->m_bhvLinked = 1; - node0->m_bhvLinked = 1; - node1->m_bhvLinked = 1; - node2->m_bhvLinked = 1; - subRoot->m_bhvLinked = 1; - - subRoot->m_parent = root; - subRoot->m_left = order[0].m_node0; - subRoot->m_right = order[0].m_node1; - subRoot->m_minBox = order[0].m_p0; - subRoot->m_maxBox = order[0].m_p1; - subRoot->m_left->m_parent = subRoot; - subRoot->m_right->m_parent = subRoot; - - root->m_parent = nullptr; - root->m_right = subRoot; - root->m_left = order[0].m_node2; - root->m_left->m_parent = root; - - root->m_minBox = root->m_left->m_minBox.GetMin(root->m_right->m_minBox); - root->m_maxBox = root->m_left->m_maxBox.GetMax(root->m_right->m_maxBox); - }; - - ndInt32 maxDepth = 0; - const ndInt32 count = bashCount; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 k = i + j; - const ndInt32 nodesCount = newParentsDest[k + 1].m_location - newParentsDest[k].m_location; - - ndInt32 depth = 0; - if (nodesCount == 1) - { - const ndInt32 childIndex = srcCellNodes[k].m_location; - const ndInt32 parentIndex = newParentsDest[k].m_location; - ndBvhNode* const node0 = nodesCells[childIndex + 0].m_node; - ndBvhNode* const node1 = nodesCells[childIndex + 1].m_node; - ndBvhInternalNode* const root = parentsArray[parentIndex]->GetAsSceneTreeNode(); - ndAssert(root); - ndAssert(!root->m_bhvLinked); - MakeTwoNodesTree(root, node0, node1); - root->m_bhvLinked = 0; - } - else if (nodesCount == 2) - { - const ndInt32 childIndex = srcCellNodes[k].m_location; - const ndInt32 parentIndex = newParentsDest[k].m_location; - - ndBvhNode* const node0 = nodesCells[childIndex + 0].m_node; - ndBvhNode* const node1 = nodesCells[childIndex + 1].m_node; - ndBvhNode* const node2 = nodesCells[childIndex + 2].m_node; - - ndBvhInternalNode* const root = parentsArray[parentIndex + 0]->GetAsSceneTreeNode(); - ndBvhInternalNode* const subParent = parentsArray[parentIndex + 1]->GetAsSceneTreeNode(); - - ndAssert(root); - ndAssert(!root->m_bhvLinked); - MakeThreeNodesTree(root, subParent, node0, node1, node2); - root->m_bhvLinked = 0; - depth += 1; - } - else if (nodesCount > 2) - { - class ndBlockSegment - { - public: - ndInt32 m_start; - ndInt32 m_count; - ndInt32 m_rootNodeIndex; - ndInt32 m_depth; - }; - - ndBlockSegment stackPool[32]; - - ndInt32 stack = 1; - ndInt32 rootNodeIndex = newParentsDest[k].m_location; - stackPool[0].m_depth = 0; - stackPool[0].m_rootNodeIndex = rootNodeIndex; - stackPool[0].m_start = srcCellNodes[k].m_location; - stackPool[0].m_count = srcCellNodes[k + 1].m_location - srcCellNodes[k].m_location; - - ndBvhNode* const rootNode = parentsArray[rootNodeIndex]; - rootNodeIndex++; - - ndInt32 maxStack = 0; - while (stack) - { - stack--; - const ndBlockSegment block(stackPool[stack]); - ndAssert(block.m_count > 2); - - maxStack = ndMax(maxStack, stack); - - ndVector minP(ndFloat32(1.0e15f)); - ndVector maxP(ndFloat32(-1.0e15f)); - ndVector median(ndVector::m_zero); - ndVector varian(ndVector::m_zero); - - for (ndInt32 m = 0; m < block.m_count; ++m) - { - ndBvhNode* const node = nodesCells[block.m_start + m].m_node; - minP = minP.GetMin(node->m_minBox); - maxP = maxP.GetMax(node->m_maxBox); - ndVector p(ndVector::m_half * (node->m_minBox + node->m_maxBox)); - median += p; - varian += p * p; - } - - ndBvhInternalNode* const root = parentsArray[block.m_rootNodeIndex]->GetAsSceneTreeNode(); - root->m_minBox = minP; - root->m_maxBox = maxP; - root->m_bhvLinked = 1; - - ndInt32 index = 0; - ndFloat32 maxVarian = ndFloat32(-1.0e15f); - varian = varian.Scale(ndFloat32(block.m_count)) - median * median; - for (ndInt32 m = 0; m < 3; ++m) - { - if (varian[m] > maxVarian) - { - index = m; - maxVarian = varian[m]; - } - } - - ndInt32 index0 = block.m_start + block.m_count / 2; - if (maxVarian > ndFloat32(1.0e-3f)) - { - class ndCompareContext - { - public: - ndFloat32 m_midPoint; - ndInt32 m_index; - }; - - class ndCompareKey - { - public: - ndCompareKey(const void* const context) - { - const ndCompareContext* const info = (ndCompareContext*)context; - - m_index = info->m_index; - m_midPoint = info->m_midPoint; - } - - ndInt32 GetKey(const ndBottomUpCell& cell) - { - const ndBvhNode* const node = cell.m_node; - const ndVector p(ndVector::m_half * (node->m_minBox + node->m_maxBox)); - ndInt32 key = p[m_index] >= m_midPoint; - return key; - } - - ndFloat32 m_midPoint; - ndInt32 m_index; - }; - - ndCompareContext info; - ndUnsigned32 scan[8]; - - info.m_index = index; - info.m_midPoint = median[index] / ndFloat32(block.m_count); - ndCountingSortInPlace(&m_bvhBuildState.m_cellBuffer0[block.m_start], &m_bvhBuildState.m_cellBuffer1[block.m_start], block.m_count, scan, &info); - index0 = block.m_start + ndInt32(scan[1]); - if (index0 == block.m_start) - { - index0 = block.m_start + block.m_count / 2; - } - if (index0 == (block.m_start + block.m_count)) - { - index0 = block.m_start + block.m_count / 2; - } - } - - ndAssert(index0 > block.m_start); - ndAssert(index0 < (block.m_start + block.m_count)); - - ndInt32 count0 = index0 - block.m_start; - - ndAssert(count0); - if (count0 == 1) - { - ndBvhNode* const node = m_bvhBuildState.m_cellBuffer0[block.m_start].m_node; - node->m_bhvLinked = 1; - node->m_parent = root; - root->m_left = node; - } - else if (count0 == 2) - { - ndBvhNode* const node0 = m_bvhBuildState.m_cellBuffer0[block.m_start + 0].m_node; - ndBvhNode* const node1 = m_bvhBuildState.m_cellBuffer0[block.m_start + 1].m_node; - ndBvhInternalNode* const parent = parentsArray[rootNodeIndex]->GetAsSceneTreeNode(); - rootNodeIndex++; - - ndAssert(root); - MakeTwoNodesTree(parent, node0, node1); - parent->m_parent = root; - root->m_left = parent; - maxStack = ndMax(maxStack, block.m_depth + 1); - } - else if (count0 == 3) - { - ndBvhNode* const node0 = m_bvhBuildState.m_cellBuffer0[block.m_start + 0].m_node; - ndBvhNode* const node1 = m_bvhBuildState.m_cellBuffer0[block.m_start + 1].m_node; - ndBvhNode* const node2 = m_bvhBuildState.m_cellBuffer0[block.m_start + 2].m_node; - - ndBvhInternalNode* const grandParent = parentsArray[rootNodeIndex]->GetAsSceneTreeNode(); - rootNodeIndex++; - - ndBvhInternalNode* const parent = parentsArray[rootNodeIndex]->GetAsSceneTreeNode(); - rootNodeIndex++; - - ndAssert(root); - MakeThreeNodesTree(grandParent, parent, node0, node1, node2); - grandParent->m_parent = root; - root->m_left = grandParent; - maxStack = ndMax(maxStack, block.m_depth + 2); - } - else - { - ndBvhInternalNode* const parent = parentsArray[rootNodeIndex]->GetAsSceneTreeNode(); - parent->m_bhvLinked = 1; - parent->m_parent = root; - parent->m_left = nullptr; - parent->m_right = nullptr; - root->m_left = parent; - - stackPool[stack].m_count = count0; - stackPool[stack].m_start = block.m_start; - stackPool[stack].m_depth = block.m_depth + 1; - stackPool[stack].m_rootNodeIndex = rootNodeIndex; - - stack++; - rootNodeIndex++; - ndAssert(stack < sizeof(stackPool) / sizeof(stackPool[0])); - } - - ndInt32 count1 = block.m_start + block.m_count - index0; - ndAssert(count1); - if (count1 == 1) - { - ndBvhNode* const node = m_bvhBuildState.m_cellBuffer0[index0].m_node; - node->m_bhvLinked = 1; - node->m_parent = root; - root->m_right = node; - } - else if (count1 == 2) - { - ndBvhNode* const node0 = m_bvhBuildState.m_cellBuffer0[index0 + 0].m_node; - ndBvhNode* const node1 = m_bvhBuildState.m_cellBuffer0[index0 + 1].m_node; - ndBvhInternalNode* const parent = parentsArray[rootNodeIndex]->GetAsSceneTreeNode(); - rootNodeIndex++; - - ndAssert(root); - MakeTwoNodesTree(parent, node0, node1); - parent->m_parent = root; - root->m_right = parent; - maxStack = ndMax(maxStack, block.m_depth + 1); - } - else if (count1 == 3) - { - ndBvhNode* const node0 = m_bvhBuildState.m_cellBuffer0[index0 + 0].m_node; - ndBvhNode* const node1 = m_bvhBuildState.m_cellBuffer0[index0 + 1].m_node; - ndBvhNode* const node2 = m_bvhBuildState.m_cellBuffer0[index0 + 2].m_node; - - ndBvhInternalNode* const grandParent = parentsArray[rootNodeIndex]->GetAsSceneTreeNode(); - rootNodeIndex++; - - ndBvhInternalNode* const parent = parentsArray[rootNodeIndex]->GetAsSceneTreeNode(); - rootNodeIndex++; - - ndAssert(root); - MakeThreeNodesTree(grandParent, parent, node0, node1, node2); - grandParent->m_parent = root; - root->m_right = grandParent; - maxStack = ndMax(maxStack, block.m_depth + 2); - } - else - { - ndBvhInternalNode* const parent = parentsArray[rootNodeIndex]->GetAsSceneTreeNode(); - parent->m_bhvLinked = 1; - parent->m_parent = root; - parent->m_left = nullptr; - parent->m_right = nullptr; - root->m_right = parent; - - stackPool[stack].m_start = index0; - stackPool[stack].m_count = count1; - stackPool[stack].m_depth = block.m_depth + 1; - stackPool[stack].m_rootNodeIndex = rootNodeIndex; - - stack++; - rootNodeIndex++; - ndAssert(stack < sizeof(stackPool) / sizeof(stackPool[0])); - } - } - rootNode->m_bhvLinked = 0; - depth = maxStack; - } - #ifdef _DEBUG - else if (nodesCount == 0) - { - ndInt32 index = srcCellNodes[k].m_location; - ndBvhNode* const node = nodesCells[index].m_node; - ndAssert(!node->m_bhvLinked); - } - #endif - - maxDepth = ndMax(maxDepth, depth); - } - } - depthLevel[threadIndex] = maxDepth; - }); - threadPool.ParallelExecute(SmallBhvNodes); - - ndInt32 depth = 0; - for (ndInt32 i = threadPool.GetThreadCount() - 1; i >= 0; --i) - { - depth = ndMax(depth, depthLevel[i]); - } - return depth; -} - -void ndBvhSceneManager::BuildBvhTreeSetNodesDepth(ndThreadPool& threadPool) -{ - D_TRACKTIME(); - class ndSortGetDethpKey - { - public: - ndSortGetDethpKey(const void* const) - { - } - - ndInt32 GetKey(const ndBvhInternalNode* const node) const - { - return node->m_depthLevel; - } - }; - - ndBvhNodeArray& nodeArray = m_workingArray; - - ndInt32 sceneNodeCount = ndInt32(nodeArray.GetCount()) / 2 - 1; - ndBvhInternalNode** const view = (ndBvhInternalNode**)&nodeArray[0]; - ndBvhInternalNode** tmpBuffer = (ndBvhInternalNode**)&m_bvhBuildState.m_tempNodeBuffer[0]; - - ndUnsigned32 scans[257]; - ndCountingSortInPlace(threadPool, &view[0], tmpBuffer, sceneNodeCount, scans, nullptr); - - nodeArray.m_scansCount = 0; - for (ndInt32 i = 1; (i < 257) && (ndInt32(scans[i]) < sceneNodeCount); ++i) - { - nodeArray.m_scans[i - 1] = scans[i]; - nodeArray.m_scansCount++; - } - nodeArray.m_scans[nodeArray.m_scansCount] = scans[nodeArray.m_scansCount + 1]; - ndAssert(nodeArray.m_scans[0] == 0); -} - -void ndBvhSceneManager::BuildBvhGenerateLayerGrids(ndThreadPool& threadPool) -{ - D_TRACKTIME(); - enum - { - m_linkedCell, - m_insideCell, - m_outsideCell, - }; - - class ndGridClassifier - { - public: - ndGridClassifier(void* const data) - { - const ndBuildBvhTreeBuildState* const info = (ndBuildBvhTreeBuildState*)data; - m_size = info->m_size; - m_origin = info->m_origin; - m_invSize = ndVector::m_triplexMask & ndVector(ndFloat32(1.0f) / m_size.m_x); - - m_code[0] = m_outsideCell; - m_code[1] = m_insideCell; - m_code[2] = m_linkedCell; - m_code[3] = m_linkedCell; - } - - ndInt32 GetKey(const ndBvhNode* const node) const - { - const ndVector minPosit((m_invSize * (node->m_minBox - m_origin)).GetInt()); - const ndVector maxPosit((m_invSize * (node->m_maxBox - m_origin)).GetInt()); - const ndInt32 x0 = ndInt32 (minPosit.m_ix); - const ndInt32 y0 = ndInt32 (minPosit.m_iy); - const ndInt32 z0 = ndInt32 (minPosit.m_iz); - const ndInt32 x1 = ndInt32 (maxPosit.m_ix); - const ndInt32 y1 = ndInt32 (maxPosit.m_iy); - const ndInt32 z1 = ndInt32 (maxPosit.m_iz); - - ndAssert(x0 >= 0); - ndAssert(y0 >= 0); - ndAssert(z0 >= 0); - ndAssert(x1 >= 0); - ndAssert(y1 >= 0); - ndAssert(z1 >= 0); - - const ndUnsigned32 test_x = ndUnsigned32((((x1 - x0)) >> 1) == 0); - const ndUnsigned32 test_y = ndUnsigned32((((y1 - y0)) >> 1) == 0); - const ndUnsigned32 test_z = ndUnsigned32((((z1 - z0)) >> 1) == 0); - const ndUnsigned32 test = test_x & test_y & test_z; - const ndUnsigned32 codeIndex = node->m_bhvLinked * 2 + test; - return m_code[codeIndex]; - } - - ndVector m_size; - ndVector m_invSize; - ndVector m_origin; - ndInt32 m_code[5]; - }; - - class ndSortCell_x - { - public: - ndSortCell_x(const void* const shift) - { - m_shift = *((ndInt32*)shift); - } - - ndInt32 GetKey(const ndBottomUpCell& cell) const - { - ndInt32 val = cell.m_x >> m_shift; - return val & 0xff; - } - - ndInt32 m_shift; - }; - - class ndSortCell_y - { - public: - ndSortCell_y(const void* const shift) - { - m_shift = *((ndInt32*)shift); - } - - ndInt32 GetKey(const ndBottomUpCell& cell) const - { - ndInt32 val = cell.m_y >> m_shift; - return val & 0xff; - } - - ndInt32 m_shift; - }; - - class ndSortCell_z - { - public: - ndSortCell_z(const void* const shift) - { - m_shift = *((ndInt32*)shift); - } - - ndInt32 GetKey(const ndBottomUpCell& cell) const - { - ndInt32 val = cell.m_z >> m_shift; - return val & 0xff; - } - - ndInt32 m_shift; - }; - - class ndSortCellCount - { - public: - ndSortCellCount(const void* const) - { - } - - ndInt32 GetKey(const ndCellScanPrefix& cell) const - { - return ndInt32 (cell.m_cellTest); - } - }; - - ndUnsigned32 prefixScan[8]; - ndInt32 maxGrids[D_MAX_THREADS_COUNT][3]; - - ndCountingSortInPlace(threadPool, m_bvhBuildState.m_srcArray, m_bvhBuildState.m_tmpArray, m_bvhBuildState.m_leafNodesCount, prefixScan, &m_bvhBuildState); - ndInt32 insideCellsCount = ndInt32(prefixScan[m_insideCell + 1] - prefixScan[m_insideCell]); - if (insideCellsCount) - { - m_bvhBuildState.m_cellBuffer0.SetCount(insideCellsCount); - m_bvhBuildState.m_cellBuffer1.SetCount(insideCellsCount); - const ndUnsigned32 linkedNodes = prefixScan[m_linkedCell + 1] - prefixScan[m_linkedCell]; - m_bvhBuildState.m_srcArray += linkedNodes; - m_bvhBuildState.m_leafNodesCount -= linkedNodes; - - ndAtomic iterator(0); - auto MakeGrids = ndMakeObject::ndFunction([this, &iterator, &maxGrids](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(MakeGrids); - - const ndGridClassifier gridClassifier(&m_bvhBuildState); - const ndVector origin(gridClassifier.m_origin); - const ndVector invSize(gridClassifier.m_invSize); - - ndBvhNode** const srcArray = m_bvhBuildState.m_srcArray; - - ndInt32 max_x = 0; - ndInt32 max_y = 0; - ndInt32 max_z = 0; - - const ndInt32 count = ndInt32(m_bvhBuildState.m_cellBuffer0.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 k = i + j; - ndBvhNode* const node = srcArray[k]; - const ndVector dist(node->m_minBox - origin); - const ndVector posit(invSize * dist); - const ndVector intPosit(posit.GetInt()); - m_bvhBuildState.m_cellBuffer0[k].m_x = ndInt32(intPosit.m_ix); - m_bvhBuildState.m_cellBuffer0[k].m_y = ndInt32(intPosit.m_iy); - m_bvhBuildState.m_cellBuffer0[k].m_z = ndInt32(intPosit.m_iz); - m_bvhBuildState.m_cellBuffer0[k].m_node = node; - max_x = ndMax(ndInt32(intPosit.m_ix), max_x); - max_y = ndMax(ndInt32(intPosit.m_iy), max_y); - max_z = ndMax(ndInt32(intPosit.m_iz), max_z); - } - } - maxGrids[threadIndex][0] = max_x; - maxGrids[threadIndex][1] = max_y; - maxGrids[threadIndex][2] = max_z; - }); - threadPool.ParallelExecute(MakeGrids); - - const ndInt32 threadCount = threadPool.GetThreadCount(); - for (ndInt32 i = 1; i < threadCount; ++i) - { - maxGrids[0][0] = ndMax(maxGrids[i][0], maxGrids[0][0]); - maxGrids[0][1] = ndMax(maxGrids[i][1], maxGrids[0][1]); - maxGrids[0][2] = ndMax(maxGrids[i][2], maxGrids[0][2]); - } - - ndAssert(maxGrids[0][0] < 0x7fffffff); - ndAssert(maxGrids[0][1] < 0x7fffffff); - ndAssert(maxGrids[0][2] < 0x7fffffff); - ndInt64 shift = 0; - do { - ndCountingSort(threadPool, m_bvhBuildState.m_cellBuffer0, m_bvhBuildState.m_cellBuffer1, nullptr, &shift); - shift += 8; - } while (ndInt64(maxGrids[0][0]) > ndInt64(1) << shift); - - shift = 0; - do { - ndCountingSort(threadPool, m_bvhBuildState.m_cellBuffer0, m_bvhBuildState.m_cellBuffer1, nullptr, &shift); - shift += 8; - } while (ndInt64(maxGrids[0][1]) > ndInt64(1) << shift); - - shift = 0; - do { - ndCountingSort(threadPool, m_bvhBuildState.m_cellBuffer0, m_bvhBuildState.m_cellBuffer1, nullptr, &shift); - shift += 8; - } while (ndInt64(maxGrids[0][2]) > ndInt64(1) << shift); - - ndBottomUpCell sentinelCell; - sentinelCell.m_x = ndUnsigned32(-1); - sentinelCell.m_y = ndUnsigned32(-1); - sentinelCell.m_z = ndUnsigned32(-1); - sentinelCell.m_node = nullptr; - - m_bvhBuildState.m_cellBuffer0.PushBack(sentinelCell); - m_bvhBuildState.m_cellBuffer1.PushBack(sentinelCell); - m_bvhBuildState.m_cellCounts0.SetCount(m_bvhBuildState.m_cellBuffer0.GetCount()); - m_bvhBuildState.m_cellCounts1.SetCount(m_bvhBuildState.m_cellBuffer1.GetCount()); - - ndAtomic iterator1(0); - auto MarkCellBounds = ndMakeObject::ndFunction([this, &iterator1](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(MarkCellBounds); - ndCellScanPrefix* const dst = &m_bvhBuildState.m_cellCounts0[0]; - - const ndInt32 count = ndInt32(m_bvhBuildState.m_cellBuffer0.GetCount()) - 1; - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 k = i + j; - const ndBottomUpCell& cell0 = m_bvhBuildState.m_cellBuffer0[k + 1]; - const ndBottomUpCell& cell1 = m_bvhBuildState.m_cellBuffer0[k]; - const ndUnsigned8 test = ndUnsigned8((cell0.m_x == cell1.m_x) & (cell0.m_y == cell1.m_y) & (cell0.m_z == cell1.m_z) & (cell1.m_node != nullptr)); - dst[k + 1].m_cellTest = test; - dst[k + 1].m_location = k + 1; - } - } - }); - threadPool.ParallelExecute(MarkCellBounds); - - m_bvhBuildState.m_cellCounts0[0].m_cellTest = 0; - m_bvhBuildState.m_cellCounts0[0].m_location = 0; - ndCountingSort(threadPool, m_bvhBuildState.m_cellCounts0, m_bvhBuildState.m_cellCounts1, prefixScan, nullptr); - - ndUnsigned32 sum = 0; - const ndInt32 bashCount = ndInt32(prefixScan[1] - 1); - for (ndInt32 i = 0; i < bashCount; ++i) - { - const ndInt32 count = m_bvhBuildState.m_cellCounts0[i + 1].m_location - m_bvhBuildState.m_cellCounts0[i].m_location - 1; - m_bvhBuildState.m_cellCounts1[i].m_location = ndInt32(sum); - sum += count; - } - if (sum) - { - m_bvhBuildState.m_cellCounts1[bashCount].m_location = ndInt32(sum); - ndInt32 subTreeDepth = BuildSmallBvhTree(threadPool, m_bvhBuildState.m_parentsArray, bashCount); - m_bvhBuildState.m_depthLevel += subTreeDepth; - - ndAtomic iterator2(0); - auto EnumerateSmallBvh = ndMakeObject::ndFunction([this, &iterator2, sum](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(EnumerateSmallBvh); - - ndInt32 depthLevel = m_bvhBuildState.m_depthLevel; - ndBvhNode** const parentsArray = m_bvhBuildState.m_parentsArray; - - const ndInt32 count = ndInt32(sum); - for (ndInt32 i = iterator2.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator2.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBvhInternalNode* const root = parentsArray[i + j]->GetAsSceneTreeNode(); - ndAssert(root); - if (!root->m_parent) - { - ndAssert(root->m_depthLevel == 0); - class StackLevel - { - public: - ndBvhInternalNode* m_node; - ndInt32 m_depthLevel; - }; - - ndInt32 stack = 1; - StackLevel m_stackPool[32]; - - m_stackPool[0].m_node = root; - m_stackPool[0].m_depthLevel = depthLevel; - - while (stack) - { - stack--; - const StackLevel level(m_stackPool[stack]); - - ndBvhInternalNode* const node = level.m_node; - node->m_depthLevel = level.m_depthLevel; - - ndBvhInternalNode* const left = node->m_left->GetAsSceneTreeNode(); - if (left && left->m_depthLevel == 0) - { - m_stackPool[stack].m_node = left; - m_stackPool[stack].m_depthLevel = level.m_depthLevel - 1; - stack++; - ndAssert(stack < ndInt32(sizeof(m_stackPool) / sizeof(m_stackPool[0]))); - } - - ndBvhInternalNode* const right = node->m_right->GetAsSceneTreeNode(); - if (right && right->m_depthLevel == 0) - { - m_stackPool[stack].m_node = right; - m_stackPool[stack].m_depthLevel = level.m_depthLevel - 1; - stack++; - ndAssert(stack < ndInt32(sizeof(m_stackPool) / sizeof(m_stackPool[0]))); - } - } - } - } - } - }); - threadPool.ParallelExecute(EnumerateSmallBvh); - - m_bvhBuildState.m_parentsArray += sum; - m_bvhBuildState.m_leafNodesCount += sum; - m_bvhBuildState.m_depthLevel++; - } - } -} - -ndBvhNode* ndBvhSceneManager::BuildIncrementalBvhTree(ndThreadPool& threadPool) -{ - D_TRACKTIME(); - ndBvhNode* root = nullptr; - switch (m_bvhBuildState.m_state) - { - case ndBuildBvhTreeBuildState::m_beginBuild: - { - if (BuildBvhTreeInitNodes(threadPool)) - { - m_bvhBuildState.m_state = m_bvhBuildState.m_calculateBoxes; - } - break; - } - - case ndBuildBvhTreeBuildState::m_calculateBoxes: - { - BuildBvhTreeCalculateLeafBoxes(threadPool); - m_bvhBuildState.m_state = m_bvhBuildState.m_buildLayer; - break; - } - - case ndBuildBvhTreeBuildState::m_buildLayer: - { - if (m_bvhBuildState.m_leafNodesCount > 1) - { - m_bvhBuildState.m_size = m_bvhBuildState.m_size * ndVector::m_two; - BuildBvhGenerateLayerGrids(threadPool); - } - else - { - m_bvhBuildState.m_root = m_bvhBuildState.m_srcArray[0]; - m_bvhBuildState.m_state = m_bvhBuildState.m_enumerateLayers; - } - break; - } - - case ndBuildBvhTreeBuildState::m_enumerateLayers: - { - BuildBvhTreeSetNodesDepth(threadPool); - m_bvhBuildState.m_state = m_bvhBuildState.m_endBuild; - break; - } - - case ndBuildBvhTreeBuildState::m_endBuild: - { - root = m_bvhBuildState.m_root; - ndAssert(m_bvhBuildState.m_root->SanityCheck(0)); - m_bvhBuildState.m_state = m_bvhBuildState.m_beginBuild; - break; - } - - default: - ndAssert(0); - } - return root; -} - -ndBvhNode* ndBvhSceneManager::BuildBvhTree(ndThreadPool& threadPool) -{ - D_TRACKTIME(); - - //while (!BuildIncrementalBvhTree()); - - if (!BuildBvhTreeInitNodes(threadPool)) - { - return nullptr; - } - - BuildBvhTreeCalculateLeafBoxes(threadPool); - while (m_bvhBuildState.m_leafNodesCount > 1) - { - m_bvhBuildState.m_size = m_bvhBuildState.m_size * ndVector::m_two; - BuildBvhGenerateLayerGrids(threadPool); - } - - m_bvhBuildState.m_root = m_bvhBuildState.m_srcArray[0]; - - BuildBvhTreeSetNodesDepth(threadPool); - ndAssert(m_bvhBuildState.m_root->SanityCheck(0)); - - return m_bvhBuildState.m_root; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBvhNode.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBvhNode.h deleted file mode 100644 index 374433261c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndBvhNode.h +++ /dev/null @@ -1,330 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SCENE_NODE_H__ -#define __ND_SCENE_NODE_H__ - -#include "ndCollisionStdafx.h" - -class ndBodyKinematic; -class ndBvhLeafNode; -class ndBvhInternalNode; - -D_MSV_NEWTON_ALIGN_32 -class ndBvhNode : public ndContainersFreeListAlloc -{ - public: - ndBvhNode(ndBvhNode* const parent); - ndBvhNode(const ndBvhNode& src); - virtual ~ndBvhNode(); - virtual ndBvhNode* Clone() const; - - void Kill(); - void GetAabb(ndVector& minBox, ndVector& maxBox) const; - void SetAabb(const ndVector& minBox, const ndVector& maxBox); - - virtual ndBvhNode* GetAsSceneNode() const; - virtual ndBvhLeafNode* GetAsSceneBodyNode() const; - virtual ndBvhInternalNode* GetAsSceneTreeNode() const; - - virtual ndBvhNode* GetLeft() const; - virtual ndBvhNode* GetRight() const; - virtual ndBodyKinematic* GetBody() const; - - virtual bool SanityCheck(ndUnsigned32 level) const; - - ndVector m_minBox; - ndVector m_maxBox; - ndBvhNode* m_parent; - ndSpinLock m_lock; - ndInt32 m_depthLevel; - ndUnsigned8 m_isDead; - ndUnsigned8 m_bhvLinked; -#ifdef _DEBUG - ndInt32 m_nodeId; -#endif - - static ndVector m_aabbQuantization; - static ndVector m_aabbInvQuantization; -} D_GCC_NEWTON_ALIGN_32 ; - -class ndBvhInternalNode: public ndBvhNode -{ - public: - ndBvhInternalNode(); - ndBvhInternalNode(const ndBvhInternalNode& src); - virtual ~ndBvhInternalNode(); - virtual ndBvhNode* Clone() const; - - virtual ndBvhNode* GetLeft() const; - virtual ndBvhNode* GetRight() const; - virtual ndBvhInternalNode* GetAsSceneTreeNode() const; - - bool SanityCheck(ndUnsigned32 level) const; - - ndBvhNode* m_left; - ndBvhNode* m_right; -} D_GCC_NEWTON_ALIGN_32; - -class ndBvhLeafNode : public ndBvhNode -{ - public: - ndBvhLeafNode(ndBodyKinematic* const body); - ndBvhLeafNode(const ndBvhLeafNode& src); - virtual ~ndBvhLeafNode(); - - virtual ndBvhNode* Clone() const; - virtual ndBodyKinematic* GetBody() const; - virtual ndBvhLeafNode* GetAsSceneBodyNode() const; - - ndBodyKinematic* m_body; -}; - -class ndBottomUpCell -{ - public: - ndInt32 m_x; - ndInt32 m_y; - ndInt32 m_z; - ndBvhNode* m_node; -}; - -class ndCellScanPrefix -{ - public: - ndInt32 m_location : 30; - ndUnsigned32 m_cellTest : 1; -}; - -class ndBuildBvhTreeBuildState -{ - public: - enum ndState - { - m_beginBuild, - m_calculateBoxes, - m_buildLayer, - m_enumerateLayers, - m_endBuild, - }; - - ndBuildBvhTreeBuildState(); - - void Init(ndInt32 maxCount); - - ndVector m_size; - ndVector m_origin; - ndArray m_cellBuffer0; - ndArray m_cellBuffer1; - ndArray m_cellCounts0; - ndArray m_cellCounts1; - ndArray m_tempNodeBuffer; - - ndBvhNode* m_root; - ndBvhNode** m_srcArray; - ndBvhNode** m_tmpArray; - ndBvhNode** m_parentsArray; - - ndInt32 m_depthLevel; - ndInt32 m_leafNodesCount; - ndState m_state; -}; - -class ndBvhNodeArray : public ndArray -{ - public: - ndBvhNodeArray(); - ndBvhNodeArray(const ndBvhNodeArray& src); - ~ndBvhNodeArray(); - - void CleanUp(); - void Swap(ndBvhNodeArray& src); - - ndUnsigned32 m_isDirty; - ndUnsigned32 m_scansCount; - ndUnsigned32 m_scans[256 + 32]; -}; - -class ndBvhSceneManager -{ - public: - ndBvhSceneManager(); - ndBvhSceneManager(const ndBvhSceneManager& src); - ~ndBvhSceneManager(); - - void CleanUp(); - ndBvhNode* AddBody(ndBodyKinematic* const body, ndBvhNode* root); - void RemoveBody(ndBodyKinematic* const body); - - void UpdateScene(ndThreadPool& threadPool); - ndBvhNode* BuildBvhTree(ndThreadPool& threadPool); - - ndBvhNodeArray& GetNodeArray(); - ndBvhLeafNode* GetLeafNode(ndBodyKinematic* const body) const; - - private: - void Update(ndThreadPool& threadPool); - bool BuildBvhTreeInitNodes(ndThreadPool& threadPool); - void BuildBvhTreeSetNodesDepth(ndThreadPool& threadPool); - void BuildBvhGenerateLayerGrids(ndThreadPool& threadPool); - void BuildBvhTreeCalculateLeafBoxes(ndThreadPool& threadPool); - - ndBvhNode* BuildIncrementalBvhTree(ndThreadPool& threadPool); - ndInt32 BuildSmallBvhTree(ndThreadPool& threadPool, ndBvhNode** const parentsArray, ndInt32 bashCount); - - ndBvhNodeArray m_workingArray; - ndBuildBvhTreeBuildState m_bvhBuildState; -}; - - -// ************************************************************** -// -// inline functions -// -// ************************************************************** -inline ndBvhNode::ndBvhNode(ndBvhNode* const parent) - :ndContainersFreeListAlloc() - ,m_minBox(ndFloat32(-1.0e15f)) - ,m_maxBox(ndFloat32(1.0e15f)) - ,m_parent(parent) - ,m_lock() - ,m_depthLevel(0) - ,m_isDead(0) - ,m_bhvLinked(0) -{ -#ifdef _DEBUG - m_nodeId = 0; -#endif -} - -inline ndBvhNode::ndBvhNode(const ndBvhNode& src) - :ndContainersFreeListAlloc() - ,m_minBox(src.m_minBox) - ,m_maxBox(src.m_maxBox) - ,m_parent(nullptr) - ,m_lock() - ,m_depthLevel(0) - ,m_isDead(0) - ,m_bhvLinked(0) -{ -#ifdef _DEBUG - m_nodeId = 0; -#endif -} - -inline ndBvhNode::~ndBvhNode() -{ -} - -inline ndBvhNode* ndBvhNode::GetAsSceneNode() const -{ - return (ndBvhNode*)this; -} - -inline ndBvhLeafNode* ndBvhNode::GetAsSceneBodyNode() const -{ - return nullptr; -} - -inline ndBvhInternalNode* ndBvhNode::GetAsSceneTreeNode() const -{ - return nullptr; -} - -inline ndBodyKinematic* ndBvhNode::GetBody() const -{ - return nullptr; -} - -inline ndBvhNode* ndBvhNode::GetLeft() const -{ - return nullptr; -} - -inline ndBvhNode* ndBvhNode::GetRight() const -{ - return nullptr; -} - -inline void ndBvhNode::Kill() -{ - m_isDead = 1; -} - -inline void ndBvhNode::GetAabb(ndVector& minBox, ndVector& maxBox) const -{ - minBox = m_minBox; - maxBox = m_maxBox; -} - -inline void ndBvhNode::SetAabb(const ndVector& minBox, const ndVector& maxBox) -{ - ndAssert(minBox.m_x <= maxBox.m_x); - ndAssert(minBox.m_y <= maxBox.m_y); - ndAssert(minBox.m_z <= maxBox.m_z); - - const ndVector p0(minBox * m_aabbQuantization); - const ndVector p1(maxBox * m_aabbQuantization + ndVector::m_one); - - m_minBox = p0.Floor() * m_aabbInvQuantization; - m_maxBox = p1.Floor() * m_aabbInvQuantization; - - ndAssert(m_minBox.m_w == ndFloat32(0.0f)); - ndAssert(m_maxBox.m_w == ndFloat32(0.0f)); -} - -inline ndBvhNode* ndBvhNode::Clone() const -{ - ndAssert(0); - return nullptr; -} - -inline ndBvhLeafNode* ndBvhLeafNode::GetAsSceneBodyNode() const -{ - return (ndBvhLeafNode*)this; -} - -inline ndBodyKinematic* ndBvhLeafNode::GetBody() const -{ - return m_body; -} - -inline ndBvhInternalNode* ndBvhInternalNode::GetAsSceneTreeNode() const -{ - return (ndBvhInternalNode*)this; -} - -inline ndBvhNode* ndBvhInternalNode::GetLeft() const -{ - return m_left; -} - -inline ndBvhNode* ndBvhInternalNode::GetRight() const -{ - return m_right; -} - -inline ndBvhNodeArray& ndBvhSceneManager::GetNodeArray() -{ - return m_workingArray; -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndCollision.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndCollision.h deleted file mode 100644 index 335a35e902..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndCollision.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#ifndef __ND_COLLISION_H__ -#define __ND_COLLISION_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ndBodySphFluid_New.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndCollisionStdafx.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndCollisionStdafx.cpp deleted file mode 100644 index 866c585ff4..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndCollisionStdafx.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" - -#if defined (_D_COLLISION_DLL) && !defined (_D_SINGLE_LIBRARY) - - #ifndef D_USE_DEFAULT_NEW_AND_DELETE - void *operator new (size_t size) - { - // this should not happens on this test - // newton should never use global operator new and delete. - return ndMemory::Malloc(size); - } - - void operator delete (void* ptr) - { - ndMemory::Free(ptr); - } - #endif - -#if (defined(WIN32) || defined(_WIN32)) - BOOL APIENTRY DllMain(HMODULE , DWORD ul_reason_for_call, LPVOID ) - { - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; - } -#endif -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndCollisionStdafx.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndCollisionStdafx.h deleted file mode 100644 index 3eaa0cd584..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndCollisionStdafx.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - - -#ifndef _ND_COLLISION_STDAFX_H__ -#define _ND_COLLISION_STDAFX_H__ - -#include - -#ifdef _D_COLLISION_DLL - #ifdef _D_COLLISION_EXPORT_DLL - #define D_COLLISION_API D_LIBRARY_EXPORT - #else - #define D_COLLISION_API D_LIBRARY_IMPORT - #endif -#else - #define D_COLLISION_API -#endif - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConstraint.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConstraint.cpp deleted file mode 100644 index 909c60cff9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConstraint.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndBody.h" -#include "ndContact.h" -#include "ndConstraint.h" -#include "ndBodyKinematic.h" - -void ndForceImpactPair::Clear() -{ - m_force = ndFloat32(ndFloat32(0.0f)); - m_impact = ndFloat32(ndFloat32(0.0f)); - for (ndInt32 i = 0; i < ndInt32(sizeof(m_initialGuess) / sizeof(m_initialGuess[0])); ++i) - { - m_initialGuess[i] = ndFloat32(ndFloat32(0.0f)); - } -} - -void ndForceImpactPair::Push(ndFloat32 val) -{ - for (ndInt32 i = 1; i < ndInt32(sizeof(m_initialGuess) / sizeof(m_initialGuess[0])); ++i) - { - m_initialGuess[i - 1] = m_initialGuess[i]; - } - m_initialGuess[sizeof(m_initialGuess) / sizeof(m_initialGuess[0]) - 1] = val; -} - -ndFloat32 ndForceImpactPair::GetInitialGuess() const -{ - //return 100.0f; - ndFloat32 smallest = ndFloat32(1.0e15f); - ndFloat32 value = ndFloat32(ndFloat32(0.0f)); - for (ndInt32 i = 0; i < ndInt32(sizeof(m_initialGuess) / sizeof(m_initialGuess[0])); ++i) - { - ndFloat32 mag = ndAbs(m_initialGuess[i]); - if (mag < smallest) - { - smallest = mag; - value = m_initialGuess[i]; - } - } - return value; -} - - -ndConstraint::ndConstraint() - :ndContainersFreeListAlloc() - ,m_forceBody0(ndVector::m_zero) - ,m_torqueBody0(ndVector::m_zero) - ,m_forceBody1(ndVector::m_zero) - ,m_torqueBody1(ndVector::m_zero) - ,m_body0(nullptr) - ,m_body1(nullptr) - ,m_rowCount(0) - ,m_rowStart(0) - ,m_maxDof(0) - ,m_active(1) - ,m_fence0(0) - ,m_fence1(0) - ,m_resting(0) - ,m_isInSkeletonLoop(0) -{ -} - -void ndConstraint::InitPointParam(ndPointParam& param, const ndVector& p0Global, const ndVector& p1Global) const -{ - ndBodyKinematic* const body0 = GetBody0(); - ndBodyKinematic* const body1 = GetBody1(); - ndAssert(body0); - ndAssert(body1); - - param.m_posit0 = p0Global; - param.m_posit1 = p1Global; - - param.m_r0 = (p0Global - body0->m_globalCentreOfMass) & ndVector::m_triplexMask; - param.m_r1 = (p1Global - body1->m_globalCentreOfMass) & ndVector::m_triplexMask; -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConstraint.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConstraint.h deleted file mode 100644 index b4c8c5e9a7..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConstraint.h +++ /dev/null @@ -1,328 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONSTRAINT_H__ -#define __ND_CONSTRAINT_H__ - -#include "ndCollisionStdafx.h" - -#define D_MAX_BOUND D_LCP_MAX_VALUE -#define D_MIN_BOUND (-D_LCP_MAX_VALUE) -#define D_INDEPENDENT_ROW -1 -#define D_CONSTRAINT_MAX_ROWS (3 * 16) - -class ndBody; -class ndContact; -class ndConstraint; -class ndLeftHandSide; -class ndRightHandSide; -class ndBodyKinematic; -class ndJointBilateralConstraint; - -D_MSV_NEWTON_ALIGN_32 -class ndConstraintDebugCallback: public ndClassAlloc -{ - public: - ndConstraintDebugCallback() - { - m_debugScale = ndFloat32(1.0f); - } - - virtual ~ndConstraintDebugCallback() - { - } - - virtual void DrawPoint(const ndVector& point, const ndVector& color, ndFloat32 thickness = ndFloat32 (8.0f)) = 0; - virtual void DrawLine(const ndVector& p0, const ndVector& p1, const ndVector& color, ndFloat32 thickness = ndFloat32(1.0f)) = 0; - - virtual void SetScale(ndFloat32 scale) - { - m_debugScale = scale; - } - - virtual ndFloat32 GetScale() const - { - return m_debugScale; - } - - virtual void DrawFrame(const ndMatrix& matrix, ndFloat32 intensity = ndFloat32 (1.0f)) - { - ndVector x(matrix.m_posit + matrix.RotateVector(ndVector(m_debugScale, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)))); - DrawLine(matrix.m_posit, x, ndVector(intensity, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f))); - - ndVector y(matrix.m_posit + matrix.RotateVector(ndVector(ndFloat32(0.0f), m_debugScale, ndFloat32(0.0f), ndFloat32(0.0f)))); - DrawLine(matrix.m_posit, y, ndVector(ndFloat32(0.0f), intensity, ndFloat32(0.0f), ndFloat32(1.0f))); - - ndVector z(matrix.m_posit + matrix.RotateVector(ndVector(ndFloat32(0.0f), ndFloat32(0.0f), m_debugScale, ndFloat32(0.0f)))); - DrawLine(matrix.m_posit, z, ndVector(ndFloat32(0.0f), ndFloat32(0.0f), intensity, ndFloat32(1.0f))); - } - - virtual void DrawArrow(const ndMatrix& matrix, const ndVector& color, ndFloat32 length) - { - ndVector p1(matrix.m_posit + matrix.RotateVector(ndVector(m_debugScale * length, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)))); - DrawLine(matrix.m_posit, p1, color); - } - - ndFloat32 m_debugScale; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndPointParam -{ - public: - ndVector m_r0; - ndVector m_r1; - ndVector m_posit0; - ndVector m_posit1; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndJacobian -{ - public: - ndVector m_linear; - ndVector m_angular; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndJacobianPair -{ - public: - ndJacobian m_jacobianM0; - ndJacobian m_jacobianM1; -} D_GCC_NEWTON_ALIGN_32; - -class ndForceImpactPair -{ - public: - ndForceImpactPair() - { - Clear(); - } - - void Clear(); - void Push(ndFloat32 val); - ndFloat32 GetInitialGuess() const; - - ndFloat32 m_force; - ndFloat32 m_impact; - ndFloat32 m_initialGuess[4]; -}; - -class ndJointAccelerationDecriptor -{ - public: - ndInt32 m_rowsCount; - ndFloat32 m_timestep; - ndFloat32 m_invTimestep; - ndFloat32 m_firstPassCoefFlag; - ndRightHandSide* m_rightHandSide; - const ndLeftHandSide* m_leftHandSide; -}; - -class ndBilateralBounds -{ - public: - ndForceImpactPair* m_jointForce; - ndFloat32 m_low; - ndFloat32 m_upper; - ndInt32 m_normalIndex; -}; - -D_MSV_NEWTON_ALIGN_32 -class ndConstraintDescritor -{ - public: - ndJacobianPair m_jacobian[D_CONSTRAINT_MAX_ROWS]; - ndBilateralBounds m_forceBounds[D_CONSTRAINT_MAX_ROWS]; - ndFloat32 m_jointSpeed[D_CONSTRAINT_MAX_ROWS]; - ndFloat32 m_jointAccel[D_CONSTRAINT_MAX_ROWS]; - ndFloat32 m_restitution[D_CONSTRAINT_MAX_ROWS]; - ndFloat32 m_penetration[D_CONSTRAINT_MAX_ROWS]; - ndFloat32 m_diagonalRegularizer[D_CONSTRAINT_MAX_ROWS]; - ndFloat32 m_penetrationStiffness[D_CONSTRAINT_MAX_ROWS]; - ndFloat32 m_zeroRowAcceleration[D_CONSTRAINT_MAX_ROWS]; - ndInt32 m_flags[D_CONSTRAINT_MAX_ROWS]; - ndFloat32 m_timestep; - ndFloat32 m_invTimestep; - ndInt32 m_rowsCount; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndLeftHandSide -{ - public: - ndJacobianPair m_Jt; - ndJacobianPair m_JMinv; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndRightHandSide -{ - public: - ndFloat32 m_force; - ndFloat32 m_diagDamp; - ndFloat32 m_invJinvMJt; - ndFloat32 m_coordenateAccel; - - ndFloat32 m_lowerBoundFrictionCoefficent; - ndFloat32 m_upperBoundFrictionCoefficent; - ndFloat32 m_deltaAccel; - ndFloat32 m_restitution; - - ndFloat32 m_maxImpact; - ndFloat32 m_penetration; - ndFloat32 m_diagonalRegularizer; - ndFloat32 m_penetrationStiffness; - - ndForceImpactPair* m_jointFeebackForce; - ndInt32 m_normalForceIndex; - ndInt32 m_normalForceIndexFlat; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndConstraint: public ndContainersFreeListAlloc -{ - public: - // add some reflexion to the classes - D_BASE_CLASS_REFLECTION(ndConstraint) - - virtual ~ndConstraint(); - - virtual bool IsBilateral() const; - virtual ndContact* GetAsContact(); - virtual ndJointBilateralConstraint* GetAsBilateral(); - - bool IsActive() const; - void SetActive(bool state); - - ndUnsigned32 GetRowsCount() const; - virtual void JacobianDerivative(ndConstraintDescritor& desc) = 0; - virtual void JointAccelerations(ndJointAccelerationDecriptor* const desc) = 0; - - ndVector GetForceBody0() const; - ndVector GetTorqueBody0() const; - ndVector GetForceBody1() const; - ndVector GetTorqueBody1() const; - ndBodyKinematic* GetBody0() const; - ndBodyKinematic* GetBody1() const; - - virtual void DebugJoint(ndConstraintDebugCallback&) const; - void InitPointParam(ndPointParam& param, const ndVector& p0Global, const ndVector& p1Global) const; - - protected: - ndConstraint(); - virtual void ClearMemory() = 0; - - ndVector m_forceBody0; - ndVector m_torqueBody0; - ndVector m_forceBody1; - ndVector m_torqueBody1; - ndBodyKinematic* m_body0; - ndBodyKinematic* m_body1; - - ndInt32 m_rowCount; - ndInt32 m_rowStart; - ndUnsigned8 m_maxDof; - ndUnsigned8 m_active; - ndUnsigned8 m_fence0; - ndUnsigned8 m_fence1; - ndUnsigned8 m_resting; // this should be identical to m_fence0, should be removed. - ndUnsigned8 m_isInSkeletonLoop; - - friend class ndIkSolver; - friend class ndBodyKinematic; - friend class ndDynamicsUpdate; - friend class ndSkeletonContainer; - friend class ndDynamicsUpdateSoa; - friend class ndDynamicsUpdateAvx2; -} D_GCC_NEWTON_ALIGN_32 ; - -inline ndConstraint::~ndConstraint() -{ -} - -inline ndContact* ndConstraint::GetAsContact() -{ - return nullptr; -} - -inline ndJointBilateralConstraint* ndConstraint::GetAsBilateral() -{ - return nullptr; -} - -inline bool ndConstraint::IsActive() const -{ - return m_active ? true : false; -} - -inline void ndConstraint::SetActive(bool state) -{ - m_active = ndUnsigned8(state ? 1 : 0); -} - -inline bool ndConstraint::IsBilateral() const -{ - return false; -} - -inline ndUnsigned32 ndConstraint::GetRowsCount() const -{ - return m_maxDof; -} - -inline ndBodyKinematic* ndConstraint::GetBody0() const -{ - return m_body0; -} - -inline ndBodyKinematic* ndConstraint::GetBody1() const -{ - return m_body1; -} - -inline void ndConstraint::DebugJoint(ndConstraintDebugCallback&) const -{ -} - -inline ndVector ndConstraint::GetForceBody0() const -{ - return m_forceBody0; -} - -inline ndVector ndConstraint::GetTorqueBody0() const -{ - return m_torqueBody0; -} - -inline ndVector ndConstraint::GetForceBody1() const -{ - return m_forceBody1; -} - -inline ndVector ndConstraint::GetTorqueBody1() const -{ - return m_torqueBody1; -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContact.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContact.cpp deleted file mode 100644 index b9d033b62d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContact.cpp +++ /dev/null @@ -1,370 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndScene.h" -#include "ndContact.h" -#include "ndBodyKinematic.h" -#include "ndContactOptions.h" - -ndVector ndContact::m_initialSeparatingVector(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - -#define D_REST_RELATIVE_VELOCITY ndFloat32 (1.0e-3f) -#define D_MAX_DYNAMIC_FRICTION_SPEED ndFloat32 (0.3f) -#define D_MAX_PENETRATION_STIFFNESS ndFloat32 (50.0f) -#define D_DIAGONAL_REGULARIZER ndFloat32 (1.0e-3f) - -ndContact::ndContact() - :ndConstraint() - ,m_positAcc(ndFloat32(10.0f)) - ,m_rotationAcc() - ,m_separatingVector(m_initialSeparatingVector) - ,m_contacPointsList() - ,m_material(nullptr) - ,m_timeOfImpact(ndFloat32(1.0e10f)) - ,m_separationDistance(ndFloat32(0.0f)) - ,m_sceneLru(0) - ,m_isDead(0) - ,m_inTrigger(0) - ,m_isAttached(0) - ,m_isIntersetionTestOnly(0) - //,m_skeletonIntraCollision(1) - ,m_skeletonSelftCollision(1) -{ - m_active = 0; -} - -ndContact::~ndContact() -{ -} - -void ndContact::SetBodies(ndBodyKinematic* const body0, ndBodyKinematic* const body1) -{ - ndAssert(body0); - ndAssert(body1); - m_body0 = body0; - m_body1 = body1; - if (m_body0->GetInvMass() == ndFloat32(0.0f)) - { - ndSwap(m_body1, m_body0); - } - ndAssert(m_body0->GetInvMass() > ndFloat32(0.0f)); -} - -void ndContact::ClearMemory() -{ - ndContactPointList& contacts = GetContactPoints(); - for (ndContactPointList::ndNode* node = contacts.GetFirst(); node; node = node->GetNext()) - { - ndContactMaterial& contact = node->GetInfo(); - contact.m_dir0_Force.Clear(); - contact.m_dir1_Force.Clear(); - contact.m_normal_Force.Clear(); - } -} - -void ndContact::InitSurrogateContact(ndContact* const surrogate, ndBodyKinematic* const body0, ndBodyKinematic* const body1) const -{ - ndAssert(m_body0->GetInvMass() > ndFloat32(0.0f)); - surrogate->m_body0 = body0; - surrogate->m_body1 = body1; - - surrogate->m_forceBody0 = m_forceBody0; - surrogate->m_forceBody1 = m_forceBody1; - surrogate->m_torqueBody0 = m_torqueBody0; - surrogate->m_torqueBody1 = m_torqueBody1; - - surrogate->m_active = m_active; - surrogate->m_contacPointsList.RemoveAll(); - for (ndContactPointList::ndNode* node = m_contacPointsList.GetFirst(); node; node = node->GetNext()) - { - const ndContactMaterial& contact = node->GetInfo(); - surrogate->m_contacPointsList.Append(contact); - } -} - -void ndContact::AttachToBodies() -{ - m_isAttached = true; - m_body0->AttachContact(this); - m_body1->AttachContact(this); -} - -void ndContact::DetachFromBodies() -{ - m_isAttached = false; - m_body0->DetachContact(this); - m_body1->DetachContact(this); -} - -void ndContact::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndInt32 frictionIndex = 0; - if (m_maxDof) - { - ndInt32 i = 0; - frictionIndex = m_contacPointsList.GetCount(); - for (ndContactPointList::ndNode* node = m_contacPointsList.GetFirst(); node; node = node->GetNext()) - { - const ndContactMaterial& contact = node->GetInfo(); - JacobianContactDerivative(desc, contact, i, frictionIndex); - i++; - } - } - desc.m_rowsCount = frictionIndex; -} - -void ndContact::CalculatePointDerivative(ndInt32 index, ndConstraintDescritor& desc, const ndVector& dir, const ndPointParam& param) const -{ - ndAssert(m_body0); - ndAssert(m_body1); - - ndJacobian &jacobian0 = desc.m_jacobian[index].m_jacobianM0; - ndJacobian &jacobian1 = desc.m_jacobian[index].m_jacobianM1; - jacobian0.m_linear = dir; - jacobian1.m_linear = dir * ndVector::m_negOne; - - jacobian0.m_angular = param.m_r0.CrossProduct(dir); - jacobian1.m_angular = dir.CrossProduct(param.m_r1); - - ndAssert(jacobian0.m_linear.m_w == ndFloat32(0.0f)); - ndAssert(jacobian0.m_angular.m_w == ndFloat32(0.0f)); - ndAssert(jacobian1.m_linear.m_w == ndFloat32(0.0f)); - ndAssert(jacobian1.m_angular.m_w == ndFloat32(0.0f)); -} - -void ndContact::JacobianContactDerivative(ndConstraintDescritor& desc, const ndContactMaterial& contact, ndInt32 normalIndex, ndInt32& frictionIndex) -{ - ndPointParam pointData; - InitPointParam(pointData, contact.m_point, contact.m_point); - CalculatePointDerivative(normalIndex, desc, contact.m_normal, pointData); - - const ndVector omega0(m_body0->GetOmega()); - const ndVector omega1(m_body1->GetOmega()); - const ndVector veloc0(m_body0->GetVelocity()); - const ndVector veloc1(m_body1->GetVelocity()); - const ndVector gyroAlpha0(m_body0->GetGyroAlpha()); - const ndVector gyroAlpha1(m_body1->GetGyroAlpha()); - - ndAssert(contact.m_normal.m_w == ndFloat32(0.0f)); - const ndJacobian& normalJacobian0 = desc.m_jacobian[normalIndex].m_jacobianM0; - const ndJacobian& normalJacobian1 = desc.m_jacobian[normalIndex].m_jacobianM1; - const ndFloat32 restitutionCoefficient = contact.m_material.m_restitution; - - ndFloat32 relSpeed = -(normalJacobian0.m_linear * veloc0 + normalJacobian0.m_angular * omega0 + normalJacobian1.m_linear * veloc1 + normalJacobian1.m_angular * omega1).AddHorizontal().GetScalar(); - ndFloat32 penetration = ndClamp(contact.m_penetration - D_RESTING_CONTACT_PENETRATION, ndFloat32(0.0f), ndFloat32(0.5f)); - desc.m_flags[normalIndex] = ndInt32(contact.m_material.m_flags & m_isSoftContact); - desc.m_jointSpeed[normalIndex] = ndFloat32 (0.0f); - desc.m_penetration[normalIndex] = penetration; - desc.m_restitution[normalIndex] = restitutionCoefficient; - desc.m_forceBounds[normalIndex].m_low = ndFloat32(0.0f); - desc.m_forceBounds[normalIndex].m_normalIndex = D_INDEPENDENT_ROW; - desc.m_forceBounds[normalIndex].m_jointForce = (ndForceImpactPair*)&contact.m_normal_Force; - - const ndFloat32 restitutionVelocity = (relSpeed > D_REST_RELATIVE_VELOCITY) ? relSpeed * restitutionCoefficient : ndFloat32(0.0f); - const ndFloat32 penetrationStiffness = D_MAX_PENETRATION_STIFFNESS * contact.m_material.m_softness; - const ndFloat32 penetrationVeloc = penetration * penetrationStiffness; - ndAssert(ndAbs(penetrationVeloc - D_MAX_PENETRATION_STIFFNESS * contact.m_material.m_softness * penetration) < ndFloat32(1.0e-6f)); - desc.m_penetrationStiffness[normalIndex] = penetrationStiffness; - - const bool isHardContact = !(contact.m_material.m_flags & m_isSoftContact); - desc.m_diagonalRegularizer[normalIndex] = isHardContact ? D_DIAGONAL_REGULARIZER : ndMax(D_DIAGONAL_REGULARIZER, contact.m_material.m_skinMargin); - const ndFloat32 relGyro = (normalJacobian0.m_angular * gyroAlpha0 + normalJacobian1.m_angular * gyroAlpha1).AddHorizontal().GetScalar(); -#if 0 - // this seem really wrong, and could cause really bad stuff - // check it out - relSpeed += ndMax(restitutionVelocity, penetrationVeloc); - desc.m_jointAccel[normalIndex] = relGyro + relSpeed * desc.m_timestep; -#else - // correct restititioan calculation, may be more unsatble. - relSpeed = ndMax(restitutionVelocity, penetrationVeloc); - desc.m_jointAccel[normalIndex] = ndMax (relGyro + relSpeed * desc.m_invTimestep, ndFloat32 (0.0f)); -#endif - ndAssert(desc.m_jointAccel[normalIndex] >= ndFloat32(0.0f)); - - if (contact.m_material.m_flags & m_overrideNormalAccel) - { - ndAssert(0); - desc.m_jointAccel[normalIndex] += contact.m_normal_Force.m_force; - } - //return; - - // first dir friction force - if (contact.m_material.m_flags & m_friction0Enable) - { - ndInt32 jacobIndex = frictionIndex; - frictionIndex += 1; - ndAssert(contact.m_dir0.m_w == ndFloat32(0.0f)); - CalculatePointDerivative(jacobIndex, desc, contact.m_dir0, pointData); - - const ndJacobian &jacobian0 = desc.m_jacobian[jacobIndex].m_jacobianM0; - const ndJacobian &jacobian1 = desc.m_jacobian[jacobIndex].m_jacobianM1; - ndFloat32 relVelocErr = -(jacobian0.m_linear * veloc0 + jacobian0.m_angular * omega0 + jacobian1.m_linear * veloc1 + jacobian1.m_angular * omega1).AddHorizontal().GetScalar(); - - desc.m_flags[jacobIndex] = 0; - desc.m_forceBounds[jacobIndex].m_normalIndex = (contact.m_material.m_flags & m_override0Friction) ? D_INDEPENDENT_ROW : normalIndex; - desc.m_diagonalRegularizer[jacobIndex] = D_DIAGONAL_REGULARIZER; - - desc.m_restitution[jacobIndex] = ndFloat32(0.0f); - desc.m_penetration[jacobIndex] = ndFloat32(0.0f); - desc.m_jointSpeed[normalIndex] = ndFloat32(0.0f); - - desc.m_penetrationStiffness[jacobIndex] = ndFloat32(0.0f); - if (contact.m_material.m_flags & m_override0Accel) - { - // note: using restitution been negative to indicate that the acceleration was override - desc.m_restitution[jacobIndex] = ndFloat32(-1.0f); - desc.m_jointAccel[jacobIndex] = contact.m_dir0_Force.m_force; - } - else - { - const ndFloat32 relFrictionGyro = (jacobian0.m_angular * gyroAlpha0 + jacobian1.m_angular * gyroAlpha1).AddHorizontal().GetScalar(); - desc.m_restitution[jacobIndex] = ndFloat32(0.0f); - //desc.m_jointAccel[jacobIndex] = relFrictionGyro + relVelocErr * desc.m_timestep; - desc.m_jointAccel[jacobIndex] = relFrictionGyro + relVelocErr * desc.m_invTimestep; - } - if (ndAbs(relVelocErr) > D_MAX_DYNAMIC_FRICTION_SPEED) - { - desc.m_forceBounds[jacobIndex].m_low = -contact.m_material.m_dynamicFriction0; - desc.m_forceBounds[jacobIndex].m_upper = contact.m_material.m_dynamicFriction0; - } - else - { - desc.m_forceBounds[jacobIndex].m_low = -contact.m_material.m_staticFriction0; - desc.m_forceBounds[jacobIndex].m_upper = contact.m_material.m_staticFriction0; - } - desc.m_forceBounds[jacobIndex].m_jointForce = (ndForceImpactPair*)&contact.m_dir0_Force; - } - - if (contact.m_material.m_flags & m_friction1Enable) - { - ndInt32 jacobIndex = frictionIndex; - frictionIndex += 1; - ndAssert(contact.m_dir1.m_w == ndFloat32(0.0f)); - CalculatePointDerivative(jacobIndex, desc, contact.m_dir1, pointData); - - const ndJacobian &jacobian0 = desc.m_jacobian[jacobIndex].m_jacobianM0; - const ndJacobian &jacobian1 = desc.m_jacobian[jacobIndex].m_jacobianM1; - ndFloat32 relVelocErr = -(jacobian0.m_linear * veloc0 + jacobian0.m_angular * omega0 + jacobian1.m_linear * veloc1 + jacobian1.m_angular * omega1).AddHorizontal().GetScalar(); - - desc.m_flags[jacobIndex] = 0; - desc.m_forceBounds[jacobIndex].m_normalIndex = (contact.m_material.m_flags & m_override1Friction) ? D_INDEPENDENT_ROW : normalIndex; - desc.m_diagonalRegularizer[jacobIndex] = D_DIAGONAL_REGULARIZER; - - desc.m_restitution[jacobIndex] = ndFloat32(0.0f); - desc.m_penetration[jacobIndex] = ndFloat32(0.0f); - desc.m_jointSpeed[normalIndex] = ndFloat32(0.0f); - desc.m_penetrationStiffness[jacobIndex] = ndFloat32(0.0f); - if (contact.m_material.m_flags & m_override1Accel) - { - // note: using restitution been negative to indicate that the acceleration was override - desc.m_restitution[jacobIndex] = ndFloat32(-1.0f); - desc.m_jointAccel[jacobIndex] = contact.m_dir1_Force.m_force; - } - else - { - const ndFloat32 relFrictionGyro = (jacobian0.m_angular * gyroAlpha0 + jacobian1.m_angular * gyroAlpha1).AddHorizontal().GetScalar(); - desc.m_restitution[jacobIndex] = ndFloat32(0.0f); - //desc.m_jointAccel[jacobIndex] = relFrictionGyro + relVelocErr * desc.m_timestep; - desc.m_jointAccel[jacobIndex] = relFrictionGyro + relVelocErr * desc.m_invTimestep; - } - if (ndAbs(relVelocErr) > D_MAX_DYNAMIC_FRICTION_SPEED) - { - desc.m_forceBounds[jacobIndex].m_low = -contact.m_material.m_dynamicFriction1; - desc.m_forceBounds[jacobIndex].m_upper = contact.m_material.m_dynamicFriction1; - } - else - { - desc.m_forceBounds[jacobIndex].m_low = -contact.m_material.m_staticFriction1; - desc.m_forceBounds[jacobIndex].m_upper = contact.m_material.m_staticFriction1; - } - desc.m_forceBounds[jacobIndex].m_jointForce = (ndForceImpactPair*)&contact.m_dir1_Force; - } -} - -void ndContact::JointAccelerations(ndJointAccelerationDecriptor* const desc) -{ - const ndVector bodyOmega0(m_body0->GetOmega()); - const ndVector bodyOmega1(m_body1->GetOmega()); - const ndVector bodyVeloc0(m_body0->GetVelocity()); - const ndVector bodyVeloc1(m_body1->GetVelocity()); - const ndVector gyroAlpha0(m_body0->GetGyroAlpha()); - const ndVector gyroAlpha1(m_body1->GetGyroAlpha()); - - const ndInt32 count = desc->m_rowsCount; - const ndFloat32 timestep = desc->m_timestep; - const ndFloat32 invTimestep = desc->m_invTimestep; - ndAssert(desc->m_timestep > ndFloat32(0.0f)); - ndAssert(desc->m_invTimestep > ndFloat32(0.0f)); - - ndRightHandSide* const rightHandSide = desc->m_rightHandSide; - const ndLeftHandSide* const leftHandSide = desc->m_leftHandSide; - - for (ndInt32 k = 0; k < count; ++k) - { - // note: using restitution been negative to indicate that the acceleration was override - ndRightHandSide* const rhs = &rightHandSide[k]; - if (rhs->m_restitution >= ndFloat32(0.0f)) - { - const ndLeftHandSide* const row = &leftHandSide[k]; - const ndJacobian& jacobian0 = row->m_Jt.m_jacobianM0; - const ndJacobian& jacobian1 = row->m_Jt.m_jacobianM1; - - ndVector relVeloc(jacobian0.m_linear * bodyVeloc0 + jacobian0.m_angular * bodyOmega0 + jacobian1.m_linear * bodyVeloc1 + jacobian1.m_angular * bodyOmega1); - ndFloat32 vRel = relVeloc.AddHorizontal().GetScalar(); - ndFloat32 aRel = rhs->m_deltaAccel; - - if (rhs->m_normalForceIndex == D_INDEPENDENT_ROW) - { - ndAssert(rhs->m_restitution >= ndFloat32 (0.0f)); - ndAssert(rhs->m_restitution <= ndFloat32(2.0f)); - - ndFloat32 penetrationVeloc = ndFloat32(0.0f); - ndFloat32 restitution = (vRel <= ndFloat32(0.0f)) ? (ndFloat32(1.0f) + rhs->m_restitution) : ndFloat32(1.0f); - if (rhs->m_penetration > D_RESTING_CONTACT_PENETRATION * ndFloat32(0.125f)) - { - if (vRel > ndFloat32(0.0f)) - { - ndFloat32 penetrationCorrection = vRel * timestep; - ndAssert(penetrationCorrection >= ndFloat32(0.0f)); - rhs->m_penetration = ndMax(ndFloat32(0.0f), rhs->m_penetration - penetrationCorrection); - } - else - { - ndFloat32 penetrationCorrection = -vRel * timestep * rhs->m_restitution * ndFloat32(8.0f); - if (penetrationCorrection > rhs->m_penetration) - { - rhs->m_penetration = ndFloat32(0.001f); - } - } - penetrationVeloc = -(rhs->m_penetration * rhs->m_penetrationStiffness); - } - vRel = vRel * restitution + penetrationVeloc; - } - - const ndFloat32 relGyro = (jacobian0.m_angular * gyroAlpha0 + jacobian1.m_angular * gyroAlpha1).AddHorizontal().GetScalar(); - rhs->m_coordenateAccel = relGyro + aRel - vRel * invTimestep; - //dTrace(("%f ", rhs->m_coordenateAccel)); - } - } - //dTrace(("\n")); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContact.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContact.h deleted file mode 100644 index 842deafd43..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContact.h +++ /dev/null @@ -1,194 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONTACT_H__ -#define __ND_CONTACT_H__ - -#include "ndCollisionStdafx.h" -#include "ndConstraint.h" -#include "ndContactNotify.h" -#include "ndContactSolver.h" - -class ndBodyKinematic; -class ndShapeInstance; - -#define D_MAX_CONTATCS 128 -#define D_CONSTRAINT_MAX_ROWS (3 * 16) -#define D_RESTING_CONTACT_PENETRATION (D_PENETRATION_TOL + ndFloat32 (1.0f / 1024.0f)) - -D_MSV_NEWTON_ALIGN_32 -class ndContactPoint -{ - public: - ndVector m_point; - ndVector m_normal; - const ndBodyKinematic* m_body0; - const ndBodyKinematic* m_body1; - const ndShapeInstance* m_shapeInstance0; - const ndShapeInstance* m_shapeInstance1; - ndInt64 m_shapeId0; - ndInt64 m_shapeId1; - ndFloat32 m_penetration; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndContactMaterial: public ndContactPoint -{ - public: - ndContactMaterial() - :m_dir0(ndVector::m_zero) - ,m_dir1(ndVector::m_zero) - ,m_material() - { - m_dir0_Force.Clear(); - m_dir1_Force.Clear(); - m_normal_Force.Clear(); - } - - void OverrideFriction0Accel(ndFloat32 accel) - { - m_dir0_Force.m_force = accel; - m_material.m_flags = m_material.m_flags | m_override0Accel; - } - - void OverrideFriction1Accel(ndFloat32 accel) - { - m_dir1_Force.m_force = accel; - m_material.m_flags = m_material.m_flags | m_override1Accel; - } - - ndVector m_dir0; - ndVector m_dir1; - ndForceImpactPair m_normal_Force; - ndForceImpactPair m_dir0_Force; - ndForceImpactPair m_dir1_Force; - ndMaterial m_material; -} D_GCC_NEWTON_ALIGN_32; - -class ndContactPointList : public ndList> -{ - public: - ndContactPointList() - :ndList>() - { - } -}; - -D_MSV_NEWTON_ALIGN_32 -class ndContact: public ndConstraint -{ - public: - D_COLLISION_API ndContact(); - D_COLLISION_API virtual ~ndContact(); - - D_COLLISION_API void AttachToBodies(); - D_COLLISION_API void DetachFromBodies(); - - const ndMaterial* GetMaterial() const; - - virtual ndContact* GetAsContact(); - virtual void JacobianDerivative(ndConstraintDescritor& desc); - virtual void JointAccelerations(ndJointAccelerationDecriptor* const desc); - - ndContactPointList& GetContactPoints(); - const ndContactPointList& GetContactPoints() const; - - bool IsTestOnly() const; - bool IsInTrigger() const; - bool IsSkeletonSelftCollision() const; - - D_COLLISION_API void InitSurrogateContact(ndContact* const surrogate, ndBodyKinematic* const body0, ndBodyKinematic* const body1) const; - - private: - virtual void ClearMemory(); - void SetBodies(ndBodyKinematic* const body0, ndBodyKinematic* const body1); - void CalculatePointDerivative(ndInt32 index, ndConstraintDescritor& desc, const ndVector& dir, const ndPointParam& param) const; - void JacobianContactDerivative(ndConstraintDescritor& desc, const ndContactMaterial& contact, ndInt32 normalIndex, ndInt32& frictionIndex); - - ndVector m_positAcc; - ndQuaternion m_rotationAcc; - ndVector m_separatingVector; - ndContactPointList m_contacPointsList; - ndMaterial* m_material; - ndFloat32 m_timeOfImpact; - ndFloat32 m_separationDistance; - ndUnsigned32 m_sceneLru; - ndUnsigned32 m_isDead : 1; - ndUnsigned32 m_inTrigger : 1; - ndUnsigned32 m_isAttached : 1; - ndUnsigned32 m_isIntersetionTestOnly : 1; - ndUnsigned32 m_skeletonSelftCollision : 1; - static ndVector m_initialSeparatingVector; - - friend class ndScene; - friend class ndIkSolver; - friend class ndContactArray; - friend class ndBodyKinematic; - friend class ndContactSolver; - friend class ndShapeInstance; - friend class ndConvexCastNotify; - friend class ndModelArticulation; - friend class ndShapeConvexPolygon; - friend class ndBodyPlayerCapsuleContactSolver; -} D_GCC_NEWTON_ALIGN_32 ; - -inline ndContact* ndContact::GetAsContact() -{ - return this; -} - -inline const ndMaterial* ndContact::GetMaterial() const -{ - return m_material; -} - -//inline ndUnsigned32 ndContact::GetRowsCount() const -//{ -// return m_maxDOF; -//} - -inline ndContactPointList& ndContact::GetContactPoints() -{ - return m_contacPointsList; -} - -inline const ndContactPointList& ndContact::GetContactPoints() const -{ - return m_contacPointsList; -} - -inline bool ndContact::IsSkeletonSelftCollision() const -{ - return m_skeletonSelftCollision ? true : false; -} - -inline bool ndContact::IsInTrigger() const -{ - return m_inTrigger; -} - -inline bool ndContact::IsTestOnly() const -{ - return m_isIntersetionTestOnly ? true : false; -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactArray.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactArray.cpp deleted file mode 100644 index 449f1fd869..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactArray.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndContactArray.h" -#include "ndBodyKinematic.h" - -ndContactArray::ndContactArray() - :ndArray(1024) - ,m_lock() -{ -} - -ndContactArray::ndContactArray(const ndContactArray& src) - :ndArray() - ,m_lock() -{ - ndContactArray& steal = (ndContactArray&)src; - Swap(steal); -} - -ndContactArray::~ndContactArray() -{ -} - -ndInt32 ndContactArray::GetActiveContacts() const -{ - ndInt32 count = 0; - ndScopeSpinLock lock(m_lock); - for (ndInt32 i = ndInt32(GetCount()) - 1; i >= 0; --i) - { - ndContact* const contact = m_array[i]; - count += contact->IsActive() ? 1 : 0; - } - return count; -} - -ndContact* ndContactArray::CreateContact(ndBodyKinematic* const body0, ndBodyKinematic* const body1) -{ - ndContact* const contact = new ndContact; - contact->SetBodies(body0, body1); - contact->AttachToBodies(); - - ndScopeSpinLock lock(m_lock); - PushBack(contact); - return contact; -} - -void ndContactArray::DetachContact(ndContact* const contact) -{ - if (contact->m_isAttached) - { - contact->DetachFromBodies(); - } - contact->m_isDead = 1; -} - -void ndContactArray::DeleteAllContacts() -{ - ndScopeSpinLock lock(m_lock); - for (ndInt32 i = ndInt32(GetCount()) - 1; i >= 0; --i) - { - ndContact* const contact = m_array[i]; - if (contact->m_isAttached) - { - DetachContact(contact); - } - delete (contact); - } - Resize(1024); - SetCount(0); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactArray.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactArray.h deleted file mode 100644 index 9e8e7f4e49..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactArray.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONTACT_CACHE_H__ -#define __ND_CONTACT_CACHE_H__ - -#include "ndCollisionStdafx.h" -#include "ndContact.h" - -class ndContactArray : public ndArray -{ - public: - ndContactArray(); - ndContactArray(const ndContactArray& src); - ~ndContactArray(); - - void DeleteAllContacts(); - void DetachContact(ndContact* const contact); - ndContact* CreateContact(ndBodyKinematic* const body0, ndBodyKinematic* const body1); - - ndSpinLock& GetLock() const; - D_COLLISION_API ndInt32 GetActiveContacts() const; - - private: - mutable ndSpinLock m_lock; -}; - -inline ndSpinLock& ndContactArray::GetLock() const -{ - return m_lock; -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactNotify.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactNotify.h deleted file mode 100644 index 759466aeda..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactNotify.h +++ /dev/null @@ -1,126 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONTACT_NOTIFY_H__ -#define __ND_CONTACT_NOTIFY_H__ - -#include "ndCollisionStdafx.h" -#include "ndContactOptions.h" - -class ndScene; -class ndContact; -class ndBodyKinematic; -class ndShapeInstance; - -class ndMaterial : public ndContainersFreeListAlloc -{ - public: - ndMaterial(); - - ndFloat32 m_restitution; - ndFloat32 m_staticFriction0; - ndFloat32 m_staticFriction1; - ndFloat32 m_dynamicFriction0; - ndFloat32 m_dynamicFriction1; - ndFloat32 m_skinMargin; - ndFloat32 m_softness; - ndUnsigned32 m_flags; - ndUnsigned32 m_userFlags; -}; - -D_MSV_NEWTON_ALIGN_32 -class ndContactNotify: public ndClassAlloc -{ - public: - ndContactNotify(ndScene* const scene); - virtual ~ndContactNotify(); - virtual ndMaterial* GetMaterial(const ndContact* const, const ndShapeInstance&, const ndShapeInstance&) const; - - protected: - virtual void OnBodyAdded(ndBodyKinematic* const) const; - virtual void OnBodyRemoved(ndBodyKinematic* const) const; - virtual void OnContactCallback(const ndContact* const, ndFloat32) const; - virtual bool OnAabbOverlap(const ndContact* const contact, ndFloat32 timestep) const; - virtual bool OnCompoundSubShapeOverlap(const ndContact* const contact, ndFloat32 timestep, const ndShapeInstance* const subShapeA, const ndShapeInstance* const subShapeB) const; - - ndMaterial m_default; - - private: - ndScene* m_scene; - friend class ndScene; - friend class ndContactSolver; - friend class ndPolygonMeshDesc; -} D_GCC_NEWTON_ALIGN_32; - -inline ndMaterial::ndMaterial() - :ndContainersFreeListAlloc() -{ - m_restitution = ndFloat32(0.4f); - m_staticFriction0 = ndFloat32(0.8f); - m_staticFriction1 = ndFloat32(0.8f); - m_dynamicFriction0 = ndFloat32(0.4f); - m_dynamicFriction1 = ndFloat32(0.4f); - m_skinMargin = ndFloat32(0.0f); - m_softness = ndFloat32(0.1f); - m_flags = m_collisionEnable | m_friction0Enable | m_friction1Enable; - m_userFlags = 0; -} - -inline ndContactNotify::ndContactNotify(ndScene* const scene) - :ndClassAlloc() - ,m_scene(scene) -{ -} - -inline ndContactNotify::~ndContactNotify() -{ -} - -inline ndMaterial* ndContactNotify::GetMaterial(const ndContact* const, const ndShapeInstance&, const ndShapeInstance&) const -{ - return (ndMaterial*)&m_default; -} - -inline void ndContactNotify::OnBodyAdded(ndBodyKinematic* const) const -{ -} - -inline void ndContactNotify::OnBodyRemoved(ndBodyKinematic* const) const -{ -} - -//bool OnCompoundSubShapeOverlap(const ndContact* const contact, ndFloat32 timestep, const ndShapeInstance* const subShapeA, const ndShapeInstance* const subShapeB); -inline bool ndContactNotify::OnCompoundSubShapeOverlap(const ndContact* const, ndFloat32, const ndShapeInstance* const, const ndShapeInstance* const) const -{ - return true; -} - -//virtual bool OnAabbOverlap(const ndContact* const contact, ndFloat32 timestep) -inline bool ndContactNotify::OnAabbOverlap(const ndContact* const, ndFloat32) const -{ - return true; -} - -inline void ndContactNotify::OnContactCallback(const ndContact* const, ndFloat32) const -{ -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactOptions.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactOptions.h deleted file mode 100644 index 8655738ea2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactOptions.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONTACT_OPTIONS_H__ -#define __ND_CONTACT_OPTIONS_H__ - -#include "ndCollisionStdafx.h" - -enum ndContactOptions -{ - m_collisionEnable = 1 << 0, - m_friction0Enable = 1 << 1, - m_friction1Enable = 1 << 2, - m_isSoftContact = 1 << 3, - m_override0Accel = 1 << 4, - m_override1Accel = 1 << 5, - m_override0Friction = 1 << 6, - m_override1Friction = 1 << 7, - m_overrideNormalAccel = 1 << 8, - m_resetSkeletonSelfCollision = 1 << 9, - m_resetSkeletonIntraCollision = 1 << 10, - m_useBrushTireModel = 1 << 11, -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactSolver.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactSolver.cpp deleted file mode 100644 index bad3a30049..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactSolver.cpp +++ /dev/null @@ -1,4498 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndScene.h" -#include "ndShape.h" -#include "ndContact.h" -#include "ndShapePoint.h" -#include "ndShapeConvex.h" -#include "ndShapeCompound.h" -#include "ndBodyKinematic.h" -#include "ndContactSolver.h" -#include "ndPolygonMeshDesc.h" -#include "ndShapeStatic_bvh.h" -#include "ndShapeStaticMesh.h" -#include "ndShapeHeightfield.h" -#include "ndShapeConvexPolygon.h" -#include "ndShapeStaticProceduralMesh.h" - -ndVector ndContactSolver::m_pruneUpDir(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f)); -ndVector ndContactSolver::m_pruneSupportX(ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - -ndVector ndContactSolver::m_hullDirs[] = -{ - ndVector(ndFloat32(0.577350f), ndFloat32(-0.577350f), ndFloat32(0.577350f), ndFloat32(0.0f)), - ndVector(ndFloat32(-0.577350f), ndFloat32(-0.577350f), ndFloat32(-0.577350f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.577350f), ndFloat32(-0.577350f), ndFloat32(-0.577350f), ndFloat32(0.0f)), - ndVector(ndFloat32(-0.577350f), ndFloat32(0.577350f), ndFloat32(0.577350f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.577350f), ndFloat32(0.577350f), ndFloat32(-0.577350f), ndFloat32(0.0f)), - ndVector(ndFloat32(-0.577350f), ndFloat32(0.577350f), ndFloat32(-0.577350f), ndFloat32(0.0f)), - ndVector(ndFloat32(-0.577350f), ndFloat32(-0.577350f), ndFloat32(0.577350f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.577350f), ndFloat32(0.577350f), ndFloat32(0.577350f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.000000f), ndFloat32(-1.000000f), ndFloat32(0.000000f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.000000f), ndFloat32(1.000000f), ndFloat32(0.000000f), ndFloat32(0.0f)), - ndVector(ndFloat32(1.000000f), ndFloat32(0.000000f), ndFloat32(0.000000f), ndFloat32(0.0f)), - ndVector(ndFloat32(-1.000000f), ndFloat32(0.000000f), ndFloat32(0.000000f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.000000f), ndFloat32(0.000000f), ndFloat32(1.000000f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.000000f), ndFloat32(0.000000f), ndFloat32(-1.000000f), ndFloat32(0.0f)), -}; - -ndInt32 ndContactSolver::m_rayCastSimplex[4][4] = -{ - { 0, 1, 2, 3 }, - { 0, 2, 3, 1 }, - { 2, 1, 3, 0 }, - { 1, 0, 3, 2 }, -}; - -D_MSV_NEWTON_ALIGN_32 -class ndContactSolver::ndBoxBoxDistance2 -{ - public: - ndBoxBoxDistance2(const ndMatrix& matrix0, const ndMatrix& matrix1) - :m_matrix0(matrix0) - ,m_matrix1(matrix1) - { - m_localMatrix0 = m_matrix1 * m_matrix0.OrthoInverse(); - m_localMatrix1 = m_localMatrix0.OrthoInverse(); - - ndInt32 index = 0; - for (ndInt32 i = 0; i < 3; ++i) - { - m_matrixAbs0[i] = m_matrix0[i].Abs(); - m_matrixAbs1[i] = m_matrix1[i].Abs(); - m_localMatrixAbs0[i] = m_localMatrix0[i].Abs(); - m_localMatrixAbs1[i] = m_localMatrix1[i].Abs(); - for (ndInt32 j = 0; j < 3; ++j) - { - const ndVector axis(m_matrix0[i].CrossProduct(m_matrix1[j])); - if (axis.DotProduct(axis).GetScalar() > ndFloat32(1.0e-5f)) - { - m_crossAxis[index] = (axis.Normalize()).Abs(); - index++; - } - } - } - - for (ndInt32 i = index; i < ndInt32(sizeof(m_crossAxis) / sizeof(m_crossAxis[0])); ++i) - { - m_crossAxis[i] = m_crossAxis[0]; - } - - m_matrixAbs0.m_posit = ndVector::m_wOne; - m_matrixAbs1.m_posit = ndVector::m_wOne; - m_localMatrixAbs0.m_posit = ndVector::m_wOne; - m_localMatrixAbs1.m_posit = ndVector::m_wOne; - - ndVector tmp; - ndVector::Transpose4x4( - m_crossAxis[0], m_crossAxis[1], m_crossAxis[2], tmp, - m_crossAxis[0], m_crossAxis[1], m_crossAxis[2], m_crossAxis[3]); - ndVector::Transpose4x4( - m_crossAxis[3], m_crossAxis[4], m_crossAxis[5], tmp, - m_crossAxis[4], m_crossAxis[5], m_crossAxis[6], m_crossAxis[7]); - ndVector::Transpose4x4( - m_crossAxis[6], m_crossAxis[7], m_crossAxis[8], tmp, - m_crossAxis[8], m_crossAxis[8], m_crossAxis[8], m_crossAxis[8]); - } - - ndFloat32 CalculateBox1Distance2(const ndVector& origin0, const ndVector& size0, const ndVector& origin1, const ndVector& size1) const - { - const ndVector localOrigin1(m_localMatrix0.TransformVector(origin1)); - const ndVector localSize1(m_localMatrixAbs0.m_front.Scale(size1.m_x) + m_localMatrixAbs0.m_up.Scale(size1.m_y) + m_localMatrixAbs0.m_right.Scale(size1.m_z)); - - const ndVector minLocalP1(localOrigin1 - localSize1); - const ndVector maxLocalP1(localOrigin1 + localSize1); - - const ndVector minLocalP0(origin0 - size0); - const ndVector maxLocalP0(origin0 + size0); - - const ndVector minBox(minLocalP1 - maxLocalP0); - const ndVector maxBox(maxLocalP1 - minLocalP0); - - ndFloat32 dist2 = ndBoxDistanceToOrigin2(minBox, maxBox); - return dist2; - } - - ndFloat32 CalculateBox0Distance2(const ndVector& origin0, const ndVector& size0, const ndVector& origin1, const ndVector& size1) const - { - const ndVector localOrigin0(m_localMatrix1.TransformVector(origin0)); - const ndVector localSize0(m_localMatrixAbs1.m_front.Scale(size0.m_x) + m_localMatrixAbs1.m_up.Scale(size0.m_y) + m_localMatrixAbs1.m_right.Scale(size0.m_z)); - - const ndVector minLocalP0(localOrigin0 - localSize0); - const ndVector maxLocalP0(localOrigin0 + localSize0); - - const ndVector minLocalP1(origin1 - size1); - const ndVector maxLocalP1(origin1 + size1); - - const ndVector minBox(minLocalP1 - maxLocalP0); - const ndVector maxBox(maxLocalP1 - minLocalP0); - - ndFloat32 dist2 = ndBoxDistanceToOrigin2(minBox, maxBox); - return dist2; - } - - ndFloat32 CalculateDistance2(const ndVector& localOrigin0, const ndVector& size0, const ndVector& localOrigin1, const ndVector& size1) const - { - ndFloat32 separatingDistance2 = CalculateBox0Distance2(localOrigin0, size0, localOrigin1, size1); - if (separatingDistance2 == ndFloat32(0.0f)) - { - separatingDistance2 = CalculateBox1Distance2(localOrigin0, size0, localOrigin1, size1); - if (separatingDistance2 == ndFloat32(0.0f)) - { - const ndVector origin0(m_matrix0.TransformVector(localOrigin0)); - const ndVector span0(m_matrixAbs0[0].Scale(size0[0]) + m_matrixAbs0[1].Scale(size0[1]) + m_matrixAbs0[2].Scale(size0[2])); - const ndVector minBox0(origin0 - span0); - const ndVector maxBox0(origin0 + span0); - - const ndVector origin1(m_matrix1.TransformVector(localOrigin1)); - const ndVector span1(m_matrixAbs1[0].Scale(size1[0]) + m_matrixAbs1[1].Scale(size1[1]) + m_matrixAbs1[2].Scale(size1[2])); - const ndVector minBox1(origin1 - span1); - const ndVector maxBox1(origin1 + span1); - - const ndVector minBox0_x(minBox0.m_x); - const ndVector minBox0_y(minBox0.m_y); - const ndVector minBox0_z(minBox0.m_z); - const ndVector maxBox0_x(maxBox0.m_x); - const ndVector maxBox0_y(maxBox0.m_y); - const ndVector maxBox0_z(maxBox0.m_z); - - const ndVector minBox1_x(minBox1.m_x); - const ndVector minBox1_y(minBox1.m_y); - const ndVector minBox1_z(minBox1.m_z); - const ndVector maxBox1_x(maxBox1.m_x); - const ndVector maxBox1_y(maxBox1.m_y); - const ndVector maxBox1_z(maxBox1.m_z); - - ndInt32 i = 0; - do - { - const ndVector minProject0(m_crossAxis[i + 0] * minBox0_x + m_crossAxis[i + 1] * minBox0_y + m_crossAxis[i + 2] * minBox0_z); - const ndVector maxProject0(m_crossAxis[i + 0] * maxBox0_x + m_crossAxis[i + 1] * maxBox0_y + m_crossAxis[i + 2] * maxBox0_z); - const ndVector minProject00(minProject0.GetMin(maxProject0)); - const ndVector maxProject00(minProject0.GetMax(maxProject0)); - - const ndVector minProject1(m_crossAxis[i + 0] * minBox1_x + m_crossAxis[i + 1] * minBox1_y + m_crossAxis[i + 2] * minBox1_z); - const ndVector maxProject1(m_crossAxis[i + 0] * maxBox1_x + m_crossAxis[i + 1] * maxBox1_y + m_crossAxis[i + 2] * maxBox1_z); - const ndVector minProject11(minProject1.GetMin(maxProject1)); - const ndVector maxProject11(minProject1.GetMax(maxProject1)); - - const ndVector box0 (maxProject11 - minProject00); - const ndVector box1 (minProject11 - maxProject00); - - const ndVector mask((box0 * box1) > ndVector::m_zero); - const ndVector dist(box0.Abs().GetMin(box1.Abs()) & mask); - - const ndVector maxVal(dist.GetMax()); - separatingDistance2 = maxVal.GetScalar(); - i += 3; - } while ((i < 9) && (separatingDistance2 == ndFloat32 (0.0f))); - separatingDistance2 = separatingDistance2 * separatingDistance2; - } - } - - return separatingDistance2; - } - - ndMatrix m_matrix0; - ndMatrix m_matrix1; - ndMatrix m_matrixAbs0; - ndMatrix m_matrixAbs1; - - ndMatrix m_localMatrix0; - ndMatrix m_localMatrix1; - ndMatrix m_localMatrixAbs0; - ndMatrix m_localMatrixAbs1; - - ndVector m_crossAxis[9]; -} D_GCC_NEWTON_ALIGN_32; - -class ndStackBvhStackEntry -{ - public: - void PushStackEntry( - ndContactSolver::ndBoxBoxDistance2& data, - ndInt32& stack, - ndStackBvhStackEntry* const stackPool, - const ndShapeCompound::ndNodeBase* const compoundNode, - ndShapeStatic_bvh* const bvhTreeCollision, - ndInt32 treeNodeType, - const ndAabbPolygonSoup::ndNode* const treeNode) - { - if (stack < ((2 * D_COMPOUND_STACK_DEPTH) - 4)) - { - ndVector bvhp0; - ndVector bvhp1; - bvhTreeCollision->GetNodeAabb(treeNode, bvhp0, bvhp1); - const ndVector bvhSize((bvhp1 - bvhp0) * ndVector::m_half); - const ndVector bvhOrigin((bvhp1 + bvhp0) * ndVector::m_half); - - ndInt32 j = stack; - ndFloat32 dist2 = data.CalculateDistance2(compoundNode->m_origin, compoundNode->m_size, bvhOrigin, bvhSize); - for (; j && (dist2 > stackPool[j - 1].m_dist2); --j) - { - stackPool[j] = stackPool[j - 1]; - } - stackPool[j].m_treeNodeIsLeaf = treeNodeType; - stackPool[j].m_compoundNode = compoundNode; - stackPool[j].m_collisionTreeNode = treeNode; - stackPool[j].m_dist2 = dist2; - stack++; - ndAssert(stack < 2 * D_COMPOUND_STACK_DEPTH); - } - } - - const ndShapeCompound::ndNodeBase* m_compoundNode; - const ndAabbPolygonSoup::ndNode* m_collisionTreeNode; - ndFloat32 m_dist2; - ndInt32 m_treeNodeIsLeaf; -}; - -class ndStackEntry -{ - public: - void PushStackEntry( - ndContactSolver::ndBoxBoxDistance2& data, - ndInt32& stack, - ndStackEntry* const stackPool, - const ndShapeCompound::ndNodeBase* const node0, - const ndShapeCompound::ndNodeBase* const node1) - { - if (stack < ((2 * D_COMPOUND_STACK_DEPTH) - 4)) - { - ndAssert(node0); - ndAssert(node1); - - ndInt32 j = stack; - ndFloat32 subDist2 = data.CalculateDistance2(node0->m_origin, node0->m_size, node1->m_origin, node1->m_size); - for (; j && (subDist2 > stackPool[j - 1].m_dist2); --j) - { - stackPool[j] = stackPool[j - 1]; - } - stackPool[j].m_node0 = node0; - stackPool[j].m_node1 = node1; - stackPool[j].m_dist2 = subDist2; - stack++; - ndAssert(stack < 2 * D_COMPOUND_STACK_DEPTH); - } - } - - ndFloat32 CalculateHeighfieldDist2(const ndContactSolver::ndBoxBoxDistance2& data, const ndShapeCompound::ndNodeBase* const compoundNode, ndShapeInstance* const heightfieldInstance) - { - const ndVector scale(heightfieldInstance->GetScale()); - const ndVector invScale(heightfieldInstance->GetInvScale()); - const ndVector size(invScale * data.m_localMatrixAbs1.RotateVector(compoundNode->m_size)); - const ndVector origin(invScale * data.m_localMatrix1.TransformVector(compoundNode->m_origin)); - const ndVector p0(origin - size); - const ndVector p1(origin + size); - - ndVector boxP0; - ndVector boxP1; - ndShapeHeightfield* const shape = heightfieldInstance->GetShape()->GetAsShapeHeightfield(); - shape->GetLocalAabb(p0, p1, boxP0, boxP1); - const ndVector boxSize((boxP1 - boxP0) * ndVector::m_half * scale); - const ndVector boxOrigin((boxP1 + boxP0) * ndVector::m_half * scale); - - ndFloat32 dist2 = data.CalculateDistance2(compoundNode->m_origin, compoundNode->m_size, boxOrigin, boxSize); - return dist2; - } - - ndFloat32 CalculateProceduralDist2(const ndContactSolver::ndBoxBoxDistance2& data, const ndShapeCompound::ndNodeBase* const compoundNode, ndShapeInstance* const proceduralInstance) - { - const ndVector scale(proceduralInstance->GetScale()); - const ndVector invScale(proceduralInstance->GetInvScale()); - const ndVector size(invScale * data.m_localMatrixAbs1.RotateVector(compoundNode->m_size)); - const ndVector origin(invScale * data.m_localMatrix1.TransformVector(compoundNode->m_origin)); - ndFloat32 dist2 = data.CalculateDistance2(compoundNode->m_origin, compoundNode->m_size, origin, size); - return dist2; - } - - const ndShapeCompound::ndNodeBase* m_node0; - const ndShapeCompound::ndNodeBase* m_node1; - ndFloat32 m_dist2; -}; - -ndContactSolver::ndContactSolver() - :ndDownHeap(m_heapBuffer, sizeof(m_heapBuffer)) - ,m_instance0(nullptr) - ,m_instance1(nullptr) - ,m_separatingVector(ndContact::m_initialSeparatingVector) - ,m_contact(nullptr) - ,m_freeFace(nullptr) - ,m_notification(nullptr) - ,m_contactBuffer(nullptr) - ,m_timestep(ndFloat32 (0.0f)) - ,m_skinMargin(ndFloat32(0.0f)) - ,m_separationDistance(ndFloat32(0.0f)) - ,m_threadId(0) - ,m_maxCount(D_MAX_CONTATCS) - ,m_faceIndex(0) - ,m_vertexIndex(0) - ,m_pruneContacts(1) - ,m_intersectionTestOnly(0) -{ -} - -ndContactSolver::ndContactSolver(ndShapeInstance* const instance, ndContactNotify* const notification, ndFloat32 timestep, ndInt32 threadIndex) - :ndDownHeap(m_heapBuffer, sizeof (m_heapBuffer)) - ,m_instance0(*instance, (ndShape*)instance->GetShape()) - ,m_instance1(*instance, (ndShape*)instance->GetShape()) - ,m_separatingVector(ndContact::m_initialSeparatingVector) - ,m_contact(nullptr) - ,m_freeFace(nullptr) - ,m_notification(notification) - ,m_contactBuffer(nullptr) - ,m_timestep(timestep) - ,m_skinMargin(ndFloat32(0.0f)) - ,m_separationDistance(ndFloat32(0.0f)) - ,m_threadId(threadIndex) - ,m_maxCount(D_MAX_CONTATCS) - ,m_faceIndex(0) - ,m_vertexIndex(0) - ,m_pruneContacts(1) - ,m_intersectionTestOnly(0) -{ -} - -ndContactSolver::ndContactSolver(ndContact* const contact, ndContactNotify* const notification, ndFloat32 timestep, ndInt32 threadIndex) - :ndDownHeap(m_heapBuffer, sizeof(m_heapBuffer)) - ,m_instance0(contact->GetBody0()->GetCollisionShape(), contact->GetBody0()->GetCollisionShape().GetShape()) - ,m_instance1(contact->GetBody1()->GetCollisionShape(), contact->GetBody1()->GetCollisionShape().GetShape()) - ,m_closestPoint0(ndVector::m_zero) - ,m_closestPoint1(ndVector::m_zero) - ,m_separatingVector(ndContact::m_initialSeparatingVector) - ,m_contact(contact) - ,m_freeFace(nullptr) - ,m_notification(notification) - ,m_contactBuffer(nullptr) - ,m_timestep(timestep) - ,m_skinMargin(ndFloat32(0.0f)) - ,m_separationDistance(ndFloat32(0.0f)) - ,m_threadId(threadIndex) - ,m_maxCount(D_MAX_CONTATCS) - ,m_faceIndex(0) - ,m_vertexIndex(0) - ,m_pruneContacts(1) - ,m_intersectionTestOnly(0) -{ -} - -ndContactSolver::ndContactSolver(const ndContactSolver& src, const ndShapeInstance& instance0, const ndShapeInstance& instance1) - :ndDownHeap(m_heapBuffer, sizeof(m_heapBuffer)) - ,m_instance0(instance0, ((ndShapeInstance*)&instance0)->GetShape()) - ,m_instance1(instance1, ((ndShapeInstance*)&instance1)->GetShape()) - ,m_closestPoint0(ndVector::m_zero) - ,m_closestPoint1(ndVector::m_zero) - ,m_separatingVector(src.m_separatingVector) - ,m_contact(src.m_contact) - ,m_freeFace(nullptr) - ,m_notification(src.m_notification) - ,m_contactBuffer(src.m_contactBuffer) - ,m_timestep(src.m_timestep) - ,m_skinMargin(src.m_skinMargin) - ,m_separationDistance(src.m_separationDistance) - ,m_threadId(src.m_threadId) - ,m_maxCount(D_MAX_CONTATCS) - ,m_faceIndex(0) - ,m_vertexIndex(0) - ,m_pruneContacts(src.m_pruneContacts) - ,m_intersectionTestOnly(src.m_intersectionTestOnly) -{ -} - -void ndContactSolver::TranslateSimplex(const ndVector& step) -{ - m_instance1.m_globalMatrix.m_posit -= step; - for (ndInt32 i = 0; i < m_vertexIndex; ++i) - { - m_hullSum[i] -= step; - m_hullDiff[i] += step; - } -} - -void ndContactSolver::SupportVertex(const ndVector& dir0, ndInt32 vertexIndex) -{ - ndAssert(dir0.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir0.DotProduct(dir0).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - ndVector dir1(dir0 * ndVector::m_negOne); - - const ndMatrix& matrix0 = m_instance0.m_globalMatrix; - const ndMatrix& matrix1 = m_instance1.m_globalMatrix; - ndVector p(matrix0.TransformVector(m_instance0.SupportVertexSpecial(matrix0.UnrotateVector (dir0))) & ndVector::m_triplexMask); - ndVector q(matrix1.TransformVector(m_instance1.SupportVertexSpecial(matrix1.UnrotateVector (dir1))) & ndVector::m_triplexMask); - m_hullDiff[vertexIndex] = p - q; - m_hullSum[vertexIndex] = p + q; -} - -ndBigVector ndContactSolver::ReduceLine(ndInt32& indexOut) -{ - const ndBigVector p0(m_hullDiff[0]); - const ndBigVector p1(m_hullDiff[1]); - const ndBigVector dp(p1 - p0); - ndBigVector v; - - const ndFloat64 mag2 = dp.DotProduct(dp).GetScalar(); - ndAssert(mag2 > ndFloat64(0.0f)); - if (mag2 < ndFloat32(1.0e-24f)) - { - v = p0; - indexOut = 1; - } - else - { - const ndFloat64 alpha0 = -p0.DotProduct(dp).GetScalar(); - if (alpha0 > mag2) - { - v = p1; - indexOut = 1; - m_hullSum[0] = m_hullSum[1]; - m_hullDiff[0] = m_hullDiff[1]; - } - else if (alpha0 < ndFloat64(0.0f)) - { - v = p0; - indexOut = 1; - } - else - { - v = p0 + dp.Scale(alpha0 / mag2); - } - } - return v; -} - -ndBigVector ndContactSolver::ReduceTriangle(ndInt32& indexOut) -{ - const ndBigVector p0(m_hullDiff[0]); - const ndBigVector p1(m_hullDiff[1]); - const ndBigVector p2(m_hullDiff[2]); - const ndBigVector e10(p1 - p0); - const ndBigVector e20(p2 - p0); - const ndFloat64 a00 = e10.DotProduct(e10).GetScalar(); - const ndFloat64 a11 = e20.DotProduct(e20).GetScalar(); - const ndFloat64 a01 = e10.DotProduct(e20).GetScalar(); - - const ndFloat64 det = a00 * a11 - a01 * a01; - ndAssert(det >= ndFloat32(0.0f)); - if (ndAbs(det) > ndFloat32(1.0e-16f)) - { - const ndFloat64 b0 = -e10.DotProduct(p0).GetScalar(); - const ndFloat64 b1 = -e20.DotProduct(p0).GetScalar(); - - const ndFloat64 u2 = b1 * a00 - a01 * b0; - const ndFloat64 u1 = b0 * a11 - a01 * b1; - - if (u2 < ndFloat32(0.0f)) - { - // this looks funny but it is correct - } - else if (u1 < ndFloat32(0.0f)) - { - m_hullSum[1] = m_hullSum[2]; - m_hullDiff[1] = m_hullDiff[2]; - } - else if ((u1 + u2) > det) - { - m_hullSum[0] = m_hullSum[2]; - m_hullDiff[0] = m_hullDiff[2]; - } - else - { - return p0 + (e10.Scale(u1) + e20.Scale(u2)).Scale(ndFloat64(1.0f) / det); - } - indexOut = 2; - return ReduceLine(indexOut); - } - else - { - ndInt32 count = 3; - for (ndInt32 i = 2; i > 0; i--) - { - for (ndInt32 j = i - 1; j >= 0; --j) - { - ndVector dist(m_hullDiff[i] - m_hullDiff[j]); - ndFloat32 mag2 = dist.DotProduct(dist).GetScalar(); - if (mag2 < ndFloat32(1.0e-12f)) - { - count--; - m_hullSum[j] = m_hullSum[count]; - m_hullDiff[j] = m_hullDiff[count]; - break; - } - } - } - if (count == 2) - { - return ReduceLine(indexOut); - } - else if (count == 1) - { - indexOut = 1; - return m_hullDiff[0]; - } - } - // this is a degenerated triangle. this should never happens - ndAssert(0); - return ndBigVector::m_zero; -} - -ndBigVector ndContactSolver::ReduceTetrahedrum(ndInt32& indexOut) -{ - const ndBigVector p0(m_hullDiff[0]); - const ndBigVector p1(m_hullDiff[1]); - const ndBigVector p2(m_hullDiff[2]); - const ndBigVector p3(m_hullDiff[3]); - const ndBigVector e10(p1 - p0); - const ndBigVector e20(p2 - p0); - const ndBigVector e30(p3 - p0); - - const ndFloat64 d0 = sqrt(e10.DotProduct(e10).GetScalar()); - if (d0 > ndFloat64(0.0f)) - { - const ndFloat64 invd0 = ndFloat64(1.0f) / d0; - const ndFloat64 l10 = e20.DotProduct(e10).GetScalar() * invd0; - const ndFloat64 l20 = e30.DotProduct(e10).GetScalar() * invd0; - const ndFloat64 desc11 = e20.DotProduct(e20).GetScalar() - l10 * l10; - if (desc11 > ndFloat64(0.0f)) - { - const ndFloat64 d1 = sqrt(desc11); - const ndFloat64 invd1 = ndFloat64(1.0f) / d1; - const ndFloat64 l21 = (e30.DotProduct(e20).GetScalar() - l20 * l10) * invd1; - const ndFloat64 desc22 = e30.DotProduct(e30).GetScalar() - l20 * l20 - l21 * l21; - if (desc22 > ndFloat64(0.0f)) - { - const ndFloat64 d2 = sqrt(desc22); - const ndFloat64 invd2 = ndFloat64(1.0f) / d2; - const ndFloat64 b0 = -e10.DotProduct(p0).GetScalar(); - const ndFloat64 b1 = -e20.DotProduct(p0).GetScalar(); - const ndFloat64 b2 = -e30.DotProduct(p0).GetScalar(); - - ndFloat64 u1 = b0 * invd0; - ndFloat64 u2 = (b1 - l10 * u1) * invd1; - ndFloat64 u3 = (b2 - l20 * u1 - l21 * u2) * invd2 * invd2; - u2 = (u2 - l21 * u3) * invd1; - u1 = (u1 - l10 * u2 - l20 * u3) * invd0; - if (u3 < ndFloat64(0.0f)) - { - // this looks funny but it is correct - } - else if (u2 < ndFloat64(0.0f)) - { - m_hullSum[2] = m_hullSum[3]; - m_hullDiff[2] = m_hullDiff[3]; - } - else if (u1 < ndFloat64(0.0f)) - { - m_hullSum[1] = m_hullSum[3]; - m_hullDiff[1] = m_hullDiff[3]; - } - else if (u1 + u2 + u3 > ndFloat64(1.0f)) - { - m_hullSum[0] = m_hullSum[3]; - m_hullDiff[0] = m_hullDiff[3]; - } - else - { - return ndBigVector::m_zero; - } - indexOut = 3; - return ReduceTriangle(indexOut); - } - } - } - // this is a degenerated tetra. this should never happens. - // it seems this does happens about once per several millions calls, - // I will assume is acceptable. No fall back needed - return ndBigVector::m_zero; -} - -ndInt32 ndContactSolver::CalculateClosestSimplex() -{ - ndBigVector v(ndBigVector::m_zero); - ndInt32 index = 1; - if (m_vertexIndex <= 0) - { - SupportVertex (m_separatingVector, 0); - - v = m_hullDiff[0]; - } - else - { - switch (m_vertexIndex) - { - case 1: - { - v = m_hullDiff[0]; - break; - } - - case 2: - { - v = ReduceLine (m_vertexIndex); - break; - } - - case 3: - { - v = ReduceTriangle (m_vertexIndex); - break; - } - - case 4: - { - v = ReduceTetrahedrum (m_vertexIndex); - break; - } - } - index = m_vertexIndex; - } - - ndVector bestNormal (m_separatingVector); - - ndInt32 iter = 0; - ndInt32 cycling = 0; - ndFloat64 minDist = ndFloat32 (1.0e20f); - ndFloat64 bestNormalDist = ndFloat32 (1.0e20f); - do - { - ndFloat64 dist = v.DotProduct(v).GetScalar(); - if (dist < ndFloat32 (1.0e-9f)) - { - // very deep penetration, resolve with generic Minkowski solver - return -index; - } - - if (dist < minDist) - { - minDist = dist; - cycling = -1; - } - cycling ++; - if (cycling > 4) - { - return -index; - } - - const ndVector dir (v.Scale (-ndRsqrt(dist))); - ndAssert (dir.m_w == ndFloat32 (0.0f)); - SupportVertex (dir, index); - - const ndBigVector w (m_hullDiff[index]); - const ndVector wv (w - v); - ndAssert (wv.m_w == ndFloat32 (0.0f)); - const ndFloat64 dist1 = dir.DotProduct(wv).GetScalar(); - if (dist1 < ndFloat64 (1.0e-3f)) - { - m_separatingVector = dir; - return index; - } - - if (dist1 < bestNormalDist) - { - bestNormal = dir; - bestNormalDist = dist1; - } - - index ++; - switch (index) - { - case 2: - { - v = ReduceLine (index); - break; - } - - case 3: - { - v = ReduceTriangle (index); - break; - } - - case 4: - { - v = ReduceTetrahedrum (index); - break; - } - } - - iter ++; - } while (iter < D_CONNICS_CONTATS_ITERATIONS); - - m_separatingVector = bestNormal; - return (index < 4) ? index : -4; -} - -void ndContactSolver::CalculateContactFromFeacture(ndInt32 featureType) -{ - ndVector d; - ndVector s; - switch (featureType) - { - case 3: - { - const ndBigVector p0(m_hullDiff[0]); - const ndBigVector p1(m_hullDiff[1]); - const ndBigVector p2(m_hullDiff[2]); - const ndBigVector e10(p1 - p0); - const ndBigVector e20(p2 - p0); - const ndFloat64 a00 = e10.DotProduct(e10).GetScalar(); - const ndFloat64 a11 = e20.DotProduct(e20).GetScalar(); - const ndFloat64 a01 = e10.DotProduct(e20).GetScalar(); - - const ndFloat64 det = a00 * a11 - a01 * a01; - //ndAssert(det >= ndFloat32(0.0f)); - // check against machine precision - if (ndAbs(det) > ndFloat32(1.0e-16f)) - { - const ndFloat64 b0 = -e10.DotProduct(p0).GetScalar(); - const ndFloat64 b1 = -e20.DotProduct(p0).GetScalar(); - - const ndFloat64 u2 = b1 * a00 - a01 * b0; - const ndFloat64 u1 = b0 * a11 - a01 * b1; - - if (u2 < ndFloat32(0.0f)) - { - // this looks funny but it is correct - } - else if (u1 < ndFloat32(0.0f)) - { - m_hullSum[1] = m_hullSum[2]; - m_hullDiff[1] = m_hullDiff[2]; - } - else if ((u1 + u2) > det) - { - m_hullSum[0] = m_hullSum[2]; - m_hullDiff[0] = m_hullDiff[2]; - } - else - { - const ndBigVector invDet(ndFloat64(1.0f) / det); - const ndBigVector q0(m_hullSum[0]); - const ndBigVector q1(m_hullSum[1]); - const ndBigVector q2(m_hullSum[2]); - const ndBigVector q10(q1 - q0); - const ndBigVector q20(q2 - q0); - - d = ndVector(p0 + (e10.Scale(u1) + e20.Scale(u2)) * invDet); - s = ndVector(q0 + (q10.Scale(u1) + q20.Scale(u2)) * invDet); - break; - } - } - else - { - // find extreme and reduce line - ndAssert ((a00 > ndFloat32(0.0f)) || (a11 > ndFloat32(0.0f))); - const ndBigVector dir ((a00 > a11) ? e10 : e20); - ndInt32 maxIndex = 0; - ndInt32 minIndex = 0; - ndFloat64 maxVal = ndFloat32(-1.0e20f); - ndFloat64 minVal = ndFloat32( 1.0e20f); - for (ndInt32 i = 0; i < 3; ++i) - { - ndFloat64 val = dir.DotProduct(m_hullDiff[i]).GetScalar(); - if (val > maxVal) - { - maxIndex = i; - maxVal = val; - } - if (val < minVal) - { - minIndex = i; - minVal = val; - } - } - const ndBigVector mindiff(m_hullDiff[minIndex]); - const ndBigVector minSum(m_hullSum[minIndex]); - const ndBigVector maxdiff(m_hullDiff[maxIndex]); - const ndBigVector maxSum(m_hullSum[maxIndex]); - - m_hullDiff[0] = mindiff; - m_hullSum[0] = minSum; - m_hullDiff[1] = maxdiff; - m_hullSum[1] = maxSum; - } - } - - case 2: - { - const ndBigVector p0(m_hullDiff[0]); - const ndBigVector p1(m_hullDiff[1]); - const ndBigVector dp(p1 - p0); - - const ndFloat64 mag2 = dp.DotProduct(dp).GetScalar(); - ndAssert(mag2 > ndFloat64(0.0f)); - if (mag2 < ndFloat32(1.0e-24f)) - { - s = m_hullSum[0]; - d = m_hullDiff[0]; - } - else - { - const ndFloat64 alpha0 = -p0.DotProduct(dp).GetScalar(); - if (alpha0 > mag2) - { - s = m_hullSum[1]; - d = m_hullDiff[1]; - } - else if (alpha0 < ndFloat64(0.0f)) - { - s = m_hullSum[0]; - d = m_hullDiff[0]; - } - else - { - const ndBigVector scale(alpha0 / mag2); - const ndBigVector q0(m_hullSum[0]); - const ndBigVector q1(m_hullSum[1]); - const ndBigVector dq(q1 - q0); - d = ndVector(p0 + dp * scale); - s = ndVector(q0 + dq * scale); - } - } - break; - } - - case 1: - default: - { - s = m_hullSum[0]; - d = m_hullDiff[0]; - break; - } - } - - m_closestPoint0 = ndVector::m_half * (s + d); - m_closestPoint1 = ndVector::m_half * (s - d); - ndAssert(m_separatingVector.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(m_separatingVector.DotProduct(m_separatingVector).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); -} - -ndInt32 ndContactSolver::ConvexPolygonToLineIntersection(const ndVector& normal, ndInt32 count1, ndVector* const shape1, ndInt32 count2, ndVector* const shape2, ndVector* const contactOut, ndVector* const mem) const -{ - ndInt32 count = 0; - ndVector* output = mem; - - ndAssert(count1 >= 3); - ndAssert(count2 <= 2); - ndAssert(normal.m_w == ndFloat32(0.0f)); - - ndVector* ptr = nullptr; - // face line intersection - if (count2 == 2) - { - ptr = (ndVector*)&shape2[0]; - ndInt32 i0 = count1 - 1; - for (ndInt32 i1 = 0; i1 < count1; ++i1) - { - const ndVector testPoint(shape1[i0]); - const ndVector n(normal.CrossProduct(shape1[i1] - testPoint)); - - ndAssert(n.m_w == ndFloat32(0.0f)); - ndAssert(n.DotProduct(n).GetScalar() > ndFloat32(0.0f)); - - ndFloat32 test0 = n.DotProduct(ptr[0] - testPoint).GetScalar(); - ndFloat32 test1 = n.DotProduct(ptr[1] - testPoint).GetScalar(); - - if (test0 >= ndFloat32(0.0f)) - { - if (test1 >= ndFloat32(0.0f)) - { - output[count + 0] = ptr[0]; - output[count + 1] = ptr[1]; - count += 2; - } - else - { - ndVector dp(ptr[1] - ptr[0]); - ndAssert(dp.m_w == ndFloat32(0.0f)); - ndFloat32 den = n.DotProduct(dp).GetScalar(); - if (ndAbs(den) < ndFloat32 (1.0e-10f)) - { - den = ndFloat32(1.0e-10f); - } - output[count + 0] = ptr[0]; - ndAssert(dp.m_w == ndFloat32(0.0f)); - output[count + 1] = ptr[0] - dp.Scale(test0 / den); - count += 2; - } - } - else if (test1 >= ndFloat32(0.0f)) - { - ndVector dp(ptr[1] - ptr[0]); - ndAssert(dp.m_w == ndFloat32(0.0f)); - ndFloat32 den = n.DotProduct(dp).GetScalar(); - if (ndAbs(den) < ndFloat32(1.0e-10f)) - { - den = ndFloat32(1.0e-10f); - } - ndAssert(dp.m_w == ndFloat32(0.0f)); - output[count] = ptr[0] - dp.Scale(test0 / den); - count++; - output[count] = ptr[1]; - count++; - } - else - { - return 0; - } - - count2 = count; - ptr = output; - output = &output[count]; - count = 0; - i0 = i1; - } - } - else if (count2 == 1) - { - const ndVector& p = shape2[0]; - ndInt32 i0 = count1 - 1; - for (ndInt32 i1 = 0; i1 < count1; ++i1) - { - ndVector n(normal.CrossProduct(shape1[i1] - shape1[i0])); - ndAssert(n.m_w == ndFloat32(0.0f)); - ndAssert(n.DotProduct(n).GetScalar() > ndFloat32(0.0f)); - ndFloat32 test0 = n.DotProduct(p - shape1[i0]).GetScalar(); - if (test0 < ndFloat32(-1.e-3f)) - { - return 0; - } - i0 = i1; - } - ptr = output; - output[count] = p; - count++; - } - else - { - count2 = 0; - } - - for (ndInt32 i0 = 0; i0 < count2; ++i0) - { - contactOut[i0] = ptr[i0]; - } - return count2; -} - -ndInt32 ndContactSolver::ConvexPolygonsIntersection(const ndVector& normal, ndInt32 count0, ndVector* const shape0, ndInt32 count1, ndVector* const shape1, ndVector* const contactOut, ndInt32 maxContacts) const -{ - ndInt32 count = 0; - if (count1 <= 2) - { - count = ConvexPolygonToLineIntersection(normal.Scale(ndFloat32(-1.0f)), count0, shape0, count1, shape1, contactOut, &contactOut[count0 + count1 + maxContacts]); - } - else if (count0 <= 2) - { - count = ConvexPolygonToLineIntersection(normal, count1, shape1, count0, shape0, contactOut, &contactOut[count0 + count1 + maxContacts]); - } - else - { - ndAssert(count0 >= 3); - ndAssert(count1 >= 3); - - dgPerimenterEdge subdivision[128]; - ndAssert((2 * (count0 + count1)) < ndInt32(sizeof(subdivision) / sizeof(subdivision[0]))); - - for (ndInt32 i0 = 1; i0 < count1; ++i0) - { - subdivision[i0].m_vertex = &shape1[i0]; - subdivision[i0].m_prev = &subdivision[i0 - 1]; - subdivision[i0].m_next = &subdivision[i0 + 1]; - } - subdivision[0].m_vertex = &shape1[0]; - subdivision[0].m_prev = &subdivision[count1 - 1]; - subdivision[0].m_next = &subdivision[1]; - - subdivision[count1 - 1].m_next = &subdivision[0]; - - dgPerimenterEdge* edgeClipped[2]; - ndVector* output = &contactOut[count0 + count1 + maxContacts]; - - edgeClipped[0] = nullptr; - edgeClipped[1] = nullptr; - ndInt32 j0 = 0; - ndInt32 edgeIndex = count1; - dgPerimenterEdge* poly = &subdivision[0]; - for (ndInt32 j1 = count0 - 1; j1 >= 0; --j1) - { - const ndVector testPoint(shape0[j0]); - const ndVector n(normal.CrossProduct(shape0[j1] - testPoint)); - ndAssert(n.m_w == 0.0f); - j0 = j1; - count = 0; - dgPerimenterEdge* tmp = poly; - ndInt32 isInside = 0; - ndFloat32 test0 = n.DotProduct(*tmp->m_vertex - testPoint).GetScalar(); - do - { - ndFloat32 test1 = n.DotProduct(*tmp->m_next->m_vertex - testPoint).GetScalar(); - - if (test0 >= ndFloat32(0.0f)) - { - isInside |= 1; - if (test1 < ndFloat32(0.0f)) - { - const ndVector& p0 = *tmp->m_vertex; - const ndVector& p1 = *tmp->m_next->m_vertex; - ndVector dp(p1 - p0); - ndAssert(dp.m_w == 0.0f); - ndFloat32 den = n.DotProduct(dp).GetScalar(); - if (ndAbs(den) < ndFloat32(1.0e-24f)) - { - den = (den >= ndFloat32(0.0f)) ? ndFloat32(1.0e-24f) : ndFloat32(-1.0e-24f); - } - - den = test0 / den; - if (den >= ndFloat32(0.0f)) - { - den = ndFloat32(0.0f); - } - else if (den <= -1.0f) - { - den = ndFloat32(-1.0f); - } - ndAssert(dp.m_w == ndFloat32(0.0f)); - output[0] = p0 - dp.Scale(den); - edgeClipped[0] = tmp; - count++; - } - } - else if (test1 >= ndFloat32(0.0f)) - { - const ndVector& p0 = *tmp->m_vertex; - const ndVector& p1 = *tmp->m_next->m_vertex; - isInside |= 1; - ndVector dp(p1 - p0); - ndAssert(dp.m_w == 0.0f); - ndFloat32 den = n.DotProduct(dp).GetScalar(); - if (ndAbs(den) < ndFloat32(1.0e-24f)) - { - den = (den >= ndFloat32(0.0f)) ? ndFloat32(1.0e-24f) : ndFloat32(-1.0e-24f); - } - den = test0 / den; - if (den >= ndFloat32(0.0f)) - { - den = ndFloat32(0.0f); - } - else if (den <= -1.0f) - { - den = ndFloat32(-1.0f); - } - ndAssert(dp.m_w == ndFloat32(0.0f)); - output[1] = p0 - dp.Scale(den); - edgeClipped[1] = tmp; - count++; - } - - test0 = test1; - tmp = tmp->m_next; - } while (tmp != poly && (count < 2)); - - if (!isInside) - { - return 0; - } - - if (count == 2) - { - dgPerimenterEdge* const newEdge = &subdivision[edgeIndex]; - newEdge->m_next = edgeClipped[1]; - newEdge->m_prev = edgeClipped[0]; - edgeClipped[0]->m_next = newEdge; - edgeClipped[1]->m_prev = newEdge; - - newEdge->m_vertex = &output[0]; - edgeClipped[1]->m_vertex = &output[1]; - poly = newEdge; - - output += 2; - edgeIndex++; - //ndAssert (output < &pool[sizeof (pool)/sizeof (pool[0])]); - ndAssert(edgeIndex < ndInt32(sizeof(subdivision) / sizeof(subdivision[0]))); - } - } - - ndAssert(poly); - count = 0; - dgPerimenterEdge* intersection = poly; - do - { - contactOut[count] = *intersection->m_vertex; - count++; - intersection = intersection->m_next; - } while (intersection != poly); - } - return count; -} - -ndInt32 ndContactSolver::PruneSupport(ndInt32 count, const ndVector& dir, const ndVector* const points) const -{ - ndInt32 index = 0; - ndFloat32 maxVal = ndFloat32(-1.0e20f); - for (ndInt32 i = 0; i < count; ++i) - { - ndFloat32 dist = dir.DotProduct(points[i]).GetScalar(); - if (dist > maxVal) - { - index = i; - maxVal = dist; - } - } - return index; -} - -ndInt32 ndContactSolver::Prune2dContacts(const ndMatrix& matrix, ndInt32 count, ndContactPoint* const contactArray, ndInt32 maxCount) const -{ - if (count <= 3) - { - return count; - } - - class ndConvexFaceNode - { - public: - ndVector m_point2d; - ndConvexFaceNode* m_next; - ndConvexFaceNode* m_prev; - ndInt32 m_mask; - }; - - ndFixSizeArray buffer; - ndFixSizeArray array; - ndFixSizeArray convexHull; - const ndVector xyMask(ndVector::m_xMask | ndVector::m_yMask); - ndUpHeap sortHeap(&array[0], D_MAX_CONTATCS * array.GetCapacity()); - - for (ndInt32 i = 0; i < count; ++i) - { - ndVector p(matrix.UntransformVector(contactArray[i].m_point) & xyMask); - p.m_w = ndFloat32(i); - array.PushBack(p); - } - ndInt32 hullCount = ndConvexHull2d(&array[0], array.GetCount()); - if (hullCount <= 3) - { - for (ndInt32 i = hullCount - 1; i >= 0; --i) - { - ndInt32 index = ndInt32 (array[i].m_w); - buffer.PushBack(contactArray[index]); - } - - for (ndInt32 i = hullCount - 1; i >= 0; --i) - { - contactArray[i] = buffer[i]; - } - return hullCount; - } - - ndInt32 last = hullCount - 1; - convexHull.SetCount(hullCount + 1); - for (ndInt32 i = 0; i < hullCount; ++i) - { - convexHull[i].m_point2d = array[i]; - convexHull[i].m_next = &convexHull[i + 1]; - convexHull[i].m_prev = &convexHull[last]; - convexHull[i].m_mask = 0; - last = i; - } - convexHull[last].m_next = &convexHull[0]; - - ndFloat32 totalArea = ndFloat32(0.0f); - ndVector areaEdge0(array[1] - array[0]); - for (ndInt32 i = 2; i < hullCount; ++i) - { - const ndVector areaEdge1(array[i] - array[0]); - ndFloat32 area = areaEdge0.m_y * areaEdge1.m_x - areaEdge0.m_x * areaEdge1.m_y; - totalArea += area; - areaEdge0 = areaEdge1; - } - - ndAssert(totalArea >= ndFloat32(0.0f)); - bool hasLinearCombination = true; - ndConvexFaceNode* hullPoint = &convexHull[0]; - while (hasLinearCombination) - { - sortHeap.Flush(); - hasLinearCombination = false; - ndConvexFaceNode* ptr = hullPoint; - ndVector e0(ptr->m_next->m_point2d - ptr->m_point2d); - do - { - const ndVector e1(ptr->m_next->m_next->m_point2d - ptr->m_next->m_point2d); - ndFloat32 area = e0.m_y * e1.m_x - e0.m_x * e1.m_y; - sortHeap.Push(ptr->m_next, area); - e0 = e1; - ptr->m_mask = 1; - ptr = ptr->m_next; - } while (ptr != hullPoint); - - while (sortHeap.GetCount() && (sortHeap.Value() * ndFloat32(16.0f) < totalArea)) - { - ndConvexFaceNode* const corner = sortHeap[0]; - if (corner->m_mask && corner->m_prev->m_mask) - { - if (hullPoint == corner) - { - hullPoint = corner->m_prev; - } - hullCount--; - hasLinearCombination = true; - corner->m_prev->m_mask = 0; - corner->m_next->m_prev = corner->m_prev; - corner->m_prev->m_next = corner->m_next; - } - sortHeap.Pop(); - } - } - - while (hullCount > maxCount) - { - sortHeap.Flush(); - ndConvexFaceNode* ptr = hullPoint; - ndVector e0(ptr->m_next->m_point2d - ptr->m_point2d); - do - { - ndVector e1(ptr->m_next->m_next->m_point2d - ptr->m_next->m_point2d); - ndFloat32 area = e0.m_y * e1.m_x - e0.m_x * e1.m_y; - sortHeap.Push(ptr->m_next, area); - e0 = e1; - ptr->m_mask = 1; - ptr = ptr->m_next; - } while (ptr != hullPoint); - - while (sortHeap.GetCount() && (hullCount > maxCount)) - { - ndConvexFaceNode* const corner = sortHeap[0]; - if (corner->m_mask && corner->m_prev->m_mask) - { - if (hullPoint == corner) - { - hullPoint = corner->m_prev; - } - hullCount--; - ndAssert(hullCount >= 1); - hasLinearCombination = true; - corner->m_prev->m_mask = 0; - corner->m_next->m_prev = corner->m_prev; - corner->m_prev->m_next = corner->m_next; - } - sortHeap.Pop(); - } - } - - //hullCount = 0; - ndConvexFaceNode* ptr = hullPoint; - do - { - ndInt32 index = ndInt32(ptr->m_point2d.m_w); - //buffer[hullCount] = contactArray[index]; - buffer.PushBack(contactArray[index]); - //hullCount++; - ptr = ptr->m_next; - } while (ptr != hullPoint); - - //for (ndInt32 i = hullCount-1; i >= 0; --i) - for (ndInt32 i = buffer.GetCount() - 1; i >= 0; --i) - { - contactArray[i] = buffer[i]; - } - return buffer.GetCount(); -} - -ndInt32 ndContactSolver::Prune3dContacts(const ndMatrix& matrix, ndInt32 count, ndContactPoint* const contactArray, ndInt32 maxCount) const -{ -#if 0 - ndFixSizeArray array; - ndFloat32 max_x = ndFloat32(1.0e20f); - ndInt32 maxIndex = 0; - array.SetCount(count); - for (ndInt32 i = 0; i < count; ++i) - { - array[i] = matrix.UntransformVector(contactArray[i].m_point); - array[i].m_w = ndFloat32(i); - if (array[i].m_x < max_x) - { - maxIndex = i; - max_x = array[i].m_x; - } - } - dSwap(array[0], array[maxIndex]); - - for (ndInt32 i = 2; i < count; ++i) - { - ndInt32 j = i; - ndVector tmp(array[i]); - for (; array[j - 1].m_x > tmp.m_x; --j) - { - dAssert(j > 0); - array[j] = array[j - 1]; - } - array[j] = tmp; - } - - ndFloat32 window = ndFloat32(2.5e-3f); - do - { - ndInt32 packContacts = 0; - window *= ndFloat32(2.0f); - const ndFloat32 window2 = window * window; - - ndUnsigned8 mask[D_MAX_CONTATCS]; - memset(mask, 0, count * sizeof(ndUnsigned8)); - for (ndInt32 i = 0; i < count; ++i) - { - if (!mask[i]) - { - const ndFloat32 val = array[i].m_x + window; - for (ndInt32 j = i + 1; (j < count) && (array[j].m_x < val); ++j) - { - if (!mask[j]) - { - ndVector dp((array[j] - array[i]) & ndVector::m_triplexMask); - dAssert(dp.m_w == ndFloat32(0.0f)); - ndFloat32 dist2 = dp.DotProduct(dp).GetScalar(); - if (dist2 < window2) - { - mask[j] = 1; - packContacts = 1; - } - } - } - } - } - - if (packContacts) - { - ndInt32 j = 0; - for (ndInt32 i = 0; i < count; ++i) - { - if (!mask[i]) - { - array[j] = array[i]; - j++; - } - } - count = j; - } - } while (count > maxCount); - - //ndContactPoint tmpContact[16]; - ndFixSizeArray tmpContact; - tmpContact.SetCount(count); - for (ndInt32 i = 0; i < count; ++i) - { - ndInt32 index = ndInt32(array[i].m_w); - tmpContact[i] = contactArray[index]; - } - - for (ndInt32 i = count - 1; i >= 0; --i) - { - contactArray[i] = tmpContact[i]; - } - - return count; -#else - - class ndCluster - { - public: - ndVector m_sum; - ndVector m_sum2; - ndInt32 m_start; - ndInt32 m_count; - }; - - ndCluster cluster; - cluster.m_start = 0; - cluster.m_count = count; - cluster.m_sum = ndVector::m_zero; - cluster.m_sum2 = ndVector::m_zero; - - ndFixSizeArray array; - array.SetCount(count); - for (ndInt32 i = 0; i < count; ++i) - { - const ndVector p(matrix.UntransformVector(contactArray[i].m_point)); - array[i] = p; - array[i].m_w = ndFloat32(i); - cluster.m_sum += p; - cluster.m_sum2 += p * p; - } - - ndInt32 baseCount = 0; - const ndInt32 clusterSize = 8; - if (cluster.m_count > clusterSize) - { - ndCluster spliteStack[128]; - spliteStack[0] = cluster; - - baseCount = 0; - ndInt32 stack = 1; - while (stack) - { - stack--; - cluster = spliteStack[stack]; - - const ndVector origin(cluster.m_sum.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count)); - const ndVector variance2(cluster.m_sum2.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count) - origin * origin); - ndFloat32 maxVariance2 = ndMax(ndMax(variance2.m_x, variance2.m_y), variance2.m_z); - - if ((cluster.m_count <= clusterSize) || (stack > (ndInt32(sizeof(spliteStack) / sizeof(spliteStack[0])) - 4)) || (maxVariance2 < ndFloat32(1.e-4f))) - { - ndAssert(baseCount <= cluster.m_start); - const ndFloat32 window = ndFloat32(2.5e-3f); - ndFloat32 window2 = window * window; - for (ndInt32 i = 0; i < cluster.m_count - 1; ++i) - { - const ndVector test(array[cluster.m_start + i]); - for (ndInt32 j = i + 1; j < cluster.m_count; ++j) - { - const ndVector error(test - array[cluster.m_start + j]); - ndFloat32 dist2 = error.DotProduct(error).GetScalar(); - if (dist2 < window2) - { - array[cluster.m_start + j] = array[cluster.m_start + cluster.m_count - 1]; - cluster.m_count--; - i--; - break; - } - } - } - - for (ndInt32 i = 0; i < cluster.m_count; ++i) - { - array[baseCount] = array[cluster.m_start + i]; - baseCount++; - } - } - else - { - ndInt32 firstSortAxis = 0; - if ((variance2.m_y >= variance2.m_x) && (variance2.m_y >= variance2.m_z)) - { - firstSortAxis = 1; - } - else if ((variance2.m_z >= variance2.m_x) && (variance2.m_z >= variance2.m_y)) - { - firstSortAxis = 2; - } - ndFloat32 axisVal = origin[firstSortAxis]; - - ndInt32 i0 = 0; - ndInt32 i1 = cluster.m_count - 1; - - const ndInt32 start = cluster.m_start; - while (i0 < i1) - { - while ((array[start + i0][firstSortAxis] <= axisVal) && (i0 < i1)) - { - ++i0; - }; - - while ((array[start + i1][firstSortAxis] > axisVal) && (i0 < i1)) - { - --i1; - } - - ndAssert(i0 <= i1); - if (i0 < i1) - { - ndSwap(array[start + i0], array[start + i1]); - ++i0; - --i1; - } - } - - while ((array[start + i0][firstSortAxis] <= axisVal) && (i0 < cluster.m_count)) - { - ++i0; - }; - - #ifdef _DEBUG - for (ndInt32 i = 0; i < i0; ++i) - { - ndAssert(array[start + i][firstSortAxis] <= axisVal); - } - - for (ndInt32 i = i0; i < cluster.m_count; ++i) - { - ndAssert(array[start + i][firstSortAxis] > axisVal); - } - #endif - - ndVector xc(ndVector::m_zero); - ndVector x2c(ndVector::m_zero); - for (ndInt32 i = 0; i < i0; ++i) - { - const ndVector x(array[start + i]); - xc += x; - x2c += x * x; - } - - ndCluster cluster_i1(cluster); - cluster_i1.m_start = start + i0; - cluster_i1.m_count = cluster.m_count - i0; - cluster_i1.m_sum -= xc; - cluster_i1.m_sum2 -= x2c; - spliteStack[stack] = cluster_i1; - stack++; - - ndCluster cluster_i0(cluster); - cluster_i0.m_start = start; - cluster_i0.m_count = i0; - cluster_i0.m_sum = xc; - cluster_i0.m_sum2 = x2c; - spliteStack[stack] = cluster_i0; - stack++; - } - } - } - else - { - ndAssert(cluster.m_start == 0); - const ndFloat32 window = ndFloat32(2.5e-3f); - ndFloat32 window2 = window * window; - for (ndInt32 i = 0; i < cluster.m_count - 1; ++i) - { - const ndVector test(array[i]); - for (ndInt32 j = i + 1; j < cluster.m_count; ++j) - { - const ndVector error(test - array[j]); - ndFloat32 dist2 = error.DotProduct(error).GetScalar(); - if (dist2 < window2) - { - array[j] = array[cluster.m_count - 1]; - cluster.m_count--; - i--; - break; - } - } - } - baseCount = cluster.m_count; - } - - count = baseCount; - if (baseCount > maxCount) - { - ndInt32 maxIndex = 0; - ndFloat32 min_x = ndFloat32(1.0e20f); - for (ndInt32 i = 0; i < count; ++i) - { - if (array[i].m_x < min_x) - { - maxIndex = i; - min_x = array[i].m_x; - } - } - ndSwap(array[0], array[maxIndex]); - - for (ndInt32 i = 2; i < count; ++i) - { - ndInt32 j = i; - ndVector tmp(array[i]); - for (; array[j - 1].m_x > tmp.m_x; --j) - { - ndAssert(j > 0); - array[j] = array[j - 1]; - } - array[j] = tmp; - } - - ndFloat32 window = ndFloat32(2.5e-3f); - do - { - ndInt32 packContacts = 0; - window *= ndFloat32(2.0f); - const ndFloat32 window2 = window * window; - - ndUnsigned8 mask[D_MAX_CONTATCS]; - memset(mask, 0, count * sizeof(ndUnsigned8)); - for (ndInt32 i = 0; i < count; ++i) - { - if (!mask[i]) - { - const ndFloat32 val = array[i].m_x + window; - for (ndInt32 j = i + 1; (j < count) && (array[j].m_x < val); ++j) - { - if (!mask[j]) - { - ndVector dp((array[j] - array[i]) & ndVector::m_triplexMask); - ndAssert(dp.m_w == ndFloat32(0.0f)); - ndFloat32 dist2 = dp.DotProduct(dp).GetScalar(); - if (dist2 < window2) - { - mask[j] = 1; - packContacts = 1; - } - } - } - } - } - - if (packContacts) - { - ndInt32 j = 0; - for (ndInt32 i = 0; i < count; ++i) - { - if (!mask[i]) - { - array[j] = array[i]; - j++; - } - } - count = j; - } - } while (count > maxCount); - } - - ndFixSizeArray tmpContact; - tmpContact.SetCount(count); - for (ndInt32 i = 0; i < count; ++i) - { - ndInt32 index = ndInt32(array[i].m_w); - tmpContact[i] = contactArray[index]; - } - - for (ndInt32 i = count - 1; i >= 0; --i) - { - contactArray[i] = tmpContact[i]; - } - return count; -#endif -} - -ndInt32 ndContactSolver::PruneContacts(ndInt32 count, ndInt32 maxCount) const -{ - ndVector origin(ndVector::m_zero); - ndContactPoint* const contactArray = m_contactBuffer; - - for (ndInt32 i = 0; i < count; ++i) - { - origin += contactArray[i].m_point; - } - ndVector scale(ndFloat32(1.0f) / (ndFloat32)count); - origin = origin * scale; - origin.m_w = ndFloat32(1.0f); - - ndMatrix covariance(ndGetZeroMatrix()); - for (ndInt32 i = 0; i < count; ++i) - { - ndVector p((contactArray[i].m_point - origin) & ndVector::m_triplexMask); - ndAssert(p.m_w == ndFloat32(0.0f)); - ndMatrix matrix(ndCovarianceMatrix(p, p)); - covariance.m_front += matrix.m_front; - covariance.m_up += matrix.m_up; - covariance.m_right += matrix.m_right; - } - - for (ndInt32 i = 0; i < 3; ++i) - { - if (ndAbs(covariance[i][i]) < ndFloat32(1.0e-8f)) - { - for (ndInt32 j = 0; j < 3; ++j) - { - covariance[i][j] = ndFloat32(0.0f); - covariance[j][i] = ndFloat32(0.0f); - } - covariance[i][i] = ndFloat32(1.0e-8f); - } - } - - ndVector eigen(covariance.EigenVectors() & ndVector::m_triplexMask); - ndAssert(eigen.DotProduct(eigen).GetScalar() > ndFloat32(0.0f)); - eigen = eigen.Normalize(); - covariance.m_posit = origin; - if (eigen[1] < eigen[2]) - { - ndSwap(eigen[1], eigen[2]); - for (ndInt32 i = 0; i < 4; ++i) - { - ndSwap(covariance[i][1], covariance[i][2]); - } - } - if (eigen[0] < eigen[1]) - { - ndSwap(eigen[0], eigen[1]); - for (ndInt32 i = 0; i < 4; ++i) - { - ndSwap(covariance[i][0], covariance[i][1]); - } - } - if (eigen[1] < eigen[2]) - { - ndSwap(eigen[1], eigen[2]); - for (ndInt32 i = 0; i < 4; ++i) - { - ndSwap(covariance[i][1], covariance[i][2]); - } - } - - const ndFloat32 eigenValueError = ndFloat32(1.0e-4f); - if (eigen[2] > eigenValueError) - { - // 3d convex Hull - return Prune3dContacts(covariance, count, contactArray, maxCount); - } - else if (eigen[1] > eigenValueError) - { - // is a 2d or 1d convex hull - return Prune2dContacts(covariance, count, contactArray, maxCount); - } - else if (eigen[0] > eigenValueError) - { - // is a line or a point convex hull - if (count > 2) - { - ndFloat32 maxValue = ndFloat32(-1.0e10f); - ndFloat32 minValue = ndFloat32(-1.0e10f); - ndInt32 j0 = 0; - ndInt32 j1 = 0; - for (ndInt32 i = 0; i < count; ++i) - { - ndFloat32 dist = contactArray[i].m_point.DotProduct(covariance.m_front).GetScalar(); - if (dist > maxValue) - { - j0 = i; - maxValue = dist; - } - if (-dist > minValue) - { - j1 = i; - minValue = -dist; - } - } - ndContactPoint c0(contactArray[j0]); - ndContactPoint c1(contactArray[j1]); - contactArray[0] = c0; - contactArray[1] = c1; - count = 2; - } - if (count == 2) - { - ndVector segment(contactArray[1].m_point - contactArray[0].m_point); - ndFloat32 dist2 = segment.DotProduct(segment).GetScalar(); - if (dist2 < ndFloat32(5.0e-3f * 5.0e-3f)) - { - count = 1; - } - } - //ndAssert(count <= 1); - return count; - } - - return 1; -} - -ndFloat32 ndContactSolver::RayCast(const ndVector& localP0, const ndVector& localP1, ndContactPoint& contactOut) -{ - ndVector point(localP0); - ndVector point0(localP0); - ndVector normal(ndVector::m_zero); - ndVector p0p1(localP0 - localP1); - - // avoid NaN as a result of a division by zero - if ((p0p1.TestZero().GetSignMask() & 7) == 7) - { - return ndFloat32(1.2f); - } - - ndFloat32 param = ndFloat32(0.0f); - - ndInt32 index = 0; - memset(m_hullSum, 0, 4 * sizeof(m_hullSum[0])); - const ndShapeConvex* const shape = m_instance0.GetShape()->GetAsShapeConvex(); - - ndVector dir1(p0p1.Normalize()); - m_hullDiff[0] = shape->SupportVertex(dir1) - point; - ndBigVector v(m_hullDiff[0]); - index = 1; - do - { - ndInt32 iter = 0; - ndInt32 cycling = 0; - ndFloat64 minDist = ndFloat32(1.0e20f); - - do - { - ndAssert(v.m_w == ndFloat32(0.0f)); - const ndFloat64 distance = v.DotProduct(v).GetScalar(); - if (distance < ndFloat32(1.0e-9f)) - { - index = -1; - break; - } - - if (distance < minDist) - { - minDist = distance; - cycling = -1; - } - cycling++; - if (cycling > 4) - { - index = -1; - break; - } - - ndVector dir(v.Scale(-ndRsqrt(ndFloat32(distance)))); - ndAssert(dir.m_w == ndFloat32(0.0f)); - m_hullDiff[index] = shape->SupportVertex(dir) - point; - const ndBigVector w(m_hullDiff[index]); - const ndVector wv(w - v); - ndAssert(wv.m_w == ndFloat32(0.0f)); - const ndFloat32 distance1 = dir.DotProduct(wv).GetScalar(); - if (distance1 < ndFloat64(1.0e-3f)) - { - normal = dir; - break; - } - - index++; - switch (index) - { - case 2: - { - v = ReduceLine(index); - break; - } - - case 3: - { - v = ReduceTriangle(index); - break; - } - - case 4: - { - v = ReduceTetrahedrum(index); - break; - } - } - - iter++; - } while (iter < D_CONNICS_CONTATS_ITERATIONS); - - ndAssert(index); - if (index > 0) - { - ndVector q(v + point); - ndFloat32 den = normal.DotProduct(p0p1).GetScalar(); - if (ndAbs(den) < ndFloat32(1.0e-12f)) - { - den = ndSign(den) * ndFloat32(1.0e-12f); - } - ndAssert(normal.m_w == ndFloat32(0.0f)); - ndFloat32 t1 = normal.DotProduct(localP0 - q).GetScalar() / den; - - if (t1 < param) - { - index = -1; - t1 = ndFloat32(0.0f); - } - else if (t1 > ndFloat32 (1.0f)) - { - index = -1; - t1 = ndFloat32(1.0f); - } - param = t1; - - point = localP0 - p0p1.Scale(param); - ndVector step(point0 - point); - point0 = point; - for (ndInt32 i = 0; i < index; ++i) - { - m_hullDiff[i] += step; - } - - switch (index) - { - case 1: - { - v = m_hullDiff[0]; - break; - } - - case 2: - { - v = ReduceLine(index); - break; - } - - case 3: - { - v = ReduceTriangle(index); - break; - } - - case 4: - { - v = ReduceTetrahedrum(index); - break; - } - } - } - } while (index >= 0); - - if ((param > ndFloat32(0.0f)) && (param < ndFloat32(1.0f))) - { - contactOut.m_normal = normal; - } - else - { - param = ndFloat32(1.2f); - } - return param; -} - -inline ndMinkFace* ndContactSolver::NewFace() -{ - ndMinkFace* face = (ndMinkFace*)m_freeFace; - if (m_freeFace) - { - m_freeFace = m_freeFace->m_next; - } - else - { - face = &m_facePool[m_faceIndex]; - m_faceIndex++; - if (m_faceIndex >= D_CONVEX_MINK_MAX_FACES) - { - return nullptr; - } - } - -#ifdef _DEBUG - memset(face, 0, sizeof(ndMinkFace)); -#endif - return face; -} - -inline ndMinkFace* ndContactSolver::AddFace(ndInt32 v0, ndInt32 v1, ndInt32 v2) -{ - ndMinkFace* const face = NewFace(); - face->m_mark = 0; - face->m_vertex[0] = ndInt16(v0); - face->m_vertex[1] = ndInt16(v1); - face->m_vertex[2] = ndInt16(v2); - return face; -} - -inline void ndContactSolver::PushFace(ndMinkFace* const face) -{ - ndInt32 i0 = face->m_vertex[0]; - ndInt32 i1 = face->m_vertex[1]; - ndInt32 i2 = face->m_vertex[2]; - - ndPlane plane(m_hullDiff[i0], m_hullDiff[i1], m_hullDiff[i2]); - ndFloat32 mag2 = plane.DotProduct(plane & ndVector::m_triplexMask).GetScalar(); - face->m_alive = 1; - if (mag2 > ndFloat32(1.0e-16f)) - { - face->m_plane = plane.Scale(ndRsqrt(mag2)); - ndMinkFace* face1 = face; - Push(face1, face->m_plane.m_w); - } - else - { - face->m_plane = ndPlane(ndVector::m_zero); - } -} - -inline void ndContactSolver::DeleteFace(ndMinkFace* const face) -{ - dgFaceFreeList* const freeFace = (dgFaceFreeList*)face; - freeFace->m_next = m_freeFace; - m_freeFace = freeFace; -} - -ndInt32 ndContactSolver::CalculateIntersectingPlane(ndInt32 count) -{ - ndAssert(count >= 1); - if (count == 1) - { - SupportVertex(m_contact->m_initialSeparatingVector.Scale(ndFloat32(-1.0f)), 1); - ndVector err(m_hullDiff[1] - m_hullDiff[0]); - ndAssert(err.m_w == ndFloat32(0.0f)); - if (err.DotProduct(err).GetScalar() < ndFloat32(1.0e-8f)) - { - return -1; - } - count = 2; - } - - if (count == 2) - { - ndVector e0(m_hullDiff[1] - m_hullDiff[0]); - ndAssert(e0.m_w == ndFloat32(0.0f)); - ndAssert(e0.DotProduct(e0).GetScalar() > ndFloat32(0.0f)); - //ndMatrix matrix(e0.Scale(ndRsqrt(e0.DotProduct(e0).GetScalar()))); - ndMatrix matrix(ndGramSchmidtMatrix(e0)); - ndMatrix rotation(ndPitchMatrix(ndFloat32(45.0f * ndDegreeToRad))); - ndFloat32 maxArea = ndFloat32(0.0f); - for (ndInt32 i = 0; i < 8; ++i) - { - SupportVertex(matrix[1], 3); - ndVector e1(m_hullDiff[3] - m_hullDiff[0]); - ndAssert(e1.m_w == ndFloat32(0.0f)); - ndVector area(e0.CrossProduct(e1)); - ndFloat32 area2 = area.DotProduct(area).GetScalar(); - if (area2 > maxArea) - { - m_hullSum[2] = m_hullSum[3]; - m_hullDiff[2] = m_hullDiff[3]; - maxArea = area2; - } - matrix = rotation * matrix; - } - if (ndAbs(maxArea) < ndFloat32(1e-15f)) - { - return -1; - } - ndAssert(maxArea > ndFloat32(0.0f)); - count++; - } - - ndFloat32 volume = ndFloat32(0.0f); - if (count == 3) - { - ndVector e10(m_hullDiff[1] - m_hullDiff[0]); - ndVector e20(m_hullDiff[2] - m_hullDiff[0]); - ndVector normal(e10.CrossProduct(e20)); - ndAssert(normal.m_w == ndFloat32(0.0f)); - ndFloat32 mag2 = normal.DotProduct(normal).GetScalar(); - ndAssert(mag2 > ndFloat32(0.0f)); - normal = normal.Scale(ndRsqrt(mag2)); - SupportVertex(normal, 3); - volume = normal.DotProduct(m_hullDiff[3] - m_hullDiff[0]).GetScalar(); - if (ndAbs(volume) < ndFloat32(1.0e-10f)) - { - normal = normal.Scale(ndFloat32(-1.0f)); - SupportVertex(normal, 3); - volume = -normal.DotProduct(m_hullDiff[3] - m_hullDiff[0]).GetScalar(); - if (ndAbs(volume) < ndFloat32(1.0e-10f)) - { - volume = ndFloat32(0.0f); - } - } - count = 4; - } - else if (count == 4) - { - ndVector e0(m_hullDiff[1] - m_hullDiff[0]); - ndVector e1(m_hullDiff[2] - m_hullDiff[0]); - ndVector e2(m_hullDiff[3] - m_hullDiff[0]); - ndVector n(e1.CrossProduct(e2)); - ndAssert(n.m_w == ndFloat32(0.0f)); - volume = e0.DotProduct(n).GetScalar(); - } - - ndAssert(count == 4); - if (volume > ndFloat32(0.0f)) - { - ndSwap(m_hullSum[1], m_hullSum[0]); - ndSwap(m_hullDiff[1], m_hullDiff[0]); - } - - if (ndAbs(volume) < ndFloat32(1e-15f)) - { - // this volume is unrealizable, let us build a different tetrahedron using the method of core 200 - ndVector e1; - ndVector e2; - ndVector e3; - ndVector normal(ndFloat32(0.0f)); - - const ndInt32 nCount = ndInt32(sizeof(m_hullDirs) / sizeof(m_hullDirs[0])); - const ndFloat32 D_CALCULATE_SEPARATING_PLANE_ERROR = ndFloat32(1.0f / 1024.0f); - - ndFloat32 error2 = ndFloat32(0.0f); - SupportVertex(m_hullDirs[0], 0); - - ndInt32 i = 1; - for (; i < nCount; ++i) - { - SupportVertex(m_hullDirs[i], 1); - e1 = m_hullDiff[1] - m_hullDiff[0]; - ndAssert(e1.m_w == ndFloat32(0.0f)); - error2 = e1.DotProduct(e1).GetScalar(); - if (error2 > D_CALCULATE_SEPARATING_PLANE_ERROR) - { - break; - } - } - - for (i++; i < nCount; ++i) - { - SupportVertex(m_hullDirs[i], 2); - e2 = m_hullDiff[2] - m_hullDiff[0]; - normal = e1.CrossProduct(e2); - ndAssert(normal.m_w == ndFloat32(0.0f)); - error2 = normal.DotProduct(normal).GetScalar(); - if (error2 > D_CALCULATE_SEPARATING_PLANE_ERROR) - { - break; - } - } - - error2 = ndFloat32(0.0f); - for (i++; i < nCount; ++i) - { - SupportVertex(m_hullDirs[i], 3); - e3 = m_hullDiff[3] - m_hullDiff[0]; - ndAssert(normal.m_w == ndFloat32(0.0f)); - error2 = normal.DotProduct(e3).GetScalar(); - if (ndAbs(error2) > D_CALCULATE_SEPARATING_PLANE_ERROR) - { - break; - } - } - - if (i >= nCount) - { - return -1; - } - - if (error2 > ndFloat32(0.0f)) - { - ndSwap(m_hullSum[1], m_hullSum[2]); - ndSwap(m_hullDiff[1], m_hullDiff[2]); - } - - #ifdef _DEBUG - { - ndVector f0(m_hullDiff[1] - m_hullDiff[0]); - ndVector f1(m_hullDiff[2] - m_hullDiff[0]); - ndVector f2(m_hullDiff[3] - m_hullDiff[0]); - ndVector n(f1.CrossProduct(f2)); - ndAssert(n.m_w == ndFloat32(0.0f)); - ndFloat32 volume1 = f0.DotProduct(n).GetScalar(); - ndAssert(volume1 < ndFloat32(0.0f)); - } - #endif - } - - // clear the face cache!! - Flush(); - m_faceIndex = 0; - m_vertexIndex = 4; - m_freeFace = nullptr; - - ndMinkFace* const f0 = AddFace(0, 1, 2); - ndMinkFace* const f1 = AddFace(0, 2, 3); - ndMinkFace* const f2 = AddFace(2, 1, 3); - ndMinkFace* const f3 = AddFace(1, 0, 3); - - f0->m_twin[0] = f3; - f0->m_twin[1] = f2; - f0->m_twin[2] = f1; - - f1->m_twin[0] = f0; - f1->m_twin[1] = f2; - f1->m_twin[2] = f3; - - f2->m_twin[0] = f0; - f2->m_twin[1] = f3; - f2->m_twin[2] = f1; - - f3->m_twin[0] = f0; - f3->m_twin[1] = f1; - f3->m_twin[2] = f2; - - PushFace(f0); - PushFace(f1); - PushFace(f2); - PushFace(f3); - - ndInt32 cycling = 0; - ndInt32 iterCount = 0; - ndFloat32 cyclingMem[4]; - cyclingMem[0] = ndFloat32(1.0e10f); - cyclingMem[1] = ndFloat32(1.0e10f); - cyclingMem[2] = ndFloat32(1.0e10f); - cyclingMem[3] = ndFloat32(1.0e10f); - - const ndFloat32 resolutionScale = ndFloat32(0.125f); - const ndFloat32 minTolerance = D_PENETRATION_TOL; - - while (GetCount()) - { - ndMinkFace* const faceNode = (*this)[0]; - Pop(); - - if (faceNode->m_alive) - { - SupportVertex(faceNode->m_plane & ndVector::m_triplexMask, m_vertexIndex); - const ndVector& p = m_hullDiff[m_vertexIndex]; - ndFloat32 dist = faceNode->m_plane.Evalue(p); - ndFloat32 distTolerance = ndMax(ndAbs(faceNode->m_plane.m_w) * resolutionScale, minTolerance); - - if (dist < distTolerance) - { - ndVector sum[3]; - ndVector diff[3]; - m_separatingVector = faceNode->m_plane & ndVector::m_triplexMask; - for (ndInt32 i = 0; i < 3; ++i) - { - ndInt32 j = faceNode->m_vertex[i]; - sum[i] = m_hullSum[j]; - diff[i] = m_hullDiff[j]; - } - for (ndInt32 i = 0; i < 3; ++i) - { - m_hullSum[i] = sum[i]; - m_hullDiff[i] = diff[i]; - } - return 3; - } - - iterCount++; - bool isCycling = false; - cyclingMem[cycling] = dist; - if (iterCount > 10) - { - ndInt32 cyclingIndex = cycling; - for (ndInt32 i = 0; i < 3; ++i) - { - ndInt32 cyclingIndex0 = (cyclingIndex - 1) & 3; - if (((cyclingMem[cyclingIndex0] - cyclingMem[cyclingIndex]) < ndFloat32(-1.0e-5f))) - { - isCycling = true; - cyclingMem[0] = ndFloat32(1.0e10f); - cyclingMem[1] = ndFloat32(1.0e10f); - cyclingMem[2] = ndFloat32(1.0e10f); - cyclingMem[3] = ndFloat32(1.0e10f); - break; - } - cyclingIndex = cyclingIndex0; - } - } - cycling = (cycling + 1) & 3; - - if (!isCycling) - { - m_faceStack[0] = faceNode; - ndInt32 stackIndex = 1; - ndInt32 deletedCount = 0; - - while (stackIndex) - { - stackIndex--; - ndMinkFace* const face = m_faceStack[stackIndex]; - - if (!face->m_mark && (face->m_plane.Evalue(p) > ndFloat32(0.0f))) - { - #ifdef _DEBUG - for (ndInt32 i = 0; i < deletedCount; ++i) - { - ndAssert(m_deletedFaceList[i] != face); - } - #endif - - m_deletedFaceList[deletedCount] = face; - deletedCount++; - ndAssert(deletedCount < ndInt32 (sizeof(m_deletedFaceList) / sizeof(m_deletedFaceList[0]))); - face->m_mark = 1; - - for (ndInt32 i = 0; i < 3; ++i) - { - ndMinkFace* const twinFace = face->m_twin[i]; - if (twinFace && !twinFace->m_mark) - { - m_faceStack[stackIndex] = twinFace; - stackIndex++; - ndAssert(stackIndex < ndInt32 (sizeof(m_faceStack) / sizeof(m_faceStack[0]))); - } - } - } - } - - //ndAssert (SanityCheck()); - ndInt32 newCount = 0; - for (ndInt32 i = 0; i < deletedCount; ++i) - { - ndMinkFace* const face = m_deletedFaceList[i]; - face->m_alive = 0; - ndAssert(face->m_mark == 1); - ndInt32 j0 = 2; - for (ndInt32 j1 = 0; j1 < 3; j1++) - { - ndMinkFace* const twinFace = face->m_twin[j0]; - if (twinFace && !twinFace->m_mark) - { - ndMinkFace* const newFace = NewFace(); - if (newFace) - { - newFace->m_mark = 0; - newFace->m_vertex[0] = ndInt16(m_vertexIndex); - newFace->m_vertex[1] = ndInt16(face->m_vertex[j0]); - newFace->m_vertex[2] = ndInt16(face->m_vertex[j1]); - PushFace(newFace); - - newFace->m_twin[1] = twinFace; - ndInt32 index = (twinFace->m_twin[0] == face) ? 0 : ((twinFace->m_twin[1] == face) ? 1 : 2); - twinFace->m_twin[index] = newFace; - - m_coneFaceList[newCount] = newFace; - newCount++; - ndAssert(newCount < ndInt32 (sizeof(m_coneFaceList) / sizeof(m_coneFaceList[0]))); - } - else - { - // this is very rare but is does happend with some degenerated faces. - return -1; - } - } - j0 = j1; - } - } - - ndInt32 i0 = newCount - 1; - for (ndInt32 i1 = 0; i1 < newCount; ++i1) - { - ndMinkFace* const faceA = m_coneFaceList[i0]; - ndAssert(faceA->m_mark == 0); - - ndInt32 j0 = newCount - 1; - for (ndInt32 j1 = 0; j1 < newCount; j1++) - { - if (i0 != j0) - { - ndMinkFace* const faceB = m_coneFaceList[j0]; - ndAssert(faceB->m_mark == 0); - if (faceA->m_vertex[2] == faceB->m_vertex[1]) - { - faceA->m_twin[2] = faceB; - faceB->m_twin[0] = faceA; - break; - } - } - j0 = j1; - } - i0 = i1; - } - - m_vertexIndex++; - ndAssert(m_vertexIndex < ndInt32 (sizeof(m_hullDiff) / sizeof(m_hullDiff[0]))); - //ndAssert(SanityCheck()); - } - } - else - { - DeleteFace(faceNode); - } - } - return -1; -} - -bool ndContactSolver::CalculateClosestPoints() -{ - ndInt32 simplexPointCount = CalculateClosestSimplex(); - if (simplexPointCount < 0) - { - simplexPointCount = CalculateIntersectingPlane(-simplexPointCount); - } - - if (simplexPointCount > 0) - { - ndAssert((simplexPointCount > 0) && (simplexPointCount <= 3)); - CalculateContactFromFeacture(simplexPointCount); - - const ndMatrix& matrix0 = m_instance0.m_globalMatrix; - const ndMatrix& matrix1 = m_instance1.m_globalMatrix; - m_closestPoint0 = matrix0.TransformVector(m_instance0.SupportVertexSpecialProjectPoint(matrix0.UntransformVector(m_closestPoint0), matrix0.UnrotateVector(m_separatingVector))); - m_closestPoint1 = matrix1.TransformVector(m_instance1.SupportVertexSpecialProjectPoint(matrix1.UntransformVector(m_closestPoint1), matrix1.UnrotateVector(m_separatingVector * ndVector::m_negOne))); - m_vertexIndex = simplexPointCount; - } - return simplexPointCount >= 0; -} - -//************************************************************* -// calculate proper separation distance for discrete collision. -//************************************************************* -ndInt32 ndContactSolver::CalculateContactsDiscrete() -{ - ndInt32 count = 0; - if (m_instance0.GetShape()->GetAsShapeCompound() || m_instance1.GetShape()->GetAsShapeCompound()) - { - count = CompoundContactsDiscrete(); - } - else if (m_instance0.GetShape()->GetAsShapeConvex()) - { - count = ConvexContactsDiscrete(); - } - else - { - //ndTrace(("Fix compound contact for pair: %s %s\n", m_instance0.GetShape()->ClassName(), m_instance1.GetShape()->ClassName())); - //ndAssert(0); - } - - m_contact->m_timeOfImpact = m_timestep; - m_contact->m_separatingVector = m_separatingVector; - ndAssert(!count || (m_separationDistance < ndFloat32(100.0f))); - m_contact->m_separationDistance = m_separationDistance; - return count; -} - -ndInt32 ndContactSolver::ConvexContactsDiscrete() -{ - const ndVector origin0(m_instance0.m_globalMatrix.m_posit); - const ndVector origin1(m_instance1.m_globalMatrix.m_posit); - m_instance0.m_globalMatrix.m_posit = ndVector::m_wOne; - m_instance1.m_globalMatrix.m_posit -= (origin0 & ndVector::m_triplexMask); - - // handle rare case of two shapes located exactly at the same origin - const ndVector error(m_instance1.m_globalMatrix.m_posit - m_instance0.m_globalMatrix.m_posit); - if (error.DotProduct(error).GetScalar() < ndFloat32(1.0e-6f)) - { - m_instance1.m_globalMatrix.m_posit.m_y += ndFloat32(1.0e-3f); - } - - ndInt32 count = 0; - if (m_instance1.GetShape()->GetAsShapeConvex()) - { - ndAssert(m_instance0.GetShape()->GetAsShapeConvex()); - count = ConvexToConvexContactsDiscrete(); - } - else - { - if (m_instance1.GetShape()->GetAsShapeStaticMesh()) - { - count = ConvexToStaticMeshContactsDiscrete(); - } - else - { - //ndAssert(0); - count = 0; - } - } - - if (m_pruneContacts) - { - switch (count) - { - case 0: - case 1: - break; - - case 2: - { - ndVector length(m_contactBuffer[1].m_point - m_contactBuffer[0].m_point); - ndFloat32 mag2 = length.DotProduct(length & ndVector::m_triplexMask).GetScalar(); - if (mag2 < ndFloat32(2.0e-3f) * ndFloat32(2.0e-3f)) - { - m_contactBuffer[0].m_point = ndVector::m_half * (m_contactBuffer[1].m_point + m_contactBuffer[0].m_point); - count = 1; - } - break; - } - - case 3: - // could write special case for triangles, but for now, just call prune - //break; - - default: - count = PruneContacts(count, 16); - } - } - - const ndVector offset(origin0 & ndVector::m_triplexMask); - m_closestPoint0 += offset; - m_closestPoint1 += offset; - - if (!m_intersectionTestOnly) - { - ndContactPoint* const contactOut = m_contactBuffer; - for (ndInt32 i = count - 1; i >= 0; i--) - { - contactOut[i].m_point += offset; - } - } - - m_instance0.m_globalMatrix.m_posit = origin0; - m_instance1.m_globalMatrix.m_posit = origin1; - return count; -} - -ndInt32 ndContactSolver::ConvexToConvexContactsDiscrete() -{ - ndAssert(m_instance0.GetConvexVertexCount() && m_instance1.GetConvexVertexCount()); - ndAssert(m_instance0.GetShape()->GetAsShapeConvex()); - ndAssert(m_instance1.GetShape()->GetAsShapeConvex()); - ndAssert(!m_instance0.GetShape()->GetAsShapeNull()); - ndAssert(!m_instance1.GetShape()->GetAsShapeNull()); - - ndInt32 count = 0; - bool colliding = CalculateClosestPoints(); - ndFloat32 penetration = m_separatingVector.DotProduct(m_closestPoint1 - m_closestPoint0).GetScalar() - m_skinMargin - D_PENETRATION_TOL; - m_separationDistance = penetration; - if (m_intersectionTestOnly) - { - count = (penetration <= ndFloat32(0.0f)) ? 1 : 0; - } - else if (colliding) - { - if (penetration <= ndFloat32(1.0e-5f)) - { - if (ndInt8 (m_instance0.GetCollisionMode()) & ndInt8(m_instance1.GetCollisionMode())) - { - count = CalculateContacts(m_closestPoint0, m_closestPoint1, m_separatingVector * ndVector::m_negOne); - // skip convex shape polygon because they could have a skirt - ndShapeConvexPolygon* const convexPolygon = m_instance1.GetShape()->GetAsShapeAsConvexPolygon(); - if (!(count || convexPolygon)) - { - // poly line failed probably because of rounding error - // but we know the shapes are colliding - // just return the closest points as contacts - m_buffer[0] = ndVector::m_half * (m_closestPoint0 + m_closestPoint1); - count = 1; - } - else if (convexPolygon && count) - { - // the contact point most be very close to the polygon - ndFixSizeArray poly; - ndAssert(convexPolygon->m_count < poly.GetCapacity()); - for (ndInt32 i = 0; i < convexPolygon->m_count; ++i) - { - poly.PushBack(convexPolygon->m_localPoly[i]); - } - - for (ndInt32 i = count - 1; i >= 0; --i) - { - //ndBigVector point(m_buffer[i]); - ndBigVector point(m_buffer[i] - convexPolygon->m_normal * (m_buffer[i] - poly[0]).DotProduct(convexPolygon->m_normal)); - ndBigVector pointInPoly(ndPointToPolygonDistance(point, &poly[0], convexPolygon->m_count)); - - const ndBigVector error(point - pointInPoly); - ndFloat64 dist2 = error.DotProduct(error & ndBigVector::m_triplexMask).GetScalar(); - - if (dist2 > ndFloat64 (5.0e-4f)) - { - count--; - m_buffer[i] = m_buffer[count]; - } - } - } - } - } - - count = ndMin(m_maxCount, count); - ndContactPoint* const contactOut = m_contactBuffer; - - ndBodyKinematic* const body0 = m_contact->GetBody0(); - ndBodyKinematic* const body1 = m_contact->GetBody1(); - ndShapeInstance* const instance0 = &body0->GetCollisionShape(); - ndShapeInstance* const instance1 = &body1->GetCollisionShape(); - - ndVector normal(m_separatingVector * ndVector::m_negOne); - for (ndInt32 i = count - 1; i >= 0; --i) - { - contactOut[i].m_point = m_buffer[i]; - contactOut[i].m_normal = normal; - contactOut[i].m_body0 = body0; - contactOut[i].m_body1 = body1; - contactOut[i].m_shapeInstance0 = instance0; - contactOut[i].m_shapeInstance1 = instance1; - contactOut[i].m_penetration = -penetration; - } - } - - ndAssert(m_separationDistance < ndFloat32(1.0e12f)); - return count; -} - -ndInt32 ndContactSolver::CompoundContactsDiscrete() -{ - if (!m_instance1.GetShape()->GetAsShapeCompound()) - { - ndAssert(m_instance0.GetShape()->GetAsShapeCompound()); - if (m_instance1.GetShape()->GetAsShapeConvex()) - { - return CompoundToConvexContactsDiscrete(); - } - else if (m_instance1.GetShape()->GetAsShapeStaticBVH()) - { - return CompoundToShapeStaticBvhContactsDiscrete(); - } - else if (m_instance1.GetShape()->GetAsShapeHeightfield()) - { - return CompoundToStaticHeightfieldContactsDiscrete(); - } - else if (m_instance1.GetShape()->GetAsShapeStaticProceduralMesh()) - { - return CompoundToStaticProceduralMesh(); - } - else - { - ndTrace(("Fix compound contact for pair: %s %s\n", m_instance0.GetShape()->ClassName(), m_instance1.GetShape()->ClassName())); - ndAssert(0); - } - } - else if (!m_instance0.GetShape()->GetAsShapeCompound()) - { - ndAssert(m_instance1.GetShape()->GetAsShapeCompound()); - if (m_instance0.GetShape()->GetAsShapeConvex()) - { - return ConvexToCompoundContactsDiscrete(); - } - else - { - ndTrace(("Fix compound contact for pair: %s %s\n", m_instance0.GetShape()->ClassName(), m_instance1.GetShape()->ClassName())); - ndAssert(0); - } - } - else - { - ndAssert(m_instance0.GetShape()->GetAsShapeCompound() && m_instance1.GetShape()->GetAsShapeCompound()); - return CompoundToCompoundContactsDiscrete(); - } - return 0; -} - -ndInt32 ndContactSolver::ConvexToCompoundContactsDiscrete() -{ - ndContact* const contactJoint = m_contact; - ndContactPoint* const contacts = m_contactBuffer; - ndBodyKinematic* const convexBody = contactJoint->GetBody0(); - ndBodyKinematic* const compoundBody = contactJoint->GetBody1(); - ndShapeInstance* const convexInstance = &convexBody->GetCollisionShape(); - ndShapeInstance* const compoundInstance = &compoundBody->GetCollisionShape(); - ndShapeCompound* const compoundShape = m_instance1.GetShape()->GetAsShapeCompound(); - ndAssert(compoundShape); - - ndVector size; - ndVector origin; - convexInstance->CalculateObb(origin, size); - const ndMatrix& matrix0 = convexInstance->GetGlobalMatrix(); - const ndMatrix& matrix1 = compoundInstance->GetGlobalMatrix(); - ndBoxBoxDistance2 data(matrix0, matrix1); - - ndInt32 stack = 1; - ndInt32 contactCount = 0; - ndFloat32 stackDistance[D_SCENE_MAX_STACK_DEPTH]; - const ndShapeCompound::ndNodeBase* stackPool[D_COMPOUND_STACK_DEPTH]; - - stackPool[0] = compoundShape->m_root; - stackDistance[0] = data.CalculateDistance2(origin, size, compoundShape->m_root->m_origin, compoundShape->m_root->m_size); - ndFloat32 closestDist = (stackDistance[0] > ndFloat32(0.0f)) ? stackDistance[0] : ndFloat32(1.0e10f); - - while (stack) - { - stack--; - - ndFloat32 dist2 = stackDistance[stack]; - if (dist2 > ndFloat32(0.0f)) - { - closestDist = ndMin (closestDist, dist2); - break; - } - - const ndShapeCompound::ndNodeBase* const node = stackPool[stack]; - ndAssert(node); - - if (node->m_type == ndShapeCompound::m_leaf) - { - ndShapeInstance* const subShape = node->GetShape(); - if (subShape->GetCollisionMode()) - { - bool processContacts = m_notification->OnCompoundSubShapeOverlap(contactJoint, m_timestep, convexInstance, subShape); - if (processContacts) - { - ndShapeInstance childInstance(*subShape, subShape->GetShape()); - childInstance.m_globalMatrix = childInstance.GetLocalMatrix() * matrix1; - - ndContactSolver contactSolver(*this, m_instance0, childInstance); - contactSolver.m_pruneContacts = 0; - contactSolver.m_maxCount = D_MAX_CONTATCS - contactCount; - contactSolver.m_contactBuffer += contactCount; - - ndInt32 count = contactSolver.ConvexContactsDiscrete(); - ndFloat32 dist = ndMax(contactSolver.m_separationDistance, ndFloat32(0.0f)); - closestDist = ndMin(closestDist, dist * dist); - if (!m_intersectionTestOnly) - { - for (ndInt32 i = 0; i < count; ++i) - { - contacts[contactCount + i].m_shapeInstance0 = subShape; - } - contactCount += count; - if (contactCount > (D_MAX_CONTATCS - 2 * (D_CONSTRAINT_MAX_ROWS / 3))) - { - contactCount = PruneContacts(contactCount, 16); - } - } - } - } - } - else if (stack < (ndInt32(sizeof(stackPool) / sizeof(stackPool[0])) - 2)) - { - ndAssert(node->m_type == ndShapeCompound::m_node); - { - const ndShapeCompound::ndNodeBase* const left = node->m_left; - ndAssert(left); - ndFloat32 subDist2 = data.CalculateDistance2(origin, size, left->m_origin, left->m_size); - ndInt32 j = stack; - for (; j && (subDist2 > stackDistance[j - 1]); --j) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = left; - stackDistance[j] = subDist2; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))); - } - - { - const ndShapeCompound::ndNodeBase* const right = node->m_right; - ndAssert(right); - ndFloat32 subDist2 = data.CalculateDistance2(origin, size, right->m_origin, right->m_size); - ndInt32 j = stack; - for (; j && (subDist2 > stackDistance[j - 1]); --j) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = right; - stackDistance[j] = subDist2; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))); - } - } - } - - if (m_pruneContacts && (contactCount > 1)) - { - contactCount = PruneContacts(contactCount, 16); - } - - ndAssert(closestDist < ndFloat32(1.0e6f)); - m_separationDistance = ndSqrt (closestDist); - return contactCount; -} - -ndInt32 ndContactSolver::CompoundToConvexContactsDiscrete() -{ - ndContact* const contactJoint = m_contact; - ndContactPoint* const contacts = m_contactBuffer; - ndBodyKinematic* const convexBody = contactJoint->GetBody1(); - ndBodyKinematic* const compoundBody = contactJoint->GetBody0(); - ndShapeInstance* const convexInstance = &convexBody->GetCollisionShape(); - ndShapeInstance* const compoundInstance = &compoundBody->GetCollisionShape(); - - ndVector size; - ndVector origin; - convexInstance->CalculateObb(origin, size); - const ndMatrix& matrix0 = compoundInstance->GetGlobalMatrix(); - const ndMatrix& matrix1 = convexInstance->GetGlobalMatrix(); - ndBoxBoxDistance2 data(matrix0, matrix1); - - ndShapeCompound* const compoundShape = m_instance0.GetShape()->GetAsShapeCompound(); - ndAssert(compoundShape); - - ndFloat32 stackDistance[D_SCENE_MAX_STACK_DEPTH]; - const ndShapeCompound::ndNodeBase* stackPool[D_COMPOUND_STACK_DEPTH]; - - ndInt32 stack = 1; - ndInt32 contactCount = 0; - stackPool[0] = compoundShape->m_root; - stackDistance[0] = data.CalculateDistance2(compoundShape->m_root->m_origin, compoundShape->m_root->m_size, origin, size); - ndFloat32 closestDist = (stackDistance[0] > ndFloat32(0.0f)) ? stackDistance[0] : ndFloat32(1.0e10f); - - while (stack) - { - stack--; - - ndFloat32 dist2 = stackDistance[stack]; - if (dist2 > ndFloat32(0.0f)) - { - closestDist = ndMin(closestDist, dist2); - break; - } - const ndShapeCompound::ndNodeBase* const node = stackPool[stack]; - ndAssert(node); - - if (node->m_type == ndShapeCompound::m_leaf) - { - ndShapeInstance* const subShape = node->GetShape(); - if (subShape->GetCollisionMode()) - { - bool processContacts = m_notification->OnCompoundSubShapeOverlap(contactJoint, m_timestep, subShape, convexInstance); - if (processContacts) - { - ndShapeInstance childInstance(*subShape, subShape->GetShape()); - childInstance.m_globalMatrix = childInstance.GetLocalMatrix() * matrix0; - - ndContactSolver contactSolver(*this, childInstance, m_instance1); - contactSolver.m_pruneContacts = 0; - contactSolver.m_maxCount = D_MAX_CONTATCS - contactCount; - contactSolver.m_contactBuffer += contactCount; - - ndInt32 count = contactSolver.ConvexContactsDiscrete(); - ndFloat32 dist = ndMax(contactSolver.m_separationDistance, ndFloat32(0.0f)); - closestDist = ndMin(closestDist, dist * dist); - if (!m_intersectionTestOnly) - { - for (ndInt32 i = 0; i < count; ++i) - { - contacts[contactCount + i].m_shapeInstance0 = subShape; - } - contactCount += count; - if (contactCount > (D_MAX_CONTATCS - 2 * (D_CONSTRAINT_MAX_ROWS / 3))) - { - contactCount = PruneContacts(contactCount, 16); - } - } - } - } - } - else if (stack < (ndInt32(sizeof(stackPool) / sizeof(stackPool[0])) - 2)) - { - ndAssert(node->m_type == ndShapeCompound::m_node); - { - const ndShapeCompound::ndNodeBase* const left = node->m_left; - ndAssert(left); - ndFloat32 subDist2 = data.CalculateDistance2(left->m_origin, left->m_size, origin, size); - ndInt32 j = stack; - for (; j && (subDist2 > stackDistance[j - 1]); --j) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = left; - stackDistance[j] = subDist2; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))); - } - - { - const ndShapeCompound::ndNodeBase* const right = node->m_right; - ndAssert(right); - ndFloat32 subDist2 = data.CalculateDistance2(right->m_origin, right->m_size, origin, size); - ndInt32 j = stack; - for (; j && (subDist2 > stackDistance[j - 1]); --j) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = right; - stackDistance[j] = subDist2; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))); - } - } - } - - if (m_pruneContacts && (contactCount > 1)) - { - contactCount = PruneContacts(contactCount, 16); - } - - ndAssert(closestDist < ndFloat32(1.0e6f)); - m_separationDistance = ndSqrt(closestDist); - return contactCount; -} - -ndInt32 ndContactSolver::CompoundToCompoundContactsDiscrete() -{ - ndContact* const contactJoint = m_contact; - ndContactPoint* const contacts = m_contactBuffer; - ndBodyKinematic* const compoundBody0 = contactJoint->GetBody0(); - ndBodyKinematic* const compoundBody1 = contactJoint->GetBody1(); - ndShapeInstance* const compoundInstance0 = &compoundBody0->GetCollisionShape(); - ndShapeInstance* const compoundInstance1 = &compoundBody1->GetCollisionShape(); - - const ndMatrix& matrix0 = compoundInstance0->GetGlobalMatrix(); - const ndMatrix& matrix1 = compoundInstance1->GetGlobalMatrix(); - ndBoxBoxDistance2 data(matrix0, matrix1); - - ndShapeCompound* const compoundShape0 = m_instance0.GetShape()->GetAsShapeCompound(); - ndShapeCompound* const compoundShape1 = m_instance1.GetShape()->GetAsShapeCompound(); - ndAssert(compoundShape0); - ndAssert(compoundShape1); - - ndInt32 stack = 1; - ndInt32 contactCount = 0; - ndStackEntry stackPool[2 * D_COMPOUND_STACK_DEPTH]; - - stackPool[0].m_node0 = compoundShape0->m_root; - stackPool[0].m_node1 = compoundShape1->m_root; - stackPool[0].m_dist2 = data.CalculateDistance2(compoundShape0->m_root->m_origin, compoundShape0->m_root->m_size, compoundShape1->m_root->m_origin, compoundShape1->m_root->m_size); - - ndFloat32 closestDist = (stackPool[0].m_dist2 > ndFloat32(0.0f)) ? stackPool[0].m_dist2 : ndFloat32(1.0e10f); - - ndStackEntry callback; - while (stack) - { - stack--; - ndFloat32 dist2 = stackPool[stack].m_dist2; - if (dist2 > ndFloat32(0.0f)) - { - closestDist = ndMin(closestDist, dist2); - break; - } - - const ndShapeCompound::ndNodeBase* const node0 = stackPool[stack].m_node0; - const ndShapeCompound::ndNodeBase* const node1 = stackPool[stack].m_node1; - ndAssert(node0 && node1); - - if ((node0->m_type == ndShapeCompound::m_leaf) && (node1->m_type == ndShapeCompound::m_leaf)) - { - ndShapeInstance* const subShape0 = node0->GetShape(); - ndShapeInstance* const subShape1 = node1->GetShape(); - - if (ndInt8(subShape0->GetCollisionMode()) & ndInt8(subShape1->GetCollisionMode())) - { - bool processContacts = m_notification->OnCompoundSubShapeOverlap(contactJoint, m_timestep, subShape0, subShape1); - if (processContacts) - { - ndShapeInstance childInstance0(*subShape0, subShape0->GetShape()); - ndShapeInstance childInstance1(*subShape1, subShape1->GetShape()); - childInstance0.m_globalMatrix = childInstance0.GetLocalMatrix() * matrix0; - childInstance1.m_globalMatrix = childInstance1.GetLocalMatrix() * matrix1; - - ndContactSolver contactSolver(*this, childInstance0, childInstance1); - contactSolver.m_pruneContacts = 0; - contactSolver.m_maxCount = D_MAX_CONTATCS - contactCount; - contactSolver.m_contactBuffer += contactCount; - - ndInt32 count = contactSolver.ConvexContactsDiscrete(); - ndFloat32 dist = ndMax(contactSolver.m_separationDistance, ndFloat32(0.0f)); - closestDist = ndMin(closestDist, dist * dist); - if (!m_intersectionTestOnly) - { - for (ndInt32 i = 0; i < count; ++i) - { - contacts[contactCount + i].m_shapeInstance0 = subShape0; - contacts[contactCount + i].m_shapeInstance1 = subShape1; - } - contactCount += count; - if (contactCount > (D_MAX_CONTATCS - 2 * (D_CONSTRAINT_MAX_ROWS / 3))) - { - contactCount = PruneContacts(contactCount, 16); - } - } - } - } - } - else if (node0->m_type == ndShapeCompound::m_leaf) - { - ndAssert(node1->m_type == ndShapeCompound::m_node); - { - const ndShapeCompound::ndNodeBase* const subNode0 = node0; - const ndShapeCompound::ndNodeBase* const subNode1 = node1->m_left; - callback.PushStackEntry(data, stack, stackPool, subNode0, subNode1); - } - - { - const ndShapeCompound::ndNodeBase* const subNode0 = node0; - const ndShapeCompound::ndNodeBase* const subNode1 = node1->m_right; - callback.PushStackEntry(data, stack, stackPool, subNode0, subNode1); - } - } - else if (node1->m_type == ndShapeCompound::m_leaf) - { - ndAssert(node0->m_type == ndShapeCompound::m_node); - { - const ndShapeCompound::ndNodeBase* const subNode0 = node0->m_left; - const ndShapeCompound::ndNodeBase* const subNode1 = node1; - callback.PushStackEntry(data, stack, stackPool, subNode0, subNode1); - } - - { - const ndShapeCompound::ndNodeBase* const subNode0 = node0->m_right; - const ndShapeCompound::ndNodeBase* const subNode1 = node1; - callback.PushStackEntry(data, stack, stackPool, subNode0, subNode1); - } - } - else - { - ndAssert(node0->m_type == ndShapeCompound::m_node); - ndAssert(node1->m_type == ndShapeCompound::m_node); - { - const ndShapeCompound::ndNodeBase* const subNode0 = node0->m_left; - const ndShapeCompound::ndNodeBase* const subNode1 = node1->m_left; - callback.PushStackEntry(data, stack, stackPool, subNode0, subNode1); - } - - { - const ndShapeCompound::ndNodeBase* const subNode0 = node0->m_left; - const ndShapeCompound::ndNodeBase* const subNode1 = node1->m_right; - callback.PushStackEntry(data, stack, stackPool, subNode0, subNode1); - } - - { - const ndShapeCompound::ndNodeBase* const subNode0 = node0->m_right; - const ndShapeCompound::ndNodeBase* const subNode1 = node1->m_left; - callback.PushStackEntry(data, stack, stackPool, subNode0, subNode1); - } - - { - const ndShapeCompound::ndNodeBase* const subNode0 = node0->m_right; - const ndShapeCompound::ndNodeBase* const subNode1 = node1->m_right; - callback.PushStackEntry(data, stack, stackPool, subNode0, subNode1); - } - } - } - - if (m_pruneContacts && (contactCount > 1)) - { - contactCount = PruneContacts(contactCount, 16); - } - - ndAssert(closestDist < ndFloat32(1.0e6f)); - m_separationDistance = ndSqrt(closestDist); - return contactCount; -} - -ndInt32 ndContactSolver::CompoundToShapeStaticBvhContactsDiscrete() -{ - ndContact* const contactJoint = m_contact; - ndContactPoint* const contacts = m_contactBuffer; - ndBodyKinematic* const compoundBody = contactJoint->GetBody0(); - ndBodyKinematic* const bvhTreeBody = contactJoint->GetBody1(); - ndShapeInstance* const compoundInstance = &compoundBody->GetCollisionShape(); - ndShapeInstance* const bvhTreeInstance = &bvhTreeBody->GetCollisionShape(); - ndShapeStatic_bvh* const bvhTreeCollision = m_instance1.GetShape()->GetAsShapeStaticBVH(); - ndShapeCompound* const compoundShape = m_instance0.GetShape()->GetAsShapeCompound(); - - ndAssert(compoundShape); - ndAssert(bvhTreeCollision); - - const ndMatrix& treeMatrix = bvhTreeInstance->GetGlobalMatrix(); - const ndMatrix& compoundMatrix = compoundInstance->GetGlobalMatrix(); - ndBoxBoxDistance2 data(compoundMatrix, treeMatrix); - - ndVector bvhp0; - ndVector bvhp1; - bvhTreeCollision->GetNodeAabb(bvhTreeCollision->GetRootNode(), bvhp0, bvhp1); - const ndVector bvhSize((bvhp1 - bvhp0) * ndVector::m_half); - const ndVector bvhOrigin((bvhp1 + bvhp0) * ndVector::m_half); - const ndVector treeScale(bvhTreeInstance->GetScale()); - - ndInt32 stack = 1; - ndInt32 contactCount = 0; - ndStackBvhStackEntry stackPool[2 * D_COMPOUND_STACK_DEPTH]; - - stackPool[0].m_treeNodeIsLeaf = 0; - stackPool[0].m_compoundNode = compoundShape->m_root; - stackPool[0].m_collisionTreeNode = bvhTreeCollision->GetRootNode(); - stackPool[0].m_dist2 = data.CalculateDistance2(compoundShape->m_root->m_origin, compoundShape->m_root->m_size, bvhOrigin, bvhSize); - - ndStackBvhStackEntry callback; - ndFloat32 closestDist = (stackPool[0].m_dist2 > ndFloat32(0.0f)) ? stackPool[0].m_dist2 : ndFloat32(1.0e10f); - while (stack) - { - stack--; - - ndFloat32 dist2 = stackPool[stack].m_dist2; - if (dist2 > ndFloat32(0.0f)) - { - closestDist = ndMin(closestDist, dist2); - break; - } - - const ndShapeCompound::ndNodeBase* const compoundNode = stackPool[stack].m_compoundNode; - const ndAabbPolygonSoup::ndNode* const collisionTreeNode = stackPool[stack].m_collisionTreeNode; - const ndInt32 treeNodeIsLeaf = stackPool[stack].m_treeNodeIsLeaf; - - ndAssert(compoundNode && collisionTreeNode); - - if (treeNodeIsLeaf && (compoundNode->m_type == ndShapeCompound::m_leaf)) - { - ndShapeInstance* const subShape = compoundNode->GetShape(); - if (subShape->GetCollisionMode()) - { - bool processContacts = m_notification->OnCompoundSubShapeOverlap(contactJoint, m_timestep, subShape, bvhTreeInstance); - if (processContacts) - { - ndShapeInstance childInstance(*subShape, subShape->GetShape()); - childInstance.m_globalMatrix = childInstance.GetLocalMatrix() * compoundMatrix; - - ndContactSolver contactSolver(*this, childInstance, m_instance1); - contactSolver.m_pruneContacts = 0; - contactSolver.m_maxCount = D_MAX_CONTATCS - contactCount; - contactSolver.m_contactBuffer += contactCount; - - ndInt32 count = contactSolver.ConvexToSaticStaticBvhContactsNodeDescrete(collisionTreeNode); - ndFloat32 dist = ndMax(contactSolver.m_separationDistance, ndFloat32(0.0f)); - closestDist = ndMin(closestDist, dist * dist); - if (!m_intersectionTestOnly) - { - for (ndInt32 i = 0; i < count; ++i) - { - contacts[contactCount + i].m_shapeInstance0 = subShape; - } - contactCount += count; - if (contactCount > (D_MAX_CONTATCS - 2 * (D_CONSTRAINT_MAX_ROWS / 3))) - { - contactCount = PruneContacts(contactCount, 16); - } - } - } - } - } - else if (compoundNode->m_type == ndShapeCompound::m_leaf) - { - ndAssert(!treeNodeIsLeaf); - const ndAabbPolygonSoup::ndNode* const backNode = bvhTreeCollision->GetBackNode(collisionTreeNode); - const ndAabbPolygonSoup::ndNode* const frontNode = bvhTreeCollision->GetFrontNode(collisionTreeNode); - - if (backNode && frontNode) - { - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 0, backNode); - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 0, frontNode); - } - else if (backNode && !frontNode) - { - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 0, backNode); - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 1, collisionTreeNode); - } - else if (!backNode && frontNode) - { - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 0, frontNode); - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 1, collisionTreeNode); - } - else - { - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 1, collisionTreeNode); - } - } - else if (treeNodeIsLeaf) - { - ndAssert(compoundNode->m_type == ndShapeCompound::m_node); - callback.PushStackEntry(data, stack, stackPool, compoundNode->m_left, bvhTreeCollision, 1, collisionTreeNode); - callback.PushStackEntry(data, stack, stackPool, compoundNode->m_right, bvhTreeCollision, 1, collisionTreeNode); - } - else - { - ndAssert(compoundNode->m_type == ndShapeCompound::m_node); - ndAssert(!treeNodeIsLeaf); - - ndVector p0; - ndVector p1; - bvhTreeCollision->GetNodeAabb(collisionTreeNode, p0, p1); - p0 = p0 * treeScale; - p1 = p1 * treeScale; - ndVector size((p1 - p0) * ndVector::m_half); - ndFloat32 area = size.DotProduct(size.ShiftTripleRight()).GetScalar(); - - if (area > compoundNode->m_area) - { - const ndAabbPolygonSoup::ndNode* const backNode = bvhTreeCollision->GetBackNode(collisionTreeNode); - const ndAabbPolygonSoup::ndNode* const frontNode = bvhTreeCollision->GetFrontNode(collisionTreeNode); - if (backNode && frontNode) - { - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 0, backNode); - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 0, frontNode); - } - else if (backNode && !frontNode) - { - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 0, backNode); - callback.PushStackEntry(data, stack, stackPool, compoundNode->m_left, bvhTreeCollision, 1, collisionTreeNode); - callback.PushStackEntry(data, stack, stackPool, compoundNode->m_right, bvhTreeCollision, 1, collisionTreeNode); - } - else if (!backNode && frontNode) - { - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 0, frontNode); - callback.PushStackEntry(data, stack, stackPool, compoundNode->m_left, bvhTreeCollision, 1, collisionTreeNode); - callback.PushStackEntry(data, stack, stackPool, compoundNode->m_right, bvhTreeCollision, 1, collisionTreeNode); - } - else - { - callback.PushStackEntry(data, stack, stackPool, compoundNode, bvhTreeCollision, 1, collisionTreeNode); - } - } - else - { - ndAssert(!treeNodeIsLeaf); - ndAssert(compoundNode->m_left); - ndAssert(compoundNode->m_right); - callback.PushStackEntry(data, stack, stackPool, compoundNode->m_left, bvhTreeCollision, 0, collisionTreeNode); - callback.PushStackEntry(data, stack, stackPool, compoundNode->m_right, bvhTreeCollision, 0, collisionTreeNode); - } - } - } - - if (m_pruneContacts && (contactCount > 1)) - { - contactCount = PruneContacts(contactCount, 16); - } - - ndAssert(closestDist < ndFloat32(1000.0f)); - m_separationDistance = closestDist; - return contactCount; -} - -ndInt32 ndContactSolver::CompoundToStaticHeightfieldContactsDiscrete() -{ - ndContact* const contactJoint = m_contact; - ndContactPoint* const contacts = m_contactBuffer; - ndBodyKinematic* const compoundBody = contactJoint->GetBody0(); - ndBodyKinematic* const heightfieldBody = contactJoint->GetBody1(); - ndShapeInstance* const compoundInstance = &compoundBody->GetCollisionShape(); - ndShapeInstance* const heightfieldInstance = &heightfieldBody->GetCollisionShape(); - ndShapeCompound* const compoundShape = compoundInstance->GetShape()->GetAsShapeCompound(); - - ndShapeCompound::ndNodeBase nodeProxi; - nodeProxi.m_left = nullptr; - nodeProxi.m_right = nullptr; - const ndVector heighFieldScale(heightfieldInstance->GetScale()); - const ndVector heighFieldInvScale(heightfieldInstance->GetInvScale()); - - const ndMatrix& compoundMatrix = compoundInstance->GetGlobalMatrix(); - const ndMatrix& heightfieldMatrix = heightfieldInstance->GetGlobalMatrix(); - ndBoxBoxDistance2 data(compoundMatrix, heightfieldMatrix); - - ndFloat32 stackDistance[D_SCENE_MAX_STACK_DEPTH]; - const ndShapeCompound::ndNodeBase* stackPool[D_COMPOUND_STACK_DEPTH]; - - ndStackEntry callback; - ndInt32 stack = 1; - ndInt32 contactCount = 0; - stackPool[0] = compoundShape->m_root; - stackDistance[0] = callback.CalculateHeighfieldDist2(data, compoundShape->m_root, heightfieldInstance); - ndFloat32 closestDist = (stackDistance[0] > ndFloat32(0.0f)) ? stackDistance[0] : ndFloat32(1.0e10f); - - while (stack) - { - stack--; - - ndFloat32 dist2 = stackDistance[stack]; - if (dist2 > ndFloat32(0.0f)) - { - closestDist = ndMin(closestDist, dist2); - break; - } - - const ndShapeCompound::ndNodeBase* const node = stackPool[stack]; - ndAssert(node); - - if (node->m_type == ndShapeCompound::m_leaf) - { - ndShapeInstance* const subShape = node->GetShape(); - if (subShape->GetCollisionMode()) - { - bool processContacts = m_notification->OnCompoundSubShapeOverlap(contactJoint, m_timestep, subShape, heightfieldInstance); - if (processContacts) - { - ndShapeInstance childInstance(*subShape, subShape->GetShape()); - childInstance.m_globalMatrix = childInstance.GetLocalMatrix() * compoundMatrix; - - ndContactSolver contactSolver(*this, childInstance, m_instance1); - contactSolver.m_pruneContacts = 0; - contactSolver.m_maxCount = D_MAX_CONTATCS - contactCount; - contactSolver.m_contactBuffer += contactCount; - - ndInt32 count = contactSolver.ConvexContactsDiscrete(); - //closestDist = ndMin(closestDist, contactSolver.m_separationDistance); - ndFloat32 dist = ndMax(contactSolver.m_separationDistance, ndFloat32(0.0f)); - closestDist = ndMin(closestDist, dist * dist); - if (!m_intersectionTestOnly) - { - for (ndInt32 i = 0; i < count; ++i) - { - contacts[contactCount + i].m_shapeInstance0 = subShape; - } - contactCount += count; - if (contactCount > (D_MAX_CONTATCS - 2 * (D_CONSTRAINT_MAX_ROWS / 3))) - { - contactCount = PruneContacts(contactCount, 16); - } - } - } - } - } - else if (stack < (ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))- 2)) - { - ndAssert(node->m_type == ndShapeCompound::m_node); - { - const ndShapeCompound::ndNodeBase* const left = node->m_left; - ndAssert(left); - ndFloat32 subDist2 = callback.CalculateHeighfieldDist2(data, left, heightfieldInstance); - ndInt32 j = stack; - for (; j && (subDist2 > stackDistance[j - 1]); --j) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = left; - stackDistance[j] = subDist2; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))); - } - - { - const ndShapeCompound::ndNodeBase* const right = node->m_right; - ndAssert(right); - ndFloat32 subDist2 = callback.CalculateHeighfieldDist2(data, right, heightfieldInstance); - ndInt32 j = stack; - for (; j && (subDist2 > stackDistance[j - 1]); --j) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = right; - stackDistance[j] = subDist2; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))); - } - } - } - - if (m_pruneContacts && (contactCount > 1)) - { - contactCount = PruneContacts(contactCount, 16); - } - ndAssert(closestDist < ndFloat32(1.0e6f)); - m_separationDistance = ndSqrt(closestDist); - return contactCount; -} - -ndInt32 ndContactSolver::CompoundToStaticProceduralMesh() -{ - ndContact* const contactJoint = m_contact; - ndContactPoint* const contacts = m_contactBuffer; - ndBodyKinematic* const compoundBody = contactJoint->GetBody0(); - ndBodyKinematic* const ProceduralBody = contactJoint->GetBody1(); - ndShapeInstance* const compoundInstance = &compoundBody->GetCollisionShape(); - ndShapeInstance* const ProceduralInstance = &ProceduralBody->GetCollisionShape(); - ndShapeCompound* const compoundShape = compoundInstance->GetShape()->GetAsShapeCompound(); - - ndShapeCompound::ndNodeBase nodeProxi; - nodeProxi.m_left = nullptr; - nodeProxi.m_right = nullptr; - const ndVector ProceduralScale(ProceduralInstance->GetScale()); - const ndVector ProceduralInvScale(ProceduralInstance->GetInvScale()); - - const ndMatrix& compoundMatrix = compoundInstance->GetGlobalMatrix(); - const ndMatrix& ProceduralMatrix = ProceduralInstance->GetGlobalMatrix(); - ndBoxBoxDistance2 data(compoundMatrix, ProceduralMatrix); - - ndFloat32 stackDistance[D_SCENE_MAX_STACK_DEPTH]; - const ndShapeCompound::ndNodeBase* stackPool[D_COMPOUND_STACK_DEPTH]; - - ndStackEntry callback; - ndInt32 stack = 1; - ndInt32 contactCount = 0; - stackPool[0] = compoundShape->m_root; - stackDistance[0] = callback.CalculateProceduralDist2(data, compoundShape->m_root, ProceduralInstance); - ndFloat32 closestDist = (stackDistance[0] > ndFloat32(0.0f)) ? stackDistance[0] : ndFloat32(1.0e10f); - - while (stack) - { - stack--; - - ndFloat32 dist2 = stackDistance[stack]; - if (dist2 > ndFloat32(0.0f)) - { - closestDist = ndMin(closestDist, dist2); - break; - } - - const ndShapeCompound::ndNodeBase* const node = stackPool[stack]; - ndAssert(node); - - if (node->m_type == ndShapeCompound::m_leaf) - { - ndShapeInstance* const subShape = node->GetShape(); - if (subShape->GetCollisionMode()) - { - bool processContacts = m_notification->OnCompoundSubShapeOverlap(contactJoint, m_timestep, subShape, ProceduralInstance); - if (processContacts) - { - ndShapeInstance childInstance(*subShape, subShape->GetShape()); - childInstance.m_globalMatrix = childInstance.GetLocalMatrix() * compoundMatrix; - - ndContactSolver contactSolver(*this, childInstance, m_instance1); - contactSolver.m_pruneContacts = 0; - contactSolver.m_maxCount = D_MAX_CONTATCS - contactCount; - contactSolver.m_contactBuffer += contactCount; - - ndInt32 count = contactSolver.ConvexContactsDiscrete(); - ndFloat32 dist = ndMax(contactSolver.m_separationDistance, ndFloat32(0.0f)); - closestDist = ndMin(closestDist, dist * dist); - if (!m_intersectionTestOnly) - { - for (ndInt32 i = 0; i < count; ++i) - { - contacts[contactCount + i].m_shapeInstance0 = subShape; - } - contactCount += count; - if (contactCount > (D_MAX_CONTATCS - 2 * (D_CONSTRAINT_MAX_ROWS / 3))) - { - contactCount = PruneContacts(contactCount, 16); - } - } - } - } - } - else if (stack < (ndInt32(sizeof(stackPool) / sizeof(stackPool[0])) - 2)) - { - ndAssert(node->m_type == ndShapeCompound::m_node); - { - const ndShapeCompound::ndNodeBase* const left = node->m_left; - ndAssert(left); - ndFloat32 subDist2 = callback.CalculateProceduralDist2(data, left, ProceduralInstance); - ndInt32 j = stack; - for (; j && (subDist2 > stackDistance[j - 1]); --j) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = left; - stackDistance[j] = subDist2; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))); - } - - { - const ndShapeCompound::ndNodeBase* const right = node->m_right; - ndAssert(right); - ndFloat32 subDist2 = callback.CalculateProceduralDist2(data, right, ProceduralInstance); - ndInt32 j = stack; - for (; j && (subDist2 > stackDistance[j - 1]); --j) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = right; - stackDistance[j] = subDist2; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))); - } - } - } - - if (m_pruneContacts && (contactCount > 1)) - { - contactCount = PruneContacts(contactCount, 16); - } - ndAssert(closestDist < ndFloat32(1.0e6f)); - m_separationDistance = ndSqrt(closestDist); - return contactCount; -} - -//************************************************************* -// calculate proper separation distance for continue collision. -//************************************************************* -ndInt32 ndContactSolver::CalculateContactsContinue() -{ - ndInt32 count = 0; - if (m_instance0.GetShape()->GetAsShapeCompound() || m_instance1.GetShape()->GetAsShapeCompound()) - { - count = CompoundContactsContinue(); - } - else if (m_instance0.GetShape()->GetAsShapeConvex()) - { - count = ConvexContactsContinue(); - } - else - { - //ndTrace(("!!!!!Fix compound contact\n")); - ndAssert(0); - } - - m_contact->m_timeOfImpact = m_timestep; - m_contact->m_separatingVector = m_separatingVector; - m_contact->m_separationDistance = m_separationDistance; - return count; -} - -ndInt32 ndContactSolver::CompoundContactsContinue() -{ - if (!m_instance1.GetShape()->GetAsShapeCompound()) - { - ndAssert(0); - // ndAssert(m_instance0.GetShape()->GetAsShapeCompound()); - // if (m_instance1.GetShape()->GetAsShapeConvex()) - // { - // return CompoundToConvexContactsDiscrete(); - // } - // else if (m_instance1.GetShape()->GetAsShapeStaticBVH()) - // { - // return CompoundToShapeStaticBvhContactsDiscrete(); - // } - // else if (m_instance1.GetShape()->GetAsShapeHeightfield()) - // { - // return CompoundToStaticHeightfieldContactsDiscrete(); - // } - // else - // { - // ndAssert(0); - // } - } - else if (!m_instance0.GetShape()->GetAsShapeCompound()) - { - ndAssert(m_instance1.GetShape()->GetAsShapeCompound()); - if (m_instance0.GetShape()->GetAsShapeConvex()) - { - return ConvexToCompoundContactsContinue(); - } - else - { - ndAssert(0); - } - } - else - { - ndAssert(0); - // ndAssert(m_instance0.GetShape()->GetAsShapeCompound() && m_instance1.GetShape()->GetAsShapeCompound()); - // return CompoundToCompoundContactsDiscrete(); - } - return 0; -} - -ndInt32 ndContactSolver::ConvexContactsContinue() -{ - const ndVector origin0(m_instance0.m_globalMatrix.m_posit); - const ndVector origin1(m_instance1.m_globalMatrix.m_posit); - m_instance0.m_globalMatrix.m_posit = ndVector::m_wOne; - m_instance1.m_globalMatrix.m_posit -= (origin0 & ndVector::m_triplexMask); - - // handle rare case of two shapes located exactly at the same origin - const ndVector error(m_instance1.m_globalMatrix.m_posit - m_instance0.m_globalMatrix.m_posit); - if (error.DotProduct(error).GetScalar() < ndFloat32(1.0e-6f)) - { - m_instance1.m_globalMatrix.m_posit.m_y += ndFloat32(1.0e-3f); - } - - ndInt32 count = 0; - if (m_instance1.GetShape()->GetAsShapeConvex()) - { - ndAssert(m_instance0.GetShape()->GetAsShapeConvex()); - count = ConvexToConvexContactsContinue(); - } - else - { - ndShapeStaticMesh* const meshShape = m_instance1.GetShape()->GetAsShapeStaticMesh(); - if (meshShape) - { - count = ConvexToStaticMeshContactsContinue(); - } - else - { - ndAssert(0); - count = 0; - } - } - - if (m_pruneContacts && (count > 1)) - { - count = PruneContacts(count, 16); - } - - const ndVector offset(origin0 & ndVector::m_triplexMask); - m_closestPoint0 += offset; - m_closestPoint1 += offset; - - if (!m_intersectionTestOnly) - { - ndContactPoint* const contactOut = m_contactBuffer; - for (ndInt32 i = count - 1; i >= 0; i--) - { - contactOut[i].m_point += offset; - } - } - - m_instance0.m_globalMatrix.m_posit = origin0; - m_instance1.m_globalMatrix.m_posit = origin1; - return count; -} - -ndInt32 ndContactSolver::ConvexToConvexContactsContinue() -{ - ndAssert(m_instance0.GetConvexVertexCount() && m_instance1.GetConvexVertexCount()); - ndAssert(m_instance0.GetShape()->GetAsShapeConvex()); - ndAssert(m_instance1.GetShape()->GetAsShapeConvex()); - ndAssert(!m_instance0.GetShape()->GetAsShapeNull()); - ndAssert(!m_instance1.GetShape()->GetAsShapeNull()); - - const ndVector savedPosition1(m_instance1.m_globalMatrix.m_posit); - const ndBodyKinematic* const body0 = m_contact->m_body0; - const ndBodyKinematic* const body1 = m_contact->m_body1; - const ndVector relVeloc(body0->GetVelocity() - body1->GetVelocity()); - ndVector closestPoint1; - - ndInt32 iter = 0; - ndInt32 count = 0; - ndFloat32 tacc = ndFloat32(0.0f); - ndFloat32 timestep = m_timestep; - do - { - bool state = CalculateClosestPoints(); - if (!state) - { - break; - } - ndAssert(m_separatingVector.m_w == ndFloat32(0.0f)); - ndFloat32 den = m_separatingVector.DotProduct(relVeloc).GetScalar(); - if (den <= ndFloat32(1.0e-6f)) - { - // bodies are residing from each other, even if they are touching - // they are not considered to be colliding because the motion will - // move them apart get the closet point and the normal at contact point - m_timestep = ndFloat32(1.0e10f); - m_separatingVector = m_separatingVector * ndVector::m_negOne; - break; - } - - ndFloat32 num = m_separatingVector.DotProduct(m_closestPoint1 - m_closestPoint0).GetScalar() - m_skinMargin; - if ((num <= ndFloat32(1.0e-5f)) && (tacc <= timestep)) - { - // bodies collide at time tacc, but we do not set it yet - ndVector step(relVeloc.Scale(tacc)); - m_timestep = tacc; - closestPoint1 = m_closestPoint1 + step; - m_separatingVector = m_separatingVector * ndVector::m_negOne; - ndFloat32 penetration = ndMax(num * ndFloat32(-1.0f) + D_PENETRATION_TOL, ndFloat32(0.0f)); - if (m_contactBuffer && !m_intersectionTestOnly) - { - if (ndInt8(m_instance0.GetCollisionMode()) & ndInt8(m_instance1.GetCollisionMode())) - { - count = CalculateContacts(m_closestPoint0, m_closestPoint1, m_separatingVector); - if (count) - { - count = ndMin(m_maxCount, count); - ndContactPoint* const contactOut = m_contactBuffer; - - for (int i = 0; i < count; ++i) - { - contactOut[i].m_point = m_hullDiff[i] + step; - contactOut[i].m_normal = m_separatingVector; - contactOut[i].m_penetration = penetration; - } - } - } - } - break; - } - - ndAssert(den > ndFloat32(0.0f)); - ndFloat32 dt = num / den; - if ((tacc + dt) >= timestep) - { - // object do not collide on this timestep - m_timestep = tacc + dt; - closestPoint1 = m_closestPoint1; - m_separatingVector = m_separatingVector * ndVector::m_negOne; - break; - } - - tacc += dt; - ndVector step(relVeloc.Scale(dt)); - TranslateSimplex(step); - - iter++; - } while (iter < D_SEPARATION_PLANES_ITERATIONS); - - m_closestPoint1 = closestPoint1; - m_instance1.m_globalMatrix.m_posit = savedPosition1; - m_separationDistance = m_separatingVector.DotProduct(m_closestPoint0 - m_closestPoint1).GetScalar(); - return count; -} - -ndInt32 ndContactSolver::ConvexToCompoundContactsContinue() -{ - ndContact* const contactJoint = m_contact; - ndContactPoint* const contacts = m_contactBuffer; - ndBodyKinematic* const convexBody = contactJoint->GetBody0(); - ndBodyKinematic* const compoundBody = contactJoint->GetBody1(); - ndShapeInstance* const convexInstance = &convexBody->GetCollisionShape(); - ndShapeInstance* const compoundInstance = &compoundBody->GetCollisionShape(); - - const ndMatrix& compoundMatrix = compoundInstance->GetGlobalMatrix(); - const ndMatrix matrix(convexInstance->GetGlobalMatrix() * compoundMatrix.OrthoInverse()); - - ndShapeCompound* const compoundShape = m_instance1.GetShape()->GetAsShapeCompound(); - ndAssert(compoundShape); - - ndVector boxP0; - ndVector boxP1; - convexInstance->CalculateAabb(matrix, boxP0, boxP1); - const ndVector relVeloc(matrix.UnrotateVector(convexBody->GetVelocity() - compoundBody->GetVelocity())); - ndFastRay ray(ndVector::m_zero, relVeloc); - - const ndVector rootMinBox(compoundShape->m_root->m_p0 - boxP1); - const ndVector rootMaxBox(compoundShape->m_root->m_p1 - boxP0); - - ndVector closestPoint0(ndVector::m_zero); - ndVector closestPoint1(ndVector::m_zero); - ndVector separatingVector(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - - ndFloat32 impactTime[D_SCENE_MAX_STACK_DEPTH]; - const ndShapeCompound::ndNodeBase* stackPool[D_COMPOUND_STACK_DEPTH]; - - ndInt32 stack = 1; - ndInt32 contactCount = 0; - ndFloat32 minTimeStep = m_timestep; - - stackPool[0] = compoundShape->m_root; - impactTime[0] = ray.BoxIntersect(rootMinBox, rootMaxBox); - while (stack) - { - stack--; - ndFloat32 dist = impactTime[stack]; - if (dist > ndFloat32 (1.0f)) - { - break; - } - - ndAssert(stackPool[stack]); - const ndShapeCompound::ndNodeBase* const node = stackPool[stack]; - if (node->m_type == ndShapeCompound::m_leaf) - { - ndShapeInstance* const subShape = node->GetShape(); - if (subShape->GetCollisionMode()) - { - bool processContacts = m_notification->OnCompoundSubShapeOverlap(contactJoint, m_timestep, convexInstance, subShape); - if (processContacts) - { - ndShapeInstance childInstance(*subShape, subShape->GetShape()); - childInstance.m_globalMatrix = childInstance.GetLocalMatrix() * compoundMatrix; - - ndContactSolver contactSolver(*this, m_instance0, childInstance); - contactSolver.m_pruneContacts = 0; - contactSolver.m_timestep = minTimeStep; - contactSolver.m_maxCount = D_MAX_CONTATCS - contactCount; - contactSolver.m_contactBuffer += contactCount; - - ndInt32 count = contactSolver.ConvexContactsContinue(); - if (!m_intersectionTestOnly) - { - for (ndInt32 i = 0; i < count; ++i) - { - contacts[contactCount + i].m_shapeInstance1 = subShape; - } - - ndFloat32 error = contactSolver.m_timestep - minTimeStep; - if (error < ndFloat32(-1.0e-3f)) - { - if (contactCount) - { - for (ndInt32 i = 0; i < count; ++i) - { - contacts[i] = contacts[contactCount + i]; - } - contactCount = 0; - } - } - - if (contactSolver.m_timestep < minTimeStep) - { - minTimeStep = contactSolver.m_timestep; - closestPoint0 = contactSolver.m_closestPoint0; - closestPoint1 = contactSolver.m_closestPoint1; - separatingVector = contactSolver.m_separatingVector; - } - - contactCount += count; - if (contactCount > (D_MAX_CONTATCS - 2 * (D_CONSTRAINT_MAX_ROWS / 3))) - { - contactCount = PruneContacts(contactCount, 16); - } - } - } - } - } - else if (stack < (ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))- 2)) - { - ndAssert(node->m_type == ndShapeCompound::m_node); - { - const ndShapeCompound::ndNodeBase* const left = node->m_left; - ndAssert(left); - const ndVector minBox(left->m_p0 - boxP1); - const ndVector maxBox(left->m_p1 - boxP0); - ndFloat32 dist1 = ray.BoxIntersect(minBox, maxBox); - if (dist1 <= ndFloat32 (1.0f)) - { - ndInt32 j = stack; - for (; j && (dist1 > impactTime[j - 1]); --j) - { - stackPool[j] = stackPool[j - 1]; - impactTime[j] = impactTime[j - 1]; - } - stackPool[j] = left; - impactTime[j] = dist1; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))); - } - } - - { - const ndShapeCompound::ndNodeBase* const right = node->m_right; - ndAssert(right); - const ndVector minBox(right->m_p0 - boxP1); - const ndVector maxBox = right->m_p1 - boxP0; - ndFloat32 dist1 = ray.BoxIntersect(minBox, maxBox); - if (dist1 <= ndFloat32(1.0f)) - { - ndInt32 j = stack; - for (; j && (dist1 > impactTime[j - 1]); --j) - { - stackPool[j] = stackPool[j - 1]; - impactTime[j] = impactTime[j - 1]; - } - stackPool[j] = right; - impactTime[j] = dist1; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(stackPool[0]))); - } - } - } - } - - if (m_pruneContacts && (contactCount > 1)) - { - contactCount = PruneContacts(contactCount, 16); - } - - if (minTimeStep < m_timestep) - { - m_timestep = minTimeStep; - m_closestPoint0 = closestPoint0; - m_closestPoint1 = closestPoint1; - m_separatingVector = separatingVector; - m_separationDistance = m_separatingVector.DotProduct(m_closestPoint0 - m_closestPoint1).GetScalar(); - } - else - { - m_separationDistance = ndSqrt(relVeloc.DotProduct(relVeloc).GetScalar()) * minTimeStep; - } - return contactCount; -} - -ndInt32 ndContactSolver::CalculatePolySoupToHullContactsContinue(ndPolygonMeshDesc& data) -{ - ndShapeConvexPolygon polygon; - ndShapeInstance polySoupInstance(m_instance1); - - ndAssert(data.m_staticMeshQuery->m_faceIndexCount.GetCount()); - m_instance1.m_shape->Release(); - m_instance1.m_shape = polygon.AddRef(); - m_instance1.SetScale(ndVector::m_one); - m_instance1.m_localMatrix = ndGetIdentityMatrix(); - m_instance1.m_globalMatrix = ndGetIdentityMatrix(); - - polygon.m_vertex = data.m_vertex; - polygon.m_stride = ndInt32(data.m_vertexStrideInBytes / sizeof(ndFloat32)); - - ndInt32 count = 0; - ndInt32 maxContacts = m_maxCount; - ndInt32 countleft = maxContacts; - ndInt32 maxReduceLimit = maxContacts - 16; - - const ndVector& polygonInstanceScale = polySoupInstance.GetScale(); - const ndMatrix& polySoupGlobalMatrix = polySoupInstance.GetGlobalMatrix(); - const ndMatrix& polySoupGlobalAligmentMatrix = polySoupInstance.GetAlignmentMatrix(); - - ndMatrix polySoupScaledMatrix( - polySoupGlobalAligmentMatrix[0] * polygonInstanceScale, - polySoupGlobalAligmentMatrix[1] * polygonInstanceScale, - polySoupGlobalAligmentMatrix[2] * polygonInstanceScale, - polySoupGlobalAligmentMatrix[3]); - polySoupScaledMatrix = polySoupScaledMatrix * polySoupGlobalMatrix; - - const ndInt32 stride = polygon.m_stride; - const ndFloat32* const vertex = polygon.m_vertex; - ndAssert(m_instance1.m_scaleType == ndShapeInstance::m_unit); - - ndContactPoint* const contactOut = m_contactBuffer; - - ndPolygonMeshDesc::ndStaticMeshFaceQuery& query = *data.m_staticMeshQuery; - ndInt32* const indexArray = (ndInt32*)&query.m_faceVertexIndex[0]; - data.SortFaceArray(); - - ndVector separatingVector(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector closestPoint0(ndVector::m_zero); - ndVector closestPoint1(ndVector::m_zero); - ndFloat32 minTimeStep = m_timestep; - ndFloat32 savedTimestep = m_timestep; - ndFloat32 epsilon = ndFloat32(-1.0e-3f) * m_timestep; - - for (ndInt32 i = 0; (i < query.m_faceIndexCount.GetCount()) && (m_timestep >= (query.m_hitDistance[i] * savedTimestep)); ++i) - { - ndInt32 address = query.m_faceIndexStart[i]; - const ndInt32* const localIndexArray = &indexArray[address]; - polygon.m_vertexIndex = localIndexArray; - polygon.m_count = query.m_faceIndexCount[i]; - polygon.m_paddedCount = polygon.m_count; - polygon.m_adjacentFaceEdgeNormalIndex = data.GetAdjacentFaceEdgeNormalArray(localIndexArray, polygon.m_count); - polygon.m_faceId = data.GetFaceId(localIndexArray, polygon.m_count); - polygon.m_faceClipSize = data.GetFaceSize(localIndexArray, polygon.m_count); - polygon.m_faceNormalIndex = data.GetNormalIndex(localIndexArray, polygon.m_count); - polygon.m_normal = polygon.CalculateGlobalNormal(&polySoupInstance, ndVector(&vertex[polygon.m_faceNormalIndex * stride]) & ndVector::m_triplexMask); - ndAssert(polygon.m_normal.m_w == ndFloat32(0.0f)); - for (ndInt32 j = 0; j < polygon.m_count; ++j) - { - polygon.m_localPoly[j] = polySoupScaledMatrix.TransformVector(ndVector(&vertex[localIndexArray[j] * stride]) & ndVector::m_triplexMask); - } - - m_vertexIndex = 0; - m_maxCount = countleft; - m_contactBuffer = &contactOut[count]; - ndInt32 count1 = polygon.CalculateContactToConvexHullContinue(&polySoupInstance, *this); - - if (count1 > 0) - { - ndFloat32 error = m_timestep - minTimeStep; - if (error < epsilon) - { - count = 0; - countleft = maxContacts; - for (ndInt32 j = 0; j < count1; ++j) - { - contactOut[j] = m_contactBuffer[j]; - } - } - count += count1; - countleft -= count1; - ndAssert(countleft >= 0); - if (count >= maxReduceLimit) - { - m_contactBuffer = contactOut; - count = PruneContacts(count, 16); - countleft = maxContacts - count; - ndAssert(countleft >= 0); - } - } - - if (m_timestep < minTimeStep) - { - minTimeStep = m_timestep; - closestPoint0 = m_closestPoint0; - closestPoint1 = m_closestPoint1; - separatingVector = m_separatingVector; - } - } - - m_contactBuffer = contactOut; - m_instance1 = polySoupInstance; - if (minTimeStep < savedTimestep) - { - m_timestep = minTimeStep; - m_closestPoint0 = closestPoint0; - m_closestPoint1 = closestPoint1; - m_separatingVector = separatingVector; - m_separationDistance = m_separatingVector.DotProduct(m_closestPoint0 - m_closestPoint1).GetScalar(); - } - - return count; -} - -ndInt32 ndContactSolver::ConvexToStaticMeshContactsContinue() -{ - ndAssert(m_instance0.GetConvexVertexCount()); - ndAssert(!m_instance0.GetShape()->GetAsShapeNull()); - ndAssert(m_instance0.GetShape()->GetAsShapeConvex()); - ndAssert(m_instance1.GetShape()->GetAsShapeStaticMesh()); - - ndInt32 count = 0; - //ndPolygonMeshLocalDesc data(*this, true); - ndPolygonMeshDesc data(*this, true); - - ndVector relVeloc(m_contact->m_body0->GetVelocity() - m_contact->m_body1->GetVelocity()); - ndFloat32 baseLinearSpeed = ndSqrt(relVeloc.DotProduct(relVeloc).GetScalar()); - if (baseLinearSpeed > ndFloat32(1.0e-6f)) - { - //const ndFloat32 minRadius = m_instance0.GetBoxMinRadius(); - //const ndFloat32 maxRadius = m_instance0.GetBoxMaxRadius(); - //ndFloat32 maxAngularSpeed = ndSqrt(hullOmega.DotProduct(hullOmega).GetScalar()); - //ndFloat32 maxAngularSpeed = ndFloat32 (0.0f); - //ndFloat32 angularSpeedBound = maxAngularSpeed * (maxRadius - minRadius); - //ndFloat32 upperBoundSpeed = baseLinearSpeed + dgSqrt(angularSpeedBound); - ndFloat32 upperBoundSpeed = baseLinearSpeed; - ndVector upperBoundVeloc(relVeloc.Scale(m_timestep * upperBoundSpeed / baseLinearSpeed)); - data.SetDistanceTravel(upperBoundVeloc); - } - - ndShapeStaticMesh* const polysoup = m_instance1.GetShape()->GetAsShapeStaticMesh(); - polysoup->GetCollidingFaces(&data); - - //if (data.m_faceCount) - if (data.m_staticMeshQuery->m_faceIndexCount.GetCount()) - { - m_separationDistance = ndSqrt(relVeloc.DotProduct(relVeloc).GetScalar()) * m_timestep; - count = CalculatePolySoupToHullContactsContinue(data); - } - - ndBodyKinematic* const body0 = m_contact->GetBody0(); - ndBodyKinematic* const body1 = m_contact->GetBody1(); - ndShapeInstance* const instance0 = &body0->GetCollisionShape(); - ndShapeInstance* const instance1 = &body1->GetCollisionShape(); - - if (!m_intersectionTestOnly) - { - ndContactPoint* const contactOut = m_contactBuffer; - for (ndInt32 i = count - 1; i >= 0; i--) - { - contactOut[i].m_body0 = body0; - contactOut[i].m_body1 = body1; - contactOut[i].m_shapeInstance0 = instance0; - contactOut[i].m_shapeInstance1 = instance1; - } - } - - return count; -} - -void ndContactSolver::CalculateContacts( - const ndShapeInstance* const instanceA, const ndMatrix& matrixA, const ndVector& velocA, - const ndShapeInstance* const instanceB, const ndMatrix& matrixB, const ndVector& velocB, - ndFixSizeArray& contactOut, ndContactNotify* const notification) -{ - ndContact contact; - ndBodyKinematic bodyA; - ndBodyKinematic bodyB; - ndContactPoint contactBuffer[D_MAX_CONTATCS]; - - ndShape* const shapeA = (ndShape*)(instanceA->GetShape()); - ndShape* const shapeB = (ndShape*)(instanceB->GetShape()); - - m_instance0.SetShape(shapeA); - m_instance0.SetLocalMatrix(instanceA->GetLocalMatrix()); - //Setting the global matrix before setting the collision shape of the body - m_instance0.SetGlobalMatrix(m_instance0.GetLocalMatrix() * matrixA); - - m_instance1.SetShape(shapeB); - m_instance1.SetLocalMatrix(instanceB->GetLocalMatrix()); - // Setting the global matrix before setting the collision shape of the body - m_instance1.SetGlobalMatrix(m_instance1.GetLocalMatrix() * matrixB); - - bodyA.SetCollisionShape(m_instance0); - bodyB.SetCollisionShape(m_instance1); - - bodyA.SetMatrix(matrixA); - bodyB.SetMatrix(matrixB); - bodyA.SetVelocity(velocA); - bodyB.SetVelocity(velocB); - - if (!shapeA->GetAsShapeStaticMesh()) - { - bodyA.SetMassMatrix(ndFloat32(1.0f), ndFloat32(1.0f), ndFloat32(1.0f), ndFloat32(1.0f)); - } - if (!shapeB->GetAsShapeStaticMesh()) - { - bodyB.SetMassMatrix(ndFloat32(1.0f), ndFloat32(1.0f), ndFloat32(1.0f), ndFloat32(1.0f)); - } - contact.SetBodies(&bodyA, &bodyB); - - m_closestPoint0 = ndVector::m_zero; - m_closestPoint1 = ndVector::m_zero; - m_separatingVector = ndVector(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - m_contact = &contact; - m_freeFace = nullptr; - m_notification = notification; - m_contactBuffer = contactBuffer; - m_timestep = ndFloat32(1.0f); - m_skinMargin = ndFloat32(0.0f); - m_separationDistance = ndFloat32(1.0e10f); - m_maxCount = D_MAX_CONTATCS; - m_vertexIndex = 0; - m_pruneContacts = 1; - m_intersectionTestOnly = 0; - - const ndInt32 count = ndMin(CalculateContactsDiscrete(), contactOut.GetCapacity()); - for (ndInt32 i = 0; i < count; ++i) - { - ndContactPoint& contactPoint = contactBuffer[i]; - contactPoint.m_body0 = nullptr; - contactPoint.m_body1 = nullptr; - contactPoint.m_shapeInstance0 = instanceA; - contactPoint.m_shapeInstance1 = instanceB; - contactOut.PushBack(contactPoint); - } -} - -ndInt32 ndContactSolver::CalculatePolySoupToHullContactsDescrete(ndPolygonMeshDesc& data) -{ - ndShapeConvexPolygon polygon; - ndShapeInstance polySoupInstance(m_instance1); - ndPolygonMeshDesc::ndStaticMeshFaceQuery& query = *data.m_staticMeshQuery; - - ndAssert(query.m_faceIndexCount.GetCount()); - m_instance1.m_shape = &polygon; - m_instance1.SetScale(ndVector::m_one); - m_instance1.m_localMatrix = ndGetIdentityMatrix(); - m_instance1.m_globalMatrix = ndGetIdentityMatrix(); - - polygon.m_vertex = data.m_vertex; - polygon.m_stride = ndInt32(data.m_vertexStrideInBytes / sizeof(ndFloat32)); - - ndInt32 count = 0; - ndInt32 maxContacts = m_maxCount; - ndInt32 countleft = maxContacts; - ndInt32 maxReduceLimit = maxContacts - 16; - - const ndVector& polygonInstanceScale = polySoupInstance.GetScale(); - const ndMatrix& polySoupGlobalMatrix = polySoupInstance.GetGlobalMatrix(); - const ndMatrix& polySoupGlobalAligmentMatrix = polySoupInstance.GetAlignmentMatrix(); - - ndMatrix polySoupScaledMatrix( - polySoupGlobalAligmentMatrix[0] * polygonInstanceScale, - polySoupGlobalAligmentMatrix[1] * polygonInstanceScale, - polySoupGlobalAligmentMatrix[2] * polygonInstanceScale, - polySoupGlobalAligmentMatrix[3]); - polySoupScaledMatrix = polySoupScaledMatrix * polySoupGlobalMatrix; - - ndAssert(m_contact); - ndVector separatingVector(m_instance0.m_globalMatrix.m_up); - - const ndInt32 stride = polygon.m_stride; - const ndFloat32* const vertex = polygon.m_vertex; - ndAssert(m_instance1.m_scaleType == ndShapeInstance::m_unit); - ndFloat32 closestDist = ndFloat32(1.0e10f); - ndContactPoint* const contactOut = m_contactBuffer; - ndContact* const contactJoint = m_contact; - const ndInt32* const indexArray = &query.m_faceVertexIndex[0]; - - data.SortFaceArray(); - for (ndInt32 i = ndInt32(query.m_faceIndexCount.GetCount()) - 1; (i >= 0) && (count < 32); --i) - { - ndInt32 address = query.m_faceIndexStart[i]; - const ndInt32* const localIndexArray = &indexArray[address]; - polygon.m_vertexIndex = localIndexArray; - polygon.m_count = query.m_faceIndexCount[i]; - polygon.m_paddedCount = polygon.m_count; - polygon.m_adjacentFaceEdgeNormalIndex = data.GetAdjacentFaceEdgeNormalArray(localIndexArray, polygon.m_count); - polygon.m_faceId = data.GetFaceId(localIndexArray, polygon.m_count); - polygon.m_faceClipSize = data.GetFaceSize(localIndexArray, polygon.m_count); - polygon.m_faceNormalIndex = data.GetNormalIndex(localIndexArray, polygon.m_count); - polygon.m_normal = polygon.CalculateGlobalNormal(&polySoupInstance, ndVector(&vertex[polygon.m_faceNormalIndex * stride]) & ndVector::m_triplexMask); - ndAssert(polygon.m_normal.m_w == ndFloat32(0.0f)); - for (ndInt32 j = 0; j < polygon.m_count; ++j) - { - polygon.m_localPoly[j] = polySoupScaledMatrix.TransformVector(ndVector(&vertex[localIndexArray[j] * stride]) & ndVector::m_triplexMask); - } - - contactJoint->m_separatingVector = separatingVector; - m_maxCount = countleft; - m_vertexIndex = 0; - m_contactBuffer = &contactOut[count]; - - ndInt32 count1 = polygon.CalculateContactToConvexHullDescrete(&polySoupInstance, *this); - closestDist = ndMin(closestDist, m_separationDistance); - - if (count1 > 0) - { - if (!m_intersectionTestOnly) - { - count += count1; - countleft -= count1; - ndAssert(countleft >= 0); - if (count >= maxReduceLimit) - { - ndAssert(0); - //count = PruneContacts(count, contactOut, ndFloat32(1.0e-2f), 16); - //countleft = maxContacts - count; - //ndAssert(countleft >= 0); - //proxy.m_maxContacts = countleft; - } - } - else - { - count = 1; - break; - } - } - } - - m_contactBuffer = contactOut; - ndAssert(!count || (closestDist < ndFloat32(1000.0f))); - m_separationDistance = closestDist; - m_instance1.m_shape = polySoupInstance.m_shape; - m_instance1 = polySoupInstance; - - return count; -} - -ndInt32 ndContactSolver::ConvexToStaticMeshContactsDiscrete() -{ - D_TRACKTIME(); - ndAssert(m_instance0.GetConvexVertexCount()); - ndAssert(!m_instance0.GetShape()->GetAsShapeNull()); - ndAssert(m_instance0.GetShape()->GetAsShapeConvex()); - ndAssert(m_instance1.GetShape()->GetAsShapeStaticMesh()); - - ndInt32 count = 0; - ndPolygonMeshDesc data(*this, false); - ndShapeStaticMesh* const polysoup = m_instance1.GetShape()->GetAsShapeStaticMesh(); - ndAssert(polysoup); - polysoup->GetCollidingFaces(&data); - if (data.m_staticMeshQuery->m_faceIndexCount.GetCount()) - { - count = CalculatePolySoupToHullContactsDescrete(data); - } - - ndBodyKinematic* const body0 = m_contact->GetBody0(); - ndBodyKinematic* const body1 = m_contact->GetBody1(); - ndShapeInstance* const instance0 = &body0->GetCollisionShape(); - ndShapeInstance* const instance1 = &body1->GetCollisionShape(); - - if (!m_intersectionTestOnly) - { - ndContactPoint* const contactOut = m_contactBuffer; - for (ndInt32 i = count - 1; i >= 0; i--) - { - contactOut[i].m_body0 = body0; - contactOut[i].m_body1 = body1; - contactOut[i].m_shapeInstance0 = instance0; - contactOut[i].m_shapeInstance1 = instance1; - } - } - - ndAssert(!count || (m_separationDistance < ndFloat32(1.0e6f))); - return count; -} - -ndInt32 ndContactSolver::ConvexToSaticStaticBvhContactsNodeDescrete(const ndAabbPolygonSoup::ndNode* const node) -{ - ndVector origin0(m_instance0.m_globalMatrix.m_posit); - ndVector origin1(m_instance1.m_globalMatrix.m_posit); - m_instance0.m_globalMatrix.m_posit = ndVector::m_wOne; - m_instance1.m_globalMatrix.m_posit -= (origin0 & ndVector::m_triplexMask); - - ndAssert(m_instance1.GetShape()->GetAsShapeStaticBVH()); - - ndShapeStatic_bvh* const polysoup = m_instance1.GetShape()->GetAsShapeStaticBVH(); - ndAssert(polysoup); - ndPolygonMeshDesc data(*this, false); - data.m_vertex = polysoup->GetLocalVertexPool(); - data.m_vertexStrideInBytes = polysoup->GetStrideInBytes(); - polysoup->ForThisSector(node, data, data.m_boxDistanceTravelInMeshSpace, data.m_maxT, polysoup->GetPolygon, &data); - - ndInt32 count = 0; - if (data.m_staticMeshQuery->m_faceIndexCount.GetCount()) - { - count = CalculatePolySoupToHullContactsDescrete(data); - } - - ndBodyKinematic* const body0 = m_contact->GetBody0(); - ndBodyKinematic* const body1 = m_contact->GetBody1(); - ndShapeInstance* const instance0 = &body0->GetCollisionShape(); - ndShapeInstance* const instance1 = &body1->GetCollisionShape(); - - //if (!m_intersectionTestOnly) - //{ - // ndContactPoint* const contactOut = m_contactBuffer; - // for (dInt32 i = count - 1; i >= 0; i--) - // { - // contactOut[i].m_body0 = body0; - // contactOut[i].m_body1 = body1; - // contactOut[i].m_shapeInstance0 = instance0; - // contactOut[i].m_shapeInstance1 = instance1; - // } - //} - - ndVector offset = (origin0 & ndVector::m_triplexMask); - m_closestPoint0 += offset; - m_closestPoint1 += offset; - - if (!m_intersectionTestOnly) - { - ndContactPoint* const contactOut = m_contactBuffer; - for (ndInt32 i = count - 1; i >= 0; i--) - { - contactOut[i].m_point += offset; - contactOut[i].m_body0 = body0; - contactOut[i].m_body1 = body1; - contactOut[i].m_shapeInstance0 = instance0; - contactOut[i].m_shapeInstance1 = instance1; - } - } - - m_instance0.m_globalMatrix.m_posit = origin0; - m_instance1.m_globalMatrix.m_posit = origin1; - return count; -} - -ndInt32 ndContactSolver::CalculateContacts(const ndVector& point0, const ndVector& point1, const ndVector& normal) -{ - ndAssert(m_instance0.GetShape()->GetAsShapeConvex()); - ndAssert(m_instance1.GetShape()->GetAsShapeConvex()); - - ndInt32 count = 0; - ndInt32 count1 = 0; - const ndInt32 baseCount = 16; - ndVector* const contactsOut = &m_buffer[0]; - ndVector* const shape1 = &contactsOut[baseCount]; - ndAssert(normal.m_w == ndFloat32(0.0f)); - - ndVector origin(m_instance1.GetShape()->GetAsShapeAsConvexPolygon() ? point1 : (point0 + point1).Scale(ndFloat32(0.5f))); - const ndMatrix& matrix1 = m_instance1.m_globalMatrix; - ndVector pointOnInstance1(matrix1.UntransformVector(origin)); - ndVector normalOnInstance1(matrix1.UnrotateVector(normal)); - ndFloat32 dist = (normal.DotProduct(point0 - point1)).GetScalar(); - - if (dist < (D_PENETRATION_TOL * ndFloat32(-0.5f))) - { - count1 = m_instance1.CalculatePlaneIntersection(normalOnInstance1, pointOnInstance1, shape1); - } - if (!count1) - { - ndVector step(normal.Scale(D_PENETRATION_TOL * ndFloat32(2.0f))); - ndVector alternatePoint(point1); - for (ndInt32 i = 0; (i < 3) && !count1; ++i) - { - alternatePoint -= step; - ndVector alternatePointOnInstance1(matrix1.UntransformVector(alternatePoint)); - count1 = m_instance1.CalculatePlaneIntersection(normalOnInstance1, alternatePointOnInstance1, shape1); - } - step = matrix1.UnrotateVector(normal * ((alternatePoint - origin).DotProduct(normal))); - for (ndInt32 i = 0; i < count1; ++i) - { - shape1[i] -= step; - } - } - - if (count1) - { - for (ndInt32 i = 0; i < count1; ++i) - { - shape1[i] = matrix1.TransformVector(shape1[i]); - } - - ndInt32 count0 = 0; - ndVector* const shape0 = &contactsOut[baseCount + count1]; - - const ndMatrix& matrix0 = m_instance0.m_globalMatrix; - ndVector pointOnInstance0(matrix0.UntransformVector(origin)); - ndVector normalOnInstance0(matrix0.UnrotateVector(normal.Scale(ndFloat32(-1.0f)))); - - if (dist < (D_PENETRATION_TOL * ndFloat32(-0.5f))) - { - count0 = m_instance0.CalculatePlaneIntersection(normalOnInstance0, pointOnInstance0, shape0); - } - if (!count0) - { - ndVector step(normal.Scale(D_PENETRATION_TOL * ndFloat32(2.0f))); - ndVector alternatePoint(point0); - for (ndInt32 i = 0; (i < 3) && !count0; ++i) - { - alternatePoint += step; - ndVector alternatePointOnInstance0(matrix0.UntransformVector(alternatePoint)); - count0 = m_instance0.CalculatePlaneIntersection(normalOnInstance0, alternatePointOnInstance0, shape0); - } - //ndTrace (("If this is a frequent event, this routine should return the translation distance as the contact point\n")) - //ndAssert(count0); - step = matrix0.UnrotateVector(normal * ((alternatePoint - origin).DotProduct(normal))); - for (ndInt32 i = 0; i < count0; ++i) - { - shape0[i] -= step; - } - } - - if (count0) - { - for (ndInt32 i = 0; i < count0; ++i) - { - shape0[i] = matrix0.TransformVector(shape0[i]); - } - - if (count0 == 1) - { - count = 1; - contactsOut[0] = shape0[0]; - } - else if (count1 == 1) - { - count = 1; - contactsOut[0] = shape1[0]; - if (m_instance1.GetShape()->GetAsShapeAsConvexPolygon()) - { - ndInt32 i0 = count0 - 1; - const ndVector p (shape1[0]); - for (ndInt32 i1 = 0; i1 < count0; i1++) - { - const ndVector e(shape0[i1] - shape0[i0]); - const ndVector n(normal.CrossProduct(e)); - ndAssert(n.m_w == ndFloat32(0.0f)); - ndAssert(n.DotProduct(n).GetScalar() > ndFloat32(0.0f)); - - ndFloat32 test = n.DotProduct(p - shape0[i0]).GetScalar(); - if (test < ndFloat32(-1.e-3f)) - { - count = 0; - break; - } - i0 = i1; - } - } - } - else if ((count1 == 2) && (count0 == 2)) - { - ndVector p0(shape1[0]); - ndVector p1(shape1[1]); - const ndVector& q0 = shape0[0]; - const ndVector& q1 = shape0[1]; - ndVector p10(p1 - p0); - ndVector q10(q1 - q0); - ndAssert(p10.m_w == ndFloat32(0.0f)); - ndAssert(q10.m_w == ndFloat32(0.0f)); - p10 = p10.Scale(ndRsqrt(p10.DotProduct(p10).GetScalar() + ndFloat32(1.0e-8f))); - q10 = q10.Scale(ndRsqrt(q10.DotProduct(q10).GetScalar() + ndFloat32(1.0e-8f))); - ndFloat32 dot = q10.DotProduct(p10).GetScalar(); - if (ndAbs(dot) > ndFloat32(0.998f)) - { - // segment are collinear, the contact points is the overlapping segment - ndFloat32 pl0 = p0.DotProduct(p10).GetScalar(); - ndFloat32 pl1 = p1.DotProduct(p10).GetScalar(); - ndFloat32 ql0 = q0.DotProduct(p10).GetScalar(); - ndFloat32 ql1 = q1.DotProduct(p10).GetScalar(); - if (pl0 > pl1) - { - ndSwap(pl0, pl1); - ndSwap(p0, p1); - p10 = p10.Scale(ndFloat32(-1.0f)); - } - if (ql0 > ql1) - { - ndSwap(ql0, ql1); - } - if (!((ql0 > pl1) && (ql1 < pl0))) - { - ndFloat32 clip0 = (ql0 > pl0) ? ql0 : pl0; - ndFloat32 clip1 = (ql1 < pl1) ? ql1 : pl1; - - count = 2; - contactsOut[0] = p0 + p10.Scale(clip0 - pl0); - contactsOut[1] = p0 + p10.Scale(clip1 - pl0); - } - } - else - { - // only on contact at the closest distance segment - count = 1; - const ndFastRay ray(p0, p1); - const ndRay intesect(ray.RayDistance(q0, q1)); - contactsOut[0] = (intesect.m_p0 + intesect.m_p1).Scale(ndFloat32(0.5f)); - } - } - else - { - ndAssert((count1 >= 2) && (count0 >= 2)); - count = ConvexPolygonsIntersection(normal, count0, shape0, count1, shape1, contactsOut, baseCount); - } - } - } - return count; -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactSolver.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactSolver.h deleted file mode 100644 index b0c7d0a64c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndContactSolver.h +++ /dev/null @@ -1,194 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONTACT_SOLVER_H__ -#define __ND_CONTACT_SOLVER_H__ - -#include "ndCollisionStdafx.h" -#include "ndShape.h" -#include "ndShapeInstance.h" - -class ndPlane; -class ndBodyKinematic; -class ndContactNotify; -class ndPolygonMeshDesc; - -D_MSV_NEWTON_ALIGN_32 -class ndMinkFace -{ - public: - ndPlane m_plane; - ndMinkFace* m_twin[3]; - ndInt16 m_vertex[3]; - ndInt8 m_mark; - ndInt8 m_alive; -} D_GCC_NEWTON_ALIGN_32 ; - -#define D_SEPARATION_PLANES_ITERATIONS 8 -#define D_CONVEX_MINK_STACK_SIZE 64 -#define D_CONNICS_CONTATS_ITERATIONS 32 -#define D_CONVEX_MINK_MAX_FACES 512 -#define D_CONVEX_MINK_MAX_POINTS 256 -#define D_MAX_EDGE_COUNT 2048 -#define D_PENETRATION_TOL ndFloat32 (1.0f / 1024.0f) -#define D_MINK_VERTEX_ERR ndFloat32 (1.0e-3f) -#define D_MINK_VERTEX_ERR2 (D_MINK_VERTEX_ERR * D_MINK_VERTEX_ERR) - -class ndContact; -class dCollisionParamProxy; - -D_MSV_NEWTON_ALIGN_32 -class ndContactSolver: public ndDownHeap -{ - public: - class ndBoxBoxDistance2; - - D_COLLISION_API ndContactSolver(); - ~ndContactSolver() {} - - D_COLLISION_API void CalculateContacts( - const ndShapeInstance* const shapeA, const ndMatrix& matrixA, const ndVector& velocA, - const ndShapeInstance* const shapeB, const ndMatrix& matrixB, const ndVector& velocB, - ndFixSizeArray& contactOut, ndContactNotify* const notification); - - private: - ndContactSolver(ndContact* const contact, ndContactNotify* const notification, ndFloat32 timestep, ndInt32 threadId); - ndContactSolver(ndShapeInstance* const instance, ndContactNotify* const notification, ndFloat32 timestep, ndInt32 threadId); - ndContactSolver(const ndContactSolver& src, const ndShapeInstance& instance0, const ndShapeInstance& instance1); - - ndInt32 CalculateContactsDiscrete(); // done - ndInt32 CalculateContactsContinue(); // done - ndFloat32 RayCast (const ndVector& localP0, const ndVector& localP1, ndContactPoint& contactOut); - - ndInt32 ConvexContactsDiscrete(); // done - ndInt32 CompoundContactsDiscrete(); // done - ndInt32 ConvexToConvexContactsDiscrete(); // done - ndInt32 CompoundToStaticProceduralMesh(); // done - ndInt32 ConvexToCompoundContactsDiscrete(); // done - ndInt32 CompoundToConvexContactsDiscrete(); // done - ndInt32 CompoundToCompoundContactsDiscrete(); // done - ndInt32 ConvexToStaticMeshContactsDiscrete(); // done - ndInt32 CompoundToShapeStaticBvhContactsDiscrete(); // done - ndInt32 CompoundToStaticHeightfieldContactsDiscrete(); // done - ndInt32 CalculatePolySoupToHullContactsDescrete(ndPolygonMeshDesc& data); // done - ndInt32 ConvexToSaticStaticBvhContactsNodeDescrete(const ndAabbPolygonSoup::ndNode* const node); // done - - ndInt32 ConvexContactsContinue(); // done - ndInt32 CompoundContactsContinue(); // done - ndInt32 ConvexToConvexContactsContinue(); // done - ndInt32 ConvexToCompoundContactsContinue(); // done - ndInt32 ConvexToStaticMeshContactsContinue(); // done - ndInt32 CalculatePolySoupToHullContactsContinue(ndPolygonMeshDesc& data); // done - - class dgPerimenterEdge - { - public: - const ndVector* m_vertex; - dgPerimenterEdge* m_next; - dgPerimenterEdge* m_prev; - }; - - class dgFaceFreeList - { - public: - dgFaceFreeList* m_next; - }; - - inline ndMinkFace* NewFace(); - inline void PushFace(ndMinkFace* const face); - inline void DeleteFace(ndMinkFace* const face); - inline ndMinkFace* AddFace(ndInt32 v0, ndInt32 v1, ndInt32 v2); - - bool CalculateClosestPoints(); - ndInt32 CalculateClosestSimplex(); - - ndInt32 CalculateIntersectingPlane(ndInt32 count); - ndInt32 PruneContacts(ndInt32 count, ndInt32 maxCount) const; - ndInt32 PruneSupport(ndInt32 count, const ndVector& dir, const ndVector* const points) const; - ndInt32 CalculateContacts(const ndVector& point0, const ndVector& point1, const ndVector& normal); - ndInt32 Prune2dContacts(const ndMatrix& matrix, ndInt32 count, ndContactPoint* const contactArray, ndInt32 maxCount) const; - ndInt32 Prune3dContacts(const ndMatrix& matrix, ndInt32 count, ndContactPoint* const contactArray, ndInt32 maxCount) const; - ndInt32 ConvexPolygonsIntersection(const ndVector& normal, ndInt32 count1, ndVector* const shape1, ndInt32 count2, ndVector* const shape2, ndVector* const contactOut, ndInt32 maxContacts) const; - ndInt32 ConvexPolygonToLineIntersection(const ndVector& normal, ndInt32 count1, ndVector* const shape1, ndInt32 count2, ndVector* const shape2, ndVector* const contactOut, ndVector* const mem) const; - - ndBigVector ReduceLine(ndInt32& indexOut); - ndBigVector ReduceTriangle (ndInt32& indexOut); - ndBigVector ReduceTetrahedrum (ndInt32& indexOut); - void SupportVertex(const ndVector& dir, ndInt32 vertexIndex); - - void TranslateSimplex(const ndVector& step); - void CalculateContactFromFeacture(ndInt32 featureType); - - ndShapeInstance m_instance0; - ndShapeInstance m_instance1; - ndVector m_closestPoint0; - ndVector m_closestPoint1; - ndVector m_separatingVector; - union - { - ndVector m_buffer[2 * D_CONVEX_MINK_MAX_POINTS]; - struct - { - ndVector m_hullDiff[D_CONVEX_MINK_MAX_POINTS]; - ndVector m_hullSum[D_CONVEX_MINK_MAX_POINTS]; - }; - }; - - ndContact* m_contact; - dgFaceFreeList* m_freeFace; - ndContactNotify* m_notification; - ndContactPoint* m_contactBuffer; - ndFloat32 m_timestep; - ndFloat32 m_skinMargin; - ndFloat32 m_separationDistance; - - ndInt32 m_threadId; - ndInt32 m_maxCount; - ndInt32 m_faceIndex; - ndInt32 m_vertexIndex; - ndUnsigned32 m_pruneContacts : 1; - ndUnsigned32 m_intersectionTestOnly : 1; - - ndMinkFace* m_faceStack[D_CONVEX_MINK_STACK_SIZE]; - ndMinkFace* m_coneFaceList[D_CONVEX_MINK_STACK_SIZE]; - ndMinkFace* m_deletedFaceList[D_CONVEX_MINK_STACK_SIZE]; - ndMinkFace m_facePool[D_CONVEX_MINK_MAX_FACES]; - ndInt8 m_heapBuffer[D_CONVEX_MINK_MAX_FACES * (sizeof (ndFloat32) + sizeof (ndMinkFace *))]; - - static ndVector m_pruneUpDir; - static ndVector m_pruneSupportX; - - static ndVector m_hullDirs[14]; - static ndInt32 m_rayCastSimplex[4][4]; - - friend class ndScene; - friend class ndShapeConvex; - friend class ndShapeInstance; - friend class ndPolygonMeshDesc; - friend class ndConvexCastNotify; - friend class ndShapeConvexPolygon; - friend class ndPolygonMeshLocalDesc; - friend class ndBodyPlayerCapsuleContactSolver; -} D_GCC_NEWTON_ALIGN_32; - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConvexCastNotify.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConvexCastNotify.cpp deleted file mode 100644 index 650fb7efbb..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConvexCastNotify.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndScene.h" -#include "ndContact.h" -#include "ndBodyKinematic.h" -#include "ndShapeInstance.h" -#include "ndConvexCastNotify.h" - -bool ndConvexCastNotify::CastShape(const ndShapeInstance& castingInstance, const ndMatrix& globalOrigin, const ndVector& globalDest, ndBodyKinematic* const targetBody) -{ - ndAssert(m_cachedScene); - ndContact contactJoint; - ndBodyKinematic body0; - ndContactNotify notify(m_cachedScene); - ndFixSizeArray contactBuffer; - contactBuffer.SetCount(D_MAX_CONTATCS); - - body0.SetCollisionShape(castingInstance); - body0.SetMatrix(globalOrigin); - body0.SetMassMatrix(ndVector::m_one); - body0.SetVelocity(globalDest - globalOrigin.m_posit); - - contactJoint.SetBodies(&body0, targetBody); - - ndShapeInstance& shape0 = body0.GetCollisionShape(); - shape0.SetGlobalMatrix(shape0.GetLocalMatrix() * body0.GetMatrix()); - - m_contacts.SetCount(0); - ndContactSolver contactSolver(&contactJoint, ¬ify, ndFloat32(1.0f), 0); - contactSolver.m_contactBuffer = &contactBuffer[0]; - - m_param = ndFloat32(1.2f); - const ndInt32 count = ndMin(contactSolver.CalculateContactsContinue(), m_contacts.GetCapacity()); - if (count) - { - for (ndInt32 i = 0; i < count; ++i) - { - ndContactPoint& contact = contactBuffer[i]; - contact.m_body0 = nullptr; - contact.m_body1 = targetBody; - contact.m_shapeInstance0 = &castingInstance; - contact.m_shapeInstance1 = &targetBody->GetCollisionShape(); - m_contacts.PushBack(contactBuffer[i]); - } - m_param = contactSolver.m_timestep; - m_normal = contactSolver.m_separatingVector; - m_closestPoint0 = contactSolver.m_closestPoint0; - m_closestPoint1 = contactSolver.m_closestPoint1; - } - return count > 0; -} - -bool ndConvexCastNotify::CastShape( - const ndShapeInstance& castingInstance, - const ndMatrix& globalOrigin, - const ndVector& globalDest, - const ndShapeInstance& targetShape, - const ndMatrix& targetMatrix) -{ - ndBodyKinematic body1; - - body1.SetCollisionShape(targetShape); - body1.SetMatrix(targetMatrix); - - ndShapeInstance& shape1 = body1.GetCollisionShape(); - shape1.SetGlobalMatrix(shape1.GetLocalMatrix() * body1.GetMatrix()); - - bool cast = CastShape(castingInstance, globalOrigin, globalDest, &body1); - for (ndInt32 i = 0; i < m_contacts.GetCount(); ++i) - { - ndContactPoint& contact = m_contacts[i]; - contact.m_body1 = nullptr; - contact.m_shapeInstance1 = &targetShape; - } - - return cast; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConvexCastNotify.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConvexCastNotify.h deleted file mode 100644 index 6ca7623bb5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndConvexCastNotify.h +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONVEXCAST_NOTIFY_H__ -#define __ND_CONVEXCAST_NOTIFY_H__ - -#include "ndCollisionStdafx.h" -#include "ndContact.h" - -class ndBody; -class ndScene; -class ndShapeInstance; - -D_MSV_NEWTON_ALIGN_32 -class ndConvexCastNotify : public ndClassAlloc -{ - public: - ndConvexCastNotify() - :ndClassAlloc() - ,m_normal(ndVector::m_zero) - ,m_closestPoint0(ndVector::m_zero) - ,m_closestPoint1(ndVector::m_zero) - ,m_contacts() - ,m_param(ndFloat32 (1.2f)) - ,m_cachedScene(nullptr) - { - } - - ndConvexCastNotify(const ndConvexCastNotify& src) - :ndClassAlloc(src) - ,m_normal(src.m_normal) - ,m_closestPoint0(src.m_closestPoint0) - ,m_closestPoint1(src.m_closestPoint1) - ,m_contacts(src.m_contacts) - ,m_param(src.m_param) - ,m_cachedScene(src.m_cachedScene) - { - } - - - virtual ~ndConvexCastNotify() - { - } - - virtual ndUnsigned32 OnRayPrecastAction(const ndBody* const, const ndShapeInstance* const) - { - ndAssert(0); - return 1; - } - - //virtual ndFloat32 OnRayCastAction(const ndContactPoint& contact, ndFloat32 intersetParam) - virtual ndFloat32 OnRayCastAction(const ndContactPoint&, ndFloat32) - { - ndAssert(0); - return 0; - } - - D_COLLISION_API bool CastShape(const ndShapeInstance& castingInstance, const ndMatrix& globalOrigin, const ndVector& globalDest, ndBodyKinematic* const targetBody); - D_COLLISION_API bool CastShape(const ndShapeInstance& castingInstance, const ndMatrix& globalOrigin, const ndVector& globalDest, const ndShapeInstance& targetShape, const ndMatrix& targetMatrix); - - ndVector m_normal; - ndVector m_closestPoint0; - ndVector m_closestPoint1; - ndFixSizeArray m_contacts; - ndFloat32 m_param; - ndScene* m_cachedScene; -} D_GCC_NEWTON_ALIGN_32; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndJointBilateralConstraint.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndJointBilateralConstraint.cpp deleted file mode 100644 index 86992c1f23..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndJointBilateralConstraint.cpp +++ /dev/null @@ -1,620 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndBodyKinematic.h" -#include "ndJointBilateralConstraint.h" - -#define D_VEL_DAMP ndFloat32(100.0f) -#define D_POS_DAMP ndFloat32(1500.0f) - -ndJointBilateralConstraint::ndJointBilateralConstraint() - :ndConstraint() - ,m_worldNode(nullptr) - ,m_body0Node(nullptr) - ,m_body1Node(nullptr) - ,m_deletedNode(nullptr) -{ - m_mark0 = 0; - m_mark1 = 0; - m_maxDof = 0; - m_hitLimits = 0; - m_rowIsMotor = 0; - m_isInSkeleton = 0; - m_enableCollision = 0; - m_solverModel = m_jointkinematicOpenLoop; - m_defualtDiagonalRegularizer = ndFloat32(0.0f); - - //memset(m_jointForce, 0, sizeof(m_jointForce)); - //memset(m_motorAcceleration, 0, sizeof(m_motorAcceleration)); - ndMemSet(m_jointForce, ndForceImpactPair(), sizeof(m_jointForce) / sizeof(m_jointForce[0])); - ndMemSet(m_motorAcceleration, ndFloat32 (0.0f), sizeof(m_motorAcceleration) / sizeof (m_motorAcceleration[0])); -} - -ndJointBilateralConstraint::ndJointBilateralConstraint(ndInt32 maxDof, ndBodyKinematic* const body0, ndBodyKinematic* const body1, const ndMatrix& globalMatrix) - :ndConstraint() - ,m_worldNode(nullptr) - ,m_body0Node(nullptr) - ,m_body1Node(nullptr) - ,m_deletedNode(nullptr) -{ - m_body0 = body0; - m_body1 = body1; - ndAssert(m_body0 && m_body1); - ndAssert(m_body0 != m_body1); - - if (m_body0->GetInvMass() == ndFloat32(0.0f)) - { - ndSwap(m_body0, m_body1); - } - ndAssert(m_body0->GetInvMass() > ndFloat32(0.0f)); - - CalculateLocalMatrix(globalMatrix, m_localMatrix0, m_localMatrix1); - - m_mark0 = 0; - m_mark1 = 0; - m_hitLimits = 0; - m_rowIsMotor = 0; - m_isInSkeleton = 0; - m_enableCollision = 0; - m_maxDof = ndUnsigned8(maxDof); - m_solverModel = m_jointkinematicOpenLoop; - m_defualtDiagonalRegularizer = ndFloat32(0.0f); - - //memset(m_jointForce, 0, sizeof(m_jointForce)); - //memset(m_motorAcceleration, 0, sizeof(m_motorAcceleration)); - ndMemSet(m_jointForce, ndForceImpactPair(), sizeof(m_jointForce) / sizeof(m_jointForce[0])); - ndMemSet(m_motorAcceleration, ndFloat32(0.0f), sizeof(m_motorAcceleration) / sizeof(m_motorAcceleration[0])); -} - -ndJointBilateralConstraint::ndJointBilateralConstraint(ndInt32 maxDof, ndBodyKinematic* const body0, - ndBodyKinematic* const body1, const ndMatrix& globalMatrixBody0, const ndMatrix& globalMatrixBody1) - :ndConstraint() - ,m_worldNode(nullptr) - ,m_body0Node(nullptr) - ,m_body1Node(nullptr) - ,m_deletedNode(nullptr) -{ - m_body0 = body0; - m_body1 = body1; - ndAssert(m_body0 && m_body1); - ndAssert(m_body0 != m_body1); - - if (m_body0->GetInvMass() == ndFloat32(0.0f)) - { - ndSwap(m_body0, m_body1); - } - ndAssert(m_body0->GetInvMass() > ndFloat32(0.0f)); - - ndMatrix dummyMatrix; - CalculateLocalMatrix(globalMatrixBody0, m_localMatrix0, dummyMatrix); - CalculateLocalMatrix(globalMatrixBody1, dummyMatrix, m_localMatrix1); - - m_mark0 = 0; - m_mark1 = 0; - m_hitLimits = 0; - m_rowIsMotor = 0; - m_isInSkeleton = 0; - m_enableCollision = 0; - m_maxDof = ndUnsigned8(maxDof); - m_solverModel = m_jointkinematicOpenLoop; - m_defualtDiagonalRegularizer = ndFloat32(0.0f); - - //memset(m_jointForce, 0, sizeof(m_jointForce)); - //memset(m_motorAcceleration, 0, sizeof(m_motorAcceleration)); - ndMemSet(m_jointForce, ndForceImpactPair(), sizeof(m_jointForce) / sizeof(m_jointForce[0])); - ndMemSet(m_motorAcceleration, ndFloat32(0.0f), sizeof(m_motorAcceleration) / sizeof(m_motorAcceleration[0])); -} - -ndJointBilateralConstraint::~ndJointBilateralConstraint() -{ - ndAssert(m_worldNode == nullptr); - ndAssert(m_body0Node == nullptr); - ndAssert(m_body1Node == nullptr); - ndAssert(m_deletedNode == nullptr); -} - -ndJointBilateralSolverModel ndJointBilateralConstraint::GetSolverModel() const -{ - return m_solverModel; -} - -void ndJointBilateralConstraint::SetSolverModel(ndJointBilateralSolverModel model) -{ - ndAssert(model < m_jointModesCount); - ndAssert(model >= m_jointIterativeSoft); - m_solverModel = ndClamp(model, m_jointIterativeSoft, m_jointModesCount); -} - -//ndUnsigned32 ndJointBilateralConstraint::GetRowsCount() const -//{ -// return m_maxDof; -//} - -const ndMatrix& ndJointBilateralConstraint::GetLocalMatrix0() const -{ - return m_localMatrix0; -} - -const ndMatrix& ndJointBilateralConstraint::GetLocalMatrix1() const -{ - return m_localMatrix1; -} - -void ndJointBilateralConstraint::SetLocalMatrix0(const ndMatrix& matrix) -{ - m_localMatrix0 = matrix; -} - -void ndJointBilateralConstraint::SetLocalMatrix1(const ndMatrix& matrix) -{ - m_localMatrix1 = matrix; -} - - -ndFloat32 ndJointBilateralConstraint::GetMotorZeroAcceleration(ndConstraintDescritor& desc) const -{ - const ndInt32 index = desc.m_rowsCount - 1; - ndAssert(index >= 0); - ndAssert(index < ndInt32(m_maxDof)); - return desc.m_zeroRowAcceleration[index]; -} - -void ndJointBilateralConstraint::SetMotorAcceleration(ndConstraintDescritor& desc, ndFloat32 acceleration) -{ - const ndInt32 index = desc.m_rowsCount - 1; - ndAssert(index >= 0); - ndAssert(index < ndInt32(m_maxDof)); - m_rowIsMotor |= (1 << index); - desc.m_flags[index] = 0; - m_motorAcceleration[index] = acceleration; - desc.m_jointAccel[index] = acceleration; -} - -ndFloat32 ndJointBilateralConstraint::GetMotorAcceleration(ndConstraintDescritor& desc) const -{ - const ndInt32 index = desc.m_rowsCount - 1; - ndAssert(index >= 0); - ndAssert(index < ndInt32(m_maxDof)); - return desc.m_jointAccel[index]; -} - -void ndJointBilateralConstraint::SetJointErrorPosit(ndConstraintDescritor& desc, ndFloat32 errorPosit) -{ - const ndInt32 index = desc.m_rowsCount - 1; - ndAssert(index >= 0); - ndAssert(index < ndInt32(m_maxDof)); - desc.m_penetration[index] = errorPosit; -} - -void ndJointBilateralConstraint::SetLowerFriction(ndConstraintDescritor& desc, ndFloat32 friction) -{ - const ndInt32 index = desc.m_rowsCount - 1; - ndAssert(index >= 0); - ndAssert(index < ndInt32(m_maxDof)); - desc.m_forceBounds[index].m_low = ndClamp(friction, ndFloat32(D_MIN_BOUND), ndFloat32(-0.001f)); - ndAssert(desc.m_forceBounds[index].m_normalIndex == D_INDEPENDENT_ROW); - -#ifdef _DEBUG - ndInt32 i0 = 0; - ndInt32 i1 = index - 1; - while ((i0 <= i1) && (desc.m_forceBounds[i0].m_normalIndex == D_INDEPENDENT_ROW)) i0++; - while ((i1 >= i0) && (desc.m_forceBounds[i1].m_normalIndex != D_INDEPENDENT_ROW)) i1--; - ndAssert((i0 - i1) == 1); - if ((i0 - i1) != 1) - { - ndTrace(("make sure that friction joint are issue at last\n")); - } -#endif -} - -void ndJointBilateralConstraint::SetHighFriction(ndConstraintDescritor& desc, ndFloat32 friction) -{ - const ndInt32 index = desc.m_rowsCount - 1; - ndAssert(index >= 0); - ndAssert(index < ndInt32(m_maxDof)); - - desc.m_forceBounds[index].m_upper = ndClamp(friction, ndFloat32(0.001f), ndFloat32(D_MAX_BOUND)); - ndAssert(desc.m_forceBounds[index].m_normalIndex == D_INDEPENDENT_ROW); - -#ifdef _DEBUG - ndInt32 i0 = 0; - ndInt32 i1 = index - 1; - while ((i0 <= i1) && (desc.m_forceBounds[i0].m_normalIndex == D_INDEPENDENT_ROW)) i0++; - while ((i1 >= i0) && (desc.m_forceBounds[i1].m_normalIndex != D_INDEPENDENT_ROW)) i1--; - ndAssert((i0 - i1) == 1); - if ((i0 - i1) != 1) - { - ndTrace(("make sure that friction joint are issue at last\n")); - } -#endif -} - -void ndJointBilateralConstraint::JacobianDerivative(ndConstraintDescritor&) -{ - //ndAssert(0); - ndTrace(("error: this joint is an interface\n")); -} - -bool ndJointBilateralConstraint::GetSkeletonFlag() const -{ - return m_isInSkeleton ? true : false; -} - -void ndJointBilateralConstraint::SetSkeletonFlag(bool flag) -{ - m_isInSkeleton = ndUnsigned32(flag ? 1 : 0); -} - -bool ndJointBilateralConstraint::IsCollidable() const -{ - return m_enableCollision ? true : false; -} - -bool ndJointBilateralConstraint::IsBilateral() const -{ - return true; -} - -void ndJointBilateralConstraint::SetCollidable(bool state) -{ - m_enableCollision = ndUnsigned32(state ? 1 : 0); -} - -ndFloat32 ndJointBilateralConstraint::GetDiagonalRegularizer(const ndConstraintDescritor& desc) const -{ - const ndInt32 index = desc.m_rowsCount - 1; - ndAssert(index >= 0); - ndAssert(index < ndInt32(m_maxDof)); - return desc.m_diagonalRegularizer[index]; -} - -void ndJointBilateralConstraint::SetDiagonalRegularizer(ndConstraintDescritor& desc, ndFloat32 regularizer) -{ - const ndInt32 index = desc.m_rowsCount - 1; - ndAssert(index >= 0); - ndAssert(index < ndInt32(m_maxDof)); - desc.m_diagonalRegularizer[index] = ndClamp(regularizer, ndFloat32(0.0f), ndFloat32(1.0f)); -} - -ndFloat32 ndJointBilateralConstraint::GetJointErrorPosit(ndConstraintDescritor& desc) const -{ - const ndInt32 index = desc.m_rowsCount - 1; - ndAssert(index >= 0); - ndAssert(index < ndInt32(m_maxDof)); - return desc.m_penetration[index]; -} - -ndFloat32 ndJointBilateralConstraint::GetJointErrorSpeed(ndConstraintDescritor& desc) const -{ - const ndInt32 index = desc.m_rowsCount - 1; - ndAssert(index >= 0); - ndAssert(index < ndInt32(m_maxDof)); - return desc.m_jointSpeed[index]; -} - -bool ndJointBilateralConstraint::IsInWorld() const -{ - return m_worldNode ? true : false; -} - -bool ndJointBilateralConstraint::IsSkeleton() const -{ - const ndJointBilateralSolverModel mode = GetSolverModel(); - bool test = false; - test = test || (mode == m_jointkinematicOpenLoop); - test = test || (mode == m_jointkinematicCloseLoop); - //test = test || (mode == m_jointkinematicHintOpenLoop); - return test; -} - -bool ndJointBilateralConstraint::GetJointHitLimits() const -{ - return m_hitLimits ? true : false; -} - -void ndJointBilateralConstraint::ReplaceSentinel(ndBodyKinematic* const sentinel) -{ - m_body1 = sentinel; -} - -ndJointBilateralConstraint* ndJointBilateralConstraint::GetAsBilateral() -{ - return this; -} - - -void ndJointBilateralConstraint::SetIkMode(bool) -{ -} - -void ndJointBilateralConstraint::SetIkSetAccel(const ndJacobian&, const ndJacobian&) -{ -} - -void ndJointBilateralConstraint::DebugJoint(ndConstraintDebugCallback& debugCallback) const -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - debugCallback.DrawFrame(matrix0); - debugCallback.DrawFrame(matrix1); -} - -ndFloat32 ndJointBilateralConstraint::CalculateAngle(const ndVector& pin, const ndVector& cosDir, const ndVector& sinDir) const -{ - const ndVector dir(pin & ndVector::m_triplexMask); - ndVector projectDir(dir - sinDir * dir.DotProduct(sinDir)); - ndFloat32 cosAngle = projectDir.DotProduct(cosDir).GetScalar(); - ndFloat32 sinAngle = sinDir.DotProduct(projectDir.CrossProduct(cosDir)).GetScalar(); - return ndAtan2(sinAngle, cosAngle); -} - -void ndJointBilateralConstraint::CalculateLocalMatrix(const ndMatrix& globalMatrix, ndMatrix& localMatrix0, ndMatrix& localMatrix1) const -{ - ndAssert(globalMatrix.TestOrthogonal()); - localMatrix0 = globalMatrix * m_body0->GetMatrix().OrthoInverse(); - localMatrix1 = globalMatrix * m_body1->GetMatrix().OrthoInverse(); -} - -void ndJointBilateralConstraint::CalculateGlobalMatrix(ndMatrix& matrix0, ndMatrix& matrix1) const -{ - matrix0 = m_localMatrix0 * m_body0->GetMatrix(); - matrix1 = m_localMatrix1 * m_body1->GetMatrix(); -} - -ndMatrix ndJointBilateralConstraint::CalculateGlobalMatrix0() const -{ - return m_localMatrix0 * m_body0->GetMatrix(); -} - -ndMatrix ndJointBilateralConstraint::CalculateGlobalMatrix1() const -{ - return m_localMatrix1 * m_body1->GetMatrix(); -} - -ndFloat32 ndJointBilateralConstraint::CalculateSpringDamperAcceleration(ndFloat32 dt, ndFloat32 ks, ndFloat32 x, ndFloat32 kd, ndFloat32 v) const -{ - //at = - (ks * x + kd * v); - //at = [- ks (x2 - x1) - kd * (v2 - v1) - dt * ks * (v2 - v1)] / [1 + dt * kd + dt * dt * ks] - ndFloat32 ksd = dt * ks; - ndFloat32 num = ks * x + kd * v + ksd * v; - ndFloat32 den = ndFloat32(1.0f) + dt * kd + dt * ksd; - ndAssert(den > 0.0f); - ndFloat32 accel = -num / den; - return accel; -} - -void ndJointBilateralConstraint::SetMassSpringDamperAcceleration(ndConstraintDescritor& desc, ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - const ndInt32 index = desc.m_rowsCount - 1; - ndAssert(index >= 0); - ndAssert(index < ndInt32(m_maxDof)); - - const ndVector& veloc0 = m_body0->m_veloc; - const ndVector& omega0 = m_body0->m_omega; - const ndVector& veloc1 = m_body1->m_veloc; - const ndVector& omega1 = m_body1->m_omega; - const ndJacobian &jacobian0 = desc.m_jacobian[index].m_jacobianM0; - const ndJacobian &jacobian1 = desc.m_jacobian[index].m_jacobianM1; - - const ndFloat32 relPosit = desc.m_penetration[index]; - const ndFloat32 relVeloc = (jacobian0.m_linear * veloc0 + jacobian0.m_angular * omega0 + jacobian1.m_linear * veloc1 + jacobian1.m_angular * omega1).AddHorizontal().GetScalar(); - const ndFloat32 accel = CalculateSpringDamperAcceleration(desc.m_timestep, spring, -relPosit, damper, relVeloc); - - const ndFloat32 r = ndClamp(regularizer, ndFloat32(1.e-8f), ndFloat32(0.9f)); - desc.m_diagonalRegularizer[index] = r; - SetMotorAcceleration(desc, accel); -} - -void ndJointBilateralConstraint::JointAccelerations(ndJointAccelerationDecriptor* const desc) -{ - const ndVector& bodyVeloc0 = m_body0->m_veloc; - const ndVector& bodyOmega0 = m_body0->m_omega; - const ndVector& bodyVeloc1 = m_body1->m_veloc; - const ndVector& bodyOmega1 = m_body1->m_omega; - const ndVector gyroAlpha0(m_body0->GetGyroAlpha()); - const ndVector gyroAlpha1(m_body1->GetGyroAlpha()); - - ndRightHandSide* const rhs = desc->m_rightHandSide; - const ndLeftHandSide* const row = desc->m_leftHandSide; - ndAssert(desc->m_timestep > ndFloat32(0.0f)); - ndAssert(desc->m_invTimestep > ndFloat32(0.0f)); - - const ndFloat32 dt = desc->m_timestep; - const ndFloat32 ks = D_POS_DAMP * ndFloat32(0.5f); - const ndFloat32 kd = D_VEL_DAMP * ndFloat32(4.0f); - for (ndInt32 k = 0; k < desc->m_rowsCount; ++k) - { - if (m_rowIsMotor & (1 << k)) - { - const ndFloat32 accel = m_motorAcceleration[k] + rhs[k].m_deltaAccel; - rhs[k].m_coordenateAccel = accel; - } - else - { - const ndJacobianPair& Jt = row[k].m_Jt; - - //calculate internal centripetal each sub step - const ndVector centripetal0(bodyOmega0.CrossProduct(bodyOmega0.CrossProduct(m_r0[k]))); - const ndVector centripetal1(bodyOmega1.CrossProduct(bodyOmega1.CrossProduct(m_r1[k]))); - - const ndVector relVeloc( - Jt.m_jacobianM0.m_linear * bodyVeloc0 + Jt.m_jacobianM0.m_angular * bodyOmega0 + - Jt.m_jacobianM1.m_linear * bodyVeloc1 + Jt.m_jacobianM1.m_angular * bodyOmega1); - const ndVector relGyro(Jt.m_jacobianM0.m_angular * gyroAlpha0 + Jt.m_jacobianM1.m_angular * gyroAlpha1); - const ndVector relCentr(Jt.m_jacobianM0.m_linear * centripetal0 + Jt.m_jacobianM1.m_linear * centripetal1); - const ndFloat32 vRel = relVeloc.AddHorizontal().GetScalar(); - - const ndFloat32 relPosit = rhs[k].m_penetration - vRel * dt * desc->m_firstPassCoefFlag; - const ndFloat32 ksd = dt * ks; - const ndFloat32 num = ks * relPosit - kd * vRel - ksd * vRel; - const ndFloat32 den = ndFloat32(1.0f) + dt * kd + dt * ksd; - const ndFloat32 aRelErr = num / den; - const ndFloat32 accel = rhs[k].m_deltaAccel + aRelErr + (relGyro - relCentr).AddHorizontal().GetScalar(); - - rhs[k].m_penetration = relPosit; - rhs[k].m_coordenateAccel = accel; - } - } -} - -void ndJointBilateralConstraint::ClearMemory() -{ - for (ndInt32 i = 0; i < sizeof(m_jointForce) / sizeof(m_jointForce[0]); ++i) - { - m_jointForce[i].Clear(); - m_motorAcceleration[i] = ndFloat32 (0.0f); - } -} - -void ndJointBilateralConstraint::AddLinearRowJacobian(ndConstraintDescritor& desc, const ndVector& pivot0, const ndVector& pivot1, const ndVector& dir) -{ - ndPointParam param; - InitPointParam(param, pivot0, pivot1); - - const ndInt32 index = desc.m_rowsCount; - ndAssert(dir.m_w == ndFloat32(0.0f)); - - ndJacobian &jacobian0 = desc.m_jacobian[index].m_jacobianM0; - ndVector r0CrossDir(param.m_r0.CrossProduct(dir)); - m_r0[index] = param.m_r0; - jacobian0.m_linear = dir; - jacobian0.m_angular = r0CrossDir; - ndAssert(jacobian0.m_linear.m_w == ndFloat32(0.0f)); - ndAssert(jacobian0.m_angular.m_w == ndFloat32(0.0f)); - - ndJacobian &jacobian1 = desc.m_jacobian[index].m_jacobianM1; - ndVector r1CrossDir(dir.CrossProduct(param.m_r1)); - m_r1[index] = param.m_r1; - jacobian1.m_linear = dir * ndVector::m_negOne; - jacobian1.m_angular = r1CrossDir; - ndAssert(jacobian1.m_linear.m_w == ndFloat32(0.0f)); - ndAssert(jacobian1.m_angular.m_w == ndFloat32(0.0f)); - - m_rowIsMotor &= ~(1 << index); - m_motorAcceleration[index] = ndFloat32(0.0f); - ndAssert(desc.m_timestep > ndFloat32(0.0f)); - ndForceImpactPair* const jointForce = &m_jointForce[index]; - - const ndVector& omega0 = m_body0->m_omega; - const ndVector& omega1 = m_body1->m_omega; - const ndVector& veloc0 = m_body0->m_veloc; - const ndVector& veloc1 = m_body1->m_veloc; - - const ndVector gyroAlpha0(m_body0->GetGyroAlpha()); - const ndVector gyroAlpha1(m_body1->GetGyroAlpha()); - const ndVector centripetal0(omega0.CrossProduct(omega0.CrossProduct(m_r0[index]))); - const ndVector centripetal1(omega1.CrossProduct(omega1.CrossProduct(m_r1[index]))); - - //const ndVector positError(param.m_posit1 - param.m_posit0); - //ndFloat32 relPosit = positError.DotProduct(dir).GetScalar(); - //ndFloat32 relPosit___ = -(jacobian0.m_linear * param.m_posit0 + jacobian1.m_linear * param.m_posit1).AddHorizontal().GetScalar(); - //ndAssert(ndAbs (relPosit___ - relPosit) < ndFloat32(1.0e-7f)); - - const ndFloat32 relGyro = (jacobian0.m_angular * gyroAlpha0 + jacobian1.m_angular * gyroAlpha1).AddHorizontal().GetScalar(); - const ndFloat32 relCentr = -(jacobian0.m_linear * centripetal0 + jacobian1.m_linear * centripetal1).AddHorizontal().GetScalar(); - const ndFloat32 relPosit = -(jacobian0.m_linear * param.m_posit0 + jacobian1.m_linear * param.m_posit1).AddHorizontal().GetScalar(); - const ndFloat32 relVeloc = -(jacobian0.m_linear * veloc0 + jacobian0.m_angular * omega0 + jacobian1.m_linear * veloc1 + jacobian1.m_angular * omega1).AddHorizontal().GetScalar(); - - //at = [- ks (x2 - x1) - kd * (v2 - v1) - dt * ks * (v2 - v1)] / [1 + dt * kd + dt * dt * ks] - const ndFloat32 dt = desc.m_timestep; - const ndFloat32 ks = D_POS_DAMP; - const ndFloat32 kd = D_VEL_DAMP; - const ndFloat32 ksd = dt * ks; - const ndFloat32 num = ks * relPosit + kd * relVeloc + ksd * relVeloc; - const ndFloat32 den = ndFloat32(1.0f) + dt * kd + dt * ksd; - const ndFloat32 accelError = num / den; - - const ndFloat32 relAccel = accelError + relCentr + relGyro; - desc.m_flags[index] = 0; - desc.m_jointAccel[index] = relAccel; - desc.m_penetration[index] = relPosit; - desc.m_jointSpeed[index] = relVeloc; - desc.m_restitution[index] = ndFloat32(0.0f); - desc.m_penetrationStiffness[index] = ndFloat32(0.0f); - desc.m_forceBounds[index].m_jointForce = jointForce; - desc.m_diagonalRegularizer[index] = m_defualtDiagonalRegularizer; - desc.m_zeroRowAcceleration[index] = relVeloc * desc.m_invTimestep + relGyro; - desc.m_rowsCount = index + 1; -} - -void ndJointBilateralConstraint::AddAngularRowJacobian(ndConstraintDescritor& desc, const ndVector& dir, ndFloat32 relAngle) -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - const ndInt32 index = desc.m_rowsCount; - ndForceImpactPair* const jointForce = &m_jointForce[index]; - ndJacobian &jacobian0 = desc.m_jacobian[index].m_jacobianM0; - m_r0[index] = ndVector::m_zero; - jacobian0.m_linear = ndVector::m_zero; - jacobian0.m_angular = dir; - ndAssert(jacobian0.m_angular.m_w == ndFloat32(0.0f)); - - ndJacobian &jacobian1 = desc.m_jacobian[index].m_jacobianM1; - ndAssert(m_body1); - m_r1[index] = ndVector::m_zero; - jacobian1.m_linear = ndVector::m_zero; - jacobian1.m_angular = dir * ndVector::m_negOne; - ndAssert(jacobian1.m_angular.m_w == ndFloat32(0.0f)); - - const ndVector omega0 (m_body0->GetOmega()); - const ndVector omega1 (m_body1->GetOmega()); - const ndVector gyroAlpha0(m_body0->GetGyroAlpha()); - const ndVector gyroAlpha1(m_body1->GetGyroAlpha()); - - const ndFloat32 relOmega = -(omega0 * jacobian0.m_angular + omega1 * jacobian1.m_angular).AddHorizontal().GetScalar(); - - ndAssert(desc.m_timestep > ndFloat32(0.0f)); - ndAssert(desc.m_invTimestep > ndFloat32(0.0f)); - - m_rowIsMotor &= ~(1 << index); - m_motorAcceleration[index] = ndFloat32(0.0f); - ndAssert(desc.m_timestep); - - const ndFloat32 relGyro = (jacobian0.m_angular * gyroAlpha0 + jacobian1.m_angular * gyroAlpha1).AddHorizontal().GetScalar(); - - //at = [- ks (x2 - x1) - kd * (v2 - v1) - dt * ks * (v2 - v1)] / [1 + dt * kd + dt * dt * ks] - ndFloat32 dt = desc.m_timestep; - ndFloat32 ks = D_POS_DAMP; - ndFloat32 kd = D_VEL_DAMP; - ndFloat32 ksd = dt * ks; - ndFloat32 num = ks * relAngle + kd * relOmega + ksd * relOmega; - ndFloat32 den = ndFloat32(1.0f) + dt * kd + dt * ksd; - ndFloat32 alphaError = num / den; - - desc.m_flags[index] = 0; - desc.m_jointSpeed[index] = relOmega; - desc.m_penetration[index] = relAngle; - desc.m_jointAccel[index] = alphaError + relGyro; - desc.m_restitution[index] = ndFloat32(0.0f); - desc.m_penetrationStiffness[index] = ndFloat32(0.0f); - desc.m_forceBounds[index].m_jointForce = jointForce; - desc.m_diagonalRegularizer[index] = m_defualtDiagonalRegularizer; - desc.m_zeroRowAcceleration[index] = relOmega * desc.m_invTimestep + relGyro; - desc.m_rowsCount = index + 1; -} - -ndInt32 ndJointBilateralConstraint::GetKinematicState(ndKinematicState* const) const -{ - ndAssert(0); - return 0; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndJointBilateralConstraint.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndJointBilateralConstraint.h deleted file mode 100644 index c2c8e8fc39..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndJointBilateralConstraint.h +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_JOINT_BILATERAL_CONSTRAINT_H__ -#define __ND_JOINT_BILATERAL_CONSTRAINT_H__ - -#include "ndCollisionStdafx.h" -#include "ndJointList.h" -#include "ndConstraint.h" -#include "ndBodyKinematic.h" - - -#define ND_BILATERAL_CONTRAINT_DOF 12 -#define ND_SPRING_DAMP_MIN_REG ndFloat32 (1.0e-3f) - -enum ndJointBilateralSolverModel -{ - m_jointIterativeSoft, - m_jointkinematicOpenLoop, - m_jointkinematicCloseLoop, - m_jointkinematicAttachment, - m_jointModesCount -}; - -#define D_ADD_IK_INTERFACE() \ -virtual void SetIkMode(bool mode) \ -{ \ - m_ikMode = mode; \ -} \ -virtual void SetIkSetAccel(const ndJacobian& body0Accel, const ndJacobian& body1Accel) \ -{ \ - m_accel0 = body0Accel; \ - m_accel1 = body1Accel; \ -} - -D_MSV_NEWTON_ALIGN_32 -class ndJointBilateralConstraint : public ndConstraint -{ - public: - D_BASE_CLASS_REFLECTION(ndJointBilateralConstraint); - - class ndIkInterface - { - public: - ndIkInterface() - :m_defualtRegularizer(ndFloat32 (1.0e-3f)) - ,m_ikMode(true) - {} - - ndJacobian m_accel0; - ndJacobian m_accel1; - ndFloat32 m_defualtRegularizer; - bool m_ikMode; - }; - - class ndKinematicState - { - public: - ndFloat32 m_posit; - ndFloat32 m_velocity; - }; - - D_COLLISION_API ndJointBilateralConstraint(); - D_COLLISION_API ndJointBilateralConstraint(ndInt32 maxDof, ndBodyKinematic* const body0, ndBodyKinematic* const body1, const ndMatrix& globalMatrix); - D_COLLISION_API ndJointBilateralConstraint(ndInt32 maxDof, ndBodyKinematic* const body0, ndBodyKinematic* const body1, const ndMatrix& globalMatrixBody0, const ndMatrix& globalMatrixBody1); - D_COLLISION_API virtual ~ndJointBilateralConstraint(); - - D_COLLISION_API virtual ndJointBilateralConstraint* GetAsBilateral(); - D_COLLISION_API virtual void JacobianDerivative(ndConstraintDescritor& desc); - D_COLLISION_API virtual ndJointBilateralSolverModel GetSolverModel() const; - D_COLLISION_API virtual void SetSolverModel(ndJointBilateralSolverModel model); - - D_COLLISION_API ndFloat32 CalculateAngle(const ndVector& planeDir, const ndVector& cosDir, const ndVector& sinDir) const; - D_COLLISION_API virtual void JointAccelerations(ndJointAccelerationDecriptor* const desc); - D_COLLISION_API void AddAngularRowJacobian(ndConstraintDescritor& desc, const ndVector& dir, ndFloat32 relAngle); - D_COLLISION_API void AddLinearRowJacobian(ndConstraintDescritor& desc, const ndVector& pivot0, const ndVector& pivot1, const ndVector& dir); - - D_COLLISION_API virtual void DebugJoint(ndConstraintDebugCallback& debugCallback) const; - D_COLLISION_API ndFloat32 CalculateSpringDamperAcceleration(ndFloat32 dt, ndFloat32 ks, ndFloat32 x, ndFloat32 kd, ndFloat32 v) const; - D_COLLISION_API void SetMassSpringDamperAcceleration(ndConstraintDescritor& desc, ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); - - D_COLLISION_API virtual ndInt32 GetKinematicState(ndKinematicState* const state) const; - - D_COLLISION_API const ndMatrix& GetLocalMatrix0() const; - D_COLLISION_API const ndMatrix& GetLocalMatrix1() const; - - D_COLLISION_API void SetLocalMatrix0(const ndMatrix& matrix); - D_COLLISION_API void SetLocalMatrix1(const ndMatrix& matrix); - D_COLLISION_API virtual ndMatrix CalculateGlobalMatrix0() const; - D_COLLISION_API virtual ndMatrix CalculateGlobalMatrix1() const; - - D_COLLISION_API virtual void CalculateGlobalMatrix(ndMatrix& matrix0, ndMatrix& matrix1) const; - D_COLLISION_API void CalculateLocalMatrix(const ndMatrix& pinsAndPivotFrame, ndMatrix& localMatrix0, ndMatrix& localMatrix1) const; - - D_COLLISION_API bool IsInWorld() const; - D_COLLISION_API bool IsSkeleton() const; - D_COLLISION_API bool IsBilateral() const; - D_COLLISION_API bool IsCollidable() const; - D_COLLISION_API bool GetSkeletonFlag() const; - D_COLLISION_API void SetCollidable(bool state); - D_COLLISION_API void SetSkeletonFlag(bool flag); - - D_COLLISION_API bool GetJointHitLimits() const; - - D_COLLISION_API void SetHighFriction(ndConstraintDescritor& desc, ndFloat32 friction); - D_COLLISION_API void SetLowerFriction(ndConstraintDescritor& desc, ndFloat32 friction); - D_COLLISION_API void SetJointErrorPosit(ndConstraintDescritor& desc, ndFloat32 errorPosit); - D_COLLISION_API void SetMotorAcceleration(ndConstraintDescritor& desc, ndFloat32 acceleration); - D_COLLISION_API void SetDiagonalRegularizer(ndConstraintDescritor& desc, ndFloat32 regularizer); - - D_COLLISION_API ndFloat32 GetJointErrorPosit(ndConstraintDescritor& desc) const; - D_COLLISION_API ndFloat32 GetJointErrorSpeed(ndConstraintDescritor& desc) const; - D_COLLISION_API ndFloat32 GetMotorAcceleration(ndConstraintDescritor& desc) const; - D_COLLISION_API ndFloat32 GetMotorZeroAcceleration(ndConstraintDescritor& desc) const; - D_COLLISION_API ndFloat32 GetDiagonalRegularizer(const ndConstraintDescritor& desc) const; - - D_COLLISION_API void ReplaceSentinel(ndBodyKinematic* const sentinel); - - protected: - // inverse dynamics interface - D_COLLISION_API virtual void ClearMemory(); - D_COLLISION_API virtual void SetIkMode(bool mode); - D_COLLISION_API virtual void SetIkSetAccel(const ndJacobian& body0Accel, const ndJacobian& body1Accel); - - ndMatrix m_localMatrix0; - ndMatrix m_localMatrix1; - - ndVector m_r0[ND_BILATERAL_CONTRAINT_DOF]; - ndVector m_r1[ND_BILATERAL_CONTRAINT_DOF]; - ndForceImpactPair m_jointForce[ND_BILATERAL_CONTRAINT_DOF]; - ndFloat32 m_motorAcceleration[ND_BILATERAL_CONTRAINT_DOF]; - ndJointList::ndNode* m_worldNode; - ndBodyKinematic::ndJointList::ndNode* m_body0Node; - ndBodyKinematic::ndJointList::ndNode* m_body1Node; - ndSpecialList::ndNode* m_deletedNode; - - ndFloat32 m_defualtDiagonalRegularizer; - ndUnsigned32 m_mark0 : 1; - ndUnsigned32 m_mark1 : 1; - ndUnsigned32 m_isInSkeleton : 1; - ndUnsigned32 m_enableCollision : 1; - ndInt8 m_rowIsMotor; - ndInt8 m_hitLimits; - ndJointBilateralSolverModel m_solverModel; - - friend class ndWorld; - friend class ndIkSolver; - friend class ndDynamicsUpdate; - friend class ndModelArticulation; - friend class ndSkeletonContainer; - friend class ndDynamicsUpdateSoa; - friend class ndDynamicsUpdateAvx2; - friend class ndDynamicsUpdateSycl; - friend class ndDynamicsUpdateCuda; -}; - - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndJointList.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndJointList.h deleted file mode 100644 index 583401c864..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndJointList.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_JOINT_LIST_H__ -#define __ND_JOINT_LIST_H__ - -#include "ndCoreStdafx.h" - -class ndJointBilateralConstraint; - -class ndJointList: public ndList, ndContainersFreeListAlloc*>> -{ - public: - ndJointList() - :ndList, ndContainersFreeListAlloc*>>() - { - } -}; - - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect.h deleted file mode 100644 index 43191f04b9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect.h +++ /dev/null @@ -1,870 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MESH_EFFECT_H__ -#define __ND_MESH_EFFECT_H__ - -#include "ndCollisionStdafx.h" - -#define DG_MESH_EFFECT_PRECISION_BITS 48 -#define DG_MESH_EFFECT_PRECISION_SCALE ndFloat64(ndInt64(1)< - { - public: - dgFitnessList (dMemoryAllocator___* const allocator); - dFloat64 TotalCost () const; - }; - - - dMeshBVH (const ndMeshEffect* const mesh); - virtual ~dMeshBVH(); - - virtual void Build (); - virtual void Cleanup (); - - void FaceRayCast (const dBigVector& l0, const dBigVector& l1, void* const userData) const; - void GetOverlapNodes (dList& overlapNodes, const dBigVector& p0, const dBigVector& p1) const; - - protected: - virtual dgMeshBVHNode* CreateLeafNode (dEdge* const face, void* const userData) = 0; - - dgMeshBVHNode* AddFaceNode (dEdge* const face, void* const userData); - void RemoveNode (dgMeshBVHNode* const treeNode); - void ImproveNodeFitness (); - void ImproveNodeFitness (dgMeshBVHNode* const node); - dFloat32 CalculateSurfaceArea (dgMeshBVHNode* const node0, dgMeshBVHNode* const node1, dVector& minBox, dVector& maxBox) const; - virtual bool SanityCheck() const; - - virtual dFloat64 RayFaceIntersect (const dgMeshBVHNode* const face, const dBigVector& p0, const dBigVector& p1, void* const userData) const; -// virtual dFloat64 VertexRayCast (const dBigVector& l0, const dBigVector& l1) const; -// virtual bool RayRayIntersect (dEdge* const edge, const ndMeshEffect* const otherMesh, dEdge* const otherEdge, dFloat64& param, dFloat64& otherParam) const; - - const ndMeshEffect* m_mesh; - dgMeshBVHNode* m_rootNode; - dgFitnessList m_fitness; - friend class ndMeshEffect; - }; - - - ndMeshEffect(dMemoryAllocator___* const allocator); - ndMeshEffect(dgCollisionInstance* const collision); - ndMeshEffect(const ndMeshEffect& source); - ndMeshEffect (dMemoryAllocator___* const allocator, dgDeserialize deserialization, void* const userData); - - // create from OFF or PLY file format - ndMeshEffect(dMemoryAllocator___* const allocator, const char* const fileName); - - // Create a convex hull Mesh form point cloud - ndMeshEffect (dMemoryAllocator___* const allocator, const dFloat64* const vertexCloud, dInt32 count, dInt32 strideInByte, dFloat64 distTol); - - // create a planar Mesh - ndMeshEffect(dMemoryAllocator___* const allocator, const dMatrix& planeMatrix, dFloat32 witdth, dFloat32 breadth, dInt32 material, const dMatrix& textureMatrix0, const dMatrix& textureMatrix1); - - void Trace () const; - void CylindricalMapping (dInt32 cylinderMaterial, dInt32 capMaterial, const dMatrix& uvAligment); - void AngleBaseFlatteningMapping (dInt32 cylinderMaterial, dgReportProgress progressReportCallback, void* const userData); - - ndMeshEffect* Union (const dMatrix& matrix, const ndMeshEffect* const clipper) const; - ndMeshEffect* Difference (const dMatrix& matrix, const ndMeshEffect* const clipper) const; - ndMeshEffect* Intersection (const dMatrix& matrix, const ndMeshEffect* const clipper) const; - void ClipMesh (const dMatrix& matrix, const ndMeshEffect* const clipper, ndMeshEffect** const top, ndMeshEffect** const bottom) const; - - //bool PlaneClip (const dBigPlane& plane); - - - - dInt32 GetVertexBaseCount() const; - void SetVertexBaseCount(dInt32 count); - - dEdge* SpliteFace (dInt32 v0, dInt32 v1); - - dInt32 GetTotalFaceCount() const; - dInt32 GetTotalIndexCount() const; - void GetFaces (dInt32* const faceCount, dInt32* const materials, void** const faceNodeList) const; - - void OptimizePoints(); - void OptimizeAttibutes(); - const dInt32* GetIndexToVertexMap() const; - - bool HasLayersChannel() const; - bool HasNormalChannel() const; - bool HasBinormalChannel() const; - bool HasUV0Channel() const; - bool HasUV1Channel() const; - bool HasVertexColorChannel() const; - - dgCollisionInstance* CreateCollisionTree(dgWorld* const world, dInt32 shapeID) const; - ndMeshEffect* CreateSimplification (dInt32 maxVertexCount, dgReportProgress reportProgressCallback, void* const userData) const; - ndMeshEffect* CreateConvexApproximation (dFloat32 maxConcavity, dFloat32 backFaceDistanceFactor, dInt32 maxHullOuputCount, dInt32 maxVertexPerHull, dgReportProgress reportProgressCallback, void* const userData) const; - - ndMeshEffect* CreateTetrahedraIsoSurface() const; - void CreateTetrahedraLinearBlendSkinWeightsChannel (const ndMeshEffect* const tetrahedraMesh); - - - static ndMeshEffect* CreateFromSerialization (dMemoryAllocator___* const allocator, dgDeserialize deserialization, void* const userData); - - void LoadOffMesh (const char* const filename); - void LoadTetraMesh (const char* const filename); - void Serialize (dgSerialize callback, void* const userData) const; - - dBigVector GetVertex (dInt32 index) const; - dInt32 GetVertexLayer (dInt32 index) const; - - void TransformMesh (const dMatrix& matrix); - - void* GetFirstVertex () const; - void* GetNextVertex (const void* const vertex) const; - dInt32 GetVertexIndex (const void* const vertex) const; - - void* GetFirstPoint () const; - void* GetNextPoint (const void* const point) const; - dInt32 GetPointIndex (const void* const point) const; - dInt32 GetVertexIndexFromPoint (const void* const point) const; - - void* GetFirstEdge () const; - void* GetNextEdge (const void* const edge) const; -// void* FindEdge (dInt32 v0, dInt32 v1) const; - void GetEdgeIndex (const void* const edge, dInt32& v0, dInt32& v1) const; -// void GetEdgeAttributeIndex (const void* edge, dInt32& v0, dInt32& v1) const; - - const dEdge* GetPolyhedraEdgeFromNode(const void* const edge) const; - - void* GetFirstFace () const; - void* GetNextFace (const void* const face) const; - dInt32 IsFaceOpen (const void* const face) const; - dInt32 GetFaceIndexCount (const void* const face) const; - void GetFaceIndex (const void* const face, dInt32* const indices) const; - void GetFaceAttributeIndex (const void* const face, dInt32* const indices) const; - dBigVector CalculateFaceNormal (const void* const face) const; - - void SetFaceMaterial (const void* const face, dInt32 materialID); - dInt32 InterpolateVertex (const dBigVector& point, const dEdge* const face) const; - - protected: - dBigVector GetOrigin ()const; - dInt32 CalculateMaxAttributes () const; -// void ReverseMergeFaces (ndMeshEffect* const source); - -#endif - - enum ndChannelType - { - m_vertex, - m_normal, - m_binormal, - m_uv0, - m_uv1, - m_color, - m_material, - m_layer, - m_point, - m_weight, - }; - - template - class ndChannel: public ndArray - { - public: - ndChannel(); - ndChannel(const ndChannel& source); - ~ndChannel(); - - void Clear(); - void PushBack(const T& element); - - ndChannelType m_type; - bool m_isValid; - }; - - public: - class ndUV - { - public: - ndUV() - { - } - - ndUV(ndFloat32 x, ndFloat32 y) - :m_u(ndReal(x)) - ,m_v(ndReal(y)) - { - } - ndReal m_u; - ndReal m_v; - }; - - class ndNormal - { - public: - ndNormal() - { - } - ndNormal(ndFloat32 x, ndFloat32 y, ndFloat32 z) - :m_x(ndReal(x)) - ,m_y(ndReal(y)) - ,m_z(ndReal(z)) - { - } - ndReal m_x; - ndReal m_y; - ndReal m_z; - }; - - class ndColor : public ndNormal - { - public: - ndColor() - :ndNormal() - { - } - - ndColor(ndFloat32 x, ndFloat32 y, ndFloat32 z, ndFloat32 w) - :ndNormal(x, y, z) - ,m_w(ndReal(w)) - { - } - - ndReal m_w; - }; - - class ndVertexWeight - { - public: - #define ND_VERTEX_WEIGHT_SIZE 4 - ndVertexWeight() - { - Clear(); - } - - void Clear() - { - for (ndInt32 i = 0; i < ND_VERTEX_WEIGHT_SIZE; ++i) - { - m_boneId[i] = -1; - m_weight[i] = ndReal(0.0f); - } - } - - void SetWeight(ndInt32 hash, ndReal weight) - { - ndAssert(weight > ndFloat32(0.0f)); - if (weight > ndFloat32(1.0e-3f)) - { - ndInt32 index = ND_VERTEX_WEIGHT_SIZE - 1; - ndReal lowest = m_weight[index]; - for (ndInt32 i = index - 1; i >= 0; --i) - { - if (m_weight[i] <= lowest) - { - index = i; - lowest = m_weight[i]; - } - } - if (weight > lowest) - { - m_boneId[index] = hash; - m_weight[index] = weight; - } - } - } - - ndReal m_weight[ND_VERTEX_WEIGHT_SIZE]; - ndInt32 m_boneId[ND_VERTEX_WEIGHT_SIZE]; - }; - - class ndFormat - { - public: - class ndSortCluster; - - class ndSortKey - { - public: - ndInt32 m_mask; - ndInt32 m_ordinal; - ndInt32 m_vertexIndex; - ndInt32 m_attibuteIndex; - }; - - class ndVertexSortData - { - public: - const ndChannel* m_points; - ndInt32 m_vertexSortIndex; - }; - - static ndInt32 CompareVertex(const ndSortKey* const ptr0, const ndSortKey* const ptr1, void* const context); - }; - - class ndPointFormat: public ndFormat - { - public: - ndPointFormat(); - ndPointFormat(const ndPointFormat& source); - ~ndPointFormat(); - - void Clear(); - void SetCount(ndInt32 count); - void CompactVertexData(ndInt32* const indexList, ndFloat32 tol); - - private: - void CompressData(ndPointFormat& output, ndInt32* const indexList, ndSortKey* const remapIndex, const ndSortCluster& batch, ndFloat32 tol); - - public: - ndChannel m_layers; - ndChannel m_vertex; - ndChannel m_skinWeights; - }; - - class ndAttibutFormat: public ndFormat - { - public: - ndAttibutFormat(); - ndAttibutFormat(const ndAttibutFormat& source); - ~ndAttibutFormat(); - - void Clear(); - ndInt32 GetCount() const; - void SetCount(ndInt32 count); - - //void CopyFrom(const ndAttibutFormat& source); - //void CopyEntryFrom(ndInt32 index, const ndAttibutFormat& source, ndInt32 sourceIndex); - void CompactVertexData(const ndPointFormat& points, ndInt32* const indexList, ndFloat32 tol); - - private: - void CompressData(ndAttibutFormat& output, const ndPointFormat& points, ndInt32* const indexList, ndSortKey* const remapIndex, const ndSortCluster& batch, ndFloat32 tol); - - public: - ndChannel m_pointChannel; - ndChannel m_materialChannel; - ndChannel m_normalChannel; - ndChannel m_binormalChannel; - ndChannel m_colorChannel; - ndChannel m_uv0Channel; - ndChannel m_uv1Channel; - }; - - class ndMaterial - { - public: - ndMaterial() - :m_ambient(ndFloat32(0.8f), ndFloat32(0.8f), ndFloat32(0.8f), ndFloat32(1.0f)) - ,m_diffuse(ndFloat32(0.8f), ndFloat32(0.8f), ndFloat32(0.8f), ndFloat32(1.0f)) - ,m_specular(ndFloat32(1.0f), ndFloat32(1.0f), ndFloat32(1.0f), ndFloat32(1.0f)) - ,m_opacity(ndFloat32(1.0f)) - ,m_shiness(ndFloat32 (60.0f)) - { - strcpy_s(m_textureName, sizeof(m_textureName), "default.png"); - } - - ndVector m_ambient; - ndVector m_diffuse; - ndVector m_specular; - ndFloat32 m_opacity; - ndFloat32 m_shiness; - char m_textureName[32]; - }; - - class ndMeshVertexFormat - { - public: - template - class ndData - { - public: - ndData() - { - Clear(); - } - - void Clear() - { - m_data = nullptr; - m_indexList = nullptr; - m_strideInBytes = 0; - } - - T* m_data; - ndInt32* m_indexList; - ndInt32 m_strideInBytes; - }; - - ndMeshVertexFormat() - { - Clear(); - } - - void Clear() - { - m_faceCount = 0; - m_faceMaterial = nullptr; - m_faceIndexCount = nullptr; - - m_uv0.Clear(); - m_uv1.Clear(); - m_vertex.Clear(); - m_normal.Clear(); - m_binormal.Clear(); - m_vertexColor.Clear(); - m_vertexWeight.Clear(); - } - - ndInt32 m_faceCount; - ndInt32* m_faceMaterial; - ndInt32* m_faceIndexCount; - ndData m_vertex; - ndData m_normal; - ndData m_binormal; - ndData m_uv0; - ndData m_uv1; - ndData m_vertexColor; - ndData m_vertexWeight; - }; - - D_COLLISION_API ndMeshEffect(); - D_COLLISION_API ndMeshEffect(const ndMeshEffect& source); - D_COLLISION_API ndMeshEffect(const ndShapeInstance& shapeInstance); - D_COLLISION_API ndMeshEffect(ndPolyhedra& mesh, const ndMeshEffect& source); - - // Create a convex hull Mesh from point cloud - D_COLLISION_API ndMeshEffect(const ndFloat64* const vertexCloud, ndInt32 count, ndInt32 strideInByte, ndFloat64 distTol); - - D_COLLISION_API virtual ~ndMeshEffect(); - - D_COLLISION_API void SetName (const ndString& name); - D_COLLISION_API const ndString& GetName() const; - - D_COLLISION_API ndArray& GetMaterials(); - D_COLLISION_API ndInt32 GetPropertiesCount() const; - - D_COLLISION_API ndInt32 GetVertexCount() const; - D_COLLISION_API ndInt32 GetVertexStrideInByte() const; - D_COLLISION_API const ndFloat64* GetVertexPool() const; - - D_COLLISION_API ndInt32 GetFaceMaterial(ndEdge* const faceEdge) const; - D_COLLISION_API ndInt32 GenerateVertexFormat(ndMeshVertexFormat& format, ndArray& buffer) const; - - D_COLLISION_API ndArray& GetVertexWeights(); - D_COLLISION_API ndFloat64 CalculateVolume() const; - D_COLLISION_API ndMatrix CalculateOOBB(ndBigVector& size) const; - D_COLLISION_API void CalculateAABB(ndBigVector& min, ndBigVector& max) const; - - D_COLLISION_API void ApplyTransform(const ndMatrix& matrix); - D_COLLISION_API void CalculateNormals(ndFloat64 angleInRadians); - D_COLLISION_API void BuildFromIndexList(const ndMeshVertexFormat* const format); - - D_COLLISION_API void GetVertexIndexChannel(ndInt32* const bufferOut) const; - D_COLLISION_API void GetVertexChannel64(ndInt32 strideInByte, ndFloat64* const bufferOut) const; - D_COLLISION_API void GetVertexChannel(ndInt32 strideInByte, ndFloat32* const bufferOut) const; - D_COLLISION_API void GetNormalChannel(ndInt32 strideInByte, ndFloat32* const bufferOut) const; - D_COLLISION_API void GetBinormalChannel(ndInt32 strideInByte, ndFloat32* const bufferOut) const; - D_COLLISION_API void GetUV0Channel(ndInt32 strideInByte, ndFloat32* const bufferOut) const; - D_COLLISION_API void GetUV1Channel(ndInt32 strideInByte, ndFloat32* const bufferOut) const; - D_COLLISION_API void GetVertexColorChannel(ndInt32 strideInByte, ndFloat32* const bufferOut) const; - D_COLLISION_API void GetVertexWeightChannel(ndInt32 strideInByte, ndVertexWeight* const bufferOut) const; - - D_COLLISION_API ndIndexArray* MaterialGeometryBegin(); - D_COLLISION_API ndInt32 GetFirstMaterial(ndIndexArray* const handle) const; - D_COLLISION_API ndInt32 GetNextMaterial(ndIndexArray* const handle, ndInt32 materialHandle) const; - D_COLLISION_API ndInt32 GetMaterialID(ndIndexArray* const handle, ndInt32 materialHandle) const; - D_COLLISION_API ndInt32 GetMaterialIndexCount(ndIndexArray* const handle, ndInt32 materialHandle) const; - D_COLLISION_API void GetMaterialGetIndexStream(ndIndexArray* const handle, ndInt32 materialHandle, ndInt32* const index) const; - D_COLLISION_API void GetMaterialGetIndexStream(ndIndexArray* const handle, ndInt32 materialHandle, ndInt16* const index) const; - D_COLLISION_API void MaterialGeometryEnd(ndIndexArray* const handle); - - D_COLLISION_API void BeginBuild(); - D_COLLISION_API void BeginBuildFace(); - D_COLLISION_API void AddPoint(ndFloat64 x, ndFloat64 y, ndFloat64 z); - D_COLLISION_API void AddLayer(ndInt32 layer); - D_COLLISION_API void AddMaterial(ndInt32 materialIndex); - D_COLLISION_API void AddNormal(ndFloat32 x, ndFloat32 y, ndFloat32 z); - D_COLLISION_API void AddBinormal(ndFloat32 x, ndFloat32 y, ndFloat32 z); - D_COLLISION_API void AddVertexColor(ndFloat32 x, ndFloat32 y, ndFloat32 z, ndFloat32 w); - D_COLLISION_API void AddUV0(ndFloat32 u, ndFloat32 v); - D_COLLISION_API void AddUV1(ndFloat32 u, ndFloat32 v); - D_COLLISION_API void EndBuildFace(); - D_COLLISION_API void EndBuild(bool fixTjoint = true); - - D_COLLISION_API ndBigVector GetOrigin()const; - D_COLLISION_API void SphericalMapping(ndInt32 materialIndex, const ndMatrix& textureMatrix); - D_COLLISION_API void UniformBoxMapping(ndInt32 materialIndex, const ndMatrix& textureMatrix); - D_COLLISION_API void BoxMapping(ndInt32 front, ndInt32 side, ndInt32 top, const ndMatrix& textureMatrix); - D_COLLISION_API void RepairTJoints(); - - D_COLLISION_API ndMeshEffect* GetFirstLayer(); - D_COLLISION_API ndMeshEffect* GetNextLayer(ndMeshEffect* const layer); - - D_COLLISION_API void FlipWinding(); - D_COLLISION_API bool HasOpenEdges() const; - D_COLLISION_API void Triangulate(); - D_COLLISION_API void ConvertToPolygons(); - D_COLLISION_API ndEdge* InsertEdgeVertex(ndEdge* const edge, ndFloat64 param); - D_COLLISION_API void AddInterpolatedEdgeAttribute(ndEdge* const edge, ndFloat64 param); - D_COLLISION_API void RemoveUnusedVertices(ndInt32* const vertexRemapTable); - D_COLLISION_API ndInt32 PlaneClip(const ndMeshEffect& convexMesh, const ndEdge* const face); - D_COLLISION_API ndShapeInstance* CreateConvexCollision(ndFloat64 tolerance) const; - D_COLLISION_API ndMeshEffect* ConvexMeshIntersection(const ndMeshEffect* const convexMesh) const; - D_COLLISION_API ndMeshEffect* InverseConvexMeshIntersection(const ndMeshEffect* const convexMesh) const; - D_COLLISION_API ndMeshEffect* CreateVoronoiConvexDecomposition(const ndArray& pointCloud, ndInt32 interiorMaterialIndex, const ndMatrix& textureProjectionMatrix); - - protected: - D_COLLISION_API void Init(); - D_COLLISION_API virtual void BeginFace(); - D_COLLISION_API virtual bool EndFace(); - ndFloat64 QuantizeCordinade(ndFloat64 val) const; - - bool Sanity() const; - void PackPoints(); - void UnpackPoints(); - void PackAttibuteData(); - void UnpackAttibuteData(); - bool SeparateDuplicateLoops(ndEdge* const face); - ndInt32 AddInterpolatedHalfAttribute(ndEdge* const edge, ndInt32 midPoint); - - void MergeFaces(const ndMeshEffect* const source); - D_COLLISION_API ndMeshEffect* GetNextLayer(ndInt32 mark); - - ndString m_name; - ndPointFormat m_points; - ndAttibutFormat m_attrib; - ndArray m_materials; - ndInt32 m_vertexBaseCount; - ndInt32 m_constructionIndex; -}; - -#if 0 - -inline dInt32 ndMeshEffect::GetVertexBaseCount() const -{ - return m_vertexBaseCount; -} - -inline void ndMeshEffect::SetVertexBaseCount(dInt32 count) -{ - m_vertexBaseCount = count; -} - - -inline const dInt32* ndMeshEffect::GetIndexToVertexMap() const -{ - return &m_attrib.m_pointChannel[0]; -} - -inline dBigVector ndMeshEffect::GetVertex (dInt32 index) const -{ - dAssert(index >= 0); - dAssert(index < m_points.m_vertex.m_count); - return m_points.m_vertex[index]; -} - -inline bool ndMeshEffect::HasLayersChannel() const -{ - return m_points.m_layers.m_count != 0; -} - -inline dInt32 ndMeshEffect::GetVertexLayer(dInt32 index) const -{ - dAssert(index >= 0); - dAssert(index < m_points.m_vertex.m_count); - return (m_points.m_layers.m_count) ? m_points.m_layers[index] : 0; -} -#endif - -inline ndFloat64 ndMeshEffect::QuantizeCordinade(ndFloat64 x) const -{ - ndInt32 exp; - ndFloat64 mantissa = frexp(x, &exp); - mantissa = DG_MESH_EFFECT_PRECISION_SCALE_INV * floor (mantissa * DG_MESH_EFFECT_PRECISION_SCALE); - - ndFloat64 x1 = ldexp(mantissa, exp); - return x1; -} - -template -ndMeshEffect::ndChannel::ndChannel() - :ndArray() - ,m_type(type) - ,m_isValid(false) -{ -} - -template -ndMeshEffect::ndChannel::ndChannel(const ndChannel& source) - :ndArray(source) - ,m_type(source.m_type) - ,m_isValid(source.m_isValid) -{ -} - -template -ndMeshEffect::ndChannel::~ndChannel() -{ -} - -template -void ndMeshEffect::ndChannel::Clear() -{ - m_isValid = false; - ndArray::SetCount(0); -} - -template -void ndMeshEffect::ndChannel::PushBack(const T& element) -{ - T tmp(element); - m_isValid = true; - ndArray::PushBack(tmp); -} - -inline ndMeshEffect::ndPointFormat::ndPointFormat() - :m_layers() - ,m_vertex() - ,m_skinWeights() -{ -} - -inline ndMeshEffect::ndPointFormat::ndPointFormat(const ndPointFormat& source) - :m_layers(source.m_layers) - ,m_vertex(source.m_vertex) - ,m_skinWeights(source.m_skinWeights) -{ -} - -inline ndMeshEffect::ndPointFormat::~ndPointFormat() -{ -} - -inline void ndMeshEffect::ndPointFormat::Clear() -{ - m_layers.Clear(); - m_vertex.Clear(); - m_skinWeights.Clear(); -} - -inline void ndMeshEffect::ndPointFormat::SetCount(ndInt32 count) -{ - m_vertex.Resize(count); - m_vertex.SetCount(count); - - if (m_layers.GetCount()) - { - m_layers.Resize(count); - m_layers.SetCount(count); - } - - if (m_skinWeights.GetCount()) - { - m_skinWeights.Resize(count); - m_skinWeights.SetCount(count); - } -} - -inline ndMeshEffect::ndAttibutFormat::ndAttibutFormat() - :m_pointChannel() - ,m_materialChannel() - ,m_normalChannel() - ,m_binormalChannel() - ,m_colorChannel() - ,m_uv0Channel() - ,m_uv1Channel() -{ -} - -inline ndMeshEffect::ndAttibutFormat::ndAttibutFormat(const ndAttibutFormat& source) - :m_pointChannel(source.m_pointChannel) - ,m_materialChannel(source.m_materialChannel) - ,m_normalChannel(source.m_normalChannel) - ,m_binormalChannel(source.m_binormalChannel) - ,m_colorChannel(source.m_colorChannel) - ,m_uv0Channel(source.m_uv0Channel) - ,m_uv1Channel(source.m_uv1Channel) -{ -} - -inline ndMeshEffect::ndAttibutFormat::~ndAttibutFormat() -{ -} - -inline void ndMeshEffect::ndAttibutFormat::Clear() -{ - m_pointChannel.Clear(); - m_materialChannel.Clear(); - m_normalChannel.Clear(); - m_binormalChannel.Clear(); - m_colorChannel.Clear(); - m_uv0Channel.Clear(); - m_uv1Channel.Clear(); -} - -inline void ndMeshEffect::ndAttibutFormat::SetCount(ndInt32 count) -{ - if (m_pointChannel.GetCount()) - { - m_pointChannel.Resize(count); - m_pointChannel.SetCount(count); - } - - if (m_materialChannel.GetCount()) - { - m_materialChannel.Resize(count); - m_materialChannel.SetCount(count); - } - - if (m_normalChannel.GetCount()) - { - m_normalChannel.Resize(count); - m_normalChannel.SetCount(count); - } - - if (m_binormalChannel.GetCount()) - { - m_binormalChannel.Resize(count); - m_binormalChannel.SetCount(count); - } - - if (m_colorChannel.GetCount()) - { - m_colorChannel.Resize(count); - m_colorChannel.SetCount(count); - } - - if (m_uv0Channel.GetCount()) - { - m_uv0Channel.Resize(count); - m_uv0Channel.SetCount(count); - } - - if (m_uv1Channel.GetCount()) - { - m_uv1Channel.Resize(count); - m_uv1Channel.SetCount(count); - } -} - -inline ndInt32 ndMeshEffect::ndAttibutFormat::GetCount() const -{ - return ndInt32(m_pointChannel.GetCount()); -} - -inline ndInt32 ndMeshEffect::GetPropertiesCount() const -{ - return ndInt32(m_attrib.m_pointChannel.GetCount()); -} - -inline void ndMeshEffect::SetName(const ndString& name) -{ - m_name = name; -} - -inline const ndString& ndMeshEffect::GetName() const -{ - return m_name; -} - -inline ndArray& ndMeshEffect::GetMaterials() -{ - return m_materials; -} - -inline ndInt32 ndMeshEffect::GetVertexCount() const -{ - return ndInt32(m_points.m_vertex.GetCount()); -} - -inline ndInt32 ndMeshEffect::GetVertexStrideInByte() const -{ - return sizeof(ndBigVector); -} - -inline const ndFloat64* ndMeshEffect::GetVertexPool() const -{ - return &m_points.m_vertex[0].m_x; -} - -inline ndInt32 ndMeshEffect::GetFaceMaterial(ndEdge* const faceEdge) const -{ - return ndInt32(m_attrib.m_materialChannel.GetCount() ? m_attrib.m_materialChannel[ndInt32(faceEdge->m_userData)] : 0); -} - -inline ndMeshEffect* ndMeshEffect::GetFirstLayer() -{ - return GetNextLayer(IncLRU()); -} - -inline ndMeshEffect* ndMeshEffect::GetNextLayer(ndMeshEffect* const layerSegment) -{ - if (!layerSegment) - { - return nullptr; - } - return GetNextLayer(layerSegment->IncLRU() - 1); -} - -inline ndArray& ndMeshEffect::GetVertexWeights() -{ - return m_points.m_skinWeights; -} -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect1.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect1.cpp deleted file mode 100644 index c54d574e08..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect1.cpp +++ /dev/null @@ -1,4893 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndSort.h" -#include "ndStack.h" -#include "ndVector.h" -#include "ndMatrix.h" -#include "ndShape.h" -#include "ndMeshEffect.h" -#include "ndShapeInstance.h" -#include "ndShapeCompound.h" -#include "ndShapeConvexHull.h" - -#define D_VERTEXLIST_INDEX_LIST_BASH (1024) - -#if 0 -void ndMeshEffect::dAttibutFormat::CopyFrom(const dAttibutFormat& source) -{ - m_pointChannel.CopyFrom(source.m_pointChannel); - m_materialChannel.CopyFrom(source.m_materialChannel); - m_normalChannel.CopyFrom(source.m_normalChannel); - m_binormalChannel.CopyFrom(source.m_binormalChannel); - m_colorChannel.CopyFrom(source.m_colorChannel); - m_uv0Channel.CopyFrom(source.m_uv0Channel); - m_uv1Channel.CopyFrom(source.m_uv1Channel); -} - - -ndMeshEffect::dMeshBVH::dgFitnessList::dgFitnessList(dgMemoryAllocator* const allocator) - :dTree (allocator) -{ -} - -dFloat64 ndMeshEffect::dMeshBVH::dgFitnessList::TotalCost() const -{ - dFloat64 cost = dFloat32(0.0f); - Iterator iter(*this); - for (iter.Begin(); iter; iter++) { - dNode* const node = iter.GetNode(); - dgMeshBVHNode* const box = node->GetInfo(); - cost += box->m_area; - } - return cost; -} - - -ndMeshEffect::dMeshBVH::dgMeshBVHNode::dgMeshBVHNode(const ndMeshEffect* const mesh, dEdge* const face, void* const userData) - :m_area(dFloat32(0.0f)) - , m_face(face) - , m_userData(userData) - , m_left(nullptr) - , m_right(nullptr) - , m_parent(nullptr) -{ - dBigVector p0(dFloat32(1.0e30f)); - dBigVector p1(dFloat32(-1.0e30f)); - - const dBigVector* const points = (dBigVector*)mesh->GetVertexPool(); - - dEdge* ptr = m_face; - do { - dInt32 i = ptr->m_incidentVertex; - const dBigVector& p = points[i]; - p0 = p.GetMin(p0); - p1 = p.GetMax(p1); - - ptr = ptr->m_next; - } while (ptr != face); - - dVector padding(dFloat32(1.0f / 32.0f)); - SetBox(p0 - padding, p1 + padding); -} - -ndMeshEffect::dMeshBVH::dgMeshBVHNode::dgMeshBVHNode(dgMeshBVHNode* const left, dgMeshBVHNode* const right) - :m_area(dFloat32(0.0f)) - , m_face(nullptr) - , m_userData(nullptr) - , m_left(left) - , m_right(right) - , m_parent(nullptr) -{ - m_left->m_parent = this; - m_right->m_parent = this; - - // dVector p0 (ndMin (left->m_p0.m_x, right->m_p0.m_x), ndMin (left->m_p0.m_y, right->m_p0.m_y), ndMin (left->m_p0.m_z, right->m_p0.m_z), dFloat32 (0.0f)); - // dVector p1 (ndMax (left->m_p1.m_x, right->m_p1.m_x), ndMax (left->m_p1.m_y, right->m_p1.m_y), ndMax (left->m_p1.m_z, right->m_p1.m_z), dFloat32 (0.0f)); - dVector p0(left->m_p0.GetMin(right->m_p0)); - dVector p1(left->m_p1.GetMax(right->m_p1)); - SetBox(p0, p1); -} - - -ndMeshEffect::dMeshBVH::dgMeshBVHNode::~dgMeshBVHNode() -{ - if (m_left) { - delete m_left; - } - if (m_right) { - delete m_right; - } -} - -void ndMeshEffect::dMeshBVH::dgMeshBVHNode::SetBox(const dVector& p0, const dVector& p1) -{ - m_p0 = p0 & dVector::m_triplexMask; - m_p1 = p1 & dVector::m_triplexMask; - dVector size(dVector::m_half * (m_p1 - m_p0)); - dVector size1(size.ShiftTripleLeft()); - dAssert(size1.m_w == dFloat32(0.0f)); - m_area = size.DotProduct(size1).GetScalar(); -} - -ndMeshEffect::dMeshBVH::dMeshBVH(const ndMeshEffect* const mesh) - :m_mesh(mesh) - , m_rootNode(nullptr) - , m_fitness(m_mesh->GetAllocator()) -{ -} - - -ndMeshEffect::dMeshBVH::~dMeshBVH() -{ - Cleanup(); -} - -ndMeshEffect* ndMeshEffect::CreateFromSerialization(dgMemoryAllocator* const allocator, dgDeserialize deserialization, void* const userData) -{ - return new (allocator) ndMeshEffect(allocator, deserialization, userData); -} - -void ndMeshEffect::Serialize(dgSerialize callback, void* const userData) const -{ - dAssert(0); - /* - dInt32 faceCount = 0; - dTreefilter(GetAllocator()); - Iterator iter (*this); - for (iter.Begin(); iter; iter ++) { - dEdge* const face = &iter.GetNode()->GetInfo(); - if (!filter.Find(face) && (face->m_incidentFace > 0)) { - faceCount ++; - dEdge* edge = face; - do { - filter.Insert(edge, edge); - edge = edge->m_next; - } while (edge != face); - } - } - - callback (userData, &faceCount, sizeof (dInt32)); - callback (userData, &m_pointCount, sizeof (dInt32)); - callback (userData, &m_atribCount, sizeof (dInt32)); - callback (userData, &m_atribCount, sizeof (dInt32)); - - callback (userData, m_points, m_pointCount * sizeof (dBigVector)); - callback (userData, m_attrib, m_atribCount * sizeof (dgVertexAtribute)); - - filter.RemoveAll(); - for (iter.Begin(); iter; iter ++) { - dEdge* const face = &iter.GetNode()->GetInfo(); - if (!filter.Find(face) && (face->m_incidentFace > 0)) { - dInt32 indices[1024]; - ndInt64 attibuteIndex[1024]; - dInt32 vertexCount = 0; - dEdge* edge = face; - do { - indices[vertexCount] = edge->m_incidentVertex; - attibuteIndex[vertexCount] = edge->m_userData; - vertexCount ++; - filter.Insert(edge, edge); - edge = edge->m_next; - } while (edge != face); - - callback (userData, &vertexCount, sizeof (dInt32)); - callback (userData, indices, vertexCount * sizeof (dInt32)); - callback (userData, attibuteIndex, vertexCount * sizeof (ndInt64)); - } - } - */ -} - -void ndMeshEffect::dMeshBVH::Build() -{ - dInt32 lru = m_mesh->IncLRU(); - /* - for (void* faceNode = m_mesh->GetFirstFace (); faceNode; faceNode = m_mesh->GetNextFace(faceNode)) { - if (!m_mesh->IsFaceOpen(faceNode)) { - dEdge* const face = &((dNode*)faceNode)->GetInfo(); - if (face->m_mark != mark) { - AddFaceNode(face, nullptr); - } - } - } - */ - ndMeshEffect::Iterator iter(*m_mesh); - for (iter.Begin(); iter; iter++) { - dEdge* const face = &iter.GetNode()->GetInfo(); - if (face->m_mark != lru) { - AddFaceNode(face, nullptr); - } - } - ImproveNodeFitness(); -} - -void ndMeshEffect::dMeshBVH::Cleanup() -{ - if (m_rootNode) { - delete m_rootNode; - } -} - -dFloat32 ndMeshEffect::dMeshBVH::CalculateSurfaceArea(dgMeshBVHNode* const node0, dgMeshBVHNode* const node1, dVector& minBox, dVector& maxBox) const -{ - minBox = dVector(dMin(node0->m_p0.m_x, node1->m_p0.m_x), dMin(node0->m_p0.m_y, node1->m_p0.m_y), dMin(node0->m_p0.m_z, node1->m_p0.m_z), dFloat32(0.0f)); - maxBox = dVector(dMax(node0->m_p1.m_x, node1->m_p1.m_x), dMax(node0->m_p1.m_y, node1->m_p1.m_y), dMax(node0->m_p1.m_z, node1->m_p1.m_z), dFloat32(0.0f)); - dVector side0((maxBox - minBox) * dVector::m_half); - dVector side1(side0.ShiftTripleLeft()); - dAssert(side1.m_w == dFloat32(0.0f)); - return side0.DotProduct(side1).GetScalar(); -} - -void ndMeshEffect::dMeshBVH::ImproveNodeFitness(dgMeshBVHNode* const node) -{ - dAssert(node->m_left); - dAssert(node->m_right); - - if (node->m_parent) { - if (node->m_parent->m_left == node) { - dFloat32 cost0 = node->m_area; - - dVector cost1P0; - dVector cost1P1; - dFloat32 cost1 = CalculateSurfaceArea(node->m_right, node->m_parent->m_right, cost1P0, cost1P1); - - dVector cost2P0; - dVector cost2P1; - dFloat32 cost2 = CalculateSurfaceArea(node->m_left, node->m_parent->m_right, cost2P0, cost2P1); - - if ((cost1 <= cost0) && (cost1 <= cost2)) { - dgMeshBVHNode* const parent = node->m_parent; - node->m_p0 = parent->m_p0; - node->m_p1 = parent->m_p1; - node->m_area = parent->m_area; - - if (parent->m_parent) { - if (parent->m_parent->m_left == parent) { - parent->m_parent->m_left = node; - } - else { - dAssert(parent->m_parent->m_right == parent); - parent->m_parent->m_right = node; - } - } - else { - m_rootNode = node; - } - node->m_parent = parent->m_parent; - parent->m_parent = node; - node->m_right->m_parent = parent; - parent->m_left = node->m_right; - node->m_right = parent; - parent->m_p0 = cost1P0; - parent->m_p1 = cost1P1; - parent->m_area = cost1; - - - } - else if ((cost2 <= cost0) && (cost2 <= cost1)) { - dgMeshBVHNode* const parent = node->m_parent; - node->m_p0 = parent->m_p0; - node->m_p1 = parent->m_p1; - node->m_area = parent->m_area; - - if (parent->m_parent) { - if (parent->m_parent->m_left == parent) { - parent->m_parent->m_left = node; - } - else { - dAssert(parent->m_parent->m_right == parent); - parent->m_parent->m_right = node; - } - } - else { - m_rootNode = node; - } - node->m_parent = parent->m_parent; - parent->m_parent = node; - node->m_left->m_parent = parent; - parent->m_left = node->m_left; - node->m_left = parent; - - parent->m_p0 = cost2P0; - parent->m_p1 = cost2P1; - parent->m_area = cost2; - } - } - else { - dFloat32 cost0 = node->m_area; - - dVector cost1P0; - dVector cost1P1; - dFloat32 cost1 = CalculateSurfaceArea(node->m_left, node->m_parent->m_left, cost1P0, cost1P1); - - dVector cost2P0; - dVector cost2P1; - dFloat32 cost2 = CalculateSurfaceArea(node->m_right, node->m_parent->m_left, cost2P0, cost2P1); - - if ((cost1 <= cost0) && (cost1 <= cost2)) { - dgMeshBVHNode* const parent = node->m_parent; - node->m_p0 = parent->m_p0; - node->m_p1 = parent->m_p1; - node->m_area = parent->m_area; - - if (parent->m_parent) { - if (parent->m_parent->m_left == parent) { - parent->m_parent->m_left = node; - } - else { - dAssert(parent->m_parent->m_right == parent); - parent->m_parent->m_right = node; - } - } - else { - m_rootNode = node; - } - node->m_parent = parent->m_parent; - parent->m_parent = node; - node->m_left->m_parent = parent; - parent->m_right = node->m_left; - node->m_left = parent; - - parent->m_p0 = cost1P0; - parent->m_p1 = cost1P1; - parent->m_area = cost1; - - } - else if ((cost2 <= cost0) && (cost2 <= cost1)) { - dgMeshBVHNode* const parent = node->m_parent; - node->m_p0 = parent->m_p0; - node->m_p1 = parent->m_p1; - node->m_area = parent->m_area; - - if (parent->m_parent) { - if (parent->m_parent->m_left == parent) { - parent->m_parent->m_left = node; - } - else { - dAssert(parent->m_parent->m_right == parent); - parent->m_parent->m_right = node; - } - } - else { - m_rootNode = node; - } - node->m_parent = parent->m_parent; - parent->m_parent = node; - node->m_right->m_parent = parent; - parent->m_right = node->m_right; - node->m_right = parent; - - parent->m_p0 = cost2P0; - parent->m_p1 = cost2P1; - parent->m_area = cost2; - } - } - } - // dAssert (SanityCheck()); -} - - -void ndMeshEffect::dMeshBVH::ImproveNodeFitness() -{ - dFloat64 cost0 = m_fitness.TotalCost(); - dFloat64 cost1 = cost0; - do { - cost0 = cost1; - dgFitnessList::Iterator iter(m_fitness); - for (iter.Begin(); iter; iter++) { - dgFitnessList::dNode* const node = iter.GetNode(); - ImproveNodeFitness(node->GetInfo()); - } - cost1 = m_fitness.TotalCost(); - } while (cost1 < (dFloat32(0.95f)) * cost0); -} - -/* -ndMeshEffect::dMeshBVH::dgMeshBVHNode* ndMeshEffect::dMeshBVH::CreateLeafNode (dEdge* const face, void* const userData) -{ - dgMemoryAllocator* const allocator = m_mesh->GetAllocator(); - return new (allocator) dgMeshBVHNode (m_mesh, face, userData); -} -*/ - -ndMeshEffect::dMeshBVH::dgMeshBVHNode* ndMeshEffect::dMeshBVH::AddFaceNode(dEdge* const face, void* const userData) -{ - dgMemoryAllocator* const allocator = m_mesh->GetAllocator(); - - dgMeshBVHNode* const newNode = CreateLeafNode(face, userData); - if (!m_rootNode) { - m_rootNode = newNode; - } - else { - - dVector p0; - dVector p1; - dgMeshBVHNode* sibling = m_rootNode; - - dFloat32 surfaceArea = dMeshBVH::CalculateSurfaceArea(newNode, sibling, p0, p1); - while (sibling->m_left && sibling->m_right) { - - if (surfaceArea > sibling->m_area) { - break; - } - - sibling->SetBox(p0, p1); - - dVector leftP0; - dVector leftP1; - dFloat32 leftSurfaceArea = CalculateSurfaceArea(newNode, sibling->m_left, leftP0, leftP1); - - dVector rightP0; - dVector rightP1; - dFloat32 rightSurfaceArea = CalculateSurfaceArea(newNode, sibling->m_right, rightP0, rightP1); - - if (leftSurfaceArea < rightSurfaceArea) { - sibling = sibling->m_left; - p0 = leftP0; - p1 = leftP1; - surfaceArea = leftSurfaceArea; - } - else { - sibling = sibling->m_right; - p0 = rightP0; - p1 = rightP1; - surfaceArea = rightSurfaceArea; - } - } - - if (!sibling->m_parent) { - m_rootNode = new (allocator) dgMeshBVHNode(sibling, newNode); - m_fitness.Insert(m_rootNode, m_rootNode); - } - else { - dgMeshBVHNode* const parent = sibling->m_parent; - if (parent->m_left == sibling) { - dgMeshBVHNode* const node = new (allocator) dgMeshBVHNode(sibling, newNode); - m_fitness.Insert(node, node); - parent->m_left = node; - node->m_parent = parent; - } - else { - dAssert(parent->m_right == sibling); - dgMeshBVHNode* const node = new (allocator) dgMeshBVHNode(sibling, newNode); - m_fitness.Insert(node, node); - parent->m_right = node; - node->m_parent = parent; - } - } - } - - return newNode; -} - - -void ndMeshEffect::dMeshBVH::RemoveNode(dgMeshBVHNode* const treeNode) -{ - if (!treeNode->m_parent) { - delete (m_rootNode); - m_rootNode = nullptr; - } - else if (!treeNode->m_parent->m_parent) { - dgMeshBVHNode* const root = m_rootNode; - if (treeNode->m_parent->m_left == treeNode) { - m_rootNode = treeNode->m_parent->m_right; - treeNode->m_parent->m_right = nullptr; - } - else { - dAssert(treeNode->m_parent->m_right == treeNode); - m_rootNode = treeNode->m_parent->m_left; - treeNode->m_parent->m_left = nullptr; - } - m_rootNode->m_parent = nullptr; - dAssert(m_fitness.Find(root)); - m_fitness.Remove(root); - delete (root); - - } - else { - dgMeshBVHNode* const root = treeNode->m_parent->m_parent; - if (treeNode->m_parent == root->m_left) { - if (treeNode->m_parent->m_right == treeNode) { - root->m_left = treeNode->m_parent->m_left; - treeNode->m_parent->m_left = nullptr; - } - else { - dAssert(treeNode->m_parent->m_left == treeNode); - root->m_left = treeNode->m_parent->m_right; - treeNode->m_parent->m_right = nullptr; - } - root->m_left->m_parent = root; - } - else { - if (treeNode->m_parent->m_right == treeNode) { - root->m_right = treeNode->m_parent->m_left; - treeNode->m_parent->m_left = nullptr; - } - else { - dAssert(treeNode->m_parent->m_left == treeNode); - root->m_right = treeNode->m_parent->m_right; - treeNode->m_parent->m_right = nullptr; - } - root->m_right->m_parent = root; - } - - dAssert(m_fitness.Find(treeNode->m_parent)); - m_fitness.Remove(treeNode->m_parent); - delete (treeNode->m_parent); - } - - //dAssert (SanityCheck()); -} - -bool ndMeshEffect::dMeshBVH::SanityCheck() const -{ -#ifdef _DEBUG - dAssert(m_mesh->Sanity()); - - if (!m_rootNode) { - return false; - } - - if ((!m_rootNode->m_left && m_rootNode->m_right) || (m_rootNode->m_left && !m_rootNode->m_right)) { - return false; - } - - if (m_rootNode->m_left && m_rootNode->m_right) { - if (m_rootNode->m_left->m_parent != m_rootNode) { - return false; - } - if (m_rootNode->m_right->m_parent != m_rootNode) { - return false; - } - - dgMeshBVHNode* stackPool[DG_MESH_EFFECT_BVH_STACK_DEPTH]; - - dInt32 stack = 2; - stackPool[0] = m_rootNode->m_left; - stackPool[1] = m_rootNode->m_right; - while (stack) { - stack--; - dgMeshBVHNode* const node = stackPool[stack]; - - if ((node->m_parent->m_left != node) && (node->m_parent->m_right != node)) { - return false; - } - - if (node->m_left) { - dAssert(node->m_right); - stackPool[stack] = node->m_left; - stack++; - dAssert(stack < dInt32(sizeof(stackPool) / sizeof(dgMeshBVHNode*))); - - stackPool[stack] = node->m_right; - stack++; - dAssert(stack < dInt32(sizeof(stackPool) / sizeof(dgMeshBVHNode*))); - } - } - } -#endif - return true; -} - -void ndMeshEffect::dMeshBVH::GetOverlapNodes(ndList& overlapNodes, const ndBigVector& p0, const ndBigVector& p1) const -{ - dgMeshBVHNode* stackPool[DG_MESH_EFFECT_BVH_STACK_DEPTH]; - - ndInt32 stack = 1; - stackPool[0] = m_rootNode; - - ndVector l0(p0); - ndVector l1(p1); - - while (stack) { - stack--; - dgMeshBVHNode* const me = stackPool[stack]; - - if (me && dgOverlapTest(me->m_p0, me->m_p1, l0, l1)) { - - if (!me->m_left) { - ndAssert(!me->m_right); - overlapNodes.Append(me); - } - else { - ndAssert(me->m_left); - ndAssert(me->m_right); - stackPool[stack] = me->m_left; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(dgMeshBVHNode*))); - - stackPool[stack] = me->m_right; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(dgMeshBVHNode*))); - } - } - } -} - -/* -ndFloat64 ndMeshEffect::dMeshBVH::VertexRayCast (const ndBigVector& p0, const ndBigVector& p1) const -{ - ndAssert (0); - - dgMeshBVHNode* stackPool[DG_MESH_EFFECT_BVH_STACK_DEPTH]; - - ndInt32 stack = 1; - stackPool[0] = m_rootNode; - - ndVector l0(p0); - ndVector l1(p1); - ndBigVector p1p0 (p1 - p0); - ndFloat64 den = p1p0 % p1p0; - - const ndBigVector* const points = (ndBigVector*) m_mesh->GetVertexPool(); - while (stack) { - stack --; - dgMeshBVHNode* const me = stackPool[stack]; - - if (me && dgOverlapTest (me->m_p0, me->m_p1, l0, l1)) { - if (!me->m_left) { - ndAssert (!me->m_right); - - ndEdge* ptr = me->m_face; - do { - ndInt32 index = ptr->m_incidentVertex; - const ndBigVector& q0 = points[index]; - ndBigVector q0p0 (q0 - p0); - ndFloat64 alpha = q0p0 % p1p0; - if ((alpha > (DG_BOOLEAN_ZERO_TOLERANCE * den)) && (alpha < (den - DG_BOOLEAN_ZERO_TOLERANCE))) { - ndBigVector dist (p0 + p1p0.Scale (alpha / den) - q0); - ndFloat64 dist2 = dist % dist; - if (dist2 < (DG_BOOLEAN_ZERO_TOLERANCE * DG_BOOLEAN_ZERO_TOLERANCE)) { - return alpha / den; - } - } - - ptr = ptr->m_next; - } while (ptr != me->m_face); - } else { - ndAssert (me->m_left); - ndAssert (me->m_right); - stackPool[stack] = me->m_left; - stack++; - ndAssert (stack < ndInt32 (sizeof (stackPool) / sizeof (dgMeshBVHNode*))); - - stackPool[stack] = me->m_right; - stack++; - ndAssert (stack < ndInt32 (sizeof (stackPool) / sizeof (dgMeshBVHNode*))); - } - } - } - return 1.2f; -} - - -bool ndMeshEffect::dMeshBVH::RayRayIntersect (ndEdge* const edge, const ndMeshEffect* const otherMesh, ndEdge* const otherEdge, ndFloat64& param, ndFloat64& otherParam) const -{ - ndAssert (0); - - ndBigVector ray_p0 (m_mesh->m_points[edge->m_incidentVertex]); - ndBigVector ray_p1 (m_mesh->m_points[edge->m_twin->m_incidentVertex]); - - ndBigVector ray_q0 (otherMesh->m_points[otherEdge->m_incidentVertex]); - ndBigVector ray_q1 (otherMesh->m_points[otherEdge->m_twin->m_incidentVertex]); - - ndBigVector p1p0 (ray_p1 - ray_p0); - ndBigVector q1q0 (ray_q1 - ray_q0); - ndBigVector p0q0 (ray_p0 - ray_q0); - - ndFloat64 a = p1p0 % p1p0; // always >= 0 - ndFloat64 c = q1q0 % q1q0; // always >= 0 - ndFloat64 b = p1p0 % q1q0; - - ndFloat64 d = (p1p0 % p0q0); - ndFloat64 e = (q1q0 % p0q0); - ndFloat64 den = a * c - b * b; // always >= 0 - // compute the line parameters of the two closest points - if (den < DG_BOOLEAN_ZERO_TOLERANCE) { - // the lines are almost parallel - return false; - } else { - // get the closest points on the infinite lines - ndFloat64 t = b * e - c * d; - ndFloat64 s = a * e - b * d; - - if (t < (DG_BOOLEAN_ZERO_TOLERANCE * den) || (s < (DG_BOOLEAN_ZERO_TOLERANCE * den)) || (t > (den - DG_BOOLEAN_ZERO_TOLERANCE)) || (s > (den - DG_BOOLEAN_ZERO_TOLERANCE))) { - return false; - } - //ndBigVector normal (p1p0 * q1q0); - ndBigVector r0 (ray_p0 + p1p0.Scale (t / den)); - ndBigVector r1 (ray_q0 + q1q0.Scale (s / den)); - ndBigVector r1r0 (r1 - r0); - ndFloat64 dist2 = r1r0 % r1r0; - if (dist2 > (DG_BOOLEAN_ZERO_TOLERANCE * DG_BOOLEAN_ZERO_TOLERANCE)) { - return false; - } - - param = t / den; - otherParam = s / den; - } - return true; -} -*/ - - -ndFloat64 ndMeshEffect::dMeshBVH::RayFaceIntersect(const dgMeshBVHNode* const faceNode, const ndBigVector& p0, const ndBigVector& p1, void* const userData) const -{ - ndAssert(0); - return 0; - /* - ndBigVector normal (m_mesh->FaceNormal(faceNode->m_face, m_mesh->GetVertexPool(), sizeof(ndBigVector))); - - ndBigVector diff (p1 - p0); - - ndFloat64 tOut = 2.0f; - const ndBigVector* const points = (ndBigVector*) m_mesh->GetVertexPool(); - ndFloat64 dir = normal.DotProduct3(diff); - if (dir < 0.0f) { - ndEdge* ptr = faceNode->m_face; - do { - ndInt32 index0 = ptr->m_incidentVertex; - ndInt32 index1 = ptr->m_next->m_incidentVertex; - ndBigVector p0v0 (points[index0] - p0); - ndBigVector p0v1 (points[index1] - p0); - ndFloat64 alpha = p0v0.DotProduct3(diff.CrossProduct(p0v1)); - if (alpha <= 0.0f) { - return 1.2f; - } - - ptr = ptr->m_next; - } while (ptr != faceNode->m_face); - - ndInt32 index0 = ptr->m_incidentVertex; - ndBigVector p0v0 (points[index0] - p0); - tOut = normal.DotProduct3(p0v0); - ndFloat64 dist = normal.DotProduct3(diff); - tOut = tOut / dist; - - } else if (doubleSidedFaces && (dir > 0.0f)) { - ndEdge* ptr = faceNode->m_face; - do { - ndInt32 index0 = ptr->m_incidentVertex; - ndInt32 index1 = ptr->m_prev->m_incidentVertex; - ndBigVector p0v0 (points[index0] - p0); - ndBigVector p0v1 (points[index1] - p0); - ndFloat64 alpha = p0v0.DotProduct3(diff.CrossProduct(p0v1)); - if (alpha <= 0.0f) { - return 1.2f; - } - - ptr = ptr->m_prev; - } while (ptr != faceNode->m_face); - - ndInt32 index0 = ptr->m_incidentVertex; - ndBigVector p0v0 (points[index0] - p0); - tOut = normal.DotProduct3(p0v0); - ndFloat64 dist = normal.DotProduct3(diff); - tOut = tOut / dist; - } - - if (tOut < 1.e-12f) { - tOut = 2.0f; - } else if (tOut > (1.0 - 1.e-12f)) { - tOut = 2.0f; - } - return tOut; - */ -} - - -void ndMeshEffect::dMeshBVH::FaceRayCast(const ndBigVector& p0, const ndBigVector& p1, void* const userData) const -{ - dgMeshBVHNode* stackPool[DG_MESH_EFFECT_BVH_STACK_DEPTH]; - - ndInt32 stack = 1; - dgMeshBVHNode* node = nullptr; - - stackPool[0] = m_rootNode; - ndFloat64 maxParam = ndFloat32(1.2f); - - ndVector l0(p0); - ndVector l1(p1); - l0 = l0 & ndVector::m_triplexMask; - l1 = l1 & ndVector::m_triplexMask; - ndFastRay ray(l0, l1); - while (stack) { - stack--; - dgMeshBVHNode* const me = stackPool[stack]; - if (me && ray.BoxTest(me->m_p0, me->m_p1)) { - if (!me->m_left) { - ndAssert(!me->m_right); - ndFloat64 param = RayFaceIntersect(me, p0, p1, userData); - if (param < ndFloat64(0.0f)) { - break; - } - if (param < maxParam) { - node = me; - maxParam = param; - } - } - else { - ndAssert(me->m_left); - ndAssert(me->m_right); - stackPool[stack] = me->m_left; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(dgMeshBVHNode*))); - - stackPool[stack] = me->m_right; - stack++; - ndAssert(stack < ndInt32(sizeof(stackPool) / sizeof(dgMeshBVHNode*))); - } - } - } -} - -ndMeshEffect::ndMeshEffect(dgMemoryAllocator* const allocator, const ndMatrix& planeMatrix, ndFloat32 witdth, ndFloat32 breadth, ndInt32 material, const ndMatrix& textureMatrix0, const ndMatrix& textureMatrix1) - :ndPolyhedra(allocator) - ,m_points(allocator) - ,m_attrib(allocator) - ,m_vertexBaseCount(-1) - ,m_constructionIndex(0) -{ - ndAssert(0); - Init(); - /* - ndInt32 index[4]; - ndInt64 attrIndex[4]; - ndBigVector face[4]; - - // Init(); - - face[0] = ndBigVector (ndFloat32 (0.0f), -witdth, -breadth, ndFloat32 (0.0f)); - face[1] = ndBigVector (ndFloat32 (0.0f), witdth, -breadth, ndFloat32 (0.0f)); - face[2] = ndBigVector (ndFloat32 (0.0f), witdth, breadth, ndFloat32 (0.0f)); - face[3] = ndBigVector (ndFloat32 (0.0f), -witdth, breadth, ndFloat32 (0.0f)); - - for (ndInt32 i = 0; i < 4; ++i) { - ndBigVector uv0 (textureMatrix0.TransformVector(face[i])); - ndBigVector uv1 (textureMatrix1.TransformVector(face[i])); - - m_points[i] = planeMatrix.TransformVector(face[i]); - - m_attrib[i].m_vertex.m_x = m_points[i].m_x; - m_attrib[i].m_vertex.m_y = m_points[i].m_y; - m_attrib[i].m_vertex.m_z = m_points[i].m_z; - m_attrib[i].m_vertex.m_w = ndFloat64 (0.0f); - - m_attrib[i].m_normal_x = planeMatrix.m_front.m_x; - m_attrib[i].m_normal_y = planeMatrix.m_front.m_y; - m_attrib[i].m_normal_z = planeMatrix.m_front.m_z; - - m_attrib[i].m_u0 = uv0.m_y; - m_attrib[i].m_v0 = uv0.m_z; - - m_attrib[i].m_u1 = uv1.m_y; - m_attrib[i].m_v1 = uv1.m_z; - - m_attrib[i].m_material = material; - - index[i] = i; - attrIndex[i] = i; - } - - m_pointCount = 4; - m_atribCount = 4; - BeginFace(); - AddFace (4, index, attrIndex); - EndFace(); - */ -} - - - -ndMeshEffect::ndMeshEffect(const ndMeshEffect& source) - :ndPolyhedra(source) - ,m_points(source.m_points) - ,m_attrib(source.m_attrib) - ,m_vertexBaseCount(-1) - ,m_constructionIndex(0) -{ - Init(); -} - -ndMeshEffect::ndMeshEffect(dgMemoryAllocator* const allocator, dgDeserialize deserialization, void* const userData) - :ndPolyhedra(allocator) - ,m_points(allocator) - ,m_attrib(allocator) - ,m_vertexBaseCount(-1) - ,m_constructionIndex(0) -{ - Init(); - ndAssert(0); - /* - ndInt32 faceCount; - deserialization (userData, &faceCount, sizeof (ndInt32)); - deserialization (userData, &m_pointCount, sizeof (ndInt32)); - deserialization (userData, &m_atribCount, sizeof (ndInt32)); - deserialization (userData, &m_atribCount, sizeof (ndInt32)); - - m_maxPointCount = m_pointCount; - m_maxAtribCount = m_atribCount; - - m_points = (ndBigVector*) GetAllocator()->MallocLow(ndInt32 (m_pointCount * sizeof(ndBigVector))); - m_attrib = (dgVertexAtribute*) GetAllocator()->MallocLow(ndInt32 (m_atribCount * sizeof(dgVertexAtribute))); - - deserialization (userData, m_points, m_pointCount * sizeof (ndBigVector)); - deserialization (userData, m_attrib, m_atribCount * sizeof (dgVertexAtribute)); - - BeginFace(); - for (ndInt32 i = 0; i < faceCount; ++i) { - ndInt32 vertexCount; - ndInt32 face[1024]; - ndInt64 attrib[1024]; - deserialization (userData, &vertexCount, sizeof (ndInt32)); - deserialization (userData, face, vertexCount * sizeof (ndInt32)); - deserialization (userData, attrib, vertexCount * sizeof (ndInt64)); - AddFace (vertexCount, face, attrib); - } - EndFace(); - */ -} - - -ndMeshEffect::~ndMeshEffect(void) -{ -} - - - -void ndMeshEffect::Trace() const -{ - ndAssert(0); - /* - for (ndInt32 i = 0; i < m_pointCount; i ++ ) { - ndTrace (("%d-> %f %f %f\n", i, m_points[i].m_x, m_points[i].m_y, m_points[i].m_z)); - } - - - ndTreefilter(GetAllocator()); - Iterator iter (*this); - for (iter.Begin(); iter; iter ++) { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if (!filter.Find(edge)) { - ndEdge* ptr = edge; - do { - filter.Insert(edge, ptr); - ndTrace (("%d ", ptr->m_incidentVertex)); - ptr = ptr->m_next; - } while (ptr != edge); - if (edge->m_incidentFace <= 0) { - ndTrace (("open")); - } - ndTrace (("\n")); - } - } - ndTrace (("\n")); - */ -}; - -void ndMeshEffect::OptimizePoints() -{ -} - -void ndMeshEffect::OptimizeAttibutes() -{ - UnpackAttibuteData(); - PackAttibuteData(); -} - - -ndInt32 ndMeshEffect::GetTotalFaceCount() const -{ - return GetFaceCount(); -} - -ndInt32 ndMeshEffect::GetTotalIndexCount() const -{ - Iterator iter(*this); - ndInt32 count = 0; - ndInt32 mark = IncLRU(); - for (iter.Begin(); iter; iter++) { - ndEdge* const edge = &(*iter); - if (edge->m_mark == mark) { - continue; - } - - if (edge->m_incidentFace < 0) { - continue; - } - - ndEdge* ptr = edge; - do { - count++; - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - } - return count; -} - -void ndMeshEffect::GetFaces(ndInt32* const facesIndex, ndInt32* const materials, void** const faceNodeList) const -{ - Iterator iter(*this); - - ndInt32 faces = 0; - ndInt32 indexCount = 0; - ndInt32 mark = IncLRU(); - for (iter.Begin(); iter; iter++) { - ndEdge* const edge = &(*iter); - if (edge->m_mark == mark) { - continue; - } - - if (edge->m_incidentFace < 0) { - continue; - } - - ndInt32 faceCount = 0; - ndEdge* ptr = edge; - do { - // indexList[indexCount] = ndInt32 (ptr->m_userData); - faceNodeList[indexCount] = GetNodeFromInfo(*ptr); - indexCount++; - faceCount++; - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - - facesIndex[faces] = faceCount; - //materials[faces] = dgFastInt(m_attrib[ndInt32 (edge->m_userData)].m_material); - materials[faces] = m_attrib.m_materialChannel.m_count ? m_attrib.m_materialChannel[ndInt32(edge->m_userData)] : 0; - faces++; - } -} - -void* ndMeshEffect::GetFirstVertex() const -{ - Iterator iter(*this); - iter.Begin(); - - ndNode* node = nullptr; - if (iter) { - ndInt32 mark = IncLRU(); - node = iter.GetNode(); - - ndEdge* const edge = &node->GetInfo(); - ndEdge* ptr = edge; - do { - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - } - return node; -} - -void* ndMeshEffect::GetNextVertex(const void* const vertex) const -{ - ndNode* const node0 = (ndNode*)vertex; - ndInt32 mark = node0->GetInfo().m_mark; - - Iterator iter(*this); - iter.Set(node0); - for (iter++; iter; iter++) { - ndNode* node = iter.GetNode(); - if (node->GetInfo().m_mark != mark) { - ndEdge* const edge = &node->GetInfo(); - ndEdge* ptr = edge; - do { - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - return node; - } - } - return nullptr; -} - -ndInt32 ndMeshEffect::GetVertexIndex(const void* const vertex) const -{ - ndNode* const node = (ndNode*)vertex; - ndEdge* const edge = &node->GetInfo(); - return edge->m_incidentVertex; -} - -void* ndMeshEffect::GetFirstPoint() const -{ - Iterator iter(*this); - for (iter.Begin(); iter; iter++) { - ndNode* const node = iter.GetNode(); - ndEdge* const edge = &node->GetInfo(); - if (edge->m_incidentFace > 0) { - return node; - } - } - return nullptr; -} - -void* ndMeshEffect::GetNextPoint(const void* const point) const -{ - Iterator iter(*this); - iter.Set((ndNode*)point); - for (iter++; iter; iter++) { - ndNode* const node = iter.GetNode(); - ndEdge* const edge = &node->GetInfo(); - if (edge->m_incidentFace > 0) { - return node; - } - } - return nullptr; -} - -ndInt32 ndMeshEffect::GetPointIndex(const void* const point) const -{ - ndNode* const node = (ndNode*)point; - ndEdge* const edge = &node->GetInfo(); - return ndInt32(edge->m_userData); -} - - -ndInt32 ndMeshEffect::GetVertexIndexFromPoint(const void* const point) const -{ - return GetVertexIndex(point); -} - -ndEdge* ndMeshEffect::SpliteFace(ndInt32 v0, ndInt32 v1) -{ - if (!FindEdge(v0, v1)) { - ndPolyhedra::ndPairKey key(v0, 0); - ndNode* const node = FindGreaterEqual(key.GetVal()); - if (node) { - ndEdge* const edge = &node->GetInfo(); - ndEdge* edge0 = edge; - do { - if (edge0->m_incidentFace > 0) { - for (ndEdge* edge1 = edge0->m_next->m_next; edge1 != edge0->m_prev; edge1 = edge1->m_next) { - if (edge1->m_incidentVertex == v1) { - return ConnectVertex(edge0, edge1); - } - }; - } - edge0 = edge0->m_twin->m_next; - } while (edge0 != edge); - } - } - return nullptr; -} - -const ndEdge* ndMeshEffect::GetPolyhedraEdgeFromNode(const void* const edge) const -{ - ndNode* const node = (ndNode*)edge; - return &node->GetInfo(); -} - -void* ndMeshEffect::GetFirstEdge() const -{ - Iterator iter(*this); - iter.Begin(); - - ndNode* node = nullptr; - if (iter) { - ndInt32 mark = IncLRU(); - - node = iter.GetNode(); - - ndEdge* const edge = &node->GetInfo(); - edge->m_mark = mark; - edge->m_twin->m_mark = mark; - } - return node; -} - -void* ndMeshEffect::GetNextEdge(const void* const edge) const -{ - ndNode* const node0 = (ndNode*)edge; - ndInt32 mark = node0->GetInfo().m_mark; - - Iterator iter(*this); - iter.Set(node0); - for (iter++; iter; iter++) { - ndNode* const node = iter.GetNode(); - if (node->GetInfo().m_mark != mark) { - node->GetInfo().m_mark = mark; - node->GetInfo().m_twin->m_mark = mark; - return node; - } - } - return nullptr; -} - - -void ndMeshEffect::GetEdgeIndex(const void* const edge, ndInt32& v0, ndInt32& v1) const -{ - ndNode* const node = (ndNode*)edge; - v0 = node->GetInfo().m_incidentVertex; - v1 = node->GetInfo().m_twin->m_incidentVertex; -} - -//void* ndMeshEffect::FindEdge (ndInt32 v0, ndInt32 v1) const -//{ -// return FindEdgeNode(v0, v1); -//} - -//void ndMeshEffect::GetEdgeAttributeIndex (const void* edge, ndInt32& v0, ndInt32& v1) const -//{ -// ndNode* node = (ndNode*) edge; -// v0 = ndInt32 (node->GetInfo().m_userData); -// v1 = ndInt32 (node->GetInfo().m_twin->m_userData); -//} - - -void* ndMeshEffect::GetFirstFace() const -{ - Iterator iter(*this); - iter.Begin(); - - ndNode* node = nullptr; - if (iter) { - ndInt32 mark = IncLRU(); - node = iter.GetNode(); - - ndEdge* const edge = &node->GetInfo(); - ndEdge* ptr = edge; - do { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - } - - return node; -} - -void* ndMeshEffect::GetNextFace(const void* const face) const -{ - ndNode* const node0 = (ndNode*)face; - ndInt32 mark = node0->GetInfo().m_mark; - - Iterator iter(*this); - iter.Set(node0); - for (iter++; iter; iter++) { - ndNode* node = iter.GetNode(); - if (node->GetInfo().m_mark != mark) { - ndEdge* const edge = &node->GetInfo(); - ndEdge* ptr = edge; - do { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - return node; - } - } - return nullptr; -} - - -ndInt32 ndMeshEffect::IsFaceOpen(const void* const face) const -{ - ndNode* const node = (ndNode*)face; - ndEdge* const edge = &node->GetInfo(); - return (edge->m_incidentFace > 0) ? 0 : 1; -} - -ndInt32 ndMeshEffect::GetFaceMaterial(const void* const face) const -{ - ndNode* const node = (ndNode*)face; - ndEdge* const edge = &node->GetInfo(); - return ndInt32(m_attrib.m_materialChannel.m_count ? m_attrib.m_materialChannel[ndInt32(edge->m_userData)] : 0); -} - -void ndMeshEffect::SetFaceMaterial(const void* const face, ndInt32 mateialID) -{ - if (m_attrib.m_materialChannel.m_count) { - ndNode* const node = (ndNode*)face; - ndEdge* const edge = &node->GetInfo(); - if (edge->m_incidentFace > 0) { - ndEdge* ptr = edge; - do { - //dgVertexAtribute* const attrib = &m_attrib[ptr->m_userData]; - //attrib->m_material = ndFloat64 (mateialID); - m_attrib.m_materialChannel[ndInt32(edge->m_userData)] = mateialID; - ptr = ptr->m_next; - } while (ptr != edge); - } - } -} - -ndInt32 ndMeshEffect::GetFaceIndexCount(const void* const face) const -{ - ndInt32 count = 0; - ndNode* node = (ndNode*)face; - ndEdge* const edge = &node->GetInfo(); - ndEdge* ptr = edge; - do { - count++; - ptr = ptr->m_next; - } while (ptr != edge); - return count; -} - -void ndMeshEffect::GetFaceIndex(const void* const face, ndInt32* const indices) const -{ - ndInt32 count = 0; - ndNode* node = (ndNode*)face; - ndEdge* const edge = &node->GetInfo(); - ndEdge* ptr = edge; - do { - indices[count] = ptr->m_incidentVertex; - count++; - ptr = ptr->m_next; - } while (ptr != edge); -} - -void ndMeshEffect::GetFaceAttributeIndex(const void* const face, ndInt32* const indices) const -{ - ndInt32 count = 0; - ndNode* node = (ndNode*)face; - ndEdge* const edge = &node->GetInfo(); - ndEdge* ptr = edge; - do { - indices[count] = ndInt32(ptr->m_userData); - count++; - ptr = ptr->m_next; - } while (ptr != edge); -} - - -ndBigVector ndMeshEffect::CalculateFaceNormal(const void* const face) const -{ - ndNode* const node = (ndNode*)face; - ndEdge* const faceEdge = &node->GetInfo(); - ndBigVector normal(FaceNormal(faceEdge, &m_points.m_vertex[0].m_x, sizeof(ndBigVector))); - ndAssert(normal.m_w == ndFloat32(0.0f)); - //normal = normal.Scale (1.0f / sqrt (normal.DotProduct3(normal))); - normal = normal.Normalize(); - return normal; -} - -/* -ndInt32 GetTotalFaceCount() const; -{ - ndInt32 mark; - ndInt32 count; - ndInt32 materialCount; - ndInt32 materials[256]; - ndInt32 streamIndexMap[256]; - ndIndexArray* array; - - count = 0; - materialCount = 0; - - array = (ndIndexArray*) GetAllocator()->MallocLow (4 * sizeof (ndInt32) * GetCount() + sizeof (ndIndexArray) + 2048); - array->m_indexList = (ndInt32*)&array[1]; - - mark = IncLRU(); - ndPolyhedra::Iterator iter (*this); - memset(streamIndexMap, 0, sizeof (streamIndexMap)); - for(iter.Begin(); iter; iter ++){ - - ndEdge* const edge; - edge = &(*iter); - if ((edge->m_incidentFace >= 0) && (edge->m_mark != mark)) { - ndEdge* ptr; - ndInt32 hashValue; - ndInt32 index0; - ndInt32 index1; - - ptr = edge; - ptr->m_mark = mark; - index0 = ndInt32 (ptr->m_userData); - - ptr = ptr->m_next; - ptr->m_mark = mark; - index1 = ndInt32 (ptr->m_userData); - - ptr = ptr->m_next; - do { - ptr->m_mark = mark; - - array->m_indexList[count * 4 + 0] = index0; - array->m_indexList[count * 4 + 1] = index1; - array->m_indexList[count * 4 + 2] = ndInt32 (ptr->m_userData); - array->m_indexList[count * 4 + 3] = m_attrib[ndInt32 (edge->m_userData)].m_material; - index1 = ndInt32 (ptr->m_userData); - - hashValue = array->m_indexList[count * 4 + 3] & 0xff; - streamIndexMap[hashValue] ++; - materials[hashValue] = array->m_indexList[count * 4 + 3]; - count ++; - - ptr = ptr->m_next; - } while (ptr != edge); - } - } -} -*/ - -bool ndMeshEffect::HasNormalChannel() const -{ - return m_attrib.m_normalChannel.m_count != 0; -} - -bool ndMeshEffect::HasBinormalChannel() const -{ - return m_attrib.m_binormalChannel.m_count != 0; -} - -bool ndMeshEffect::HasUV0Channel() const -{ - return m_attrib.m_uv0Channel.m_count != 0; -} - -bool ndMeshEffect::HasUV1Channel() const -{ - return m_attrib.m_uv1Channel.m_count != 0; -} - -bool ndMeshEffect::HasVertexColorChannel() const -{ - return m_attrib.m_colorChannel.m_count != 0; -} - - -/* -void ndMeshEffect::GetWeightBlendChannel(ndInt32 strideInByte, ndFloat32* const bufferOut) const -{ - ndInt8* const buffer = (ndInt8*)bufferOut; - for (ndInt32 i = 0; i < m_attrib.m_pointChannel.m_count; ++i) { - const ndInt32 j = i * strideInByte; - ndFloat32* const ptr = (ndFloat32*)&buffer[j]; - - const ndInt32 index = m_attrib.m_pointChannel[i]; - const ndFloat32* const p = &m_points.m_weights[index].m_weightBlends[0]; - ptr[0] = ndFloat32(p[0]); - ptr[1] = ndFloat32(p[1]); - ptr[2] = ndFloat32(p[2]); - ptr[3] = ndFloat32(p[3]); - } -} - -void ndMeshEffect::GetWeightIndexChannel(ndInt32 strideInByte, ndInt32* const bufferOut) const -{ - ndInt8* const buffer = (ndInt8*)bufferOut; - for (ndInt32 i = 0; i < m_attrib.m_pointChannel.m_count; ++i) { - const ndInt32 j = i * strideInByte; - ndInt32* const ptr = (ndInt32*)&buffer[j]; - const ndInt32 index = m_attrib.m_pointChannel[i]; - const ndInt32* const p = &m_points.m_weights[index].m_controlIndex[0]; - ptr[0] = p[0]; - ptr[1] = p[1]; - ptr[2] = p[2]; - ptr[3] = p[3]; - } -} -*/ - - -dgCollisionInstance* ndMeshEffect::CreateCollisionTree(dgWorld* const world, ndInt32 shapeID) const -{ - ndShapeStatic_bvh* const collision = new (GetAllocator()) ndShapeStatic_bvh(world); - - collision->BeginBuild(); - - ndInt32 mark = IncLRU(); - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndNode* const faceNode = iter.GetNode(); - ndEdge* const face = &faceNode->GetInfo(); - if ((face->m_mark != mark) && (face->m_incidentFace > 0)) - { - ndInt32 count = 0; - ndVector polygon[256]; - ndEdge* ptr = face; - do - { - //polygon[count] = ndVector (m_points[ptr->m_incidentVertex]); - polygon[count] = GetVertex(ptr->m_incidentVertex); - count++; - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != face); - //collision->AddFace(count, &polygon[0].m_x, sizeof (ndVector), ndInt32 (m_attrib[face->m_userData].m_material)); - collision->AddFace(count, &polygon[0].m_x, sizeof(ndVector), GetFaceMaterial(faceNode)); - } - } - collision->EndBuild(0); - - dgCollisionInstance* const instance = world->CreateInstance(collision, shapeID, ndGetIdentityMatrix()); - collision->Release(); - return instance; -} - -void ndMeshEffect::TransformMesh(const ndMatrix& matrix) -{ - ndAssert(0); - /* - ndMatrix normalMatrix (matrix); - normalMatrix.m_posit = ndVector (ndFloat32 (0.0f), ndFloat32 (0.0f), ndFloat32 (0.0f), ndFloat32 (1.0f)); - - matrix.TransformTriplex (&m_points->m_x, sizeof (ndBigVector), &m_points->m_x, sizeof (ndBigVector), m_pointCount); - matrix.TransformTriplex (&m_attrib[0].m_vertex.m_x, sizeof (dgVertexAtribute), &m_attrib[0].m_vertex.m_x, sizeof (dgVertexAtribute), m_atribCount); - normalMatrix.TransformTriplex (&m_attrib[0].m_normal_x, sizeof (dgVertexAtribute), &m_attrib[0].m_normal_x, sizeof (dgVertexAtribute), m_atribCount); -*/ -} - - - -//ndMeshEffect::dgVertexAtribute ndMeshEffect::InterpolateVertex (const ndBigVector& srcPoint, const ndEdge* const face) const -ndInt32 ndMeshEffect::InterpolateVertex(const ndBigVector& srcPoint, const ndEdge* const face) const -{ - ndAssert(0); - return 0; - /* - const ndBigVector point (srcPoint); - - dgVertexAtribute attribute; - memset (&attribute, 0, sizeof (attribute)); - - // ndBigVector normal (FaceNormal(face, &m_points[0].m_x, sizeof(ndBigVector))); - // normal = normal.Scale (ndFloat64 (1.0f) / sqrt (normal % normal)); - // attribute.m_vertex = srcPoint; - // attribute.m_normal_x = normal.m_x; - // attribute.m_normal_y = normal.m_y; - // attribute.m_normal_z = normal.m_z; - - ndFloat64 tol = ndFloat32 (1.0e-4f); - for (ndInt32 i = 0; i < 4; ++i) { - const ndEdge* ptr = face; - const ndEdge* const edge0 = ptr; - ndBigVector q0 (m_points[ptr->m_incidentVertex]); - - ptr = ptr->m_next; - const ndEdge* edge1 = ptr; - ndBigVector q1 (m_points[ptr->m_incidentVertex]); - - ptr = ptr->m_next; - const ndEdge* edge2 = ptr; - do { - const ndBigVector q2 (m_points[ptr->m_incidentVertex]); - - ndBigVector p10 (q1 - q0); - ndBigVector p20 (q2 - q0); - - ndFloat64 dot = p20.DotProduct3(p10); - ndFloat64 mag1 = p10.DotProduct3(p10); - ndFloat64 mag2 = p20.DotProduct3(p20); - ndFloat64 collinear = dot * dot - mag2 * mag1; - if (fabs (collinear) > ndFloat64 (1.0e-8f)) { - ndBigVector p_p0 (point - q0); - ndBigVector p_p1 (point - q1); - ndBigVector p_p2 (point - q2); - - ndFloat64 alpha1 = p10.DotProduct3(p_p0); - ndFloat64 alpha2 = p20.DotProduct3(p_p0); - ndFloat64 alpha3 = p10.DotProduct3(p_p1); - ndFloat64 alpha4 = p20.DotProduct3(p_p1); - ndFloat64 alpha5 = p10.DotProduct3(p_p2); - ndFloat64 alpha6 = p20.DotProduct3(p_p2); - - ndFloat64 vc = alpha1 * alpha4 - alpha3 * alpha2; - ndFloat64 vb = alpha5 * alpha2 - alpha1 * alpha6; - ndFloat64 va = alpha3 * alpha6 - alpha5 * alpha4; - ndFloat64 den = va + vb + vc; - ndFloat64 minError = den * (-tol); - ndFloat64 maxError = den * (ndFloat32 (1.0f) + tol); - if ((va > minError) && (vb > minError) && (vc > minError) && (va < maxError) && (vb < maxError) && (vc < maxError)) { - edge2 = ptr; - - den = ndFloat64 (1.0f) / (va + vb + vc); - - ndFloat64 alpha0 = ndFloat32 (va * den); - ndFloat64 alpha1 = ndFloat32 (vb * den); - ndFloat64 alpha2 = ndFloat32 (vc * den); - - const dgVertexAtribute& attr0 = m_attrib[edge0->m_userData]; - const dgVertexAtribute& attr1 = m_attrib[edge1->m_userData]; - const dgVertexAtribute& attr2 = m_attrib[edge2->m_userData]; - ndBigVector normal (attr0.m_normal_x * alpha0 + attr1.m_normal_x * alpha1 + attr2.m_normal_x * alpha2, - attr0.m_normal_y * alpha0 + attr1.m_normal_y * alpha1 + attr2.m_normal_y * alpha2, - attr0.m_normal_z * alpha0 + attr1.m_normal_z * alpha1 + attr2.m_normal_z * alpha2, ndFloat32 (0.0f)); - //normal = normal.Scale (ndFloat64 (1.0f) / sqrt (normal.DotProduct3(normal))); - normal = normal.Normalize(); - - #ifdef _DEBUG - ndBigVector testPoint (attr0.m_vertex.m_x * alpha0 + attr1.m_vertex.m_x * alpha1 + attr2.m_vertex.m_x * alpha2, - attr0.m_vertex.m_y * alpha0 + attr1.m_vertex.m_y * alpha1 + attr2.m_vertex.m_y * alpha2, - attr0.m_vertex.m_z * alpha0 + attr1.m_vertex.m_z * alpha1 + attr2.m_vertex.m_z * alpha2, ndFloat32 (0.0f)); - ndAssert (fabs (testPoint.m_x - point.m_x) < ndFloat32 (1.0e-2f)); - ndAssert (fabs (testPoint.m_y - point.m_y) < ndFloat32 (1.0e-2f)); - ndAssert (fabs (testPoint.m_z - point.m_z) < ndFloat32 (1.0e-2f)); - #endif - - - attribute.m_vertex.m_x = point.m_x; - attribute.m_vertex.m_y = point.m_y; - attribute.m_vertex.m_z = point.m_z; - attribute.m_vertex.m_w = point.m_w; - attribute.m_normal_x = normal.m_x; - attribute.m_normal_y = normal.m_y; - attribute.m_normal_z = normal.m_z; - attribute.m_u0 = attr0.m_u0 * alpha0 + attr1.m_u0 * alpha1 + attr2.m_u0 * alpha2; - attribute.m_v0 = attr0.m_v0 * alpha0 + attr1.m_v0 * alpha1 + attr2.m_v0 * alpha2; - attribute.m_u1 = attr0.m_u1 * alpha0 + attr1.m_u1 * alpha1 + attr2.m_u1 * alpha2; - attribute.m_v1 = attr0.m_v1 * alpha0 + attr1.m_v1 * alpha1 + attr2.m_v1 * alpha2; - - attribute.m_material = attr0.m_material; - ndAssert (attr0.m_material == attr1.m_material); - ndAssert (attr0.m_material == attr2.m_material); - return attribute; - } - } - - q1 = q2; - edge1 = ptr; - - ptr = ptr->m_next; - } while (ptr != face); - tol *= ndFloat64 (2.0f); - } - // this should never happens - ndAssert (0); - return attribute; - */ -} - - -#endif - -class ndMeshEffect::ndFormat::ndSortCluster -{ - public: - ndBigVector m_sum; - ndBigVector m_sum2; - ndInt32 m_start; - ndInt32 m_count; -}; - -inline ndInt32 ndMeshEffect::ndFormat::CompareVertex(const ndSortKey* const ptr0, const ndSortKey* const ptr1, void* const context) -{ - const ndVertexSortData* const sortContext = (ndVertexSortData*)context; - const ndInt32 compIndex = sortContext->m_vertexSortIndex; - const ndChannel& points = *sortContext->m_points; - const ndFloat64 x0 = points[ptr0->m_vertexIndex][compIndex]; - const ndFloat64 x1 = points[ptr1->m_vertexIndex][compIndex]; - - if (x0 < x1) - { - return -1; - } - else if (x0 > x1) - { - return 1; - } - return 0; -} - -void ndMeshEffect::ndPointFormat::CompressData( - ndPointFormat& output, ndInt32* const indexList, - ndSortKey* const remapIndex, const ndSortCluster& cluster, ndFloat32 tol) -{ - const ndBigVector origin(cluster.m_sum.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count)); - const ndBigVector x2c(cluster.m_sum2.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count) - origin * origin); - const ndBigVector variance((x2c.GetMax(ndVector::m_zero)).Sqrt()); - - ndInt32 firstSortAxis = 0; - if ((variance.m_y >= variance.m_x) && (variance.m_y >= variance.m_z)) - { - firstSortAxis = 1; - } - else if ((variance.m_z >= variance.m_x) && (variance.m_z >= variance.m_y)) - { - firstSortAxis = 2; - } - - ndVertexSortData sortContext; - sortContext.m_points = &m_vertex; - sortContext.m_vertexSortIndex = firstSortAxis; - class CompareKey - { - public: - //ndInt32 Compare(const ndSortKey& elementA, const ndSortKey& elementB, void* const context) const - //{ - // return ndMeshEffect::ndFormat::CompareVertex(&elementA, &elementB, context); - //} - CompareKey(void* const context) - :m_context((ndVertexSortData*)context) - { - } - - ndInt32 Compare(const ndSortKey& elementA, const ndSortKey& elementB) const - { - return ndMeshEffect::ndFormat::CompareVertex(&elementA, &elementB, m_context); - } - ndVertexSortData* m_context; - }; - ndSort(remapIndex, cluster.m_count, &sortContext); - - const ndFloat64 minDist = ndMin(ndMin(variance.m_x, variance.m_y), variance.m_z); - const ndFloat64 tolerance = ndMax(ndMin(minDist, ndFloat64(tol)), ndFloat64(1.0e-8f)); - const ndFloat64 sweptWindow = ndFloat64(2.0f) * tolerance; - - const ndInt32 base = ndInt32 (output.m_vertex.GetCount()); - - ndInt32 newCount = 0; - for (ndInt32 i = 0; i < cluster.m_count; ++i) - { - const ndInt32 ii = remapIndex[i].m_mask; - if (ii == -1) - { - const ndInt32 i0 = remapIndex[i].m_ordinal; - const ndInt32 iii = remapIndex[i].m_vertexIndex; - const ndBigVector& p = m_vertex[iii]; - const ndFloat64 swept = p[firstSortAxis] + sweptWindow; - for (ndInt32 j = i + 1; j < cluster.m_count; ++j) - { - const ndInt32 jj = remapIndex[j].m_mask; - if (jj == -1) - { - const ndInt32 j0 = remapIndex[j].m_ordinal; - const ndInt32 jjj = remapIndex[j].m_vertexIndex; - const ndBigVector& q = m_vertex[jjj]; - ndFloat64 val = q[firstSortAxis]; - if (val >= swept) - { - break; - } - - bool test = true; - if (iii != jjj) - { - ndBigVector dp(p - q); - for (ndInt32 k = 0; k < 3; ++k) - { - test &= (fabs(dp[k]) <= tolerance); - } - } - if (test && m_layers.GetCount()) - { - test &= (m_layers[i0] == m_layers[j0]); - } - // note, is ok weight duplicate to be ignored. - - if (test) - { - remapIndex[j].m_mask = newCount + base; - } - } - } - - remapIndex[newCount].m_vertexIndex = remapIndex[i].m_vertexIndex; - remapIndex[i].m_mask = newCount + base; - newCount++; - } - } - - for (ndInt32 i = 0; i < newCount; ++i) - { - ndAssert(remapIndex[i].m_attibuteIndex == -1); - output.m_vertex.PushBack(m_vertex[remapIndex[i].m_vertexIndex]); - } - - if (m_layers.GetCount()) - { - for (ndInt32 i = 0; i < newCount; ++i) - { - output.m_layers.PushBack(m_layers[remapIndex[i].m_vertexIndex]); - } - } - - for (ndInt32 i = 0; i < cluster.m_count; ++i) - { - ndInt32 i1 = remapIndex[i].m_ordinal; - ndInt32 index = remapIndex[i].m_mask; - indexList[i1] = index; - } -} - -void ndMeshEffect::ndPointFormat::CompactVertexData(ndInt32* const indexList, ndFloat32 tol) -{ - ndPointFormat tmpFormat(*this); - Clear(); - const ndInt32 vertexCount = ndInt32 (tmpFormat.m_vertex.GetCount()); - - ndStack indirectListBuffer(vertexCount); - ndSortKey* const indirectList = &indirectListBuffer[0]; - - ndSortCluster cluster; - cluster.m_start = 0; - cluster.m_count = vertexCount; - cluster.m_sum = ndBigVector::m_zero; - cluster.m_sum2 = ndBigVector::m_zero; - for (ndInt32 i = 0; i < vertexCount; ++i) - { - indirectList[i].m_mask = -1; - indirectList[i].m_ordinal = i; - indirectList[i].m_vertexIndex = i; - indirectList[i].m_attibuteIndex = -1; - - const ndBigVector x(tmpFormat.m_vertex[i]); - cluster.m_sum += x; - cluster.m_sum2 += x * x; - } - - if (vertexCount > D_VERTEXLIST_INDEX_LIST_BASH) - { - ndSortCluster spliteStack[128]; - spliteStack[0] = cluster; - - ndInt32 stack = 1; - while (stack) - { - stack--; - cluster = spliteStack[stack]; - ndSortKey* const remapIndex = &indirectList[cluster.m_start]; - - const ndBigVector origin(cluster.m_sum.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count)); - const ndBigVector variance2(cluster.m_sum2.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count) - origin * origin); - - ndFloat64 maxVariance2 = ndMax(ndMax(variance2.m_x, variance2.m_y), variance2.m_z); - if ((cluster.m_count <= D_VERTEXLIST_INDEX_LIST_BASH) || (stack > (ndInt32 (sizeof(spliteStack) / sizeof(spliteStack[0])) - 4)) || (maxVariance2 < ndFloat32(4.0f))) - { - tmpFormat.CompressData(*this, indexList, remapIndex, cluster, tol); - } - else - { - ndInt32 firstSortAxis = 0; - if ((variance2.m_y >= variance2.m_x) && (variance2.m_y >= variance2.m_z)) - { - firstSortAxis = 1; - } - else if ((variance2.m_z >= variance2.m_x) && (variance2.m_z >= variance2.m_y)) - { - firstSortAxis = 2; - } - - ndBigPlane plane(ndFloat32(0.0f)); - plane[firstSortAxis] = ndFloat32(1.0f); - plane.m_w = -origin[firstSortAxis]; - - ndInt32 i0 = 0; - ndInt32 i1 = cluster.m_count - 1; - while (i0 < i1) - { - ndInt32 index0 = remapIndex[i0].m_vertexIndex; - ndFloat64 side = plane.Evalue(tmpFormat.m_vertex[index0]); - while (side <= ndFloat32(0.0f) && (i0 < i1)) - { - ++i0; - index0 = remapIndex[i0].m_vertexIndex; - side = plane.Evalue(tmpFormat.m_vertex[index0]); - }; - - ndInt32 index1 = remapIndex[i1].m_vertexIndex; - side = plane.Evalue(tmpFormat.m_vertex[index1]); - while (side > ndFloat32(0.0f) && (i0 < i1)) - { - --i1; - index1 = remapIndex[i1].m_vertexIndex; - side = plane.Evalue(tmpFormat.m_vertex[index1]); - } - - ndAssert(i0 <= i1); - if (i0 < i1) - { - ndSwap(remapIndex[i0], remapIndex[i1]); - ++i0; - --i1; - } - } - - ndInt32 index0 = remapIndex[i0].m_vertexIndex; - ndFloat64 side0 = plane.Evalue(tmpFormat.m_vertex[index0]); - while (side0 <= ndFloat32(0.0f) && (i0 < cluster.m_count)) - { - ++i0; - index0 = remapIndex[i0].m_vertexIndex; - side0 = plane.Evalue(tmpFormat.m_vertex[index0]); - }; - - #ifdef _DEBUG - for (ndInt32 i = 0; i < i0; ++i) - { - ndInt32 index = remapIndex[i].m_vertexIndex; - ndFloat64 side = plane.Evalue(tmpFormat.m_vertex[index]); - ndAssert(side <= ndFloat32(0.0f)); - } - - for (ndInt32 i = i0; i < cluster.m_count; ++i) - { - ndInt32 index = remapIndex[i].m_vertexIndex; - ndFloat64 side = plane.Evalue(tmpFormat.m_vertex[index]); - ndAssert(side > ndFloat32(0.0f)); - } - #endif - - ndBigVector xc(ndBigVector::m_zero); - ndBigVector x2c(ndBigVector::m_zero); - for (ndInt32 i = 0; i < i0; ++i) - { - ndInt32 index = remapIndex[i].m_vertexIndex; - ndBigVector x(tmpFormat.m_vertex[index]); - xc += x; - x2c += x * x; - } - - ndSortCluster cluster_i1(cluster); - cluster_i1.m_start = cluster.m_start + i0; - cluster_i1.m_count = cluster.m_count - i0; - cluster_i1.m_sum -= xc; - cluster_i1.m_sum2 -= x2c; - spliteStack[stack] = cluster_i1; - stack++; - - ndSortCluster cluster_i0(cluster); - cluster_i0.m_start = cluster.m_start; - cluster_i0.m_count = i0; - cluster_i0.m_sum = xc; - cluster_i0.m_sum2 = x2c; - spliteStack[stack] = cluster_i0; - stack++; - } - } - } - else - { - tmpFormat.CompressData(*this, indexList, indirectList, cluster, tol); - } -} - -void ndMeshEffect::ndAttibutFormat::CompressData( - ndAttibutFormat& output, const ndPointFormat& points, ndInt32* const indexList, - ndSortKey* const remapIndex, const ndSortCluster& cluster, ndFloat32 tol) -{ - const ndBigVector origin (cluster.m_sum.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count)); - const ndBigVector x2c (cluster.m_sum2.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count) - origin * origin); - const ndBigVector variance((x2c.GetMax(ndVector::m_zero)).Sqrt()); - - ndInt32 firstSortAxis = 0; - if ((variance.m_y >= variance.m_x) && (variance.m_y >= variance.m_z)) - { - firstSortAxis = 1; - } - else if ((variance.m_z >= variance.m_x) && (variance.m_z >= variance.m_y)) - { - firstSortAxis = 2; - } - - ndVertexSortData sortContext; - sortContext.m_points = &points.m_vertex; - sortContext.m_vertexSortIndex = firstSortAxis; - - class CompareKey - { - public: - CompareKey(void* const context) - :m_context(context) - { - } - - ndInt32 Compare(const ndSortKey& elementA, const ndSortKey& elementB) const - { - return ndMeshEffect::ndFormat::CompareVertex(&elementA, &elementB, m_context); - } - - void* m_context; - }; - ndSort(remapIndex, cluster.m_count, &sortContext); - - const ndFloat64 minDist = ndMin(ndMin(variance.m_x, variance.m_y), variance.m_z); - const ndFloat64 tolerance = ndMax(ndMin(minDist, ndFloat64(tol)), ndFloat64(1.0e-8f)); - const ndFloat64 sweptWindow = ndFloat64(2.0f) * tolerance; - - const ndInt32 base = ndInt32(output.m_pointChannel.GetCount()); - - ndInt32 newCount = 0; - for (ndInt32 i = 0; i < cluster.m_count; ++i) - { - const ndInt32 ii = remapIndex[i].m_mask; - if (ii == -1) - { - const ndInt32 i0 = remapIndex[i].m_ordinal; - const ndInt32 iii = remapIndex[i].m_vertexIndex; - const ndFloat64 swept = points.m_vertex[iii][firstSortAxis] + sweptWindow; - for (ndInt32 j = i + 1; j < cluster.m_count; ++j) - { - const ndInt32 jj = remapIndex[j].m_mask; - if (jj == -1) - { - const ndInt32 j0 = remapIndex[j].m_ordinal; - const ndInt32 jjj = remapIndex[j].m_vertexIndex;; - ndFloat64 val = points.m_vertex[jjj][firstSortAxis]; - if (val >= swept) - { - break; - } - - bool test = true; - if (iii != jjj) - { - ndBigVector dp(points.m_vertex[iii] - points.m_vertex[jjj]); - for (ndInt32 k = 0; k < 3; ++k) - { - test &= (fabs(dp[k]) <= tolerance); - } - } - if (test && points.m_layers.m_isValid) - { - test &= (points.m_layers[iii] == points.m_layers[jjj]); - } - if (test && points.m_skinWeights.m_isValid) - { - for (ndInt32 k = 0; k < ND_VERTEX_WEIGHT_SIZE; ++k) - { - test &= (points.m_skinWeights[iii].m_boneId[k] == points.m_skinWeights[jjj].m_boneId[k]); - test &= (points.m_skinWeights[iii].m_weight[k] == points.m_skinWeights[jjj].m_weight[k]); - } - } - - if (test && m_normalChannel.m_isValid) - { - ndVector n0(m_normalChannel[i0].m_x, m_normalChannel[i0].m_y, m_normalChannel[i0].m_z, ndFloat32(0.0f)); - ndVector n1(m_normalChannel[j0].m_x, m_normalChannel[j0].m_y, m_normalChannel[j0].m_z, ndFloat32(0.0f)); - ndVector dp(n1 - n0); - for (ndInt32 k = 0; k < 3; ++k) - { - test &= (fabs(dp[k]) <= tolerance); - } - } - - if (test && m_binormalChannel.m_isValid) - { - ndVector n0(m_binormalChannel[i0].m_x, m_binormalChannel[i0].m_y, m_binormalChannel[i0].m_z, ndFloat32(0.0f)); - ndVector n1(m_binormalChannel[j0].m_x, m_binormalChannel[j0].m_y, m_binormalChannel[j0].m_z, ndFloat32(0.0f)); - ndVector dp(n1 - n0); - for (ndInt32 k = 0; k < 3; ++k) - { - test &= (fabs(dp[k]) <= tolerance); - } - } - - if (test && m_uv0Channel.m_isValid) - { - ndVector n0(m_uv0Channel[i0].m_u, m_uv0Channel[i0].m_v, ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector n1(m_uv0Channel[j0].m_u, m_uv0Channel[j0].m_v, ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector dp(n1 - n0); - for (ndInt32 k = 0; k < 2; ++k) - { - test &= (fabs(dp[k]) <= tolerance); - } - } - - if (test && m_uv1Channel.m_isValid) - { - ndVector n0(m_uv1Channel[i0].m_u, m_uv1Channel[i0].m_v, ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector n1(m_uv1Channel[j0].m_u, m_uv1Channel[j0].m_v, ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector dp(n1 - n0); - for (ndInt32 k = 0; k < 2; ++k) - { - test &= (fabs(dp[k]) <= tolerance); - } - } - - if (test && m_colorChannel.m_isValid) - { - const ndVector colorI(m_colorChannel[i0].m_x, m_colorChannel[i0].m_y, m_colorChannel[i0].m_z, m_colorChannel[i0].m_w); - const ndVector colorJ(m_colorChannel[j0].m_x, m_colorChannel[j0].m_y, m_colorChannel[j0].m_z, m_colorChannel[j0].m_w); - const ndVector dp(colorI - colorJ); - for (ndInt32 k = 0; k < 3; ++k) - { - test &= (fabs(dp[k]) <= tolerance); - } - } - - if (test && m_materialChannel.m_isValid) - { - test &= (m_materialChannel[i0] == m_materialChannel[j0]); - } - - if (test) - { - remapIndex[j].m_mask = newCount + base; - } - } - } - - remapIndex[newCount].m_attibuteIndex = remapIndex[i].m_attibuteIndex; - remapIndex[newCount].m_vertexIndex = remapIndex[i].m_vertexIndex; - remapIndex[i].m_mask = newCount + base; - newCount++; - } - } - - for (ndInt32 i = 0; i < newCount; ++i) - { - output.m_pointChannel.PushBack(remapIndex[i].m_vertexIndex); - } - - if (m_normalChannel.m_isValid) - { - for (ndInt32 i = 0; i < newCount; ++i) - { - output.m_normalChannel.PushBack(m_normalChannel[remapIndex[i].m_attibuteIndex]); - } - } - - if (m_binormalChannel.m_isValid) - { - for (ndInt32 i = 0; i < newCount; ++i) - { - output.m_binormalChannel.PushBack(m_binormalChannel[remapIndex[i].m_attibuteIndex]); - } - } - - if (m_uv0Channel.m_isValid) - { - for (ndInt32 i = 0; i < newCount; ++i) - { - output.m_uv0Channel.PushBack(m_uv0Channel[remapIndex[i].m_attibuteIndex]); - } - } - - if (m_uv1Channel.m_isValid) - { - for (ndInt32 i = 0; i < newCount; ++i) - { - output.m_uv1Channel.PushBack(m_uv1Channel[remapIndex[i].m_attibuteIndex]); - } - } - - if (m_colorChannel.m_isValid) - { - for (ndInt32 i = 0; i < newCount; ++i) - { - output.m_colorChannel.PushBack(m_colorChannel[remapIndex[i].m_attibuteIndex]); - } - } - - if (m_materialChannel.m_isValid) - { - for (ndInt32 i = 0; i < newCount; ++i) - { - output.m_materialChannel.PushBack(m_materialChannel[remapIndex[i].m_attibuteIndex]); - } - } - - for (ndInt32 i = 0; i < cluster.m_count; ++i) - { - ndInt32 i1 = remapIndex[i].m_ordinal; - ndInt32 index = remapIndex[i].m_mask; - indexList[i1] = index; - } -} - -void ndMeshEffect::ndAttibutFormat::CompactVertexData(const ndPointFormat& points, ndInt32* const indexList, ndFloat32 tol) -{ - ndAttibutFormat tmpFormat(*this); - Clear(); - - ndSortCluster cluster; - cluster.m_start = 0; - cluster.m_sum = ndBigVector::m_zero; - cluster.m_sum2 = ndBigVector::m_zero; - cluster.m_count = ndInt32(tmpFormat.m_pointChannel.GetCount()); - ndStack indirectListBuffer(cluster.m_count); - ndSortKey* const indirectList = &indirectListBuffer[0]; - - for (ndInt32 i = 0; i < cluster.m_count; ++i) - { - ndInt32 index = tmpFormat.m_pointChannel[i]; - indirectList[i].m_mask = -1; - indirectList[i].m_ordinal = i; - indirectList[i].m_attibuteIndex = i; - indirectList[i].m_vertexIndex = index; - - const ndBigVector x(points.m_vertex[index]); - cluster.m_sum += x; - cluster.m_sum2 += x * x; - } - - if (cluster.m_count > D_VERTEXLIST_INDEX_LIST_BASH) - { - ndSortCluster spliteStack[128]; - spliteStack[0] = cluster; - - ndInt32 stack = 1; - while (stack) - { - stack--; - - cluster = spliteStack[stack]; - ndSortKey* const remapIndex = &indirectList[cluster.m_start]; - - const ndBigVector origin(cluster.m_sum.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count)); - const ndBigVector variance2(cluster.m_sum2.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count) - origin * origin); - ndFloat64 maxVariance2 = ndMax(ndMax(variance2.m_x, variance2.m_y), variance2.m_z); - - if ((cluster.m_count <= D_VERTEXLIST_INDEX_LIST_BASH) || (stack > (ndInt32 (sizeof (spliteStack) / sizeof (spliteStack[0])) - 4)) || (maxVariance2 < ndFloat32(4.0f))) - { - tmpFormat.CompressData(*this, points, indexList, remapIndex, cluster, tol); - } - else - { - ndInt32 firstSortAxis = 0; - if ((variance2.m_y >= variance2.m_x) && (variance2.m_y >= variance2.m_z)) - { - firstSortAxis = 1; - } - else if ((variance2.m_z >= variance2.m_x) && (variance2.m_z >= variance2.m_y)) - { - firstSortAxis = 2; - } - - ndBigPlane plane(ndFloat32(0.0f)); - plane[firstSortAxis] = ndFloat32(1.0f); - plane.m_w = -origin[firstSortAxis]; - - ndInt32 i0 = 0; - ndInt32 i1 = cluster.m_count - 1; - while (i0 < i1) - { - ndInt32 index0 = remapIndex[i0].m_vertexIndex; - ndFloat64 side = plane.Evalue(points.m_vertex[index0]); - while (side <= ndFloat32(0.0f) && (i0 < i1)) - { - ++i0; - index0 = remapIndex[i0].m_vertexIndex; - side = plane.Evalue(points.m_vertex[index0]); - }; - - ndInt32 index1 = remapIndex[i1].m_vertexIndex; - side = plane.Evalue(points.m_vertex[index1]); - while (side > ndFloat32(0.0f) && (i0 < i1)) - { - --i1; - index1 = remapIndex[i1].m_vertexIndex; - side = plane.Evalue(points.m_vertex[index1]); - } - - ndAssert(i0 <= i1); - if (i0 < i1) - { - ndSwap(remapIndex[i0], remapIndex[i1]); - ++i0; - --i1; - } - } - - ndInt32 index0 = remapIndex[i0].m_vertexIndex; - ndFloat64 side0 = plane.Evalue(points.m_vertex[index0]); - while (side0 <= ndFloat32(0.0f) && (i0 < cluster.m_count)) - { - ++i0; - index0 = remapIndex[i0].m_vertexIndex; - side0 = plane.Evalue(points.m_vertex[index0]); - }; - - #ifdef _DEBUG - for (ndInt32 i = 0; i < i0; ++i) - { - ndInt32 index = remapIndex[i].m_vertexIndex; - ndFloat64 side = plane.Evalue(points.m_vertex[index]); - ndAssert(side <= ndFloat32(0.0f)); - } - - for (ndInt32 i = i0; i < cluster.m_count; ++i) - { - ndInt32 index = remapIndex[i].m_vertexIndex; - ndFloat64 side = plane.Evalue(points.m_vertex[index]); - ndAssert(side > ndFloat32(0.0f)); - } - #endif - - ndBigVector xc(ndBigVector::m_zero); - ndBigVector x2c(ndBigVector::m_zero); - ndBigVector maxP(ndFloat64(-1.0e20f)); - for (ndInt32 i = 0; i < i0; ++i) - { - ndInt32 index = remapIndex[i].m_vertexIndex; - const ndBigVector x(points.m_vertex[index]); - xc += x; - x2c += x * x; - maxP = maxP.GetMax(x); - } - - ndSortCluster cluster_i1(cluster); - cluster_i1.m_start = cluster.m_start + i0; - cluster_i1.m_count = cluster.m_count - i0; - cluster_i1.m_sum -= xc; - cluster_i1.m_sum2 -= x2c; - spliteStack[stack] = cluster_i1; - stack++; - - ndSortCluster cluster_i0(cluster); - cluster_i0.m_start = cluster.m_start; - cluster_i0.m_count = i0; - cluster_i0.m_sum = xc; - cluster_i0.m_sum2 = x2c; - spliteStack[stack] = cluster_i0; - stack++; - } - } - } - else - { - tmpFormat.CompressData(*this, points, indexList, indirectList, cluster, tol); - } -} - -ndMeshEffect::ndMeshEffect() - :ndPolyhedra() - ,m_name() - ,m_points() - ,m_attrib() - ,m_materials() - ,m_vertexBaseCount(-1) - ,m_constructionIndex(0) -{ - Init(); -} - -ndMeshEffect::ndMeshEffect(ndPolyhedra& mesh, const ndMeshEffect& source) - :ndPolyhedra(mesh) - ,m_points(source.m_points) - ,m_attrib(source.m_attrib) - ,m_materials(source.m_materials) - ,m_vertexBaseCount(-1) - ,m_constructionIndex(0) -{ - Init(); -} - -ndMeshEffect::ndMeshEffect(const ndMeshEffect& source) - :ndPolyhedra(source) - ,m_points(source.m_points) - ,m_attrib(source.m_attrib) - ,m_materials(source.m_materials) - ,m_vertexBaseCount(-1) - ,m_constructionIndex(0) -{ - Init(); -} - -ndMeshEffect::~ndMeshEffect() -{ -} - -void ndMeshEffect::Init() -{ -} - -bool ndMeshEffect::Sanity() const -{ - #ifdef _DEBUG - ndMeshEffect::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - ndAssert(edge->m_twin); - ndAssert(edge->m_next); - ndAssert(edge->m_prev); - ndAssert(edge->m_twin->m_twin == edge); - ndAssert(edge->m_next->m_incidentVertex == edge->m_twin->m_incidentVertex); - ndAssert(edge->m_incidentVertex == edge->m_twin->m_next->m_incidentVertex); - } - #endif - return true; -} - -void ndMeshEffect::BeginBuildFace() -{ - m_constructionIndex = ndInt32(m_points.m_vertex.GetCount()); -} - -void ndMeshEffect::AddPoint(ndFloat64 x, ndFloat64 y, ndFloat64 z) -{ - m_attrib.m_pointChannel.PushBack(ndInt32(m_points.m_vertex.GetCount())); - const ndBigVector point(QuantizeCordinade(x), QuantizeCordinade(y), QuantizeCordinade(z), ndFloat64(0.0f)); - m_points.m_vertex.PushBack(point); -} - -void ndMeshEffect::AddLayer(ndInt32 layer) -{ - m_points.m_layers.PushBack(layer); -} - -void ndMeshEffect::AddVertexColor(ndFloat32 x, ndFloat32 y, ndFloat32 z, ndFloat32 w) -{ - m_attrib.m_colorChannel.PushBack(ndColor(x, y, z, w)); -} - -void ndMeshEffect::AddNormal(ndFloat32 x, ndFloat32 y, ndFloat32 z) -{ - m_attrib.m_normalChannel.PushBack(ndNormal(x, y, z)); -} - -void ndMeshEffect::AddBinormal(ndFloat32 x, ndFloat32 y, ndFloat32 z) -{ - m_attrib.m_binormalChannel.PushBack(ndNormal(x, y, z)); -} - -void ndMeshEffect::AddUV0(ndFloat32 u, ndFloat32 v) -{ - m_attrib.m_uv0Channel.PushBack(ndUV(u, v)); -} - -void ndMeshEffect::AddUV1(ndFloat32 u, ndFloat32 v) -{ - m_attrib.m_uv1Channel.PushBack(ndUV(u, v)); -} - -void ndMeshEffect::AddMaterial(ndInt32 materialIndex) -{ - m_attrib.m_materialChannel.PushBack(materialIndex); -} - -void ndMeshEffect::EndBuildFace() -{ - ndInt32 count = ndInt32 (m_points.m_vertex.GetCount()) - m_constructionIndex; - if (count > 3) - { - ndInt32 indexList[256]; - - ndAssert(count < ndInt32(sizeof(indexList) / sizeof(indexList[0]))); - ndPolyhedra polygon; - ndPointFormat points; - ndAttibutFormat attibutes; - - for (ndInt32 i = 0; i < count; ++i) - { - indexList[i] = i; - - points.m_vertex.PushBack(m_points.m_vertex[m_constructionIndex + i]); - if (m_points.m_layers.GetCount()) - { - points.m_layers.PushBack(m_points.m_layers[m_constructionIndex + i]); - } - - if (m_attrib.m_materialChannel.GetCount()) - { - attibutes.m_materialChannel.PushBack(m_attrib.m_materialChannel[m_constructionIndex + i]); - } - - if (m_attrib.m_normalChannel.GetCount()) - { - attibutes.m_normalChannel.PushBack(m_attrib.m_normalChannel[m_constructionIndex + i]); - } - - if (m_attrib.m_binormalChannel.GetCount()) - { - attibutes.m_binormalChannel.PushBack(m_attrib.m_binormalChannel[m_constructionIndex + i]); - } - - if (m_attrib.m_colorChannel.GetCount()) - { - attibutes.m_colorChannel.PushBack(m_attrib.m_colorChannel[m_constructionIndex + i]); - } - - if (m_attrib.m_uv0Channel.GetCount()) - { - attibutes.m_uv0Channel.PushBack(m_attrib.m_uv0Channel[m_constructionIndex + i]); - } - - if (m_attrib.m_uv1Channel.GetCount()) - { - attibutes.m_uv1Channel.PushBack(m_attrib.m_uv1Channel[m_constructionIndex + i]); - } - } - - polygon.BeginFace(); - polygon.AddFace(count, indexList, nullptr); - polygon.EndFace(); - polygon.Triangulate(&points.m_vertex[0].m_x, sizeof(ndBigVector), nullptr); - - ndInt32 mark = polygon.IncLRU(); - ndPolyhedra::Iterator iter(polygon); - - m_points.m_vertex.SetCount(m_constructionIndex); - m_attrib.SetCount(GetPropertiesCount() - count); - - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if ((edge->m_incidentFace > 0) && (edge->m_mark < mark)) - { - ndInt32 i0 = edge->m_incidentVertex; - ndInt32 i1 = edge->m_next->m_incidentVertex; - ndInt32 i2 = edge->m_next->m_next->m_incidentVertex; - edge->m_mark = mark; - edge->m_next->m_mark = mark; - edge->m_next->m_next->m_mark = mark; - - const ndBigVector& p0 = points.m_vertex[i0]; - const ndBigVector& p1 = points.m_vertex[i1]; - const ndBigVector& p2 = points.m_vertex[i2]; - - ndBigVector e1(p1 - p0); - ndBigVector e2(p2 - p0); - ndBigVector n(e1.CrossProduct(e2)); - - ndAssert(e1.m_w == ndFloat32(0.0f)); - ndAssert(e2.m_w == ndFloat32(0.0f)); - ndAssert(n.m_w == ndFloat32(0.0f)); - - ndFloat64 mag3 = n.DotProduct(n).GetScalar(); - if (mag3 >= ndFloat64(DG_MESH_EFFECT_PRECISION_SCALE_INV * DG_MESH_EFFECT_PRECISION_SCALE_INV)) - { - ndInt32 index[] = { i0, i1, i2 }; - for (ndInt32 i = 0; i < 3; ++i) - { - ndInt32 j = index[i]; - AddPoint(points.m_vertex[j].m_x, points.m_vertex[j].m_y, points.m_vertex[j].m_z); - if (points.m_layers.GetCount()) - { - AddLayer(points.m_layers[j]); - } - - if (attibutes.m_materialChannel.GetCount()) - { - AddMaterial(attibutes.m_materialChannel[j]); - } - - if (attibutes.m_normalChannel.GetCount()) - { - AddNormal(attibutes.m_normalChannel[j].m_x, attibutes.m_normalChannel[j].m_y, attibutes.m_normalChannel[j].m_z); - } - - if (attibutes.m_binormalChannel.GetCount()) - { - AddBinormal(attibutes.m_binormalChannel[j].m_x, attibutes.m_binormalChannel[j].m_y, attibutes.m_binormalChannel[j].m_z); - } - - if (attibutes.m_colorChannel.GetCount()) - { - AddVertexColor(attibutes.m_colorChannel[j].m_x, attibutes.m_colorChannel[j].m_y, attibutes.m_colorChannel[j].m_z, attibutes.m_colorChannel[j].m_w); - } - - if (attibutes.m_uv0Channel.GetCount()) - { - AddUV0(attibutes.m_uv0Channel[j].m_u, attibutes.m_uv0Channel[j].m_v); - } - - if (attibutes.m_uv1Channel.GetCount()) - { - AddUV1(attibutes.m_uv1Channel[j].m_u, attibutes.m_uv1Channel[j].m_v); - } - } - } - } - } - } - else - { - const ndBigVector& p0 = m_points.m_vertex[m_constructionIndex + 0]; - const ndBigVector& p1 = m_points.m_vertex[m_constructionIndex + 1]; - const ndBigVector& p2 = m_points.m_vertex[m_constructionIndex + 2]; - - ndBigVector e1(p1 - p0); - ndBigVector e2(p2 - p0); - ndBigVector n(e1.CrossProduct(e2)); - ndAssert(e1.m_w == ndFloat32(0.0f)); - ndAssert(e2.m_w == ndFloat32(0.0f)); - ndAssert(n.m_w == ndFloat32(0.0f)); - - ndFloat64 mag3 = n.DotProduct(n).GetScalar(); - if (mag3 < ndFloat64(DG_MESH_EFFECT_PRECISION_SCALE_INV * DG_MESH_EFFECT_PRECISION_SCALE_INV)) - { - m_attrib.SetCount(m_constructionIndex); - m_points.SetCount(m_constructionIndex); - } - } -} - -void ndMeshEffect::BeginBuild() -{ - m_points.Clear(); - m_attrib.Clear(); - RemoveAll(); - BeginFace(); - m_vertexBaseCount = -1; - m_constructionIndex = 0; -} - -void ndMeshEffect::EndBuild(bool fixTjoint) -{ - #ifdef _DEBUG - for (ndInt32 i = 0; i < m_points.m_vertex.GetCount(); i += 3) - { - ndBigVector p0(m_points.m_vertex[i + 0]); - ndBigVector p1(m_points.m_vertex[i + 1]); - ndBigVector p2(m_points.m_vertex[i + 2]); - ndBigVector e1(p1 - p0); - ndBigVector e2(p2 - p0); - ndBigVector n(e1.CrossProduct(e2)); - - ndAssert(e1.m_w == ndFloat32(0.0f)); - ndAssert(e2.m_w == ndFloat32(0.0f)); - ndAssert(n.m_w == ndFloat32(0.0f)); - ndFloat64 mag2 = n.DotProduct(n).GetScalar(); - ndAssert(mag2 > ndFloat32(0.0f)); - } - #endif - - ndInt32 triangCount = ndInt32 (m_points.m_vertex.GetCount() / 3); - const ndInt32* const indexList = &m_attrib.m_pointChannel[0]; - for (ndInt32 i = 0; i < triangCount; ++i) - { - ndInt32 index[3]; - ndInt64 userdata[3]; - - index[0] = indexList[i * 3 + 0]; - index[1] = indexList[i * 3 + 1]; - index[2] = indexList[i * 3 + 2]; - - ndBigVector e1(m_points.m_vertex[index[1]] - m_points.m_vertex[index[0]]); - ndBigVector e2(m_points.m_vertex[index[2]] - m_points.m_vertex[index[0]]); - ndBigVector n(e1.CrossProduct(e2)); - - ndAssert(e1.m_w == ndFloat32(0.0f)); - ndAssert(e2.m_w == ndFloat32(0.0f)); - ndAssert(n.m_w == ndFloat32(0.0f)); - ndFloat64 mag2 = n.DotProduct(n).GetScalar(); - if (mag2 > ndFloat64(1.0e-12f)) - { - userdata[0] = i * 3 + 0; - userdata[1] = i * 3 + 1; - userdata[2] = i * 3 + 2; - ndEdge* const edge = AddFace(3, index, userdata); - if (!edge) - { - ndAssert(0); - /* - //ndAssert ((m_pointCount + 3) <= m_maxPointCount); - m_points[m_pointCount + 0] = m_points[index[0]]; - m_points[m_pointCount + 1] = m_points[index[1]]; - m_points[m_pointCount + 2] = m_points[index[2]]; - - index[0] = m_pointCount + 0; - index[1] = m_pointCount + 1; - index[2] = m_pointCount + 2; - - m_pointCount += 3; - - #ifdef _DEBUG - ndEdge* test = AddFace (3, index, userdata); - ndAssert (test); - #else - AddFace (3, index, userdata); - #endif - */ - } - } - } - EndFace(); - - PackAttibuteData(); - PackPoints(); - - if (fixTjoint) - { - RepairTJoints(); - } - - #ifdef _DEBUG - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const face = &(*iter); - if (face->m_incidentFace > 0) - { - ndBigVector p0(m_points.m_vertex[face->m_incidentVertex]); - ndBigVector p1(m_points.m_vertex[face->m_next->m_incidentVertex]); - ndBigVector p2(m_points.m_vertex[face->m_next->m_next->m_incidentVertex]); - ndBigVector e1(p1 - p0); - ndBigVector e2(p2 - p0); - ndBigVector n(e1.CrossProduct(e2)); - - ndAssert(e1.m_w == ndFloat32(0.0f)); - ndAssert(e2.m_w == ndFloat32(0.0f)); - ndAssert(n.m_w == ndFloat32(0.0f)); - ndFloat64 mag2 = n.DotProduct(n).GetScalar(); - ndAssert(mag2 >= ndFloat32(0.0f)); - } - } - #endif -} - -void ndMeshEffect::BeginFace() -{ - ndPolyhedra::BeginFace(); -} - -bool ndMeshEffect::EndFace() -{ - ndPolyhedra::EndFace(); - bool state = false; - for (bool hasVertexCollision = true; hasVertexCollision;) - { - hasVertexCollision = false; - const ndInt32 currentCount = ndInt32(m_points.m_vertex.GetCount()); - ndStack verterCollisionBuffer(currentCount); - ndInt8* const verterCollision = &verterCollisionBuffer[0]; - ndMemSet(&verterCollision[0], ndInt8(0), currentCount); - - Iterator iter(*this); - ndInt32 mark = IncLRU(); - ndList collisionFound; - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if (edge->m_mark != mark) - { - if ((edge->m_incidentVertex < currentCount) && (verterCollision[edge->m_incidentVertex] == 0)) - { - verterCollision[edge->m_incidentVertex] = 1; - } - else - { - hasVertexCollision = true; - collisionFound.Append(iter.GetNode()); - } - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - } - } - - ndAssert(!collisionFound.GetFirst() || Sanity()); - for (ndList::ndNode* node = collisionFound.GetFirst(); node; node = node->GetNext()) - { - state = true; - ndEdge* const edge = &node->GetInfo()->GetInfo(); - - // this is a vertex collision - m_points.m_vertex.PushBack(m_points.m_vertex[edge->m_incidentVertex]); - if (m_points.m_layers.GetCount()) - { - m_points.m_layers.PushBack(m_points.m_layers[edge->m_incidentVertex]); - } - if (m_points.m_skinWeights.GetCount()) - { - m_points.m_skinWeights.PushBack(m_points.m_skinWeights[edge->m_incidentVertex]); - } - - ndEdge* ptr = edge; - do - { - if (ptr->m_incidentFace > 0) - { - ndInt32 index = ndInt32(ptr->m_userData); - m_attrib.m_pointChannel.PushBack(ndInt32(m_points.m_vertex.GetCount()) - 1); - if (m_attrib.m_materialChannel.GetCount()) - { - m_attrib.m_materialChannel.PushBack(m_attrib.m_materialChannel[index]); - } - if (m_attrib.m_normalChannel.GetCount()) - { - m_attrib.m_normalChannel.PushBack(m_attrib.m_normalChannel[index]); - } - if (m_attrib.m_binormalChannel.GetCount()) - { - m_attrib.m_binormalChannel.PushBack(m_attrib.m_binormalChannel[index]); - } - if (m_attrib.m_colorChannel.GetCount()) - { - m_attrib.m_colorChannel.PushBack(m_attrib.m_colorChannel[index]); - } - if (m_attrib.m_uv0Channel.GetCount()) - { - m_attrib.m_uv0Channel.PushBack(m_attrib.m_uv0Channel[index]); - } - if (m_attrib.m_uv1Channel.GetCount()) - { - m_attrib.m_uv1Channel.PushBack(m_attrib.m_uv1Channel[index]); - } - ptr->m_userData = ndUnsigned64(m_attrib.m_pointChannel.GetCount() - 1); - } - - ndNode* const edgeNode = GetNodeFromInfo(*ptr); - ndPairKey edgeKey(ptr->m_incidentVertex, ptr->m_twin->m_incidentVertex); - ReplaceKey(edgeNode, edgeKey.GetVal()); - - ndNode* const twinNode = GetNodeFromInfo(*(ptr->m_twin)); - ndPairKey twinKey(ptr->m_twin->m_incidentVertex, ptr->m_incidentVertex); - ReplaceKey(twinNode, twinKey.GetVal()); - - ptr->m_incidentVertex = ndInt32(m_points.m_vertex.GetCount()) - 1; - - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - } - ndAssert(!collisionFound.GetFirst() || Sanity()); - } - - return !state; -} - -void ndMeshEffect::BuildFromIndexList(const ndMeshVertexFormat* const format) -{ - BeginBuild(); - ndAssert(format->m_vertex.m_data); - ndAssert(format->m_vertex.m_indexList); - ndAssert(format->m_vertex.m_strideInBytes); - - // calculate vertex Count - ndInt32 vertexCount = 0; - ndInt32 maxAttribCount = 0; - for (ndInt32 j = 0; j < format->m_faceCount; ++j) - { - ndInt32 count = format->m_faceIndexCount[j]; - for (ndInt32 i = 0; i < count; ++i) - { - vertexCount = ndMax(vertexCount, format->m_vertex.m_indexList[maxAttribCount + i] + 1); - } - maxAttribCount += count; - } - m_vertexBaseCount = vertexCount; - - ndInt32 layerIndex = 0; - ndInt32 vertexStride = ndInt32(format->m_vertex.m_strideInBytes / sizeof(ndFloat64)); - const ndFloat64* const vertex = format->m_vertex.m_data; - - m_points.SetCount(0); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - ndInt32 index = i * vertexStride; - m_points.m_layers.PushBack(layerIndex); - ndBigVector p(vertex[index + 0], vertex[index + 1], vertex[index + 2], ndFloat64(0.0f)); - m_points.m_vertex.PushBack(p); - } - if (format->m_vertexWeight.m_data) - { - for (ndInt32 i = 0; i < vertexCount; ++i) - { - m_points.m_skinWeights.PushBack(format->m_vertexWeight.m_data[i]); - } - } - - bool pendingFaces = true; - //ndInt32 layerBase = 0; - ndInt32 attributeCount = 0; - - ndInt32 uv0Stride = ndInt32(format->m_uv0.m_strideInBytes / sizeof(ndReal)); - ndInt32 uv1Stride = ndInt32(format->m_uv1.m_strideInBytes / sizeof(ndReal)); - ndInt32 normalStride = ndInt32(format->m_normal.m_strideInBytes / sizeof(ndReal)); - ndInt32 binormalStride = ndInt32(format->m_binormal.m_strideInBytes / sizeof(ndReal)); - ndInt32 vertexColorStride = ndInt32(format->m_vertexColor.m_strideInBytes / sizeof(ndReal)); - //ndInt32 vertexWeightStride = ndInt32(format->m_vertexWeight.m_strideInBytes / sizeof(ndVertexWeight)); - - ndStack faceMark(format->m_faceCount); - ndMemSet(&faceMark[0], ndInt8(0), format->m_faceCount); - const ndInt32* const vertexIndex = format->m_vertex.m_indexList; - - while (pendingFaces) - { - ndInt32 acc = 0; - pendingFaces = false; - ndInt32 vertexBank = layerIndex * vertexCount; - for (ndInt32 j = 0; j < format->m_faceCount; ++j) - { - ndInt32 indexCount = format->m_faceIndexCount[j]; - - if (indexCount > 0) - { - ndInt32 index[256]; - ndInt64 userdata[256]; - ndAssert(indexCount >= 3); - ndAssert(indexCount < ndInt32(sizeof(index) / sizeof(index[0]))); - - if (!faceMark[j]) - { - for (ndInt32 i = 0; i < indexCount; ++i) - { - ndInt32 k = attributeCount + i; - userdata[i] = k; - index[i] = vertexIndex[acc + i] + vertexBank; - } - - ndEdge* const edge = AddFace(indexCount, index, userdata); - if (edge) - { - faceMark[j] = 1; - for (ndInt32 i = 0; i < indexCount; ++i) - { - m_attrib.m_pointChannel.PushBack(index[i]); - } - - if (format->m_faceMaterial) - { - ndInt32 materialIndex = format->m_faceMaterial[j]; - for (ndInt32 i = 0; i < indexCount; ++i) - { - m_attrib.m_materialChannel.PushBack(materialIndex); - } - } - - if (format->m_normal.m_data) - { - for (ndInt32 i = 0; i < indexCount; ++i) - { - ndInt32 k = attributeCount + i; - ndInt32 m = format->m_normal.m_indexList[k] * normalStride; - ndFloat32 x = format->m_normal.m_data[m + 0]; - ndFloat32 y = format->m_normal.m_data[m + 1]; - ndFloat32 z = format->m_normal.m_data[m + 2]; - m_attrib.m_normalChannel.PushBack(ndNormal(x, y, z)); - } - } - - if (format->m_binormal.m_data) - { - for (ndInt32 i = 0; i < indexCount; ++i) - { - ndInt32 k = attributeCount + i; - ndInt32 m = format->m_binormal.m_indexList[k] * binormalStride; - ndFloat32 x = format->m_binormal.m_data[m + 0]; - ndFloat32 y = format->m_binormal.m_data[m + 1]; - ndFloat32 z = format->m_binormal.m_data[m + 2]; - m_attrib.m_binormalChannel.PushBack(ndNormal(x, y, z)); - } - } - - if (format->m_vertexColor.m_data) - { - for (ndInt32 i = 0; i < indexCount; ++i) - { - ndInt32 k = attributeCount + i; - ndInt32 m = format->m_vertexColor.m_indexList[k] * vertexColorStride; - ndColor color(format->m_vertexColor.m_data[m + 0], format->m_vertexColor.m_data[m + 1], format->m_vertexColor.m_data[m + 2], format->m_vertexColor.m_data[m + 3]); - m_attrib.m_colorChannel.PushBack(color); - } - } - - if (format->m_uv0.m_data) - { - for (ndInt32 i = 0; i < indexCount; ++i) - { - ndInt32 k = attributeCount + i; - ndInt32 m = format->m_uv0.m_indexList[k] * uv0Stride; - ndFloat32 u = format->m_uv0.m_data[m + 0]; - ndFloat32 v = format->m_uv0.m_data[m + 1]; - m_attrib.m_uv0Channel.PushBack(ndUV(u, v)); - } - } - - if (format->m_uv1.m_data) - { - for (ndInt32 i = 0; i < indexCount; ++i) - { - ndInt32 k = attributeCount + i; - ndInt32 m = format->m_uv1.m_indexList[k] * uv1Stride; - ndFloat32 u = format->m_uv1.m_data[m + 0]; - ndFloat32 v = format->m_uv1.m_data[m + 1]; - m_attrib.m_uv1Channel.PushBack(ndUV(u, v)); - } - } - attributeCount += indexCount; - } - else - { - // check if the face is not degenerated - bool degeneratedFace = false; - for (ndInt32 i = 0; i < indexCount - 1; ++i) - { - for (ndInt32 k = i + 1; k < indexCount; ++k) - { - if (index[i] == index[k]) - { - degeneratedFace = true; - } - } - } - if (degeneratedFace) - { - faceMark[j] = 1; - } - else - { - pendingFaces = true; - } - } - } - acc += indexCount; - } - } - - if (pendingFaces) - { - ndAssert (0); - layerIndex++; - //layerBase += vertexCount; - for (ndInt32 i = 0; i < vertexCount; ++i) - { - m_points.m_layers.PushBack(layerIndex); - ndInt32 index = i * vertexStride; - ndBigVector p(vertex[index + 0], vertex[index + 1], vertex[index + 2], vertex[index + 3]); - m_points.m_vertex.PushBack(p); - } - if (format->m_vertexWeight.m_data) - { - ndAssert(0); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - m_points.m_skinWeights.PushBack(format->m_vertexWeight.m_data[i]); - } - } - } - } - - ndAssert(m_attrib.m_pointChannel.GetCount() == attributeCount); - ndAssert(m_points.m_vertex.GetCount() == vertexCount * (layerIndex + 1)); - ndAssert(!format->m_vertexWeight.m_data || (m_points.m_skinWeights.GetCount() == vertexCount * (layerIndex + 1))); - - EndFace(); - PackAttibuteData(); -} - -void ndMeshEffect::PackPoints() -{ - ndStackvertexIndexMapBuffer(ndInt32 (m_points.m_vertex.GetCount())); - ndInt32* const vertexIndexMap = &vertexIndexMapBuffer[0]; - m_points.CompactVertexData(&vertexIndexMap[0], ndFloat32 (1.0e-6f)); - - ndInt32 index[DG_MESH_EFFECT_POINT_SPLITED]; - ndInt64 userData[DG_MESH_EFFECT_POINT_SPLITED]; - ndPolyhedra polygon; - SwapInfo(polygon); - ndAssert(GetCount() == 0); - - BeginFace(); - const ndInt32 mark = IncLRU(); - ndPolyhedra::Iterator iter(polygon); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_mark != mark) && (edge->m_incidentFace > 0)) - { - ndEdge* ptr = edge; - ndInt32 indexCount = 0; - do - { - ptr->m_mark = mark; - index[indexCount] = vertexIndexMap[ptr->m_incidentVertex]; - m_attrib.m_pointChannel[ndInt32(ptr->m_userData)] = vertexIndexMap[ptr->m_incidentVertex]; - userData[indexCount] = ndInt64(ptr->m_userData); - - indexCount++; - ptr = ptr->m_next; - } while (ptr != edge); - ndEdge* const face = AddFace(indexCount, index, userData); - - if (!face) - { - ndTrace(("skiping degeneraded face\n")); - //ndAssert (0); - } - } - } - EndFace(); -} - -void ndMeshEffect::UnpackPoints() -{ -ndAssert(0); -#if 0 - - do - { - ndPointFormat points(m_points); - m_points.Clear(); - for (ndInt32 i = 0; i < m_attrib.m_pointChannel.GetCount(); ++i) - { - ndInt32 index = m_attrib.m_pointChannel[i]; - m_points.m_vertex.PushBack(points.m_vertex[index]); - if (points.m_layers.GetCount()) - { - m_points.m_layers.PushBack(points.m_layers[index]); - } - - m_attrib.m_pointChannel[i] = i; - } - - ndInt32 index[DG_MESH_EFFECT_POINT_SPLITED]; - ndInt64 userData[DG_MESH_EFFECT_POINT_SPLITED]; - ndPolyhedra polygon; - SwapInfo(polygon); - ndAssert(GetCount() == 0); - BeginFace(); - const ndInt32 mark = IncLRU(); - ndPolyhedra::Iterator iter(polygon); - for (iter.Begin(); iter; iter++) - { - ndEdge* const face = &(*iter); - if ((face->m_mark != mark) && (face->m_incidentFace > 0)) - { - ndEdge* ptr = face; - ndInt32 indexCount = 0; - do - { - ptr->m_mark = mark; - index[indexCount] = ndInt32(ptr->m_userData); - userData[indexCount] = ndInt64(ptr->m_userData); - indexCount++; - ptr = ptr->m_next; - } while (ptr != face); - AddFace(indexCount, index, userData); - } - } - } while (!EndFace()); - - ndAssert(m_points.m_vertex.GetCount() == m_attrib.m_pointChannel.GetCount()); - #ifdef _DEBUG - for (ndInt32 i = 0; i < m_attrib.m_pointChannel.GetCount(); ++i) - { - ndAssert(m_attrib.m_pointChannel[i] == i); - } - #endif -#endif -} - -void ndMeshEffect::PackAttibuteData() -{ - ndStackattrIndexBuffer(ndInt32(m_attrib.m_pointChannel.GetCount())); - ndInt32* const attrIndexMap = &attrIndexBuffer[0]; - m_attrib.CompactVertexData(m_points, &attrIndexMap[0], ndFloat32(1.0e-6f)); - - Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if (edge->m_incidentFace > 0) - { - edge->m_userData = ndUnsigned64(attrIndexMap[edge->m_userData]); - } - } - - ndMemSet(attrIndexMap, -1, ndInt32(m_attrib.m_pointChannel.GetCount())); - ndAttibutFormat tmpFormat(m_attrib); - m_attrib.Clear(); - - ndInt32 remapIndex = 0; - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if (edge->m_incidentFace > 0) - { - ndInt32 index = ndInt32(edge->m_userData); - if (attrIndexMap[edge->m_userData] == -1) - { - attrIndexMap[index] = remapIndex; - remapIndex++; - - m_attrib.m_pointChannel.PushBack(tmpFormat.m_pointChannel[index]); - if (tmpFormat.m_materialChannel.m_isValid) - { - m_attrib.m_materialChannel.PushBack(tmpFormat.m_materialChannel[index]); - } - if (tmpFormat.m_normalChannel.m_isValid) - { - m_attrib.m_normalChannel.PushBack(tmpFormat.m_normalChannel[index]); - } - if (tmpFormat.m_binormalChannel.m_isValid) - { - m_attrib.m_binormalChannel.PushBack(tmpFormat.m_binormalChannel[index]); - } - if (tmpFormat.m_uv0Channel.m_isValid) - { - m_attrib.m_uv0Channel.PushBack(tmpFormat.m_uv0Channel[index]); - } - if (tmpFormat.m_uv1Channel.m_isValid) - { - m_attrib.m_uv1Channel.PushBack(tmpFormat.m_uv1Channel[index]); - } - if (tmpFormat.m_colorChannel.m_isValid) - { - m_attrib.m_colorChannel.PushBack(tmpFormat.m_colorChannel[index]); - } - } - edge->m_userData = ndUnsigned64(attrIndexMap[index]); - } - } -} - -void ndMeshEffect::UnpackAttibuteData() -{ - ndAttibutFormat attibutes(m_attrib); - m_attrib.Clear(); - - Iterator iter(*this); - ndInt32 attributeCount = 0; - const ndInt32 lru = IncLRU(); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if ((edge->m_incidentFace > 0) && (edge->m_mark != lru)) - { - ndEdge* ptr = edge; - - ptr = edge; - do - { - ptr->m_mark = lru; - m_attrib.m_pointChannel.PushBack(ptr->m_incidentVertex); - - if (attibutes.m_materialChannel.m_isValid) - { - m_attrib.m_materialChannel.PushBack(attibutes.m_materialChannel[ndInt32(ptr->m_userData)]); - } - - if (attibutes.m_normalChannel.m_isValid) - { - m_attrib.m_normalChannel.PushBack(attibutes.m_normalChannel[ndInt32(ptr->m_userData)]); - } - - if (attibutes.m_binormalChannel.m_isValid) - { - m_attrib.m_binormalChannel.PushBack(attibutes.m_binormalChannel[ndInt32(ptr->m_userData)]); - } - - if (attibutes.m_colorChannel.m_isValid) - { - m_attrib.m_colorChannel.PushBack(attibutes.m_colorChannel[ndInt32(ptr->m_userData)]); - } - - if (attibutes.m_uv0Channel.m_isValid) - { - m_attrib.m_uv0Channel.PushBack(attibutes.m_uv0Channel[ndInt32(ptr->m_userData)]); - } - - if (attibutes.m_uv1Channel.m_isValid) - { - m_attrib.m_uv1Channel.PushBack(attibutes.m_uv1Channel[ndInt32(ptr->m_userData)]); - } - - ptr->m_userData = ndUnsigned64(attributeCount); - attributeCount++; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - ndAssert(m_attrib.m_pointChannel.GetCount() == attributeCount); -} - -bool ndMeshEffect::SeparateDuplicateLoops(ndEdge* const face) -{ - for (ndEdge* ptr0 = face; ptr0 != face->m_prev; ptr0 = ptr0->m_next) - { - ndInt32 index = ptr0->m_incidentVertex; - - ndEdge* ptr1 = ptr0->m_next; - do - { - if (ptr1->m_incidentVertex == index) - { - ndEdge* const ptr00 = ptr0->m_prev; - ndEdge* const ptr11 = ptr1->m_prev; - - ptr00->m_next = ptr1; - ptr1->m_prev = ptr00; - - ptr11->m_next = ptr0; - ptr0->m_prev = ptr11; - - return true; - } - ptr1 = ptr1->m_next; - } while (ptr1 != face); - } - return false; -} - -//ndInt32 ndMeshEffect::AddInterpolatedHalfAttribute(ndEdge* const edge, ndInt32 midPoint) -ndInt32 ndMeshEffect::AddInterpolatedHalfAttribute(ndEdge* const, ndInt32) -{ -ndAssert(0); -return 0; -#if 0 - ndBigVector p0(m_points.m_vertex[edge->m_incidentVertex]); - ndBigVector p2(m_points.m_vertex[edge->m_next->m_incidentVertex]); - ndBigVector p1(m_points.m_vertex[midPoint]); - ndBigVector p2p0(p2 - p0); - - ndAssert(p2p0.m_w == ndFloat32(0.0f)); - - ndFloat64 den = p2p0.DotProduct(p2p0).GetScalar(); - ndFloat64 param = p2p0.DotProduct(p1 - p0).GetScalar() / den; - ndFloat64 t1 = param; - ndFloat64 t0 = ndFloat64(1.0f) - t1; - ndAssert(t1 >= ndFloat64(0.0f)); - ndAssert(t1 <= ndFloat64(1.0f)); - - m_attrib.m_pointChannel.PushBack(midPoint); - - if (m_attrib.m_materialChannel.m_isValid) - { - m_attrib.m_materialChannel.PushBack(m_attrib.m_materialChannel[ndInt32(edge->m_userData)]); - } - if (m_attrib.m_normalChannel.m_isValid) - { - ndNormal edgeNormal0(m_attrib.m_normalChannel[ndInt32(edge->m_userData)]); - ndNormal edgeNormal1(m_attrib.m_normalChannel[ndInt32(edge->m_next->m_userData)]); - ndNormal edgeNormal( - edgeNormal0.m_x * ndFloat32(t0) + edgeNormal1.m_x * ndFloat32(t1), - edgeNormal0.m_y * ndFloat32(t0) + edgeNormal1.m_y * ndFloat32(t1), - edgeNormal0.m_z * ndFloat32(t0) + edgeNormal1.m_z * ndFloat32(t1)); - m_attrib.m_normalChannel.PushBack(edgeNormal); - } - if (m_attrib.m_binormalChannel.m_isValid) - { - ndAssert(0); - } - - if (m_attrib.m_uv0Channel.m_isValid) - { - ndUV edgeUV0(m_attrib.m_uv0Channel[ndInt32(edge->m_userData)]); - ndUV edgeUV1(m_attrib.m_uv0Channel[ndInt32(edge->m_next->m_userData)]); - ndUV edgeUV(edgeUV0.m_u * ndFloat32(t0) + edgeUV1.m_u * ndFloat32(t1), edgeUV0.m_v * ndFloat32(t0) + edgeUV1.m_v * ndFloat32(t1)); - m_attrib.m_uv0Channel.PushBack(edgeUV); - } - - if (m_attrib.m_uv1Channel.m_isValid) - { - ndAssert(0); - } - - if (m_attrib.m_colorChannel.m_isValid) - { - ndAssert(0); - } - return m_attrib.m_pointChannel.GetCount() - 1; -#endif -} - -void ndMeshEffect::RepairTJoints() -{ - ndAssert(Sanity()); - // delete edge of zero length - bool dirty = true; - while (dirty) - { - ndFloat64 tol = ndFloat64(1.0e-5f); - ndFloat64 tol2 = tol * tol; - dirty = false; - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; ) - { - ndEdge* const edge = &(*iter); - iter++; - const ndBigVector& p0 = m_points.m_vertex[edge->m_incidentVertex]; - const ndBigVector& p1 = m_points.m_vertex[edge->m_twin->m_incidentVertex]; - ndBigVector dist(p1 - p0); - ndAssert(dist.m_w == ndFloat32(0.0f)); - ndFloat64 mag2 = dist.DotProduct(dist).GetScalar(); - if (mag2 < tol2) - { - bool move = true; - while (move) - { - move = false; - ndEdge* ptr = edge->m_twin; - do - { - if ((&(*iter) == ptr) || (&(*iter) == ptr->m_twin)) - { - move = true; - iter++; - } - ptr = ptr->m_twin->m_next; - } while (ptr != edge->m_twin); - - ptr = edge; - do - { - if ((&(*iter) == ptr) || (&(*iter) == ptr->m_twin)) - { - move = true; - iter++; - } - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - } - - ndEdge* const collapsedEdge = CollapseEdge(edge); - if (collapsedEdge) - { - //ndAssert (0); - ndTrace(("remember to finish this!!: %s %s line:%d\n", __FILE__, __FUNCTION__, __LINE__)); - dirty = true; - ndBigVector q(m_points.m_vertex[collapsedEdge->m_incidentVertex]); - ndEdge* ptr = collapsedEdge; - do - { - if (ptr->m_incidentFace > 0) - { - //ndAssert (0); - //m_attrib[ptr->m_userData].m_vertex = q; - ndTrace(("remember to finish this!!: %s %s line:%d\n", __FILE__, __FUNCTION__, __LINE__)); - } - ptr = ptr->m_twin->m_next; - } while (ptr != collapsedEdge); - } - } - } - } - ndAssert(Sanity()); - - // repair straight open edges - ndInt32 mark = IncLRU(); - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_mark) != mark && (edge->m_incidentFace < 0)) - { - while (SeparateDuplicateLoops(edge)); - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - - ndAssert(Sanity()); - DeleteDegenerateFaces(&m_points.m_vertex[0].m_x, sizeof(ndBigVector), ndFloat64(1.0e-7f)); - ndAssert(Sanity()); - - // delete straight line edges - dirty = true; - // dirty = false; - while (dirty) - { - ndFloat64 tol = ndFloat64(1.0 - 1.0e-8); - ndFloat64 tol2 = tol * tol; - - dirty = false; - ndAssert(Sanity()); - - ndPolyhedra::Iterator iter1(*this); - for (iter1.Begin(); iter1; ) - { - ndEdge* const edge = &(*iter1); - iter1++; - - const ndBigVector& p0 = m_points.m_vertex[edge->m_incidentVertex]; - const ndBigVector& p1 = m_points.m_vertex[edge->m_next->m_incidentVertex]; - const ndBigVector& p2 = m_points.m_vertex[edge->m_next->m_next->m_incidentVertex]; - - ndBigVector A(p1 - p0); - ndBigVector B(p2 - p1); - ndAssert(A.m_w == ndFloat32(0.0f)); - ndAssert(B.m_w == ndFloat32(0.0f)); - ndFloat64 ab = A.DotProduct(B).GetScalar(); - if (ab >= 0.0f) - { - ndFloat64 aa = A.DotProduct(A).GetScalar(); - ndFloat64 bb = B.DotProduct(B).GetScalar(); - - ndFloat64 magab2 = ab * ab; - ndFloat64 magaabb = aa * bb * tol2; - if (magab2 >= magaabb) - { - if ((edge->m_incidentFace > 0) && (edge->m_twin->m_incidentFace > 0)) - { - if (edge->m_twin->m_prev == edge->m_next->m_twin) - { - ndEdge* const newEdge = AddHalfEdge(edge->m_incidentVertex, edge->m_next->m_next->m_incidentVertex); - if (newEdge) - { - dirty = true; - ndEdge* const newTwin = AddHalfEdge(edge->m_next->m_next->m_incidentVertex, edge->m_incidentVertex); - ndAssert(newEdge); - ndAssert(newTwin); - - newEdge->m_twin = newTwin; - newTwin->m_twin = newEdge; - - newEdge->m_userData = edge->m_userData; - newTwin->m_userData = edge->m_twin->m_prev->m_userData; - - newEdge->m_incidentFace = edge->m_incidentFace; - newTwin->m_incidentFace = edge->m_twin->m_incidentFace; - - ndEdge* const nextEdge = edge->m_next; - - nextEdge->m_twin->m_prev->m_next = newTwin; - newTwin->m_prev = nextEdge->m_twin->m_prev; - - edge->m_twin->m_next->m_prev = newTwin; - newTwin->m_next = edge->m_twin->m_next; - - nextEdge->m_next->m_prev = newEdge; - newEdge->m_next = nextEdge->m_next; - - edge->m_prev->m_next = newEdge; - newEdge->m_prev = edge->m_prev; - - while ((&(*iter1) == edge->m_twin) || (&(*iter1) == nextEdge) || (&(*iter1) == nextEdge->m_twin)) - { - iter1++; - } - - nextEdge->m_twin->m_prev = nextEdge; - nextEdge->m_twin->m_next = nextEdge; - nextEdge->m_prev = nextEdge->m_twin; - nextEdge->m_next = nextEdge->m_twin; - - edge->m_twin->m_prev = edge; - edge->m_twin->m_next = edge; - edge->m_prev = edge->m_twin; - edge->m_next = edge->m_twin; - - DeleteEdge(edge); - DeleteEdge(nextEdge); - //ndAssert (Sanity ()); - - } - else if (edge->m_next->m_next->m_next == edge) - { - ndAssert(0); - /* - dirty = true; - ndEdge* const openEdge = edge; - ndEdge* const nextEdge = openEdge->m_next; - ndEdge* const deletedEdge = openEdge->m_prev; - while ((&(*iter) == deletedEdge) || (&(*iter) == deletedEdge->m_twin)) - { - iter ++; - } - - openEdge->m_userData = deletedEdge->m_twin->m_userData; - - ndBigVector p2p0 (p2 - p0); - ndFloat64 den = p2p0.DotProduct3(p2p0); - ndFloat64 param1 = p2p0.DotProduct3(p1 - p0) / den; - dgVertexAtribute attib1 = AddInterpolateEdgeAttibute (deletedEdge->m_twin, param1); - AddAtribute(attib1); - openEdge->m_next->m_userData = m_atribCount - 1; - - openEdge->m_incidentFace = deletedEdge->m_twin->m_incidentFace; - openEdge->m_next->m_incidentFace = deletedEdge->m_twin->m_incidentFace; - - deletedEdge->m_twin->m_prev->m_next = openEdge; - openEdge->m_prev = deletedEdge->m_twin->m_prev; - - deletedEdge->m_twin->m_next->m_prev = nextEdge; - nextEdge->m_next = deletedEdge->m_twin->m_next; - - deletedEdge->m_twin->m_next = deletedEdge; - deletedEdge->m_twin->m_prev = deletedEdge; - deletedEdge->m_next = deletedEdge->m_twin; - deletedEdge->m_prev = deletedEdge->m_twin; - DeleteEdge(deletedEdge); - //ndAssert (Sanity ()); - */ - } - } - } - else if (FindEdge(edge->m_incidentVertex, edge->m_next->m_next->m_incidentVertex)) - { - ndEdge* const openEdge = edge; - //ndAssert (openEdge->m_incidentFace <= 0); - ndTrace(("remember to finish this!!: %s %s line:%d\n", __FILE__, __FUNCTION__, __LINE__)); - ndEdge* const nextEdge = openEdge->m_next; - ndEdge* const deletedEdge = openEdge->m_prev; - if (deletedEdge == openEdge->m_next->m_next) - { - dirty = true; - while ((&(*iter1) == deletedEdge) || (&(*iter1) == deletedEdge->m_twin)) - { - iter1++; - } - - //ndAssert (deletedEdge->m_twin->m_incidentFace > 0); - ndTrace(("remember to finish this!!: %s %s line:%d\n", __FILE__, __FUNCTION__, __LINE__)); - openEdge->m_incidentFace = deletedEdge->m_twin->m_incidentFace; - openEdge->m_next->m_incidentFace = deletedEdge->m_twin->m_incidentFace; - - ndInt32 attibuteIndex = AddInterpolatedHalfAttribute(deletedEdge->m_twin, nextEdge->m_incidentVertex); - openEdge->m_next->m_userData = ndUnsigned64(attibuteIndex); - openEdge->m_userData = deletedEdge->m_twin->m_userData; - - deletedEdge->m_twin->m_prev->m_next = openEdge; - openEdge->m_prev = deletedEdge->m_twin->m_prev; - - deletedEdge->m_twin->m_next->m_prev = nextEdge; - nextEdge->m_next = deletedEdge->m_twin->m_next; - - deletedEdge->m_twin->m_next = deletedEdge; - deletedEdge->m_twin->m_prev = deletedEdge; - deletedEdge->m_next = deletedEdge->m_twin; - deletedEdge->m_prev = deletedEdge->m_twin; - DeleteEdge(deletedEdge); - ndAssert(Sanity()); - } - } - else - { - ndEdge* const openEdge = (edge->m_incidentFace <= 0) ? edge : edge->m_twin; - ndAssert(openEdge->m_incidentFace <= 0); - - const ndBigVector& p3 = m_points.m_vertex[openEdge->m_next->m_next->m_next->m_incidentVertex]; - - ndBigVector A0(p3 - p2); - ndBigVector B0(p2 - p1); - ndAssert(A0.m_w == ndFloat32(0.0f)); - ndAssert(B0.m_w == ndFloat32(0.0f)); - - ndFloat64 ab0 = A0.DotProduct(B0).GetScalar(); - if (ab0 >= ndFloat32(0.0f)) - { - ndFloat64 aa0 = A0.DotProduct(A0).GetScalar(); - ndFloat64 bb0 = B0.DotProduct(B0).GetScalar(); - - ndFloat64 ab0ab0 = ab0 * ab0; - ndFloat64 aa0bb0 = aa0 * bb0 * tol2; - if (ab0ab0 >= aa0bb0) - { - if (openEdge->m_next->m_next->m_next->m_next != openEdge) - { - const ndBigVector& p4 = m_points.m_vertex[openEdge->m_prev->m_incidentVertex]; - ndBigVector A1(p1 - p0); - ndBigVector B1(p1 - p4); - ndAssert(A1.m_w == ndFloat32(0.0f)); - ndAssert(B1.m_w == ndFloat32(0.0f)); - ndFloat64 ab1 = A1.DotProduct(B1).GetScalar(); - if (ab1 < ndFloat32(0.0f)) - { - ndFloat64 ab1ab1 = ab1 * ab1; - ndFloat64 aa1bb1 = aa0 * bb0 * tol2; - if (ab1ab1 >= aa1bb1) - { - ndEdge* const newFace = ConnectVertex(openEdge->m_prev, openEdge->m_next); - dirty |= newFace ? true : false; - } - } - //ndAssert (Sanity ()); - } - else if (openEdge->m_prev->m_twin->m_incidentFace > 0) - { - dirty = true; - - ndEdge* const deletedEdge = openEdge->m_prev; - while ((&(*iter1) == deletedEdge) || (&(*iter1) == deletedEdge->m_twin)) - { - iter1++; - } - - openEdge->m_incidentFace = deletedEdge->m_twin->m_incidentFace; - openEdge->m_next->m_incidentFace = deletedEdge->m_twin->m_incidentFace; - openEdge->m_next->m_next->m_incidentFace = deletedEdge->m_twin->m_incidentFace; - - ndInt32 attibuteIndex0 = AddInterpolatedHalfAttribute(deletedEdge->m_twin, openEdge->m_next->m_incidentVertex); - ndInt32 attibuteIndex1 = AddInterpolatedHalfAttribute(deletedEdge->m_twin, openEdge->m_next->m_next->m_incidentVertex); - - openEdge->m_userData = deletedEdge->m_twin->m_userData; - openEdge->m_next->m_userData = ndUnsigned64(attibuteIndex0); - openEdge->m_next->m_next->m_userData = ndUnsigned64(attibuteIndex1); - - deletedEdge->m_twin->m_prev->m_next = openEdge; - openEdge->m_prev = deletedEdge->m_twin->m_prev; - - deletedEdge->m_twin->m_next->m_prev = deletedEdge->m_prev; - deletedEdge->m_prev->m_next = deletedEdge->m_twin->m_next; - - deletedEdge->m_twin->m_next = deletedEdge; - deletedEdge->m_twin->m_prev = deletedEdge; - deletedEdge->m_next = deletedEdge->m_twin; - deletedEdge->m_prev = deletedEdge->m_twin; - DeleteEdge(deletedEdge); - //ndAssert (Sanity ()); - } - } - } - } - } - } - } - } - ndAssert(Sanity()); - - DeleteDegenerateFaces(&m_points.m_vertex[0].m_x, sizeof(ndBigVector), ndFloat64(1.0e-7f)); - /* - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if (edge->m_incidentFace > 0) - { - ndBigVector p0(m_points[edge->m_incidentVertex]); - m_attrib[edge->m_userData].m_vertex.m_x = p0.m_x; - m_attrib[edge->m_userData].m_vertex.m_y = p0.m_y; - m_attrib[edge->m_userData].m_vertex.m_z = p0.m_z; - } - } - */ - ndAssert(Sanity()); -} - -void ndMeshEffect::GetVertexIndexChannel(ndInt32* const bufferOut) const -{ - for (ndInt32 i = 0; i < m_attrib.m_pointChannel.GetCount(); ++i) - { - const ndInt32 index = m_attrib.m_pointChannel[i]; - bufferOut[i] = index; - } -} - -void ndMeshEffect::GetVertexChannel64(ndInt32 strideInByte, ndFloat64* const bufferOut) const -{ - ndInt32 stride = strideInByte / ndInt32(sizeof(ndFloat64)); - for (ndInt32 i = 0; i < m_attrib.m_pointChannel.GetCount(); ++i) - { - const ndInt32 j = i * stride; - const ndInt32 index = m_attrib.m_pointChannel[i]; - bufferOut[j + 0] = m_points.m_vertex[index].m_x; - bufferOut[j + 1] = m_points.m_vertex[index].m_y; - bufferOut[j + 2] = m_points.m_vertex[index].m_z; - } -} - -void ndMeshEffect::GetVertexChannel(ndInt32 strideInByte, ndFloat32* const bufferOut) const -{ - ndInt32 stride = strideInByte / ndInt32(sizeof(ndFloat32)); - for (ndInt32 i = 0; i < m_attrib.m_pointChannel.GetCount(); ++i) - { - const ndInt32 j = i * stride; - const ndInt32 index = m_attrib.m_pointChannel[i]; - const ndBigVector& p = m_points.m_vertex[index]; - bufferOut[j + 0] = ndFloat32(p.m_x); - bufferOut[j + 1] = ndFloat32(p.m_y); - bufferOut[j + 2] = ndFloat32(p.m_z); - } -} - -void ndMeshEffect::GetVertexWeightChannel(ndInt32 strideInByte, ndVertexWeight* const bufferOut) const -{ - //ndInt32 offset = 0; - char* ptr = (char*)bufferOut; - for (ndInt32 i = 0; i < m_attrib.m_pointChannel.GetCount(); ++i) - { - const ndInt32 index = m_attrib.m_pointChannel[i]; - const ndVertexWeight& p = m_points.m_skinWeights[index]; - ndVertexWeight* const dst = (ndVertexWeight*)ptr; - *dst = p; - ptr += strideInByte; - } -} - -void ndMeshEffect::GetNormalChannel(ndInt32 strideInByte, ndFloat32* const bufferOut) const -{ - ndInt32 stride = strideInByte / ndInt32(sizeof(ndFloat32)); - for (ndInt32 i = 0; i < m_attrib.m_normalChannel.GetCount(); ++i) - { - const ndInt32 j = i * stride; - bufferOut[j + 0] = ndFloat32(m_attrib.m_normalChannel[i].m_x); - bufferOut[j + 1] = ndFloat32(m_attrib.m_normalChannel[i].m_y); - bufferOut[j + 2] = ndFloat32(m_attrib.m_normalChannel[i].m_z); - } -} - -void ndMeshEffect::GetBinormalChannel(ndInt32 strideInByte, ndFloat32* const bufferOut) const -{ - ndInt32 stride = strideInByte / ndInt32(sizeof(ndFloat32)); - for (ndInt32 i = 0; i < m_attrib.m_binormalChannel.GetCount(); ++i) - { - const ndInt32 j = i * stride; - bufferOut[j + 0] = ndFloat32(m_attrib.m_binormalChannel[i].m_x); - bufferOut[j + 1] = ndFloat32(m_attrib.m_binormalChannel[i].m_y); - bufferOut[j + 2] = ndFloat32(m_attrib.m_binormalChannel[i].m_z); - } -} - -void ndMeshEffect::GetUV0Channel(ndInt32 strideInByte, ndFloat32* const bufferOut) const -{ - ndInt32 stride = strideInByte / ndInt32(sizeof(ndFloat32)); - for (ndInt32 i = 0; i < m_attrib.m_uv0Channel.GetCount(); ++i) - { - const ndInt32 j = i * stride; - bufferOut[j + 0] = ndFloat32(m_attrib.m_uv0Channel[i].m_u); - bufferOut[j + 1] = ndFloat32(m_attrib.m_uv0Channel[i].m_v); - } -} - -void ndMeshEffect::GetUV1Channel(ndInt32 strideInByte, ndFloat32* const bufferOut) const -{ - ndInt32 stride = strideInByte / ndInt32(sizeof(ndFloat32)); - for (ndInt32 i = 0; i < m_attrib.m_uv1Channel.GetCount(); ++i) - { - const ndInt32 j = i * stride; - bufferOut[j + 0] = ndFloat32(m_attrib.m_uv1Channel[i].m_u); - bufferOut[j + 1] = ndFloat32(m_attrib.m_uv1Channel[i].m_v); - } -} - -void ndMeshEffect::GetVertexColorChannel(ndInt32 strideInByte, ndFloat32* const bufferOut) const -{ - ndInt32 stride = strideInByte / ndInt32(sizeof(ndFloat32)); - for (ndInt32 i = 0; i < m_attrib.m_colorChannel.GetCount(); ++i) - { - const ndInt32 j = i * stride; - bufferOut[j + 0] = ndFloat32(m_attrib.m_colorChannel[i].m_x); - bufferOut[j + 1] = ndFloat32(m_attrib.m_colorChannel[i].m_y); - bufferOut[j + 2] = ndFloat32(m_attrib.m_colorChannel[i].m_z); - bufferOut[j + 3] = ndFloat32(m_attrib.m_colorChannel[i].m_w); - } -} - -ndInt32 ndMeshEffect::GenerateVertexFormat(ndMeshVertexFormat& format, ndArray& buffer) const -{ - ndInt32 faceCount = 0; - ndInt32 indexCount = 0; - ndInt32 lru = IncLRU(); - Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if ((edge->m_incidentFace > 0) && (edge->m_mark != lru)) - { - faceCount++; - ndEdge* ptr = edge; - ptr = edge; - do - { - indexCount++; - ptr->m_mark = lru; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - - ndAssert(indexCount == m_points.m_vertex.GetCount()); - ndAssert(!m_points.m_layers.m_isValid || indexCount == m_points.m_layers.GetCount()); - ndAssert(!m_points.m_skinWeights.m_isValid || (indexCount == m_points.m_skinWeights.GetCount())); - - ndInt32 uvStrideInBytes = sizeof(ndUV); - ndInt32 normalStrideInBytes = sizeof(ndNormal); - ndInt32 vertexStrideInBytes = 3 * sizeof(ndFloat64); - ndInt32 vertexWeightStrideInBytes = sizeof(ndVertexWeight); - - ndInt32 totalSize = 0; - ndInt32 vertexOffset = totalSize; - totalSize += ndInt32(m_points.m_vertex.GetCount()) * vertexStrideInBytes; - - ndInt32 normalOffset = 0; - if (m_attrib.m_normalChannel.m_isValid) - { - normalOffset = totalSize; - totalSize += ndInt32(m_attrib.m_normalChannel.GetCount()) * normalStrideInBytes; - } - - ndInt32 uvOffset = 0; - if (m_attrib.m_uv0Channel.m_isValid) - { - uvOffset = totalSize; - totalSize += ndInt32(m_attrib.m_uv0Channel.GetCount()) * uvStrideInBytes; - } - - ndInt32 vertexWeightsOffset = 0; - if (m_points.m_skinWeights.m_isValid) - { - vertexWeightsOffset = totalSize; - totalSize += ndInt32(m_points.m_skinWeights.GetCount()) * vertexWeightStrideInBytes; - } - - ndInt32 faceCountOffset = totalSize; - totalSize += faceCount * sizeof(ndInt32); - - ndInt32 vertexIndexOffset = totalSize; - totalSize += indexCount * sizeof (ndInt32); - - ndInt32 faceMaterialOffset = 0; - if (m_attrib.m_materialChannel.m_isValid) - { - faceMaterialOffset = totalSize; - totalSize += faceCount * sizeof(ndInt32); - } - - ndInt32 normalIndexOffset = 0; - if (m_attrib.m_normalChannel.m_isValid) - { - normalIndexOffset = totalSize; - totalSize += indexCount * sizeof(ndInt32); - } - - ndInt32 uvIndexOffset = 0; - if (m_attrib.m_uv0Channel.m_isValid) - { - uvIndexOffset = totalSize; - totalSize += indexCount * sizeof(ndInt32); - } - - ndInt32 weightsIndexOffset = 0; - if (m_attrib.m_uv0Channel.m_isValid) - { - weightsIndexOffset = totalSize; - totalSize += indexCount * sizeof(ndInt32); - } - - buffer.SetCount(totalSize); - format.m_vertex.m_data = (ndFloat64*)&buffer[vertexOffset]; - format.m_vertex.m_indexList = (ndInt32*)&buffer[vertexIndexOffset]; - ndInt32* const faceIndexBuffer = (ndInt32*)&buffer[faceCountOffset]; - ndInt32* const faceMaterialBuffer = (ndInt32*)&buffer[faceMaterialOffset]; - - format.m_uv0.m_data = m_attrib.m_uv0Channel.m_isValid ? (ndReal*)&buffer[uvOffset] : nullptr; - format.m_normal.m_data = m_attrib.m_normalChannel.m_isValid ? (ndReal*)&buffer[normalOffset] : nullptr; - format.m_vertexWeight.m_data = m_points.m_skinWeights.m_isValid ? (ndVertexWeight*)&buffer[vertexWeightsOffset] : nullptr; - - format.m_uv0.m_indexList = m_attrib.m_uv0Channel.m_isValid ? (ndInt32*)&buffer[uvIndexOffset] : nullptr; - format.m_normal.m_indexList = m_attrib.m_normalChannel.m_isValid ? (ndInt32*)&buffer[normalIndexOffset] : nullptr; - format.m_vertexWeight.m_indexList = m_points.m_skinWeights.m_isValid ? (ndInt32*)&buffer[weightsIndexOffset] : nullptr; - - format.m_faceCount = faceCount; - format.m_faceIndexCount = faceIndexBuffer; - format.m_faceMaterial = faceMaterialBuffer; - - format.m_vertex.m_strideInBytes = vertexStrideInBytes; - for (ndInt32 i = 0; i < m_points.m_vertex.GetCount(); ++i) - { - format.m_vertex.m_data[i * 3 + 0] = m_points.m_vertex[i].m_x; - format.m_vertex.m_data[i * 3 + 1] = m_points.m_vertex[i].m_y; - format.m_vertex.m_data[i * 3 + 2] = m_points.m_vertex[i].m_z; - } - - if (m_points.m_skinWeights.m_isValid) - { - format.m_vertexWeight.m_strideInBytes = vertexWeightStrideInBytes; - for (ndInt32 i = 0; i < m_points.m_skinWeights.GetCount(); ++i) - { - format.m_vertexWeight.m_data[i] = m_points.m_skinWeights[i]; - } - } - - if (m_attrib.m_normalChannel.m_isValid) - { - format.m_normal.m_strideInBytes = normalStrideInBytes; - for (ndInt32 i = 0; i < m_attrib.m_normalChannel.GetCount(); ++i) - { - format.m_normal.m_data[i * 3 + 0] = m_attrib.m_normalChannel[i].m_x; - format.m_normal.m_data[i * 3 + 1] = m_attrib.m_normalChannel[i].m_y; - format.m_normal.m_data[i * 3 + 2] = m_attrib.m_normalChannel[i].m_z; - } - } - - if (m_attrib.m_uv0Channel.m_isValid) - { - format.m_uv0.m_strideInBytes = uvStrideInBytes; - for (ndInt32 i = 0; i < m_attrib.m_uv0Channel.GetCount(); ++i) - { - format.m_uv0.m_data[i * 2 + 0] = m_attrib.m_uv0Channel[i].m_u; - format.m_uv0.m_data[i * 2 + 1] = m_attrib.m_uv0Channel[i].m_v; - } - } - - faceCount = 0; - indexCount = 0; - lru = IncLRU(); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if ((edge->m_incidentFace > 0) && (edge->m_mark != lru)) - { - ndEdge* ptr = edge; - ndInt32 count = 0; - ptr = edge; - do - { - ptr->m_mark = lru; - count++; - - format.m_vertex.m_indexList[indexCount] = ptr->m_incidentVertex; - if (m_points.m_skinWeights.m_isValid) - { - format.m_vertexWeight.m_indexList[indexCount] = ptr->m_incidentVertex; - } - - if (m_attrib.m_normalChannel.m_isValid) - { - //normalIndexBuffer[indexCount] = m_attrib.m_normalChannel[ndInt32(ptr->m_userData)]; - format.m_normal.m_indexList[indexCount] = ndInt32(ptr->m_userData); - } - - if (m_attrib.m_binormalChannel.m_isValid) - { - ndAssert(0); - // m_attrib.m_binormalChannel.PushBack(attibutes.m_binormalChannel[ndInt32(ptr->m_userData)]); - } - - if (m_attrib.m_colorChannel.m_isValid) - { - ndAssert(0); - //m_attrib.m_colorChannel.PushBack(attibutes.m_colorChannel[ndInt32(ptr->m_userData)]); - } - - if (m_attrib.m_uv0Channel.m_isValid) - { - //m_attrib.m_uv0Channel.PushBack(attibutes.m_uv0Channel[ndInt32(ptr->m_userData)]); - format.m_uv0.m_indexList[indexCount] = ndInt32(ptr->m_userData); - } - - if (m_attrib.m_uv1Channel.m_isValid) - { - ndAssert(0); - //m_attrib.m_uv1Channel.PushBack(attibutes.m_uv1Channel[ndInt32(ptr->m_userData)]); - } - - indexCount++; - ptr = ptr->m_next; - } while (ptr != edge); - - if (m_attrib.m_materialChannel.m_isValid) - { - format.m_faceMaterial[faceCount] = m_attrib.m_materialChannel[ndInt32(edge->m_userData)]; - } - - faceIndexBuffer[faceCount] = count; - faceCount++; - } - } - - ndAssert(indexCount == m_points.m_vertex.GetCount()); - - ndStack tempIndex(indexCount); - if (m_points.m_skinWeights.m_isValid) - { - struct ndVertexPositWeight - { - ndFloat64 m_posit[3]; - ndFloat64 m_boneIndex[ND_VERTEX_WEIGHT_SIZE]; - ndFloat64 m_boneWeight[ND_VERTEX_WEIGHT_SIZE]; - }; - ndArray points; - for (ndInt32 i = 0; i < indexCount; i++) - { - ndVertexPositWeight data; - data.m_posit[0] = format.m_vertex.m_data[i * 3 + 0]; - data.m_posit[1] = format.m_vertex.m_data[i * 3 + 1]; - data.m_posit[2] = format.m_vertex.m_data[i * 3 + 2]; - for (ndInt32 j = 0; j < ND_VERTEX_WEIGHT_SIZE; ++j) - { - data.m_boneIndex[j] = format.m_vertexWeight.m_data[i].m_boneId[j]; - data.m_boneWeight[j] = format.m_vertexWeight.m_data[i].m_weight[j]; - } - points.PushBack(data); - } - ndInt32 count = ndVertexListToIndexList(&points[0].m_posit[0], sizeof(ndVertexPositWeight), sizeof(ndVertexPositWeight)/sizeof (ndFloat64), indexCount, &tempIndex[0]); - - //#ifdef _DEBUG - #if 0 - for (ndInt32 i = 0; i < indexCount; i++) - { - ndInt32 j0 = format.m_vertex.m_indexList[i]; - ndBigVector xxx0(format.m_vertex.m_data[j0 * 3 + 0], format.m_vertex.m_data[j0 * 3 + 1], format.m_vertex.m_data[j0 * 3 + 2], 0.0); - - ndInt32 j1 = tempIndex[format.m_vertex.m_indexList[i]]; - ndBigVector xxx1(points[j1].m_posit[0], points[j1].m_posit[1], points[j1].m_posit[2], 0.0); - ndAssert(xxx0.m_x == xxx1.m_x); - ndAssert(xxx0.m_y == xxx1.m_y); - ndAssert(xxx0.m_z == xxx1.m_z); - - for (ndInt32 j = 0; j < ND_VERTEX_WEIGHT_SIZE; ++j) - { - ndInt32 k0 = format.m_vertexWeight.m_data[j0].m_boneId[j]; - ndInt32 k1 = ndInt32(points[j1].m_boneIndex[j]); - ndAssert(k0 == k1); - - ndReal w0 = format.m_vertexWeight.m_data[j0].m_weight[j]; - ndReal w1 = ndReal(points[j1].m_boneWeight[j]); - ndAssert(w0 == w1); - } - } - #endif - - for (ndInt32 i = 0; i < count; i++) - { - format.m_vertex.m_data[i * 3 + 0] = points[i].m_posit[0]; - format.m_vertex.m_data[i * 3 + 1] = points[i].m_posit[1]; - format.m_vertex.m_data[i * 3 + 2] = points[i].m_posit[2]; - for (ndInt32 j = 0; j < ND_VERTEX_WEIGHT_SIZE; ++j) - { - format.m_vertexWeight.m_data[i].m_boneId[j] = ndInt32 (points[i].m_boneIndex[j]); - format.m_vertexWeight.m_data[i].m_weight[j] = ndReal (points[i].m_boneWeight[j]); - } - } - for (ndInt32 i = 0; i < indexCount; i++) - { - ndInt32 index = tempIndex[format.m_vertex.m_indexList[i]]; - format.m_vertex.m_indexList[i] = index; - format.m_vertexWeight.m_indexList[i] = index; - } - } - else - { - ndVertexListToIndexList(format.m_vertex.m_data, format.m_vertex.m_strideInBytes, 3, indexCount, &tempIndex[0]); - for (ndInt32 i = 0; i < indexCount; i++) - { - format.m_vertex.m_indexList[i] = tempIndex[format.m_vertex.m_indexList[i]]; - } - } - - if (format.m_normal.m_data) - { - ndInt32 count = 0; - for (ndInt32 i = 0; i < indexCount; i++) - { - count = ndMax(count, format.m_normal.m_indexList[i] + 1); - } - - ndVertexListToIndexList(format.m_normal.m_data, format.m_normal.m_strideInBytes, 3, count, &tempIndex[0]); - for (ndInt32 i = 0; i < indexCount; i++) - { - format.m_normal.m_indexList[i] = tempIndex[format.m_normal.m_indexList[i]]; - } - } - - if (format.m_uv0.m_data) - { - ndArray array; - ndInt32 count = 0; - for (ndInt32 i = 0; i < indexCount; i++) - { - count = ndMax(count, format.m_uv0.m_indexList[i] + 1); - } - - for (ndInt32 i = 0; i < count; i++) - { - array.PushBack(ndVector(format.m_uv0.m_data[i * 2 + 0], format.m_uv0.m_data[i * 2 + 1], ndFloat32(0.0f), ndFloat32(0.0f))); - } - ndInt32 vCount = ndVertexListToIndexList(&array[0].m_x, sizeof (ndVector), 3, count, &tempIndex[0]); - for (ndInt32 i = 0; i < vCount; i++) - { - format.m_uv0.m_data[i * 2 + 0] = ndReal(array[i].m_x); - format.m_uv0.m_data[i * 2 + 1] = ndReal(array[i].m_y); - } - for (ndInt32 i = 0; i < indexCount; i++) - { - format.m_uv0.m_indexList[i] = tempIndex[format.m_uv0.m_indexList[i]]; - } - } - - return ndInt32(m_points.m_vertex.GetCount()); -} - -ndIndexArray* ndMeshEffect::MaterialGeometryBegin() -{ - ndInt32 materials[256]; - ndInt32 streamIndexMap[256]; - - ndInt32 count = 0; - ndInt32 materialCount = 0; - - ndIndexArray* const array = (ndIndexArray*)ndMemory::Malloc(size_t(4 * sizeof(ndInt32) * GetCount() + sizeof(ndIndexArray) + 2048)); - array->m_indexList = (ndInt32*)&array[1]; - - ndInt32 mark = IncLRU(); - ndPolyhedra::Iterator iter(*this); - ndMemSet(streamIndexMap, 0, sizeof(streamIndexMap) / sizeof(streamIndexMap[0])); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_incidentFace >= 0) && (edge->m_mark != mark)) - { - ndEdge* ptr = edge; - ptr->m_mark = mark; - ndInt32 index0 = ndInt32(ptr->m_userData); - - ptr = ptr->m_next; - ptr->m_mark = mark; - ndInt32 index1 = ndInt32(ptr->m_userData); - - ptr = ptr->m_next; - do - { - ptr->m_mark = mark; - - array->m_indexList[count * 4 + 0] = index0; - array->m_indexList[count * 4 + 1] = index1; - array->m_indexList[count * 4 + 2] = ndInt32(ptr->m_userData); - array->m_indexList[count * 4 + 3] = m_attrib.m_materialChannel.m_isValid ? ndInt32(m_attrib.m_materialChannel[ndInt32(edge->m_userData)]) : 0; - index1 = ndInt32(ptr->m_userData); - - ndInt32 hashValue = array->m_indexList[count * 4 + 3] & 0xff; - streamIndexMap[hashValue] ++; - materials[hashValue] = array->m_indexList[count * 4 + 3]; - count++; - - ptr = ptr->m_next; - } while (ptr != edge); - } - } - - array->m_indexCount = count; - array->m_materialCount = materialCount; - - count = 0; - for (ndInt32 i = 0; i < 256; ++i) - { - if (streamIndexMap[i]) - { - array->m_materials[count] = materials[i]; - array->m_materialsIndexCount[count] = streamIndexMap[i] * 3; - count++; - } - } - - array->m_materialCount = count; - return array; -} - -void ndMeshEffect::MaterialGeometryEnd(ndIndexArray* const handle) -{ - ndMemory::Free(handle); -} - -ndInt32 ndMeshEffect::GetFirstMaterial(ndIndexArray* const handle) const -{ - return GetNextMaterial(handle, -1); -} - -ndInt32 ndMeshEffect::GetNextMaterial(ndIndexArray* const handle, ndInt32 materialId) const -{ - materialId++; - if (materialId >= handle->m_materialCount) - { - materialId = -1; - } - return materialId; -} - -ndInt32 ndMeshEffect::GetMaterialID(ndIndexArray* const handle, ndInt32 materialHandle) const -{ - return handle->m_materials[materialHandle]; -} - -ndInt32 ndMeshEffect::GetMaterialIndexCount(ndIndexArray* const handle, ndInt32 materialHandle) const -{ - return handle->m_materialsIndexCount[materialHandle]; -} - -void ndMeshEffect::GetMaterialGetIndexStream(ndIndexArray* const handle, ndInt32 materialHandle, ndInt32* const indexArray) const -{ - ndInt32 index = 0; - ndInt32 textureID = handle->m_materials[materialHandle]; - for (ndInt32 j = 0; j < handle->m_indexCount; ++j) - { - if (handle->m_indexList[j * 4 + 3] == textureID) - { - indexArray[index + 0] = handle->m_indexList[j * 4 + 0]; - indexArray[index + 1] = handle->m_indexList[j * 4 + 1]; - indexArray[index + 2] = handle->m_indexList[j * 4 + 2]; - index += 3; - } - } -} - -void ndMeshEffect::GetMaterialGetIndexStream(ndIndexArray* const handle, ndInt32 materialHandle, ndInt16* const indexArray) const -{ - ndInt32 index = 0; - ndInt32 textureID = handle->m_materials[materialHandle]; - for (ndInt32 j = 0; j < handle->m_indexCount; ++j) - { - if (handle->m_indexList[j * 4 + 3] == textureID) - { - indexArray[index + 0] = (ndInt16)handle->m_indexList[j * 4 + 0]; - indexArray[index + 1] = (ndInt16)handle->m_indexList[j * 4 + 1]; - indexArray[index + 2] = (ndInt16)handle->m_indexList[j * 4 + 2]; - index += 3; - } - } -} - -void ndMeshEffect::ApplyTransform(const ndMatrix& matrix) -{ - matrix.TransformTriplex(&m_points.m_vertex[0].m_x, sizeof(ndBigVector), &m_points.m_vertex[0].m_x, sizeof(ndBigVector), ndInt32(m_points.m_vertex.GetCount())); - - ndMatrix invMatix(matrix.Inverse4x4()); - invMatix.m_posit = ndVector::m_wOne; - ndMatrix rotation(invMatix.Transpose4X4()); - for (ndInt32 i = 0; i < m_attrib.m_normalChannel.GetCount(); ++i) - { - ndVector n(ndFloat32(m_attrib.m_normalChannel[i].m_x), ndFloat32(m_attrib.m_normalChannel[i].m_y), ndFloat32(m_attrib.m_normalChannel[i].m_z), ndFloat32(0.0f)); - n = rotation.RotateVector(n); - ndAssert(n.m_w == ndFloat32(0.0f)); - ndAssert(n.DotProduct(n).GetScalar() > ndFloat32(0.0f)); - n = n.Normalize(); - m_attrib.m_normalChannel[i] = ndNormal(n.m_x, n.m_y, n.m_z); - } - - for (ndInt32 i = 0; i < m_attrib.m_binormalChannel.GetCount(); ++i) - { - ndVector n(ndFloat32(m_attrib.m_binormalChannel[i].m_x), ndFloat32(m_attrib.m_binormalChannel[i].m_y), ndFloat32(m_attrib.m_binormalChannel[i].m_z), ndFloat32(0.0f)); - n = rotation.RotateVector(n); - ndAssert(n.m_w == ndFloat32(0.0f)); - ndAssert(n.DotProduct(n).GetScalar() > ndFloat32(0.0f)); - n = n.Normalize(); - m_attrib.m_binormalChannel[i] = ndNormal(n.m_x, n.m_y, n.m_z); - } - - ndFloat32 det = matrix.m_right.DotProduct(matrix.m_front.CrossProduct(matrix.m_up)).GetScalar(); - if (det < 0.0f) - { - FlipWinding(); - } -} - -//void ndMeshEffect::MergeFaces(const ndMeshEffect* const source) -void ndMeshEffect::MergeFaces(const ndMeshEffect* const) -{ - ndAssert(0); -#if 0 - ndInt32 mark = source->IncLRU(); - ndPolyhedra::Iterator iter(*source); - ndInt32 maxMatIndex = 0; - for (iter.Begin(); iter; iter++) - { - ndEdge* const face = &(*iter); - if ((face->m_incidentFace > 0) && (face->m_mark < mark)) - { - BeginBuildFace(); - ndEdge* ptr = face; - do { - ptr->m_mark = mark; - ndInt32 vIndex = ptr->m_incidentVertex; - ndInt32 aIndex = ndInt32(ptr->m_userData); - AddPoint(source->m_points.m_vertex[vIndex].m_x, source->m_points.m_vertex[vIndex].m_y, source->m_points.m_vertex[vIndex].m_z); - if (source->m_points.m_layers.GetCount()) - { - AddLayer(source->m_points.m_layers[vIndex]); - } - - if (source->m_attrib.m_materialChannel.GetCount()) - { - ndInt32 matIndex = source->m_attrib.m_materialChannel[aIndex]; - maxMatIndex = ndMax(matIndex, maxMatIndex); - AddMaterial(matIndex); - } - - if (source->m_attrib.m_colorChannel.GetCount()) - { - AddVertexColor(source->m_attrib.m_colorChannel[aIndex].m_x, source->m_attrib.m_colorChannel[aIndex].m_y, source->m_attrib.m_colorChannel[aIndex].m_z, source->m_attrib.m_colorChannel[aIndex].m_w); - } - - if (source->m_attrib.m_normalChannel.GetCount()) - { - AddNormal(source->m_attrib.m_normalChannel[aIndex].m_x, source->m_attrib.m_normalChannel[aIndex].m_y, source->m_attrib.m_normalChannel[aIndex].m_z); - } - - if (source->m_attrib.m_binormalChannel.GetCount()) - { - AddBinormal(source->m_attrib.m_binormalChannel[aIndex].m_x, source->m_attrib.m_binormalChannel[aIndex].m_y, source->m_attrib.m_binormalChannel[aIndex].m_z); - } - - if (source->m_attrib.m_uv0Channel.GetCount()) - { - AddUV0(source->m_attrib.m_uv0Channel[aIndex].m_u, source->m_attrib.m_uv0Channel[aIndex].m_v); - } - - if (source->m_attrib.m_uv1Channel.GetCount()) - { - AddUV1(source->m_attrib.m_uv1Channel[aIndex].m_u, source->m_attrib.m_uv1Channel[aIndex].m_v); - } - ptr = ptr->m_next; - } while (ptr != face); - EndBuildFace(); - } - } - - for (ndInt32 i = m_materials.GetCount(); i <= maxMatIndex; ++i) - { - m_materials.PushBack(source->m_materials[i]); - } -#endif -} - -// create a convex hull -ndMeshEffect::ndMeshEffect(const ndFloat64* const vertexCloud, ndInt32 count, ndInt32 strideInByte, ndFloat64 distTol) - :ndPolyhedra() - ,m_name() - ,m_points() - ,m_attrib() - ,m_materials() - ,m_vertexBaseCount(0) - ,m_constructionIndex(0) -{ - Init(); - if (count >= 4) - { - ndConvexHull3d convexHull(vertexCloud, strideInByte, count, distTol); - if (convexHull.GetCount()) - { - ndStack faceCountPool(convexHull.GetCount()); - ndStack vertexIndexListPool(convexHull.GetCount() * 3); - - ndInt32 index = 0; - ndMeshVertexFormat format; - format.m_faceCount = convexHull.GetCount(); - format.m_faceIndexCount = &faceCountPool[0]; - format.m_vertex.m_indexList = &vertexIndexListPool[0]; - format.m_vertex.m_data = (ndFloat64*)&convexHull.GetVertexPool()[0].m_x; - format.m_vertex.m_strideInBytes = sizeof(ndBigVector); - for (ndConvexHull3d::ndNode* faceNode = convexHull.GetFirst(); faceNode; faceNode = faceNode->GetNext()) - { - ndConvexHull3dFace& face = faceNode->GetInfo(); - faceCountPool[index] = 3; - vertexIndexListPool[index * 3 + 0] = face.m_index[0]; - vertexIndexListPool[index * 3 + 1] = face.m_index[1]; - vertexIndexListPool[index * 3 + 2] = face.m_index[2]; - index++; - } - BuildFromIndexList(&format); - RepairTJoints(); - } - } -} - -ndMeshEffect::ndMeshEffect(const ndShapeInstance& shapeInstance) - :ndPolyhedra() - ,m_name() - ,m_points() - ,m_attrib() - ,m_materials() - ,m_vertexBaseCount(0) - ,m_constructionIndex(0) -{ - class dgMeshEffectBuilder : public ndShapeDebugNotify - { - public: - dgMeshEffectBuilder() - :m_vertex(256) - ,m_faceIndexCount(256) - ,m_brush(0) - { - } - - virtual void DrawPolygon(ndInt32 vertexCount, const ndVector* const faceVertex, const ndEdgeType* const) - { - m_faceIndexCount.PushBack(vertexCount); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - ndBigVector point(faceVertex[i].m_x, faceVertex[i].m_y, faceVertex[i].m_z, ndFloat32(m_brush)); - m_vertex.PushBack(point); - } - } - - ndArray m_vertex; - ndArray m_faceIndexCount; - ndInt32 m_brush; - }; - dgMeshEffectBuilder builder; - - Init(); - if (((ndShape*)shapeInstance.GetShape())->GetAsShapeCompound()) - { - ndInt32 brush = 0; - ndMatrix matrix(shapeInstance.GetLocalMatrix()); - const ndShapeCompound* const compound = ((ndShape*)shapeInstance.GetShape())->GetAsShapeCompound(); - const ndShapeCompound::ndTreeArray& array = compound->GetTree(); - ndShapeCompound::ndTreeArray::Iterator iter(array); - for (iter.Begin(); iter; iter++) - { - ndShapeInstance* const childInstance = iter.GetNode()->GetInfo()->GetShape(); - builder.m_brush = brush; - brush++; - childInstance->DebugShape(matrix, builder); - } - } - else - { - ndMatrix matrix(ndGetIdentityMatrix()); - shapeInstance.DebugShape(matrix, builder); - } - - ndStackindexListBuffer(ndInt32(builder.m_vertex.GetCount())); - ndInt32* const indexList = &indexListBuffer[0]; - ndVertexListToIndexList(&builder.m_vertex[0].m_x, sizeof(ndBigVector), 4, ndInt32(builder.m_vertex.GetCount()), &indexList[0], DG_VERTEXLIST_INDEXLIST_TOL); - - ndMeshEffect::ndMeshVertexFormat vertexFormat; - - vertexFormat.m_faceCount = ndInt32(builder.m_faceIndexCount.GetCount()); - vertexFormat.m_faceIndexCount = &builder.m_faceIndexCount[0]; - //vertexFormat.m_faceMaterial = materialIndex; - - vertexFormat.m_vertex.m_data = &builder.m_vertex[0].m_x; - vertexFormat.m_vertex.m_strideInBytes = sizeof(ndBigVector); - vertexFormat.m_vertex.m_indexList = &indexList[0]; - - BuildFromIndexList(&vertexFormat); - RepairTJoints(); - CalculateNormals(ndFloat32(45.0f) * ndDegreeToRad); -} - -ndMatrix ndMeshEffect::CalculateOOBB(ndBigVector& size) const -{ - ndMatrix sphere(CalculateSphere(size, &m_points.m_vertex[0].m_x, sizeof(ndBigVector))); - return sphere; -} - -void ndMeshEffect::CalculateAABB(ndBigVector& minBox, ndBigVector& maxBox) const -{ - ndBigVector minP(ndFloat64(1.0e15f), ndFloat64(1.0e15f), ndFloat64(1.0e15f), ndFloat64(0.0f)); - ndBigVector maxP(-ndFloat64(1.0e15f), -ndFloat64(1.0e15f), -ndFloat64(1.0e15f), ndFloat64(0.0f)); - - ndPolyhedra::Iterator iter(*this); - const ndBigVector* const points = &m_points.m_vertex[0]; - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - const ndBigVector& p(points[edge->m_incidentVertex]); - - minP.m_x = ndMin(p.m_x, minP.m_x); - minP.m_y = ndMin(p.m_y, minP.m_y); - minP.m_z = ndMin(p.m_z, minP.m_z); - - maxP.m_x = ndMax(p.m_x, maxP.m_x); - maxP.m_y = ndMax(p.m_y, maxP.m_y); - maxP.m_z = ndMax(p.m_z, maxP.m_z); - } - - minBox = minP; - maxBox = maxP; -} - -ndFloat64 ndMeshEffect::CalculateVolume() const -{ - ndPolyhedraMassProperties localData; - - ndInt32 mark = IncLRU(); - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndVector points[256]; - - ndEdge* face = &(*iter); - if ((face->m_incidentFace > 0) && (face->m_mark != mark)) - { - ndInt32 count = 0; - ndEdge* ptr = face; - do - { - points[count] = m_points.m_vertex[ptr->m_incidentVertex]; - count++; - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != face); - localData.AddCGFace(count, points); - } - } - - ndVector com; - ndVector inertia; - ndVector crossInertia; - ndFloat32 volume = localData.MassProperties(com, inertia, crossInertia); - return volume; -} - -ndMeshEffect* ndMeshEffect::GetNextLayer(ndInt32 mark) -{ - Iterator iter(*this); - ndEdge* edge = nullptr; - for (iter.Begin(); iter; iter++) - { - edge = &(*iter); - if ((edge->m_mark < mark) && (edge->m_incidentFace > 0)) - { - break; - } - } - - if (!edge) - { - return nullptr; - } - - const ndInt32 layer = m_points.m_layers.GetCount() ? m_points.m_layers[edge->m_incidentVertex] : 0; - ndPolyhedra polyhedra; - - polyhedra.BeginFace(); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge1 = &(*iter); - if ((edge1->m_mark < mark) && (edge1->m_incidentFace > 0)) - { - const ndInt32 thislayer = m_points.m_layers.GetCount() ? m_points.m_layers[edge1->m_incidentVertex] : 0; - if (thislayer == layer) - { - ndEdge* ptr = edge1; - ndInt32 count = 0; - ndInt32 faceIndex[256]; - ndInt64 faceDataIndex[256]; - do - { - ptr->m_mark = mark; - faceIndex[count] = ptr->m_incidentVertex; - faceDataIndex[count] = ndInt64(ptr->m_userData); - count++; - ndAssert(count < ndInt32(sizeof(faceIndex) / sizeof(faceIndex[0]))); - ptr = ptr->m_next; - } while (ptr != edge1); - polyhedra.AddFace(count, &faceIndex[0], &faceDataIndex[0]); - } - } - } - polyhedra.EndFace(); - - ndMeshEffect* solid = nullptr; - if (polyhedra.GetCount()) - { - solid = new ndMeshEffect(polyhedra, *this); - solid->SetLRU(mark); - } - return solid; -} - -ndShapeInstance* ndMeshEffect::CreateConvexCollision(ndFloat64 tolerance) const -{ - ndStack poolPtr(ndInt32(m_points.m_vertex.GetCount()) * 2); - ndVector* const pool = &poolPtr[0]; - - ndBigVector minBox; - ndBigVector maxBox; - CalculateAABB(minBox, maxBox); - ndVector com((minBox + maxBox) * ndVector::m_half); - - ndInt32 count = 0; - ndInt32 mark = IncLRU(); - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const vertex = &(*iter); - if (vertex->m_mark != mark) - { - ndEdge* ptr = vertex; - do - { - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != vertex); - - if (count < ndInt32(poolPtr.GetElementsCount())) - { - const ndBigVector p(m_points.m_vertex[vertex->m_incidentVertex]); - pool[count] = ndVector(p) - com; - count++; - } - } - } - - ndMatrix matrix(ndGetIdentityMatrix()); - matrix.m_posit += matrix.RotateVector(com); - matrix.m_posit.m_w = ndFloat32(1.0f); - - ndShapeConvexHull* const collision = new ndShapeConvexHull(count, sizeof(ndVector), ndFloat32(tolerance), &pool[0].m_x); - if (!collision->GetConvexVertexCount()) - { - delete collision; - return nullptr; - } - ndShapeInstance* const instance = new ndShapeInstance(collision); - instance->SetLocalMatrix(matrix); - return instance; -} - -void ndMeshEffect::ConvertToPolygons() -{ - ndAssert(0); -#if 0 - - UnpackPoints(); - ndPolyhedra leftOversOut; - ndPolyhedra::ConvexPartition(&m_points.m_vertex[0].m_x, sizeof(ndBigVector), &leftOversOut); - ndAssert(leftOversOut.GetCount() == 0); - - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - edge->m_userData = ndUnsigned64(edge->m_incidentFace > 0 ? edge->m_incidentVertex : 0); - } - PackPoints(); - - RepairTJoints(); - ndAssert(Sanity()); -#endif -} - -void ndMeshEffect::Triangulate() -{ - ndAssert(0); -#if 0 - UnpackPoints(); - ndPolyhedra leftOversOut; - ndPolyhedra::Triangulate(&m_points.m_vertex[0].m_x, sizeof(ndBigVector), &leftOversOut); - ndAssert(leftOversOut.GetCount() == 0); - - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - edge->m_userData = ndUnsigned64(edge->m_incidentFace > 0 ? edge->m_incidentVertex : 0); - } - PackPoints(); - - RepairTJoints(); - ndAssert(Sanity()); -#endif -} - -bool ndMeshEffect::HasOpenEdges() const -{ - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const face = &(*iter); - if (face->m_incidentFace < 0) - { - return true; - } - } - return false; -} - -void ndMeshEffect::RemoveUnusedVertices(ndInt32* const) -{ - //ndAssert(!vertexMapResult); - UnpackAttibuteData(); - PackAttibuteData(); - UnpackPoints(); - PackPoints(); -} - -ndEdge* ndMeshEffect::InsertEdgeVertex(ndEdge* const edge, ndFloat64 param) -{ - ndEdge* const twin = edge->m_twin; - AddInterpolatedEdgeAttribute(edge, param); - - ndInt32 edgeAttrV0 = ndInt32(edge->m_userData); - ndInt32 twinAttrV0 = ndInt32(twin->m_userData); - - ndEdge* const faceA0 = edge->m_next; - ndEdge* const faceA1 = edge->m_prev; - ndEdge* const faceB0 = twin->m_next; - ndEdge* const faceB1 = twin->m_prev; - SpliteEdge(ndInt32(m_points.m_vertex.GetCount()) - 1, edge); - - faceA0->m_prev->m_userData = ndUnsigned64(m_attrib.m_pointChannel.GetCount() - 2); - faceA1->m_next->m_userData = ndUnsigned64(edgeAttrV0); - - faceB0->m_prev->m_userData = ndUnsigned64(m_attrib.m_pointChannel.GetCount() - 1); - faceB1->m_next->m_userData = ndUnsigned64(twinAttrV0); - return faceA1->m_next; -} - -//void ndMeshEffect::AddInterpolatedEdgeAttribute(ndEdge* const edge, ndFloat64 param) -void ndMeshEffect::AddInterpolatedEdgeAttribute(ndEdge* const, ndFloat64) -{ - ndAssert(0); -#if 0 - - ndFloat64 t1 = param; - ndFloat64 t0 = ndFloat64(1.0f) - t1; - ndAssert(t1 >= ndFloat64(0.0f)); - ndAssert(t1 <= ndFloat64(1.0f)); - - const ndInt32 vertexIndex = m_points.m_vertex.GetCount(); - m_points.m_vertex.PushBack(m_points.m_vertex[edge->m_incidentVertex].Scale(t0) + m_points.m_vertex[edge->m_next->m_incidentVertex].Scale(t1)); - if (m_points.m_layers.GetCount()) - { - m_points.m_layers.PushBack(m_points.m_layers[edge->m_incidentVertex]); - } - - m_attrib.m_pointChannel.PushBack(vertexIndex); - m_attrib.m_pointChannel.PushBack(vertexIndex); - - if (m_attrib.m_materialChannel.GetCount()) - { - m_attrib.m_materialChannel.PushBack(m_attrib.m_materialChannel[ndInt32(edge->m_userData)]); - m_attrib.m_materialChannel.PushBack(m_attrib.m_materialChannel[ndInt32(edge->m_twin->m_userData)]); - } - - if (m_attrib.m_normalChannel.GetCount()) - { - ndNormal edgeNormal0(m_attrib.m_normalChannel[ndInt32(edge->m_userData)]); - ndNormal edgeNormal1(m_attrib.m_normalChannel[ndInt32(edge->m_next->m_userData)]); - ndNormal edgeNormal( - edgeNormal0.m_x * ndFloat32(t0) + edgeNormal1.m_x * ndFloat32(t1), - edgeNormal0.m_y * ndFloat32(t0) + edgeNormal1.m_y * ndFloat32(t1), - edgeNormal0.m_z * ndFloat32(t0) + edgeNormal1.m_z * ndFloat32(t1)); - m_attrib.m_normalChannel.PushBack(edgeNormal); - - ndNormal twinNormal0(m_attrib.m_normalChannel[ndInt32(edge->m_twin->m_next->m_userData)]); - ndNormal twinNormal1(m_attrib.m_normalChannel[ndInt32(edge->m_twin->m_userData)]); - ndNormal twinNormal( - twinNormal0.m_x * ndFloat32(t0) + twinNormal1.m_x * ndFloat32(t1), - twinNormal0.m_y * ndFloat32(t0) + twinNormal1.m_y * ndFloat32(t1), - twinNormal0.m_z* ndFloat32(t0) + twinNormal1.m_z * ndFloat32(t1)); - m_attrib.m_normalChannel.PushBack(twinNormal); - } - if (m_attrib.m_binormalChannel.GetCount()) - { - ndAssert(0); - } - - if (m_attrib.m_uv0Channel.GetCount()) - { - ndUV edgeUV0(m_attrib.m_uv0Channel[ndInt32(edge->m_userData)]); - ndUV edgeUV1(m_attrib.m_uv0Channel[ndInt32(edge->m_next->m_userData)]); - ndUV edgeUV( - edgeUV0.m_u * ndFloat32(t0) + edgeUV1.m_u * ndFloat32(t1), - edgeUV0.m_v * ndFloat32(t0) + edgeUV1.m_v * ndFloat32(t1)); - m_attrib.m_uv0Channel.PushBack(edgeUV); - - ndUV twinUV0(m_attrib.m_uv0Channel[ndInt32(edge->m_twin->m_next->m_userData)]); - ndUV twinUV1(m_attrib.m_uv0Channel[ndInt32(edge->m_twin->m_userData)]); - ndUV twinUV( - twinUV0.m_u * ndFloat32(t0) + twinUV1.m_u * ndFloat32(t1), - twinUV0.m_v * ndFloat32(t0) + twinUV1.m_v * ndFloat32(t1)); - m_attrib.m_uv0Channel.PushBack(twinUV); - } - - if (m_attrib.m_uv1Channel.GetCount()) - { - ndAssert(0); - } - - if (m_attrib.m_colorChannel.GetCount()) - { - ndAssert(0); - } -#endif -} - -void ndMeshEffect::FlipWinding() -{ - ndInt32 index[DG_MESH_EFFECT_POINT_SPLITED]; - ndInt64 userData[DG_MESH_EFFECT_POINT_SPLITED]; - - ndPolyhedra polyhedra(*this); - RemoveAll(); - - ndPolyhedra::BeginFace(); - ndInt32 mark = polyhedra.IncLRU(); - ndPolyhedra::Iterator iter(polyhedra); - for (iter.Begin(); iter; iter++) - { - ndEdge* const face = &iter.GetNode()->GetInfo(); - if ((face->m_mark != mark) && (face->m_incidentFace > 0)) - { - ndEdge* ptr = face; - ndInt32 indexCount = 0; - do - { - index[indexCount] = ptr->m_incidentVertex; - userData[indexCount] = ndInt64(ptr->m_userData); - ptr->m_mark = mark; - indexCount++; - ptr = ptr->m_prev; - } while (ptr != face); - AddFace(indexCount, index, userData); - } - } - ndPolyhedra::EndFace(); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect2.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect2.cpp deleted file mode 100644 index a61a22c7ed..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect2.cpp +++ /dev/null @@ -1,1259 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndStack.h" -#include "ndMatrix.h" -#include "ndMeshEffect.h" -#include "ndConvexHull3d.h" -#include "ndConvexHull4d.h" -#include "ndDelaunayTetrahedralization.h" - -//#include "dgCollisionConvexHull.h" - - -#if 0 -class dgRayTrataAABBAccelerator: public ndMeshEffect::dMeshBVH -{ - public: - dgRayTrataAABBAccelerator(const ndMeshEffect* const tetraMesh) - :ndMeshEffect::dMeshBVH(tetraMesh) - { - Build(); - } - - dgMeshBVHNode* CreateLeafNode(dEdge* const face, void* const userData) - { - dgMemoryAllocator* const allocator = m_mesh->GetAllocator(); - dgMeshBVHNode* const node = new (allocator)dgMeshBVHNode(m_mesh, face, userData); - - dInt32 mark = m_mesh->GetLRU(); - - dVector p0(m_mesh->GetVertex(face->m_twin->m_prev->m_incidentVertex)); - dVector p1(p0); - dEdge* faceEdge = face; - do { - dEdge* twinFace = faceEdge->m_twin; - do { - twinFace->m_mark = mark; - twinFace = twinFace->m_next; - } while (twinFace != faceEdge->m_twin); - - dVector point(m_mesh->GetVertex(faceEdge->m_incidentVertex)); - p0 = point.GetMin(p0); - p1 = point.GetMax(p1); - - faceEdge = faceEdge->m_next; - } while (faceEdge != face); - - dVector padding(dFloat32(0.01f)); - p0 -= padding; - p1 += padding; - node->SetBox(p0, p1); - return node; - } -}; - - -// idea taken from paper: Fast Tetrahedral Meshes with Good Dihedral Angles, by Francois Labelle Jonathan Richard Shewchuk -// but quite different approach. -class dgTetraIsoSufaceStuffing -{ - public: - enum dgVertexSign - { - m_onSuface, - m_inside, - m_outside, - }; - - class dgGridDimension - { - public: - dBigVector m_origin; - dFloat64 m_cellSize; - dFloat64 m_diameter; - dInt32 m_gridSizeX; - dInt32 m_gridSizeY; - dInt32 m_gridSizeZ; - dInt32 m_innerSize; - dInt32 m_outerSize; - }; - - template - class dgAssessor - { - public: - dgAssessor() - :m_count(0) - { - } - - dInt32 GetCount() const - { - return m_count; - } - - const T& operator[] (dInt32 i) const - { - dAssert(i >= 0); - dAssert(i < size); - return m_elements[i]; - } - - T& operator[] (dInt32 i) - { - dAssert (i >= 0); - dAssert (i < size); - return m_elements[i]; - } - - void PushBack (const T data) - { - dAssert(m_count >= 0); - dAssert(m_count < size); - m_elements[m_count] = data; - m_count ++; - } - - private: - dInt32 m_count; - T m_elements[size]; - }; - - typedef dgAssessor dgTetrahedra; - typedef dgAssessor dgTetraEdgeCuts; - typedef dgAssessor dgTetraToVertexNode; - - class dgNormalMap - { - public: - dgNormalMap() - :m_count(sizeof (m_normal)/sizeof (m_normal[0])) - { - dVector p0(dFloat32(1.0f), dFloat32(0.0f), dFloat32(0.0f), dFloat32(0.0f)); - dVector p1(dFloat32(-1.0f), dFloat32(0.0f), dFloat32(0.0f), dFloat32(0.0f)); - dVector p2(dFloat32(0.0f), dFloat32(1.0f), dFloat32(0.0f), dFloat32(0.0f)); - dVector p3(dFloat32(0.0f), dFloat32(-1.0f), dFloat32(0.0f), dFloat32(0.0f)); - dVector p4(dFloat32(0.0f), dFloat32(0.0f), dFloat32(1.0f), dFloat32(0.0f)); - dVector p5(dFloat32(0.0f), dFloat32(0.0f), dFloat32(-1.0f), dFloat32(0.0f)); - - dInt32 count = 0; - dInt32 subdivitions = 1; - TessellateTriangle(subdivitions, p4, p0, p2, count); - TessellateTriangle(subdivitions, p0, p5, p2, count); - TessellateTriangle(subdivitions, p5, p1, p2, count); - TessellateTriangle(subdivitions, p1, p4, p2, count); - TessellateTriangle(subdivitions, p0, p4, p3, count); - TessellateTriangle(subdivitions, p5, p0, p3, count); - TessellateTriangle(subdivitions, p1, p5, p3, count); - TessellateTriangle(subdivitions, p4, p1, p3, count); - } - - private: - void TessellateTriangle(dInt32 level, const dVector& p0, const dVector& p1, const dVector& p2, dInt32& count) - { - if (level) - { - dAssert(dAbs(p0.DotProduct(p0).GetScalar() - dFloat32(1.0f)) < dFloat32(1.0e-4f)); - dAssert(dAbs(p1.DotProduct(p1).GetScalar() - dFloat32(1.0f)) < dFloat32(1.0e-4f)); - dAssert(dAbs(p2.DotProduct(p2).GetScalar() - dFloat32(1.0f)) < dFloat32(1.0e-4f)); - dVector p01(p0 + p1); - dVector p12(p1 + p2); - dVector p20(p2 + p0); - - p01 = p01.Scale(dgRsqrt(p01.DotProduct(p01).GetScalar())); - p12 = p12.Scale(dgRsqrt(p12.DotProduct(p12).GetScalar())); - p20 = p20.Scale(dgRsqrt(p20.DotProduct(p20).GetScalar())); - - dAssert(dAbs(p01.DotProduct(p01).GetScalar() - dFloat32(1.0f)) < dFloat32(1.0e-4f)); - dAssert(dAbs(p12.DotProduct(p12).GetScalar() - dFloat32(1.0f)) < dFloat32(1.0e-4f)); - dAssert(dAbs(p20.DotProduct(p20).GetScalar() - dFloat32(1.0f)) < dFloat32(1.0e-4f)); - - TessellateTriangle(level - 1, p0, p01, p20, count); - TessellateTriangle(level - 1, p1, p12, p01, count); - TessellateTriangle(level - 1, p2, p20, p12, count); - TessellateTriangle(level - 1, p01, p12, p20, count); - } else { - dBigPlane n(p0, p1, p2); - n = n.Scale(dFloat64(1.0f) / sqrt(n.DotProduct3(n))); - n.m_w = dFloat64(0.0f); - dInt32 index = dgBitReversal(count, sizeof (m_normal) / sizeof (m_normal[0])); - m_normal[index] = n; - count++; - dAssert(count <= sizeof (m_normal) / sizeof (m_normal[0])); - } - } - - public: - dBigVector m_normal[32]; - dInt32 m_count; - }; - - class dgClosePointsAccelerator: public ndMeshEffect::dMeshBVH - { - public: - dgClosePointsAccelerator(const ndMeshEffect* const mesh) - :ndMeshEffect::dMeshBVH(mesh) - { - Build(); - } - - dgMeshBVHNode* CreateLeafNode(dEdge* const face, void* const userData) - { - dgMemoryAllocator* const allocator = m_mesh->GetAllocator(); - dgMeshBVHNode* const node = new (allocator)dgMeshBVHNode(m_mesh, face, userData); - - dInt32 mark = m_mesh->GetLRU(); - dAssert(mark != face->m_mark); - - dEdge* faceEdge = face; - do { - faceEdge->m_mark = mark; - faceEdge = faceEdge->m_twin->m_next; - } while (faceEdge != face); - - dVector padding(dFloat32(1.0f / 32.0f)); - dVector p(m_mesh->GetVertex(face->m_incidentVertex)); - dVector p0(p - padding); - dVector p1(p + padding); - node->SetBox(p0, p1); - return node; - } - - bool DoesTetrahedrumHasInsidePoints (const dgArray& points, const dgTetrahedra& tetra) const - { - dBigVector box0(dFloat64( 1.0e10f)); - dBigVector box1(dFloat64(-1.0e10f)); - for (dInt32 i = 0; i < 4; ++i) { - box0 = box0.GetMin(points[tetra[i]]); - box1 = box1.GetMax(points[tetra[i]]); - } - - dBigVector padding (dFloat64 (0.01f)); - box0 -= padding; - box1 += padding; - - dList overlapNodes(m_mesh->GetAllocator()); - GetOverlapNodes(overlapNodes, box0, box1); - if (overlapNodes.GetCount()) { - dBigVector p0(points[tetra[0]]); - dBigVector p1(points[tetra[1]]); - dBigVector p2(points[tetra[2]]); - dBigVector p3(points[tetra[3]]); - - for (dList::dNode* node = overlapNodes.GetFirst(); node; node = node->GetNext()) { - dEdge* const edge = node->GetInfo()->m_face; - dBigVector point(m_mesh->GetVertex(edge->m_incidentVertex)); - dBigVector closestPoint(dgPointToTetrahedrumDistance(point, p0, p1, p2, p3)); - dBigVector error(closestPoint - point); - dFloat64 error2 = error.DotProduct3(error); - if (error2 < dFloat64(1.0e-8f)) { - return true; - } - } - } - - return false; - } - }; - - class dgRayTraceAccelerator: public ndMeshEffect::dMeshBVH - { - enum dgTraceType - { - m_pointSide, - m_pointOnSurface, - }; - - class dgRayTraceBase - { - public: - dgRayTraceBase(dgTraceType type) - :m_type(type) - { - } - dgTraceType m_type; - }; - - class dgRayTracePointSide: public dgRayTraceBase - { - public: - dgRayTracePointSide() - :dgRayTraceBase(m_pointSide) - ,m_hitCount(0) - ,m_rayIsDegenerate(true) - { - } - dInt32 m_hitCount; - bool m_rayIsDegenerate; - }; - - class dgRayPointOnSurface: public dgRayTraceBase - { - public: - dgRayPointOnSurface() - :dgRayTraceBase(m_pointOnSurface) - ,m_param(2.0f) - { - } - - dFloat32 m_param; - }; - - public: - dgRayTraceAccelerator(const ndMeshEffect* const mesh, dFloat64 diameter) - :ndMeshEffect::dMeshBVH(mesh) - ,m_normals() - ,m_diameter(diameter) - { - Build(); - } - - dgMeshBVHNode* CreateLeafNode(dEdge* const face, void* const userData) - { - dgMemoryAllocator* const allocator = m_mesh->GetAllocator(); - dgMeshBVHNode* const node = new (allocator)dgMeshBVHNode(m_mesh, face, userData); - dInt32 mark = m_mesh->GetLRU(); - dAssert(mark != face->m_mark); - - dEdge* faceEdge = face; - do { - faceEdge->m_mark = mark; - faceEdge = faceEdge->m_next; - } while (faceEdge != face); - return node; - } - - dFloat64 dgPointToRayDistance (const dBigVector& point, const dBigVector& ray_p0, const dBigVector& ray_p1, dgRayTracePointSide* const rayType) const - { - dBigVector dp(ray_p1 - ray_p0); - dFloat64 den = dp.DotProduct3(dp); - dFloat64 num = dp.DotProduct3(point - ray_p0); - if ((num >= dFloat64 (0.0f)) && (num <= den)) { - dBigVector p (ray_p0 + dp.Scale (num / den)); - dBigVector dist (point - p); - if (dist.DotProduct3(dist) < dFloat64 (1.0e-12f)) { - rayType->m_rayIsDegenerate = true; - return dFloat64 (-2.0f); - } - } - return dFloat64 (2.0f); - } - - dFloat64 PointSideTest(const dgMeshBVHNode* const faceNode, const dBigVector& point0, const dBigVector& point1, dgRayTracePointSide* const rayType) const - { - const dEdge* const edge = faceNode->m_face; - const dBigVector p0 (m_mesh->GetVertex(edge->m_incidentVertex)); - const dBigVector p1 (m_mesh->GetVertex(edge->m_next->m_incidentVertex)); - const dBigVector p2 (m_mesh->GetVertex(edge->m_next->m_next->m_incidentVertex)); - - const dBigVector e10(p1 - p0); - const dBigVector e20(p2 - p0); - const dFloat64 a00 = e10.DotProduct(e10).GetScalar(); - const dFloat64 a11 = e20.DotProduct(e20).GetScalar(); - const dFloat64 a01 = e10.DotProduct(e20).GetScalar(); - - const dFloat64 det = a00 * a11 - a01 * a01; - dAssert(det >= dFloat32(0.0f)); - if (dAbs(det) > dFloat32(1.0e-24f)) { - dBigVector p0Point(point0 - p0); - dBigVector normal(e10.CrossProduct(e20)); - dFloat64 t = -normal.DotProduct3(p0Point) / normal.DotProduct3(point1 - point0); - if ((t > dFloat64(0.0f)) && (t < dFloat64(1.0f))) { - dBigVector point(point0 + (point1 - point0).Scale(t)); - dBigVector variPoint(point - p0); - const dFloat64 b0 = e10.DotProduct(variPoint).GetScalar(); - const dFloat64 b1 = e20.DotProduct(variPoint).GetScalar(); - - dFloat64 beta = b1 * a00 - a01 * b0; - dFloat64 alpha = b0 * a11 - a01 * b1; - - if (beta <= dFloat32(0.0f)) { - return dgPointToRayDistance (point, p0, p1, rayType); - } else if (alpha <= dFloat32(0.0f)) { - return dgPointToRayDistance (point, p0, p2, rayType); - } else if ((alpha + beta) >= det) { - return dgPointToRayDistance (point, p1, p2, rayType); - } - rayType->m_hitCount ++; - } - } - return dFloat64 (2.0f); - } - - - dFloat64 PointSurfaceHit(const dgMeshBVHNode* const faceNode, const dBigVector& point0, const dBigVector& point1, dgRayPointOnSurface* const rayType) const - { - const dEdge* const edge = faceNode->m_face; - const dBigVector p0(m_mesh->GetVertex(edge->m_incidentVertex)); - const dBigVector p1(m_mesh->GetVertex(edge->m_next->m_incidentVertex)); - const dBigVector p2(m_mesh->GetVertex(edge->m_next->m_next->m_incidentVertex)); - - const dBigVector e10(p1 - p0); - const dBigVector e20(p2 - p0); - const dFloat64 a00 = e10.DotProduct(e10).GetScalar(); - const dFloat64 a11 = e20.DotProduct(e20).GetScalar(); - const dFloat64 a01 = e10.DotProduct(e20).GetScalar(); - - const dFloat64 det = a00 * a11 - a01 * a01; - dAssert(det >= dFloat32(0.0f)); - if (dAbs(det) > dFloat32(1.0e-24f)) { - dBigVector p0Point(point0 - p0); - dBigVector normal(e10.CrossProduct(e20)); - dFloat64 t = -normal.DotProduct3(p0Point) / normal.DotProduct3(point1 - point0); - if ((t > dFloat64(0.0f)) && (t < dFloat64(1.0f))) { - dBigVector point(point0 + (point1 - point0).Scale(t)); - dBigVector variPoint(point - p0); - const dFloat64 b0 = e10.DotProduct(variPoint).GetScalar(); - const dFloat64 b1 = e20.DotProduct(variPoint).GetScalar(); - - dFloat64 beta = b1 * a00 - a01 * b0; - dFloat64 alpha = b0 * a11 - a01 * b1; - - if (beta <= dFloat32(0.0f)) { - return dFloat64(2.0f); - } else if (alpha <= dFloat32(0.0f)) { - return dFloat64(2.0f); - } else if ((alpha + beta) >= det) { - return dFloat64(2.0f); - } - if (t < rayType->m_param) { - rayType->m_param = dFloat32 (t); - } - } - } - return dFloat64(2.0f); - } - - dFloat64 RayFaceIntersect(const dgMeshBVHNode* const faceNode, const dBigVector& point0, const dBigVector& point1, void* const userData) const - { - dgRayTraceBase* const rayType = (dgRayTraceBase*)userData; - - switch (rayType->m_type) - { - case m_pointSide: - return PointSideTest(faceNode, point0, point1, (dgRayTracePointSide*) rayType); - - case m_pointOnSurface: - return PointSurfaceHit(faceNode, point0, point1, (dgRayPointOnSurface*) rayType); - } - - dAssert (0); - return dFloat64 (-1.0f); - } - - dgVertexSign CalculateVertexSide (const dBigVector& point0) const - { - dgRayTracePointSide hits; - for (dInt32 i = 0; (i < m_normals.m_count) && hits.m_rayIsDegenerate; ++i) - { - hits.m_hitCount = 0; - hits.m_rayIsDegenerate = false; - dBigVector point1 (point0 + dBigVector (m_normals.m_normal[i].Scale (m_diameter))); - FaceRayCast (point0, point1, &hits); - } - dAssert (!hits.m_rayIsDegenerate); - return (hits.m_hitCount & 1) ? m_inside : m_outside; - } - - dFloat32 CalculateEdgeCut (const dBigVector& point0, const dBigVector& point1) const - { - dgRayPointOnSurface pointOnSurface; - FaceRayCast (point0, point1, &pointOnSurface); - return pointOnSurface.m_param; - } - - dgNormalMap m_normals; - dFloat64 m_diameter; - }; - - dgTetraIsoSufaceStuffing(const ndMeshEffect* const mesh, dFloat64 cellSize) - :m_points(mesh->GetAllocator()) - ,m_tetraList(mesh->GetAllocator()) - ,m_pointCount(0) - ,m_tetraCount(0) - { - dgArray vertexSide(mesh->GetAllocator()); - dgArray tetraGraph(mesh->GetAllocator()); - dgArray tetraEdgeCuts(mesh->GetAllocator()); - - dgGridDimension gridDim (CalculateGridSize(mesh, cellSize)); - dgClosePointsAccelerator closePointaAccelerator (mesh); - dgRayTraceAccelerator rayAccelerator (mesh, gridDim.m_diameter); - - PopulateGridPoints (gridDim); - CalculateVertexSide (vertexSide, rayAccelerator); - BuildTetraGraph (gridDim, vertexSide, closePointaAccelerator, tetraGraph); - //CalculateEdgeCuts (tetraEdgeCuts, tetraGraph, vertexSide, rayAccelerator); - //SnapClosePoints (tetraEdgeCuts, tetraGraph, vertexSide, rayAccelerator); - } - - void CalculateEdgeCuts (dgArray& tetraEdgeCuts, const dgArray& tetraGraph, const dgArray& vertexSide, const dgRayTraceAccelerator& rayAccelerator) - { - tetraEdgeCuts.Resize(m_tetraCount); - for (dInt32 i = 0; i < m_tetraCount; ++i) { - tetraEdgeCuts[i] = dgTetraEdgeCuts(); - for (dInt32 j = 0; j < 6; ++j) { - tetraEdgeCuts[i].PushBack(dFloat32(-1.0f)); - } - } - - for (dInt32 i = 0; i < m_pointCount; ++i) { - if (vertexSide[i] == m_outside) { - const dgTetraToVertexNode& graphNode = tetraGraph[i]; - for (dInt32 j = 0; j < graphNode.GetCount(); ++j) { - dgTetraEdgeCuts& cuts = tetraEdgeCuts[graphNode[j]]; - const dgTetrahedra& tetra = m_tetraList[graphNode[j]]; - dAssert ((tetra[0] == i) || (tetra[1] == i) || (tetra[2] == i) || (tetra[3] == i)); - - dInt32 index = 0; - for (dInt32 i0 = 0; i0 < 3; ++i0) { - const dBigVector& p0 = m_points[tetra[i0]]; - for (dInt32 i1 = i0 + 1; i1 < 4; ++i1) { - if ((tetra[i0] == i) && (vertexSide[tetra[i1]] == m_inside)) { - const dBigVector& p1 = m_points[tetra[i1]]; - dFloat32 param = rayAccelerator.CalculateEdgeCut (p0, p1); - cuts[index] = param; - } - index ++; - dAssert (index <= 6); - } - } - } - } - } - } - - void SnapClosePoints (dgArray& tetraEdgeCuts, const dgArray& tetraGraph, const dgArray& vertexSide, const dgRayTraceAccelerator& rayAccelerator) - { - for (dInt32 i = 0; i < m_pointCount; ++i) { - if (vertexSide[i] == m_outside) { -/* - const dgTetraToVertexNode& graphNode = tetraGraph[i]; - for (dInt32 j = 0; j < graphNode.GetCount(); ++j) { - dgTetraEdgeCuts& cuts = tetraEdgeCuts[graphNode[j]]; - const dgTetrahedra& tetra = m_tetraList[graphNode[j]]; - dAssert((tetra[0] == i) || (tetra[1] == i) || (tetra[2] == i) || (tetra[3] == i)); - - dInt32 index = 0; - for (dInt32 i0 = 0; i0 < 3; i0++) { - const dBigVector& p0 = m_points[tetra[i0]]; - for (dInt32 i1 = i0 + 1; i1 < 4; i1++) { - if ((tetra[i0] == i) && (vertexSide[tetra[i1]] == m_inside)) { - const dBigVector& p1 = m_points[tetra[i1]]; - dFloat32 param = rayAccelerator.CalculateEdgeCut(p0, p1); - cuts[index] = param; - } - index++; - dAssert(index <= 6); - } - } - } -*/ - } - } - } - - void CalculateVertexSide (dgArray& vertexSide, const dgRayTraceAccelerator& rayAccelerator) - { - vertexSide.Resize(m_pointCount); - for (dInt32 i = 0; i < m_pointCount; ++i) { - vertexSide[i] = rayAccelerator.CalculateVertexSide (m_points[i]); - } - } - - dgGridDimension CalculateGridSize(const ndMeshEffect* const mesh, dFloat64 cellsize) const - { - dBigVector minBox; - dBigVector maxBox; - mesh->CalculateAABB(minBox, maxBox); - minBox -= (maxBox - minBox).Scale(dFloat64(1.e-3f)); - maxBox += (maxBox - minBox).Scale(dFloat64(1.e-3f)); - - dBigVector mMinInt((minBox.Scale(dFloat64(1.0f) / cellsize)).Floor()); - dBigVector mMaxInt((maxBox.Scale(dFloat64(1.0f) / cellsize)).Floor() + dBigVector::m_one); - dBigVector gridSize(mMaxInt - mMinInt + dBigVector::m_one); - - dBigVector size(maxBox - minBox); - - dgGridDimension gridDimension; - gridDimension.m_origin = minBox; - gridDimension.m_cellSize = cellsize; - gridDimension.m_diameter = sqrt (size.DotProduct3(size)); - gridDimension.m_gridSizeX = dInt32(gridSize.m_x); - gridDimension.m_gridSizeY = dInt32(gridSize.m_y); - gridDimension.m_gridSizeZ = dInt32(gridSize.m_z); - - gridDimension.m_innerSize = gridDimension.m_gridSizeX * gridDimension.m_gridSizeY * gridDimension.m_gridSizeZ; - gridDimension.m_outerSize = gridDimension.m_innerSize + (gridDimension.m_gridSizeX + 1) * (gridDimension.m_gridSizeY + 1) * (gridDimension.m_gridSizeZ + 1); - return gridDimension; - } - - void PopulateGridPoints(const dgGridDimension& gridDimension) - { - m_pointCount = 0; - m_points.Resize(gridDimension.m_outerSize); - - for (dInt32 z = 0; z < gridDimension.m_gridSizeZ; z++) { - for (dInt32 y = 0; y < gridDimension.m_gridSizeY; y++) { - for (dInt32 x = 0; x < gridDimension.m_gridSizeX; x++) { - m_points[m_pointCount] = gridDimension.m_origin + dBigVector(x * gridDimension.m_cellSize, y * gridDimension.m_cellSize, z * gridDimension.m_cellSize, dFloat64(0.0f)); - m_pointCount++; - } - } - } - - dBigVector outerOrigin(gridDimension.m_origin - dBigVector(gridDimension.m_cellSize * dFloat64(0.5f))); - outerOrigin.m_w = dFloat64 (0.0f); - for (dInt32 z = 0; z < gridDimension.m_gridSizeZ + 1; z++) { - for (dInt32 y = 0; y < gridDimension.m_gridSizeY + 1; y++) { - for (dInt32 x = 0; x < gridDimension.m_gridSizeX + 1; x++) { - m_points[m_pointCount] = outerOrigin + dBigVector(x * gridDimension.m_cellSize, y * gridDimension.m_cellSize, z * gridDimension.m_cellSize, dFloat64(0.0f)); - m_pointCount++; - } - } - } - } - - void AddTetra(dgArray& graph, const dgTetrahedra& tetra, const dgArray& vertexSigns, const dgClosePointsAccelerator& closePoint) - { - dAssert(CalculateVolume(tetra) > dFloat64(0.0f)); - bool hasInsizePoints = false; - hasInsizePoints = hasInsizePoints || (vertexSigns[tetra[0]] == m_inside); - hasInsizePoints = hasInsizePoints || (vertexSigns[tetra[1]] == m_inside); - hasInsizePoints = hasInsizePoints || (vertexSigns[tetra[2]] == m_inside); - hasInsizePoints = hasInsizePoints || (vertexSigns[tetra[3]] == m_inside); - hasInsizePoints = hasInsizePoints || closePoint.DoesTetrahedrumHasInsidePoints(m_points, tetra); - - if (hasInsizePoints) { - m_tetraList[m_tetraCount] = tetra; - dgTetrahedra& tetraEntry = m_tetraList[m_tetraCount]; - for (dInt32 i = 0; i < 4; ++i) { - dInt32 vertexIndex = tetra[i]; - tetraEntry.PushBack(vertexIndex); - graph[vertexIndex].PushBack(m_tetraCount); - } - m_tetraCount ++; - } - } - - void BuildTetraGraph(const dgGridDimension& gridDimension, const dgArray& vertexSigns, const dgClosePointsAccelerator& closePoint, dgArray& graph) - { - graph.Resize(m_pointCount); - for (dInt32 i = 0; i < m_pointCount; ++i) { - graph[i] = dgTetraToVertexNode(); - } - - dgDelaunayTetrahedralization delaunayTetrahedras(m_points.GetAllocator(), &m_points[0].m_x, m_pointCount, sizeof (dBigVector), dFloat32(0.0f)); - delaunayTetrahedras.RemoveUpperHull(); - - for (dgDelaunayTetrahedralization::dNode* node = delaunayTetrahedras.GetFirst(); node; node = node->GetNext()) { - dgTetrahedra stuffingTetra; - dgConvexHull4dTetraherum& delaunayTetra = node->GetInfo(); - - for (dInt32 i = 0; i < 4; ++i) { - stuffingTetra[i] = delaunayTetra.m_faces[0].m_index[i]; - } - dFloat64 volume = CalculateVolume(stuffingTetra); - if (volume < dFloat64 (0.0f)) { - dSwap(stuffingTetra[0], stuffingTetra[1]); - } - AddTetra(graph, stuffingTetra, vertexSigns, closePoint); - } - - -/* - const dInt32 base = gridDimension.m_innerSize; - for (dInt32 z = 0; z < gridDimension.m_gridSizeZ; z++) { - for (dInt32 y = 0; y < gridDimension.m_gridSizeY; y++) { - for (dInt32 x = 0; x < gridDimension.m_gridSizeX - 1; x++) { - dgTetrahedra tetra; - tetra[0] = ((z * gridDimension.m_gridSizeY + y) * gridDimension.m_gridSizeX) + x; - tetra[1] = ((z * gridDimension.m_gridSizeY + y) * gridDimension.m_gridSizeX) + x + 1; - tetra[2] = base + (((z + 0) * (gridDimension.m_gridSizeY + 1) + y + 0) * (gridDimension.m_gridSizeX + 1)) + x + 1; - tetra[3] = base + (((z + 0) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 1; - AddTetra(graph, tetra, vertexSigns, closePoint); - - tetra[0] = ((z * gridDimension.m_gridSizeY + y) * gridDimension.m_gridSizeX) + x; - tetra[1] = ((z * gridDimension.m_gridSizeY + y) * gridDimension.m_gridSizeX) + x + 1; - tetra[3] = base + (((z + 1) * (gridDimension.m_gridSizeY + 1) + y + 0) * (gridDimension.m_gridSizeX + 1)) + x + 1; - tetra[2] = base + (((z + 1) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 1; - AddTetra(graph, tetra, vertexSigns, closePoint); - } - } - } - - for (dInt32 z = 0; z < gridDimension.m_gridSizeZ; z++) { - for (dInt32 y = 0; y < gridDimension.m_gridSizeY - 1; y++) { - for (dInt32 x = 0; x < gridDimension.m_gridSizeX; x++) { - dgTetrahedra tetra; - tetra[0] = ((z * gridDimension.m_gridSizeY + (y + 0)) * gridDimension.m_gridSizeX) + x; - tetra[1] = ((z * gridDimension.m_gridSizeY + (y + 1)) * gridDimension.m_gridSizeX) + x; - tetra[3] = base + (((z + 0) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 1; - tetra[2] = base + (((z + 1) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 1; - AddTetra(graph, tetra, vertexSigns, closePoint); - - tetra[0] = ((z * gridDimension.m_gridSizeY + (y + 0)) * gridDimension.m_gridSizeX) + x; - tetra[1] = ((z * gridDimension.m_gridSizeY + (y + 1)) * gridDimension.m_gridSizeX) + x; - tetra[2] = base + (((z + 0) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 0; - tetra[3] = base + (((z + 1) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 0; - AddTetra(graph, tetra, vertexSigns, closePoint); - } - } - } - - for (dInt32 z = 0; z < gridDimension.m_gridSizeZ - 1; z++) { - for (dInt32 y = 0; y < gridDimension.m_gridSizeY; y++) { - for (dInt32 x = 0; x < gridDimension.m_gridSizeX; x++) { - dgTetrahedra tetra; - tetra[0] = (((z + 0) * gridDimension.m_gridSizeY + y + 0) * gridDimension.m_gridSizeX) + x; - tetra[1] = (((z + 1) * gridDimension.m_gridSizeY + y + 0) * gridDimension.m_gridSizeX) + x; - tetra[3] = base + (((z + 1) * (gridDimension.m_gridSizeY + 1) + y + 0) * (gridDimension.m_gridSizeX + 1)) + x + 0; - tetra[2] = base + (((z + 1) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 0; - AddTetra(graph, tetra, vertexSigns, closePoint); - - tetra[0] = (((z + 0) * gridDimension.m_gridSizeY + y + 0) * gridDimension.m_gridSizeX) + x; - tetra[1] = (((z + 1) * gridDimension.m_gridSizeY + y + 0) * gridDimension.m_gridSizeX) + x; - tetra[2] = base + (((z + 1) * (gridDimension.m_gridSizeY + 1) + y + 0) * (gridDimension.m_gridSizeX + 1)) + x + 1; - tetra[3] = base + (((z + 1) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 1; - AddTetra(graph, tetra, vertexSigns, closePoint); - } - } - } - - for (dInt32 z = 0; z < gridDimension.m_gridSizeZ; z++) { - for (dInt32 y = 0; y < gridDimension.m_gridSizeY - 1; y++) { - for (dInt32 x = 0; x < gridDimension.m_gridSizeX; x++) { - dgTetrahedra tetra; - tetra[0] = ((z * gridDimension.m_gridSizeY + (y + 0)) * gridDimension.m_gridSizeX) + x; - tetra[1] = ((z * gridDimension.m_gridSizeY + (y + 1)) * gridDimension.m_gridSizeX) + x; - tetra[2] = base + (((z + 1) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 0; - tetra[3] = base + (((z + 1) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 1; - AddTetra(graph, tetra, vertexSigns, closePoint); - - tetra[0] = ((z * gridDimension.m_gridSizeY + (y + 0)) * gridDimension.m_gridSizeX) + x; - tetra[1] = ((z * gridDimension.m_gridSizeY + (y + 1)) * gridDimension.m_gridSizeX) + x; - tetra[3] = base + (((z + 0) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 0; - tetra[2] = base + (((z + 0) * (gridDimension.m_gridSizeY + 1) + y + 1) * (gridDimension.m_gridSizeX + 1)) + x + 1; - AddTetra(graph, tetra, vertexSigns, closePoint); - } - } - } -*/ - } - - dFloat64 CalculateVolume(const dgTetrahedra& tetra) const - { - const dBigVector& p0 = m_points[tetra[0]]; - const dBigVector& p1 = m_points[tetra[1]]; - const dBigVector& p2 = m_points[tetra[2]]; - const dBigVector& p3 = m_points[tetra[3]]; - dBigVector p10(p1 - p0); - dBigVector p20(p2 - p0); - dBigVector p30(p3 - p0); - return p10.DotProduct3(p20.CrossProduct(p30)); - } - - dgArray m_points; - dgArray m_tetraList; - dInt32 m_pointCount; - dInt32 m_tetraCount; -}; - -void ndMeshEffect::LoadOffMesh(const char* const fileName) -{ - class ParceOFF - { - public: - enum Token - { - m_off, - m_value, - m_end, - }; - - ParceOFF(FILE* const file) - :m_file(file) - { - } - - Token GetToken(char* const buffer) const - { - while (!feof(m_file) && fscanf(m_file, "%s", buffer)) { - if (buffer[0] == '#') { - SkipLine(); - } else { - if (!_stricmp(buffer, "OFF")) { - return m_off; - } - return m_value; - } - } - return m_end; - } - - char* SkipLine() const - { - char tmp[1024]; - return fgets(tmp, sizeof (tmp), m_file); - } - - dInt32 GetInteger() const - { - char buffer[1024]; - GetToken(buffer); - return atoi(buffer); - } - - dFloat64 GetFloat() const - { - char buffer[1024]; - GetToken(buffer); - return atof(buffer); - } - - FILE* m_file; - }; - - FILE* const file = fopen(fileName, "rb"); - if (file) { - ParceOFF parcel(file); - - dInt32 vertexCount = 0; - dInt32 faceCount = 0; - //dInt32 edgeCount = 0; - - char buffer[1024]; - bool stillData = true; - while (stillData) { - ParceOFF::Token token = parcel.GetToken(buffer); - switch (token) - { - case ParceOFF::m_off: - { - vertexCount = parcel.GetInteger(); - faceCount = parcel.GetInteger(); - // edgeCount = parcel.GetInteger(); - parcel.SkipLine(); - - dgArray points(GetAllocator()); - for (dInt32 i = 0; i < vertexCount; ++i) { - dFloat64 x = parcel.GetFloat(); - dFloat64 y = parcel.GetFloat(); - dFloat64 z = parcel.GetFloat(); - dBigVector p(x, y, z, dFloat32(0.0f)); - points[i] = p; - } - - dgArray indexList(GetAllocator()); - dgArray faceVertex(GetAllocator()); - dInt32 index = 0; - for (dInt32 i = 0; i < faceCount; ++i) { - const dInt32 faceVertexCount = parcel.GetInteger(); - faceVertex[i] = faceVertexCount; - for (dInt32 j = 0; j < faceVertexCount; ++j) { - indexList[index] = parcel.GetInteger(); - index++; - } - parcel.SkipLine(); - } - - dMeshVertexFormat vertexFormat; - vertexFormat.m_faceCount = faceCount; - vertexFormat.m_faceIndexCount = &faceVertex[0]; - - vertexFormat.m_vertex.m_data = &points[0].m_x; - vertexFormat.m_vertex.m_strideInBytes = sizeof (dBigVector); - vertexFormat.m_vertex.m_indexList = &indexList[0]; - BuildFromIndexList(&vertexFormat); - - CalculateNormals(30.0f * dDegreeToRad); - stillData = false; - break; - } - - default:; - } - } - - fclose(file); - } -} - -void ndMeshEffect::LoadTetraMesh (const char* const filename) -{ - FILE* const file = fopen(filename, "rb"); - if (file) { - dInt32 vertexCount; - size_t ret = fscanf(file, "%d", &vertexCount); - dgArray points(GetAllocator()); - for (dInt32 i = 0; i < vertexCount; ++i) { - float x; - float y; - float z; - ret = fscanf(file, "%f %f %f", &x, &y, &z); - points[i] = dBigVector (x, y, z, dFloat32 (0.0f)); - } - - BeginBuild(); - dInt32 tetras; - ret = fscanf(file, "%d", &tetras); - dgMemoryAllocator* const allocator = GetAllocator(); - for (dInt32 layers = 0; layers < tetras; layers ++) { - dInt32 tetra[4]; - ret = fscanf(file, "%d %d %d %d", &tetra[0], &tetra[1], &tetra[2], &tetra[3]); - ret = 0; - dBigVector pointArray[4]; - for (dInt32 i = 0; i < 4; ++i) { - dInt32 index = tetra[i]; - pointArray[i] = points[index]; - } - - ndMeshEffect convexMesh(allocator, &pointArray[0].m_x, 4, sizeof (dBigVector), dFloat64(0.0f)); - - dAssert(convexMesh.GetCount()); - convexMesh.CalculateNormals(dFloat32(30.0f * dDegreeToRad)); - for (dInt32 i = 0; i < convexMesh.m_points.m_vertex.m_count; ++i) - { - convexMesh.m_points.m_layers[i] = layers; - } - MergeFaces(&convexMesh); - } - EndBuild(dFloat64(1.0e-8f), false); - fclose(file); - } -} - - - -ndMeshEffect* ndMeshEffect::CreateTetrahedraIsoSurface() const -{ -/* -ndMeshEffect xxxx (GetAllocator()); -xxxx.BeginBuild(); - -xxxx.BeginBuildFace (); -xxxx.AddPoint (0.0, 0.0, -1.0); -xxxx.AddLayer (0); - -xxxx.AddPoint (1.0, 0.0, 0.0); -xxxx.AddLayer (0); - -xxxx.AddPoint (0.0, 0.0, 1.0); -xxxx.AddLayer (0); -xxxx.EndBuildFace (); - -xxxx.BeginBuildFace (); -xxxx.AddPoint (0.0, 0.0, -1.0); -xxxx.AddLayer (1); - -xxxx.AddPoint (0.0, 0.0, 1.0); -xxxx.AddLayer (1); - -xxxx.AddPoint (-1.0, 0.0, 0.0); -xxxx.AddLayer (1); - -xxxx.EndBuildFace (); -xxxx.EndBuild(dFloat64(1.0e-8f), false); -*/ - - - dgTetraIsoSufaceStuffing tetraIsoStuffing (this, dFloat64(0.125f)); - - ndMeshEffect* delaunayPartition = nullptr; - if (tetraIsoStuffing.m_tetraCount) { - dgMemoryAllocator* const allocator = GetAllocator(); - delaunayPartition = new (allocator) ndMeshEffect (allocator); - delaunayPartition->BeginBuild(); - dInt32 layer = 0; - dBigVector pointArray[4]; - for (dInt32 j = 0; j < tetraIsoStuffing.m_tetraCount; ++j) { - dgTetraIsoSufaceStuffing::dgTetrahedra& tetra = tetraIsoStuffing.m_tetraList[j]; - for (dInt32 i = 0; i < 4; ++i) { - dInt32 index = tetra[i]; - pointArray[i] = tetraIsoStuffing.m_points[index]; - } - ndMeshEffect convexMesh(allocator, &pointArray[0].m_x, 4, sizeof (dBigVector), dFloat64(0.0f)); - //dAssert (convexMesh.GetCount()); - //convexMesh.CalculateNormals(dFloat32 (30.0f * dgDEG2RAD)); - for (dInt32 i = 0; i < convexMesh.m_points.m_vertex.m_count; ++i) - { - convexMesh.m_points.m_layers[i] = layer; - } - delaunayPartition->MergeFaces(&convexMesh); - layer++; - } - delaunayPartition->EndBuild(dFloat64(1.0e-8f), false); - } - - return delaunayPartition; -} - -void ndMeshEffect::CreateTetrahedraLinearBlendSkinWeightsChannel (const ndMeshEffect* const tetrahedraMesh) -{ -dAssert(0); -/* - dgRayTrataAABBAccelerator accelerator (tetrahedraMesh); - m_points.m_weights.Clear(); - m_points.m_weights.Reserve(m_points.m_vertex.m_count); - - dBigVector padding (dFloat64(1.0f / 32.0f)); - for (dInt32 i = 0; i < m_points.m_weights.m_count; ++i) { - dBigVector p (m_points.m_vertex[i]); - dBigVector p0 (p - padding); - dBigVector p1 (p + padding); - dList overlapNodes (GetAllocator()); - accelerator.GetOverlapNodes (overlapNodes, p0, p1); - dAssert (overlapNodes.GetCount()); - - bool weightFound = false; - for (dList::dNode* node = overlapNodes.GetFirst(); node; node = node->GetNext()) { - dEdge* const edge = node->GetInfo()->m_face; - - dInt32 i0 = edge->m_incidentVertex; - dInt32 i1 = edge->m_next->m_incidentVertex; - dInt32 i2 = edge->m_prev->m_incidentVertex; - dInt32 i3 = edge->m_twin->m_prev->m_incidentVertex; - dBigVector q0 (tetrahedraMesh->m_points.m_vertex[i0]); - dBigVector q1 (tetrahedraMesh->m_points.m_vertex[i1]); - dBigVector q2 (tetrahedraMesh->m_points.m_vertex[i2]); - dBigVector q3 (tetrahedraMesh->m_points.m_vertex[i3]); - - const dBigVector e10(q1 - q0); - const dBigVector e20(q2 - q0); - const dBigVector e30(q3 - q0); - - dAssert (e10.DotProduct(e10).GetScalar() > dFloat32 (0.0f)); - const dFloat64 d0 = sqrt(e10.DotProduct(e10).GetScalar()); - const dFloat64 invd0 = dFloat64(1.0f) / d0; - const dFloat64 l10 = e20.DotProduct(e10).GetScalar() * invd0; - const dFloat64 l20 = e30.DotProduct(e10).GetScalar() * invd0; - - dAssert ((e20.DotProduct(e20).GetScalar() - l10 * l10) > dFloat32 (0.0f)); - const dFloat64 desc11 = e20.DotProduct(e20).GetScalar() - l10 * l10; - - const dFloat64 d1 = sqrt(desc11); - const dFloat64 invd1 = dFloat64(1.0f) / d1; - const dFloat64 l21 = (e30.DotProduct(e20).GetScalar() - l20 * l10) * invd1; - dAssert (e30.DotProduct(e30).GetScalar() - l20 * l20 - l21 * l21 > dFloat32 (0.0f)); - const dFloat64 desc22 = e30.DotProduct(e30).GetScalar() - l20 * l20 - l21 * l21; - - dBigVector p0Point(p - q0); - const dFloat64 d2 = sqrt(desc22); - const dFloat64 invd2 = dFloat64(1.0f) / d2; - - const dFloat64 b0 = e10.DotProduct(p0Point).GetScalar(); - const dFloat64 b1 = e20.DotProduct(p0Point).GetScalar(); - const dFloat64 b2 = e30.DotProduct(p0Point).GetScalar(); - - dFloat64 u1 = b0 * invd0; - dFloat64 u2 = (b1 - l10 * u1) * invd1; - dFloat64 u3 = (b2 - l20 * u1 - l21 * u2) * invd2; - - u3 = u3 * invd2; - u2 = (u2 - l21 * u3) * invd1; - u1 = (u1 - l10 * u2 - l20 * u3) * invd0; - if ((u1 >= dFloat64(0.0f)) && (u2 >= dFloat64(0.0f)) && (u3 >= dFloat64(0.0f)) && ((u1 + u2 + u3) <= dFloat64(1.0f))) { - dBigVector r0 (q0 + e10.Scale(u1) + e20.Scale(u2) + e30.Scale(u3)); - - dFloat64 u0 = dFloat64 (1.0f) - u1 - u2 - u3; - dBigVector r1 (q0.Scale (u0) + q1.Scale (u1) + q2.Scale (u2) + q3.Scale (u3)); - dgWeights& weighSet = m_points.m_weights[i]; - - weighSet.m_controlIndex[0] = i0; - weighSet.m_weightBlends[0] = dFloat32(u0); - - weighSet.m_controlIndex[1] = i1; - weighSet.m_weightBlends[1] = dFloat32(u1); - - weighSet.m_controlIndex[2] = i2; - weighSet.m_weightBlends[2] = dFloat32(u2); - - weighSet.m_controlIndex[3] = i3; - weighSet.m_weightBlends[3] = dFloat32(u3); - - weightFound = true; - break; - } - } - dAssert (weightFound); - if (!weightFound) { - dTrace (("%d %f %f %f\n", i, p.m_x, p.m_y, p.m_z)); - } - - overlapNodes.RemoveAll(); - } -*/ -} -#endif - -ndMeshEffect* ndMeshEffect::CreateVoronoiConvexDecomposition(const ndArray& pointCloud, ndInt32 interiorMaterialIndex, const ndMatrix& textureProjectionMatrix) -{ - ndStack buffer(ndInt32(pointCloud.GetCount() + 32)); - ndBigVector* const pool = &buffer[0]; - ndInt32 count = 0; - ndFloat64 quantizeFactor = ndFloat64(16.0f); - ndFloat64 invQuantizeFactor = ndFloat64(1.0f) / quantizeFactor; - - ndBigVector pMin(ndFloat32(1.0e10f)); - ndBigVector pMax(ndFloat32(-1.0e10f)); - for (ndInt32 i = 0; i indexList(count); - count = ndVertexListToIndexList(&pool[0].m_x, sizeof(ndBigVector), 3, count, &indexList[0], ndFloat64(5.0e-2f)); - ndAssert(count >= 8); - - //ndFloat64 maxSize = ndMax(pMax.m_x - pMin.m_x, pMax.m_y - pMin.m_y, pMax.m_z - pMin.m_z); - ndFloat64 maxSize = ndMax(ndMax(pMax.m_x - pMin.m_x, pMax.m_y - pMin.m_y), pMax.m_z - pMin.m_z); - pMin -= ndBigVector(maxSize, maxSize, maxSize, ndFloat64(0.0f)); - pMax += ndBigVector(maxSize, maxSize, maxSize, ndFloat64(0.0f)); - - // add the a guard zone, so that we do no have to clip - ndInt32 guardVertexKey = count; - pool[count + 0] = ndBigVector(pMin.m_x, pMin.m_y, pMin.m_z, ndFloat64(0.0f)); - pool[count + 1] = ndBigVector(pMax.m_x, pMin.m_y, pMin.m_z, ndFloat64(0.0f)); - pool[count + 2] = ndBigVector(pMin.m_x, pMax.m_y, pMin.m_z, ndFloat64(0.0f)); - pool[count + 3] = ndBigVector(pMax.m_x, pMax.m_y, pMin.m_z, ndFloat64(0.0f)); - pool[count + 4] = ndBigVector(pMin.m_x, pMin.m_y, pMax.m_z, ndFloat64(0.0f)); - pool[count + 5] = ndBigVector(pMax.m_x, pMin.m_y, pMax.m_z, ndFloat64(0.0f)); - pool[count + 6] = ndBigVector(pMin.m_x, pMax.m_y, pMax.m_z, ndFloat64(0.0f)); - pool[count + 7] = ndBigVector(pMax.m_x, pMax.m_y, pMax.m_z, ndFloat64(0.0f)); - count += 8; - - ndDelaunayTetrahedralization delaunayTetrahedras(&pool[0].m_x, count, sizeof(ndBigVector), ndFloat32(0.0f)); - delaunayTetrahedras.RemoveUpperHull(); - - // delaunayTetrahedras.Save("xxx0.txt"); - ndInt32 tetraCount = delaunayTetrahedras.GetCount(); - ndStack voronoiPoints(tetraCount + 32); - ndStack tetradrumNode(tetraCount); - ndTree, ndInt32> delaunayNodes; - - ndInt32 index = 0; - const ndConvexHull4dVector* const convexHulPoints = delaunayTetrahedras.GetHullVertexArray(); - for (ndDelaunayTetrahedralization::ndNode* node = delaunayTetrahedras.GetFirst(); node; node = node->GetNext()) - { - ndConvexHull4dTetraherum& tetra = node->GetInfo(); - voronoiPoints[index] = tetra.CircumSphereCenter(convexHulPoints); - tetradrumNode[index] = node; - - for (ndInt32 i = 0; i < 4; ++i) - { - ndTree, ndInt32>::ndNode* header = delaunayNodes.Find(tetra.m_faces[0].m_index[i]); - if (!header) - { - ndList list; - header = delaunayNodes.Insert(list, tetra.m_faces[0].m_index[i]); - } - header->GetInfo().Append(index); - } - index++; - } - - const ndFloat32 normalAngleInRadians = ndFloat32(30.0f * ndDegreeToRad); - ndMeshEffect* const voronoiPartition = new ndMeshEffect; - voronoiPartition->BeginBuild(); - ndInt32 layer = 0; - ndTree, ndInt32>::Iterator iter(delaunayNodes); - for (iter.Begin(); iter; iter++) - { - ndTree, ndInt32>::ndNode* const nodeNode = iter.GetNode(); - const ndList& list = nodeNode->GetInfo(); - ndInt32 key = nodeNode->GetKey(); - - if (key < guardVertexKey) - { - ndBigVector pointArray[512]; - ndInt32 indexArray[512]; - - ndInt32 count1 = 0; - for (ndList::ndNode* ptr = list.GetFirst(); ptr; ptr = ptr->GetNext()) - { - ndInt32 i = ptr->GetInfo(); - pointArray[count1] = voronoiPoints[i]; - count1++; - ndAssert(count1 < ndInt32(sizeof(pointArray) / sizeof(pointArray[0]))); - } - - count1 = ndVertexListToIndexList(&pointArray[0].m_x, sizeof(ndBigVector), 3, count1, &indexArray[0], ndFloat64(1.0e-3f)); - if (count1 >= 4) - { - ndMeshEffect convexMesh(&pointArray[0].m_x, count1, sizeof(ndBigVector), ndFloat64(0.0f)); - if (convexMesh.GetCount()) - { - convexMesh.m_materials.SetCount(interiorMaterialIndex + 1); - convexMesh.CalculateNormals(normalAngleInRadians); - convexMesh.UniformBoxMapping(interiorMaterialIndex, textureProjectionMatrix); - for (ndInt32 i = 0; i < convexMesh.m_points.m_vertex.GetCount(); ++i) - { - convexMesh.m_points.m_layers[i] = layer; - } - voronoiPartition->MergeFaces(&convexMesh); - layer++; - } - } - } - } - - voronoiPartition->EndBuild(false); - //voronoiPartition->SaveOFF("xxx0.off"); - - ndAssert(interiorMaterialIndex < m_materials.GetCount()); - voronoiPartition->m_materials.SetCount(m_materials.GetCount()); - for (ndInt32 i = 0; i < m_materials.GetCount(); ++i) - { - voronoiPartition->m_materials[i] = m_materials[i]; - } - return voronoiPartition; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect3.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect3.cpp deleted file mode 100644 index 9ad7c25ebe..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect3.cpp +++ /dev/null @@ -1,1377 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndMeshEffect.h" -//#include "dgBody.h" -//#include "dgWorld.h" -//#include "ndMeshEffect.h" -//#include "dgCollisionConvexHull.h" - - -// based of the paper Hierarchical Approximate Convex Decomposition by Khaled Mamou -// with his permission to adapt his algorithm to be more efficient. -// also making some addition to his heuristic for better convex clusters selections -// for the details http://kmamou.blogspot.com/ - -#if 0 -#define DG_CONCAVITY_SCALE ndFloat64 (100.0f) -#define DG_CONCAVITY_PERIMETER_HANDICAP ndFloat64 (0.5f) - -class dgHACDEdge -{ - public: - dgHACDEdge () - :m_mark(0) - ,m_proxyListNode(nullptr) - ,m_backFaceHandicap(dFloat64 (1.0)) - { - } - ~dgHACDEdge () - { - } - - dInt32 m_mark; - void* m_proxyListNode; - dFloat64 m_backFaceHandicap; -}; - -class dHACDClusterFace -{ - public: - dHACDClusterFace() - :m_edge(nullptr) - ,m_area(dFloat64(0.0f)) - { - } - ~dHACDClusterFace() - { - } - - dEdge* m_edge; - dFloat64 m_area; - dBigVector m_normal; -}; - -class dgHACDCluster: public dList -{ - public: - dgHACDCluster () - :dList(nullptr) - ,m_color(0) - ,m_hierachicalClusterIndex(0) - ,m_area(dFloat64 (0.0f)) - ,m_concavity(dFloat64 (0.0f)) - { - } - - bool IsCoplanar(const dBigPlane& plane, const ndMeshEffect& mesh, dFloat64 tolerance) const - { - const dBigVector* const points = (dBigVector*) mesh.GetVertexPool(); - for (dNode* node = GetFirst(); node; node = node->GetNext()) { - const dHACDClusterFace& info = node->GetInfo(); - dEdge* ptr = info.m_edge; - do { - const dBigVector& p = points[ptr->m_incidentVertex]; - dFloat64 dist = fabs(plane.Evalue(p)); - if (dist > tolerance) { - return false; - } - ptr = ptr->m_next; - } while (ptr != info.m_edge); - } - return true; - } - - - dInt32 m_color; - dInt32 m_hierachicalClusterIndex; - dFloat64 m_area; - dFloat64 m_concavity; -}; - - -class dgHACDClusterGraph: public dGraph -{ - public: - class dgHACDConveHull: public dConvexHull3d - { - class dgConvexHullRayCastData - { - public: - dFloat64 m_normalProjection; - dConvexHull3DFace* m_face; - }; - - public: - dgHACDConveHull (const dgHACDConveHull& hull) - :dConvexHull3d(hull) - ,m_mark(1) - { - } - - dgHACDConveHull (dgMemoryAllocator* const allocator, const dBigVector* const points, dInt32 count) - :dConvexHull3d(allocator, &points[0].m_x, sizeof (dBigVector),count, dFloat64 (0.0f)) - ,m_mark(1) - { - } - - - dFloat64 CalculateTriangleConcavity(const dBigVector& normal, dInt32 i0, dInt32 i1, dInt32 i2, const dBigVector* const points) - { - dUnsigned32 head = 1; - dUnsigned32 tail = 0; - dBigVector pool[1<<8][3]; - - pool[0][0] = points[i0]; - pool[0][1] = points[i1]; - pool[0][2] = points[i2]; - - const dFloat64 rayLength = dFloat64(4.0f) * GetDiagonal(); - const dBigVector step(normal.Scale(rayLength)); - - dFloat64 concavity = dFloat32(0.0f); - dFloat64 minArea = dFloat32(0.125f); - dFloat64 minArea2 = minArea * minArea * 0.5f; - - dInt32 maxCount = 4; - dUnsigned32 mask = (sizeof (pool) / (3 * sizeof (pool[0][0]))) - 1; - - dConvexHull3DFace* firstGuess = nullptr; - while ((tail != head) && (maxCount >= 0)) { - maxCount --; - dBigVector p0(pool[tail][0]); - dBigVector p1(pool[tail][1]); - dBigVector p2(pool[tail][2]); - p0.m_w = dFloat32 (0.0f); - p1.m_w = dFloat32 (0.0f); - p2.m_w = dFloat32 (0.0f); - - tail = (tail + 1) & mask; - - dBigVector q1((p0 + p1 + p2).Scale(dFloat64(1.0f / 3.0f))); - dBigVector q0(q1 + step); - - dFloat64 param = RayCast(q0, q1, &firstGuess); - if (param > dFloat64(1.0f)) { - param = dFloat64(1.0f); - } - dBigVector dq(step.Scale(dFloat32(1.0f) - param)); - dAssert(dq.m_w == dFloat32(0.0f)); - dFloat64 lenght2 = sqrt (dq.DotProduct(dq).GetScalar()); - if (lenght2 > concavity) { - concavity = lenght2; - } - - if (((head + 1) & mask) != tail) { - dBigVector edge10(p1 - p0); - dBigVector edge20(p2 - p0); - dBigVector n(edge10.CrossProduct(edge20)); - dAssert(n.m_w == dFloat32(0.0f)); - dFloat64 area2 = n.DotProduct(n).GetScalar(); - if (area2 > minArea2) { - dBigVector p01((p0 + p1).Scale(dFloat64(0.5f))); - dBigVector p12((p1 + p2).Scale(dFloat64(0.5f))); - dBigVector p20((p2 + p0).Scale(dFloat64(0.5f))); - - pool[head][0] = p0; - pool[head][1] = p01; - pool[head][2] = p20; - head = (head + 1) & mask; - - if (((head + 1) & mask) != tail) { - pool[head][0] = p1; - pool[head][1] = p12; - pool[head][2] = p01; - head = (head + 1) & mask; - - if (((head + 1) & mask) != tail) { - pool[head][0] = p2; - pool[head][1] = p20; - pool[head][2] = p12; - head = (head + 1) & mask; - } - } - } - } - } - return concavity; - } - - - - dFloat64 FaceRayCast (const dConvexHull3DFace* const face, const dBigVector& origin, const dBigVector& dist, dFloat64& normalProjection) const - { - dInt32 i0 = face->m_index[0]; - dInt32 i1 = face->m_index[1]; - dInt32 i2 = face->m_index[2]; - - const dBigVector& p0 = m_points[i0]; - dBigVector normal ((m_points[i1] - p0).CrossProduct(m_points[i2] - p0)); - - //dFloat64 N = (origin - p0) % normal; - dAssert(normal.m_w == dFloat32(0.0f)); - dFloat64 N = normal.DotProduct(origin - p0).GetScalar(); - dFloat64 D = normal.DotProduct(dist).GetScalar(); - - if (fabs(D) < dFloat64 (1.0e-16f)) { // - normalProjection = dFloat32 (0.0); - if (N > dFloat64 (0.0f)) { - return dFloat32 (-1.0e30); - } else { - - return dFloat32 (1.0e30); - } - } - normalProjection = D; - return - N / D; - } - - dConvexHull3DFace* ClosestFaceVertexToPoint (const dBigVector& point) - { - // note, for this function to be effective point should be an already close point to the Hull. - // for example casting the point to the OBB or the AABB of the full is a good first guess. - dConvexHull3DFace* closestFace = &GetFirst()->GetInfo(); - dInt8 pool[256 * (sizeof (dConvexHull3DFace*) + sizeof (dFloat64))]; - dUpHeap heap (pool, sizeof (pool)); - - for (dInt32 i = 0; i < 3; ++i) { - dBigVector dist (m_points[closestFace->m_index[i]] - point); - dAssert(dist.m_w == dFloat32(0.0f)); - heap.Push(closestFace, dist.DotProduct(dist).GetScalar()); - } - - m_mark ++; - dFloat64 minDist = heap.Value(); - while (heap.GetCount()) { - dConvexHull3DFace* const face = heap[0]; - if (heap.Value() < minDist) { - minDist = heap.Value(); - closestFace = face; - } - heap.Pop(); - //face->m_mark = m_mark; - face->SetMark(m_mark); - for (dInt32 i = 0; i < 3; ++i) { - dConvexHull3DFace* twin = &face->GetTwin(i)->GetInfo(); - if (twin->GetMark() != m_mark) { - dBigVector dist (m_points[twin->m_index[i]] - point); - // use hysteresis to prevent stops at a local minimal, but at the same time fast descend - dAssert(dist.m_w == dFloat32(0.0f)); - dFloat64 dist2 = dist.DotProduct(dist).GetScalar(); - if (dist2 < (minDist * dFloat64 (1.001f))) { - heap.Push(twin, dist2); - } - } - } - } - - return closestFace; - } - - - // this version have input sensitive complexity (approximately log2) - // when casting parallel rays and using the last face as initial guess this version has const time complexity - dFloat64 RayCast (const dBigVector& localP0, const dBigVector& localP1, dConvexHull3DFace** firstFaceGuess) - { - dConvexHull3DFace* face = &GetFirst()->GetInfo(); - if (firstFaceGuess && *firstFaceGuess) { - face = *firstFaceGuess; - } else { - if (GetCount() > 32) { - dVector q0 (localP0); - dVector q1 (localP1); - if (dRayBoxClip (q0, q1, m_aabbP0, m_aabbP1)) { - face = ClosestFaceVertexToPoint (q0); - } - } - } - - m_mark ++; - face->SetMark (m_mark); - dInt8 pool[256 * (sizeof (dgConvexHullRayCastData) + sizeof (dFloat64))]; - dDownHeap heap (pool, sizeof (pool)); - - dFloat64 t0 = dFloat64 (-1.0e20); //for the maximum entering segment parameter; - dFloat64 t1 = dFloat64 ( 1.0e20); //for the minimum leaving segment parameter; - dBigVector dS (localP1 - localP0); // is the segment direction vector; - dgConvexHullRayCastData data; - data.m_face = face; - dFloat64 t = FaceRayCast (face, localP0, dS, data.m_normalProjection); - if (data.m_normalProjection >= dFloat32 (0.0f)) { - t = dFloat64 (-1.0e30); - } - - heap.Push (data, t); - while (heap.GetCount()) { - dgConvexHullRayCastData data1 (heap[0]); - t = heap.Value(); - dConvexHull3DFace* const face1 = data1.m_face; - dFloat64 normalDistProjection = data1.m_normalProjection; - heap.Pop(); - bool foundThisBestFace = true; - if (normalDistProjection < dFloat64 (0.0f)) { - if (t > t0) { - t0 = t; - } - if (t0 > t1) { - return dFloat64 (1.2f); - } - } else { - foundThisBestFace = false; - } - - for (dInt32 i = 0; i < 3; ++i) { - dConvexHull3DFace* const face2 = &face1->GetTwin(i)->GetInfo(); - - if (face2->GetMark() != m_mark) { - face2->SetMark (m_mark); - dgConvexHullRayCastData data2; - data2.m_face = face2; - t = FaceRayCast (face2, localP0, dS, data2.m_normalProjection); - if (data2.m_normalProjection >= dFloat32 (0.0)) { - t = dFloat64 (-1.0e30); - } else if (t > t0) { - foundThisBestFace = false; - } else if (fabs (t - t0) < dFloat64 (1.0e-10f)) { - return dConvexHull3d::RayCast (localP0, localP1); - } - if ((heap.GetCount() + 2)>= heap.GetMaxCount()) { - // remove t values that are old and way outside interval [0.0, 1.0] - for (dInt32 j = heap.GetCount() - 1; j >= 0; j--) { - dFloat64 val = heap.Value(j); - if ((val < dFloat64 (-100.0f)) || (val > dFloat64 (100.0f))) { - heap.Remove(j); - } - } - } - heap.Push (data2, t); - } - } - if (foundThisBestFace) { - if ((t0 >= dFloat64 (0.0f)) && (t0 <= dFloat64 (1.0f))) { - if (firstFaceGuess) { - *firstFaceGuess = face1; - } - return t0; - } - break; - } - } - return dFloat64 (1.2f); - } - - - dInt32 m_mark; - }; - - class dgHACDConvacityLookAheadTree - { - public: - DG_CLASS_ALLOCATOR(allocator) - - dgHACDConvacityLookAheadTree (dgMemoryAllocator* const allocator, dEdge* const face, dFloat64 concavity) - :m_concavity(concavity) - ,m_faceList (allocator) - ,m_left (nullptr) - ,m_right (nullptr) - { - m_faceList.Append(face); - } - - - dgHACDConvacityLookAheadTree (dgMemoryAllocator* const allocator, dgHACDConvacityLookAheadTree* const leftChild, dgHACDConvacityLookAheadTree* const rightChild, dFloat64 concavity) - :m_concavity(concavity) - ,m_faceList (allocator) - ,m_left (leftChild) - ,m_right (rightChild) - { - dAssert (leftChild); - dAssert (rightChild); - - dFloat64 concavityTest = m_concavity - dFloat64 (1.0e-5f); - if ((((m_left->m_faceList.GetCount() == 1) || (m_right->m_faceList.GetCount() == 1))) || - ((concavityTest <= m_left->m_concavity) && (concavityTest <= m_right->m_concavity))) { - //The the parent has lower concavity this mean that the two do no add more detail, - //the can be deleted and replaced the parent node - // for example the two children can be two convex strips that are part of a larger convex piece - // but each part has a non zero concavity, while the convex part has a lower concavity - m_faceList.Merge (m_left->m_faceList); - m_faceList.Merge (m_right->m_faceList); - - delete m_left; - delete m_right; - m_left = nullptr; - m_right = nullptr; - } else { - for (dList::dNode* node = m_left->m_faceList.GetFirst(); node; node = node->GetNext()) { - m_faceList.Append(node->GetInfo()); - } - for (dList::dNode* node = m_right->m_faceList.GetFirst(); node; node = node->GetNext()) { - m_faceList.Append(node->GetInfo()); - } - } - } - - ~dgHACDConvacityLookAheadTree () - { - if (m_left) { - dAssert (m_right); - delete m_left; - delete m_right; - } - } - - dInt32 GetNodesCount () const - { - dInt32 count = 0; - dInt32 stack = 1; - const dgHACDConvacityLookAheadTree* pool[1024]; - pool[0] = this; - while (stack) { - stack --; - count ++; - const dgHACDConvacityLookAheadTree* const root = pool[stack]; - if (root->m_left) { - dAssert (root->m_right); - pool[stack] = root->m_left; - stack ++; - dAssert (stack < sizeof (pool)/sizeof (pool[0])); - pool[stack] = root->m_right; - stack ++; - dAssert (stack < sizeof (pool)/sizeof (pool[0])); - } - } - return count; - } - - void ReduceByCount (dInt32 count, dDownHeap& approximation) - { - if (count < 1) { - count = 1; - } - - approximation.Flush(); - dgHACDConvacityLookAheadTree* tmp = this; - approximation.Push(tmp, m_concavity); - while ((approximation.GetCount() < count) && (approximation.Value() >= dFloat32 (0.0f))) { - dgHACDConvacityLookAheadTree* worseCluster = approximation[0]; - dFloat64 concavity = approximation.Value(); - if (!worseCluster->m_left && (concavity >= dFloat32 (0.0f))) { - dAssert (!worseCluster->m_right); - approximation.Pop(); - approximation.Push(worseCluster, concavity - dFloat64 (1.0e10f)); - } else { - dAssert (worseCluster->m_left); - dAssert (worseCluster->m_right); - approximation.Pop(); - approximation.Push(worseCluster->m_left, worseCluster->m_left->m_concavity); - approximation.Push(worseCluster->m_right, worseCluster->m_right->m_concavity); - } - } - } - - - void ReduceByConcavity (dFloat64 concavity, dDownHeap& approximation) - { - approximation.Flush(); - dgHACDConvacityLookAheadTree* tmp = this; - - approximation.Push(tmp, m_concavity); - while (approximation.Value() > concavity) { - dgHACDConvacityLookAheadTree* worseCluster = approximation[0]; - if (!worseCluster->m_left && approximation.Value() >= dFloat32 (0.0f)) { - approximation.Pop(); - approximation.Push(worseCluster, dFloat32 (-1.0f)); - } else { - dAssert (worseCluster->m_left); - dAssert (worseCluster->m_right); - approximation.Pop(); - approximation.Push(worseCluster->m_left, worseCluster->m_left->m_concavity); - approximation.Push(worseCluster->m_right, worseCluster->m_right->m_concavity); - } - } - } - - dFloat64 m_concavity; - dList m_faceList; - dgHACDConvacityLookAheadTree* m_left; - dgHACDConvacityLookAheadTree* m_right; - }; - - class dgPairProxy - { - public: - dgPairProxy() - :m_nodeA(nullptr) - ,m_nodeB(nullptr) - ,m_hierachicalClusterIndexA(0) - ,m_hierachicalClusterIndexB(0) - ,m_area(dFloat64(0.0f)) - { - } - - ~dgPairProxy() - { - } - - dNode* m_nodeA; - dNode* m_nodeB; - dInt32 m_hierachicalClusterIndexA; - dInt32 m_hierachicalClusterIndexB; - dFloat64 m_area; - dFloat64 m_distanceConcavity; - }; - - - class dgBackFaceFinder: public ndMeshEffect::dMeshBVH - { - public: - dgBackFaceFinder(ndMeshEffect* const mesh, dgHACDClusterGraph* const graph) - :ndMeshEffect::dMeshBVH(mesh) - ,m_clusterA(nullptr) - ,m_graph(graph) - { - for (dNode* clusterNode = graph->GetFirst(); clusterNode; clusterNode = clusterNode->GetNext()) { - dgHACDCluster& cluster = clusterNode->GetInfo().m_nodeData; - dHACDClusterFace& face = cluster.GetFirst()->GetInfo(); - dEdge* const edge = face.m_edge; - AddFaceNode(edge, &cluster); - } - } - - //dFloat64 RayFaceIntersect (const dgMeshBVHNode* const face, const dBigVector& p0, const dBigVector& p1, bool doublesided) const - dFloat64 RayFaceIntersect (const dgMeshBVHNode* const face, const dBigVector& p0, const dBigVector& p1, void* const userData) const - { - dgHACDCluster* const clusterFace = (dgHACDCluster*) face->m_userData; - - dFloat64 param = dFloat32 (100.0f); - if (clusterFace->m_color != m_clusterA->m_color) { - param = ndMeshEffect::dMeshBVH::RayFaceIntersect (face, p1, p0, nullptr); - if ((param >= dFloat32 (0.0f)) && (param <= dFloat32(1.0f))) { - param = dFloat32 (1.0f) - param; - } - } - return param; - } - - void CastBackFace (dNode* const clusterNodeA, const dBigVector& p0, const dBigVector& p1, const dBigVector& p2, dFloat32 distanceThreshold) - { - dAssert(0); - /* - dBigVector origin ((p0 + p1 + p2).Scale (dFloat32 (1.0f/3.0f))); - - dFloat32 rayDistance = distanceThreshold * dFloat32 (2.0f); - - - m_clusterA = &clusterNodeA->GetInfo().m_nodeData; - dHACDClusterFace& faceA = m_clusterA->GetFirst()->GetInfo(); - dBigVector end (origin - faceA.m_normal.Scale (rayDistance)); - - dFloat64 paramOut; - //dgMeshBVHNode* const node = FaceRayCast (origin, end, paramOut, false); - - dgMeshBVHNode* node; - FaceRayCast (origin, end, paramOut, &node); - - if (node) { - dgHACDCluster* const clusterB = (dgHACDCluster*) node->m_userData; - dAssert (clusterB->m_color != m_clusterA->m_color); - dFloat64 distance = rayDistance * paramOut; - - if (distance < distanceThreshold) { - dHACDClusterFace& faceB = clusterB->GetFirst()->GetInfo(); - dEdge* const edgeB = faceB.m_edge; - - - bool isAdjacent = false; - dEdge* ptrA = faceA.m_edge; - do { - dEdge* ptrB = edgeB; - do { - if (ptrB->m_twin == ptrA) { - ptrA = faceA.m_edge->m_prev; - isAdjacent = true; - break; - } - ptrB = ptrB->m_next; - } while (ptrB != edgeB); - - ptrA = ptrA->m_next; - } while (ptrA != faceA.m_edge); - - if (!isAdjacent) { - isAdjacent = false; - dgHACDClusterGraph::dNode* const clusterNodeB = m_graph->GetNodeFromNodeData (clusterB); - for (dgGraphNode::dNode* edgeNode = clusterNodeA->GetInfo().GetFirst(); edgeNode; edgeNode = edgeNode->GetNext()) { - if (edgeNode->GetInfo().m_node == clusterNodeB) { - isAdjacent = true; - break; - } - } - - if (!isAdjacent) { - dgGraphNode::dNode* const edgeNodeAB = clusterNodeA->GetInfo().AddEdge (clusterNodeB); - dgGraphNode::dNode* const edgeNodeBA = clusterNodeB->GetInfo().AddEdge (clusterNodeA); - - dgHACDEdge& edgeAB = edgeNodeAB->GetInfo().m_edgeData; - dgHACDEdge& edgeBA = edgeNodeBA->GetInfo().m_edgeData; - edgeAB.m_backFaceHandicap = DG_CONCAVITY_PERIMETER_HANDICAP; - edgeBA.m_backFaceHandicap = DG_CONCAVITY_PERIMETER_HANDICAP; - } - } - } - } -*/ - } - - - dgHACDCluster* m_clusterA; - dgHACDClusterGraph* m_graph; - }; - - dgHACDClusterGraph(ndMeshEffect& mesh, dFloat32 backFaceDistanceFactor, dgReportProgress reportProgressCallback, void* const reportProgressUserData) - :dGraph (mesh.GetAllocator()) - ,m_mark(0) - ,m_faceCount(0) - ,m_vertexMark(0) - ,m_progress(0) - ,m_concavityTreeIndex(0) - ,m_invFaceCount(dFloat32 (1.0f)) - ,m_diagonal(dFloat64(1.0f)) - ,m_vertexMarks(nullptr) - ,m_vertexPool(nullptr) - ,m_proxyList(mesh.GetAllocator()) - ,m_concavityTreeArray(nullptr) - ,m_convexProximation(mesh.GetAllocator()) - ,m_priorityHeap (mesh.GetCount() * 2 + 2048, mesh.GetAllocator()) - ,m_reportProgressCallback(reportProgressCallback) - ,m_reportProgressUserData(reportProgressUserData) - { - m_faceCount = mesh.GetTotalFaceCount(); - - dgMemoryAllocator* const allocator = mesh.GetAllocator(); - m_invFaceCount = dFloat32 (1.0f) / (m_faceCount); - - // init some auxiliary structures - dInt32 vertexCount = mesh.GetVertexCount(); - m_vertexMarks = (dInt32*) dgMallocStack(vertexCount * sizeof(dInt32)); - m_vertexPool = (dBigVector*) dgMallocStack(vertexCount * sizeof(dBigVector)); - memset(m_vertexMarks, 0, vertexCount * sizeof(dInt32)); - - m_concavityTreeIndex = m_faceCount + 1; - m_concavityTreeArray = (dgHACDConvacityLookAheadTree**) dgMallocStack(2 * m_concavityTreeIndex * sizeof(dgHACDConvacityLookAheadTree*)); - memset(m_concavityTreeArray, 0, 2 * m_concavityTreeIndex * sizeof(dgHACDConvacityLookAheadTree*)); - - // scan the mesh and and add a node for each face - dInt32 color = 1; - ndMeshEffect::Iterator iter(mesh); - - dInt32 meshMask = mesh.IncLRU(); - const dBigVector* const points = (dBigVector*) mesh.GetVertexPool(); - for (iter.Begin(); iter; iter++) { - dEdge* const edge = &(*iter); - if ((edge->m_mark != meshMask) && (edge->m_incidentFace > 0)) { - - dNode* const clusterNode = AddNode (); - dgHACDCluster& cluster = clusterNode->GetInfo().m_nodeData; - cluster.SetAllocator(mesh.GetAllocator()); - - dFloat64 perimeter = dFloat64(0.0f); - dEdge* ptr = edge; - do { - dBigVector p1p0(points[ptr->m_incidentVertex] - points[ptr->m_prev->m_incidentVertex]); - dAssert(p1p0.m_w == dFloat32(0.0f)); - perimeter += sqrt(p1p0.DotProduct(p1p0).GetScalar()); - ptr->m_incidentFace = color; - ptr->m_userData = ndUnsigned64 (clusterNode); - ptr->m_mark = meshMask; - ptr = ptr->m_next; - } while (ptr != edge); - - dBigVector normal (mesh.FaceNormal(edge, &points[0][0], sizeof(dBigVector))); - dFloat64 mag = sqrt(normal.DotProduct(normal).GetScalar()); - - cluster.m_color = color; - cluster.m_hierachicalClusterIndex = color; - cluster.m_area = dFloat64(0.5f) * mag; - cluster.m_concavity = CalculateConcavityMetric (dFloat64 (0.0f), cluster.m_area, perimeter, 1, 0); - - dHACDClusterFace& face = cluster.Append()->GetInfo(); - face.m_edge = edge; - face.m_area = dFloat64(0.5f) * mag; - face.m_normal = normal.Scale(dFloat64(1.0f) / mag); - - m_concavityTreeArray[color] = new (allocator) dgHACDConvacityLookAheadTree (allocator, edge, dFloat64 (0.0f)); - - color ++; - } - } - - // add all link adjacent faces links - for (dNode* clusterNode = GetFirst(); clusterNode; clusterNode = clusterNode->GetNext()) { - - dgHACDCluster& cluster = clusterNode->GetInfo().m_nodeData; - dHACDClusterFace& face = cluster.GetFirst()->GetInfo(); - dEdge* const edge = face.m_edge; - dEdge* ptr = edge; - do { - if (ptr->m_twin->m_incidentFace > 0) { - dAssert (ptr->m_twin->m_userData); - dNode* const twinClusterNode = (dNode*) ptr->m_twin->m_userData; - dAssert (twinClusterNode); - - bool doubleEdge = false; - for (dgGraphNode::dNode* edgeNode = clusterNode->GetInfo().GetFirst(); edgeNode; edgeNode = edgeNode->GetNext()) { - if (edgeNode->GetInfo().m_node == twinClusterNode) { - doubleEdge = true; - break; - } - } - if (!doubleEdge) { - clusterNode->GetInfo().AddEdge (twinClusterNode); - } - } - ptr = ptr->m_next; - } while (ptr != edge); - } - - Trace(); - dAssert (0); -/* - // add links to back faces - dBigVector minAABB; - dBigVector maxAABB; - mesh.CalculateAABB (minAABB, maxAABB); - maxAABB -= minAABB; - dAssert(maxAABB.m_w == dFloat32(0.0f)); - dFloat32 rayDiagonalLength = dFloat32 (sqrt (maxAABB.DotProduct(maxAABB).GetScalar())); - m_diagonal = rayDiagonalLength; - - dgBackFaceFinder backFaces(&mesh, this); - dFloat32 distanceThreshold = rayDiagonalLength * backFaceDistanceFactor; - dAssert (distanceThreshold >= dFloat32 (0.0f)); - for (dNode* clusterNodeA = GetFirst(); clusterNodeA; clusterNodeA = clusterNodeA->GetNext()) { - - dgHACDCluster& clusterA = clusterNodeA->GetInfo().m_nodeData; - dHACDClusterFace& faceA = clusterA.GetFirst()->GetInfo(); - dEdge* const edgeA = faceA.m_edge; - dEdge* ptr = edgeA; - - dBigVector p0 (points[ptr->m_incidentVertex]); - dBigVector p1 (points[ptr->m_next->m_incidentVertex]); - ptr = ptr->m_next->m_next; - do { - dBigVector p2 (points[ptr->m_incidentVertex]); - dBigVector p01 ((p0 + p1).Scale (dFloat32 (0.5f))); - dBigVector p12 ((p1 + p2).Scale (dFloat32 (0.5f))); - dBigVector p20 ((p2 + p0).Scale (dFloat32 (0.5f))); - - backFaces.CastBackFace (clusterNodeA, p0, p01, p20, distanceThreshold); - backFaces.CastBackFace (clusterNodeA, p1, p12, p01, distanceThreshold); - backFaces.CastBackFace (clusterNodeA, p2, p20, p12, distanceThreshold); - backFaces.CastBackFace (clusterNodeA, p01, p12, p20, distanceThreshold); - - p1 = p2; - ptr = ptr->m_next; - } while (ptr != edgeA); - } -*/ - Trace(); - } - - ~dgHACDClusterGraph () - { - for (dInt32 i = 0; i < m_faceCount * 2; ++i) { - if (m_concavityTreeArray[i]) { - delete m_concavityTreeArray[i]; - } - } - - dgFreeStack(m_concavityTreeArray); - dgFreeStack(m_vertexPool); - dgFreeStack(m_vertexMarks); - } - - - - - void Trace() const - { -#if 0 - for (dNode* clusterNodeA = GetFirst(); clusterNodeA; clusterNodeA = clusterNodeA->GetNext()) { - dgHACDCluster& clusterA = clusterNodeA->GetInfo().m_nodeData; - //dHACDClusterFace& faceA = clusterA.GetFirst()->GetInfo(); - //dEdge* const edgeA = faceA.m_edge; - - dTrace (("cluster node: %d\n", clusterA.m_color)); - dTrace ((" links: ")); - for (dgGraphNode::dNode* edgeNodeA = clusterNodeA->GetInfo().GetFirst(); edgeNodeA; edgeNodeA = edgeNodeA->GetNext()) { - dNode* const clusterNodeB = edgeNodeA->GetInfo().m_node; - dgHACDCluster& clusterB = clusterNodeB->GetInfo().m_nodeData; - dTrace (("%d ", clusterB.m_color)); - } - dTrace (("\n")); - } - dTrace (("\n")); -#endif - } - - - // you can insert callback here to print the progress as it collapse clusters - bool ReportProgress () - { - bool state = true; - m_progress ++; - if (m_reportProgressCallback) { - ndFloat32 progress = ndFloat32(m_progress) * m_invFaceCount; - state = m_reportProgressCallback (progress * ndFloat32 (0.5f) + 0.5f, m_reportProgressUserData); - } - return state; - } - - ndMeshEffect* CreatePartitionMesh (ndMeshEffect& mesh, ndInt32 maxVertexPerHull) - { - dgMemoryAllocator* const allocator = mesh.GetAllocator(); - ndMeshEffect* const convexPartionMesh = new (allocator) ndMeshEffect(allocator); - - dgArray convexVertexBuffer(mesh.m_points.m_vertex, mesh.m_points.m_vertex.m_count); - const ndBigVector* const points = (ndBigVector*) mesh.GetVertexPool(); - - ndInt32 layer = 0; - convexPartionMesh->BeginBuild(); - for (ndList::ndNode* clusterNode = m_convexProximation.GetFirst(); clusterNode; clusterNode = clusterNode->GetNext()) - { - dgHACDConvacityLookAheadTree* const cluster = clusterNode->GetInfo(); - - ndInt32 vertexCount = 0; - for (ndList::ndNode* faceNode = cluster->m_faceList.GetFirst(); faceNode; faceNode = faceNode->GetNext()) - { - ndEdge* const edge = faceNode->GetInfo(); - ndEdge* ptr = edge; - do { - ndInt32 index = ptr->m_incidentVertex; - convexVertexBuffer[vertexCount] = points[index]; - vertexCount++; - ptr = ptr->m_next; - } while (ptr != edge); - } - - //dConvexHull3d convexHull(allocator, &convexVertexBuffer[0].m_x, sizeof(ndBigVector), vertexCount, 0.0, maxVertexPerHull); - ndMeshEffect convexMesh(allocator, &convexVertexBuffer[0].m_x, vertexCount, sizeof(ndBigVector), ndFloat64(0.0f)); - if (convexMesh.GetCount()) - { - for (ndInt32 i = 0; i < convexMesh.m_points.m_vertex.m_count; ++i) - { - convexMesh.m_points.m_layers[i] = layer; - } - convexPartionMesh->MergeFaces(&convexMesh); - layer++; - } - } - convexPartionMesh->EndBuild(1.0e-5f); - - m_progress = m_faceCount - 1; - ReportProgress(); - return convexPartionMesh; - } - - ndFloat64 ConcavityByFaceMedian (ndInt32 faceCountA, ndInt32 faceCountB) const - { - ndFloat64 faceCountCost = DG_CONCAVITY_SCALE * ndFloat64 (0.1f) * (faceCountA + faceCountB) * m_invFaceCount; - return faceCountCost; - } - - ndFloat64 CalculateConcavityMetric (ndFloat64 convexConcavity, ndFloat64 area, ndFloat64 perimeter, ndInt32 faceCountA, ndInt32 faceCountB) const - { - ndFloat64 edgeCost = perimeter * perimeter / (ndFloat64(4.0f * ndPi) * area); - return convexConcavity * DG_CONCAVITY_SCALE + edgeCost + ConcavityByFaceMedian (faceCountA, faceCountB); - } - - void SubmitInitialEdgeCosts (ndMeshEffect& mesh) - { - m_mark ++; - for (ndNode* clusterNodeA = GetFirst(); clusterNodeA; clusterNodeA = clusterNodeA->GetNext()) { - // call the progress callback - for (dgGraphNode::ndNode* edgeNodeAB = clusterNodeA->GetInfo().GetFirst(); edgeNodeAB; edgeNodeAB = edgeNodeAB->GetNext()) { - dgHACDEdge& edgeAB = edgeNodeAB->GetInfo().m_edgeData; - ndFloat64 weight = edgeAB.m_backFaceHandicap; - if (edgeAB.m_mark != m_mark) { - edgeAB.m_mark = m_mark; - ndNode* const clusterNodeB = edgeNodeAB->GetInfo().m_node; - for (dgGraphNode::ndNode* edgeNodeBA = clusterNodeB->GetInfo().GetFirst(); edgeNodeBA; edgeNodeBA = edgeNodeBA->GetNext()) { - ndNode* const clusterNode = edgeNodeBA->GetInfo().m_node; - if (clusterNode == clusterNodeA) { - dgHACDEdge& edgeBA = edgeNodeBA->GetInfo().m_edgeData; - edgeBA.m_mark = m_mark; - ndAssert (!edgeAB.m_proxyListNode); - ndAssert (!edgeBA.m_proxyListNode); - - ndAssert (edgeBA.m_backFaceHandicap == weight); - ndList::ndNode* const proxyNode = SubmitEdgeCost (mesh, clusterNodeA, clusterNodeB, weight * edgeBA.m_backFaceHandicap); - edgeAB.m_proxyListNode = proxyNode; - edgeBA.m_proxyListNode = proxyNode; - break; - } - } - } - } - } - } - - ndInt32 CopyVertexToPool(const ndMeshEffect& mesh, const dgHACDCluster& cluster, ndInt32 start) - { - ndInt32 count = start; - - const ndBigVector* const points = (ndBigVector*) mesh.GetVertexPool(); - for (ndList::ndNode* node = cluster.GetFirst(); node; node = node->GetNext()) { - const dHACDClusterFace& clusterFace = node->GetInfo(); - ndEdge* edge = clusterFace.m_edge; - do { - ndInt32 index = edge->m_incidentVertex; - if (m_vertexMarks[index] != m_vertexMark) { - m_vertexMarks[index] = m_vertexMark; - m_vertexPool[count] = points[index]; - count++; - } - edge = edge->m_next; - } while (edge != clusterFace.m_edge); - } - return count; - } - - - void MarkInteriorClusterEdges (ndMeshEffect& mesh, ndInt32 mark, const dgHACDCluster& cluster, ndInt32 colorA, ndInt32 colorB) const - { - ndAssert (colorA != colorB); - for (ndList::ndNode* node = cluster.GetFirst(); node; node = node->GetNext()) { - dHACDClusterFace& clusterFace = node->GetInfo(); - ndEdge* edge = clusterFace.m_edge; - do { - if ((edge->m_twin->m_incidentFace == colorA) || (edge->m_twin->m_incidentFace == colorB)) { - edge->m_mark = mark; - edge->m_twin->m_mark = mark; - } - edge = edge->m_next; - } while (edge != clusterFace.m_edge); - } - } - - ndFloat64 CalculateClusterPerimeter (ndMeshEffect& mesh, ndInt32 mark, const dgHACDCluster& cluster, ndInt32 colorA, ndInt32 colorB) const - { - ndAssert (colorA != colorB); - ndFloat64 perimeter = ndFloat64 (0.0f); - const ndBigVector* const points = (ndBigVector*) mesh.GetVertexPool(); - for (ndList::ndNode* node = cluster.GetFirst(); node; node = node->GetNext()) { - dHACDClusterFace& clusterFace = node->GetInfo(); - ndEdge* edge = clusterFace.m_edge; - do { - if (!((edge->m_twin->m_incidentFace == colorA) || (edge->m_twin->m_incidentFace == colorB))) { - ndBigVector p1p0(points[edge->m_twin->m_incidentVertex] - points[edge->m_incidentVertex]); - ndAssert(p1p0.m_w == ndFloat32(0.0f)); - perimeter += sqrt(p1p0.DotProduct(p1p0).GetScalar()); - } - edge = edge->m_next; - } while (edge != clusterFace.m_edge); - } - - return perimeter; - } - - void HeapCollectGarbage () - { - if ((m_priorityHeap.GetCount() + 20) > m_priorityHeap.GetMaxCount()) { - for (ndInt32 i = m_priorityHeap.GetCount() - 1; i >= 0; i--) { - ndList::ndNode* const emptyNode = m_priorityHeap[i]; - dgPairProxy& emptyPair = emptyNode->GetInfo(); - if ((emptyPair.m_nodeA == nullptr) && (emptyPair.m_nodeB == nullptr)) { - m_priorityHeap.Remove(i); - } - } - } - } - - - ndFloat64 CalculateConcavity(dgHACDConveHull& hull, const ndMeshEffect& mesh, const dgHACDCluster& cluster) - { - ndFloat64 concavity = ndFloat32(0.0f); - - const ndBigVector* const points = (ndBigVector*) mesh.GetVertexPool(); - for (ndList::ndNode* node = cluster.GetFirst(); node; node = node->GetNext()) { - dHACDClusterFace& clusterFace = node->GetInfo(); - ndEdge* edge = clusterFace.m_edge; - ndInt32 i0 = edge->m_incidentVertex; - ndInt32 i1 = edge->m_next->m_incidentVertex; - for (ndEdge* ptr = edge->m_next->m_next; ptr != edge; ptr = ptr->m_next) { - ndInt32 i2 = ptr->m_incidentVertex; - ndFloat64 val = hull.CalculateTriangleConcavity(clusterFace.m_normal, i0, i1, i2, points); - if (val > concavity) { - concavity = val; - } - i1 = i2; - } - } - - return concavity; - } - - ndFloat64 CalculateConcavity (dgHACDConveHull& hull, ndMeshEffect& mesh, dgHACDCluster& clusterA, dgHACDCluster& clusterB) - { - return ndMax(CalculateConcavity(hull, mesh, clusterA), CalculateConcavity(hull, mesh, clusterB)); - } - - - ndList::ndNode* SubmitEdgeCost (ndMeshEffect& mesh, ndNode* const clusterNodeA, ndNode* const clusterNodeB, ndFloat64 perimeterHandicap) - { - dgHACDCluster& clusterA = clusterNodeA->GetInfo().m_nodeData; - dgHACDCluster& clusterB = clusterNodeB->GetInfo().m_nodeData; - const ndBigVector* const points = (ndBigVector*) mesh.GetVertexPool(); - - bool flatStrip = true; - ndFloat64 tol = ndFloat64 (1.0e-5f) * m_diagonal; - dHACDClusterFace& clusterFaceA = clusterA.GetFirst()->GetInfo(); - ndAssert(clusterFaceA.m_normal.m_w == ndFloat32(0.0f)); - ndBigPlane plane(clusterFaceA.m_normal, - points[clusterFaceA.m_edge->m_incidentVertex].DotProduct(clusterFaceA.m_normal).GetScalar()); - - if (clusterA.GetCount() > 1) { - flatStrip = clusterA.IsCoplanar(plane, mesh, tol); - } - - if (flatStrip) { - flatStrip = clusterB.IsCoplanar(plane, mesh, tol); - } - - ndList::ndNode* pairNode = nullptr; - if (!flatStrip) { - m_vertexMark ++; - ndInt32 vertexCount = CopyVertexToPool(mesh, clusterA, 0); - vertexCount = CopyVertexToPool(mesh, clusterB, vertexCount); - - dgHACDConveHull convexHull(mesh.GetAllocator(), m_vertexPool, vertexCount); - - if (convexHull.GetVertexCount()) { - ndInt32 mark = mesh.IncLRU(); - MarkInteriorClusterEdges (mesh, mark, clusterA, clusterA.m_color, clusterB.m_color); - MarkInteriorClusterEdges (mesh, mark, clusterB, clusterA.m_color, clusterB.m_color); - - ndFloat64 area = clusterA.m_area + clusterB.m_area; - ndFloat64 perimeter = CalculateClusterPerimeter (mesh, mark, clusterA, clusterA.m_color, clusterB.m_color) + - CalculateClusterPerimeter (mesh, mark, clusterB, clusterA.m_color, clusterB.m_color); - ndFloat64 concavity = CalculateConcavity (convexHull, mesh, clusterA, clusterB); - - if (concavity < ndFloat64(1.0e-3f)) { - concavity = ndFloat64(0.0f); - } - - // see if the heap will overflow - HeapCollectGarbage (); - - // add a new pair to the heap - ndList::ndNode* pairNode1 = m_proxyList.Append(); - dgPairProxy& pair = pairNode1->GetInfo(); - pair.m_nodeA = clusterNodeA; - pair.m_nodeB = clusterNodeB; - pair.m_distanceConcavity = concavity; - pair.m_hierachicalClusterIndexA = clusterA.m_hierachicalClusterIndex; - pair.m_hierachicalClusterIndexB = clusterB.m_hierachicalClusterIndex; - - pair.m_area = area; - ndFloat64 cost = CalculateConcavityMetric (concavity, area * perimeterHandicap, perimeter * perimeterHandicap, clusterA.GetCount(), clusterB.GetCount()); - m_priorityHeap.Push(pairNode1, cost); - - return pairNode1; - } - } - return pairNode; - } - - - bool CollapseEdge (ndList::ndNode* const pairNode, ndMeshEffect& mesh, ndFloat64 concavity) - { - ndNode* adjacentNodes[1024]; - dgPairProxy& pair = pairNode->GetInfo(); - - dgMemoryAllocator* const allocator = mesh.GetAllocator(); - - bool continueColapsing = true; - ndAssert((pair.m_nodeA && pair.m_nodeB) || (!pair.m_nodeA && !pair.m_nodeB)); - if (pair.m_nodeA && pair.m_nodeB && continueColapsing) { - // call the progress callback - continueColapsing = ReportProgress(); - - ndNode* const clusterNodeA = pair.m_nodeA; - ndNode* const clusterNodeB = pair.m_nodeB; - ndAssert (clusterNodeA != clusterNodeB); - - dgHACDCluster& clusterA = clusterNodeA->GetInfo().m_nodeData; - dgHACDCluster& clusterB = clusterNodeB->GetInfo().m_nodeData; - - ndAssert (&clusterA != &clusterB); - ndAssert(clusterA.m_color != clusterB.m_color); - - dgHACDConvacityLookAheadTree* const leftTree = m_concavityTreeArray[pair.m_hierachicalClusterIndexA]; - dgHACDConvacityLookAheadTree* const rightTree = m_concavityTreeArray[pair.m_hierachicalClusterIndexB]; - ndAssert (leftTree); - ndAssert (rightTree); - m_concavityTreeArray[pair.m_hierachicalClusterIndexA] = nullptr; - m_concavityTreeArray[pair.m_hierachicalClusterIndexB] = nullptr; - ndAssert (m_concavityTreeIndex < (2 * (m_faceCount + 1))); - - ndFloat64 treeConcavity = pair.m_distanceConcavity; -// ndAssert (treeConcavity < 0.1); - m_concavityTreeArray[m_concavityTreeIndex] = new (allocator) dgHACDConvacityLookAheadTree (allocator, leftTree, rightTree, treeConcavity); - clusterA.m_hierachicalClusterIndex = m_concavityTreeIndex; - clusterB.m_hierachicalClusterIndex = m_concavityTreeIndex; - m_concavityTreeIndex ++; - - // merge two clusters - while (clusterB.GetCount()) { - - dgHACDCluster::ndNode* const nodeB = clusterB.GetFirst(); - clusterB.Unlink(nodeB); - - // now color code all faces of the merged cluster - dHACDClusterFace& faceB = nodeB->GetInfo(); - ndEdge* ptr = faceB.m_edge; - do { - ptr->m_incidentFace = clusterA.m_color; - ptr = ptr->m_next; - } while (ptr != faceB.m_edge); - clusterA.Append(nodeB); - } - clusterA.m_area = pair.m_area; - clusterA.m_concavity = concavity; - - // invalidate all proxies that are still in the heap - ndInt32 adjacentCount = 1; - adjacentNodes[0] = clusterNodeA; - for (dgGraphNode::ndNode* edgeNodeAB = clusterNodeA->GetInfo().GetFirst(); edgeNodeAB; edgeNodeAB = edgeNodeAB->GetNext()) { - dgHACDEdge& edgeAB = edgeNodeAB->GetInfo().m_edgeData; - ndList::ndNode* const proxyNode = (ndList::ndNode*) edgeAB.m_proxyListNode; - if (proxyNode) { - dgPairProxy& pairProxy = proxyNode->GetInfo(); - ndAssert ((edgeNodeAB->GetInfo().m_node == pairProxy.m_nodeA) || (edgeNodeAB->GetInfo().m_node == pairProxy.m_nodeB)); - pairProxy.m_nodeA = nullptr; - pairProxy.m_nodeB = nullptr; - edgeAB.m_proxyListNode = nullptr; - } - - adjacentNodes[adjacentCount] = edgeNodeAB->GetInfo().m_node; - adjacentCount ++; - ndAssert (adjacentCount < sizeof (adjacentNodes)/ sizeof (adjacentNodes[0])); - } - - for (dgGraphNode::ndNode* edgeNodeBA = clusterNodeB->GetInfo().GetFirst(); edgeNodeBA; edgeNodeBA = edgeNodeBA->GetNext()) { - dgHACDEdge& edgeBA = edgeNodeBA->GetInfo().m_edgeData; - ndList::ndNode* const proxyNode = (ndList::ndNode*) edgeBA.m_proxyListNode; - if (proxyNode) { - dgPairProxy& pairProxy = proxyNode->GetInfo(); - pairProxy.m_nodeA = nullptr; - pairProxy.m_nodeB = nullptr; - edgeBA.m_proxyListNode = nullptr; - } - - bool alreadyLinked = false; - ndNode* const node = edgeNodeBA->GetInfo().m_node; - for (ndInt32 i = 0; i < adjacentCount; ++i) { - if (node == adjacentNodes[i]) { - alreadyLinked = true; - break; - } - } - if (!alreadyLinked) { - clusterNodeA->GetInfo().AddEdge (node); - node->GetInfo().AddEdge (clusterNodeA); - } - } - DeleteNode (clusterNodeB); - - // submit all new costs for each edge connecting this new node to any other node - for (dgGraphNode::ndNode* edgeNodeAB = clusterNodeA->GetInfo().GetFirst(); edgeNodeAB; edgeNodeAB = edgeNodeAB->GetNext()) { - dgHACDEdge& edgeAB = edgeNodeAB->GetInfo().m_edgeData; - ndFloat64 weigh = edgeAB.m_backFaceHandicap; - ndNode* const clusterNodeB1 = edgeNodeAB->GetInfo().m_node; - for (dgGraphNode::ndNode* edgeNodeBA = clusterNodeB1->GetInfo().GetFirst(); edgeNodeBA; edgeNodeBA = edgeNodeBA->GetNext()) { - ndNode* const clusterNode = edgeNodeBA->GetInfo().m_node; - if (clusterNode == clusterNodeA) { - dgHACDEdge& edgeBA = edgeNodeBA->GetInfo().m_edgeData; - ndList::ndNode* const proxyNode = SubmitEdgeCost (mesh, clusterNodeA, clusterNodeB1, weigh * edgeBA.m_backFaceHandicap); - if (proxyNode) { - edgeBA.m_proxyListNode = proxyNode; - edgeAB.m_proxyListNode = proxyNode; - } - break; - } - } - } - } - m_proxyList.Remove(pairNode); - - return continueColapsing; - } - - bool CollapseClusters (ndMeshEffect& mesh, ndFloat64 maxConcavity___, ndInt32 maxClustesCount) - { - bool collapseEdgeState = true; - while (m_priorityHeap.GetCount() && collapseEdgeState) { - ndFloat64 concavity = m_priorityHeap.Value(); - ndList::ndNode* const pairNode = m_priorityHeap[0]; - m_priorityHeap.Pop(); - collapseEdgeState = CollapseEdge (pairNode, mesh, concavity); - } - - if (collapseEdgeState) { - ndInt32 treeCounts = 0; - for (ndInt32 i = 0; i < m_concavityTreeIndex; ++i) { - if (m_concavityTreeArray[i]) { - m_concavityTreeArray[treeCounts] = m_concavityTreeArray[i]; - m_concavityTreeArray[i] = nullptr; - treeCounts ++; - } - } - - if (treeCounts > 1) { - for (ndInt32 i = 0; i < treeCounts; ++i) { - ndAssert (m_concavityTreeArray[i]); - if (m_concavityTreeArray[i]->m_faceList.GetCount()==1) { - delete m_concavityTreeArray[i]; - m_concavityTreeArray[i] = m_concavityTreeArray[treeCounts-1]; - m_concavityTreeArray[treeCounts-1]= nullptr; - treeCounts --; - i--; - } - } - - - ndFloat32 largeConcacvity = 10000; - while (treeCounts > 1) { - dgHACDConvacityLookAheadTree* const leftTree = m_concavityTreeArray[treeCounts-1]; - dgHACDConvacityLookAheadTree* const rightTree = m_concavityTreeArray[treeCounts-2]; - m_concavityTreeArray[treeCounts-1] = nullptr; - m_concavityTreeArray[treeCounts-2] = new (mesh.GetAllocator()) dgHACDConvacityLookAheadTree (mesh.GetAllocator(), leftTree, rightTree, largeConcacvity); - largeConcacvity *= 2; - treeCounts --; - } - - } - - dgHACDConvacityLookAheadTree* const tree = m_concavityTreeArray[0]; - if (tree) { - ndDownHeap approximation(maxClustesCount * 2, mesh.GetAllocator()); - - tree->ReduceByCount (maxClustesCount, approximation); - //tree->ReduceByConcavity (maxConcavity, approximation); - -//while ((approximation.Value() + ndFloat64 (1.0e10f)) > 1.0e-5) { -//approximation.Pop(); -//} - - while (approximation.GetCount()) { - m_convexProximation.Append(approximation[0]); - approximation.Pop(); - } - } - } - return collapseEdgeState; - } - - - ndInt32 m_mark; - ndInt32 m_faceCount; - ndInt32 m_vertexMark; - ndInt32 m_progress; - ndInt32 m_concavityTreeIndex; - ndFloat32 m_invFaceCount; - ndFloat64 m_diagonal; - ndInt32* m_vertexMarks; - ndBigVector* m_vertexPool; - ndList m_proxyList; - dgHACDConvacityLookAheadTree** m_concavityTreeArray; - ndList m_convexProximation; - ndUpHeap::ndNode*, ndFloat64> m_priorityHeap; - dgReportProgress m_reportProgressCallback; - void* m_reportProgressUserData; -}; - -ndMeshEffect* ndMeshEffect::CreateConvexApproximation(ndFloat32 maxConcavity, ndFloat32 backFaceDistanceFactor, ndInt32 maxHullsCount, ndInt32 maxVertexPerHull, dgReportProgress reportProgressCallback, void* const progressReportUserData) const -{ - // dgMeshEffect triangleMesh(*this); - if (maxHullsCount <= 1) { - maxHullsCount = 1; - } - if (maxConcavity <= ndFloat32 (1.0e-5f)) { - maxConcavity = ndFloat32 (1.0e-5f); - } - - if (maxVertexPerHull < 4) { - maxVertexPerHull = 4; - } - backFaceDistanceFactor = ndClamp(backFaceDistanceFactor, ndFloat32 (1.0e-6f), ndFloat32 (1.0f)); - - ndMeshEffect* partition = nullptr; - - // make a copy of the mesh - ndMeshEffect mesh(*this); - mesh.m_attrib.m_materialChannel.Clear(); - mesh.m_attrib.m_normalChannel.Clear(); - mesh.m_attrib.m_binormalChannel.Clear(); - mesh.m_attrib.m_colorChannel.Clear(); - mesh.m_attrib.m_uv0Channel.Clear(); - mesh.m_attrib.m_uv1Channel.Clear(); - mesh.Triangulate (); - - mesh.UnpackAttibuteData(); - mesh.PackAttibuteData(); - mesh.UnpackPoints(); - bool state = mesh.Optimize (&mesh.m_points.m_vertex[0].m_x, sizeof (ndBigVector), reportProgressCallback, progressReportUserData, ndFloat32 (1.0e-3f), 1500); - // optimized override userdata - ndPolyhedra::Iterator iter(mesh); - for (iter.Begin(); iter; iter++) { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if (edge->m_incidentFace > 0) { - edge->m_userData = edge->m_incidentVertex; - } - } - mesh.PackPoints(ndFloat32 (1.0e-24f)); - if (state) { - mesh.DeleteDegenerateFaces (&mesh.m_points.m_vertex[0].m_x, sizeof (ndBigVector), ndFloat32 (1.0e-12f)); - mesh.RepairTJoints(); - mesh.ConvertToPolygons(); - //mesh.SaveOFF ("xxxxxx.off"); - - // create a general connectivity graph - dgHACDClusterGraph graph (mesh, backFaceDistanceFactor, reportProgressCallback, progressReportUserData); - - // calculate initial edge costs - graph.SubmitInitialEdgeCosts (mesh); - - // collapse the graph - if (graph.CollapseClusters (mesh, maxConcavity, maxHullsCount)) { - // Create Partition Mesh - partition = graph.CreatePartitionMesh (mesh, maxVertexPerHull); - } - } - - return partition; -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect4.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect4.cpp deleted file mode 100644 index e96a3eb3cd..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect4.cpp +++ /dev/null @@ -1,1630 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndMeshEffect.h" -//#include "dgBody.h" -//#include "dgWorld.h" -//#include "ndMeshEffect.h" -//#include "dgCollisionConvexHull.h" - - -#if 0 - -#if 0 -#define DG_BUILD_HIERACHICAL_HACD - -#define DG_CONCAVITY_MAX_THREADS 8 -#define DG_CONCAVITY_SCALE ndFloat64 (100.0f) - - - - -class dgHACDEdge -{ - public: - dgHACDEdge () - :m_mark(0) - ,m_proxyListNode(nullptr) - ,m_backFaceHandicap(dFloat64 (1.0)) - { - } - ~dgHACDEdge () - { - } - - dInt32 m_mark; - void* m_proxyListNode; - dFloat64 m_backFaceHandicap; -}; - -class dHACDClusterFace -{ - public: - dHACDClusterFace() - :m_edge(nullptr) - ,m_area(dFloat64(0.0f)) - { - } - ~dHACDClusterFace() - { - } - - dEdge* m_edge; - dFloat64 m_area; - dBigVector m_normal; -}; - - -class dgHACDCluster: public dList -{ - public: - dgHACDCluster () - :dList(nullptr) - ,m_color(0) - ,m_hierachicalClusterIndex(0) - ,m_area(dFloat64 (0.0f)) - ,m_concavity(dFloat64 (0.0f)) - { - } - - bool IsCoplanar(const dBigPlane& plane, const dgMeshEffect& mesh, dFloat64 tolerance) const - { - const dBigVector* const points = (dBigVector*) mesh.GetVertexPool(); - for (dNode* node = GetFirst(); node; node = node->GetNext()) { - const dHACDClusterFace& info = node->GetInfo(); - dEdge* ptr = info.m_edge; - do { - const dBigVector& p = points[ptr->m_incidentVertex]; - dFloat64 dist = fabs(plane.Evalue(p)); - if (dist > tolerance) { - return false; - } - ptr = ptr->m_next; - } while (ptr != info.m_edge); - } - return true; - } - - - dInt32 m_color; - dInt32 m_hierachicalClusterIndex; - dFloat64 m_area; - dFloat64 m_concavity; -}; - - -class dgHACDClusterGraph - :public dGraph - ,public dgAABBPolygonSoup -{ - public: - - class dgHACDConveHull: public dConvexHull3d - { - class dgConvexHullRayCastData - { - public: - dFloat64 m_normalProjection; - dConvexHull3DFace* m_face; - }; - - public: - dgHACDConveHull (const dgHACDConveHull& hull) - :dConvexHull3d(hull) - ,m_mark(1) - { - } - - dgHACDConveHull (dgMemoryAllocator* const allocator, const dBigVector* const points, dInt32 count) - :dConvexHull3d(allocator, &points[0].m_x, sizeof (dBigVector),count, dFloat64 (0.0f)) - ,m_mark(1) - { - - } - - dFloat64 CalculateTriangleConcavity(const dBigVector& normal, dInt32 i0, dInt32 i1, dInt32 i2, const dBigVector* const points) - { - dUnsigned32 head = 1; - dUnsigned32 tail = 0; - dBigVector pool[1<<8][3]; - - pool[0][0] = points[i0]; - pool[0][1] = points[i1]; - pool[0][2] = points[i2]; - - const dBigVector step(normal.Scale(dFloat64(4.0f) * GetDiagonal())); - - dFloat64 concavity = dFloat32(0.0f); - dFloat64 minArea = dFloat32(0.125f); - dFloat64 minArea2 = minArea * minArea * 0.5f; - - dInt32 maxCount = 4; - dUnsigned32 mask = (sizeof (pool) / (3 * sizeof (pool[0][0]))) - 1; - - dConvexHull3DFace* firstGuess = nullptr; - while ((tail != head) && (maxCount >= 0)) { - maxCount --; - dBigVector p0(pool[tail][0]); - dBigVector p1(pool[tail][1]); - dBigVector p2(pool[tail][2]); - tail = (tail + 1) & mask; - - dBigVector q1((p0 + p1 + p2).Scale(dFloat64(1.0f / 3.0f))); - dBigVector q0(q1 + step); - - //dFloat64 param = convexHull.RayCast(q0, q1, &firstGuess); - dFloat64 param = FastRayCast(q0, q1, &firstGuess); - if (param > dFloat64(1.0f)) { - param = dFloat64(1.0f); - } - dBigVector dq(step.Scale(dFloat32(1.0f) - param)); - dFloat64 lenght2 = sqrt (dq % dq); - //ndAssert (lenght2 < GetDiagonal()); - if (lenght2 > concavity) { - concavity = lenght2; - } - - if (((head + 1) & mask) != tail) { - dBigVector edge10(p1 - p0); - dBigVector edge20(p2 - p0); - dBigVector n(edge10 * edge20); - dFloat64 area2 = n % n; - if (area2 > minArea2) { - dBigVector p01((p0 + p1).Scale(dFloat64(0.5f))); - dBigVector p12((p1 + p2).Scale(dFloat64(0.5f))); - dBigVector p20((p2 + p0).Scale(dFloat64(0.5f))); - - pool[head][0] = p0; - pool[head][1] = p01; - pool[head][2] = p20; - head = (head + 1) & mask; - - if (((head + 1) & mask) != tail) { - pool[head][0] = p1; - pool[head][1] = p12; - pool[head][2] = p01; - head = (head + 1) & mask; - - if (((head + 1) & mask) != tail) { - pool[head][0] = p2; - pool[head][1] = p20; - pool[head][2] = p12; - head = (head + 1) & mask; - } - } - } - } - } - return concavity; - } - - - - dFloat64 FaceRayCast (const dConvexHull3DFace* const face, const dBigVector& origin, const dBigVector& dist, dFloat64& normalProjection) const - { - dInt32 i0 = face->m_index[0]; - dInt32 i1 = face->m_index[1]; - dInt32 i2 = face->m_index[2]; - - const dBigVector& p0 = m_points[i0]; - dBigVector normal ((m_points[i1] - p0) * (m_points[i2] - p0)); - - dFloat64 N = (origin - p0) % normal; - dFloat64 D = dist % normal; - - if (fabs(D) < dFloat64 (1.0e-16f)) { // - normalProjection = dFloat32 (0.0); - if (N > dFloat64 (0.0f)) { - return dFloat32 (-1.0e30); - } else { - - return dFloat32 (1.0e30); - } - } - normalProjection = D; - return - N / D; - } - - dConvexHull3DFace* ClosestFaceVertexToPoint (const dBigVector& point) - { - // note, for this function to be effective point should be an already close point to the Hull. - // for example casting the point to the OBB or the AABB of the full is a good first guess. - dConvexHull3DFace* closestFace = &GetFirst()->GetInfo(); - dInt8 pool[256 * (sizeof (dConvexHull3DFace*) + sizeof (dFloat64))]; - dUpHeap heap (pool, sizeof (pool)); - - for (dInt32 i = 0; i < 3; ++i) { - dBigVector dist (m_points[closestFace->m_index[i]] - point); - heap.Push(closestFace, dist % dist); - } - - m_mark ++; - dFloat64 minDist = heap.Value(); - while (heap.GetCount()) { - dConvexHull3DFace* const face = heap[0]; - if (heap.Value() < minDist) { - minDist = heap.Value(); - closestFace = face; - } - heap.Pop(); - //face->m_mark = m_mark; - face->SetMark(m_mark); - for (dInt32 i = 0; i < 3; ++i) { - //const dConvexHull3DFace* twin = &face->m_twin[i]->GetInfo(); - dConvexHull3DFace* twin = &face->GetTwin(i)->GetInfo(); - //if (twin->m_mark != m_mark) { - if (twin->GetMark() != m_mark) { - dBigVector dist (m_points[twin->m_index[i]] - point); - // use hysteresis to prevent stops at a local minimal, but at the same time fast descend - dFloat64 dist2 = dist % dist; - if (dist2 < (minDist * dFloat64 (1.001f))) { - heap.Push(twin, dist2); - } - } - } - } - - return closestFace; - } - - - // this version have input sensitive complexity (approximately log2) - // when casting parallel rays and using the last face as initial guess this version has const time complexity - dFloat64 RayCast (const dBigVector& localP0, const dBigVector& localP1, dConvexHull3DFace** firstFaceGuess) - { - dConvexHull3DFace* face = &GetFirst()->GetInfo(); - if (firstFaceGuess && *firstFaceGuess) { - face = *firstFaceGuess; - } else { - if (GetCount() > 32) { - dVector q0 (localP0); - dVector q1 (localP1); - if (dRayBoxClip (q0, q1, m_aabbP0, m_aabbP1)) { - face = ClosestFaceVertexToPoint (q0); - } - } - } - - m_mark ++; - //face->m_mark = m_mark; - face->SetMark (m_mark); - dInt8 pool[256 * (sizeof (dgConvexHullRayCastData) + sizeof (dFloat64))]; - dDownHeap heap (pool, sizeof (pool)); - - dFloat64 t0 = dFloat64 (-1.0e20); //for the maximum entering segment parameter; - dFloat64 t1 = dFloat64 ( 1.0e20); //for the minimum leaving segment parameter; - dBigVector dS (localP1 - localP0); // is the segment direction vector; - dgConvexHullRayCastData data; - data.m_face = face; - dFloat64 t = FaceRayCast (face, localP0, dS, data.m_normalProjection); - if (data.m_normalProjection >= dFloat32 (0.0)) { - t = dFloat64 (-1.0e30); - } - - heap.Push (data, t); - while (heap.GetCount()) { - dgConvexHullRayCastData data (heap[0]); - dFloat64 t = heap.Value(); - dConvexHull3DFace* face = data.m_face; - dFloat64 normalDistProjection = data.m_normalProjection; - heap.Pop(); - bool foundThisBestFace = true; - if (normalDistProjection < dFloat64 (0.0f)) { - if (t > t0) { - t0 = t; - } - if (t0 > t1) { - return dFloat64 (1.2f); - } - } else { - foundThisBestFace = false; - } - - for (dInt32 i = 0; i < 3; ++i) { - //dConvexHull3DFace* const face1 = &face->m_twin[i]->GetInfo(); - dConvexHull3DFace* const face1 = &face->GetTwin(i)->GetInfo(); - - //if (face1->m_mark != m_mark) { - if (face1->GetMark() != m_mark) { - //face1->m_mark = m_mark; - face1->SetMark (m_mark); - dgConvexHullRayCastData data; - data.m_face = face1; - dFloat64 t = FaceRayCast (face1, localP0, dS, data.m_normalProjection); - if (data.m_normalProjection >= dFloat32 (0.0)) { - t = dFloat64 (-1.0e30); - } else if (t > t0) { - foundThisBestFace = false; - } else if (fabs (t - t0) < dFloat64 (1.0e-10f)) { - return dConvexHull3d::RayCast (localP0, localP1); - } - if ((heap.GetCount() + 2)>= heap.GetMaxCount()) { - // remove t values that are old and way outside interval [0.0, 1.0] - for (dInt32 i = heap.GetCount() - 1; i >= 0; i--) { - dFloat64 val = heap.Value(i); - if ((val < dFloat64 (-100.0f)) || (val > dFloat64 (100.0f))) { - heap.Remove(i); - } - } - } - heap.Push (data, t); - } - } - if (foundThisBestFace) { - if ((t0 >= dFloat64 (0.0f)) && (t0 <= dFloat64 (1.0f))) { - if (firstFaceGuess) { - *firstFaceGuess = face; - } - return t0; - } - break; - } - } - - return dFloat64 (1.2f); - - } - - dFloat64 FastRayCast (const dBigVector& localP0, const dBigVector& localP1, dConvexHull3DFace** guess) - { -#if 0 - #ifdef _DEBUG - dFloat64 t0 = dConvexHull3d::RayCast (localP0, localP1); - dFloat64 t1 = RayCast (localP0, localP1, guess); - dAssert (fabs(t0 - t1) < dFloat64 (1.0e-5f)); - #endif -#endif - - //return dConvexHull3d::RayCast (localP0, localP1); - return RayCast (localP0, localP1, guess); - } - - ndInt32 m_mark; - }; - - class dgHACDConvacityLookAheadTree - { - public: - DG_CLASS_ALLOCATOR(allocator) - - dgHACDConvacityLookAheadTree (dgMemoryAllocator* const allocator, ndEdge* const face, ndFloat64 concavity) - :m_concavity(concavity) - ,m_faceList (allocator) - ,m_left (nullptr) - ,m_right (nullptr) - { - m_faceList.Append(face); - } - - - dgHACDConvacityLookAheadTree (dgMemoryAllocator* const allocator, dgHACDConvacityLookAheadTree* const leftChild, dgHACDConvacityLookAheadTree* const rightChild, ndFloat64 concavity) - :m_concavity(concavity) - ,m_faceList (allocator) - ,m_left (leftChild) - ,m_right (rightChild) - { - ndAssert (leftChild); - ndAssert (rightChild); - - ndFloat64 concavityTest = m_concavity - ndFloat64 (1.0e-5f); - //if ((m_left->m_faceList.GetCount() == 1) || (m_right->m_faceList.GetCount() == 1)) { - if ((((m_left->m_faceList.GetCount() == 1) || (m_right->m_faceList.GetCount() == 1))) || - ((concavityTest <= m_left->m_concavity) && (concavityTest <= m_right->m_concavity))) { - //The the parent has lower concavity this mean that the two do no add more detail, - //the can be deleted and replaced the parent node - // for example the two children can be two convex strips that are part of a larger convex piece - // but each part has a non zero concavity, while the convex part has a lower concavity - m_faceList.Merge (m_left->m_faceList); - m_faceList.Merge (m_right->m_faceList); - - delete m_left; - delete m_right; - m_left = nullptr; - m_right = nullptr; - } else { - for (ndList::ndNode* node = m_left->m_faceList.GetFirst(); node; node = node->GetNext()) { - m_faceList.Append(node->GetInfo()); - } - for (ndList::ndNode* node = m_right->m_faceList.GetFirst(); node; node = node->GetNext()) { - m_faceList.Append(node->GetInfo()); - } - } - } - - ~dgHACDConvacityLookAheadTree () - { - if (m_left) { - ndAssert (m_right); - delete m_left; - delete m_right; - } - } - - ndInt32 GetNodesCount () const - { - ndInt32 count = 0; - ndInt32 stack = 1; - const dgHACDConvacityLookAheadTree* pool[1024]; - pool[0] = this; - while (stack) { - stack --; - count ++; - const dgHACDConvacityLookAheadTree* const root = pool[stack]; - if (root->m_left) { - ndAssert (root->m_right); - pool[stack] = root->m_left; - stack ++; - ndAssert (stack < sizeof (pool)/sizeof (pool[0])); - pool[stack] = root->m_right; - stack ++; - ndAssert (stack < sizeof (pool)/sizeof (pool[0])); - } - } - return count; - } - - void ReduceByCount (ndInt32 count, ndDownHeap& approximation) - { - if (count < 1) { - count = 1; - } -// ndInt32 nodesCount = GetNodesCount(); - - approximation.Flush(); - dgHACDConvacityLookAheadTree* tmp = this; - approximation.Push(tmp, m_concavity); -// nodesCount --; - //while (nodesCount && (approximation.GetCount() < count) && (approximation.Value() >= ndFloat32 (0.0f))) { - while ((approximation.GetCount() < count) && (approximation.Value() >= ndFloat32 (0.0f))) { - dgHACDConvacityLookAheadTree* worseCluster = approximation[0]; - if (!worseCluster->m_left && approximation.Value() >= ndFloat32 (0.0f)) { - approximation.Pop(); - approximation.Push(worseCluster, ndFloat32 (-1.0f)); - } else { - ndAssert (worseCluster->m_left); - ndAssert (worseCluster->m_right); - approximation.Pop(); - approximation.Push(worseCluster->m_left, worseCluster->m_left->m_concavity); - approximation.Push(worseCluster->m_right, worseCluster->m_right->m_concavity); -// nodesCount -= 2; - } - } - } - - - void ReduceByConcavity (ndFloat64 concavity, ndDownHeap& approximation) - { - approximation.Flush(); - dgHACDConvacityLookAheadTree* tmp = this; - - approximation.Push(tmp, m_concavity); - while (approximation.Value() > concavity) { - dgHACDConvacityLookAheadTree* worseCluster = approximation[0]; - if (!worseCluster->m_left && approximation.Value() >= ndFloat32 (0.0f)) { - approximation.Pop(); - approximation.Push(worseCluster, ndFloat32 (-1.0f)); - } else { - ndAssert (worseCluster->m_left); - ndAssert (worseCluster->m_right); - approximation.Pop(); - approximation.Push(worseCluster->m_left, worseCluster->m_left->m_concavity); - approximation.Push(worseCluster->m_right, worseCluster->m_right->m_concavity); - } - } - } - - ndFloat64 m_concavity; - ndList m_faceList; - dgHACDConvacityLookAheadTree* m_left; - dgHACDConvacityLookAheadTree* m_right; - }; - - class dgPairProxy - { - public: - dgPairProxy() - :m_nodeA(nullptr) - ,m_nodeB(nullptr) - ,m_hierachicalClusterIndexA(0) - ,m_hierachicalClusterIndexB(0) - ,m_area(ndFloat64(0.0f)) - { - } - - ~dgPairProxy() - { - } - - ndNode* m_nodeA; - ndNode* m_nodeB; - ndInt32 m_hierachicalClusterIndexA; - ndInt32 m_hierachicalClusterIndexB; - ndFloat64 m_area; - ndFloat64 m_distanceConcavity; - }; - - class dgHACDRayCasterContext: public ndFastRay - { - public: - dgHACDRayCasterContext (const ndVector& l0, const ndVector& l1, dgHACDClusterGraph* const me, ndInt32 mycolor) - :ndFastRay (l0, l1) - ,m_myColor(mycolor) - ,m_colorHit(-1) - ,m_param (1.0f) - ,m_me (me) - { - } - - ndInt32 m_myColor; - ndInt32 m_colorHit; - ndFloat32 m_param; - dgHACDClusterGraph* m_me; - }; - - - dgHACDClusterGraph(ndMeshEffect& mesh, ndFloat32 backFaceDistanceFactor, dgReportProgress reportProgressCallback) - :dGraph (mesh.GetAllocator()) - ,ndAabbPolygonSoup() - ,m_mark(0) - ,m_faceCount(0) - ,m_vertexMark(0) - ,m_progress(0) - ,m_cancavityTreeIndex(0) - ,m_invFaceCount(ndFloat32 (1.0f)) - ,m_vertexMarks(nullptr) - ,m_diagonal(ndFloat64(1.0f)) - ,m_vertexPool(nullptr) - ,m_proxyList(mesh.GetAllocator()) - ,m_concavityTreeArray(nullptr) - ,m_convexProximation(mesh.GetAllocator()) - ,m_priorityHeap (mesh.GetCount() + 2048, mesh.GetAllocator()) - ,m_reportProgressCallback (reportProgressCallback) - ,m_parallerConcavityCalculator(mesh.GetAllocator()) - { - - m_parallerConcavityCalculator.SetThreadsCount(DG_CONCAVITY_MAX_THREADS); - - // precondition the mesh for better approximation - mesh.ConvertToPolygons(); - - m_faceCount = mesh.GetTotalFaceCount(); - - dgMemoryAllocator* const allocator = mesh.GetAllocator(); - m_invFaceCount = ndFloat32 (1.0f) / (m_faceCount); - - // init some auxiliary structures - ndInt32 vertexCount = mesh.GetVertexCount(); - m_vertexMarks = (ndInt32*) dgMallocStack(vertexCount * sizeof(ndInt32)); - m_vertexPool = (ndBigVector*) dgMallocStack(vertexCount * sizeof(ndBigVector)); - memset(m_vertexMarks, 0, vertexCount * sizeof(ndInt32)); - - m_cancavityTreeIndex = m_faceCount + 1; - m_concavityTreeArray = (dgHACDConvacityLookAheadTree**) dgMallocStack(2 * m_cancavityTreeIndex * sizeof(dgHACDConvacityLookAheadTree*)); - memset(m_concavityTreeArray, 0, 2 * m_cancavityTreeIndex * sizeof(dgHACDConvacityLookAheadTree*)); - - // scan the mesh and and add a node for each face - ndInt32 color = 1; - ndMeshEffect::Iterator iter(mesh); - - ndInt32 meshMask = mesh.IncLRU(); - const ndBigVector* const points = (ndBigVector*) mesh.GetVertexPool(); - for (iter.Begin(); iter; iter++) { - ndEdge* const edge = &(*iter); - if ((edge->m_mark != meshMask) && (edge->m_incidentFace > 0)) { - - // call the progress callback - //ReportProgress(); - - ndNode* const clusterNode = AddNode (); - dgHACDCluster& cluster = clusterNode->GetInfo().m_nodeData; - cluster.SetAllocator(mesh.GetAllocator()); - - ndFloat64 perimeter = ndFloat64(0.0f); - ndEdge* ptr = edge; - do { - ndBigVector p1p0(points[ptr->m_incidentVertex] - points[ptr->m_prev->m_incidentVertex]); - perimeter += sqrt(p1p0 % p1p0); - ptr->m_incidentFace = color; - ptr->m_userData = ndUnsigned64 (clusterNode); - ptr->m_mark = meshMask; - ptr = ptr->m_next; - } while (ptr != edge); - - ndBigVector normal = mesh.FaceNormal(edge, &points[0][0], sizeof(ndBigVector)); - ndFloat64 mag = sqrt(normal % normal); - - cluster.m_color = color; - cluster.m_hierachicalClusterIndex = color; - cluster.m_area = ndFloat64(0.5f) * mag; - cluster.m_concavity = CalculateConcavityMetric (ndFloat64 (0.0f), cluster.m_area, perimeter, 1, 0); - - dHACDClusterFace& face = cluster.Append()->GetInfo(); - face.m_edge = edge; - face.m_area = ndFloat64(0.5f) * mag; - face.m_normal = normal.Scale(ndFloat64(1.0f) / mag); - - //m_concavityTreeArray[color] = new (allocator) dgHACDConvacityLookAheadTree (allocator, edge, cluster.m_concavity); - m_concavityTreeArray[color] = new (allocator) dgHACDConvacityLookAheadTree (allocator, edge, ndFloat64 (0.0f)); - - color ++; - } - } - - // add all link adjacent faces links - for (ndNode* clusterNode = GetFirst(); clusterNode; clusterNode = clusterNode->GetNext()) { - - // call the progress callback - //ReportProgress(); - - dgHACDCluster& cluster = clusterNode->GetInfo().m_nodeData; - dHACDClusterFace& face = cluster.GetFirst()->GetInfo(); - ndEdge* const edge = face.m_edge; - ndEdge* ptr = edge; - do { - if (ptr->m_twin->m_incidentFace > 0) { - ndAssert (ptr->m_twin->m_userData); - ndNode* const twinClusterNode = (ndNode*) ptr->m_twin->m_userData; - ndAssert (twinClusterNode); - - bool doubleEdge = false; - for (dgGraphNode::ndNode* edgeNode = clusterNode->GetInfo().GetFirst(); edgeNode; edgeNode = edgeNode->GetNext()) { - if (edgeNode->GetInfo().m_node == twinClusterNode) { - doubleEdge = true; - break; - } - } - if (!doubleEdge) { - clusterNode->GetInfo().AddEdge (twinClusterNode); - } - } - ptr = ptr->m_next; - } while (ptr != edge); - } - - Trace(); - - // add links to back faces - ndPolygonSoupBuilder builder (mesh.GetAllocator()); - ndVector polygon[64]; - ndInt32 indexList[64]; - - ndMatrix matrix (ndGetIdentityMatrix()); - for (ndInt32 i = 0; i < sizeof (polygon) / sizeof (polygon[0]); ++i) { - indexList[i] = i; - } - - ndBigVector minAABB; - ndBigVector maxAABB; - mesh.CalculateAABB (minAABB, maxAABB); - maxAABB -= minAABB; - ndFloat32 rayDiagonalLength = ndFloat32 (sqrt (maxAABB % maxAABB)); - m_diagonal = rayDiagonalLength; - - builder.Begin(); - ndTree clusterMap (GetAllocator()); - for (ndNode* clusterNode = GetFirst(); clusterNode; clusterNode = clusterNode->GetNext()) { - - // call the progress callback - //ReportProgress(); - - dgHACDCluster& cluster = clusterNode->GetInfo().m_nodeData; - clusterMap.Insert(clusterNode, cluster.m_color); - dHACDClusterFace& face = cluster.GetFirst()->GetInfo(); - ndEdge* const edge = face.m_edge; - ndInt32 count = 0; - ndEdge* ptr = edge; - do { - polygon[count] = points[ptr->m_incidentVertex]; - count ++; - ptr = ptr->m_prev; - } while (ptr != edge); - - builder.AddMesh(&polygon[0].m_x, count, sizeof (ndVector), 1, &count, indexList, &cluster.m_color, matrix); - } - builder.End(false); - Create (builder, false); - - - ndFloat32 distanceThreshold = rayDiagonalLength * backFaceDistanceFactor; - for (ndNode* clusterNodeA = GetFirst(); clusterNodeA; clusterNodeA = clusterNodeA->GetNext()) { - - // call the progress callback - //ReportProgress(); - dgHACDCluster& clusterA = clusterNodeA->GetInfo().m_nodeData; - dHACDClusterFace& faceA = clusterA.GetFirst()->GetInfo(); - ndEdge* const edgeA = faceA.m_edge; - ndEdge* ptr = edgeA; - - ndVector p0 (points[ptr->m_incidentVertex]); - ndVector p1 (points[ptr->m_next->m_incidentVertex]); - ptr = ptr->m_next->m_next; - do { - ndVector p2 (points[ptr->m_incidentVertex]); - ndVector p01 ((p0 + p1).Scale (ndFloat32 (0.5f))); - ndVector p12 ((p1 + p2).Scale (ndFloat32 (0.5f))); - ndVector p20 ((p2 + p0).Scale (ndFloat32 (0.5f))); - - CastBackFace (clusterNodeA, p0, p01, p20, distanceThreshold, clusterMap); - CastBackFace (clusterNodeA, p1, p12, p01, distanceThreshold, clusterMap); - CastBackFace (clusterNodeA, p2, p20, p12, distanceThreshold, clusterMap); - CastBackFace (clusterNodeA, p01, p12, p20, distanceThreshold, clusterMap); - - p1 = p2; - ptr = ptr->m_next; - } while (ptr != edgeA); - } - - Trace(); - } - - ~dgHACDClusterGraph () - { - for (ndInt32 i = 0; i < m_faceCount * 2; ++i) { - if (m_concavityTreeArray[i]) { - delete m_concavityTreeArray[i]; - } - } - - dgFreeStack(m_concavityTreeArray); - dgFreeStack(m_vertexPool); - dgFreeStack(m_vertexMarks); - } - - - void CastBackFace ( - ndNode* const clusterNodeA, - const ndVector& p0, - const ndVector& p1, - const ndVector& p2, - ndFloat32 distanceThreshold, - ndTree& clusterMap) - { - ndVector origin ((p0 + p1 + p2).Scale (ndFloat32 (1.0f/3.0f))); - - ndFloat32 rayDistance = distanceThreshold * ndFloat32 (2.0f); - - dgHACDCluster& clusterA = clusterNodeA->GetInfo().m_nodeData; - dHACDClusterFace& faceA = clusterA.GetFirst()->GetInfo(); - ndVector end (origin - ndVector (faceA.m_normal).Scale (rayDistance)); - - dgHACDRayCasterContext ray (origin, end, this, clusterA.m_color); - ForAllSectorsRayHit(ray, RayHit, &ray); - - if (ray.m_colorHit != -1) { - ndAssert (ray.m_colorHit != ray.m_myColor); - ndFloat32 distance = rayDistance * ray.m_param; - - if (distance < distanceThreshold) { - - ndAssert (ray.m_colorHit != clusterA.m_color); - ndAssert (clusterMap.Find(ray.m_colorHit)); - ndNode* const clusterNodeB = clusterMap.Find(ray.m_colorHit)->GetInfo(); - dgHACDCluster& clusterB = clusterNodeB->GetInfo().m_nodeData; - - dHACDClusterFace& faceB = clusterB.GetFirst()->GetInfo(); - ndEdge* const edgeB = faceB.m_edge; - - bool isAdjacent = false; - ndEdge* ptrA = faceA.m_edge; - do { - ndEdge* ptrB = edgeB; - do { - if (ptrB->m_twin == ptrA) { - ptrA = faceA.m_edge->m_prev; - isAdjacent = true; - break; - } - ptrB = ptrB->m_next; - } while (ptrB != edgeB); - - ptrA = ptrA->m_next; - } while (ptrA != faceA.m_edge); - - if (!isAdjacent) { - - isAdjacent = false; - for (dgGraphNode::ndNode* edgeNode = clusterNodeA->GetInfo().GetFirst(); edgeNode; edgeNode = edgeNode->GetNext()) { - if (edgeNode->GetInfo().m_node == clusterNodeB) { - isAdjacent = true; - break; - } - } - - if (!isAdjacent) { - - dgGraphNode::ndNode* const edgeNodeAB = clusterNodeA->GetInfo().AddEdge (clusterNodeB); - dgGraphNode::ndNode* const edgeNodeBA = clusterNodeB->GetInfo().AddEdge (clusterNodeA); - - dgHACDEdge& edgeAB = edgeNodeAB->GetInfo().m_edgeData; - dgHACDEdge& edgeBA = edgeNodeBA->GetInfo().m_edgeData; - edgeAB.m_backFaceHandicap = ndFloat64 (0.5f); - edgeBA.m_backFaceHandicap = ndFloat64 (0.5f); - } - } - } - } - } - - - void Trace() const - { - /* - for (ndNode* clusterNodeA = GetFirst(); clusterNodeA; clusterNodeA = clusterNodeA->GetNext()) { - dgHACDCluster& clusterA = clusterNodeA->GetInfo().m_nodeData; - //dHACDClusterFace& faceA = clusterA.GetFirst()->GetInfo(); - //ndEdge* const edgeA = faceA.m_edge; - - dTrace (("cluster node: %d\n", clusterA.m_color)); - dTrace ((" links: ")); - for (dgGraphNode::ndNode* edgeNodeA = clusterNodeA->GetInfo().GetFirst(); edgeNodeA; edgeNodeA = edgeNodeA->GetNext()) { - ndNode* const clusterNodeB = edgeNodeA->GetInfo().m_node; - dgHACDCluster& clusterB = clusterNodeB->GetInfo().m_nodeData; - dTrace (("%d ", clusterB.m_color)); - } - dTrace (("\n")); - } - dTrace (("\n")); - */ - } - - - // you can insert cal callback here to print the progress as it collapse clusters - void ReportProgress () - { - m_progress ++; - if (m_reportProgressCallback) { - ndFloat32 progress = ndFloat32(m_progress) * m_invFaceCount; - m_reportProgressCallback (progress); - } - } - - ndMeshEffect* CreatePatitionMesh (ndMeshEffect& mesh, ndInt32 maxVertexPerHull) - { - dgMemoryAllocator* const allocator = mesh.GetAllocator(); - ndMeshEffect* const convexPartionMesh = new (allocator) ndMeshEffect(allocator, true); - - ndMeshEffect::dgVertexAtribute polygon[256]; - memset(polygon, 0, sizeof(polygon)); - dgArray convexVertexBuffer(mesh.GetCount(), GetAllocator()); - const ndBigVector* const points = (ndBigVector*) mesh.GetVertexPool(); - - convexPartionMesh->BeginBuild(); - ndFloat64 layer = ndFloat64 (0.0f); - for (ndList::ndNode* clusterNode = m_convexProximation.GetFirst(); clusterNode; clusterNode = clusterNode->GetNext()) { - dgHACDConvacityLookAheadTree* const cluster = clusterNode->GetInfo(); - - ndInt32 vertexCount = 0; - for (ndList::ndNode* faceNode = cluster->m_faceList.GetFirst(); faceNode; faceNode = faceNode->GetNext()) { - ndEdge* const edge = faceNode->GetInfo(); - ndEdge* ptr = edge; - do { - ndInt32 index = ptr->m_incidentVertex; - convexVertexBuffer[vertexCount] = points[index]; - vertexCount++; - ptr = ptr->m_next; - } while (ptr != edge); - } - ndConvexHull3d convexHull(allocator, &convexVertexBuffer[0].m_x, sizeof(ndBigVector), vertexCount, 0.0, maxVertexPerHull); - if (convexHull.GetCount()) { - const ndBigVector* const vertex = convexHull.GetVertexPool(); - for (ndConvexHull3d::ndNode* node = convexHull.GetFirst(); node; node = node->GetNext()) { - const ndConvexHull3dFace* const face = &node->GetInfo(); - - ndInt32 i0 = face->m_index[0]; - ndInt32 i1 = face->m_index[1]; - ndInt32 i2 = face->m_index[2]; - - polygon[0].m_vertex = vertex[i0]; - polygon[0].m_vertex.m_w = layer; - - polygon[1].m_vertex = vertex[i1]; - polygon[1].m_vertex.m_w = layer; - - polygon[2].m_vertex = vertex[i2]; - polygon[2].m_vertex.m_w = layer; - - convexPartionMesh->AddPolygon(3, &polygon[0].m_vertex.m_x, sizeof(ndMeshEffect::dgVertexAtribute), 0); - } - layer += ndFloat64 (1.0f); - } - } - convexPartionMesh->EndBuild(1.0e-5f); - - m_progress = m_faceCount - 1; - ReportProgress(); - - return convexPartionMesh; - } - - - - static ndFloat32 RayHit (void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount) - { - dgHACDRayCasterContext& me = *((dgHACDRayCasterContext*) context); - ndVector normal (&polygon[indexArray[indexCount] * (strideInBytes / sizeof (ndFloat32))]); - ndFloat32 t = me.PolygonIntersect (normal, polygon, strideInBytes, indexArray, indexCount); - if (t < me.m_param) { - ndInt32 faceColor = me.m_me->GetTagId(indexArray); - if (faceColor != me.m_myColor) { - me.m_param = t; - me.m_colorHit = faceColor; - } - } - return t; - } - - - ndFloat64 ConcavityByFaceMedian (ndInt32 faceCountA, ndInt32 faceCountB) const - { - ndFloat64 faceCountCost = DG_CONCAVITY_SCALE * ndFloat64 (0.1f) * (faceCountA + faceCountB) * m_invFaceCount; - //faceCountCost *= 0; - return faceCountCost; - } - - ndFloat64 CalculateConcavityMetric (ndFloat64 convexConcavity, ndFloat64 area, ndFloat64 perimeter, ndInt32 faceCountA, ndInt32 faceCountB) const - { - ndFloat64 edgeCost = perimeter * perimeter / (ndFloat64(4.0f * ndPi) * area); - return convexConcavity * DG_CONCAVITY_SCALE + edgeCost + ConcavityByFaceMedian (faceCountA, faceCountB); - } - - void SubmitInitialEdgeCosts (ndMeshEffect& mesh) - { - m_mark ++; - for (ndNode* clusterNodeA = GetFirst(); clusterNodeA; clusterNodeA = clusterNodeA->GetNext()) { - // call the progress callback - //ReportProgress(); - - for (dgGraphNode::ndNode* edgeNodeAB = clusterNodeA->GetInfo().GetFirst(); edgeNodeAB; edgeNodeAB = edgeNodeAB->GetNext()) { - dgHACDEdge& edgeAB = edgeNodeAB->GetInfo().m_edgeData; - ndFloat64 weight = edgeAB.m_backFaceHandicap; - if (edgeAB.m_mark != m_mark) { - edgeAB.m_mark = m_mark; - ndNode* const clusterNodeB = edgeNodeAB->GetInfo().m_node; - for (dgGraphNode::ndNode* edgeNodeBA = clusterNodeB->GetInfo().GetFirst(); edgeNodeBA; edgeNodeBA = edgeNodeBA->GetNext()) { - ndNode* const clusterNode = edgeNodeBA->GetInfo().m_node; - if (clusterNode == clusterNodeA) { - dgHACDEdge& edgeBA = edgeNodeBA->GetInfo().m_edgeData; - edgeBA.m_mark = m_mark; - ndAssert (!edgeAB.m_proxyListNode); - ndAssert (!edgeBA.m_proxyListNode); - - ndList::ndNode* const proxyNode = SubmitEdgeCost (mesh, clusterNodeA, clusterNodeB, weight * edgeBA.m_backFaceHandicap); - edgeAB.m_proxyListNode = proxyNode; - edgeBA.m_proxyListNode = proxyNode; - break; - } - } - } - } - } - } - - ndInt32 CopyVertexToPool(const ndMeshEffect& mesh, const dgHACDCluster& cluster, ndInt32 start) - { - ndInt32 count = start; - - const ndBigVector* const points = (ndBigVector*) mesh.GetVertexPool(); - for (ndList::ndNode* node = cluster.GetFirst(); node; node = node->GetNext()) { - const dHACDClusterFace& clusterFace = node->GetInfo(); - ndEdge* edge = clusterFace.m_edge; - do { - ndInt32 index = edge->m_incidentVertex; - if (m_vertexMarks[index] != m_vertexMark) { - m_vertexMarks[index] = m_vertexMark; - m_vertexPool[count] = points[index]; - count++; - } - edge = edge->m_next; - } while (edge != clusterFace.m_edge); - } - return count; - } - - - void MarkInteriorClusterEdges (ndMeshEffect& mesh, ndInt32 mark, const dgHACDCluster& cluster, ndInt32 colorA, ndInt32 colorB) const - { - ndAssert (colorA != colorB); - for (ndList::ndNode* node = cluster.GetFirst(); node; node = node->GetNext()) { - dHACDClusterFace& clusterFace = node->GetInfo(); - ndEdge* edge = clusterFace.m_edge; - do { - if ((edge->m_twin->m_incidentFace == colorA) || (edge->m_twin->m_incidentFace == colorB)) { - edge->m_mark = mark; - edge->m_twin->m_mark = mark; - } - edge = edge->m_next; - } while (edge != clusterFace.m_edge); - } - } - - ndFloat64 CalculateClusterPerimeter (ndMeshEffect& mesh, ndInt32 mark, const dgHACDCluster& cluster, ndInt32 colorA, ndInt32 colorB) const - { - ndAssert (colorA != colorB); - ndFloat64 perimeter = ndFloat64 (0.0f); - const ndBigVector* const points = (ndBigVector*) mesh.GetVertexPool(); - for (ndList::ndNode* node = cluster.GetFirst(); node; node = node->GetNext()) { - dHACDClusterFace& clusterFace = node->GetInfo(); - ndEdge* edge = clusterFace.m_edge; - do { - if (!((edge->m_twin->m_incidentFace == colorA) || (edge->m_twin->m_incidentFace == colorB))) { - ndBigVector p1p0(points[edge->m_twin->m_incidentVertex] - points[edge->m_incidentVertex]); - perimeter += sqrt(p1p0 % p1p0); - } - edge = edge->m_next; - } while (edge != clusterFace.m_edge); - } - - return perimeter; - } - - void HeapCollectGarbage () - { - if ((m_priorityHeap.GetCount() + 20) > m_priorityHeap.GetMaxCount()) { - for (ndInt32 i = m_priorityHeap.GetCount() - 1; i >= 0; i--) { - ndList::ndNode* const emptyNode = m_priorityHeap[i]; - dgPairProxy& emptyPair = emptyNode->GetInfo(); - if ((emptyPair.m_nodeA == nullptr) && (emptyPair.m_nodeB == nullptr)) { - m_priorityHeap.Remove(i); - } - } - } - } - - - ndFloat64 CalculateConcavity(dgHACDConveHull& hull, const ndMeshEffect& mesh, const dgHACDCluster& cluster) - { - ndFloat64 concavity = ndFloat32(0.0f); - - const ndBigVector* const points = (ndBigVector*) mesh.GetVertexPool(); - for (ndList::ndNode* node = cluster.GetFirst(); node; node = node->GetNext()) { - dHACDClusterFace& clusterFace = node->GetInfo(); - ndEdge* edge = clusterFace.m_edge; - ndInt32 i0 = edge->m_incidentVertex; - ndInt32 i1 = edge->m_next->m_incidentVertex; - for (ndEdge* ptr = edge->m_next->m_next; ptr != edge; ptr = ptr->m_next) { - ndInt32 i2 = ptr->m_incidentVertex; - ndFloat64 val = hull.CalculateTriangleConcavity(clusterFace.m_normal, i0, i1, i2, points); - if (val > concavity) { - concavity = val; - } - i1 = i2; - } - } - - return concavity; - } - - ndFloat64 CalculateConcavitySingleThread (dgHACDConveHull& hull, ndMeshEffect& mesh, dgHACDCluster& clusterA, dgHACDCluster& clusterB) - { - return ndMax(CalculateConcavity(hull, mesh, clusterA), CalculateConcavity(hull, mesh, clusterB)); - } - - - class dgConvexHullRayCastContext - { - public: - dgConvexHullRayCastContext (dgHACDConveHull& hull, ndMeshEffect& mesh, dgThreadHive* const manager) - :m_atomicLock(0) - ,m_mesh(&mesh) - ,m_cluster(nullptr) - ,m_threadManager(manager) - ,m_faceNode(nullptr) - { - for(ndInt32 i = 0; i < DG_CONCAVITY_MAX_THREADS; ++i) { - hullArray[i] = new (mesh.GetAllocator()) dgHACDConveHull (hull); - } - } - - ~dgConvexHullRayCastContext () - { - for(ndInt32 i = 0; i < DG_CONCAVITY_MAX_THREADS; ++i) { - delete hullArray[i]; - } - } - - void SetCluster (dgHACDCluster& cluster) - { - m_cluster = &cluster; - m_node = m_cluster->GetFirst(); - memset (m_concavity, 0, sizeof (m_concavity)); - } - - ndFloat64 GetConcavity() const - { - ndFloat64 concavity = ndFloat32(0.0f); - for (ndInt32 i = 0; i < DG_CONCAVITY_MAX_THREADS; ++i) { - if (concavity < m_concavity[i]) { - concavity = m_concavity[i]; - } - } - return concavity; - } - - - static void RayCastKernel (void* const context, ndInt32 threadID) - { - dgConvexHullRayCastContext* const data = (dgConvexHullRayCastContext*) context; - const ndBigVector* const points = (ndBigVector*) data->m_mesh->GetVertexPool(); - - data->m_threadManager->GetIndirectLock(&data->m_atomicLock, threadID); - ndList::ndNode* node = data->m_node; - if (node) { - data->m_node = node->GetNext(); - } - data->m_threadManager->ReleaseIndirectLock (&data->m_atomicLock); - for (; node;) { - - dHACDClusterFace& clusterFace = node->GetInfo(); - ndEdge* edge = clusterFace.m_edge; - ndInt32 i0 = edge->m_incidentVertex; - ndInt32 i1 = edge->m_next->m_incidentVertex; - for (ndEdge* ptr = edge->m_next->m_next; ptr != edge; ptr = ptr->m_next) { - ndInt32 i2 = ptr->m_incidentVertex; - ndFloat64 val = data->hullArray[threadID]->CalculateTriangleConcavity(clusterFace.m_normal, i0, i1, i2, points); - if (val > data->m_concavity[threadID]) { - data->m_concavity[threadID] = val; - } - i1 = i2; - } - - data->m_threadManager->GetIndirectLock(&data->m_atomicLock, threadID); - node = data->m_node; - if (node) { - data->m_node = node->GetNext();; - } - data->m_threadManager->ReleaseIndirectLock (&data->m_atomicLock); - } - } - - - ndInt32 m_atomicLock; - ndMeshEffect* m_mesh; - dgHACDCluster* m_cluster; - dgThreadHive* m_threadManager; - ndList::ndNode* m_node; - - ndList::ndNode* m_faceNode; - ndFloat64 m_concavity[DG_CONCAVITY_MAX_THREADS]; - dgHACDConveHull* hullArray[DG_CONCAVITY_MAX_THREADS]; - }; - - - ndFloat64 CalculateConcavityMultiThread (dgHACDConveHull& hull, ndMeshEffect& mesh, dgHACDCluster& clusterA, dgHACDCluster& clusterB) - { - dgConvexHullRayCastContext data (hull, mesh, &m_parallerConcavityCalculator); - - ndInt32 threadsCount = m_parallerConcavityCalculator.GetThreadCount(); - data.SetCluster (clusterA); - for (ndInt32 i = 0; i < threadsCount; ++i) { - m_parallerConcavityCalculator.QueueJob(dgConvexHullRayCastContext::RayCastKernel, &data); - } - m_parallerConcavityCalculator.SynchronizationBarrier(); - ndFloat64 concavity = data.GetConcavity(); - - data.SetCluster (clusterB); - for (ndInt32 i = 0; i < threadsCount; ++i) { - m_parallerConcavityCalculator.QueueJob(dgConvexHullRayCastContext::RayCastKernel, &data); - } - m_parallerConcavityCalculator.SynchronizationBarrier(); - - concavity = ndMax(concavity, data.GetConcavity()); - //ndFloat64 xxx = CalculateConcavitySingleThread (hull, mesh, clusterA, clusterB); - //ndAssert (fabs(concavity - xxx) < ndFloat64 (1.0e-5f)); - return concavity; - } - - ndList::ndNode* SubmitEdgeCost (ndMeshEffect& mesh, ndNode* const clusterNodeA, ndNode* const clusterNodeB, ndFloat64 perimeterHandicap) - { - dgHACDCluster& clusterA = clusterNodeA->GetInfo().m_nodeData; - dgHACDCluster& clusterB = clusterNodeB->GetInfo().m_nodeData; - const ndBigVector* const points = (ndBigVector*) mesh.GetVertexPool(); - - bool flatStrip = true; - ndFloat64 tol = ndFloat64 (1.0e-5f) * m_diagonal; - dHACDClusterFace& clusterFaceA = clusterA.GetFirst()->GetInfo(); - ndBigPlane plane(clusterFaceA.m_normal, -(points[clusterFaceA.m_edge->m_incidentVertex] % clusterFaceA.m_normal)); - - if (clusterA.GetCount() > 1) { - flatStrip = clusterA.IsCoplanar(plane, mesh, tol); - } - - if (flatStrip) { - flatStrip = clusterB.IsCoplanar(plane, mesh, tol); - } - - ndList::ndNode* pairNode = nullptr; - if (!flatStrip) { - m_vertexMark ++; - ndInt32 vertexCount = CopyVertexToPool(mesh, clusterA, 0); - vertexCount = CopyVertexToPool(mesh, clusterB, vertexCount); - - dgHACDConveHull convexHull(mesh.GetAllocator(), m_vertexPool, vertexCount); - - if (convexHull.GetVertexCount()) { - ndInt32 mark = mesh.IncLRU(); - MarkInteriorClusterEdges (mesh, mark, clusterA, clusterA.m_color, clusterB.m_color); - MarkInteriorClusterEdges (mesh, mark, clusterB, clusterA.m_color, clusterB.m_color); - - ndFloat64 area = clusterA.m_area + clusterB.m_area; - ndFloat64 perimeter = CalculateClusterPerimeter (mesh, mark, clusterA, clusterA.m_color, clusterB.m_color) + - CalculateClusterPerimeter (mesh, mark, clusterB, clusterA.m_color, clusterB.m_color); - - - ndFloat64 concavity = ndFloat64 (0.0f); - if ((convexHull.GetCount() > 128) && ((clusterA.GetCount() > 256) || (clusterB.GetCount() > 256))) { - concavity = CalculateConcavityMultiThread (convexHull, mesh, clusterA, clusterB); - } else { - concavity = CalculateConcavitySingleThread (convexHull, mesh, clusterA, clusterB); - } - - if (concavity < ndFloat64(1.0e-3f)) { - concavity = ndFloat64(0.0f); - } - - // see if the heap will overflow - HeapCollectGarbage (); - - // add a new pair to the heap - ndList::ndNode* pairNode = m_proxyList.Append(); - dgPairProxy& pair = pairNode->GetInfo(); - pair.m_nodeA = clusterNodeA; - pair.m_nodeB = clusterNodeB; - pair.m_distanceConcavity = concavity; - pair.m_hierachicalClusterIndexA = clusterA.m_hierachicalClusterIndex; - pair.m_hierachicalClusterIndexB = clusterB.m_hierachicalClusterIndex; - - pair.m_area = area; - ndFloat64 cost = CalculateConcavityMetric (concavity, area, perimeter * perimeterHandicap, clusterA.GetCount(), clusterB.GetCount()); - m_priorityHeap.Push(pairNode, cost); - - return pairNode; - } - } - return pairNode; - } - - - void CollapseEdge (ndList::ndNode* const pairNode, ndMeshEffect& mesh, ndFloat64 concavity) - { - ndNode* adjacentNodes[1024]; - dgPairProxy& pair = pairNode->GetInfo(); - - dgMemoryAllocator* const allocator = mesh.GetAllocator(); - - - ndAssert((pair.m_nodeA && pair.m_nodeB) || (!pair.m_nodeA && !pair.m_nodeB)); - if (pair.m_nodeA && pair.m_nodeB) { - // call the progress callback - ReportProgress(); - - ndNode* const clusterNodeA = pair.m_nodeA; - ndNode* const clusterNodeB = pair.m_nodeB; - ndAssert (clusterNodeA != clusterNodeB); - - dgHACDCluster& clusterA = clusterNodeA->GetInfo().m_nodeData; - dgHACDCluster& clusterB = clusterNodeB->GetInfo().m_nodeData; - - ndAssert (&clusterA != &clusterB); - ndAssert(clusterA.m_color != clusterB.m_color); - - dgHACDConvacityLookAheadTree* const leftTree = m_concavityTreeArray[pair.m_hierachicalClusterIndexA]; - dgHACDConvacityLookAheadTree* const rightTree = m_concavityTreeArray[pair.m_hierachicalClusterIndexB]; - ndAssert (leftTree); - ndAssert (rightTree); - m_concavityTreeArray[pair.m_hierachicalClusterIndexA] = nullptr; - m_concavityTreeArray[pair.m_hierachicalClusterIndexB] = nullptr; - ndAssert (m_cancavityTreeIndex < (2 * (m_faceCount + 1))); - - ndFloat64 treeConcavity = pair.m_distanceConcavity; -// ndAssert (treeConcavity < 0.1); - m_concavityTreeArray[m_cancavityTreeIndex] = new (allocator) dgHACDConvacityLookAheadTree (allocator, leftTree, rightTree, treeConcavity); - clusterA.m_hierachicalClusterIndex = m_cancavityTreeIndex; - clusterB.m_hierachicalClusterIndex = m_cancavityTreeIndex; - m_cancavityTreeIndex ++; - - // merge two clusters - while (clusterB.GetCount()) { - - dgHACDCluster::ndNode* const nodeB = clusterB.GetFirst(); - clusterB.Unlink(nodeB); - - // now color code all faces of the merged cluster - dHACDClusterFace& faceB = nodeB->GetInfo(); - ndEdge* ptr = faceB.m_edge; - do { - ptr->m_incidentFace = clusterA.m_color; - ptr = ptr->m_next; - } while (ptr != faceB.m_edge); - clusterA.Append(nodeB); - } - clusterA.m_area = pair.m_area; - clusterA.m_concavity = concavity; - - // invalidate all proxies that are still in the heap - ndInt32 adjacentCount = 1; - adjacentNodes[0] = clusterNodeA; - for (dgGraphNode::ndNode* edgeNodeAB = clusterNodeA->GetInfo().GetFirst(); edgeNodeAB; edgeNodeAB = edgeNodeAB->GetNext()) { - dgHACDEdge& edgeAB = edgeNodeAB->GetInfo().m_edgeData; - ndList::ndNode* const proxyNode = (ndList::ndNode*) edgeAB.m_proxyListNode; - if (proxyNode) { - dgPairProxy& pairProxy = proxyNode->GetInfo(); - ndAssert ((edgeNodeAB->GetInfo().m_node == pairProxy.m_nodeA) || (edgeNodeAB->GetInfo().m_node == pairProxy.m_nodeB)); - pairProxy.m_nodeA = nullptr; - pairProxy.m_nodeB = nullptr; - edgeAB.m_proxyListNode = nullptr; - } - - adjacentNodes[adjacentCount] = edgeNodeAB->GetInfo().m_node; - adjacentCount ++; - ndAssert (adjacentCount < sizeof (adjacentNodes)/ sizeof (adjacentNodes[0])); - } - - for (dgGraphNode::ndNode* edgeNodeBA = clusterNodeB->GetInfo().GetFirst(); edgeNodeBA; edgeNodeBA = edgeNodeBA->GetNext()) { - dgHACDEdge& edgeBA = edgeNodeBA->GetInfo().m_edgeData; - ndList::ndNode* const proxyNode = (ndList::ndNode*) edgeBA.m_proxyListNode; - if (proxyNode) { - dgPairProxy& pairProxy = proxyNode->GetInfo(); - pairProxy.m_nodeA = nullptr; - pairProxy.m_nodeB = nullptr; - edgeBA.m_proxyListNode = nullptr; - } - - bool alreadyLinked = false; - ndNode* const node = edgeNodeBA->GetInfo().m_node; - for (ndInt32 i = 0; i < adjacentCount; ++i) { - if (node == adjacentNodes[i]) { - alreadyLinked = true; - break; - } - } - if (!alreadyLinked) { - clusterNodeA->GetInfo().AddEdge (node); - node->GetInfo().AddEdge (clusterNodeA); - } - } - DeleteNode (clusterNodeB); - - // submit all new costs for each edge connecting this new node to any other node - for (dgGraphNode::ndNode* edgeNodeAB = clusterNodeA->GetInfo().GetFirst(); edgeNodeAB; edgeNodeAB = edgeNodeAB->GetNext()) { - dgHACDEdge& edgeAB = edgeNodeAB->GetInfo().m_edgeData; - ndNode* const clusterNodeB = edgeNodeAB->GetInfo().m_node; - ndFloat64 weigh = edgeAB.m_backFaceHandicap; - for (dgGraphNode::ndNode* edgeNodeBA = clusterNodeB->GetInfo().GetFirst(); edgeNodeBA; edgeNodeBA = edgeNodeBA->GetNext()) { - ndNode* const clusterNode = edgeNodeBA->GetInfo().m_node; - if (clusterNode == clusterNodeA) { - dgHACDEdge& edgeBA = edgeNodeBA->GetInfo().m_edgeData; - ndList::ndNode* const proxyNode = SubmitEdgeCost (mesh, clusterNodeA, clusterNodeB, weigh * edgeBA.m_backFaceHandicap); - if (proxyNode) { - edgeBA.m_proxyListNode = proxyNode; - edgeAB.m_proxyListNode = proxyNode; - } - break; - } - } - } - } - m_proxyList.Remove(pairNode); - } - -#ifdef DG_BUILD_HIERACHICAL_HACD - void CollapseClusters (ndMeshEffect& mesh, ndFloat64 maxConcavity, ndInt32 maxClustesCount) - { - - maxConcavity *= (m_diagonal * DG_CONCAVITY_SCALE); - while (m_priorityHeap.GetCount()) { - ndFloat64 concavity = m_priorityHeap.Value(); - ndList::ndNode* const pairNode = m_priorityHeap[0]; - m_priorityHeap.Pop(); - CollapseEdge (pairNode, mesh, concavity); - -//if (m_progress == 24) -//break; - - } - - - - ndInt32 treeCounts = 0; - for (ndInt32 i = 0; i < m_cancavityTreeIndex; ++i) { - if (m_concavityTreeArray[i]) { - m_concavityTreeArray[treeCounts] = m_concavityTreeArray[i]; - m_concavityTreeArray[i] = nullptr; - treeCounts ++; - } - } - - if (treeCounts > 1) { - - for (ndInt32 i = 0; i < treeCounts; ++i) { - if (m_concavityTreeArray[i]->m_faceList.GetCount()==1) { - delete m_concavityTreeArray[i]; - m_concavityTreeArray[i] = m_concavityTreeArray[treeCounts-1]; - m_concavityTreeArray[treeCounts-1]= nullptr; - treeCounts --; - i--; - } - } - - - ndFloat32 C = 10000; - while (treeCounts > 1) { - dgHACDConvacityLookAheadTree* const leftTree = m_concavityTreeArray[treeCounts-1]; - dgHACDConvacityLookAheadTree* const rightTree = m_concavityTreeArray[treeCounts-2]; - m_concavityTreeArray[treeCounts-1] = nullptr; - m_concavityTreeArray[treeCounts-2] = new (mesh.GetAllocator()) dgHACDConvacityLookAheadTree (mesh.GetAllocator(), leftTree, rightTree, C); - C *= 2; - treeCounts --; - } - - } - - dgHACDConvacityLookAheadTree* const tree = m_concavityTreeArray[0]; - ndDownHeap approximation(maxClustesCount * 2, mesh.GetAllocator()); - - tree->ReduceByCount (maxClustesCount, approximation); - // tree->ReduceByConcavity (maxConcavity, approximation); - - while (approximation.GetCount()) { - m_convexProximation.Append(approximation[0]); - approximation.Pop(); - } - } -#else - void CollapseClusters (ndMeshEffect& mesh, ndFloat64 maxConcavity, ndInt32 maxClustesCount) - { - maxConcavity *= (m_diagonal * DG_CONCAVITY_SCALE); - - bool terminate = false; - while (m_priorityHeap.GetCount() && !terminate) { - ndFloat64 concavity = m_priorityHeap.Value(); - ndList::ndNode* const pairNode = m_priorityHeap[0]; - if ((concavity < maxConcavity) && (GetCount() < maxClustesCount)) { - terminate = true; - } else { - m_priorityHeap.Pop(); - CollapseEdge (pairNode, mesh, concavity); - } - } - } -#endif - - ndInt32 m_mark; - ndInt32 m_faceCount; - ndInt32 m_vertexMark; - ndInt32 m_progress; - ndInt32 m_cancavityTreeIndex; - ndInt32* m_vertexMarks; - ndFloat32 m_invFaceCount; - ndFloat64 m_diagonal; - ndBigVector* m_vertexPool; - ndList m_proxyList; - dgHACDConvacityLookAheadTree** m_concavityTreeArray; - ndList m_convexProximation; - ndUpHeap::ndNode*, ndFloat64> m_priorityHeap; - dgReportProgress m_reportProgressCallback; - dgThreadHive m_parallerConcavityCalculator; -}; - -#endif - -ndMeshEffect* ndMeshEffect::CreateSimplification(ndInt32 maxVertexCount, dgReportProgress reportProgressCallback, void* const reportPrgressUserData) const -{ - if (GetVertexCount() <= maxVertexCount) { - return new (GetAllocator()) ndMeshEffect(*this); - } -ndAssert (0); -return new (GetAllocator()) ndMeshEffect(*this); -/* - // ndMeshEffect triangleMesh(*this); - if (maxHullsCount <= 1) { - maxHullsCount = 1; - } - if (maxConcavity <= ndFloat32 (1.0e-5f)) { - maxConcavity = ndFloat32 (1.0e-5f); - } - - if (maxVertexPerHull < 4) { - maxVertexPerHull = 4; - } - ClampValue(backFaceDistanceFactor, ndFloat32 (0.01f), ndFloat32 (1.0f)); - - if (reportProgressCallback) { - reportProgressCallback (0.0f); - } - - - // make a copy of the mesh - ndMeshEffect mesh(*this); - mesh.ClearAttributeArray(); - - - ndInt32 faceCount = mesh.GetTotalFaceCount(); - if (faceCount > meshSimplicationMaxFaceCount) { - mesh.Triangulate(); - - dPolyhedra polygon(GetAllocator()); - ndInt32 mark = mesh.IncLRU(); - polygon.BeginFace(); - dPolyhedra::Iterator iter (mesh); - for (iter.Begin(); iter; iter ++){ - ndEdge* const face = &(*iter); - - if ((face->m_mark != mark) && (face->m_incidentFace > 0)) { - ndInt32 index[DG_MESH_EFFECT_POINT_SPLITED]; - - ndEdge* ptr = face; - ndInt32 indexCount = 0; - do { - index[indexCount] = ptr->m_incidentVertex; - ptr->m_mark = mark; - indexCount ++; - ptr = ptr->m_next; - } while (ptr != face); - polygon.AddFace(indexCount, index); - } - } - polygon.EndFace(); - - polygon.Optimize(&mesh.m_points[0].m_x, sizeof (ndFloat64), 1000.0f, meshSimplicationMaxFaceCount); - - mesh.RemoveAll(); - - mark = polygon.IncLRU(); - mesh.BeginFace(); - dPolyhedra::Iterator iter1 (polygon); - for (iter1.Begin(); iter1; iter1 ++){ - ndEdge* const face = &(*iter1); - if ((face->m_mark != mark) && (face->m_incidentFace > 0)) { - ndInt32 index[DG_MESH_EFFECT_POINT_SPLITED]; - ndEdge* ptr = face; - ndInt32 indexCount = 0; - do { - ptr->m_mark = mark; - index[indexCount] = ndInt32 (ptr->m_incidentVertex); - indexCount ++; - ptr = ptr->m_next; - } while (ptr != face); - mesh.AddFace(indexCount, index); - } - } - mesh.EndFace(); - - faceCount = mesh.GetTotalFaceCount(); - mesh.ClearAttributeArray(); - } - - // create a general connectivity graph - dgHACDClusterGraph graph (mesh, backFaceDistanceFactor, reportProgressCallback); - - // calculate initial edge costs - graph.SubmitInitialEdgeCosts (mesh); - - // collapse the graph - graph.CollapseClusters (mesh, maxConcavity, maxHullsCount); - - // Create Partition Mesh - return graph.CreatePatitionMesh (mesh, maxVertexPerHull); -*/ -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect5.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect5.cpp deleted file mode 100644 index 0104df8a2f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect5.cpp +++ /dev/null @@ -1,1303 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndMeshEffect.h" -//#include "dgBody.h" -//#include "dgWorld.h" -//#include "ndMeshEffect.h" -//#include "dgCollisionConvexHull.h" - - -#if 0 -void ndMeshEffect::ClipMesh (const dMatrix& matrix, const ndMeshEffect* const clipMesh, ndMeshEffect** const back, ndMeshEffect** const front) const -{ - dAssert (0); -/* - ndMeshEffect clipper (*clipMesh); - clipper.TransformMesh (matrix); - - ndMeshEffect* backMeshSource = nullptr; - ndMeshEffect* frontMeshSource = nullptr; - ndMeshEffect* backMeshClipper = nullptr; - ndMeshEffect* frontMeshClipper = nullptr; - - ClipMesh (&clipper, &backMeshSource, &frontMeshSource); - if (backMeshSource && frontMeshSource) { - clipper.ClipMesh (this, &backMeshClipper, &frontMeshClipper); - if (backMeshSource && frontMeshSource) { - - ndMeshEffect* backMesh; - ndMeshEffect* frontMesh; - - backMesh = new (GetAllocator()) ndMeshEffect (GetAllocator(), true); - frontMesh = new (GetAllocator()) ndMeshEffect (GetAllocator(), true); - - backMesh->BeginPolygon(); - frontMesh->BeginPolygon(); - - backMesh->MergeFaces(backMeshSource); - backMesh->MergeFaces(backMeshClipper); - - frontMesh->MergeFaces(frontMeshSource); - frontMesh->ReverseMergeFaces(backMeshClipper); - - backMesh->EndPolygon(ndFloat64 (1.0e-5f)); - frontMesh->EndPolygon(ndFloat64 (1.0e-5f)); - - *back = backMesh; - *front = frontMesh; - } - } - - if (backMeshClipper) { - delete backMeshClipper; - } - - if (frontMeshClipper) { - delete frontMeshClipper; - } - - if (backMeshSource) { - delete backMeshSource; - } - - if (frontMeshSource) { - delete frontMeshSource; - } -*/ -} - - - - -ndMeshEffect* ndMeshEffect::Union (const dMatrix& matrix, const ndMeshEffect* const clipperMesh) const -{ - dAssert (0); - return nullptr; -/* - ndMeshEffect copy (*this); - ndMeshEffect clipper (*clipperMesh); - clipper.TransformMesh (matrix); - - dgBooleanMeshClipper::ClipMeshesAndColorize (©, &clipper); - - ndMeshEffect* const mesh = new (GetAllocator()) ndMeshEffect (GetAllocator()); - mesh->BeginFace(); - dgBooleanMeshClipper::CopyPoints(mesh, ©); - dgBooleanMeshClipper::AddExteriorFaces (mesh, ©); - - dgBooleanMeshClipper::AddExteriorFaces (mesh, &clipper); - mesh->EndFace (); - mesh->RepairTJoints(); - mesh->RemoveUnusedVertices(nullptr); - return mesh; -*/ -} - -ndMeshEffect* ndMeshEffect::Difference (const dMatrix& matrix, const ndMeshEffect* const clipperMesh) const -{ -/* - ndMeshEffect copy (*this); - ndMeshEffect clipper (*clipperMesh); - clipper.TransformMesh (matrix); - - dgBooleanMeshClipper::ClipMeshesAndColorize (©, &clipper); - - ndMeshEffect* const mesh = new (GetAllocator()) ndMeshEffect (GetAllocator()); - mesh->BeginFace(); - dgBooleanMeshClipper::CopyPoints(mesh, ©); - dgBooleanMeshClipper::AddExteriorFaces (mesh, ©); - dgBooleanMeshClipper::AddInteriorFacesInvertWinding (mesh, &clipper); - mesh->EndFace (); - mesh->RepairTJoints(); - mesh->RemoveUnusedVertices(nullptr); - return mesh; -*/ - - dAssert (0); - return nullptr; -} - - -class dgBooleanMeshClipper: public ndMeshEffect::dMeshBVH -{ - class dgPoint: public dBigVector - { - public: - dgPoint() - :dBigVector(dFloat32 (0.0f)) - ,m_links(nullptr) - ,m_lru(0) - { - dAssert (0); - } - - dgPoint(const dBigVector& point, dgMemoryAllocator* const allocator) - :dBigVector(point) - ,m_links(allocator) - ,m_lru(0) - { - } - - dList::dNode*> m_links; - dInt32 m_lru; - }; - - class dgCurvesNetwork: public dTree - { - public: - dgCurvesNetwork () - :dTree(nullptr) - { - dAssert (0); - } - - dgCurvesNetwork (dgMemoryAllocator* const allocator) - :dTree(allocator) - { - } - - dNode* AddVertex(const dBigVector& point, dgMemoryAllocator* const allocator) - { - dFloat64 key = ((point.m_z * dFloat64 (1024.0f) + point.m_y) * dFloat64 (1024.0f)) + point.m_x; - dNode* node = Find(key); - if (!node) { - dgPoint entry (point, allocator); - node = Insert(entry, key); - } - return node; - } - -/* - dgCurvesNetwork(dgBooleanMeshClipper* const BVHmeshA, dgBooleanMeshClipper* const BVHmeshB) - :dTree(BVHmeshA->m_mesh->GetAllocator()) -// ,m_meshA(BVHmeshA->m_mesh) -// ,m_meshB(BVHmeshB->m_mesh) -// ,m_pointBaseA(m_meshA->GetVertexCount()) -// ,m_pointBaseB(m_meshB->GetVertexCount()) -// ,m_lru(0) - { - } -*/ -/* - dgHugeVector CalculateFaceNormal (const ndMeshEffect* const mesh, ndEdge* const face) - { - dgHugeVector plane(dgGoogol::m_zero, dgGoogol::m_zero, dgGoogol::m_zero, dgGoogol::m_zero); - ndEdge* edge = face; - dgHugeVector p0(mesh->GetVertex(edge->m_incidentVertex)); - edge = edge->m_next; - dgHugeVector p1(mesh->GetVertex(edge->m_incidentVertex)); - dgHugeVector p1p0(p1 - p0); - edge = edge->m_next; - do { - dgHugeVector p2(mesh->GetVertex(edge->m_incidentVertex)); - dgHugeVector p2p0(p2 - p0); - plane += p2p0 * p1p0; - p1p0 = p2p0; - edge = edge->m_next; - } while (edge != face); - - plane.m_w = dgGoogol::m_zero - (plane % p0); - return plane; - } - - - bool IsPointInFace (const dgHugeVector& point, const ndMeshEffect* const mesh, ndEdge* const face, const dgHugeVector& normal) const - { - ndEdge* edge = face; - - dTrace (("%f %f %f\n", dFloat64 (point.m_x), dFloat64 (point.m_y), dFloat64 (point.m_z))); - do { - dBigVector p1(mesh->GetVertex(edge->m_incidentVertex)); - dTrace (("%f %f %f\n", dFloat64 (p1.m_x), dFloat64 (p1.m_y), dFloat64 (p1.m_z))); - edge = edge->m_next; - } while (edge != face); - - dgHugeVector p0(mesh->GetVertex(face->m_incidentVertex)); - do { - dgHugeVector p1(mesh->GetVertex(edge->m_twin->m_incidentVertex)); - dgHugeVector p1p0(p1 - p0); - dgHugeVector q1p0(point - p0); - dgGoogol side (q1p0 % (normal * p1p0)); - if (side >= dgGoogol::m_zero) { - return false; - } - p0 = p1; - edge = edge->m_next; - } while (edge != face); - - return true; - } - - dFloat64 ClipEdgeFace(const ndMeshEffect* const meshEdge, ndEdge* const edge, const ndMeshEffect* const meshFace, ndEdge* const face, const dgHugeVector& plane) - { - dgHugeVector p0 (meshEdge->GetVertex(edge->m_incidentVertex)); - dgHugeVector p1 (meshEdge->GetVertex(edge->m_twin->m_incidentVertex)); - - dgGoogol test0 (plane.EvaluePlane(p0)); - dgGoogol test1 (plane.EvaluePlane(p1)); - - if ((test0 * test1) > dgGoogol::m_zero) { - // both point are in one side - return -1.0f; - } - - if ((test0 * test1) < dgGoogol::m_zero) { - //point on different size, clip the line - dgHugeVector p1p0 (p1 - p0); - dgGoogol param = dgGoogol::m_zero - plane.EvaluePlane(p0) / (plane % p1p0); - dgHugeVector p (p0 + p1p0.Scale (param)); - if (IsPointInFace (p, meshFace, face, plane)) { - return param; - } - return -1.0f; - } else { - dAssert (0); - //special cases; - } - - return -1.0f; - } - - void AddPoint (ndMeshEffect* const edgeOwnerMesh, ndEdge* const edgeStart, ndMeshEffect* const faceOwnerMesh, ndEdge* const face, const dgHugeVector& plane, dNode** nodes, dInt32& index) - { - ndEdge* edge = edgeStart; - do { - dFloat64 param = ClipEdgeFace(edgeOwnerMesh, edge, faceOwnerMesh, face, plane); - if (param > 0.0f) { - dgPoint point(edgeOwnerMesh, edge, param, faceOwnerMesh, face); - dNode* node = Find(dgNodeKey(edge, param)); - if (!node) { - node = Insert(point, dgNodeKey(edge, param)); - } - nodes[index] = node; - index ++; - } - edge = edge->m_next; - } while (edge != edgeStart); - - } - - void ClipMeshesFaces(ndEdge* const faceA, ndEdge* const faceB) - { - dAssert (m_meshA->FindEdge(faceA->m_incidentVertex, faceA->m_twin->m_incidentVertex) == faceA); - dAssert (m_meshB->FindEdge(faceB->m_incidentVertex, faceB->m_twin->m_incidentVertex) == faceB); - - dgHugeVector planeA (CalculateFaceNormal (m_meshA, faceA)); - dgHugeVector planeB (CalculateFaceNormal (m_meshB, faceB)); - - dInt32 index = 0; - dNode* nodes[16]; - AddPoint (m_meshA, faceA, m_meshB, faceB, planeB, nodes, index); - AddPoint (m_meshB, faceB, m_meshA, faceA, planeA, nodes, index); - dAssert ((index == 0) || (index == 2)); - if (index == 2) { - dgPoint& pointA = nodes[0]->GetInfo(); - dgPoint& pointB = nodes[1]->GetInfo(); - pointA.m_links.Append(nodes[1]); - pointB.m_links.Append(nodes[0]); - } - } - - void GetCurve (dList& curve, dNode* const node) - { - dInt32 stack = 1; - dNode* pool[64]; - - pool[0] = node; - while (stack) { - stack --; - dNode* const ptr = pool[stack]; - dgPoint& point = ptr->GetInfo(); - if (point.m_lru != m_lru) { - point.m_lru = m_lru; - curve.Append(ptr); - for (dList::dNode*>::dNode* ptrPoint = point.m_links.GetFirst(); ptrPoint; ptrPoint = ptrPoint->GetNext()) { - dNode* const nextnode = ptrPoint->GetInfo(); - dgPoint& nextPoint = nextnode->GetInfo(); - if (nextPoint.m_lru != m_lru) { - pool[stack] = nextnode; - stack ++; - } - } - } - } - } - - void EmbedCurveToSingleFace (dList& curve, ndMeshEffect* const mesh) - { - ndEdge* const face = curve.GetFirst()->GetInfo()->GetInfo().m_face; - - dInt32 indexBase = mesh->GetVertexCount(); - dInt32 indexAttribBase = mesh->GetPropertiesCount(); - - for (dList::dNode* node = curve.GetFirst(); node; node = node->GetNext()) { - dgPoint& point = node->GetInfo()->GetInfo(); - dAssert (point.m_face == face); - ndMeshEffect::dgVertexAtribute attribute(mesh->InterpolateVertex(point.m_posit, face)); - mesh->AddVertex(point.m_posit); - mesh->AddAtribute(attribute); - } - - dList list(GetAllocator()); - dInt32 i0 = curve.GetCount() - 1; - for (dInt32 i = 0; i < curve.GetCount(); ++i) { - ndEdge* const edge = mesh->AddHalfEdge(indexBase + i0, indexBase + i); - ndEdge* const twin = mesh->AddHalfEdge(indexBase + i, indexBase + i0); - - edge->m_incidentFace = 1; - twin->m_incidentFace = 1; - edge->m_userData = indexAttribBase + i0; - twin->m_userData = indexAttribBase + i; - twin->m_twin = edge; - edge->m_twin = twin; - i0 = i; - list.Append(edge); - } - - ndEdge* closestEdge = nullptr; - dFloat64 dist2 = dFloat64 (1.0e10f); - dBigVector p(mesh->GetVertex(face->m_incidentVertex)); - - list.Append(list.GetFirst()->GetInfo()); - list.Addtop(list.GetLast()->GetInfo()); - for (dList::dNode* node = list.GetFirst()->GetNext(); node != list.GetLast(); node = node->GetNext()) { - ndEdge* const edge = node->GetInfo(); - - ndEdge* const prev = node->GetPrev()->GetInfo(); - edge->m_prev = prev; - prev->m_next = edge; - edge->m_twin->m_next = prev->m_twin; - prev->m_twin->m_prev = edge->m_twin; - - ndEdge* const next = node->GetNext()->GetInfo(); - edge->m_next = next; - next->m_prev = edge; - edge->m_twin->m_prev = next->m_twin; - next->m_twin->m_next = edge->m_twin; - - dBigVector dist(mesh->GetVertex(edge->m_incidentVertex) - p); - dFloat64 err2 = dist % dist; - if (err2 < dist2) { - closestEdge = edge; - dist2 = err2; - } - } - - dBigVector faceNormal (mesh->FaceNormal(face, mesh->GetVertexPool(), mesh->GetVertexStrideInByte())); - dBigVector clipNormal (mesh->FaceNormal(closestEdge, mesh->GetVertexPool(), mesh->GetVertexStrideInByte())); - if ((clipNormal % faceNormal) > dFloat64(0.0f)) { - closestEdge = closestEdge->m_twin->m_next; - } - ndEdge* const glueEdge = mesh->ConnectVertex (closestEdge, face); - dAssert (glueEdge); - mesh->PolygonizeFace(glueEdge, mesh->GetVertexPool(), sizeof (dBigVector)); - } - - void EmbedCurveToMulipleFaces (dList& curve, ndMeshEffect* const mesh) - { - for (dList::dNode* node = curve.GetFirst(); node; node = node->GetNext()) { - dgPoint& point = node->GetInfo()->GetInfo(); - if (point.m_edgeOwnerMesh == mesh) { - ndEdge* const edge = point.m_edge; - dBigVector p0 (mesh->GetVertex(edge->m_incidentVertex)); - dBigVector p1 (mesh->GetVertex(edge->m_twin->m_incidentVertex)); - ndVector p1p0 (p1 - p0); - ndVector qp0 (point.m_posit - p0); - dFloat64 param = (qp0 % p1p0) / (p1p0 % p1p0); - dAssert (param >= dFloat64 (0.0f)); - dAssert (param <= dFloat64 (1.0f)); - ndEdge* const newEdge = mesh->InsertEdgeVertex (edge, param); - } -// mesh->AddVertex(point.m_posit); -// mesh->AddAtribute(attribute); - } - } - - - void AddCurveToMesh (dList& curve, ndMeshEffect* const mesh) - { - bool isIscribedInFace = true; - ndEdge* const face = curve.GetFirst()->GetInfo()->GetInfo().m_face; - for (dList::dNode* node = curve.GetFirst(); isIscribedInFace && node; node = node->GetNext()) { - dgPoint& point = node->GetInfo()->GetInfo(); - isIscribedInFace = isIscribedInFace && (point.m_face == face); - isIscribedInFace = isIscribedInFace && (point.m_faceOwnerMesh == mesh); - } - - if (isIscribedInFace) { - EmbedCurveToSingleFace (curve, mesh); - } else { - EmbedCurveToMulipleFaces (curve, mesh); - } - } - - void Colorize() - { - m_lru ++; - Iterator iter (*this); - for (iter.Begin(); iter; iter ++) { - dgPoint& point = iter.GetNode()->GetInfo(); - if (point.m_lru != m_lru) { - dList curve (GetAllocator()); - GetCurve (curve, iter.GetNode()); - AddCurveToMesh (curve, m_meshB); - AddCurveToMesh (curve, m_meshA); - } - } - - m_meshA->SaveOFF("xxxA0.off"); - m_meshB->SaveOFF("xxxB0.off"); - } - - ndMeshEffect* m_meshA; - ndMeshEffect* m_meshB; - dInt32 m_pointBaseA; - dInt32 m_pointBaseB; - dInt32 m_lru; -*/ - }; - - class dgClippedFace: public ndMeshEffect - { - public: - dgClippedFace () - :ndMeshEffect() - ,m_curveNetwork() - { - dAssert (0); - } - - dgClippedFace (dgMemoryAllocator* const allocator) - :ndMeshEffect(allocator) - ,m_curveNetwork(allocator) - { - } - - dgClippedFace (const dgClippedFace& copy) - :ndMeshEffect(copy) - ,m_curveNetwork(copy.m_curveNetwork) - { - } - - void InitFace(ndMeshEffect* const mesh, dEdge* const face) - { - dInt32 indexCount = 0; - dInt32 faceIndex[256]; - dInt64 faceDataIndex[256]; - BeginFace (); - dEdge* ptr = face; - do { - dAssert (0); - //const ndMeshEffect::dgVertexAtribute& point = mesh->GetAttribute(dInt32 (ptr->m_userData)); - //AddPoint (&point.m_vertex.m_x, dInt32 (point.m_material)); - faceIndex[indexCount] = indexCount; - faceDataIndex[indexCount] = indexCount; - indexCount ++; - ptr = ptr->m_next; - } while (ptr != face); - AddFace (indexCount, faceIndex, faceDataIndex); - EndFace (); - } - - - void AddSegment (const dBigVector& plane, const dBigVector* const segment) - { - dAssert (0); -/* - dgCurvesNetwork::dNode* const node0 = m_curveNetwork.AddVertex (segment[0], GetAllocator()); - dgCurvesNetwork::dNode* const node1 = m_curveNetwork.AddVertex (segment[1], GetAllocator()); - - dgPoint& pointA = node0->GetInfo(); - dgPoint& pointB = node1->GetInfo(); - pointA.m_links.Append(node1); - pointB.m_links.Append(node0); -*/ - } - - dgCurvesNetwork m_curveNetwork; - }; - - class dgClipppedFaces: public dTree - { - public: - dgClipppedFaces(ndMeshEffect* const mesh) - :dTree(mesh->GetAllocator()) - ,m_parentMesh (mesh) - { - } - - void ClipMeshesFaces(dEdge* const faceA, const ndMeshEffect* const meshB, dEdge* const faceB, const dBigVector& planeB, const dBigVector* const segment) - { - dNode* node = Find (faceA); - if (!node) { - dgClippedFace tmp (m_parentMesh->GetAllocator()); - node = Insert (tmp, faceA); - dgClippedFace& faceHead = node->GetInfo(); - faceHead.InitFace (m_parentMesh, faceA); - } - dAssert (node); - dgClippedFace& faceHead = node->GetInfo(); - faceHead.AddSegment(planeB, segment); - } - - ndMeshEffect* m_parentMesh; - }; - - - public: - dgBooleanMeshClipper(ndMeshEffect* const mesh) - :dMeshBVH(mesh) - ,m_clippedFaces(mesh) - { - dMeshBVH::Build(); - } - - ~dgBooleanMeshClipper() - { - } - -/* - dFloat64 IntersetionSegment(const ndMeshEffect* const meshEdge, dEdge* const edge, const ndMeshEffect* const meshFace, dEdge* const face, const dgHugeVector& plane) - { - dgHugeVector p0 (meshEdge->GetVertex(edge->m_incidentVertex)); - dgHugeVector p1 (meshEdge->GetVertex(edge->m_twin->m_incidentVertex)); - - dgGoogol test0 (plane.EvaluePlane(p0)); - dgGoogol test1 (plane.EvaluePlane(p1)); - - if ((test0 * test1) > dgGoogol::m_zero) { - // both point are in one side - return -1.0f; - } - - if ((test0 * test1) < dgGoogol::m_zero) { - //point on different size, clip the line - dgHugeVector p1p0 (p1 - p0); - dgGoogol param = dgGoogol::m_zero - plane.EvaluePlane(p0) / (plane % p1p0); - dgHugeVector p (p0 + p1p0.Scale (param)); - if (IsPointInFace (p, meshFace, face, plane)) { - return param; - } - return -1.0f; - } else { - dAssert (0); - //special cases; - } - - return -1.0f; - } -*/ - - static dgHugeVector CalculateFaceNormal (const ndMeshEffect* const mesh, dEdge* const face) - { - dgHugeVector plane(dgGoogol::m_zero, dgGoogol::m_zero, dgGoogol::m_zero, dgGoogol::m_zero); - dEdge* edge = face; - dgHugeVector p0(mesh->GetVertex(edge->m_incidentVertex)); - edge = edge->m_next; - dgHugeVector p1(mesh->GetVertex(edge->m_incidentVertex)); - dgHugeVector p1p0(p1 - p0); - edge = edge->m_next; - do { - dgHugeVector p2(mesh->GetVertex(edge->m_incidentVertex)); - dgHugeVector p2p0(p2 - p0); - plane += p1p0.CrossProduct(p2p0); - p1p0 = p2p0; - edge = edge->m_next; - } while (edge != face); - - dAssert(plane.m_w == dgGoogol(0.0)); - plane.m_w = dgGoogol::m_zero - plane.DotProduct(p0).GetScalar(); - return plane; - } - - static bool IsPointInFace (const dgHugeVector& point, const ndMeshEffect* const mesh, dEdge* const face, const dgHugeVector& normal) - { - dEdge* edge = face; - dgHugeVector p0(mesh->GetVertex(face->m_incidentVertex)); - do { - dgHugeVector p1(mesh->GetVertex(edge->m_twin->m_incidentVertex)); - dgHugeVector p1p0(p1 - p0); - dgHugeVector q1p0(point - p0); - dAssert(p1p0.m_w == dgGoogol(0.0)); - dgGoogol side (q1p0.DotProduct(p1p0.CrossProduct(normal)).GetScalar()); - if (side >= dgGoogol::m_zero) { - return false; - } - p0 = p1; - edge = edge->m_next; - } while (edge != face); - - return true; - } - - static bool ClipEdgeFace(dBigVector& point, const ndMeshEffect* const meshEdge, dEdge* const edgeSrc, const ndMeshEffect* const meshFace, dEdge* const face, const dgHugeVector& plane) - { - const dEdge* const edge = (edgeSrc->m_incidentVertex < edgeSrc->m_twin->m_incidentVertex) ? edgeSrc : edgeSrc->m_twin; - dgHugeVector p0 (meshEdge->GetVertex(edge->m_incidentVertex)); - dgHugeVector p1 (meshEdge->GetVertex(edge->m_twin->m_incidentVertex)); - - dgGoogol test0 (plane.EvaluePlane(p0)); - dgGoogol test1 (plane.EvaluePlane(p1)); - - if ((test0 * test1) > dgGoogol::m_zero) { - // both point are in one side - return false; - } - - if ((test0 * test1) < dgGoogol::m_zero) { - //point on different size, clip the line - dgHugeVector p1p0 (p1 - p0); - dAssert(p1p0.m_w == dgGoogol(0.0)); - dgGoogol param = dgGoogol::m_zero - plane.EvaluePlane(p0) / plane.DotProduct(p1p0).GetScalar(); - dgHugeVector p (p0 + p1p0.Scale (param)); - if (IsPointInFace (p, meshFace, face, plane)) { - point = dBigVector(p.m_x, p.m_y, p.m_z, p.m_w); - return true; - } - return false; - } else { - dAssert (0); - //special cases; - } - - return false; - } - - static void CalculateIntersection (const ndMeshEffect* const edgeOwnerMesh, dEdge* const edgeStart, const ndMeshEffect* const faceOwnerMesh, dEdge* const face, const dgHugeVector& facePlane, dBigVector* const data, dInt32& index) - { - dEdge* edge = edgeStart; - do { - bool isCleipped = ClipEdgeFace(data[index], edgeOwnerMesh, edge, faceOwnerMesh, face, facePlane); - if (isCleipped) { - index ++; - } - edge = edge->m_next; - } while (edge != edgeStart); - } - - static void ClipMeshesFaces(dgBooleanMeshClipper& bvhMeshA, dEdge* const faceA, dgBooleanMeshClipper& bvhMeshB, dEdge* const faceB) - { - const ndMeshEffect* const meshA = bvhMeshA.m_mesh; - const ndMeshEffect* const meshB = bvhMeshB.m_mesh; - dAssert (meshA->FindEdge(faceA->m_incidentVertex, faceA->m_twin->m_incidentVertex) == faceA); - dAssert (meshB->FindEdge(faceB->m_incidentVertex, faceB->m_twin->m_incidentVertex) == faceB); - - dgHugeVector planeA (CalculateFaceNormal (meshA, faceA)); - dgHugeVector planeB (CalculateFaceNormal (meshB, faceB)); - - dBigVector points[16]; - dInt32 pointCount = 0; - CalculateIntersection (meshA, faceA, meshB, faceB, planeB, points, pointCount); - CalculateIntersection (meshB, faceB, meshA, faceA, planeA, points, pointCount); - dAssert ((pointCount == 0) || (pointCount == 2)); - if (pointCount == 2) { - dBigVector facePlaneA (planeA.m_x, planeA.m_y, planeA.m_z, planeA.m_w); - dBigVector facePlaneB (planeB.m_x, planeB.m_y, planeB.m_z, planeB.m_w); - - bvhMeshA.m_clippedFaces.ClipMeshesFaces(faceA, meshB, faceB, facePlaneB, points); - bvhMeshB.m_clippedFaces.ClipMeshesFaces(faceB, meshA, faceA, facePlaneA, points); - } - } - - static void ClipMeshesAndColorize(ndMeshEffect* const meshA, ndMeshEffect* const meshB) - { - dAssert (0); -/* - dgBooleanMeshClipper BVHmeshA(meshA); - dgBooleanMeshClipper BVHmeshB(meshB); - - dInt32 stack = 1; - - dgMeshBVHNode* stackPool[2 * DG_MESH_EFFECT_BVH_STACK_DEPTH][2]; - - stackPool[0][0] = BVHmeshA.m_rootNode; - stackPool[0][1] = BVHmeshB.m_rootNode; - while (stack) { - stack --; - dgMeshBVHNode* const nodeA = stackPool[stack][0]; - dgMeshBVHNode* const nodeB = stackPool[stack][1]; - if (dgOverlapTest (nodeA->m_p0, nodeA->m_p1, nodeB->m_p0, nodeB->m_p1)) { - if (nodeA->m_face && nodeB->m_face) { - ClipMeshesFaces(BVHmeshA, nodeA->m_face, BVHmeshB, nodeB->m_face); - } else if (nodeA->m_face) { - stackPool[stack][0] = nodeA; - stackPool[stack][1] = nodeB->m_left; - stack++; - dAssert(stack < sizeof (stackPool) / sizeof (stackPool[0])); - - stackPool[stack][0] = nodeA; - stackPool[stack][1] = nodeB->m_right; - stack++; - dAssert(stack < sizeof (stackPool) / sizeof (stackPool[0])); - - } else if (nodeB->m_face) { - stackPool[stack][0] = nodeA->m_left; - stackPool[stack][1] = nodeB; - stack++; - dAssert(stack < sizeof (stackPool) / sizeof (stackPool[0])); - - stackPool[stack][0] = nodeA->m_right; - stackPool[stack][1] = nodeB; - stack++; - dAssert(stack < sizeof (stackPool) / sizeof (stackPool[0])); - - } else { - stackPool[stack][0] = nodeA->m_left; - stackPool[stack][1] = nodeB->m_left; - stack ++; - dAssert (stack < sizeof (stackPool) / sizeof (stackPool[0])); - - stackPool[stack][0] = nodeA->m_left; - stackPool[stack][1] = nodeB->m_right; - stack++; - dAssert(stack < sizeof (stackPool) / sizeof (stackPool[0])); - - stackPool[stack][0] = nodeA->m_right; - stackPool[stack][1] = nodeB->m_left; - stack++; - dAssert(stack < sizeof (stackPool) / sizeof (stackPool[0])); - - stackPool[stack][0] = nodeA->m_right; - stackPool[stack][1] = nodeB->m_right; - stack++; - dAssert(stack < sizeof (stackPool) / sizeof (stackPool[0])); - } - } - } -*/ - dAssert (0); -// network.Colorize(); - - -/* - dInt32 baseAttibuteCountB = BVHmeshB.m_mesh->GetPropertiesCount(); - - BVHmeshA.m_mesh->SaveOFF("xxxA0.off"); - BVHmeshB.m_mesh->SaveOFF("xxxB0.off"); - - // edge-face, edge-edge and edge-vertex intersections until not more intersections are found - for (bool intersectionFound = true; intersectionFound;) { - intersectionFound = false; - - intersectionFound |= BVHmeshA.CalculateEdgeFacesIntersetions(BVHmeshB); - intersectionFound |= BVHmeshB.CalculateEdgeFacesIntersetions(BVHmeshA); - - intersectionFound |= BVHmeshA.CalculateVertexFacesIntersetions(BVHmeshB); - intersectionFound |= BVHmeshB.CalculateVertexFacesIntersetions(BVHmeshA); - - - BVHmeshA.m_mesh->SaveOFF("xxxA1.off"); - BVHmeshB.m_mesh->SaveOFF("xxxB1.off"); - - intersectionFound |= BVHmeshA.CalculateEdgeEdgeIntersetions(BVHmeshB); - - BVHmeshA.m_mesh->SaveOFF("xxxA2.off"); - BVHmeshB.m_mesh->SaveOFF("xxxB2.off"); - - intersectionFound |= BVHmeshA.CalculateEdgeVertexIntersetions(BVHmeshB); - intersectionFound |= BVHmeshB.CalculateEdgeVertexIntersetions(BVHmeshA); - - BVHmeshA.m_mesh->SaveOFF("xxxA3.off"); - BVHmeshB.m_mesh->SaveOFF("xxxB3.off"); - } -*/ - } - - dgClipppedFaces m_clippedFaces; -}; - - - -ndMeshEffect* ndMeshEffect::Intersection (const dMatrix& matrix, const ndMeshEffect* const clipperMesh) const -{ - ndMeshEffect copy (*this); - ndMeshEffect clipper (*clipperMesh); - clipper.TransformMesh (matrix); - - dgBooleanMeshClipper::ClipMeshesAndColorize (©, &clipper); -/* - ndMeshEffect* const mesh = new (GetAllocator()) ndMeshEffect (GetAllocator()); - mesh->BeginFace(); - dgBooleanMeshClipper::CopyPoints(mesh, ©); - dgBooleanMeshClipper::AddInteriorFaces (mesh, ©); - dgBooleanMeshClipper::AddInteriorFaces (mesh, &clipper); - mesh->EndFace (); - mesh->RepairTJoints(); - mesh->RemoveUnusedVertices(nullptr); - - return mesh; -*/ - - dAssert (0); - return nullptr; -} - -#endif - -// return 0 if the the shape was clipped -// return 1 if the shape is the positive size of the plane -// return -1 if the shape is the negative size of the plane -// return -2 if function fail -//ndInt32 ndMeshEffect::PlaneClip(const ndMeshEffect& convexMesh, const ndEdge* const convexFace) -ndInt32 ndMeshEffect::PlaneClip(const ndMeshEffect&, const ndEdge* const) -{ -ndAssert(0); -return 0; -#if 0 - ndAssert(convexFace->m_incidentFace > 0); - - ndBigVector normal(convexMesh.FaceNormal(convexFace, &convexMesh.m_points.m_vertex[0].m_x, sizeof(ndBigVector))); - ndFloat64 mag2 = normal.DotProduct(normal).GetScalar(); - if (mag2 < ndFloat64(1.0e-30)) - { - ndAssert(0); - return -2; - } - - normal = normal.Normalize(); - ndBigVector origin(convexMesh.m_points.m_vertex[convexFace->m_incidentVertex]); - ndBigPlane plane(normal, -origin.DotProduct(normal).GetScalar()); - - ndAssert(!HasOpenEdges()); - - ndInt32 pointCount = GetVertexCount(); - ndStack testPool(2 * pointCount + 1024); - ndFloat64* const test = &testPool[0]; - for (ndInt32 i = 0; i < pointCount; ++i) - { - test[i] = plane.Evalue(m_points.m_vertex[i]); - if (fabs(test[i]) < ndFloat32(1.0e-5f)) - { - test[i] = ndFloat32(0.0f); - } - } - - ndInt32 positive = 0; - ndInt32 negative = 0; - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter && !(positive && negative); iter++) - { - ndEdge* const edge = &(*iter); - positive += test[edge->m_incidentVertex] > ndFloat32(0.0f); - negative += test[edge->m_incidentVertex] < ndFloat32(0.0f); - } - if (positive && !negative) - { - return 1; - } - - ndInt32 retValue = -1; - if (positive && negative) - { - retValue = 0; - const ndEdge* e0 = convexFace; - const ndEdge* e1 = e0->m_next; - const ndEdge* e2 = e1->m_next; - - ndMatrix matrix; - ndBigVector p1(convexMesh.m_points.m_vertex[e1->m_incidentVertex]); - - ndBigVector xDir(p1 - origin); - ndAssert(xDir.m_w == ndFloat32(0.0f)); - ndAssert(xDir.DotProduct(xDir).GetScalar() > ndFloat32(0.0f)); - matrix[2] = ndVector(normal); - matrix[0] = ndVector(xDir.Scale(ndFloat64(1.0f) / sqrt(xDir.DotProduct(xDir).GetScalar()))); - matrix[1] = matrix[2].CrossProduct(matrix[0]); - matrix[3] = ndVector(origin); - matrix[3][3] = ndFloat32(1.0f); - - ndVector q0(matrix.UntransformVector(ndVector(convexMesh.m_points.m_vertex[e0->m_incidentVertex]))); - ndVector q1(matrix.UntransformVector(ndVector(convexMesh.m_points.m_vertex[e1->m_incidentVertex]))); - ndVector q2(matrix.UntransformVector(ndVector(convexMesh.m_points.m_vertex[e2->m_incidentVertex]))); - - ndVector p10(q1 - q0); - ndVector p20(q2 - q0); - ndVector faceNormal(matrix.UnrotateVector(ndVector(normal))); - ndAssert(faceNormal.m_w == ndFloat32(0.0f)); - ndFloat32 areaInv = faceNormal.DotProduct(p10.CrossProduct(p20)).GetScalar(); - if (e2->m_next != e0) - { - const ndEdge* edge = e2; - ndVector r1(q2); - ndVector q10(p20); - do - { - ndVector r2(matrix.UntransformVector(ndVector(convexMesh.m_points.m_vertex[edge->m_next->m_incidentVertex]))); - ndVector q20(r2 - q0); - ndFloat32 areaInv1 = faceNormal.DotProduct(q10.CrossProduct(q20)).GetScalar(); - if (areaInv1 > areaInv) - { - e1 = edge; - e2 = edge->m_next; - q1 = r1; - q2 = r2; - areaInv = areaInv1; - } - r1 = r2; - q10 = q20; - edge = edge->m_next; - } while (edge->m_next != e0); - } - - ndAssert(areaInv > ndFloat32(0.0f)); - areaInv = ndFloat32(1.0f) / areaInv; - - ndVector uv0[3]; - ndVector uv1[3]; - memset(uv0, 0, sizeof(uv0)); - memset(uv1, 0, sizeof(uv1)); - if (m_attrib.m_uv0Channel.GetCount() && convexMesh.m_attrib.m_uv0Channel.GetCount()) - { - uv0[0] = ndVector(ndFloat32(convexMesh.m_attrib.m_uv0Channel[ndInt32(e0->m_userData)].m_u), ndFloat32(convexMesh.m_attrib.m_uv0Channel[ndInt32(e0->m_userData)].m_v), ndFloat32(0.0f), ndFloat32(0.0f)); - uv0[1] = ndVector(ndFloat32(convexMesh.m_attrib.m_uv0Channel[ndInt32(e1->m_userData)].m_u), ndFloat32(convexMesh.m_attrib.m_uv0Channel[ndInt32(e1->m_userData)].m_v), ndFloat32(0.0f), ndFloat32(0.0f)); - uv0[2] = ndVector(ndFloat32(convexMesh.m_attrib.m_uv0Channel[ndInt32(e2->m_userData)].m_u), ndFloat32(convexMesh.m_attrib.m_uv0Channel[ndInt32(e2->m_userData)].m_v), ndFloat32(0.0f), ndFloat32(0.0f)); - } - - if (m_attrib.m_uv1Channel.GetCount() && convexMesh.m_attrib.m_uv1Channel.GetCount()) - { - uv1[0] = ndVector(ndFloat32(convexMesh.m_attrib.m_uv1Channel[ndInt32(e0->m_userData)].m_u), ndFloat32(convexMesh.m_attrib.m_uv1Channel[ndInt32(e0->m_userData)].m_v), ndFloat32(0.0f), ndFloat32(0.0f)); - uv1[1] = ndVector(ndFloat32(convexMesh.m_attrib.m_uv1Channel[ndInt32(e1->m_userData)].m_u), ndFloat32(convexMesh.m_attrib.m_uv1Channel[ndInt32(e1->m_userData)].m_v), ndFloat32(0.0f), ndFloat32(0.0f)); - uv1[2] = ndVector(ndFloat32(convexMesh.m_attrib.m_uv1Channel[ndInt32(e2->m_userData)].m_u), ndFloat32(convexMesh.m_attrib.m_uv1Channel[ndInt32(e2->m_userData)].m_v), ndFloat32(0.0f), ndFloat32(0.0f)); - } - - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - - ndFloat64 side0 = test[edge->m_prev->m_incidentVertex]; - ndFloat64 side1 = test[edge->m_incidentVertex]; - - if ((side0 < ndFloat32(0.0f)) && (side1 > ndFloat64(0.0f))) - { - ndBigVector dp(m_points.m_vertex[edge->m_incidentVertex] - m_points.m_vertex[edge->m_prev->m_incidentVertex]); - ndAssert(dp.m_w == ndFloat32(0.0f)); - ndFloat64 param = -side0 / plane.DotProduct(dp).GetScalar(); - - ndEdge* const splitEdge = InsertEdgeVertex(edge->m_prev, param); - test[splitEdge->m_next->m_incidentVertex] = ndFloat64(0.0f); - } - } - - ndInt32 colorMark = IncLRU(); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - ndFloat64 side0 = test[edge->m_incidentVertex]; - ndFloat64 side1 = test[edge->m_next->m_incidentVertex]; - - if ((side0 > ndFloat32(0.0f)) || (side1 > ndFloat64(0.0f))) - { - edge->m_mark = colorMark; - } - } - - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - ndFloat64 side0 = test[edge->m_incidentVertex]; - ndFloat64 side1 = test[edge->m_next->m_incidentVertex]; - if ((side0 == ndFloat32(0.0f)) && (side1 == ndFloat64(0.0f))) - { - ndEdge* ptr = edge->m_next; - do - { - if (ptr->m_mark == colorMark) - { - edge->m_mark = colorMark; - break; - } - ptr = ptr->m_next; - } while (ptr != edge); - } - } - - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_mark == colorMark) && (edge->m_next->m_mark < colorMark)) - { - ndEdge* const startEdge = edge->m_next; - ndEdge* end = startEdge; - do - { - if (end->m_mark == colorMark) - { - break; - } - - end = end->m_next; - } while (end != startEdge); - ndAssert(end != startEdge); - ndEdge* const devideEdge = ConnectVertex(startEdge, end); - ndAssert(devideEdge); - ndAssert(devideEdge->m_next->m_mark != colorMark); - ndAssert(devideEdge->m_prev->m_mark != colorMark); - ndAssert(devideEdge->m_twin->m_next->m_mark == colorMark); - ndAssert(devideEdge->m_twin->m_prev->m_mark == colorMark); - devideEdge->m_mark = colorMark - 1; - devideEdge->m_twin->m_mark = colorMark; - } - } - - ndInt32 mark = IncLRU(); - ndList faceList; - for (iter.Begin(); iter; iter++) - { - ndEdge* const face = &(*iter); - if ((face->m_mark >= colorMark) && (face->m_mark != mark)) - { - faceList.Append(face); - ndEdge* edge = face; - do - { - edge->m_mark = mark; - edge = edge->m_next; - } while (edge != face); - } - } - - for (ndList::ndNode* node = faceList.GetFirst(); node; node = node->GetNext()) - { - ndEdge* const face = node->GetInfo(); - DeleteFace(face); - } - - mark = IncLRU(); - faceList.RemoveAll(); - for (iter.Begin(); iter; iter++) - { - ndEdge* const face = &(*iter); - if ((face->m_mark != mark) && (face->m_incidentFace < 0)) - { - faceList.Append(face); - ndEdge* edge = face; - do - { - edge->m_mark = mark; - edge = edge->m_next; - } while (edge != face); - } - } - - const ndInt32 capAttribute = convexMesh.m_attrib.m_materialChannel.GetCount() ? convexMesh.m_attrib.m_materialChannel[ndInt32(convexFace->m_userData)] : 0; - for (ndList::ndNode* node = faceList.GetFirst(); node; node = node->GetNext()) - { - ndEdge* const face = node->GetInfo(); - - ndEdge* edge = face; - do - { - edge->m_incidentFace = 1; - edge->m_userData = ndUnsigned64(m_attrib.m_pointChannel.GetCount()); - - m_attrib.m_pointChannel.PushBack(edge->m_incidentVertex); - if (m_attrib.m_normalChannel.GetCount()) - { - m_attrib.m_normalChannel.PushBack(ndNormal(ndReal(normal.m_x), ndReal(normal.m_y), ndReal(normal.m_z))); - } - - if (m_attrib.m_binormalChannel.GetCount()) - { - ndAssert(0); - } - - if (m_attrib.m_colorChannel.GetCount()) - { - ndAssert(0); - } - - if (m_attrib.m_materialChannel.GetCount()) - { - m_attrib.m_materialChannel.PushBack(capAttribute); - } - - //ndVector p (matrix.UntransformVector (attibute.m_vertex)); - ndVector p(matrix.UntransformVector(m_points.m_vertex[edge->m_incidentVertex])); - ndVector p_p0(p - q0); - ndVector p_p1(p - q1); - ndVector p_p2(p - q2); - ndAssert(faceNormal.m_w == ndFloat32(0.0f)); - ndFloat32 alpha0 = faceNormal.DotProduct(p_p1.CrossProduct(p_p2)).GetScalar() * areaInv; - ndFloat32 alpha1 = faceNormal.DotProduct(p_p2.CrossProduct(p_p0)).GetScalar() * areaInv; - ndFloat32 alpha2 = faceNormal.DotProduct(p_p0.CrossProduct(p_p1)).GetScalar() * areaInv; - - //alpha0 = 0.0f; - //alpha1 = 0.0f; - //alpha2 = 0.0; - if (m_attrib.m_uv0Channel.GetCount() && convexMesh.m_attrib.m_uv0Channel.GetCount()) - { - ndUV uv( - uv0[0].m_x * alpha0 + uv0[1].m_x * alpha1 + uv0[2].m_x * alpha2, - uv0[0].m_y * alpha0 + uv0[1].m_y * alpha1 + uv0[2].m_y * alpha2); - m_attrib.m_uv0Channel.PushBack(uv); - } - - if (m_attrib.m_uv1Channel.GetCount() && convexMesh.m_attrib.m_uv1Channel.GetCount()) - { - ndUV uv( - uv1[0].m_x * alpha0 + uv1[1].m_x * alpha1 + uv1[2].m_x * alpha2, - uv1[0].m_y * alpha0 + uv1[1].m_y * alpha1 + uv1[2].m_y * alpha2); - m_attrib.m_uv1Channel.PushBack(uv); - } - - edge = edge->m_next; - } while (edge != face); - } - } - - return retValue; -#endif -} -ndMeshEffect* ndMeshEffect::ConvexMeshIntersection(const ndMeshEffect* const convexMeshSrc) const -{ - ndMeshEffect convexMesh(*convexMeshSrc); - convexMesh.ConvertToPolygons(); - ndMeshEffect* const convexIntersection = new ndMeshEffect(*this); - - ndInt32 mark = convexMesh.IncLRU(); - ndPolyhedra::Iterator iter(convexMesh); - - for (iter.Begin(); iter; iter++) - { - ndEdge* const convexFace = &(*iter); - if ((convexFace->m_incidentFace > 0) && (convexFace->m_mark != mark)) - { - ndEdge* ptr = convexFace; - do - { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != convexFace); - - ndInt32 clipCode = convexIntersection->PlaneClip(convexMesh, convexFace); - if (clipCode > 0) - { - delete convexIntersection; - return nullptr; - } - } - } - - if (!convexIntersection->GetVertexCount()) - { - delete convexIntersection; - return nullptr; - } - - convexIntersection->RemoveUnusedVertices(nullptr); - return convexIntersection; -} - -//ndMeshEffect* ndMeshEffect::InverseConvexMeshIntersection(const ndMeshEffect* const convexMeshSrc) const -ndMeshEffect* ndMeshEffect::InverseConvexMeshIntersection(const ndMeshEffect* const) const -{ - ndAssert(0); - return 0; -#if 0 - ndMeshEffect concaveMesh(*convexMeshSrc); - concaveMesh.ConvertToPolygons(); - - ndMeshEffect convexMesh(concaveMesh); - ndMeshEffect* intersection = new ndMeshEffect(*this); - - ndMeshEffect* const mergedOutput = new ndMeshEffect; - mergedOutput->BeginBuild(); - - ndInt32 layer = 0; - for (ndInt32 i = 0; i < intersection->m_points.m_vertex.GetCount(); ++i) - { - intersection->m_points.m_layers[i] = layer; - } - - concaveMesh.FlipWinding(); - ndInt32 mark = concaveMesh.IncLRU(); - ndPolyhedra::Iterator iter(concaveMesh); - for (iter.Begin(); iter; iter++) - { - ndEdge* const concaveFace = &(*iter); - if ((concaveFace->m_incidentFace > 0) && (concaveFace->m_mark != mark)) - { - ndEdge* ptr = concaveFace; - do - { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != concaveFace); - - ndMeshEffect clipTest (*intersection); - ndInt32 clipCode = clipTest.PlaneClip(concaveMesh, concaveFace); - if (clipCode <= 0) - { - clipTest.Triangulate(); - mergedOutput->MergeFaces(&clipTest); - - layer++; - if (clipCode < 0) - { - break; - } - - convexMesh.RemoveAll(); - convexMesh.BeginFace(); - - ptr = concaveFace; - ndInt32 count = 0; - ndInt32 vetexIndex[256]; - ndInt64 attribIndex[256]; - do - { - vetexIndex[count] = ptr->m_incidentVertex; - attribIndex[count] = ndInt64(ptr->m_userData); - count++; - ptr = ptr->m_prev; - } while (ptr != concaveFace); - ndEdge* const edge = convexMesh.AddFace(count, vetexIndex, attribIndex); - convexMesh.EndFace(); - - ndMeshEffect clipTest1(*intersection); - delete intersection; - clipTest1.PlaneClip(convexMesh, edge); - intersection = new ndMeshEffect(clipTest1); - - for (ndInt32 i = 0; i < intersection->m_points.m_vertex.GetCount(); ++i) - { - intersection->m_points.m_layers[i] = layer; - } - } - } - } - - delete intersection; - mergedOutput->EndBuild(false); - - if (!layer) - { - delete mergedOutput; - return nullptr; - } - mergedOutput->RemoveUnusedVertices(nullptr); - return mergedOutput; -#endif -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect6.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect6.cpp deleted file mode 100644 index 11eb3a5c16..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndMeshEffect6.cpp +++ /dev/null @@ -1,1944 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -// algorithm from paper: Non-Distorted Texture Mapping Using Angle Based Flattening -// by: A. Sheffer and E. de Sturler -// http://www.math.vt.edu/people/sturler/Publications/UIUCDCS-R-2001-2257.pdf -// -// also improvement from paper: ABF++: Fast and Robust Angle Based Flattening -// http://hal.archives-ouvertes.fr/docs/00/10/56/89/PDF/abf_plus_plus_temp.pdf -// by: Alla Sheffer, Bruno Lévy, Inria Lorraine, Maxim Mogilnitsky and Alexander Bogomyakov -// -// also looking at paper -// Least Squares Conformal Maps for Automatic Texture Atlas Generation -// http://www.cs.jhu.edu/~misha/Fall09/Levy02.pdf -// by Bruno Lévy Sylvain Petitjean Nicolas Ray Jérome Maillot -// for automatic seam and atlas generation - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndStack.h" -#include "ndMatrix.h" -#include "ndMeshEffect.h" -//#include "dgWorld.h" -//#include "ndMeshEffect.h" - -#if 0 -#define dgABF_MAX_ITERATIONS 5 -#define dgABF_TOL2 ndFloat64 (1.0e-12) -#define dgABF_LINEAR_SOLVER_TOL ndFloat64 (1.0e-14) -#define dgABF_PI ndFloat64 (3.1415926535) - -#define dgABF_UV_TOL2 ndFloat64 (1.0e-8) - -#if 1 - #define DG_DEBUG_UV ndTrace -#else - #define DG_DEBUG_UV -#endif - - -class dgTriangleAnglesToUV: public dgSymmetricConjugateGradientSolver -{ - public: - dgTriangleAnglesToUV (ndMeshEffect* const mesh, ndInt32 material, dgReportProgress progressReportCallback, void* const userData, const ndFloat64* const pinnedPoint, ndFloat64* const triangleAnglesVector = nullptr) - :m_hessianCoLumnIndex (mesh->GetAllocator()) - ,m_hessianCoLumnValue(mesh->GetAllocator()) - ,m_mesh(mesh) - ,m_triangleAngles(triangleAnglesVector) - ,m_pinnedPoints(pinnedPoint) - ,m_trianglesCount(0) - ,m_matrixElementCount(0) - ,m_allocated(false) - { - ndInt32 mark = m_mesh->IncLRU(); - ndMeshEffect::Iterator iter (*m_mesh); - for (iter.Begin(); iter; iter ++) { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if ((edge->m_incidentFace > 0) && (edge->m_mark != mark)) { - ndEdge *ptr = edge; - do { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - m_trianglesCount ++; - ndAssert (edge->m_next->m_next->m_next == edge); - } - } - - m_triangles = (ndEdge**) m_mesh->GetAllocator()->MallocLow (m_trianglesCount * sizeof (ndEdge*)); - - ndInt32 count = 0; - mark = m_mesh->IncLRU(); - for (iter.Begin(); iter; iter ++) { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if ((edge->m_incidentFace > 0) && (edge->m_mark != mark)) { - ndEdge *ptr = edge; - do { - ptr->m_incidentFace = count + 1; - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - m_triangles[count] = ptr; - count ++; - ndAssert (count <= m_trianglesCount); - } - } - - if (!m_triangleAngles) { - ndAssert (0); - AnglesFromUV (); - } - - m_uvArray = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (2 * m_mesh->GetVertexCount() * sizeof (ndFloat64)); - mark = m_mesh->IncLRU(); - for (iter.Begin(); iter; iter ++) { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if (edge->m_mark != mark) { - ndEdge* ptr = edge; - ndEdge* uvEdge = edge; - do { - if ((uvEdge->m_incidentFace < 0) && (ptr->m_incidentFace > 0)) { - uvEdge = ptr; - } - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - ndAssert (0); -/* - ndInt32 index = ndInt32 (uvEdge->m_userData); - ndMeshEffect::dgVertexAtribute& attribute = m_mesh->GetAttribute (index); - m_uvArray[index * 2 + 0] = attribute.m_u0; - m_uvArray[index * 2 + 1] = attribute.m_v0; -*/ - } - } - - m_sinTable = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (3 * m_trianglesCount * sizeof (ndFloat64)); - m_cosTable = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (3 * m_trianglesCount * sizeof (ndFloat64)); - - // pre-compute sin cos tables - for (ndInt32 i = 0; i < m_trianglesCount * 3; ++i) { - m_sinTable[i] = sin (m_triangleAngles[i]); - m_cosTable[i] = cos (m_triangleAngles[i]); - } - - m_vertexEdge = (ndEdge**) m_mesh->GetAllocator()->MallocLow (m_mesh->GetVertexCount() * sizeof (ndEdge*)); - mark = m_mesh->IncLRU(); - for (iter.Begin(); iter; iter ++) { - ndEdge* const vertex = &iter.GetNode()->GetInfo(); - if (vertex->m_mark != mark) { - ndInt32 index = vertex->m_incidentVertex; - m_vertexEdge[index] = vertex; - ndEdge* ptr = vertex; - do { - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next ; - } while (ptr != vertex); - } - } - - m_gradients = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (2 * m_mesh->GetVertexCount() * sizeof (ndFloat64)); - m_diagonal = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (2 * m_mesh->GetVertexCount() * sizeof (ndFloat64)); - - LagrangeOptimization(); - - ndAssert (0); -/* - ndStackattribArray (m_mesh->GetCount()); -// ndInt32 attribCount = m_mesh->EnumerateAttributeArray (&attribArray[0]); - mark = m_mesh->IncLRU(); - for (iter.Begin(); iter; iter ++) { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if (edge->m_mark != mark) { - ndInt32 vertexIndex = edge->m_incidentVertex; - ndEdge* const vertexEdge = m_vertexEdge[vertexIndex]; - ndFloat64 u = m_uvArray[vertexIndex * 2 + 0]; - ndFloat64 v = m_uvArray[vertexIndex * 2 + 1]; - ndEdge* ptr = vertexEdge; - do { - if (ptr->m_incidentFace > 0) { - ndInt32 index = ndInt32 (ptr->m_userData); - ndMeshEffect::dgVertexAtribute& attribute = m_mesh->GetAttribute (index); - attribute.m_u0 = u; - attribute.m_v0 = v; - attribute.m_material = material; - } - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != vertexEdge); - } - } -*/ - ndAssert (0); - //m_mesh->ApplyAttributeArray(&attribArray[0], attribCount); - } - - ~dgTriangleAnglesToUV() - { - m_mesh->GetAllocator()->FreeLow (m_diagonal); - m_mesh->GetAllocator()->FreeLow (m_gradients); - m_mesh->GetAllocator()->FreeLow (m_vertexEdge); - m_mesh->GetAllocator()->FreeLow (m_sinTable); - m_mesh->GetAllocator()->FreeLow (m_cosTable); - m_mesh->GetAllocator()->FreeLow (m_uvArray); - m_mesh->GetAllocator()->FreeLow (m_triangles); - - if (m_allocated) { - m_mesh->GetAllocator()->FreeLow (m_triangleAngles); - } - } - -/* - void GenerateUVCoordinates () - { - m_mesh->SaveOFF("xxx.off"); - - ndStack attibuteUsed (m_attibuteCount); - memset (&attibuteUsed[0], 0, attibuteUsed.GetSizeInBytes()); - ndInt32 mark = m_mesh->IncLRU(); - for (ndInt32 i = 0; i < m_triangleCount; ++i) { - ndEdge* const face = m_betaEdge[i * 3]; - if (face->m_mark != mark) { - ndEdge* ptr = face; - do { - if (ptr->m_incidentFace > 0) { - ndInt32 index = ndInt32 (ptr->m_userData); - attibuteUsed[index] = 1; - m_uvArray[index].m_u0 = ndFloat32 (0.0f); - m_uvArray[index].m_v0 = ndFloat32 (0.0f); - } - ptr = ptr->m_twin->m_next; - } while (ptr != face); - - ndEdge* const twinFace = face->m_twin; - const ndBigVector& p0 = m_mesh->GetVertex(face->m_incidentVertex); - const ndBigVector& p1 = m_mesh->GetVertex(twinFace->m_incidentVertex); - ndBigVector p10 (p1 - p0); - ndFloat64 e0length = sqrt (p10 % p10); - - ptr = twinFace; - do { - if (ptr->m_incidentFace > 0) { - ndInt32 index = ndInt32 (ptr->m_userData); - attibuteUsed[index] = 1; - m_uvArray[index].m_u0 = e0length; - m_uvArray[index].m_v0 = ndFloat32 (0.0f); - } - ptr = ptr->m_twin->m_next; - } while (ptr != twinFace); - - dList stack(m_mesh->GetAllocator()); - stack.Append(face); - while (stack.GetCount()) { - dList::dNode* const node = stack.GetFirst(); - ndEdge* const face = node->GetInfo(); - stack.Remove (node); - if (face->m_mark != mark) { - ndInt32 uvIndex2 = ndInt32 (face->m_prev->m_userData); - if (!attibuteUsed[uvIndex2]) { - - ndInt32 uvIndex0 = ndInt32 (face->m_userData); - ndInt32 uvIndex1 = ndInt32 (face->m_next->m_userData); - - ndInt32 edgeIndex0 = GetAlphaLandaIndex (face); - ndInt32 edgeIndex1 = GetAlphaLandaIndex (face->m_next); - ndInt32 edgeIndex2 = GetAlphaLandaIndex (face->m_prev); - - ndFloat64 refAngleCos = cos (m_variables[edgeIndex0]); - ndFloat64 refAngleSin = sin (m_variables[edgeIndex0]); - ndFloat64 scale = sin (m_variables[edgeIndex1]) / sin (m_variables[edgeIndex2]); - - ndFloat64 du = (m_uvArray[uvIndex1].m_u0 - m_uvArray[uvIndex0].m_u0) * scale; - ndFloat64 dv = (m_uvArray[uvIndex1].m_v0 - m_uvArray[uvIndex0].m_v0) * scale; - ndFloat64 u = m_uvArray[uvIndex0].m_u0 + du * refAngleCos - dv * refAngleSin; - ndFloat64 v = m_uvArray[uvIndex0].m_v0 + du * refAngleSin + dv * refAngleCos; - - ndEdge* ptr = face->m_prev; - do { - if (ptr->m_incidentFace > 0) { - ndInt32 index = ndInt32 (ptr->m_userData); - attibuteUsed[index] = 1; - m_uvArray[index].m_u0 = u; - m_uvArray[index].m_v0 = v; - } - ptr = ptr->m_twin->m_next; - } while (ptr != face->m_prev); - } - - face->m_mark = mark; - face->m_next->m_mark = mark; - face->m_prev->m_mark = mark; - - if (face->m_next->m_twin->m_incidentFace > 0) { - stack.Append(face->m_next->m_twin); - } - - if (face->m_prev->m_twin->m_incidentFace > 0) { - stack.Append(face->m_prev->m_twin); - } - } - } - } - } - } -*/ - - ndInt32 GetAlphaLandaIndex (const ndEdge* const edge) const - { - return edge->m_incidentFace - 1; - } - - void AnglesFromUV () - { - m_allocated = true; - m_triangleAngles = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (3 * m_trianglesCount * sizeof (ndFloat64)); - - // calculate initial beta angle for each triangle - for (ndInt32 i = 0; i < m_trianglesCount; ++i) { - ndEdge* const edge = m_triangles[i]; - - const ndBigVector& p0 = m_mesh->GetVertex(edge->m_incidentVertex); - const ndBigVector& p1 = m_mesh->GetVertex(edge->m_next->m_incidentVertex); - const ndBigVector& p2 = m_mesh->GetVertex(edge->m_prev->m_incidentVertex); - - ndBigVector e10 (p1 - p0); - ndBigVector e20 (p2 - p0); - ndBigVector e12 (p2 - p1); - ndAssert(e10.m_w == ndFloat32(0.0f)); - ndAssert(e20.m_w == ndFloat32(0.0f)); - ndAssert(e12.m_w == ndFloat32(0.0f)); - - e10 = e10.Scale (ndFloat64 (1.0) / sqrt (e10.DotProduct(e10).GetScalar())); - e20 = e20.Scale (ndFloat64 (1.0) / sqrt (e20.DotProduct(e20).GetScalar())); - e12 = e20.Scale (ndFloat64 (1.0) / sqrt (e12.DotProduct(e12).GetScalar())); - - m_triangleAngles[i * 3 + 0] = acos (ndClamp(e10.DotProduct(e20).GetScalar(), ndFloat64 (-1.0f), ndFloat64 (1.0f))); - m_triangleAngles[i * 3 + 1] = acos (ndClamp(e10.DotProduct(e20).GetScalar(), ndFloat64 (-1.0f), ndFloat64 (1.0f))); - m_triangleAngles[i * 3 + 2] = dgABF_PI - m_triangleAngles[i * 3 + 0] - m_triangleAngles[i * 3 + 1]; - } - } - -/* - // objective function - f[u2_,v2_,u3_,v3_,u4_,v4_,u5_,v5_,u6_,v6_] := - (cos[a0] * sin[b0] * (u1 - u0) + sin[a0] * sin[b0] * (v1 - v0) - sin[c0] * (u6 - u0)) ^ 2 + - (cos[a0] * sin[b0] * (v1 - v0) + sin[a0] * sin[b0] * (u1 - u0) - sin[c0] * (v6 - v0)) ^ 2 + - (cos[a1] * sin[b1] * (u2 - u0) + sin[a1] * sin[b1] * (v2 - v0) - sin[c1] * (u1 - u0)) ^ 2 + - (cos[a1] * sin[b1] * (v2 - v0) + sin[a1] * sin[b1] * (u2 - u0) - sin[c1] * (v1 - v0)) ^ 2 + - (cos[a2] * sin[b2] * (u5 - u0) + sin[a2] * sin[b2] * (v5 - v0) - sin[c2] * (u2 - u0)) ^ 2 + - (cos[a2] * sin[b2] * (v5 - v0) + sin[a2] * sin[b2] * (u5 - u0) - sin[c2] * (v2 - v0)) ^ 2 + - (cos[a3] * sin[b3] * (u2 - u1) + sin[a3] * sin[b3] * (v2 - v1) - sin[c3] * (u3 - u1)) ^ 2 + - (cos[a3] * sin[b3] * (v2 - v1) + sin[a3] * sin[b3] * (u2 - u1) - sin[c3] * (v3 - v1)) ^ 2 + - (cos[a4] * sin[b4] * (u3 - u1) + sin[a4] * sin[b4] * (v3 - v1) - sin[c4] * (u4 - u1)) ^ 2 + - (cos[a4] * sin[b4] * (v3 - v1) + sin[a4] * sin[b4] * (u3 - u1) - sin[c4] * (v4 - v1)) ^ 2 + - (cos[a5] * sin[b5] * (u4 - u1) + sin[a5] * sin[b5] * (v4 - v1) - sin[c5] * (u6 - u1)) ^ 2 + - (cos[a5] * sin[b5] * (v4 - v1) + sin[a5] * sin[b5] * (u4 - u1) - sin[c5] * (v6 - v1)) ^ 2 + - (cos[a6] * sin[b6] * (u4 - u2) + sin[a6] * sin[b6] * (v4 - v2) - sin[c6] * (u3 - u2)) ^ 2 + - (cos[a6] * sin[b6] * (v4 - v2) + sin[a6] * sin[b6] * (u4 - u2) - sin[c6] * (v3 - v2)) ^ 2 + - (cos[a7] * sin[b7] * (u5 - u2) + sin[a7] * sin[b7] * (v5 - v2) - sin[c7] * (u4 - u2)) ^ 2 + - (cos[a7] * sin[b7] * (v5 - v2) + sin[a7] * sin[b7] * (u5 - u2) - sin[c7] * (v4 - v2)) ^ 2 + - (cos[a8] * sin[b8] * (u5 - u4) + sin[a8] * sin[b8] * (v5 - v4) - sin[c8] * (u6 - u4)) ^ 2 + - (cos[a8] * sin[b8] * (v5 - v4) + sin[a8] * sin[b8] * (u5 - u4) - sin[c8] * (v6 - v4)) ^ 2 -*/ - void TraceObjectiveFunction() const - { - DG_DEBUG_UV (("f[")); - for (ndInt32 i = 2; i < m_mesh->GetVertexCount(); ++i) { - DG_DEBUG_UV (("u%d_,v%d_", i, i)); - if (i != (m_mesh->GetVertexCount() - 1)) { - DG_DEBUG_UV ((",")); - } - } - DG_DEBUG_UV (("] := \n")); - - for (ndInt32 i = 0; i < m_trianglesCount; ++i) { - ndEdge* const face = m_triangles[i]; - - ndInt32 v0 = face->m_incidentVertex; - ndInt32 v1 = face->m_next->m_incidentVertex; - ndInt32 v2 = face->m_prev->m_incidentVertex; - (void)(v0); - (void)(v1); - (void)(v2); - DG_DEBUG_UV (("(cos[a%d] * sin[b%d] * (u%d - u%d) + sin[a%d] * sin[b%d] * (v%d - v%d) - sin[c%d] * (u%d - u%d)) ^ 2 +\n", i, i, v1, v0, i, i, v1, v0, i, v2, v0)); - DG_DEBUG_UV (("(cos[a%d] * sin[b%d] * (v%d - v%d) + sin[a%d] * sin[b%d] * (u%d - u%d) - sin[c%d] * (v%d - v%d)) ^ 2", i, i, v1, v0, i, i, v1, v0, i, v2, v0)); - if (i != (m_trianglesCount - 1)) { - DG_DEBUG_UV ((" + \n")); - } else { - DG_DEBUG_UV (("\n")); - } - } - } - - ndFloat64 CalculateExpression_U_face (const ndEdge* const face) const - { - ndInt32 faceIndex = GetAlphaLandaIndex (face); - ndEdge* const faceStartEdge = m_triangles[faceIndex]; - - ndInt32 uvIndex0 = ndInt32 (faceStartEdge->m_incidentVertex); - ndInt32 uvIndex1 = ndInt32 (faceStartEdge->m_next->m_incidentVertex); - ndInt32 uvIndex2 = ndInt32 (faceStartEdge->m_prev->m_incidentVertex); - - ndInt32 alphaIndex0 = faceIndex * 3; - ndInt32 alphaIndex1 = faceIndex * 3 + 1; - ndInt32 alphaIndex2 = faceIndex * 3 + 2; - - DG_DEBUG_UV (("(")); - DG_DEBUG_UV (("cos(a%d) * sin(b%d) * (u%d - u%d) + ", faceIndex, faceIndex, uvIndex1, uvIndex0)); - DG_DEBUG_UV (("sin(a%d) * sin(b%d) * (v%d - v%d) + ", faceIndex, faceIndex, uvIndex1, uvIndex0)); - DG_DEBUG_UV (("sin(c%d) * (u%d - u%d)", faceIndex, uvIndex2, uvIndex0)); - DG_DEBUG_UV ((")")); - - ndFloat64 gradient = m_cosTable[alphaIndex0] * m_sinTable[alphaIndex1] * (m_uvArray[uvIndex1 * 2] - m_uvArray[uvIndex0 * 2]) + - m_sinTable[alphaIndex0] * m_sinTable[alphaIndex1] * (m_uvArray[uvIndex1 * 2 + 1] - m_uvArray[uvIndex0 * 2 + 1]) + - m_sinTable[alphaIndex2] * (m_uvArray[uvIndex2 * 2] - m_uvArray[uvIndex0 * 2]); - return gradient; - } - - ndFloat64 CalculateExpression_V_face (const ndEdge* const face) const - { - ndInt32 faceIndex = GetAlphaLandaIndex (face); - ndEdge* const faceStartEdge = m_triangles[faceIndex]; - - ndInt32 uvIndex0 = ndInt32 (faceStartEdge->m_incidentVertex); - ndInt32 uvIndex1 = ndInt32 (faceStartEdge->m_next->m_incidentVertex); - ndInt32 uvIndex2 = ndInt32 (faceStartEdge->m_prev->m_incidentVertex); - - ndInt32 alphaIndex0 = faceIndex * 3; - ndInt32 alphaIndex1 = faceIndex * 3 + 1; - ndInt32 alphaIndex2 = faceIndex * 3 + 2; - - DG_DEBUG_UV (("(")); - DG_DEBUG_UV (("cos(a%d) * sin(b%d) * (v%d - v%d) + ", faceIndex, faceIndex, uvIndex1, uvIndex0)); - DG_DEBUG_UV (("sin(a%d) * sin(b%d) * (u%d - u%d) + ", faceIndex, faceIndex, uvIndex1, uvIndex0)); - DG_DEBUG_UV (("sin(c%d) * (v%d - v%d)", faceIndex, uvIndex2, uvIndex0)); - DG_DEBUG_UV ((")")); - - ndFloat64 gradient = m_cosTable[alphaIndex0] * m_sinTable[alphaIndex1] * (m_uvArray[uvIndex1 * 2 + 1] - m_uvArray[uvIndex0 * 2 + 1]) + - m_sinTable[alphaIndex0] * m_sinTable[alphaIndex1] * (m_uvArray[uvIndex1 * 2] - m_uvArray[uvIndex0 * 2]) + - m_sinTable[alphaIndex2] * (m_uvArray[uvIndex2 * 2 + 1] - m_uvArray[uvIndex0 * 2 + 1]); - return gradient; - } - - - ndFloat64 CalculateGradient_U_Coefficent (const ndEdge* const edge, bool u) const - { - DG_DEBUG_UV (("(")); - ndInt32 faceIndex = GetAlphaLandaIndex (edge); - ndEdge* const faceStartEdge = m_triangles[faceIndex]; - - ndFloat64 gradient = ndFloat64 (0.0f); - - ndInt32 alphaIndex0 = faceIndex * 3; - ndInt32 alphaIndex1 = faceIndex * 3 + 1; - ndInt32 alphaIndex2 = faceIndex * 3 + 2; - if (faceStartEdge == edge) { - if (u) { - DG_DEBUG_UV ((" - cos(a%d) * sin(b%d) - sin(c%d)", faceIndex, faceIndex, faceIndex)); - gradient = - m_cosTable[alphaIndex0] * m_sinTable[alphaIndex1] - m_sinTable[alphaIndex2]; - } else { - DG_DEBUG_UV ((" - sin(a%d) * sin(b%d) - sin(c%d)", faceIndex, faceIndex, faceIndex)); - gradient = - m_sinTable[alphaIndex0] * m_sinTable[alphaIndex1] - m_sinTable[alphaIndex2]; - } - } else if (faceStartEdge->m_next == edge) { - if (u) { - DG_DEBUG_UV (("cos(a%d) * sin(b%d)", faceIndex, faceIndex)); - gradient = m_cosTable[alphaIndex0] * m_sinTable[alphaIndex1]; - } else { - DG_DEBUG_UV (("sin(a%d) * sin(b%d)", faceIndex, faceIndex)); - gradient = m_sinTable[alphaIndex0] * m_sinTable[alphaIndex1]; - } - } else { - ndAssert (faceStartEdge->m_prev == edge); - if (u) { - DG_DEBUG_UV ((" - sin(c%d)", faceIndex)); - gradient = -m_sinTable[alphaIndex2]; - } else { - DG_DEBUG_UV (("0")); - } - } - DG_DEBUG_UV ((")")); - return gradient; - } - - ndFloat64 CalculateGradient_V_Coefficent (const ndEdge* const edge, bool u) const - { - DG_DEBUG_UV (("(")); - ndInt32 faceIndex = GetAlphaLandaIndex (edge); - ndEdge* const faceStartEdge = m_triangles[faceIndex]; - - ndInt32 alphaIndex0 = faceIndex * 3; - ndInt32 alphaIndex1 = faceIndex * 3 + 1; - ndInt32 alphaIndex2 = faceIndex * 3 + 2; - - ndFloat64 gradient = ndFloat64 (0.0f); - if (faceStartEdge == edge) { - if (!u) { - DG_DEBUG_UV ((" - cos(a%d) * sin(b%d) - sin(c%d)", faceIndex, faceIndex, faceIndex)); - gradient = - m_cosTable[alphaIndex0] * m_sinTable[alphaIndex1] - m_sinTable[alphaIndex2]; - } else { - DG_DEBUG_UV ((" - sin(a%d) * sin(b%d) - sin(c%d)", faceIndex, faceIndex, faceIndex)); - gradient = - m_sinTable[alphaIndex0] * m_sinTable[alphaIndex1] - m_sinTable[alphaIndex2]; - } - } else if (faceStartEdge->m_next == edge) { - if (!u) { - DG_DEBUG_UV (("cos(a%d) * sin(b%d)", faceIndex, faceIndex)); - gradient = m_cosTable[alphaIndex0] * m_sinTable[alphaIndex1]; - } else { - DG_DEBUG_UV (("sin(a%d) * sin(b%d)", faceIndex, faceIndex)); - gradient = m_sinTable[alphaIndex0] * m_sinTable[alphaIndex1]; - } - } else { - ndAssert (faceStartEdge->m_prev == edge); - if (!u) { - DG_DEBUG_UV ((" - sin(c%d)", faceIndex)); - gradient = -m_sinTable[alphaIndex2]; - } else { - DG_DEBUG_UV (("0")); - } - } - DG_DEBUG_UV ((")")); - return gradient; - } - - - ndFloat64 CalculateHessianExpression_U_V (const ndEdge* const face) const - { - ndInt32 faceIndex = GetAlphaLandaIndex (face); - //ndEdge* const faceStartEdge = m_triangles[faceIndex]; - //ndInt32 uvIndex0 = ndInt32 (faceStartEdge->m_incidentVertex); - //ndInt32 uvIndex1 = ndInt32 (faceStartEdge->m_next->m_incidentVertex); - //ndInt32 uvIndex2 = ndInt32 (faceStartEdge->m_prev->m_incidentVertex); - ndInt32 alphaIndex0 = faceIndex * 3; - ndInt32 alphaIndex1 = faceIndex * 3 + 1; - //ndInt32 alphaIndex2 = faceIndex * 3 + 2; - DG_DEBUG_UV (("( - sin(a%d) * sin(b%d))", faceIndex, faceIndex)); - return - m_sinTable[alphaIndex0] * m_sinTable[alphaIndex1]; - } - - - ndFloat64 CalculateHessianExpression_V_V (const ndEdge* const face) const - { - ndInt32 faceIndex = GetAlphaLandaIndex (face); - //ndEdge* const faceStartEdge = m_triangles[faceIndex]; - //ndInt32 uvIndex0 = ndInt32 (faceStartEdge->m_incidentVertex); - //ndInt32 uvIndex1 = ndInt32 (faceStartEdge->m_next->m_incidentVertex); - //ndInt32 uvIndex2 = ndInt32 (faceStartEdge->m_prev->m_incidentVertex); - - ndInt32 alphaIndex0 = faceIndex * 3; - ndInt32 alphaIndex1 = faceIndex * 3 + 1; - ndInt32 alphaIndex2 = faceIndex * 3 + 2; - DG_DEBUG_UV (("(- cos(a%d) * sin(b%d) - sin(c%d))", faceIndex, faceIndex, faceIndex)); - return - m_cosTable[alphaIndex0] * m_sinTable[alphaIndex1] - m_sinTable[alphaIndex2]; - } - - - void CalculateGradientU (ndInt32 vertexIndex) - { - // calculate U Gradient derivative - const ndEdge* const vertex = m_vertexEdge[vertexIndex]; - DG_DEBUG_UV (("du%d =\n", vertexIndex)); - ndFloat64 gradient = ndFloat64 (0.0f); - const ndEdge* ptr = vertex; - do { - if (ptr->m_incidentFace > 0) { - DG_DEBUG_UV (("2 * ")); - ndAssert (ptr->m_incidentVertex == vertexIndex); - ndFloat64 a = CalculateGradient_U_Coefficent (ptr, true) ; - DG_DEBUG_UV ((" * ")); - gradient += a * CalculateExpression_U_face (ptr); - DG_DEBUG_UV ((" +\n")); - - DG_DEBUG_UV (("2 * ")); - a = CalculateGradient_U_Coefficent (ptr, false); - DG_DEBUG_UV ((" * ")); - gradient += a * CalculateExpression_V_face (ptr); - DG_DEBUG_UV ((" +\n")); - } - ptr = ptr->m_twin->m_next; - } while (ptr != vertex); - m_gradients[2 * vertexIndex] = - gradient; - DG_DEBUG_UV (("\n")); - - // calculate diagonal derivative - DG_DEBUG_UV (("H(u%d,u%d) =\n", vertexIndex, vertexIndex)); - ndFloat64 diagonal = ndFloat64 (0.0f); - ptr = vertex; - do { - if (ptr->m_incidentFace > 0) { - DG_DEBUG_UV (("2 * ")); - ndAssert (ptr->m_incidentVertex == vertexIndex); - ndFloat64 diag = CalculateGradient_U_Coefficent (ptr, true); - diagonal += diag * diag; - DG_DEBUG_UV (("^2 +\n")); - - DG_DEBUG_UV (("2 * ")); - diag = CalculateGradient_U_Coefficent (ptr, false); - diagonal += diag * diag; - DG_DEBUG_UV (("^2 +\n")); - } - ptr = ptr->m_twin->m_next; - } while (ptr != vertex); - ndAssert (diagonal > ndFloat32 (0.0f)); - - m_hessianCoLumnValue[m_matrixElementCount] = diagonal; - m_hessianCoLumnIndex[m_matrixElementCount] = vertexIndex * 2 + 0; - m_matrixElementCount ++; - m_diagonal[2 * vertexIndex] = diagonal; - DG_DEBUG_UV (("\n")); - - // calculate of diagonal UiVi derivative - DG_DEBUG_UV (("H(u%d,v%d) =\n", vertexIndex, vertexIndex)); - ndFloat64 hessianUV = ndFloat64 (0.0); - ptr = vertex; - do { - if (ptr->m_incidentFace > 0) { - DG_DEBUG_UV (("2 * ")); - ndAssert (ptr->m_incidentVertex == vertexIndex); - ndFloat64 a = CalculateGradient_U_Coefficent (ptr, true); - DG_DEBUG_UV ((" * ")); - hessianUV += a * CalculateHessianExpression_U_V (ptr); - DG_DEBUG_UV ((" +\n")); - - DG_DEBUG_UV (("2 * ")); - a = CalculateGradient_U_Coefficent (ptr, false); - DG_DEBUG_UV ((" * ")); - hessianUV += a * CalculateHessianExpression_V_V (ptr); - DG_DEBUG_UV ((" +\n")); - } - ptr = ptr->m_twin->m_next; - } while (ptr != vertex); - - m_hessianCoLumnValue[m_matrixElementCount] = hessianUV; - m_hessianCoLumnIndex[m_matrixElementCount] = vertexIndex * 2 + 1; - m_matrixElementCount ++; - DG_DEBUG_UV (("\n")); - - -/* - // calculate off diagonal partial derivatives - ptr = vertex; - do { - // derivative respect to U(i, j) - ndInt32 vertexIndex2 = ptr->m_twin->m_incidentVertex; - DG_DEBUG_UV (("H(u%d,u%d) =\n", vertexIndex, vertexIndex2)); - if (ptr->m_incidentFace > 0) { - DG_DEBUG_UV (("2 * ")); - ndAssert (ptr->m_incidentVertex == vertexIndex); - ndFloat64 a = CalculateGradient_U_Coefficent (ptr, true); - DG_DEBUG_UV ((" * ")); -// gradient += diag * TraceExpression_U_face (ptr); - DG_DEBUG_UV ((" +\n")); - - DG_DEBUG_UV (("2 * ")); - a = CalculateGradient_U_Coefficent (ptr, false); - DG_DEBUG_UV ((" * ")); -// gradient += diag * TraceExpression_V_face (ptr); - DG_DEBUG_UV ((" +\n")); - } - - if (ptr->m_twin->m_incidentFace > 0) { - DG_DEBUG_UV (("2 * ")); - ndAssert (ptr->m_incidentVertex == vertexIndex); - ndFloat64 a = CalculateGradient_U_Coefficent (ptr->m_twin->m_next, true); - DG_DEBUG_UV ((" * ")); - // gradient += diag * TraceExpression_U_face (ptr); - DG_DEBUG_UV ((" +\n")); - - DG_DEBUG_UV (("2 * ")); - a = CalculateGradient_U_Coefficent (ptr->m_twin->m_next, false); - DG_DEBUG_UV ((" * ")); - // gradient += diag * TraceExpression_V_face (ptr); - DG_DEBUG_UV ((" +\n")); - } - - // derivative respect to V(i, j) - DG_DEBUG_UV (("H(u%d,v%d) =\n", vertexIndex, vertexIndex2)); - if (ptr->m_incidentFace > 0) { - - DG_DEBUG_UV (("2 * ")); - ndAssert (ptr->m_incidentVertex == vertexIndex); - ndFloat64 a = CalculateGradient_U_Coefficent (ptr, true); - DG_DEBUG_UV ((" * ")); - // gradient += diag * TraceExpression_U_face (ptr); - DG_DEBUG_UV ((" +\n")); - - DG_DEBUG_UV (("2 * ")); - a = CalculateGradient_U_Coefficent (ptr, false); - DG_DEBUG_UV ((" * ")); - // gradient += diag * TraceExpression_V_face (ptr); - DG_DEBUG_UV ((" +\n")); - - } - - if (ptr->m_twin->m_incidentFace > 0) { - - DG_DEBUG_UV (("2 * ")); - ndAssert (ptr->m_incidentVertex == vertexIndex); - ndFloat64 a = CalculateGradient_U_Coefficent (ptr->m_twin->m_next, true); - DG_DEBUG_UV ((" * ")); - // gradient += diag * TraceExpression_U_face (ptr); - DG_DEBUG_UV ((" +\n")); - - DG_DEBUG_UV (("2 * ")); - a = CalculateGradient_U_Coefficent (ptr->m_twin->m_next, false); - DG_DEBUG_UV ((" * ")); - // gradient += diag * TraceExpression_V_face (ptr); - DG_DEBUG_UV ((" +\n")); - - } - - DG_DEBUG_UV (("\n")); - ptr = ptr->m_twin->m_next; - } while (ptr != vertex); -*/ - } - - - void CalculateGradientV (ndInt32 vertexIndex) - { - // calculate U Gradient derivative - const ndEdge* const vertex = m_vertexEdge[vertexIndex]; - DG_DEBUG_UV (("dv%d =\n", vertexIndex)); - - ndFloat64 gradient = ndFloat64 (0.0f); - const ndEdge* ptr = vertex; - do { - if (ptr->m_incidentFace > 0) { - DG_DEBUG_UV (("2 * ")); - ndAssert (ptr->m_incidentVertex == vertexIndex); - ndFloat64 a = CalculateGradient_V_Coefficent (ptr, true); - DG_DEBUG_UV ((" * ")); - gradient += a * CalculateExpression_U_face (ptr); - DG_DEBUG_UV ((" +\n")); - - DG_DEBUG_UV (("2 * ")); - a = CalculateGradient_V_Coefficent (ptr, false); - DG_DEBUG_UV ((" * ")); - gradient += a * CalculateExpression_V_face (ptr); - DG_DEBUG_UV ((" +\n")); - } - ptr = ptr->m_twin->m_next; - } while (ptr != vertex); - m_gradients[2 * vertexIndex + 1] = - gradient; - DG_DEBUG_UV (("\n")); - - - // calculate diagonal derivative - DG_DEBUG_UV (("H(v%d,v%d) =\n", vertexIndex, vertexIndex)); - ndFloat64 diagonal = ndFloat64 (0.0f); - ptr = vertex; - do { - if (ptr->m_incidentFace > 0) { - DG_DEBUG_UV (("2 * ")); - ndAssert (ptr->m_incidentVertex == vertexIndex); - ndFloat64 diag = CalculateGradient_V_Coefficent (ptr, true); - diagonal += diag * diag; - DG_DEBUG_UV (("^2 +\n")); - - DG_DEBUG_UV (("2 * ")); - diag = CalculateGradient_V_Coefficent (ptr, false); - diagonal += diag * diag; - DG_DEBUG_UV (("^2 +\n")); - } - ptr = ptr->m_twin->m_next; - } while (ptr != vertex); - ndAssert (diagonal > ndFloat32 (0.0f)); - - m_hessianCoLumnValue[m_matrixElementCount] = diagonal; - m_hessianCoLumnIndex[m_matrixElementCount] = vertexIndex * 2 + 1; - m_matrixElementCount ++; - m_diagonal[2 * vertexIndex + 1] = diagonal; - DG_DEBUG_UV (("\n")); - - - - - - } - - - - void CalculateGradientVectorAndHessianMatrix () - { - // trace objective function -// TraceObjectiveFunction(); - - // trace gradients - DG_DEBUG_UV (("\n")); - ndInt32 count = m_mesh->GetVertexCount(); - for (ndInt32 i = 0; i < count; ++i) { - CalculateGradientU (i); - CalculateGradientV (i); - } - DG_DEBUG_UV (("\n")); - } - - void InversePrecoditionerTimeVector (ndFloat64* const out, const ndFloat64* const v) const - { - const ndInt32 count = m_mesh->GetVertexCount(); - for (ndInt32 i = 0; i < count; ++i) { - out[2 * i + 0] = m_pinnedPoints[i] * v[i * 2 + 0] / m_diagonal[2 * i + 0]; - out[2 * i + 1] = m_pinnedPoints[i] * v[i * 2 + 1] / m_diagonal[2 * i + 1]; - } - } - - void MatrixTimeVector (ndFloat64* const out, const ndFloat64* const v) const - { -/* - const ndInt32 count = m_mesh->GetVertexCount(); - for (ndInt32 i = 0; i < count; ++i) { - ndEdge* const vertex = m_vertexEdge[i]; - ndAssert (vertex->m_incidentVertex == i); - out[i * 2 + 0] = m_diagonal[2 * i + 0] * v[2 * i + 0]; - out[i * 2 + 1] = m_diagonal[2 * i + 1] * v[2 * i + 1]; - } - DG_DEBUG_UV (("\n")); - ndInt32 count = m_mesh->GetVertexCount(); - for (ndInt32 i = 0; count; ++i) { - CalculateHessianDiagonalUU (i); - } - DG_DEBUG_UV (("\n")); -*/ - } - - void LagrangeOptimization() - { - CalculateGradientVectorAndHessianMatrix (); - ndStack r0(2 * m_mesh->GetVertexCount()); - ndStack z0(2 * m_mesh->GetVertexCount()); - ndStack p0(2 * m_mesh->GetVertexCount()); - ndStack q0(2 * m_mesh->GetVertexCount()); - SetBuffers(&r0[0], &z0[0], &p0[0], &q0[0]); - Solve(2 * m_mesh->GetVertexCount(), dgABF_UV_TOL2, m_uvArray, m_gradients); - SetBuffers(nullptr, nullptr, nullptr, nullptr); - } - - dgArray m_hessianCoLumnIndex; - dgArray m_hessianCoLumnValue; - ndMeshEffect* m_mesh; - ndEdge** m_triangles; - ndEdge** m_vertexEdge; - ndFloat64* m_uvArray; - ndFloat64* m_sinTable; - ndFloat64* m_cosTable; - ndFloat64* m_gradients; - ndFloat64* m_diagonal; - ndFloat64* m_triangleAngles; - const ndFloat64* m_pinnedPoints; - - ndInt32 m_trianglesCount; - ndInt32 m_matrixElementCount; - bool m_allocated; -}; - -class dgAngleBasedFlatteningMapping: public dgSymmetricConjugateGradientSolver -{ - public: - dgAngleBasedFlatteningMapping (ndMeshEffect* const mesh, ndInt32 material, dgReportProgress progressReportCallback, void* const userData) - :m_mesh(mesh) - ,m_progressReportUserData(userData) - ,m_progressReportCallback(progressReportCallback) - { -ndAssert (0); -/* - AllocVectors(); - InitEdgeVector(); - CalculateInitialAngles (); - LagrangeOptimization(); - - ndEdge* const face = m_betaEdge[0]; - ndEdge* ptr = face; - do { - if (ptr->m_incidentFace > 0) { - ndInt32 index = ndInt32 (ptr->m_userData); - ndMeshEffect::dgVertexAtribute& attribute = m_mesh->GetAttribute (index); - attribute.m_u0 = ndFloat32 (0.0f); - attribute.m_v0 = ndFloat32 (0.0f); - } - ptr = ptr->m_twin->m_next; - } while (ptr != face); - - ndEdge* const twinFace = face->m_twin; - const ndBigVector& p0 = m_mesh->GetVertex(face->m_incidentVertex); - const ndBigVector& p1 = m_mesh->GetVertex(twinFace->m_incidentVertex); - ndBigVector p10 (p1 - p0); - ndAssert(p10.m_w == ndFloat32(0.0f)); - ndFloat64 e0length = sqrt (p10.DotProduct(p10).GetScalar()); - - ptr = twinFace; - do { - if (ptr->m_incidentFace > 0) { - ndInt32 index = ndInt32 (ptr->m_userData); - ndMeshEffect::dgVertexAtribute& attribute = m_mesh->GetAttribute (index); - attribute.m_u0 = e0length; - attribute.m_v0 = ndFloat32 (0.0f); - } - ptr = ptr->m_twin->m_next; - } while (ptr != twinFace); - - DeleteAuxiliaryVectors(); - - m_deltaVariables[0] = 0.0f; - m_deltaVariables[1] = 0.0f; - for (ndInt32 i = 2; i < m_totalVariablesCount; ++i) { - m_deltaVariables[i] = 1.0f; - } - dgTriangleAnglesToUV anglesToUV (mesh, material, progressReportCallback, userData, m_deltaVariables, m_variables); -*/ - } - - ~dgAngleBasedFlatteningMapping() - { - m_mesh->GetAllocator()->FreeLow (m_variables); - m_mesh->GetAllocator()->FreeLow (m_deltaVariables); - } - - - void AllocVectors() - { - CalculateNumberOfVariables(); - ndInt32 vertexCount = m_mesh->GetVertexCount(); - - // alloc intermediate vectors - m_betaEdge = (ndEdge**) m_mesh->GetAllocator()->MallocLow(m_anglesCount * sizeof (ndEdge*)); - m_interiorIndirectMap = (ndInt32*) m_mesh->GetAllocator()->MallocLow (vertexCount * sizeof (ndInt32)); - m_beta = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (m_anglesCount * sizeof (ndFloat64)); - m_weight= (ndFloat64*) m_mesh->GetAllocator()->MallocLow (m_anglesCount * sizeof (ndFloat64)); - m_sinTable = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (m_anglesCount * sizeof (ndFloat64)); - m_cosTable = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (m_anglesCount * sizeof (ndFloat64)); - m_gradients = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (m_totalVariablesCount * sizeof (ndFloat64)); - - // allocate angle and internal vertex vector - m_variables = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (m_totalVariablesCount * sizeof (ndFloat64)); - m_deltaVariables = (ndFloat64*) m_mesh->GetAllocator()->MallocLow (m_totalVariablesCount * sizeof (ndFloat64)); - } - - void DeleteAuxiliaryVectors() - { - // delete intermediate vectors - m_mesh->GetAllocator()->FreeLow (m_betaEdge); - m_mesh->GetAllocator()->FreeLow (m_interiorIndirectMap); - m_mesh->GetAllocator()->FreeLow (m_sinTable); - m_mesh->GetAllocator()->FreeLow (m_cosTable); - m_mesh->GetAllocator()->FreeLow (m_beta); - m_mesh->GetAllocator()->FreeLow (m_weight); - m_mesh->GetAllocator()->FreeLow (m_gradients); - - m_beta = nullptr; - m_weight = nullptr; - m_betaEdge = nullptr; - m_sinTable = nullptr; - m_cosTable = nullptr; - m_gradients = nullptr; - m_interiorIndirectMap = nullptr; - } - - - void CalculateNumberOfVariables() - { - //m_mesh->SaveOFF("xxx.off"); - m_anglesCount = 0; - m_triangleCount = 0; - m_interiorVertexCount = 0; - - ndInt32 mark = m_mesh->IncLRU(); - ndMeshEffect::Iterator iter (*m_mesh); - for (iter.Begin(); iter; iter ++) { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if ((edge->m_incidentFace > 0) && (edge->m_mark != mark)) { - ndEdge *ptr = edge; - do { - m_anglesCount ++; - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - m_triangleCount ++; - ndAssert (edge->m_next->m_next->m_next == edge); - } - } - - mark = m_mesh->IncLRU(); - for (iter.Begin(); iter; iter ++) { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if ((edge->m_incidentFace > 0) && (edge->m_mark != mark)) { - bool isInterior = true; - ndEdge *ptr = edge; - do { - isInterior &= (ptr->m_incidentFace > 0); - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - m_interiorVertexCount += isInterior ? 1 : 0; - } - } - m_totalVariablesCount = m_anglesCount + m_triangleCount + 2 * m_interiorVertexCount; - } - - void InitEdgeVector() - { - ndInt32 count = 0; - ndInt32 mark = m_mesh->IncLRU(); - ndMeshEffect::Iterator iter (*m_mesh); - for (iter.Begin(); iter; iter ++) { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if ((edge->m_incidentFace > 0) && (edge->m_mark != mark)) { - ndEdge *ptr = edge; - do { - ptr->m_mark = mark; - m_betaEdge[count] = ptr; - ptr->m_incidentFace = count + 1; - count ++; - ndAssert (count <= m_anglesCount); - ptr = ptr->m_next; - } while (ptr != edge); - } - } - - count = 0; - mark = m_mesh->IncLRU(); - memset (m_interiorIndirectMap, -1, m_mesh->GetVertexCount() * sizeof (m_interiorIndirectMap[0])); - for (iter.Begin(); iter; iter ++) { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if ((edge->m_incidentFace > 0) && (edge->m_mark != mark)) { - - bool isInterior = true; - ndEdge* ptr = edge; - do { - isInterior &= (ptr->m_incidentFace > 0); - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - if (isInterior) { - m_interiorIndirectMap[edge->m_incidentVertex] = m_anglesCount + m_triangleCount + count; - count ++; - } - } - } - } - - ndInt32 GetAlphaLandaIndex (const ndEdge* const edge) const - { - return edge->m_incidentFace - 1; - } - - ndInt32 GetTriangleIndex (const ndInt32 alphaIndex) const - { - return alphaIndex / 3 + m_anglesCount; - } - - ndInt32 GetTriangleIndex (const ndEdge* const edge) const - { - return GetAlphaLandaIndex(edge) / 3 + m_anglesCount; - } - - ndInt32 GetInteriorVertex(const ndEdge* const edge) const - { - return m_interiorIndirectMap[edge->m_incidentVertex]; - } - - void CalculateInitialAngles () - { - // calculate initial beta angle for each triangle - for (ndInt32 i = 0; i < m_anglesCount; ++i) { - ndEdge* const edge = m_betaEdge[i]; - - const ndBigVector& p0 = m_mesh->GetVertex(edge->m_incidentVertex); - const ndBigVector& p1 = m_mesh->GetVertex(edge->m_next->m_incidentVertex); - const ndBigVector& p2 = m_mesh->GetVertex(edge->m_prev->m_incidentVertex); - - ndBigVector e10 (p1 - p0); - ndBigVector e20 (p2 - p0); - - e10 = e10.Scale (ndFloat64 (1.0) / sqrt (e10.DotProduct(e10).GetScalar())); - e20 = e20.Scale (ndFloat64 (1.0) / sqrt (e20.DotProduct(e20).GetScalar())); - ndAssert(e10.m_w == ndFloat32(0.0f)); - ndAssert(e20.m_w == ndFloat32(0.0f)); - - m_beta[i] = acos (ndClamp(e10.DotProduct(e20).GetScalar(), ndFloat64 (-1.0f), ndFloat64 (1.0f))); - ndAssert (m_beta[i] > ndFloat64 (0.0f)); - } - - #ifdef _DEBUG - for (ndInt32 i = 0; i < m_triangleCount; ++i) { - ndInt32 i0 = i * 3 + 0; - ndInt32 i1 = i * 3 + 1; - ndInt32 i2 = i * 3 + 2; - ndAssert (fabs (m_beta[i0] + m_beta[i1] + m_beta[i2] - dgABF_PI) < ndFloat64 (1.0e-6f)); - } - #endif - - // for each interior vertex apply the scale factor - ndInt32 mark = m_mesh->IncLRU(); - for (ndInt32 i = 0; i < m_anglesCount; ++i) { - ndEdge* const edge = m_betaEdge[i]; - if ((edge->m_mark != mark) && (GetInteriorVertex(edge) >= 0)) { - ndFloat64 scale = ndFloat64 (0.0f); - ndEdge* ptr = edge; - do { - ndInt32 index = GetAlphaLandaIndex (ptr); - ndAssert (index >= 0); - ndAssert (index <= m_anglesCount); - scale += m_beta[index]; - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - ndAssert (scale > ndFloat32 (0.0f)); - - scale = ndFloat64 (2.0f) * dgABF_PI / scale; - ptr = edge; - do { - ndInt32 index = GetAlphaLandaIndex (ptr); - ndAssert (index >= 0); - ndAssert (index <= m_anglesCount); - m_beta[index] *= scale; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - } - } - - // initialized each alpha lambda to the beta angle and also calcual ethe derivatoe coeficent (2.0 / (betai * betai)) - for (ndInt32 i = 0; i < m_anglesCount; ++i) { - ndAssert (m_beta[i] > ndFloat64 (0.0f)); - m_variables[i] = m_beta[i]; - m_weight[i] = ndFloat64 (2.0f) / (m_beta[i] * m_beta[i]); - } - } - - // angular derivative component - // (wi * (xi - bi) + T0 - // where wi = 2.0 / (bi ^ 2) - ndFloat64 CalculateAngularGradientDerivative (ndInt32 alphaIndex) const - { - ndFloat64 gradient = (m_variables[alphaIndex] - m_beta[alphaIndex]) * m_weight[alphaIndex] + m_variables[GetTriangleIndex(alphaIndex)]; - ndAssert (fabs(gradient) < ndFloat64(1.0e10f)); - return gradient; - } - - // Vi if the the edge is an interior vertex - ndFloat64 CalculateInteriorVertexGradient (ndInt32 alphaIndex) const - { - ndInt32 index = GetInteriorVertex(m_betaEdge[alphaIndex]); - ndFloat64 gradient = (index != -1) ? m_variables[index] : ndFloat32 (0.0f); - ndAssert (fabs(gradient) < ndFloat64(1.0e10f)); - return gradient; - } - - // Wj * cos(alpha) * sum (alphai) for eadh previsu or next interior incdent vertex - ndFloat64 CalculatePlanarityGradient (ndInt32 alphaIndex) const - { - ndFloat64 gradient = ndFloat64 (0.0f); - - ndEdge* const incidentEdge = m_betaEdge[alphaIndex]; - - if (GetInteriorVertex (incidentEdge->m_next) != -1) { - ndEdge* const edge = m_betaEdge[GetAlphaLandaIndex(incidentEdge->m_next)]; - ndFloat64 product = m_cosTable[GetAlphaLandaIndex(edge->m_prev)]; - ndEdge* ptr = edge->m_twin->m_next; - do { - product *= m_sinTable[GetAlphaLandaIndex(ptr->m_prev)]; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - ndInt32 interiorVertexIndex = GetInteriorVertex (incidentEdge->m_next) + m_interiorVertexCount; - gradient -= m_variables[interiorVertexIndex] * product; - } - - if (GetInteriorVertex (incidentEdge->m_prev) != -1) { - ndEdge* const edge = m_betaEdge[GetAlphaLandaIndex(incidentEdge->m_prev)]; - ndFloat64 product = m_cosTable[GetAlphaLandaIndex(edge->m_next)]; - ndEdge* ptr = edge->m_twin->m_next; - do { - product *= m_sinTable[GetAlphaLandaIndex(ptr->m_next)]; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - ndInt32 interiorVertexIndex = GetInteriorVertex (incidentEdge->m_prev) + m_interiorVertexCount; - gradient += m_variables[interiorVertexIndex] * product; - } - ndAssert (fabs(gradient) < ndFloat64(1.0e10f)); - return gradient; - } - - // sample of the Gradient Vector according to Mathematic to a generic mesh, this can be generalize for and arbitrary mesh topology - // x0 - x14 are the planar angles in 2d - // b0 - b14 are the mesh angles in 3d. - // T0 - T4 are the triangle lambdas - // V0 - V1 interior vertex lambdas - // W0 - W1 interior vertex wheel lambdas - // - // Gradient derivatives: - //0 (2 (-b0 + x0))/b0^2 + T0 + W2 Cos[x0] Sin[x5] Sin[x9] - //1 (2 (-b1 + x1))/b1^2 + T0 - W2 Cos[x1] Sin[x10] Sin[x3] - //2 (2 (-b2 + x2))/b2^2 + T0 + V2 - //3 (2 (-b3 + x3))/b3^2 + T1 - W2 Cos[x3] Sin[x1] Sin[x10] + W3 Cos[x3] Sin[x11] Sin[x12] Sin[x8] - //4 (2 (-b4 + x4))/b4^2 + T1 + V2 - W3 Cos[x4] Sin[x13] Sin[x6] Sin[x9] - //5 (2 (-b5 + x5))/b5^2 + T1 + V3 + W2 Cos[x5] Sin[x0] Sin[x9] - //6 (2 (-b6 + x6))/b6^2 + T2 - W3 Cos[x6] Sin[x13] Sin[x4] Sin[x9] - //7 (2 (-b7 + x7))/b7^2 + T2 + V3 - //8 (2 (-b8 + x8))/b8^2 + T2 + W3 Cos[x8] Sin[x11] Sin[x12] Sin[x3] - //9 (2 (-b09 + x09))/b09^2 + T3 + W2 Cos[x9] Sin[x0] Sin[x5] - W3 Cos[x9] Sin[x13] Sin[x4] Sin[x6] - //10 (2 (-b10 + x10))/b10^2 + T3 + V3 - W2 Cos[x10] Sin[x1] Sin[x3] - //11 (2 (-b11 + x11))/b11^2 + T3 + V2 + W3 Cos[x11] Sin[x12] Sin[x3] Sin[x8] - //12 (2 (-b12 + x12))/b12^2 + T4 + W3 Cos[x12] Sin[x11] Sin[x3] Sin[x8] - //13 (2 (-b13 + x13))/b13^2 + T4 - W3 Cos[x13] Sin[x4] Sin[x6] Sin[x9] - //14 (2 (-b14 + x14))/b14^2 + T4 + V3 - // - //15 x0 + x1 + x2 - pi - //16 x3 + x4 + x5 - pi - //17 x6 + x7 + x8 - pi - //18 x10 + x11 + x9 - pi - //19 x12 + x13 + x14 - pi - // - //20 x11 + x2 + x4 - 2 pi - //21 x10 + x14 + x5 + x7 - 2 pi - // - //22 Sin[x0] Sin[x5] Sin[x9] - Sin[x1] Sin[x10] Sin[x3] - //23 Sin[x11] Sin[x12] Sin[x3] Sin[x8] - Sin[x13] Sin[x4] Sin[x6] Sin[x9] - ndFloat64 CalculateGradientVector () - { - // pre-compute sin cos tables - for (ndInt32 i = 0; i < m_anglesCount; ++i) { - m_sinTable[i] = sin (m_variables[i]); - m_cosTable[i] = cos (m_variables[i]); - } - - ndFloat64 gradientNorm = ndFloat64 (0.0f); - - // calculate gradients due to the difference between a matching edge angle and it projected angle msu be mminimal Wei * (Xei - Bei) ^ e = minimal - for (ndInt32 i = 0; i < m_anglesCount; ++i) { - ndFloat64 gradient = CalculateAngularGradientDerivative (i) + CalculateInteriorVertexGradient (i) + CalculatePlanarityGradient (i); - m_gradients[i] = -gradient; - gradientNorm += gradient * gradient; - } - - // calculate gradient due to the equality that the sum on the internal angle of a triangle must add to 180 degree. (Xt0 + Xt1 + Xt2 - pi) = 0 - for (ndInt32 i = 0; i < m_triangleCount; ++i) { - ndFloat64 gradient = m_variables[i * 3 + 0] + m_variables[i * 3 + 1] + m_variables[i * 3 + 2] - dgABF_PI; - m_gradients[m_anglesCount + i] = -gradient; - gradientNorm += gradient * gradient; - } - - // calculate the gradient due to the equality that the sum of all the angle incident to and interior vertex must be 3060 degree sum (Xvi) - 2 * pi = 0 - ndInt32 mark = m_mesh->IncLRU(); - for (ndInt32 i = 0; i < m_anglesCount; ++i) { - ndEdge* const edge = m_betaEdge[i]; - - if ((edge->m_mark != mark) && GetInteriorVertex(edge) != -1) { - ndInt32 vertexIndex = GetInteriorVertex(edge); - ndFloat64 gradient = - ndFloat64 (2.0f) * dgABF_PI; - - ndEdge* ptr = edge; - do { - ndInt32 index = GetAlphaLandaIndex(ptr); - gradient += m_variables[index]; - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - m_gradients[vertexIndex] = - gradient; - gradientNorm += gradient * gradient; - } - } - - // calculate the gradient due to the equality that the difference of the product of the sin of the angle to the - // incident to an interior vertex must be zero product (sin (Xvi + 1) - product (sin (Xvi - 1) = 0 - mark = m_mesh->IncLRU(); - for (ndInt32 i = 0; i < m_anglesCount; ++i) { - ndEdge* const edge = m_betaEdge[i]; - - ndInt32 vertexIndex = GetInteriorVertex(edge); - if ((edge->m_mark != mark) && (vertexIndex != -1)) { - vertexIndex += m_interiorVertexCount; - ndFloat64 partialProdut0 = ndFloat64 (1.0f); - ndFloat64 partialProdut1 = ndFloat64 (1.0f); - ndEdge* ptr = edge; - do { - ndInt32 index0 = GetAlphaLandaIndex(ptr->m_next); - ndInt32 index1 = GetAlphaLandaIndex(ptr->m_prev); - partialProdut0 *= m_sinTable[index0]; - partialProdut1 *= m_sinTable[index1]; - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - ndFloat64 gradient = partialProdut0 - partialProdut1; - m_gradients[vertexIndex] = - gradient; - gradientNorm += gradient * gradient; - } - } - - return gradientNorm; - } - - // the Hessian matrix is compose of these second partial derivatives - // these derivatives are too complex and make the solver to spend too much time, - // [0][0] 2/b0^2 - W2 Sin[x0] Sin[x5] Sin[x9], 0, 0, 0, 0, W2 Cos[x0] Cos[x5] Sin[x9], 0, 0, 0, W2 Cos[x0] Cos[x9] Sin[x5], 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, Cos[x0] Sin[x5] Sin[x9], 0, - // [0][[1] {0, 2/b1^2 + W2 Sin[x1] Sin[x10] Sin[x3], 0, -W2 Cos[x1] Cos[x3] Sin[x10], 0, 0, 0, 0, 0, 0, -W2 Cos[x1] Cos[x10] Sin[x3], 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, -Cos[x1] Sin[x10] Sin[x3], 0}, - // ... - - // the optimize version of the algorithms assume that the second derivatives are linear, therefore all sine terms are neglected, I will do the same - // [ 0][0-n] 2/b0^2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, Cos[x0] Sin[x5] Sin[x9], 0 - // [ 1][0-n] 0, 2/b1^2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, -Cos[x1] Sin[x10] Sin[x3], 0 - // [ 2][0-n] 0, 0, 2/b2^2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 - // [ 3][0-n] 0, 0, 0, 2/b3^2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -Cos[x3] Sin[x1] Sin[x10], Cos[x3] Sin[x11] Sin[x12] Sin[x8] - // [ 4][0-n] 0, 0, 0, 0, 2/b4^2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -Cos[x4] Sin[x13] Sin[x6] Sin[x9]} - // [ 5][0-n] 0, 0, 0, 0, 0, 2/b5^2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, Cos[x5] Sin[x0] Sin[x9], 0 - // [ 6][0-n] 0, 0, 0, 0, 0, 0, 2/b6^2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -Cos[x6] Sin[x13] Sin[x4] Sin[x9] - // [ 7][0-n] 0, 0, 0, 0, 0, 0, 0, 2/b7^2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0 - // [ 8][0-n] 0, 0, 0, 0, 0, 0, 0, 0, 2/b8^2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, Cos[x8] Sin[x11] Sin[x12] Sin[x3] - // [ 9][0-n] 0, 0, 0, 0, 0, 0, 0, 0, 0, 2/b9^2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, Cos[x9] Sin[x0] Sin[x5], -Cos[x9] Sin[x13] Sin[x4] Sin[x6] - // [10][0-n] 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2/b10^2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, -Cos[x10] Sin[x1] Sin[x3], 0}, - // [11][0-n] 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2/b11^2, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, Cos[x11] Sin[x12] Sin[x3] Sin[x8] - // [12][0-n] 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2/b12^2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, Cos[x12] Sin[x11] Sin[x3] Sin[x8] - // [13][0-n] 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2/b13^2, 0, 0, 0, 0, 0, 1, 0, 0, 0, -Cos[x13] Sin[x4] Sin[x6] Sin[x9] - // [14][0-n] 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2/b14^2, 0, 0, 0, 0, 1, 0, 1, 0, 0 - - // [15][0-n] 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - // [16][0-n] 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - // [17][0-n] 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - // [18][0-n] 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - // [19][0-n] 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 - - // [20][0-n] 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - // [21][0-n] 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 - - // [22][0-n] Cos[x0] Sin[x5] Sin[x9], -Cos[x1] Sin[x10] Sin[x3], 0, -Cos[x3] Sin[x1] Sin[x10], 0, Cos[x5] Sin[x0] Sin[x9], 0, 0, 0, Cos[x9] Sin[x0] Sin[x5], -Cos[x10] Sin[x1] Sin[x3], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - // [23][0-n] 0, 0, 0, Cos[x3] Sin[x11] Sin[x12] Sin[x8], -Cos[x4] Sin[x13] Sin[x6] Sin[x9], 0, -Cos[x6] Sin[x13] Sin[x4] Sin[x9], 0, Cos[x8] Sin[x11] Sin[x12] Sin[x3], -Cos[x9] Sin[x13] Sin[x4] Sin[x6], 0, Cos[x11] Sin[x12] Sin[x3] Sin[x8], Cos[x12] Sin[x11] Sin[x3] Sin[x8], -Cos[x13] Sin[x4] Sin[x6] Sin[x9], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - void MatrixTimeVector (ndFloat64* const out, const ndFloat64* const v) const - { - for (ndInt32 i = 0; i < m_interiorVertexCount; ++i) { - out[i + m_anglesCount + m_triangleCount] = ndFloat64 (0.0f); - out[i + m_anglesCount + m_triangleCount + m_interiorVertexCount] = ndFloat64 (0.0f); - } - - for (ndInt32 i = 0; i < m_anglesCount; ++i) { - out[i] = m_weight[i] * v[i]; - - ndEdge* const edge = m_betaEdge[i]; - ndInt32 vertexIndex = GetInteriorVertex(edge); - if (vertexIndex >= 0) { - out[i] += v[vertexIndex]; - out[vertexIndex] += v[i]; - } - } - - for (ndInt32 i = 0; i < m_triangleCount; ++i) { - ndInt32 j = i * 3; - out[j + 0] += v[i + m_anglesCount]; - out[j + 1] += v[i + m_anglesCount]; - out[j + 2] += v[i + m_anglesCount]; - out[i + m_anglesCount] = v[j + 0] + v[j + 1] + v[j + 2]; - } - - for (ndInt32 i = 0; i < m_anglesCount; ++i) { - { - ndEdge* const edge = m_betaEdge[i]->m_prev; - ndInt32 vertexIndex = GetInteriorVertex(edge); - if (vertexIndex >= 0) { - ndInt32 index = GetAlphaLandaIndex(edge->m_next); - ndFloat64 product = m_cosTable[index]; - ndEdge* ptr = edge->m_twin->m_next; - do { - ndInt32 m = GetAlphaLandaIndex(ptr->m_next); - product *= m_sinTable[m]; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - out[i] += v[vertexIndex + m_interiorVertexCount] * product; - out[vertexIndex + m_interiorVertexCount] += product * v[i]; - } - } - - { - ndEdge* const edge = m_betaEdge[i]->m_next; - ndInt32 vertexIndex = GetInteriorVertex(edge); - if (vertexIndex >= 0) { - ndInt32 index = GetAlphaLandaIndex(edge->m_prev); - ndFloat64 product = m_cosTable[index]; - ndEdge* ptr = edge->m_twin->m_next; - do { - ndInt32 m = GetAlphaLandaIndex(ptr->m_prev); - product *= m_sinTable[m]; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - out[i] -= v[vertexIndex + m_interiorVertexCount] * product; - out[vertexIndex + m_interiorVertexCount] -= product * v[i]; - } - } - } - } - - void InversePrecoditionerTimeVector (ndFloat64* const out, const ndFloat64* const v) const - { - for (ndInt32 i = 0; i < m_anglesCount; ++i) { - out[i] = v[i] / m_weight[i]; - } - for (ndInt32 i = 0; i < m_triangleCount; ++i) { - out[i + m_anglesCount] = v[i + m_anglesCount]; - } - - for (ndInt32 i = 0; i < m_interiorVertexCount; ++i) { - out[i + m_anglesCount + m_triangleCount] = v[i + m_anglesCount + m_triangleCount]; - out[i + m_anglesCount + m_triangleCount + m_interiorVertexCount] = v[i + m_anglesCount + m_triangleCount + m_interiorVertexCount]; - } - - m_progressNum ++; - if (m_progressReportCallback) { - if ((m_progressNum & 127) == 127) { - m_continueExecution = m_progressReportCallback (ndMin (ndFloat32 (m_progressNum) / m_progressDen, ndFloat32 (1.0f)), m_progressReportUserData); - } - } - } - - void LagrangeOptimization() - { - memset (m_deltaVariables, 0, m_totalVariablesCount * sizeof (ndFloat64)); - memset (&m_variables[m_anglesCount], 0, m_triangleCount * sizeof (ndFloat64)); - - for (ndInt32 i = 0; i < m_interiorVertexCount; ++i) { - m_variables[i + m_anglesCount + m_triangleCount] = ndFloat32 (1.0f); - m_variables[i + m_anglesCount + m_triangleCount + m_interiorVertexCount] = ndFloat32 (1.0f); - } - - m_progressNum = 0; - m_continueExecution = true; - -/* - ndStack r0(2 * m_mesh->GetVertexCount()); - ndStack z0(2 * m_mesh->GetVertexCount()); - ndStack p0(2 * m_mesh->GetVertexCount()); - ndStack q0(2 * m_mesh->GetVertexCount()); - SetBuffers(&r0[0], &z0[0], &p0[0], &q0[0]); - ndFloat64 gradientNorm = CalculateGradientVector (); - for (ndInt32 iter = 0; (iter < dgABF_MAX_ITERATIONS) && (gradientNorm > dgABF_TOL2) && m_continueExecution; iter++) { - m_progressDen = m_progressNum + m_totalVariablesCount; - Solve(m_totalVariablesCount, dgABF_LINEAR_SOLVER_TOL, m_deltaVariables, m_gradients); - for (ndInt32 i = 0; i < m_totalVariablesCount; ++i) { - m_variables[i] += m_deltaVariables[i]; - } - gradientNorm = CalculateGradientVector (); - } - SetBuffers(nullptr, nullptr, nullptr, nullptr); -*/ - -#ifdef _DEBUG - // calculate gradient due to the equality that the sum on the internal angle of a triangle must add to 180 degree. (Xt0 + Xt1 + Xt2 - pi) = 0 -// for (ndInt32 i = 0; i < m_triangleCount; ++i) { -// ndFloat64 gradient = m_variables[i * 3 + 0] + m_variables[i * 3 + 1] + m_variables[i * 3 + 2] - dgABF_PI; -// ndAssert (fabs (gradient) < ndFloat64 (1.0e-2f)); -// } -#endif - } - - ndMeshEffect* m_mesh; - ndEdge** m_betaEdge; - ndInt32* m_interiorIndirectMap; - - ndFloat64* m_beta; - ndFloat64* m_weight; - ndFloat64* m_sinTable; - ndFloat64* m_cosTable; - ndFloat64* m_variables; - ndFloat64* m_gradients; - ndFloat64* m_deltaVariables; - - ndInt32 m_anglesCount; - ndInt32 m_triangleCount; - ndInt32 m_interiorVertexCount; - ndInt32 m_totalVariablesCount; - - void* m_progressReportUserData; - dgReportProgress m_progressReportCallback; - mutable ndInt32 m_progressNum; - mutable ndInt32 m_progressDen; - mutable bool m_continueExecution; -}; - - -/* -void ndMeshEffect::ClearAttributeArray () -{ - ndAssert(0); - - ndStackattribArray (m_pointCount); - - memset (&attribArray[0], 0, m_pointCount * sizeof (dgVertexAtribute)); - ndInt32 mark = IncLRU(); - dPolyhedra::Iterator iter (*this); - for(iter.Begin(); iter; iter ++){ - ndEdge* const edge = &(*iter); - if (edge->m_mark < mark){ - ndEdge* ptr = edge; - - ndInt32 index = ptr->m_incidentVertex; - dgVertexAtribute& attrib = attribArray[index]; - attrib.m_vertex = m_points[index]; - do { - ptr->m_mark = mark; - ptr->m_userData = index; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - - } - } - ApplyAttributeArray (&attribArray[0], m_pointCount); -} -*/ - - - -void ndMeshEffect::CylindricalMapping (ndInt32 cylinderMaterial, ndInt32 capMaterial, const ndMatrix& uvAligment) -{ - ndBigVector origin (GetOrigin()); - ndStack buffer(m_points.m_vertex.m_count); - ndBigVector pMin(ndFloat64(1.0e10f), ndFloat64(1.0e10f), ndFloat64(1.0e10f), ndFloat64(0.0f)); - ndBigVector pMax(ndFloat64(-1.0e10f), ndFloat64(-1.0e10f), ndFloat64(-1.0e10f), ndFloat64(0.0f)); - - for (ndInt32 i = 0; i < m_points.m_vertex.m_count; ++i) { - buffer[i] = uvAligment.RotateVector (m_points.m_vertex[i] - origin); - const ndBigVector& tmp = buffer[i]; - pMin.m_x = ndMin (pMin.m_x, tmp.m_x); - pMax.m_x = ndMax (pMax.m_x, tmp.m_x); - pMin.m_y = ndMin (pMin.m_y, tmp.m_y); - pMax.m_y = ndMax (pMax.m_y, tmp.m_y); - pMin.m_z = ndMin (pMin.m_z, tmp.m_z); - pMax.m_z = ndMax (pMax.m_z, tmp.m_z); - } - - ndStackcylinder (m_points.m_vertex.m_count); - ndBigVector scale (ndFloat64 (1.0f)/ (pMax.m_x - pMin.m_x), ndFloat64 (1.0f)/ (pMax.m_y - pMin.m_y), ndFloat64 (1.0f)/ (pMax.m_z - pMin.m_z), ndFloat64 (0.0f)); - for (ndInt32 i = 0; i < m_points.m_vertex.m_count; ++i) { - ndBigVector point (buffer[i]); - ndFloat64 u = (point.m_x - pMin.m_x) * scale.m_x; - - ndAssert(point.m_w == ndFloat32(0.0f)); - ndAssert(point.DotProduct(point).GetScalar() > ndFloat32 (0.0f)); - point = point.Normalize(); - ndFloat64 v = ndAtan2 (point.m_y, point.m_z); - - v = v + ndPi; - cylinder[i].m_x = u; - cylinder[i].m_y = v; - } - - UnpackAttibuteData(); - m_attrib.m_uv0Channel.Reserve(m_attrib.m_pointChannel.m_count); - m_attrib.m_materialChannel.Reserve(m_attrib.m_pointChannel.m_count); - - ndPolyhedra::Iterator iter (*this); - for(iter.Begin(); iter; iter ++){ - ndEdge* const edge = &(*iter); - ndAttibutFormat::ndUV uv; - uv.m_u = ndFloat32(cylinder[edge->m_incidentVertex].m_x); - uv.m_v = ndFloat32(cylinder[edge->m_incidentVertex].m_y); - m_attrib.m_uv0Channel[ndInt32(edge->m_userData)] = uv; - m_attrib.m_materialChannel[ndInt32(edge->m_userData)] = cylinderMaterial; - } - - ndInt32 mark = IncLRU (); - for(iter.Begin(); iter; iter ++){ - ndEdge* const edge = &(*iter); - if ((edge->m_incidentFace > 0) && (edge->m_mark != mark)) { - ndAttibutFormat::ndUV uvRef(m_attrib.m_uv0Channel[ndInt32(edge->m_userData)]); - ndFloat32 UVrefSin = ndSin(uvRef.m_v); - ndFloat32 UVrefCos = ndCos(uvRef.m_v); - ndEdge* ptr = edge; - do { - ptr->m_mark = mark; - ndAttibutFormat::ndUV uv(m_attrib.m_uv0Channel[ndInt32(ptr->m_userData)]); - ndFloat32 sinAngle = UVrefCos * ndSin(uv.m_v) - UVrefSin * ndCos(uv.m_v); - ndFloat32 cosAngle = UVrefCos * ndCos(uv.m_v) + UVrefSin * ndSin(uv.m_v); - ndFloat32 deltaAngle = ndAtan2(sinAngle, cosAngle); - uv.m_v = (uvRef.m_v + deltaAngle) / dPi2; - m_attrib.m_uv0Channel[ndInt32(ptr->m_userData)] = uv; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - - // apply cap mapping - mark = IncLRU (); - for(iter.Begin(); iter; iter ++){ - ndEdge* const edge = &(*iter); - if ((edge->m_incidentFace > 0) && (edge->m_mark != mark)) { - ndVector p0(buffer[edge->m_incidentVertex]); - ndVector p1(buffer[edge->m_next->m_incidentVertex]); - - ndVector e1(p1 - p0); - ndBigVector normal(ndFloat32(0.0f)); - for (ndEdge* ptr = edge->m_next; ptr != edge; ptr = ptr->m_next) { - ndVector p2(buffer[ptr->m_next->m_incidentVertex]); - ndBigVector e2(p2 - p0); - normal += e1.CrossProduct(e2); - e1 = e2; - } - normal = normal.Normalize(); - if (ndAbs(normal.m_x) > ndFloat32 (0.99f)) { - ndEdge* ptr = edge; - do { - ndAttibutFormat::ndUV uv; - ndVector p(buffer[ptr->m_incidentVertex]); - uv.m_u = ndFloat32((p.m_y - pMin.m_y) * scale.m_y); - uv.m_v = ndFloat32((p.m_z - pMin.m_z) * scale.m_z); - m_attrib.m_uv0Channel[ndInt32(ptr->m_userData)] = uv; - m_attrib.m_materialChannel[ndInt32(ptr->m_userData)] = capMaterial; - ptr = ptr->m_next; - } while (ptr != edge); - } - - ndEdge* ptr = edge; - do { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - - } - } - PackAttibuteData(); -} - -void ndMeshEffect::AngleBaseFlatteningMapping (ndInt32 material, dgReportProgress progressReportCallback, void* const userData) -{ - dgSetPrecisionDouble presicion; - - ndMeshEffect tmp (*this); - - ndBigVector minBox; - ndBigVector maxBox; - tmp.CalculateAABB(minBox, maxBox); - - ndBigVector size (maxBox - minBox); - ndFloat32 scale = ndFloat32 (1.0 / ndMax (size.m_x, size.m_y, size.m_z)); - - ndMatrix matrix (ndGetIdentityMatrix()); - matrix[0][0] = scale; - matrix[1][1] = scale; - matrix[2][2] = scale; - tmp.ApplyTransform(matrix); - - dgAngleBasedFlatteningMapping angleBadedFlattening (&tmp, material, progressReportCallback, userData); -} - -#endif - - -void ndMeshEffect::CalculateNormals(ndFloat64 angleInRadians) -{ - ndEdge* edgeBuffer[256]; - ndBigVector faceNormal[256]; - - UnpackAttibuteData(); - m_attrib.m_normalChannel.Resize(m_attrib.m_pointChannel.GetCount()); - m_attrib.m_normalChannel.SetCount(m_attrib.m_pointChannel.GetCount()); - m_attrib.m_normalChannel.m_isValid = true; - - ndInt32 mark = IncLRU(); - ndPolyhedra::Iterator iter(*this); - ndFloat32 smoothValue = ndCos(angleInRadians); - - ndTree normalsMap; - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_mark < mark) && (edge->m_incidentFace > 0)) - { - ndInt32 edgeIndex = 0; - normalsMap.RemoveAll(); - ndEdge* edgePtr = edge; - do - { - ndVector normal(FaceNormal(edgePtr, &m_points.m_vertex[0].m_x, sizeof(ndBigVector))); - ndAssert(normal.m_w == ndFloat32(0.0f)); - normal = normal.Scale(ndFloat32(1.0f) / ndFloat32(sqrt(normal.DotProduct(normal).GetScalar()) + ndFloat32(1.0e-16f))); - faceNormal[edgeIndex] = normal; - normalsMap.Insert(edgeIndex, edgePtr); - edgeIndex++; - edgePtr = edgePtr->m_twin->m_next; - } while (edgePtr != edge); - - ndEdge* startEdge = edge; - ndVector normal0(faceNormal[normalsMap.Find(startEdge)->GetInfo()]); - for (ndEdge* ptr = edge->m_prev->m_twin; (ptr->m_mark != mark) && (ptr != edge) && (ptr->m_incidentFace > 0); ptr = ptr->m_prev->m_twin) - { - const ndVector& normal1(faceNormal[normalsMap.Find(ptr)->GetInfo()]); - ndAssert(normal0.m_w == ndFloat32(0.0f)); - ndFloat32 dot = normal0.DotProduct(normal1).GetScalar(); - if (dot < smoothValue) - { - break; - } - startEdge = ptr; - normal0 = normal1; - } - - ndInt32 attribCount = 1; - edgeBuffer[0] = startEdge; - normal0 = faceNormal[normalsMap.Find(startEdge)->GetInfo()]; - ndVector normal(normal0); - for (ndEdge* ptr = startEdge->m_twin->m_next; (ptr->m_mark != mark) && (ptr != startEdge) && (ptr->m_incidentFace > 0); ptr = ptr->m_twin->m_next) - { - const ndVector& normal1(faceNormal[normalsMap.Find(ptr)->GetInfo()]); - ndAssert(normal0.m_w == ndFloat32(0.0f)); - ndFloat32 dot = normal0.DotProduct(normal1).GetScalar(); - if (dot < smoothValue) - { - break; - } - edgeBuffer[attribCount] = ptr; - attribCount++; - normal += normal1; - normal0 = normal1; - } - - ndAssert(normal.m_w == ndFloat32(0.0f)); - normal = normal.Scale(ndFloat32(1.0f) / ndFloat32(sqrt(normal.DotProduct(normal).GetScalar()) + ndFloat32(1.0e-16f))); - ndNormal n(normal.m_x, normal.m_y, normal.m_z); - for (ndInt32 i = 0; i < attribCount; ++i) - { - edgeBuffer[i]->m_mark = mark; - ndInt32 index = ndInt32(edgeBuffer[i]->m_userData); - m_attrib.m_normalChannel[index] = n; - } - } - } - PackAttibuteData(); -} - -ndBigVector ndMeshEffect::GetOrigin()const -{ - ndBigVector origin(ndFloat64(0.0f), ndFloat64(0.0f), ndFloat64(0.0f), ndFloat64(0.0f)); - for (ndInt32 i = 0; i < m_points.m_vertex.GetCount(); ++i) - { - origin += m_points.m_vertex[i]; - } - return origin.Scale(ndFloat64(1.0f) / ndInt32(m_points.m_vertex.GetCount())); -} - -void ndMeshEffect::BoxMapping(ndInt32 front, ndInt32 side, ndInt32 top, const ndMatrix& textureMatrix) -{ - ndBigVector origin(GetOrigin()); - ndStack buffer(ndInt32(m_points.m_vertex.GetCount())); - ndBigVector pMin(ndFloat64(1.0e10f), ndFloat64(1.0e10f), ndFloat64(1.0e10f), ndFloat64(0.0f)); - ndBigVector pMax(ndFloat64(-1.0e10f), ndFloat64(-1.0e10f), ndFloat64(-1.0e10f), ndFloat64(0.0f)); - - for (ndInt32 i = 0; i < m_points.m_vertex.GetCount(); ++i) - { - buffer[i] = textureMatrix.RotateVector(m_points.m_vertex[i] - origin); - const ndBigVector& tmp = buffer[i]; - pMin.m_x = ndMin(pMin.m_x, tmp.m_x); - pMax.m_x = ndMax(pMax.m_x, tmp.m_x); - pMin.m_y = ndMin(pMin.m_y, tmp.m_y); - pMax.m_y = ndMax(pMax.m_y, tmp.m_y); - pMin.m_z = ndMin(pMin.m_z, tmp.m_z); - pMax.m_z = ndMax(pMax.m_z, tmp.m_z); - } - ndInt32 materialArray[3]; - - ndBigVector dist(pMax); - dist[0] = ndMax(ndFloat64(1.0e-3f), dist[0]); - dist[1] = ndMax(ndFloat64(1.0e-3f), dist[1]); - dist[2] = ndMax(ndFloat64(1.0e-3f), dist[2]); - ndBigVector scale(ndFloat64(0.5f) / dist[0], ndFloat64(0.5f) / dist[1], ndFloat64(0.5f) / dist[2], ndFloat64(0.0f)); - - UnpackAttibuteData(); - m_attrib.m_uv0Channel.SetCount(m_attrib.m_pointChannel.GetCount()); - m_attrib.m_materialChannel.SetCount(m_attrib.m_pointChannel.GetCount()); - m_attrib.m_uv0Channel.m_isValid = true; - m_attrib.m_materialChannel.m_isValid = true; - - materialArray[0] = front; - materialArray[1] = side; - materialArray[2] = top; - - ndInt32 mark = IncLRU(); - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_mark < mark) && (edge->m_incidentFace > 0)) - { - const ndBigVector& p0 = buffer[edge->m_incidentVertex]; - const ndBigVector& p1 = buffer[edge->m_next->m_incidentVertex]; - const ndBigVector& p2 = buffer[edge->m_prev->m_incidentVertex]; - - edge->m_mark = mark; - edge->m_next->m_mark = mark; - edge->m_prev->m_mark = mark; - - ndBigVector e0(p1 - p0); - ndBigVector e1(p2 - p0); - ndBigVector n(e0.CrossProduct(e1)); - - ndInt32 index = 0; - ndFloat64 maxProjection = ndFloat32(0.0f); - - for (ndInt32 i = 0; i < 3; ++i) - { - ndFloat64 proj = fabs(n[i]); - if (proj > maxProjection) - { - index = i; - maxProjection = proj; - } - } - - ndInt32 u = (index + 1) % 3; - ndInt32 v = (u + 1) % 3; - if (index == 1) - { - ndSwap(u, v); - } - ndEdge* ptr = edge; - do - { - ndVector p(scale * buffer[ptr->m_incidentVertex] - ndFloat32(0.5f)); - ndUV uv(p[u], p[v]); - m_attrib.m_uv0Channel[ndInt32(ptr->m_userData)] = uv; - m_attrib.m_materialChannel[ndInt32(ptr->m_userData)] = materialArray[index]; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - PackAttibuteData(); -} - -void ndMeshEffect::UniformBoxMapping(ndInt32 material, const ndMatrix& textureMatrix) -{ - UnpackAttibuteData(); - - m_attrib.m_uv0Channel.Resize(m_attrib.m_pointChannel.GetCount()); - m_attrib.m_uv0Channel.SetCount(m_attrib.m_pointChannel.GetCount()); - - m_attrib.m_materialChannel.Resize(m_attrib.m_pointChannel.GetCount()); - m_attrib.m_materialChannel.SetCount(m_attrib.m_pointChannel.GetCount()); - - m_attrib.m_uv0Channel.m_isValid = true; - m_attrib.m_materialChannel.m_isValid = true; - - ndInt32 mark = IncLRU(); - for (ndInt32 i = 0; i < 3; ++i) - { - ndMatrix rotationMatrix(ndGetIdentityMatrix()); - if (i == 1) - { - rotationMatrix = ndYawMatrix(ndFloat32(90.0f * ndDegreeToRad)); - } - else if (i == 2) - { - rotationMatrix = ndPitchMatrix(ndFloat32(90.0f * ndDegreeToRad)); - } - - ndPolyhedra::Iterator iter(*this); - - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_mark < mark) && (edge->m_incidentFace > 0)) - { - ndBigVector n(FaceNormal(edge, &m_points.m_vertex[0].m_x, sizeof(ndBigVector))); - ndVector normal(rotationMatrix.RotateVector(ndVector(n.Normalize()))); - normal.m_x = ndAbs(normal.m_x); - normal.m_y = ndAbs(normal.m_y); - normal.m_z = ndAbs(normal.m_z); - if ((normal.m_z >= (normal.m_x - ndFloat32(1.0e-4f))) && (normal.m_z >= (normal.m_y - ndFloat32(1.0e-4f)))) - { - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - ndVector point(rotationMatrix.RotateVector(m_points.m_vertex[ptr->m_incidentVertex])); - ndVector p(textureMatrix.TransformVector(point)); - ndUV uv(p.m_x, p.m_y); - m_attrib.m_uv0Channel[ndInt32(ptr->m_userData)] = uv; - m_attrib.m_materialChannel[ndInt32(ptr->m_userData)] = material; - - ptr = ptr->m_next; - } while (ptr != edge); - } - } - } - } - - PackAttibuteData(); -} - -void ndMeshEffect::SphericalMapping(ndInt32 material, const ndMatrix& textureMatrix) -{ - ndBigVector origin(GetOrigin()); - ndStacksphere(ndInt32(m_points.m_vertex.GetCount())); - for (ndInt32 i = 0; i < m_points.m_vertex.GetCount(); ++i) - { - ndBigVector geoPoint(m_points.m_vertex[i] - origin); - ndAssert(geoPoint.m_w == ndFloat32(0.0f)); - ndVector point(textureMatrix.RotateVector(geoPoint.Normalize())); - point.m_x = ndClamp(point.m_x, ndFloat32(-1.0f + 1.0e-6f), ndFloat32(1.0f - 1.0e-6f)); - - ndFloat64 v = ndClamp(ndAsin(point.m_x) / ndPi + ndFloat64(0.5f), ndFloat64(0.0f), ndFloat64(1.0f)); - ndFloat64 u = ndClamp(ndAtan2(point.m_y, point.m_z) / (ndFloat32(2.0f) * ndPi) + ndFloat64(0.5f), ndFloat64(0.0f), ndFloat64(1.0f)); - sphere[i].m_x = u; - sphere[i].m_y = v; - } - - UnpackAttibuteData(); - - m_attrib.m_uv0Channel.Resize(m_attrib.m_pointChannel.GetCount()); - m_attrib.m_uv0Channel.SetCount(m_attrib.m_pointChannel.GetCount()); - - m_attrib.m_materialChannel.Resize(m_attrib.m_pointChannel.GetCount()); - m_attrib.m_materialChannel.SetCount(m_attrib.m_pointChannel.GetCount()); - - m_attrib.m_uv0Channel.m_isValid = true; - m_attrib.m_materialChannel.m_isValid = true; - - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - ndUV uv(ndFloat32(sphere[edge->m_incidentVertex].m_x), ndFloat32(sphere[edge->m_incidentVertex].m_y)); - m_attrib.m_uv0Channel[ndInt32(edge->m_userData)] = uv; - m_attrib.m_materialChannel[ndInt32(edge->m_userData)] = material; - } - - ndInt32 mark = IncLRU(); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_incidentFace > 0) && (edge->m_mark != mark)) - { - ndUV uvRef(m_attrib.m_uv0Channel[ndInt32(edge->m_userData)]); - ndFloat32 angle0 = uvRef.m_u * ndPi * ndFloat32(2.0f); - ndFloat32 UVrefSin = ndSin(angle0); - ndFloat32 UVrefCos = ndCos(angle0); - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - ndUV uv(m_attrib.m_uv0Channel[ndInt32(ptr->m_userData)]); - ndFloat32 angle1 = uv.m_u * ndPi * ndFloat32(2.0f); - ndFloat32 sinAngle = ndSin(angle1) * UVrefCos - ndCos(angle1) * UVrefSin; - ndFloat32 cosAngle = ndCos(angle1) * UVrefCos + ndSin(angle1) * UVrefSin; - ndFloat32 deltaAngle = ndAtan2(sinAngle, cosAngle); - uv.m_u = ndReal (uvRef.m_u + deltaAngle / (ndFloat32 (2.0f) * ndPi)); - m_attrib.m_uv0Channel[ndInt32(ptr->m_userData)] = uv; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - - PackAttibuteData(); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndPolygonMeshDesc.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndPolygonMeshDesc.cpp deleted file mode 100644 index 45dc0a250d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndPolygonMeshDesc.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndScene.h" -#include "ndContact.h" -#include "ndContactSolver.h" -#include "ndBodyKinematic.h" -#include "ndShapeInstance.h" -#include "ndPolygonMeshDesc.h" - -//ndPolygonMeshDesc::ndPolygonMeshDesc() -// :ndFastAabb() -// ,m_boxDistanceTravelInMeshSpace(ndVector::m_zero) -// ,m_maxT(ndFloat32(1.0f)) -// ,m_threadId(0) -// ,m_ownTempBuffers(false) -// ,m_doContinueCollisionTest(false) -//{ -//} - -ndPolygonMeshDesc::ndPolygonMeshDesc(ndContactSolver& proxy, bool ccdMode) - :ndFastAabb() - ,m_boxDistanceTravelInMeshSpace(ndVector::m_zero) - ,m_vertexStrideInBytes(0) - ,m_skinMargin(proxy.m_skinMargin) - ,m_convexInstance(&proxy.m_instance0) - ,m_polySoupInstance(&proxy.m_instance1) - ,m_vertex(nullptr) - ,m_staticMeshQuery(nullptr) - ,m_proceduralStaticMeshFaceQuery(nullptr) - ,m_maxT(ndFloat32(1.0f)) - ,m_threadId(proxy.m_threadId) - //,m_ownTempBuffers(false) - ,m_doContinueCollisionTest(ccdMode) -{ - ndAssert(proxy.m_notification->m_scene); - //ndScene* const scene = proxy.m_contact->GetBody0()->GetScene(); - //if (scene) - //{ - // m_staticMeshQuery = &scene->m_staticMeshQuery[proxy.m_threadId]; - // m_proceduralStaticMeshFaceQuery = &scene->m_proceduralStaticMeshQuery[proxy.m_threadId]; - //} - //else - //{ - // m_ownTempBuffers = true; - // m_staticMeshQuery = new ndStaticMeshFaceQuery; - // m_proceduralStaticMeshFaceQuery = new ndProceduralStaticMeshFaceQuery; - //} - - ndScene* const scene = proxy.m_notification->m_scene; - m_staticMeshQuery = &scene->m_staticMeshQuery[proxy.m_threadId]; - m_proceduralStaticMeshFaceQuery = &scene->m_proceduralStaticMeshQuery[proxy.m_threadId]; - Init(); -} - -ndPolygonMeshDesc::~ndPolygonMeshDesc() -{ - //if (m_ownTempBuffers) - //{ - // delete m_proceduralStaticMeshFaceQuery; - // delete m_staticMeshQuery; - //} -} - -void ndPolygonMeshDesc::Init() -{ - const ndMatrix& hullMatrix = m_convexInstance->GetGlobalMatrix(); - const ndMatrix& soupMatrix = m_polySoupInstance->GetGlobalMatrix(); - - ndMatrix& matrix = *this; - matrix = hullMatrix * soupMatrix.OrthoInverse(); - ndMatrix convexMatrix(ndGetIdentityMatrix()); - - m_staticMeshQuery->Reset(); - m_proceduralStaticMeshFaceQuery->Reset(); - switch (m_polySoupInstance->GetScaleType()) - { - case ndShapeInstance::m_unit: - { - break; - } - - case ndShapeInstance::m_uniform: - { - const ndVector& invScale = m_polySoupInstance->GetInvScale(); - convexMatrix[0][0] = invScale.GetScalar(); - convexMatrix[1][1] = invScale.GetScalar(); - convexMatrix[2][2] = invScale.GetScalar(); - matrix.m_posit = matrix.m_posit * (invScale | ndVector::m_wOne); - break; - } - - case ndShapeInstance::m_nonUniform: - { - const ndVector& invScale = m_polySoupInstance->GetInvScale(); - ndMatrix tmp(matrix[0] * invScale, matrix[1] * invScale, matrix[2] * invScale, ndVector::m_wOne); - convexMatrix = tmp * matrix.OrthoInverse(); - convexMatrix.m_posit = ndVector::m_wOne; - matrix.m_posit = matrix.m_posit * (invScale | ndVector::m_wOne); - break; - } - - case ndShapeInstance::m_global: - default: - { - ndAssert(0); - } - } - - ndMatrix fullMatrix(convexMatrix * matrix); - m_convexInstance->CalculateAabb(fullMatrix, m_p0, m_p1); - - ndVector p0; - ndVector p1; - SetTransposeAbsMatrix(matrix); - m_convexInstance->CalculateAabb(convexMatrix, p0, p1); - m_size = ndVector::m_half * (p1 - p0); - m_posit = matrix.TransformVector(ndVector::m_half * (p1 + p0)); - ndAssert(m_posit.m_w == ndFloat32(1.0f)); -} - -ndInt32 ndPolygonMeshDesc::GetFaceIndexCount(ndInt32 indexCount) const -{ - return indexCount * 2 + 3; -} - -const ndInt32* ndPolygonMeshDesc::GetAdjacentFaceEdgeNormalArray(const ndInt32* const faceIndexArray, ndInt32 indexCount) const -{ - return &faceIndexArray[indexCount + 2]; -} - -ndInt32 ndPolygonMeshDesc::GetNormalIndex(const ndInt32* const faceIndexArray, ndInt32 indexCount) const -{ - return faceIndexArray[indexCount + 1]; -} - -ndInt32 ndPolygonMeshDesc::GetFaceId(const ndInt32* const faceIndexArray, ndInt32 indexCount) const -{ - return faceIndexArray[indexCount]; -} - -ndFloat32 ndPolygonMeshDesc::GetFaceSize(const ndInt32* const faceIndexArray, ndInt32 indexCount) const -{ - ndInt32 size = faceIndexArray[indexCount * 2 + 2]; - ndAssert(size >= 1); - return D_FACE_CLIP_DIAGONAL_SCALE * ndFloat32(size); -} - -ndFloat32 ndPolygonMeshDesc::GetSeparetionDistance() const -{ - return m_separationDistance[0] * m_polySoupInstance->GetScale().GetScalar(); -} - -void ndPolygonMeshDesc::SetDistanceTravel(const ndVector& distanceInGlobalSpace) -{ - const ndMatrix& soupMatrix = m_polySoupInstance->GetGlobalMatrix(); - m_boxDistanceTravelInMeshSpace = m_polySoupInstance->GetInvScale() * soupMatrix.UnrotateVector(distanceInGlobalSpace * m_convexInstance->GetInvScale()); - if (m_boxDistanceTravelInMeshSpace.DotProduct(m_boxDistanceTravelInMeshSpace).GetScalar() < ndFloat32(1.0e-2f)) - { - m_doContinueCollisionTest = false; - } -} - -void ndPolygonMeshDesc::SortFaceArray() -{ - ndPolygonMeshDesc::ndStaticMeshFaceQuery& query = *m_staticMeshQuery; - ndInt32 stride = 8; - if (query.m_faceIndexCount.GetCount() >= 8) - { - ndInt32 stack[256][2]; - - stack[0][0] = 0; - stack[0][1] = ndInt32(query.m_faceIndexCount.GetCount() - 1); - ndInt32 stackIndex = 1; - while (stackIndex) - { - stackIndex--; - ndInt32 lo = stack[stackIndex][0]; - ndInt32 hi = stack[stackIndex][1]; - if ((hi - lo) > stride) - { - ndInt32 i = lo; - ndInt32 j = hi; - ndFloat32 dist = query.m_hitDistance[(lo + hi) >> 1]; - do - { - while (query.m_hitDistance[i] < dist) i++; - while (query.m_hitDistance[j] > dist) j--; - - if (i <= j) - { - ndSwap(query.m_hitDistance[i], query.m_hitDistance[j]); - ndSwap(query.m_faceIndexStart[i], query.m_faceIndexStart[j]); - ndSwap(query.m_faceIndexCount[i], query.m_faceIndexCount[j]); - i++; - j--; - } - } while (i <= j); - - if (i < hi) - { - stack[stackIndex][0] = i; - stack[stackIndex][1] = hi; - stackIndex++; - } - if (lo < j) { - stack[stackIndex][0] = lo; - stack[stackIndex][1] = j; - stackIndex++; - } - ndAssert(stackIndex < ndInt32(sizeof(stack) / (2 * sizeof(stack[0][0])))); - } - } - } - - stride = stride * 2; - if (query.m_faceIndexCount.GetCount() < stride) - { - stride = ndInt32(query.m_faceIndexCount.GetCount()); - } - for (ndInt32 i = 1; i < stride; ++i) - { - if (query.m_hitDistance[i] < query.m_hitDistance[0]) - { - ndSwap(query.m_hitDistance[i], query.m_hitDistance[0]); - ndSwap(query.m_faceIndexStart[i], query.m_faceIndexStart[0]); - ndSwap(query.m_faceIndexCount[i], query.m_faceIndexCount[0]); - } - } - - for (ndInt32 i = 1; i < query.m_faceIndexCount.GetCount(); ++i) - { - ndInt32 j = i; - ndInt32 ptr = query.m_faceIndexStart[i]; - ndInt32 count = query.m_faceIndexCount[i]; - ndFloat32 dist = query.m_hitDistance[i]; - for (; dist < query.m_hitDistance[j - 1]; j--) - { - ndAssert(j > 0); - query.m_hitDistance[j] = query.m_hitDistance[j - 1]; - query.m_faceIndexStart[j] = query.m_faceIndexStart[j - 1]; - query.m_faceIndexCount[j] = query.m_faceIndexCount[j - 1]; - } - query.m_hitDistance[j] = dist; - query.m_faceIndexStart[j] = ptr; - query.m_faceIndexCount[j] = count; - } - - #ifdef _DEBUG - for (ndInt32 i = 0; i < query.m_faceIndexCount.GetCount() - 1; ++i) - { - ndAssert(query.m_hitDistance[i] <= query.m_hitDistance[i + 1]); - } - #endif -} - -//ndPolygonMeshLocalDesc::ndPolygonMeshLocalDesc(ndContactSolver& proxy, bool ccdMode) -// :ndPolygonMeshDesc(proxy, ccdMode) -// ,m_localStaticMeshQuery() -// ,m_localProceduralStaticMeshQuery() -//{ -// m_vertex = nullptr; -// m_vertexStrideInBytes = 0; -// m_skinMargin = proxy.m_skinMargin; -// m_convexInstance = &proxy.m_instance0; -// m_polySoupInstance = &proxy.m_instance1; -// -// m_ownTempBuffers = false; -// m_doContinueCollisionTest = ccdMode; -// -// m_staticMeshQuery = &m_localStaticMeshQuery; -// m_proceduralStaticMeshFaceQuery = &m_localProceduralStaticMeshQuery; -// Init(); -//} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndPolygonMeshDesc.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndPolygonMeshDesc.h deleted file mode 100644 index 7de6c1062f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndPolygonMeshDesc.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_POLOGON_MESH_DESC_H__ -#define __ND_POLOGON_MESH_DESC_H__ - -#include "ndCollisionStdafx.h" -#include "ndShape.h" - -class ndBodyKinematic; -class ndShapeInstance; -class ndContactSolver; -class ndShapeStaticMesh; - -D_MSV_NEWTON_ALIGN_32 -class ndPolygonMeshDesc: public ndFastAabb -{ - public: - class ndStaticMeshFaceQuery - { - public: - ndStaticMeshFaceQuery() - { - m_hitDistance.Resize(256); - m_faceIndexCount.Resize(256); - m_faceIndexStart.Resize(256); - m_faceVertexIndex.Resize(256); - } - - void Reset() - { - m_hitDistance.SetCount(0); - m_faceIndexCount.SetCount(0); - m_faceIndexStart.SetCount(0); - m_faceVertexIndex.SetCount(0); - } - - ndArray m_hitDistance; - ndArray m_faceIndexCount; - ndArray m_faceIndexStart; - ndArray m_faceVertexIndex; - }; - - class ndProceduralStaticMeshFaceQuery - { - public: - ndProceduralStaticMeshFaceQuery() - { - m_vertex.Resize(256); - m_faceMaterial.Resize(256); - m_indexListList.Resize(256); - } - - void Reset() - { - m_vertex.SetCount(0); - m_faceMaterial.SetCount(0); - m_indexListList.SetCount(0); - } - - ndArray m_vertex; - ndArray m_faceMaterial; - ndArray m_indexListList; - }; - - // colliding box in polygonSoup local space - //D_COLLISION_API ndPolygonMeshDesc(); - D_COLLISION_API ndPolygonMeshDesc(ndContactSolver& proxy, bool ccdMode); - D_COLLISION_API ~ndPolygonMeshDesc(); - - D_COLLISION_API void SortFaceArray(); - D_COLLISION_API ndFloat32 GetSeparetionDistance() const; - D_COLLISION_API ndInt32 GetFaceIndexCount(ndInt32 indexCount) const; - D_COLLISION_API void SetDistanceTravel(const ndVector& distanceInGlobalSpace); - D_COLLISION_API ndInt32 GetFaceId(const ndInt32* const faceIndexArray, ndInt32 indexCount) const; - D_COLLISION_API ndInt32 GetNormalIndex(const ndInt32* const faceIndexArray, ndInt32 indexCount) const; - D_COLLISION_API ndFloat32 GetFaceSize(const ndInt32* const faceIndexArray, ndInt32 indexCount) const; - D_COLLISION_API const ndInt32* GetAdjacentFaceEdgeNormalArray(const ndInt32* const faceIndexArray, ndInt32 indexCount) const; - - void Init(); - - ndVector m_boxDistanceTravelInMeshSpace; - ndInt32 m_vertexStrideInBytes; - ndFloat32 m_skinMargin; - ndShapeInstance* m_convexInstance; - ndShapeInstance* m_polySoupInstance; - ndFloat32* m_vertex; - - // private data; - ndStaticMeshFaceQuery* m_staticMeshQuery; - ndProceduralStaticMeshFaceQuery* m_proceduralStaticMeshFaceQuery; - ndFloat32 m_maxT; - ndInt32 m_threadId; - //bool m_ownTempBuffers; - bool m_doContinueCollisionTest; -} D_GCC_NEWTON_ALIGN_32; - - -//class ndPolygonMeshLocalDesc : public ndPolygonMeshDesc -//{ -// public: -// D_COLLISION_API ndPolygonMeshLocalDesc(ndContactSolver& proxy, bool ccdMode); -// -// ndPolygonMeshDesc::ndStaticMeshFaceQuery m_localStaticMeshQuery; -// ndPolygonMeshDesc::ndProceduralStaticMeshFaceQuery m_localProceduralStaticMeshQuery; -//}; - -#endif - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndRayCastNotify.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndRayCastNotify.cpp deleted file mode 100644 index 2162f18ede..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndRayCastNotify.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndRayCastNotify.h" -#include "ndBodyKinematic.h" - -bool ndRayCastNotify::TraceShape(const ndVector& globalOrigin, const ndVector& globalDestination, const ndShapeInstance& shapeInstance, const ndMatrix& shapeGlobal) -{ - ndContactPoint contactOut; - - ndBodyKinematic tmpBody; - tmpBody.SetMatrix(ndGramSchmidtMatrix(globalOrigin)); - tmpBody.SetCollisionShape(shapeInstance); - tmpBody.SetMassMatrix(ndVector::m_one); - - const ndVector& localOrigin(shapeGlobal.UntransformVector(globalOrigin) & ndVector::m_triplexMask); - const ndVector& localDestination(shapeGlobal.UntransformVector(globalDestination) & ndVector::m_triplexMask); - ndFloat32 t = shapeInstance.RayCast(*this, localOrigin, localDestination, &tmpBody, contactOut); - bool state = false; - if (t <= ndFloat32 (1.0f)) - { - ndVector p(shapeGlobal.TransformVector(localOrigin + (localDestination - localOrigin).Scale(t))); - ndAssert(t >= ndFloat32(0.0f)); - ndAssert(t <= ndFloat32(1.0f)); - m_param = t; - state = true; - m_contact.m_body0 = nullptr; - m_contact.m_body1 = nullptr; - m_contact.m_point = p; - m_contact.m_normal = shapeGlobal.RotateVector(contactOut.m_normal); - } - return state; -} - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndRayCastNotify.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndRayCastNotify.h deleted file mode 100644 index b92d862ded..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndRayCastNotify.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_RAYCAST_NOTYFY_H__ -#define __ND_RAYCAST_NOTYFY_H__ - -#include "ndCollisionStdafx.h" -#include "ndBody.h" -#include "ndContact.h" - -D_MSV_NEWTON_ALIGN_32 -class ndRayCastNotify : public ndClassAlloc -{ - public: - ndRayCastNotify() - :m_param(ndFloat32 (1.0f)) - { - } - - virtual ~ndRayCastNotify() - { - } - - D_COLLISION_API bool TraceShape(const ndVector& globalOrigin, const ndVector& globalDestination, const ndShapeInstance& shapeInstance, const ndMatrix& shapeGlobal); - - virtual ndUnsigned32 OnRayPrecastAction(const ndBody* const, const ndShapeInstance* const) - { - return 1; - } - - virtual ndFloat32 OnRayCastAction(const ndContactPoint& contact, ndFloat32 intersetParam) = 0; - - - ndContactPoint m_contact; - ndFloat32 m_param; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndRayCastClosestHitCallback: public ndRayCastNotify -{ - public: - ndRayCastClosestHitCallback() - :ndRayCastNotify() - { - } - - ndUnsigned32 OnRayPrecastAction(const ndBody* const body, const ndShapeInstance* const) - { - // do not let player capsule picking - return ndUnsigned32 (((ndBody*)body)->GetAsBodyPlayerCapsule() ? 0 : 1); - } - - ndFloat32 OnRayCastAction(const ndContactPoint& contact, ndFloat32 intersetParam) - { - if (intersetParam < m_param) - { - m_contact = contact; - m_param = intersetParam; - } - return intersetParam; - } -} D_GCC_NEWTON_ALIGN_32 ; - - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndScene.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndScene.cpp deleted file mode 100644 index 3ed4450bbd..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndScene.cpp +++ /dev/null @@ -1,1709 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndScene.h" -#include "ndShapeNull.h" -#include "ndBodyNotify.h" -#include "ndShapeCompound.h" -#include "ndBodyKinematic.h" -#include "ndContactNotify.h" -#include "ndContactSolver.h" -#include "ndRayCastNotify.h" -#include "ndBodyParticleSet.h" -#include "ndConvexCastNotify.h" -#include "ndBodyTriggerVolume.h" -#include "ndBodiesInAabbNotify.h" -#include "ndJointBilateralConstraint.h" -#include "ndShapeStaticProceduralMesh.h" - -#define D_CONTACT_DELAY_FRAMES 4 -#define D_NARROW_PHASE_DIST ndFloat32 (0.2f) -#define D_CONTACT_TRANSLATION_ERROR ndFloat32 (1.0e-3f) -#define D_CONTACT_ANGULAR_ERROR (ndFloat32 (0.25f * ndDegreeToRad)) - -ndVector ndScene::m_velocTol(ndFloat32(1.0e-16f)); -ndVector ndScene::m_angularContactError2(D_CONTACT_ANGULAR_ERROR * D_CONTACT_ANGULAR_ERROR); -ndVector ndScene::m_linearContactError2(D_CONTACT_TRANSLATION_ERROR * D_CONTACT_TRANSLATION_ERROR); - -ndScene::ndScene() - :ndThreadPool("newtonWorker") - ,m_bodyList() - ,m_particleSetList() - ,m_contactArray() - ,m_bvhSceneManager() - ,m_scratchBuffer(1024 * sizeof (void*)) - ,m_sceneBodyArray(1024) - ,m_activeConstraintArray(1024) - ,m_specialUpdateList() - ,m_backgroundThread() - ,m_newPairs(1024) - ,m_lock() - ,m_rootNode(nullptr) - ,m_sentinelBody(nullptr) - ,m_contactNotifyCallback(new ndContactNotify(nullptr)) - ,m_timestep(ndFloat32 (0.0f)) - ,m_lru(D_CONTACT_DELAY_FRAMES) - ,m_frameNumber(0) - ,m_subStepNumber(0) - ,m_forceBalanceSceneCounter(0) -{ - m_sentinelBody = new ndBodySentinel; - m_contactNotifyCallback->m_scene = this; - - for (ndInt32 i = 0; i < D_MAX_THREADS_COUNT; ++i) - { - m_partialNewPairs[i].Resize(256); - } -} - -ndScene::ndScene(const ndScene& src) - :ndThreadPool("newtonWorker") - ,m_bodyList(src.m_bodyList) - ,m_particleSetList() - ,m_contactArray(src.m_contactArray) - ,m_bvhSceneManager(src.m_bvhSceneManager) - ,m_scratchBuffer() - ,m_sceneBodyArray() - ,m_activeConstraintArray() - ,m_specialUpdateList() - ,m_backgroundThread() - ,m_newPairs(1024) - ,m_lock() - ,m_rootNode(nullptr) - ,m_sentinelBody(nullptr) - ,m_contactNotifyCallback(nullptr) - ,m_timestep(ndFloat32(0.0f)) - ,m_lru(src.m_lru) - ,m_frameNumber(src.m_frameNumber) - ,m_subStepNumber(src.m_subStepNumber) - ,m_forceBalanceSceneCounter(0) -{ - ndScene* const stealData = (ndScene*)&src; - - SetThreadCount(src.GetThreadCount()); - m_backgroundThread.SetThreadCount(m_backgroundThread.GetThreadCount()); - - m_scratchBuffer.Swap(stealData->m_scratchBuffer); - m_sceneBodyArray.Swap(stealData->m_sceneBodyArray); - m_activeConstraintArray.Swap(stealData->m_activeConstraintArray); - - ndSwap(m_rootNode, stealData->m_rootNode); - ndSwap(m_sentinelBody, stealData->m_sentinelBody); - ndSwap(m_contactNotifyCallback, stealData->m_contactNotifyCallback); - m_contactNotifyCallback->m_scene = this; - - ndSpecialList::ndNode* nextNode; - for (ndSpecialList::ndNode* node = stealData->m_specialUpdateList.GetFirst(); node; node = nextNode) - { - nextNode = node->GetNext(); - stealData->m_specialUpdateList.Unlink(node); - m_specialUpdateList.Append(node); - } - - ndBodyList::ndNode* nextParticleNode; - for (ndBodyList::ndNode* node = stealData->m_particleSetList.GetFirst(); node; node = nextParticleNode) - { - nextParticleNode = node->GetNext(); - stealData->m_particleSetList.Unlink(node); - ndBodyParticleSet* const particle = (*node->GetInfo())->GetAsBodyParticleSet(); - particle->m_listNode = m_particleSetList.Append(node); - } - - for (ndBodyListView::ndNode* node = m_bodyList.GetFirst(); node; node = node->GetNext()) - { - ndBodyKinematic* const body = node->GetInfo()->GetAsBodyKinematic(); - body->m_sceneForceUpdate = 1; - ndScene* const sceneNode = body->GetScene(); - if (sceneNode) - { - body->SetSceneNodes(this, node); - } - ndAssert (body->GetContactMap().SanityCheck()); - } - - for (ndInt32 i = 0; i < D_MAX_THREADS_COUNT; ++i) - { - m_partialNewPairs[i].Resize(256); - } -} - -ndScene::~ndScene() -{ - Cleanup(); - Finish(); - if (m_contactNotifyCallback) - { - delete m_contactNotifyCallback; - } - ndFreeListAlloc::Flush(); -} - -void ndScene::Sync() -{ - ndThreadPool::Sync(); -} - -void ndScene::Begin() -{ - ndThreadPool::Begin(); -} - -void ndScene::End() -{ - ndThreadPool::End(); - m_frameNumber++; -} - -bool ndScene::AddParticle(const ndSharedPtr& particle) -{ - ndBodyParticleSet* const particleSet = particle->GetAsBodyParticleSet(); - ndAssert(particleSet->m_listNode == nullptr); - ndBodyList::ndNode* const node = m_particleSetList.Append(particle); - particleSet->m_listNode = node; - return true; -} - -bool ndScene::RemoveParticle(const ndSharedPtr& particle) -{ - ndBodyParticleSet* const particleSet = particle->GetAsBodyParticleSet(); - ndAssert(particleSet->m_listNode); - m_particleSetList.Remove(particleSet->m_listNode); - return true; -} - -ndContactNotify* ndScene::GetContactNotify() const -{ - return m_contactNotifyCallback; -} - -void ndScene::SetContactNotify(ndContactNotify* const notify) -{ - ndAssert(m_contactNotifyCallback); - delete m_contactNotifyCallback; - - if (notify) - { - m_contactNotifyCallback = notify; - } - else - { - m_contactNotifyCallback = new ndContactNotify(nullptr); - } - m_contactNotifyCallback->m_scene = this; -} - -void ndScene::DebugScene(ndSceneTreeNotiFy* const notify) -{ - const ndBvhNodeArray& array = m_bvhSceneManager.GetNodeArray(); - for (ndInt32 i = 0; i < array.GetCount(); ++i) - { - ndBvhNode* const node = array[i]; - if (node->GetAsSceneBodyNode()) - { - notify->OnDebugNode(node); - } - } -} - -bool ndScene::AddBody(const ndSharedPtr& body) -{ - ndBodyKinematic* const kinematicBody = body->GetAsBodyKinematic(); - if (kinematicBody) - { - if ((kinematicBody->m_scene == nullptr) && (kinematicBody->m_sceneNode == nullptr)) - { - ndBodyListView::ndNode* const node = m_bodyList.AddItem(body); - kinematicBody->SetSceneNodes(this, node); - m_contactNotifyCallback->OnBodyAdded(kinematicBody); - kinematicBody->UpdateCollisionMatrix(); - - m_rootNode = m_bvhSceneManager.AddBody(kinematicBody, m_rootNode); - if (kinematicBody->GetAsBodyKinematicSpecial()) - { - kinematicBody->m_spetialUpdateNode = m_specialUpdateList.Append(kinematicBody); - } - - m_forceBalanceSceneCounter = 0; - - return true; - } - } - else if (body->GetAsBodyParticleSet()) - { - return AddParticle(body); - } - return false; -} - -ndSharedPtr ndScene::GetBody(ndBody* const body) const -{ - ndBodyKinematic* const kinematicBody = body->GetAsBodyKinematic(); - if (kinematicBody) - { - return kinematicBody->m_sceneNode->GetInfo(); - } - else - { - ndAssert(0); - return ndSharedPtr(nullptr); - } -} - -bool ndScene::RemoveBody(const ndSharedPtr& body) -{ - ndBodyKinematic* const kinematicBody = body->GetAsBodyKinematic(); - if (kinematicBody) - { - m_forceBalanceSceneCounter = 0; - m_bvhSceneManager.RemoveBody(kinematicBody); - - //ndAssert(0); - ndBodyKinematic::ndContactMap& contactMap = kinematicBody->GetContactMap(); - while (contactMap.GetRoot()) - { - ndContact* const contact = contactMap.GetRoot()->GetInfo(); - m_contactArray.DetachContact(contact); - } - - ndBodyListView::ndNode* const sceneNode = kinematicBody->m_sceneNode; - if (kinematicBody->m_scene && sceneNode) - { - if (kinematicBody->GetAsBodyKinematicSpecial()) - { - m_specialUpdateList.Remove(kinematicBody->m_spetialUpdateNode); - kinematicBody->m_spetialUpdateNode = nullptr; - } - - m_contactNotifyCallback->OnBodyRemoved(kinematicBody); - kinematicBody->SetSceneNodes(nullptr, nullptr); - m_bodyList.RemoveItem(sceneNode); - return true; - } - } - else - { - //ndBodyParticleSet* const particle = body->GetAsBodyParticleSet(); - ndAssert(body->GetAsBodyParticleSet()); - RemoveParticle(body); - } - return false; -} - -void ndScene::BalanceScene() -{ - D_TRACKTIME(); - UpdateBodyList(); - if (m_bvhSceneManager.GetNodeArray().GetCount() > 2) - { - if (!m_forceBalanceSceneCounter) - { - m_rootNode = m_bvhSceneManager.BuildBvhTree(*this); - } - const ndInt32 sceneUpdatePeriod = 64; - m_forceBalanceSceneCounter = (m_forceBalanceSceneCounter < sceneUpdatePeriod) ? m_forceBalanceSceneCounter + 1 : 0; - ndAssert(!m_rootNode || !m_rootNode->m_parent); - } - - if (!m_bodyList.GetCount()) - { - m_rootNode = nullptr; - } -} - -void ndScene::UpdateTransformNotify(ndInt32 threadIndex, ndBodyKinematic* const body) -{ - if (body->m_transformIsDirty) - { - body->m_transformIsDirty = 0; - ndBodyNotify* const notify = body->GetNotifyCallback(); - if (notify) - { - notify->OnTransform(threadIndex, body->GetMatrix()); - } - } -} - -bool ndScene::ValidateContactCache(ndContact* const contact, const ndVector& timestep) const -{ - ndAssert(contact && (contact->GetAsContact())); - - if (contact->m_maxDof) - { - ndBodyKinematic* const body0 = contact->GetBody0(); - ndBodyKinematic* const body1 = contact->GetBody1(); - - ndVector positStep(timestep * (body0->m_veloc - body1->m_veloc)); - positStep = ((positStep.DotProduct(positStep)) > m_velocTol) & positStep; - contact->m_positAcc += positStep; - - ndVector positError2(contact->m_positAcc.DotProduct(contact->m_positAcc)); - ndVector positSign(ndVector::m_negOne & (positError2 < m_linearContactError2)); - if (positSign.GetSignMask()) - { - ndVector rotationStep(timestep * (body0->m_omega - body1->m_omega)); - rotationStep = ((rotationStep.DotProduct(rotationStep)) > m_velocTol) & rotationStep; - contact->m_rotationAcc = contact->m_rotationAcc * ndQuaternion(rotationStep.m_x, rotationStep.m_y, rotationStep.m_z, ndFloat32(1.0f)); - - ndVector angle(contact->m_rotationAcc & ndVector::m_triplexMask); - ndVector rotatError2(angle.DotProduct(angle)); - ndVector rotationSign(ndVector::m_negOne & (rotatError2 < m_linearContactError2)); - if (rotationSign.GetSignMask()) - { - return true; - } - } - } - return false; -} - -void ndScene::CalculateJointContacts(ndInt32 threadIndex, ndContact* const contact) -{ - ndBodyKinematic* const body0 = contact->GetBody0(); - ndBodyKinematic* const body1 = contact->GetBody1(); - - ndAssert(body0->GetScene() == this); - ndAssert(body1->GetScene() == this); - - ndAssert(contact->m_material); - ndAssert(m_contactNotifyCallback); - - bool processContacts = m_contactNotifyCallback->OnAabbOverlap(contact, m_timestep); - if (processContacts) - { - //ndAssert(!body0->GetCollisionShape().GetShape()->GetAsShapeNull()); - //ndAssert(!body1->GetCollisionShape().GetShape()->GetAsShapeNull()); - - ndContactPoint contactBuffer[D_MAX_CONTATCS]; - ndContactSolver contactSolver(contact, m_contactNotifyCallback, m_timestep, threadIndex); - contactSolver.m_separatingVector = contact->m_separatingVector; - contactSolver.m_contactBuffer = contactBuffer; - contactSolver.m_intersectionTestOnly = body0->m_contactTestOnly | body1->m_contactTestOnly; - - ndInt32 count = contactSolver.CalculateContactsDiscrete (); - if (count) - { - contact->SetActive(true); - if (contactSolver.m_intersectionTestOnly) - { - ndBodyKinematic* otherBody = body0; - ndBodyTriggerVolume* trigger = body1->GetAsBodyTriggerVolume(); - if (!trigger) - { - otherBody = body1; - trigger = body0->GetAsBodyTriggerVolume(); - } - - if (trigger && !contact->m_inTrigger) - { - contact->m_inTrigger = 1; - trigger->OnTriggerEnter(otherBody, m_timestep); - } - contact->m_isIntersetionTestOnly = 1; - } - else - { - ndAssert(count <= (D_CONSTRAINT_MAX_ROWS / 3)); - ProcessContacts(threadIndex, count, &contactSolver); - ndAssert(contact->m_maxDof); - contact->m_isIntersetionTestOnly = 0; - } - } - else - { - if (contactSolver.m_intersectionTestOnly) - { - ndBodyKinematic* otherBody = body0; - ndBodyTriggerVolume* trigger = body1->GetAsBodyTriggerVolume(); - if (!trigger) - { - otherBody = body1; - trigger = body0->GetAsBodyTriggerVolume(); - } - - if (trigger && contact->m_inTrigger) - { - contact->m_inTrigger = 0; - ndAssert(contact->m_isIntersetionTestOnly); - trigger->GetAsBodyTriggerVolume()->OnTriggerExit(otherBody, m_timestep); - } - contact->m_isIntersetionTestOnly = 1; - } - contact->m_maxDof = 0; - } - } -} - -void ndScene::ProcessContacts(ndInt32, ndInt32 contactCount, ndContactSolver* const contactSolver) -{ - ndContact* const contact = contactSolver->m_contact; - contact->m_positAcc = ndVector::m_zero; - contact->m_rotationAcc = ndQuaternion(); - - ndBodyKinematic* const body0 = contact->m_body0; - ndBodyKinematic* const body1 = contact->m_body1; - ndAssert(body0); - ndAssert(body1); - ndAssert(body0 != body1); - - contact->m_material = m_contactNotifyCallback->GetMaterial(contact, body0->GetCollisionShape(), body1->GetCollisionShape()); - const ndContactPoint* const contactArray = contactSolver->m_contactBuffer; - - ndInt32 count = 0; - ndVector cachePosition[D_MAX_CONTATCS]; - ndContactPointList::ndNode* nodes[D_MAX_CONTATCS]; - ndContactPointList& contactPointList = contact->m_contacPointsList; - for (ndContactPointList::ndNode* contactNode = contactPointList.GetFirst(); contactNode; contactNode = contactNode->GetNext()) - { - nodes[count] = contactNode; - cachePosition[count] = contactNode->GetInfo().m_point; - count++; - } - - const ndVector& v0 = body0->m_veloc; - const ndVector& w0 = body0->m_omega; - const ndVector& com0 = body0->m_globalCentreOfMass; - - const ndVector& v1 = body1->m_veloc; - const ndVector& w1 = body1->m_omega; - const ndVector& com1 = body1->m_globalCentreOfMass; - - ndVector controlDir0(ndVector::m_zero); - ndVector controlDir1(ndVector::m_zero); - ndVector controlNormal(contactArray[0].m_normal); - ndVector vel0(v0 + w0.CrossProduct(contactArray[0].m_point - com0)); - ndVector vel1(v1 + w1.CrossProduct(contactArray[0].m_point - com1)); - ndVector vRel(vel1 - vel0); - ndAssert(controlNormal.m_w == ndFloat32(0.0f)); - ndVector tangDir(vRel - controlNormal * vRel.DotProduct(controlNormal)); - ndAssert(tangDir.m_w == ndFloat32(0.0f)); - ndFloat32 diff = tangDir.DotProduct(tangDir).GetScalar(); - - ndInt32 staticMotion = 0; - if (diff <= ndFloat32(1.0e-2f)) - { - staticMotion = 1; - if (ndAbs(controlNormal.m_z) > ndFloat32(0.577f)) - { - tangDir = ndVector(-controlNormal.m_y, controlNormal.m_z, ndFloat32(0.0f), ndFloat32(0.0f)); - } - else - { - tangDir = ndVector(-controlNormal.m_y, controlNormal.m_x, ndFloat32(0.0f), ndFloat32(0.0f)); - } - controlDir0 = controlNormal.CrossProduct(tangDir); - ndAssert(controlDir0.m_w == ndFloat32(0.0f)); - ndAssert(controlDir0.DotProduct(controlDir0).GetScalar() > ndFloat32(1.0e-8f)); - controlDir0 = controlDir0.Normalize(); - controlDir1 = controlNormal.CrossProduct(controlDir0); - ndAssert(ndAbs(controlNormal.DotProduct(controlDir0.CrossProduct(controlDir1)).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - } - - ndFloat32 maxImpulse = ndFloat32(-1.0f); - for (ndInt32 i = 0; i < contactCount; ++i) - { - ndInt32 index = -1; - ndFloat32 min = ndFloat32(1.0e20f); - ndContactPointList::ndNode* contactNode = nullptr; - for (ndInt32 j = 0; j < count; ++j) - { - ndVector v(ndVector::m_triplexMask & (cachePosition[j] - contactArray[i].m_point)); - ndAssert(v.m_w == ndFloat32(0.0f)); - diff = v.DotProduct(v).GetScalar(); - if (diff < min) - { - index = j; - min = diff; - contactNode = nodes[j]; - } - } - - if (contactNode) - { - count--; - ndAssert(index != -1); - nodes[index] = nodes[count]; - cachePosition[index] = cachePosition[count]; - } - else - { - contactNode = contactPointList.Append(); - } - - ndContactMaterial* const contactPoint = &contactNode->GetInfo(); - - ndAssert(ndCheckFloat(contactArray[i].m_point.m_x)); - ndAssert(ndCheckFloat(contactArray[i].m_point.m_y)); - ndAssert(ndCheckFloat(contactArray[i].m_point.m_z)); - ndAssert(contactArray[i].m_body0); - ndAssert(contactArray[i].m_body1); - ndAssert(contactArray[i].m_shapeInstance0); - ndAssert(contactArray[i].m_shapeInstance1); - ndAssert(contactArray[i].m_body0 == body0); - ndAssert(contactArray[i].m_body1 == body1); - contactPoint->m_point = contactArray[i].m_point; - contactPoint->m_normal = contactArray[i].m_normal; - contactPoint->m_penetration = contactArray[i].m_penetration; - contactPoint->m_body0 = contactArray[i].m_body0; - contactPoint->m_body1 = contactArray[i].m_body1; - contactPoint->m_shapeInstance0 = contactArray[i].m_shapeInstance0; - contactPoint->m_shapeInstance1 = contactArray[i].m_shapeInstance1; - contactPoint->m_shapeId0 = contactArray[i].m_shapeId0; - contactPoint->m_shapeId1 = contactArray[i].m_shapeId1; - contactPoint->m_material = *contact->m_material; - - if (staticMotion) - { - if (contactPoint->m_normal.DotProduct(controlNormal).GetScalar() > ndFloat32(0.9995f)) - { - contactPoint->m_dir0 = controlDir0; - contactPoint->m_dir1 = controlDir1; - } - else - { - if (ndAbs(contactPoint->m_normal.m_z) > ndFloat32(0.577f)) - { - tangDir = ndVector(-contactPoint->m_normal.m_y, contactPoint->m_normal.m_z, ndFloat32(0.0f), ndFloat32(0.0f)); - } - else - { - tangDir = ndVector(-contactPoint->m_normal.m_y, contactPoint->m_normal.m_x, ndFloat32(0.0f), ndFloat32(0.0f)); - } - contactPoint->m_dir0 = contactPoint->m_normal.CrossProduct(tangDir); - ndAssert(contactPoint->m_dir0.m_w == ndFloat32(0.0f)); - ndAssert(contactPoint->m_dir0.DotProduct(contactPoint->m_dir0).GetScalar() > ndFloat32(1.0e-8f)); - contactPoint->m_dir0 = contactPoint->m_dir0.Normalize(); - contactPoint->m_dir1 = contactPoint->m_normal.CrossProduct(contactPoint->m_dir0); - ndAssert(ndAbs(contactPoint->m_normal.DotProduct(contactPoint->m_dir0.CrossProduct(contactPoint->m_dir1)).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - } - } - else - { - ndVector veloc0(v0 + w0.CrossProduct(contactPoint->m_point - com0)); - ndVector veloc1(v1 + w1.CrossProduct(contactPoint->m_point - com1)); - ndVector relReloc(veloc1 - veloc0); - - ndAssert(contactPoint->m_normal.m_w == ndFloat32(0.0f)); - ndFloat32 impulse = relReloc.DotProduct(contactPoint->m_normal).GetScalar(); - if (ndAbs(impulse) > maxImpulse) - { - maxImpulse = ndAbs(impulse); - } - - ndVector tangentDir(relReloc - contactPoint->m_normal.Scale(impulse)); - ndAssert(tangentDir.m_w == ndFloat32(0.0f)); - diff = tangentDir.DotProduct(tangentDir).GetScalar(); - if (diff > ndFloat32(1.0e-2f)) - { - ndAssert(tangentDir.m_w == ndFloat32(0.0f)); - contactPoint->m_dir0 = tangentDir.Normalize(); - } - else - { - if (ndAbs(contactPoint->m_normal.m_z) > ndFloat32(0.577f)) - { - tangentDir = ndVector(-contactPoint->m_normal.m_y, contactPoint->m_normal.m_z, ndFloat32(0.0f), ndFloat32(0.0f)); - } - else - { - tangentDir = ndVector(-contactPoint->m_normal.m_y, contactPoint->m_normal.m_x, ndFloat32(0.0f), ndFloat32(0.0f)); - } - contactPoint->m_dir0 = contactPoint->m_normal.CrossProduct(tangentDir); - ndAssert(contactPoint->m_dir0.m_w == ndFloat32(0.0f)); - ndAssert(contactPoint->m_dir0.DotProduct(contactPoint->m_dir0).GetScalar() > ndFloat32(1.0e-8f)); - contactPoint->m_dir0 = contactPoint->m_dir0.Normalize(); - } - contactPoint->m_dir1 = contactPoint->m_normal.CrossProduct(contactPoint->m_dir0); - ndAssert(ndAbs(contactPoint->m_normal.DotProduct(contactPoint->m_dir0.CrossProduct(contactPoint->m_dir1)).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - } - ndAssert(contactPoint->m_dir0.m_w == ndFloat32(0.0f)); - ndAssert(contactPoint->m_dir0.m_w == ndFloat32(0.0f)); - ndAssert(contactPoint->m_normal.m_w == ndFloat32(0.0f)); - } - - for (ndInt32 i = 0; i < count; ++i) - { - contactPointList.Remove(nodes[i]); - } - - //contact->m_maxDof = ndUnsigned32(3 * contactPointList.GetCount()); - contact->m_maxDof = ndUnsigned8(3 * contactPointList.GetCount()); - m_contactNotifyCallback->OnContactCallback(contact, m_timestep); -} - -void ndScene::SubmitPairs(ndBvhLeafNode* const leafNode, ndBvhNode* const node, bool forward, ndInt32 threadId) -{ - ndBvhNode* pool[D_SCENE_MAX_STACK_DEPTH]; - - ndBodyKinematic* const body0 = leafNode->GetBody() ? leafNode->GetBody() : nullptr; - ndAssert(body0); - - const ndVector boxP0(leafNode->m_minBox); - const ndVector boxP1(leafNode->m_maxBox); - const ndUnsigned8 test0 = ndUnsigned8(!body0->m_equilibrium); - const ndUnsigned8 fowardTest = forward ? ndUnsigned8(1) : ndUnsigned8(0); - - ndBodyNotify* const notify = body0->GetNotifyCallback(); - - pool[0] = node; - ndInt32 stack = 1; - while (stack && (stack < (D_SCENE_MAX_STACK_DEPTH - 16))) - { - stack--; - ndBvhNode* const rootNode = pool[stack]; - if (ndOverlapTest(rootNode->m_minBox, rootNode->m_maxBox, boxP0, boxP1)) - { - if (rootNode->GetAsSceneBodyNode()) - { - ndAssert(!rootNode->GetRight()); - ndAssert(!rootNode->GetLeft()); - - ndBodyKinematic* const body1 = rootNode->GetBody(); - ndAssert(body1); - const ndUnsigned8 test = ndUnsigned8((body1->m_sceneEquilibrium | fowardTest) & (test0 | ndUnsigned8(!body1->m_equilibrium))); - if (test) - { - //if (notify->OnSceneAabbOverlap(body1)) - if (!notify || notify->OnSceneAabbOverlap(body1)) - { - AddPair(body0, body1, threadId); - } - } - } - else - { - ndBvhInternalNode* const tmpNode = rootNode->GetAsSceneTreeNode(); - ndAssert(tmpNode->m_left); - ndAssert(tmpNode->m_right); - - pool[stack] = tmpNode->m_left; - stack++; - ndAssert(stack < ndInt32(sizeof(pool) / sizeof(pool[0]))); - - pool[stack] = tmpNode->m_right; - stack++; - ndAssert(stack < ndInt32(sizeof(pool) / sizeof(pool[0]))); - } - } - } - - if (stack) - { - m_forceBalanceSceneCounter = 0; - } -} - -ndJointBilateralConstraint* ndScene::FindBilateralJoint(ndBodyKinematic* const body0, ndBodyKinematic* const body1) const -{ - if (body0->m_jointList.GetCount() <= body1->m_jointList.GetCount()) - { - for (ndBodyKinematic::ndJointList::ndNode* node = body0->m_jointList.GetFirst(); node; node = node->GetNext()) - { - ndJointBilateralConstraint* const joint = node->GetInfo(); - if ((joint->GetBody0() == body1) || (joint->GetBody1() == body1)) - { - return joint; - } - } - } - else - { - for (ndBodyKinematic::ndJointList::ndNode* node = body1->m_jointList.GetFirst(); node; node = node->GetNext()) - { - ndJointBilateralConstraint* const joint = node->GetInfo(); - if ((joint->GetBody0() == body0) || (joint->GetBody1() == body0)) - { - return joint; - } - } - } - return nullptr; -} - -void ndScene::FindCollidingPairs(ndBodyKinematic* const body, ndInt32 threadId) -{ - ndBvhLeafNode* const bodyNode = m_bvhSceneManager.GetLeafNode(body); - ndAssert(bodyNode->GetAsSceneBodyNode()); - for (ndBvhNode* ptr = bodyNode; ptr->m_parent; ptr = ptr->m_parent) - { - ndBvhInternalNode* const parent = ptr->m_parent->GetAsSceneTreeNode(); - ndAssert(!parent->GetAsSceneBodyNode()); - ndBvhNode* const sibling = parent->m_right; - if (sibling != ptr) - { - SubmitPairs(bodyNode, sibling, true, threadId); - } - } -} - -void ndScene::FindCollidingPairsForward(ndBodyKinematic* const body, ndInt32 threadId) -{ - ndBvhLeafNode* const bodyNode = m_bvhSceneManager.GetLeafNode(body); - ndAssert(bodyNode->GetAsSceneBodyNode()); - for (ndBvhNode* ptr = bodyNode; ptr->m_parent; ptr = ptr->m_parent) - { - ndBvhInternalNode* const parent = ptr->m_parent->GetAsSceneTreeNode(); - ndAssert(!parent->GetAsSceneBodyNode()); - ndBvhNode* const sibling = parent->m_right; - if (sibling != ptr) - { - SubmitPairs(bodyNode, sibling, true, threadId); - } - } -} - -void ndScene::FindCollidingPairsBackward(ndBodyKinematic* const body, ndInt32 threadId) -{ - ndBvhLeafNode* const bodyNode = m_bvhSceneManager.GetLeafNode(body); - ndAssert(bodyNode->GetAsSceneBodyNode()); - for (ndBvhNode* ptr = bodyNode; ptr->m_parent; ptr = ptr->m_parent) - { - ndBvhInternalNode* const parent = ptr->m_parent->GetAsSceneTreeNode(); - ndAssert(!parent->GetAsSceneBodyNode()); - ndBvhNode* const sibling = parent->m_left; - if (sibling != ptr) - { - SubmitPairs(bodyNode, sibling, false, threadId); - } - } -} - -void ndScene::UpdateTransform() -{ - D_TRACKTIME(); - for (ndBodyList::ndNode* node = m_particleSetList.GetFirst(); node; node = node->GetNext()) - { - ndBodyParticleSet* const particleSet = node->GetInfo()->GetAsBodyParticleSet(); - ndAssert(particleSet); - ndBodyNotify* const notify = particleSet->GetNotifyCallback(); - if (notify) - { - notify->OnTransform(0, particleSet->GetMatrix()); - } - } - - ndAtomic iterator(0); - auto TransformUpdate = ndMakeObject::ndFunction([this, &iterator](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(TransformUpdate); - const ndArray& bodyArray = GetActiveBodyArray(); - - const ndInt32 count = ndInt32(bodyArray.GetCount()) - 1; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - UpdateTransformNotify(threadIndex, body); - } - } - }); - ParallelExecute(TransformUpdate); -} - -void ndScene::CalculateContacts(ndInt32 threadIndex, ndContact* const contact) -{ - const ndUnsigned32 lru = m_lru - D_CONTACT_DELAY_FRAMES; - - ndVector deltaTime(m_timestep); - ndBodyKinematic* const body0 = contact->GetBody0(); - ndBodyKinematic* const body1 = contact->GetBody1(); - - ndAssert(!contact->m_isDead); - if (!(body0->m_equilibrium & body1->m_equilibrium)) - { - bool active = contact->IsActive(); - if (ValidateContactCache(contact, deltaTime)) - { - contact->m_sceneLru = m_lru; - contact->m_timeOfImpact = ndFloat32(1.0e10f); - } - else - { - contact->SetActive(false); - contact->m_positAcc = ndVector::m_zero; - contact->m_rotationAcc = ndQuaternion(); - - ndFloat32 distance = contact->m_separationDistance; - if (distance >= D_NARROW_PHASE_DIST) - { - const ndVector veloc0(body0->GetVelocity()); - const ndVector veloc1(body1->GetVelocity()); - - const ndVector veloc(veloc1 - veloc0); - const ndVector omega0(body0->GetOmega()); - const ndVector omega1(body1->GetOmega()); - const ndShapeInstance* const collision0 = &body0->GetCollisionShape(); - const ndShapeInstance* const collision1 = &body1->GetCollisionShape(); - const ndVector scale(ndFloat32(1.0f), ndFloat32(3.5f) * collision0->GetBoxMaxRadius(), ndFloat32(3.5f) * collision1->GetBoxMaxRadius(), ndFloat32(0.0f)); - const ndVector velocMag2(veloc.DotProduct(veloc).GetScalar(), omega0.DotProduct(omega0).GetScalar(), omega1.DotProduct(omega1).GetScalar(), ndFloat32(0.0f)); - const ndVector velocMag(velocMag2.GetMax(ndVector::m_epsilon).InvSqrt() * velocMag2 * scale); - const ndFloat32 speed = velocMag.AddHorizontal().GetScalar() + ndFloat32(0.5f); - - distance -= speed * m_timestep; - contact->m_separationDistance = distance; - } - if (distance < D_NARROW_PHASE_DIST) - { - CalculateJointContacts(threadIndex, contact); - if (contact->m_maxDof || contact->m_isIntersetionTestOnly) - { - contact->SetActive(true); - contact->m_timeOfImpact = ndFloat32(1.0e10f); - } - contact->m_sceneLru = m_lru; - } - else - { - const ndBvhLeafNode* const bodyNode0 = m_bvhSceneManager.GetLeafNode(contact->GetBody0()); - const ndBvhLeafNode* const bodyNode1 = m_bvhSceneManager.GetLeafNode(contact->GetBody1()); - ndAssert(bodyNode0 && bodyNode0->GetAsSceneBodyNode()); - ndAssert(bodyNode1 && bodyNode1->GetAsSceneBodyNode()); - if (ndOverlapTest(bodyNode0->m_minBox, bodyNode0->m_maxBox, bodyNode1->m_minBox, bodyNode1->m_maxBox)) - { - contact->m_sceneLru = m_lru; - } - else if (contact->m_sceneLru < lru) - { - contact->m_isDead = 1; - } - } - } - - if (active ^ contact->IsActive()) - { - ndAssert(body0->GetInvMass() > ndFloat32(0.0f)); - body0->m_equilibrium = 0; - if (body1->GetInvMass() > ndFloat32(0.0f)) - { - body1->m_equilibrium = 0; - } - } - } - else - { - contact->m_sceneLru = m_lru; - } - - if (!contact->m_isDead && (body0->m_equilibrium & body1->m_equilibrium & !contact->IsActive())) - { - const ndBvhLeafNode* const bodyNode0 = m_bvhSceneManager.GetLeafNode(contact->GetBody0()); - const ndBvhLeafNode* const bodyNode1 = m_bvhSceneManager.GetLeafNode(contact->GetBody1()); - ndAssert(bodyNode0->GetAsSceneBodyNode()); - ndAssert(bodyNode1->GetAsSceneBodyNode()); - if (!ndOverlapTest(bodyNode0->m_minBox, bodyNode0->m_maxBox, bodyNode1->m_minBox, bodyNode1->m_maxBox)) - { - contact->m_isDead = 1; - } - } -} - -void ndScene::UpdateSpecial() -{ - for (ndSpecialList::ndNode* node = m_specialUpdateList.GetFirst(); node; node = node->GetNext()) - { - ndBodyKinematic* const body = node->GetInfo(); - body->SpecialUpdate(m_timestep); - } -} - -bool ndScene::ConvexCast(ndConvexCastNotify& callback, const ndBvhNode** stackPool, ndFloat32* const stackDistance, ndInt32 stack, const ndFastRay& ray, const ndShapeInstance& convexShape, const ndMatrix& globalOrigin, const ndVector& globalDest) const -{ - ndVector boxP0; - ndVector boxP1; - - ndAssert(globalOrigin.TestOrthogonal()); - convexShape.CalculateAabb(globalOrigin, boxP0, boxP1); - - callback.m_contacts.SetCount(0); - callback.m_param = ndFloat32(1.2f); - callback.m_cachedScene = (ndScene*)this; - while (stack && (stack < (D_SCENE_MAX_STACK_DEPTH - 4))) - { - stack--; - ndFloat32 dist = stackDistance[stack]; - - if (dist > callback.m_param) - { - break; - } - else - { - const ndBvhNode* const me = stackPool[stack]; - - ndBody* const body = me->GetBody(); - if (body) - { - if (callback.OnRayPrecastAction (body, &convexShape)) - { - // save contacts and try new set - ndConvexCastNotify savedNotification(callback); - ndBodyKinematic* const kinBody = body->GetAsBodyKinematic(); - callback.m_contacts.SetCount(0); - if (callback.CastShape(convexShape, globalOrigin, globalDest, kinBody)) - { - // found new contacts, see how the are managed - if (ndAbs(savedNotification.m_param - callback.m_param) < ndFloat32(-1.0e-3f)) - { - // merge contact - for (ndInt32 i = 0; i < savedNotification.m_contacts.GetCount(); ++i) - { - const ndContactPoint& contact = savedNotification.m_contacts[i]; - bool newPoint = true; - for (ndInt32 j = callback.m_contacts.GetCount() - 1; j >= 0; ++j) - { - const ndVector diff(callback.m_contacts[j].m_point - contact.m_point); - ndFloat32 mag2 = diff.DotProduct(diff & ndVector::m_triplexMask).GetScalar(); - newPoint = newPoint & (mag2 > ndFloat32(1.0e-5f)); - } - if (newPoint && (callback.m_contacts.GetCount() < callback.m_contacts.GetCapacity())) - { - callback.m_contacts.PushBack(contact); - } - } - } - else if (callback.m_param > savedNotification.m_param) - { - // restore contacts - callback.m_normal = savedNotification.m_normal; - callback.m_closestPoint0 = savedNotification.m_closestPoint0; - callback.m_closestPoint1 = savedNotification.m_closestPoint1; - callback.m_param = savedNotification.m_param; - for (ndInt32 i = 0; i < savedNotification.m_contacts.GetCount(); ++i) - { - callback.m_contacts[i] = savedNotification.m_contacts[i]; - } - } - } - else - { - // no new contacts restore old ones, - // in theory it should no copy, by the notification may change - // the previous found contacts - callback.m_normal = savedNotification.m_normal; - callback.m_closestPoint0 = savedNotification.m_closestPoint0; - callback.m_closestPoint1 = savedNotification.m_closestPoint1; - callback.m_param = savedNotification.m_param; - for (ndInt32 i = 0; i < savedNotification.m_contacts.GetCount(); ++i) - { - callback.m_contacts[i] = savedNotification.m_contacts[i]; - } - } - - if (callback.m_param < ndFloat32 (1.0e-8f)) - { - break; - } - } - } - else - { - { - const ndBvhNode* const left = me->GetLeft(); - ndAssert(left); - const ndVector minBox(left->m_minBox - boxP1); - const ndVector maxBox(left->m_maxBox - boxP0); - ndFloat32 dist1 = ray.BoxIntersect(minBox, maxBox); - if (dist1 < callback.m_param) - { - ndInt32 j = stack; - for (; j && (dist1 > stackDistance[j - 1]); j--) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = left; - stackDistance[j] = dist1; - stack++; - ndAssert(stack < D_SCENE_MAX_STACK_DEPTH); - } - } - - { - const ndBvhNode* const right = me->GetRight(); - ndAssert(right); - const ndVector minBox(right->m_minBox - boxP1); - const ndVector maxBox = right->m_maxBox - boxP0; - ndFloat32 dist1 = ray.BoxIntersect(minBox, maxBox); - if (dist1 < callback.m_param) - { - ndInt32 j = stack; - for (; j && (dist1 > stackDistance[j - 1]); j--) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = right; - stackDistance[j] = dist1; - stack++; - ndAssert(stack < D_SCENE_MAX_STACK_DEPTH); - } - } - } - } - } - - callback.m_cachedScene = nullptr; - return callback.m_contacts.GetCount() > 0; -} - -bool ndScene::RayCast(ndRayCastNotify& callback, const ndBvhNode** stackPool, ndFloat32* const stackDistance, ndInt32 stack, const ndFastRay& ray) const -{ - bool state = false; - while (stack && (stack < (D_SCENE_MAX_STACK_DEPTH - 4))) - { - stack--; - ndFloat32 dist = stackDistance[stack]; - if (dist > callback.m_param) - { - break; - } - else - { - const ndBvhNode* const me = stackPool[stack]; - ndAssert(me); - ndBodyKinematic* const body = me->GetBody(); - if (body) - { - ndAssert(!me->GetLeft()); - ndAssert(!me->GetRight()); - - if (body->RayCast(callback, ray, callback.m_param)) - { - state = true; - if (callback.m_param < ndFloat32(1.0e-8f)) - { - break; - } - } - } - else - { - const ndBvhNode* const left = me->GetLeft(); - ndAssert(left); - ndFloat32 dist1 = ray.BoxIntersect(left->m_minBox, left->m_maxBox); - if (dist1 < callback.m_param) - { - ndInt32 j = stack; - for (; j && (dist1 > stackDistance[j - 1]); j--) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = left; - stackDistance[j] = dist1; - stack++; - ndAssert(stack < D_SCENE_MAX_STACK_DEPTH); - } - - const ndBvhNode* const right = me->GetRight(); - ndAssert(right); - dist1 = ray.BoxIntersect(right->m_minBox, right->m_maxBox); - if (dist1 < callback.m_param) - { - ndInt32 j = stack; - for (; j && (dist1 > stackDistance[j - 1]); j--) - { - stackPool[j] = stackPool[j - 1]; - stackDistance[j] = stackDistance[j - 1]; - } - stackPool[j] = right; - stackDistance[j] = dist1; - stack++; - ndAssert(stack < D_SCENE_MAX_STACK_DEPTH); - } - } - } - } - return state; -} - -void ndScene::BodiesInAabb(ndBodiesInAabbNotify& callback, const ndVector& minBox, const ndVector& maxBox) const -{ - callback.Reset(); - if (m_rootNode) - { - const ndBvhNode* stackPool[D_SCENE_MAX_STACK_DEPTH]; - stackPool[0] = m_rootNode; - ndInt32 stack = 1; - while (stack && (stack < (D_SCENE_MAX_STACK_DEPTH - 4))) - { - stack--; - - const ndBvhNode* const rootNode = stackPool[stack]; - ndAssert(rootNode); - if (ndOverlapTest(rootNode->m_minBox, rootNode->m_maxBox, minBox, maxBox)) - { - ndBodyKinematic* const body = rootNode->GetBody(); - if (body) - { - ndAssert(!rootNode->GetLeft()); - ndAssert(!rootNode->GetRight()); - if (ndOverlapTest(body->m_minAabb, body->m_maxAabb, minBox, maxBox)) - { - callback.OnOverlap(body); - } - } - else - { - const ndBvhNode* const left = rootNode->GetLeft(); - ndAssert(left); - stackPool[stack] = left; - stack++; - ndAssert(stack < D_SCENE_MAX_STACK_DEPTH); - - const ndBvhNode* const right = rootNode->GetRight(); - ndAssert(right); - stackPool[stack] = right; - stack++; - ndAssert(stack < D_SCENE_MAX_STACK_DEPTH); - } - } - } - } -} - -void ndScene::Cleanup() -{ - Sync(); - m_backgroundThread.Terminate(); - PrepareCleanup(); - - m_frameNumber = 0; - m_subStepNumber = 0; - - if (m_sentinelBody) - { - delete m_sentinelBody; - m_sentinelBody = nullptr; - } - - m_bvhSceneManager.CleanUp(); - m_contactArray.DeleteAllContacts(); - - ndFreeListAlloc::Flush(); - m_sceneBodyArray.Resize(1024); - m_activeConstraintArray.Resize(1024); - m_scratchBuffer.Resize(1024 * sizeof(void*)); - - m_scratchBuffer.SetCount(0); - m_sceneBodyArray.SetCount(0); - m_activeConstraintArray.SetCount(0); -} - -bool ndScene::RayCast(ndRayCastNotify& callback, const ndVector& globalOrigin, const ndVector& globalDest) const -{ - const ndVector p0(globalOrigin & ndVector::m_triplexMask); - const ndVector p1(globalDest & ndVector::m_triplexMask); - - bool state = false; - callback.m_param = ndFloat32(1.2f); - if (m_rootNode) - { - const ndVector segment(p1 - p0); - ndFloat32 dist2 = segment.DotProduct(segment).GetScalar(); - if (dist2 > ndFloat32(1.0e-8f)) - { - ndFloat32 distance[D_SCENE_MAX_STACK_DEPTH]; - const ndBvhNode* stackPool[D_SCENE_MAX_STACK_DEPTH]; - - ndFastRay ray(p0, p1); - - stackPool[0] = m_rootNode; - distance[0] = ray.BoxIntersect(m_rootNode->m_minBox, m_rootNode->m_maxBox); - state = RayCast(callback, stackPool, distance, 1, ray); - } - } - return state; -} - -bool ndScene::ConvexCast(ndConvexCastNotify& callback, const ndShapeInstance& convexShape, const ndMatrix& globalOrigin, const ndVector& globalDest) const -{ - bool state = false; - callback.m_param = ndFloat32(1.2f); - if (m_rootNode) - { - ndVector boxP0; - ndVector boxP1; - ndAssert(globalOrigin.TestOrthogonal()); - convexShape.CalculateAabb(globalOrigin, boxP0, boxP1); - - ndFloat32 distance[D_SCENE_MAX_STACK_DEPTH]; - const ndBvhNode* stackPool[D_SCENE_MAX_STACK_DEPTH]; - - const ndVector velocB(ndVector::m_zero); - const ndVector velocA((globalDest - globalOrigin.m_posit) & ndVector::m_triplexMask); - const ndVector minBox(m_rootNode->m_minBox - boxP1); - const ndVector maxBox(m_rootNode->m_maxBox - boxP0); - ndFastRay ray(ndVector::m_zero, velocA); - - stackPool[0] = m_rootNode; - distance[0] = ray.BoxIntersect(minBox, maxBox); - state = ConvexCast(callback, stackPool, distance, 1, ray, convexShape, globalOrigin, globalDest); - } - return state; -} - -void ndScene::SendBackgroundTask(ndBackgroundTask* const job) -{ - m_backgroundThread.SendTask(job); -} - -void ndScene::AddPair(ndBodyKinematic* const body0, ndBodyKinematic* const body1, ndInt32 threadId) -{ - const ndBodyKinematic::ndContactMap& contactMap0 = body0->GetContactMap(); - const ndBodyKinematic::ndContactMap& contactMap1 = body1->GetContactMap(); - - ndContact* const contact = (contactMap0.GetCount() <= contactMap1.GetCount()) ? contactMap0.FindContact(body0, body1) : contactMap1.FindContact(body1, body0); - if (!contact) - { - const ndJointBilateralConstraint* const bilateral = FindBilateralJoint(body0, body1); - const bool isCollidable = bilateral ? bilateral->IsCollidable() : true; - if (isCollidable) - { - ndArray& particalPairs = m_partialNewPairs[threadId]; - ndContactPairs pair(ndUnsigned32(body0->m_index), ndUnsigned32(body1->m_index)); - particalPairs.PushBack(pair); - } - } -} - -void ndScene::FindCollidingPairs() -{ - D_TRACKTIME(); - ndAtomic iterator0(0); - auto FindPairsForward = ndMakeObject::ndFunction([this, &iterator0](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(FindPairsForward); - const ndArray& bodyArray = m_sceneBodyArray; - - const ndInt32 count = ndInt32(m_sceneBodyArray.GetCount()); - for (ndInt32 i = iterator0.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator0.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - FindCollidingPairsForward(body, threadIndex); - } - } - }); - - ndAtomic iterator1(0); - auto FindPairsBackward = ndMakeObject::ndFunction([this, &iterator1](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(FindPairsBackward); - const ndArray& bodyArray = m_sceneBodyArray; - - const ndInt32 count = ndInt32(m_sceneBodyArray.GetCount()); - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - FindCollidingPairsBackward(body, threadIndex); - } - } - }); - - for (ndInt32 i = GetThreadCount() - 1; i >= 0; --i) - { - m_partialNewPairs[i].SetCount(0); - } - - const ndInt32 threadCount = GetThreadCount(); - - ParallelExecute(FindPairsForward); - ParallelExecute(FindPairsBackward); - - ndInt32 sum = 0; - for (ndInt32 i = 0; i < threadCount; ++i) - { - sum += ndInt32(m_partialNewPairs[i].GetCount()); - } - m_newPairs.SetCount(sum); - - sum = 0; - for (ndInt32 i = 0; i < threadCount; ++i) - { - const ndArray& newPairs = m_partialNewPairs[i]; - const ndInt32 count = ndInt32(newPairs.GetCount()); - if (count) - { - ndMemCpy(&m_newPairs[sum], &newPairs[0], count); - sum += count; - } - } -} - -void ndScene::UpdateBodyList() -{ - if (m_bodyList.UpdateView()) - { - ndArray& view = GetActiveBodyArray(); - // allow for bodies with null shape to be part of the simulation. - //#ifdef _DEBUG - //for (ndInt32 i = 0; i < view.GetCount(); ++i) - //{ - // ndBodyKinematic* const body = view[i]; - // ndAssert(!body->GetCollisionShape().GetShape()->GetAsShapeNull()); - //} - //#endif - view.PushBack(m_sentinelBody); - } -} - -void ndScene::ApplyExtForce() -{ - D_TRACKTIME(); - ndAtomic iterator(0); - auto ApplyForce = ndMakeObject::ndFunction([this, &iterator](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(ApplyForce); - const ndArray& view = GetActiveBodyArray(); - - const ndFloat32 timestep = m_timestep; - - const ndInt32 count = ndInt32(view.GetCount()) - 1; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = view[i + j]; - body->ApplyExternalForces(threadIndex, timestep); - } - } - }); - ParallelExecute(ApplyForce); -} - -void ndScene::InitBodyArray() -{ - D_TRACKTIME(); - ndAtomic iterator(0); - auto BuildBodyArray = ndMakeObject::ndFunction([this, &iterator](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(BuildBodyArray); - const ndArray& view = GetActiveBodyArray(); - - ndBvhNodeArray& array = m_bvhSceneManager.GetNodeArray(); - const ndInt32 count = ndInt32(view.GetCount()) - 1; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = view[i + j]; - body->PrepareStep(i + j); - ndUnsigned8 sceneEquilibrium = 1; - ndUnsigned8 sceneForceUpdate = body->m_sceneForceUpdate; - ndUnsigned8 moving = ndUnsigned8(!body->m_equilibrium); - if (moving | sceneForceUpdate) - { - ndBvhLeafNode* const bodyNode = (ndBvhLeafNode*)array[body->m_bodyNodeIndex]; - ndAssert(bodyNode->GetAsSceneBodyNode()); - ndAssert(bodyNode->m_body == body); - ndAssert(!bodyNode->GetLeft()); - ndAssert(!bodyNode->GetRight()); - - body->UpdateCollisionMatrix(); - const ndInt32 test = ndBoxInclusionTest(body->m_minAabb, body->m_maxAabb, bodyNode->m_minBox, bodyNode->m_maxBox); - if (!test) - { - bodyNode->SetAabb(body->m_minAabb, body->m_maxAabb); - } - sceneEquilibrium = ndUnsigned8(!sceneForceUpdate & (test != 0)); - } - body->m_sceneForceUpdate = 0; - body->m_sceneEquilibrium = sceneEquilibrium; - } - } - }); - - ParallelExecute(BuildBodyArray); - - ndUnsigned32 scans[4]; - class ndSortCompactKey - { - public: - ndSortCompactKey(const void* const) - { - } - - ndInt32 GetKey(const ndBodyKinematic* const body) const - { - return body->m_sceneEquilibrium; - } - }; - - ndArray& view = GetActiveBodyArray(); - ndInt32 movingBodyCount = 0; - ndInt32 sceneBodyCount = ndInt32(view.GetCount()) - 1; - if (sceneBodyCount) - { - m_sceneBodyArray.SetCount(sceneBodyCount); - ndCountingSort(*this, &view[0], &m_sceneBodyArray[0], sceneBodyCount, scans, nullptr); - movingBodyCount = ndInt32(scans[1] - scans[0]); - m_sceneBodyArray.SetCount(movingBodyCount); - } - - if (m_rootNode && m_rootNode->GetAsSceneTreeNode()) - { - const ndInt32 bodyCount = m_bodyList.GetCount(); - const ndInt32 cutoffCount = (ndExp2(bodyCount) + 1) * movingBodyCount; - if (cutoffCount < bodyCount) - { - ndAtomic iterator1(0); - auto UpdateSceneBvh = ndMakeObject::ndFunction([this, &iterator1](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(UpdateSceneBvh); - const ndArray& view = m_sceneBodyArray; - ndBvhNodeArray& array = m_bvhSceneManager.GetNodeArray(); - - const ndInt32 count = ndInt32(view.GetCount()); - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = view[i + j]; - ndBvhLeafNode* const bodyNode = (ndBvhLeafNode*)array[body->m_bodyNodeIndex]; - ndAssert(bodyNode->GetAsSceneBodyNode()); - ndAssert(bodyNode->GetBody() == body); - - const ndBvhNode* const root = (m_rootNode->GetLeft() && m_rootNode->GetRight()) ? nullptr : m_rootNode; - ndAssert(root == nullptr); - for (ndBvhInternalNode* parent = (ndBvhInternalNode*)bodyNode->m_parent; parent != root; parent = (ndBvhInternalNode*)parent->m_parent) - { - ndAssert(parent->GetAsSceneTreeNode()); - ndScopeSpinLock lock(parent->m_lock); - const ndVector minBox(parent->m_left->m_minBox.GetMin(parent->m_right->m_minBox)); - const ndVector maxBox(parent->m_left->m_maxBox.GetMax(parent->m_right->m_maxBox)); - if (ndBoxInclusionTest(minBox, maxBox, parent->m_minBox, parent->m_maxBox)) - { - break; - } - parent->m_minBox = minBox; - parent->m_maxBox = maxBox; - } - } - } - }); - - D_TRACKTIME_NAMED(UpdateSceneBvhLight); - ParallelExecute(UpdateSceneBvh); - } - else - { - m_bvhSceneManager.UpdateScene(*this); - } - } - - ndBodyKinematic* const sentinelBody = m_sentinelBody; - sentinelBody->PrepareStep(ndInt32(GetActiveBodyArray().GetCount()) - 1); - - sentinelBody->m_isStatic = 1; - sentinelBody->m_autoSleep = 1; - sentinelBody->m_equilibrium = 1; - sentinelBody->m_equilibrium0 = 1; - sentinelBody->m_isJointFence0 = 1; - sentinelBody->m_isJointFence1 = 1; - sentinelBody->m_isConstrained = 0; - sentinelBody->m_sceneEquilibrium = 1; - sentinelBody->m_weigh = ndFloat32(0.0f); -} - -void ndScene::CreateNewContacts() -{ - D_TRACKTIME(); - const ndInt32 contactCount = ndInt32(m_contactArray.GetCount()); - m_scratchBuffer.SetCount(ndInt32((contactCount + m_newPairs.GetCount() + 16) * sizeof(ndContact*))); - - ndContact** const tmpJointsArray = (ndContact**)&m_scratchBuffer[0]; - - ndAtomic iterator(0); - auto CreateNewContacts = ndMakeObject::ndFunction([this, &iterator, tmpJointsArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CreateNewContacts); - const ndArray& newPairs = m_newPairs; - ndBodyKinematic** const bodyArray = &GetActiveBodyArray()[0]; - - const ndInt32 count = ndInt32(newPairs.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndContactPairs& pair = newPairs[i + j]; - ndBodyKinematic* const body0 = bodyArray[pair.m_body0]; - ndBodyKinematic* const body1 = bodyArray[pair.m_body1]; - ndAssert(ndUnsigned32(body0->m_index) == pair.m_body0); - ndAssert(ndUnsigned32(body1->m_index) == pair.m_body1); - - ndContact* const contact = new ndContact; - contact->SetBodies(body0, body1); - contact->AttachToBodies(); - - ndAssert(contact->m_body0->GetInvMass() != ndFloat32(0.0f)); - contact->m_material = m_contactNotifyCallback->GetMaterial(contact, body0->GetCollisionShape(), body1->GetCollisionShape()); - tmpJointsArray[i + j] = contact; - } - } - }); - ParallelExecute(CreateNewContacts); - - if (contactCount) - { - D_TRACKTIME_NAMED(CopyContactArray) - const ndInt32 start = ndInt32(m_newPairs.GetCount()); - ndContact** const contactArray = &m_contactArray[0]; - for (ndInt32 i = 0; i < contactCount; ++i) - { - ndContact* const contact = contactArray[i]; - tmpJointsArray[start + i] = contact; - } - } -} - -void ndScene::CalculateContacts() -{ - D_TRACKTIME(); - m_activeConstraintArray.SetCount(0); - ndScopeSpinLock lock(m_contactArray.GetLock()); - const ndInt32 contactCount = ndInt32(m_contactArray.GetCount() + m_newPairs.GetCount()); - m_contactArray.SetCount(contactCount); - if (contactCount) - { - ndContact** const tmpJointsArray = (ndContact**)&m_scratchBuffer[0]; - - ndAtomic iterator(0); - auto CalculateContactPoints = ndMakeObject::ndFunction([this, &iterator, tmpJointsArray](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(CalculateContactPoints); - - const ndInt32 jointCount = ndInt32(m_contactArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < jointCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((jointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : jointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndContact* const contact = tmpJointsArray[i + j]; - ndAssert(contact); - if (!contact->m_isDead) - { - CalculateContacts(threadIndex, contact); - } - } - } - }); - ParallelExecute(CalculateContactPoints); - } -} - -void ndScene::DeleteDeadContacts() -{ - enum ndPairGroup - { - m_active, - m_inactive, - m_dead, - }; - - class ndJointActive - { - public: - ndJointActive(void* const) - { - m_code[0] = m_active; - m_code[1] = m_inactive; - m_code[2] = m_dead; - m_code[3] = m_dead; - } - - ndInt32 GetKey(const ndContact* const contact) const - { - //const ndUnsigned32 inactive = ndUnsigned32(!contact->IsActive() | (contact->m_maxDOF ? 0 : 1)); - const ndUnsigned32 inactive = ndUnsigned32(!contact->IsActive() | (contact->m_maxDof ? 0 : 1)); - const ndUnsigned32 idDead = contact->m_isDead; - return m_code[idDead * 2 + inactive]; - } - ndInt32 m_code[4]; - }; - ndUnsigned32 prefixScan[5]; - - ndScopeSpinLock lock(m_contactArray.GetLock()); - if (m_contactArray.GetCount()) - { - D_TRACKTIME(); - ndContact** const tmpJointsArray = (ndContact**)&m_scratchBuffer[0]; - ndCountingSort(*this, tmpJointsArray, &m_contactArray[0], ndInt32(m_contactArray.GetCount()), prefixScan, nullptr); - if (prefixScan[m_dead + 1] != prefixScan[m_dead]) - { - ndAtomic iterator(0); - auto DeleteContactArray = ndMakeObject::ndFunction([this, &iterator, &prefixScan](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(DeleteContactArray); - ndArray& contactArray = m_contactArray; - - const ndInt32 start = ndInt32(prefixScan[m_dead]); - const ndInt32 count = ndInt32(prefixScan[m_dead + 1] - start); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndContact* const contact = contactArray[start + i + j]; - ndAssert(contact->m_isDead); - if (contact->m_isAttached) - { - contact->DetachFromBodies(); - } - delete contact; - } - } - }); - - ParallelExecute(DeleteContactArray); - m_contactArray.SetCount(ndInt32(prefixScan[m_inactive + 1])); - } - - m_activeConstraintArray.SetCount(ndInt32(prefixScan[m_active + 1])); - if (m_activeConstraintArray.GetCount()) - { - ndConstraint** constraintArray = (ndConstraint**)& m_contactArray[0]; - ndMemCpy(&m_activeConstraintArray[0], constraintArray, m_activeConstraintArray.GetCount()); - } - } -} - -void ndScene::ParticleUpdate(ndFloat32 timestep) -{ - D_TRACKTIME(); - for (ndBodyList::ndNode* node = m_particleSetList.GetFirst(); node; node = node->GetNext()) - { - ndBodyParticleSet* const body = node->GetInfo()->GetAsBodyParticleSet(); - body->Update(this, timestep); - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndScene.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndScene.h deleted file mode 100644 index c2f6b24292..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndScene.h +++ /dev/null @@ -1,274 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SCENE_H__ -#define __ND_SCENE_H__ - -#include "ndCollisionStdafx.h" -#include "ndBvhNode.h" -#include "ndBodyListView.h" -#include "ndContactArray.h" -#include "ndPolygonMeshDesc.h" - -#define D_SCENE_MAX_STACK_DEPTH 256 - -class ndWorld; -class ndScene; -class ndContact; -class ndRayCastNotify; -class ndContactNotify; -class ndConvexCastNotify; -class ndBodiesInAabbNotify; -class ndJointBilateralConstraint; - -D_MSV_NEWTON_ALIGN_32 -class ndSceneTreeNotiFy : public ndClassAlloc -{ - public: - ndSceneTreeNotiFy() - { - } - - virtual ~ndSceneTreeNotiFy() - { - } - - virtual void OnDebugNode(const ndBvhNode* const node) = 0; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndScene : public ndThreadPool -{ - protected: - class ndContactPairs - { - public: - ndContactPairs(ndUnsigned32 body0, ndUnsigned32 body1) - :m_body0(ndMin(body0, body1)) - ,m_body1(ndMax(body0, body1)) - { - } - - ndUnsigned32 m_body0; - ndUnsigned32 m_body1; - }; - - public: - D_COLLISION_API virtual ~ndScene(); - D_COLLISION_API virtual bool AddBody(const ndSharedPtr& body); - D_COLLISION_API virtual bool RemoveBody(const ndSharedPtr& body); - - D_COLLISION_API ndSharedPtr GetBody(ndBody* const body) const; - - D_COLLISION_API virtual void Begin(); - D_COLLISION_API virtual void End(); - D_COLLISION_API virtual void Sync(); - D_COLLISION_API virtual bool IsHighPerformanceCompute() const; - D_COLLISION_API virtual bool IsValid() const; - - D_COLLISION_API virtual void Cleanup(); - D_COLLISION_API virtual void PrepareCleanup(); - - D_COLLISION_API ndContactNotify* GetContactNotify() const; - D_COLLISION_API void SetContactNotify(ndContactNotify* const notify); - - D_COLLISION_API virtual void DebugScene(ndSceneTreeNotiFy* const notify); - - D_COLLISION_API virtual void BodiesInAabb(ndBodiesInAabbNotify& callback, const ndVector& minBox, const ndVector& maxBox) const; - D_COLLISION_API virtual bool RayCast(ndRayCastNotify& callback, const ndVector& globalOrigin, const ndVector& globalDest) const; - D_COLLISION_API virtual bool ConvexCast(ndConvexCastNotify& callback, const ndShapeInstance& convexShape, const ndMatrix& globalOrigin, const ndVector& globalDest) const; - - D_COLLISION_API void SendBackgroundTask(ndBackgroundTask* const job); - - ndInt32 GetThreadCount() const; - - virtual ndWorld* GetWorld() const; - const ndBodyListView& GetBodyList() const; - const ndBodyList& GetParticleList() const; - - ndArray& GetActiveBodyArray(); - const ndArray& GetActiveBodyArray() const; - - ndArray& GetActiveContactArray(); - const ndArray& GetActiveContactArray() const; - - ndArray& GetScratchBuffer(); - - ndFloat32 GetTimestep() const; - void SetTimestep(ndFloat32 timestep); - ndBodyKinematic* GetSentinelBody() const; - - protected: - D_COLLISION_API ndScene(); - D_COLLISION_API ndScene(const ndScene& src); - bool ValidateContactCache(ndContact* const contact, const ndVector& timestep) const; - - const ndContactArray& GetContactArray() const; - void FindCollidingPairs(ndBodyKinematic* const body, ndInt32 threadId); - void FindCollidingPairsForward(ndBodyKinematic* const body, ndInt32 threadId); - void FindCollidingPairsBackward(ndBodyKinematic* const body, ndInt32 threadId); - void AddPair(ndBodyKinematic* const body0, ndBodyKinematic* const body1, ndInt32 threadId); - void SubmitPairs(ndBvhLeafNode* const bodyNode, ndBvhNode* const node, bool forward, ndInt32 threadId); - - void CalculateJointContacts(ndInt32 threadIndex, ndContact* const contact); - void ProcessContacts(ndInt32 threadIndex, ndInt32 contactCount, ndContactSolver* const contactSolver); - - ndJointBilateralConstraint* FindBilateralJoint(ndBodyKinematic* const body0, ndBodyKinematic* const body1) const; - bool RayCast(ndRayCastNotify& callback, const ndBvhNode** stackPool, ndFloat32* const distance, ndInt32 stack, const ndFastRay& ray) const; - bool ConvexCast(ndConvexCastNotify& callback, const ndBvhNode** stackPool, ndFloat32* const distance, ndInt32 stack, const ndFastRay& ray, const ndShapeInstance& convexShape, const ndMatrix& globalOrigin, const ndVector& globalDest) const; - - // call from sub steps update - D_COLLISION_API virtual void ApplyExtForce(); - D_COLLISION_API virtual void BalanceScene(); - D_COLLISION_API virtual void InitBodyArray(); - D_COLLISION_API virtual void UpdateSpecial(); - D_COLLISION_API virtual void UpdateBodyList(); - D_COLLISION_API virtual void UpdateTransform(); - D_COLLISION_API virtual void CreateNewContacts(); - D_COLLISION_API virtual void CalculateContacts(); - D_COLLISION_API virtual void FindCollidingPairs(); - D_COLLISION_API virtual void DeleteDeadContacts(); - - D_COLLISION_API virtual void CalculateContacts(ndInt32 threadIndex, ndContact* const contact); - D_COLLISION_API virtual void UpdateTransformNotify(ndInt32 threadIndex, ndBodyKinematic* const body); - - D_COLLISION_API virtual void ParticleUpdate(ndFloat32 timestep); - D_COLLISION_API virtual bool AddParticle(const ndSharedPtr& particle); - D_COLLISION_API virtual bool RemoveParticle(const ndSharedPtr& particle); - - ndBodyListView m_bodyList; - ndBodyList m_particleSetList; - ndContactArray m_contactArray; - ndBvhSceneManager m_bvhSceneManager; - ndArray m_scratchBuffer; - ndArray m_sceneBodyArray; - ndArray m_activeConstraintArray; - ndSpecialList m_specialUpdateList; - ndThreadBackgroundWorker m_backgroundThread; - ndArray m_newPairs; - ndArray m_partialNewPairs[D_MAX_THREADS_COUNT]; - ndPolygonMeshDesc::ndStaticMeshFaceQuery m_staticMeshQuery[D_MAX_THREADS_COUNT]; - ndPolygonMeshDesc::ndProceduralStaticMeshFaceQuery m_proceduralStaticMeshQuery[D_MAX_THREADS_COUNT]; - - ndSpinLock m_lock; - ndBvhNode* m_rootNode; - ndBodyKinematic* m_sentinelBody; - ndContactNotify* m_contactNotifyCallback; - - ndFloat32 m_timestep; - ndUnsigned32 m_lru; - ndUnsigned32 m_frameNumber; - ndUnsigned32 m_subStepNumber; - ndUnsigned32 m_forceBalanceSceneCounter; - - static ndVector m_velocTol; - static ndVector m_linearContactError2; - static ndVector m_angularContactError2; - - friend class ndWorld; - friend class ndBodyKinematic; - friend class ndRayCastNotify; - friend class ndPolygonMeshDesc; - friend class ndConvexCastNotify; - friend class ndSkeletonContainer; -} D_GCC_NEWTON_ALIGN_32 ; - -inline void ndScene::PrepareCleanup() -{ -} - -inline bool ndScene::IsValid() const -{ - return true; -} - -inline bool ndScene::IsHighPerformanceCompute() const -{ - return false; -} - -inline ndWorld* ndScene::GetWorld() const -{ - return nullptr; -} - -inline ndInt32 ndScene::GetThreadCount() const -{ - const ndThreadPool& pool = *this; - return pool.GetThreadCount(); -} - -inline ndArray& ndScene::GetScratchBuffer() -{ - return m_scratchBuffer; -} - -inline const ndBodyList& ndScene::GetParticleList() const -{ - return m_particleSetList; -} - -inline const ndBodyListView& ndScene::GetBodyList() const -{ - return m_bodyList; -} - -inline ndArray& ndScene::GetActiveContactArray() -{ - return m_activeConstraintArray; -} - -inline const ndContactArray& ndScene::GetContactArray() const -{ - return m_contactArray; -} - -inline const ndArray& ndScene::GetActiveContactArray() const -{ - return m_activeConstraintArray; -} - -inline ndArray& ndScene::GetActiveBodyArray() -{ - return m_bodyList.GetView(); -} - -inline const ndArray& ndScene::GetActiveBodyArray() const -{ - return m_bodyList.GetView(); -} - -inline ndFloat32 ndScene::GetTimestep() const -{ - return m_timestep; -} - -inline void ndScene::SetTimestep(ndFloat32 timestep) -{ - m_timestep = timestep; -} - -inline ndBodyKinematic* ndScene::GetSentinelBody() const -{ - return m_sentinelBody; -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.cpp deleted file mode 100644 index 3ab38ddf8f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndShape.h" - -ndVector ndShape::m_flushZero(ndFloat32(1.0e-7f)); - -ndShape::ndShape(ndShapeID id) - :ndContainersFreeListAlloc() - ,m_inertia(ndVector::m_zero) - ,m_crossInertia(ndVector::m_zero) - ,m_centerOfMass(ndVector::m_zero) - ,m_boxSize(ndVector::m_zero) - ,m_boxOrigin(ndVector::m_zero) - ,m_refCount(0) - ,m_collisionId(id) -{ -} - -ndShape::ndShape(const ndShape& source) - :ndContainersFreeListAlloc() - ,m_inertia(source.m_inertia) - ,m_crossInertia(source.m_crossInertia) - ,m_centerOfMass(source.m_centerOfMass) - ,m_boxSize(source.m_boxSize) - ,m_boxOrigin(source.m_boxOrigin) - ,m_refCount(0) - ,m_collisionId(source.m_collisionId) -{ -} - -ndShape::~ndShape() -{ - ndAssert(m_refCount.load() == 0); -} - -void ndShape::MassProperties() -{ - // using general central theorem, to extract the Inertia relative to the center of mass - //IImatrix = IIorigin + unitmass * [(displacemnet % displacemnet) * identityMatrix - transpose(displacement) * displacement)]; - - ndMatrix inertia(ndGetIdentityMatrix()); - inertia[0][0] = m_inertia[0]; - inertia[1][1] = m_inertia[1]; - inertia[2][2] = m_inertia[2]; - inertia[0][1] = m_crossInertia[2]; - inertia[1][0] = m_crossInertia[2]; - inertia[0][2] = m_crossInertia[1]; - inertia[2][0] = m_crossInertia[1]; - inertia[1][2] = m_crossInertia[0]; - inertia[2][1] = m_crossInertia[0]; - - ndVector origin(m_centerOfMass); - ndFloat32 originMag2 = origin.DotProduct(origin & ndVector::m_triplexMask).GetScalar(); - - ndMatrix Covariance(ndCovarianceMatrix(origin, origin)); - ndMatrix parallel(ndGetIdentityMatrix()); - for (ndInt32 i = 0; i < 3; ++i) - { - parallel[i][i] = originMag2; - inertia[i] += (parallel[i] - Covariance[i]); - ndAssert(inertia[i][i] > ndFloat32(0.0f)); - } - - m_inertia[0] = inertia[0][0]; - m_inertia[1] = inertia[1][1]; - m_inertia[2] = inertia[2][2]; - m_crossInertia[0] = inertia[2][1]; - m_crossInertia[1] = inertia[2][0]; - m_crossInertia[2] = inertia[1][0]; -} - -ndShapeInfo ndShape::GetShapeInfo() const -{ - ndShapeInfo info; - info.m_collisionType = m_collisionId; - return info; -} - -const ndShape* ndShape::AddRef() const -{ - m_refCount.fetch_add(1); - return this; -} - -ndInt32 ndShape::Release() const -{ - ndInt32 count = m_refCount.fetch_add(-1); - ndAssert(count >= 1); - if (count == 1) - { - delete this; - } - return count; -} - -ndInt32 ndShape::GetRefCount() const -{ - return m_refCount.load(); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.h deleted file mode 100644 index c6c1dc5541..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.h +++ /dev/null @@ -1,344 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_H__ -#define __ND_SHAPE_H__ - -#include "ndCollisionStdafx.h" - -class ndBody; -class ndShape; -class ndShapeBox; -class ndShapeNull; -class ndShapeCone; -class ndShapePoint; -class ndShapeConvex; -class ndShapeSphere; -class ndShapeCapsule; -class ndContactPoint; -class ndShapeCompound; -class ndShapeCylinder; -class ndShapeCompound; -class ndRayCastNotify; -class ndShapeInstance; -class ndShapeStatic_bvh; -class ndShapeStaticMesh; -class ndShapeHeightfield; -class ndShapeConvexPolygon; -class ndShapeDebugNotify; -class ndShapeChamferCylinder; -class ndShapeStaticProceduralMesh; - - -enum ndShapeID -{ - // do not change the order of these enum - m_box = 0, - m_cone, - m_sphere, - m_capsule, - m_cylinder, - m_chamferCylinder, - m_convexHull, // this must be the last convex shape ID - - // special and non convex collisions. - m_compound, - m_staticMesh, - m_heightField, - m_staticProceduralMesh, - m_nullCollision, - m_pointCollision, - m_polygonCollision, - m_boundingBoxHierachy, - - //m_deformableClothPatch, - //m_deformableSolidMesh, - // these are for internal use only - //m_contactCloud, - //m_lumpedMassCollision -}; - -class ndShapeMaterial -{ - public: - ndShapeMaterial() - :m_userId(0) - { - m_data.m_alignPad = 0; - for (ndInt32 i = 0; i < sizeof(m_userParam) / sizeof(m_userParam[0]); ++i) - { - m_userParam[i].m_intData = 0; - } - } - - ndInt64 m_userId; - union nData - { - void* m_userData; - ndUnsigned64 m_alignPad; - } m_data; - - union dExtraData - { - void* m_ptrData; - ndFloat32 m_floatData; - ndUnsigned64 m_intData; - } m_userParam[6]; -}; - -struct ndBoxInfo -{ - ndFloat32 m_x; - ndFloat32 m_y; - ndFloat32 m_z; -}; - -struct ndPointInfo -{ - ndFloat32 m_noUsed; -}; - -struct ndSphereInfo -{ - ndFloat32 m_radius; -}; - -struct ndCylinderInfo -{ - ndFloat32 m_radio0; - ndFloat32 m_radio1; - ndFloat32 m_height; -}; - -struct ndCapsuleInfo -{ - ndFloat32 m_radio0; - ndFloat32 m_radio1; - ndFloat32 m_height; -}; - -struct ndConeInfo -{ - ndFloat32 m_radius; - ndFloat32 m_height; -}; - -struct ndChamferCylinderInfo -{ - ndFloat32 m_r; - ndFloat32 m_height; -}; - -struct ndConvexHullInfo -{ - ndInt32 m_vertexCount; - ndInt32 m_strideInBytes; - ndInt32 m_faceCount; - ndVector* m_vertex; -}; - -struct ndCompoundInfo -{ - ndInt32 m_noUsed; -}; - -struct ndProceduralInfo -{ - ndInt32 m_noUsed; -}; - -struct ndCollisionBvhInfo -{ - ndInt32 m_vertexCount; - ndInt32 m_indexCount; -}; - -struct ndHeighfieldInfo -{ - ndInt32 m_width; - ndInt32 m_height; - ndInt32 m_gridsDiagonals; - ndFloat32 m_verticalScale; - ndFloat32 m_horizonalScale_x; - ndFloat32 m_horizonalScale_z; - ndReal* m_elevation; - ndInt8* m_atributes; -}; - -D_MSV_NEWTON_ALIGN_32 -class ndShapeInfo -{ - public: - ndShapeInfo(); - ndUnsigned64 GetHash(ndUnsigned64 hash); - - ndMatrix m_offsetMatrix; - ndVector m_scale; - ndShapeMaterial m_shapeMaterial; - ndShapeID m_collisionType; - union - { - ndBoxInfo m_box; - ndConeInfo m_cone; - ndPointInfo m_point; - ndSphereInfo m_sphere; - ndCapsuleInfo m_capsule; - ndCollisionBvhInfo m_bvh; - ndCylinderInfo m_cylinder; - ndCompoundInfo m_compound; - ndConvexHullInfo m_convexhull; - ndHeighfieldInfo m_heightfield; - ndProceduralInfo m_procedural; - ndChamferCylinderInfo m_chamferCylinder; - ndFloat32 m_paramArray[32]; - }; - -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndShape: public ndContainersFreeListAlloc -{ - public: - D_BASE_CLASS_REFLECTION(ndShape) - D_COLLISION_API virtual ~ndShape(); - - D_COLLISION_API ndInt32 GetRefCount() const; - D_COLLISION_API virtual ndInt32 Release() const; - D_COLLISION_API virtual const ndShape* AddRef() const; - - virtual ndShapeBox* GetAsShapeBox() { return nullptr; } - virtual ndShapeNull* GetAsShapeNull() { return nullptr; } - virtual ndShapeCone* GetAsShapeCone() { return nullptr; } - virtual ndShapePoint* GetAsShapePoint() { return nullptr; } - virtual ndShapeConvex* GetAsShapeConvex() { return nullptr; } - virtual ndShapeSphere* GetAsShapeSphere() { return nullptr; } - virtual ndShapeCapsule* GetAsShapeCapsule() { return nullptr; } - virtual ndShapeCylinder* GetAsShapeCylinder() { return nullptr; } - virtual ndShapeCompound* GetAsShapeCompound() { return nullptr; } - virtual ndShapeStatic_bvh* GetAsShapeStaticBVH() { return nullptr; } - virtual ndShapeStaticMesh* GetAsShapeStaticMesh() { return nullptr; } - virtual ndShapeHeightfield* GetAsShapeHeightfield() { return nullptr; } - virtual ndShapeConvexPolygon* GetAsShapeAsConvexPolygon() { return nullptr; } - virtual ndShapeChamferCylinder* GetAsShapeChamferCylinder() { return nullptr; } - virtual ndShapeStaticProceduralMesh* GetAsShapeStaticProceduralMesh() { return nullptr; } - - virtual ndInt32 GetConvexVertexCount() const; - - ndVector GetObbSize() const; - ndVector GetObbOrigin() const; - ndFloat32 GetUmbraClipSize() const; - - D_COLLISION_API virtual void MassProperties(); - - virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const = 0; - - virtual ndShapeInfo GetShapeInfo() const; - virtual ndFloat32 GetVolume() const = 0; - virtual ndFloat32 GetBoxMinRadius() const = 0; - virtual ndFloat32 GetBoxMaxRadius() const = 0; - virtual ndUnsigned64 GetHash(ndUnsigned64 hash = 0) const; - - virtual ndVector SupportVertex(const ndVector& dir) const = 0; - virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const = 0; - virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const = 0; - virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const = 0; - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const = 0; - virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& globalPlane, const ndShapeInstance& parentScale) const = 0; - virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const = 0; - - virtual ndMatrix CalculateInertiaAndCenterOfMass(const ndMatrix& alignMatrix, const ndVector& localScale, const ndMatrix& matrix) const; - virtual ndFloat32 CalculateMassProperties(const ndMatrix& offset, ndVector& inertia, ndVector& crossInertia, ndVector& centerOfMass) const; - - protected: - D_COLLISION_API ndShape(ndShapeID id); - D_COLLISION_API ndShape (const ndShape& source); - - ndVector m_inertia; - ndVector m_crossInertia; - ndVector m_centerOfMass; - ndVector m_boxSize; - ndVector m_boxOrigin; - mutable ndAtomic m_refCount; - ndShapeID m_collisionId; - static ndVector m_flushZero; -} D_GCC_NEWTON_ALIGN_32; - -inline ndShapeInfo::ndShapeInfo() - :m_offsetMatrix(ndGetIdentityMatrix()) - ,m_scale(ndFloat32 (1.0f)) - ,m_shapeMaterial() - ,m_collisionType(::m_box) -{ - for (ndInt32 i = 0; i < sizeof(m_paramArray) / sizeof(m_paramArray[0]); ++i) - { - m_paramArray[i] = ndFloat32(0); - } -} - -inline ndUnsigned64 ndShapeInfo::GetHash(ndUnsigned64 hash) -{ - ndInt32 id = m_collisionType; - hash = ndCRC64(m_paramArray, sizeof (m_paramArray), hash); - hash = ndCRC64(&id, sizeof(id), hash); - return hash; -} - -inline ndInt32 ndShape::GetConvexVertexCount() const -{ - return 0; -} - -inline ndFloat32 ndShape::CalculateMassProperties(const ndMatrix&, ndVector&, ndVector&, ndVector&) const -{ - ndAssert(0); - return 0; -} - -inline ndMatrix ndShape::CalculateInertiaAndCenterOfMass(const ndMatrix&, const ndVector&, const ndMatrix&) const -{ - ndAssert(0); - return ndGetZeroMatrix(); -} - -inline ndVector ndShape::GetObbOrigin() const -{ - return m_boxOrigin; -} - -inline ndVector ndShape::GetObbSize() const -{ - return m_boxSize; -} - -inline ndFloat32 ndShape::GetUmbraClipSize() const -{ - return ndFloat32(3.0f) * GetBoxMaxRadius(); -} - -inline ndUnsigned64 ndShape::GetHash(ndUnsigned64 hash) const -{ - ndAssert(0); - return hash; -} - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeBox.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeBox.cpp deleted file mode 100644 index 8c99ae5586..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeBox.cpp +++ /dev/null @@ -1,489 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndShapeBox.h" -#include "ndContactSolver.h" - -ndInt32 ndShapeBox::m_initSimplex = 0; -ndShapeConvex::ndConvexSimplexEdge ndShapeBox::m_edgeArray[24]; -ndShapeConvex::ndConvexSimplexEdge* ndShapeBox::m_edgeEdgeMap[12]; -ndShapeConvex::ndConvexSimplexEdge* ndShapeBox::m_vertexToEdgeMap[8]; -ndInt32 ndShapeBox::m_faces[][4] = -{ - {0, 1, 3, 2}, - {0, 4, 5, 1}, - {1, 5, 7, 3}, - {0, 2, 6, 4}, - {2, 3, 7, 6}, - {4, 6, 7, 5}, -}; - -ndVector ndShapeBox::m_indexMark(ndFloat32(1.0f), ndFloat32(2.0f), ndFloat32(4.0f), ndFloat32(0.0f)); -ndVector ndShapeBox::m_penetrationTol(D_PENETRATION_TOL, D_PENETRATION_TOL, D_PENETRATION_TOL, ndFloat32(0.0f)); - -ndShapeBox::ndShapeBox(ndFloat32 size_x, ndFloat32 size_y, ndFloat32 size_z) - :ndShapeConvex(m_box) -{ - Init(size_x, size_y, size_z); -} - -ndShapeBox::~ndShapeBox() -{ - ndShapeConvex::m_simplex = nullptr; - ndShapeConvex::m_vertex = nullptr; -} - -void ndShapeBox::Init(ndFloat32 size_x, ndFloat32 size_y, ndFloat32 size_z) -{ - m_size[0].m_x = ndMax(ndAbs(size_x) * ndFloat32(0.5f), D_MIN_CONVEX_SHAPE_SIZE); - m_size[0].m_y = ndMax(ndAbs(size_y) * ndFloat32(0.5f), D_MIN_CONVEX_SHAPE_SIZE); - m_size[0].m_z = ndMax(ndAbs(size_z) * ndFloat32(0.5f), D_MIN_CONVEX_SHAPE_SIZE); - m_size[0].m_w = ndFloat32(0.0f); - - m_size[1].m_x = -m_size[0].m_x; - m_size[1].m_y = -m_size[0].m_y; - m_size[1].m_z = -m_size[0].m_z; - m_size[1].m_w = ndFloat32(0.0f); - - m_edgeCount = 24; - m_vertexCount = 8; - - m_vertex[0] = ndVector(m_size[0].m_x, m_size[0].m_y, m_size[0].m_z, ndFloat32(0.0f)); - m_vertex[1] = ndVector(-m_size[0].m_x, m_size[0].m_y, m_size[0].m_z, ndFloat32(0.0f)); - m_vertex[2] = ndVector(m_size[0].m_x, -m_size[0].m_y, m_size[0].m_z, ndFloat32(0.0f)); - m_vertex[3] = ndVector(-m_size[0].m_x, -m_size[0].m_y, m_size[0].m_z, ndFloat32(0.0f)); - - m_vertex[4] = ndVector(m_size[0].m_x, m_size[0].m_y, -m_size[0].m_z, ndFloat32(0.0f)); - m_vertex[5] = ndVector(-m_size[0].m_x, m_size[0].m_y, -m_size[0].m_z, ndFloat32(0.0f)); - m_vertex[6] = ndVector(m_size[0].m_x, -m_size[0].m_y, -m_size[0].m_z, ndFloat32(0.0f)); - m_vertex[7] = ndVector(-m_size[0].m_x, -m_size[0].m_y, -m_size[0].m_z, ndFloat32(0.0f)); - - ndShapeConvex::m_vertex = m_vertex; - ndShapeConvex::m_simplex = m_edgeArray; - - if (!m_initSimplex) - { - ndPolyhedra polyhedra; - polyhedra.BeginFace(); - for (ndInt32 i = 0; i < 6; ++i) - { - polyhedra.AddFace(4, &m_faces[i][0]); - } - polyhedra.EndFace(); - - ndInt32 index = 0; - ndInt32 mark = polyhedra.IncLRU();; - ndPolyhedra::Iterator iter(polyhedra); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if (edge->m_mark != mark) - { - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - ptr->m_userData = ndUnsigned64(index); - index++; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - } - } - ndAssert(index == 24); - - polyhedra.IncLRU(); - mark = polyhedra.IncLRU(); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - ndEdge *ptr = edge; - do - { - ptr->m_mark = mark; - ndConvexSimplexEdge* const simplexPtr = &m_simplex[ptr->m_userData]; - simplexPtr->m_vertex = ptr->m_incidentVertex; - simplexPtr->m_next = &m_simplex[ptr->m_next->m_userData]; - simplexPtr->m_prev = &m_simplex[ptr->m_prev->m_userData]; - simplexPtr->m_twin = &m_simplex[ptr->m_twin->m_userData]; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - } - - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - m_vertexToEdgeMap[edge->m_incidentVertex] = &m_simplex[edge->m_userData]; - } - - ndInt32 count = 0; - mark = polyhedra.IncLRU(); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if (edge->m_mark != mark) - { - edge->m_mark = mark; - edge->m_twin->m_mark = mark; - m_edgeEdgeMap[count] = &m_simplex[edge->m_userData]; - count++; - ndAssert(count <= 12); - } - } - - m_initSimplex = 1; - } - - SetVolumeAndCG(); -} - -void ndShapeBox::MassProperties() -{ - m_centerOfMass = ndVector::m_zero; - m_crossInertia = ndVector::m_zero; - ndFloat32 volume = ndFloat32(8.0f) * m_size[0].m_x * m_size[0].m_y * m_size[0].m_z; - m_inertia = ndVector(ndFloat32(1.0f / 3.0f) * (m_size[0].m_y * m_size[0].m_y + m_size[0].m_z * m_size[0].m_z), - ndFloat32(1.0f / 3.0f) * (m_size[0].m_x * m_size[0].m_x + m_size[0].m_z * m_size[0].m_z), - ndFloat32(1.0f / 3.0f) * (m_size[0].m_x * m_size[0].m_x + m_size[0].m_y * m_size[0].m_y), - ndFloat32(0.0f)); - m_centerOfMass.m_w = volume; -} - -void ndShapeBox::CalculateAabb(const ndMatrix& matrix, ndVector &p0, ndVector &p1) const -{ - const ndVector size(matrix[0].Abs().Scale(m_size[0].m_x) + matrix[1].Abs().Scale(m_size[0].m_y) + matrix[2].Abs().Scale(m_size[0].m_z)); - p0 = (matrix[3] - size) & ndVector::m_triplexMask; - p1 = (matrix[3] + size) & ndVector::m_triplexMask; -} - -ndVector ndShapeBox::SupportVertex(const ndVector& dir0) const -{ - const ndVector mask0(dir0.Abs() > m_flushZero); - const ndVector dir(dir0 & mask0); - - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - ndAssert(dir.m_w == ndFloat32(0.0f)); - const ndVector mask(dir < ndVector::m_zero); - //if (vertexIndex) - //{ - // ndVector index(m_indexMark * (mask & ndVector::m_one)); - // index = (index.AddHorizontal()).GetInt(); - // *vertexIndex = ndInt32(index.m_ix); - //} - return m_size[0].Select(m_size[1], mask); -} - -ndVector ndShapeBox::SupportFeatureVertex(const ndVector& dir0, ndInt32* const vertexIndex) const -{ - const ndVector mask0(dir0.Abs() > m_flushZero); - const ndVector dir(dir0 & mask0); - - ndAssert(vertexIndex); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - ndAssert(dir.m_w == ndFloat32(0.0f)); - const ndVector mask(dir < ndVector::m_zero); - ndVector index(m_indexMark * (mask & ndVector::m_one)); - index = (index.AddHorizontal()).GetInt(); - *vertexIndex = ndInt32(index.m_ix); - return m_size[0].Select(m_size[1], mask); -} - -ndVector ndShapeBox::SupportVertexSpecial(const ndVector& dir0, ndFloat32) const -{ - const ndVector mask0(dir0.Abs() > m_flushZero); - const ndVector dir(dir0 & mask0); - - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - ndAssert(dir.m_w == ndFloat32(0.0f)); - const ndVector mask(dir < ndVector::m_zero); - //if (vertexIndex) - //{ - // ndVector index(m_indexMark * (mask & ndVector::m_one)); - // index = (index.AddHorizontal()).GetInt(); - // *vertexIndex = ndInt32(index.m_ix); - //} - - const ndVector size0(m_size[0] - m_penetrationTol); - const ndVector size1(m_size[1] + m_penetrationTol); - return size0.Select(size1, mask); -} - -ndVector ndShapeBox::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir0) const -{ - const ndVector mask0(dir0.Abs() > m_flushZero); - const ndVector dir(dir0 & mask0); - ndAssert(ndAbs((dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f))) < ndFloat32(1.0e-3f)); - return point + dir.Scale(D_PENETRATION_TOL); -} - -ndFloat32 ndShapeBox::RayCast(ndRayCastNotify&, const ndVector& localP0, const ndVector& localP1, ndFloat32, const ndBody* const, ndContactPoint& contactOut) const -{ - ndAssert(localP0.m_w == localP1.m_w); - - ndInt32 index = 0; - ndFloat32 signDir = ndFloat32(0.0f); - ndFloat32 tmin = ndFloat32(0.0f); - ndFloat32 tmax = ndFloat32(1.0f); - for (ndInt32 i = 0; i < 3; ++i) - { - ndFloat32 dp = localP1[i] - localP0[i]; - if (ndAbs(dp) < ndFloat32(1.0e-8f)) - { - if (localP0[i] <= m_size[1][i] || localP0[i] >= m_size[0][i]) - { - return ndFloat32(1.2f); - } - } - else - { - dp = ndFloat32(1.0f) / dp; - ndFloat32 t1 = (m_size[1][i] - localP0[i]) * dp; - ndFloat32 t2 = (m_size[0][i] - localP0[i]) * dp; - - ndFloat32 sign = ndFloat32(-1.0f); - if (t1 > t2) - { - sign = 1; - ndSwap(t1, t2); - } - if (t1 > tmin) - { - signDir = sign; - index = i; - tmin = t1; - } - if (t2 < tmax) - { - tmax = t2; - } - if (tmin > tmax) - { - return ndFloat32(1.2f); - } - } - } - - if (tmin > ndFloat32(0.0f)) - { - ndAssert(tmin <= 1.0f); - contactOut.m_normal = ndVector::m_zero; - contactOut.m_normal[index] = signDir; - //contactOut.m_userId = SetUserDataID(); - } - else - { - tmin = ndFloat32(1.2f); - } - return tmin; -} - -const ndShapeConvex::ndConvexSimplexEdge** ndShapeBox::GetVertexToEdgeMapping() const -{ - return (const ndConvexSimplexEdge**)&m_vertexToEdgeMap[0]; -} - -ndInt32 ndShapeBox::CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const -{ - ndVector support[4]; - ndInt32 featureCount = 3; - - const ndConvexSimplexEdge** const vertToEdgeMapping = GetVertexToEdgeMapping(); - if (vertToEdgeMapping) - { - ndInt32 edgeIndex; - support[0] = SupportFeatureVertex(normal, &edgeIndex); - - ndFloat32 dist = normal.DotProduct(support[0] - point).GetScalar(); - if (dist <= D_PENETRATION_TOL) - { - ndVector normalAlgin(normal.Abs()); - if (!((normalAlgin.m_x > ndFloat32(0.9999f)) || (normalAlgin.m_y > ndFloat32(0.9999f)) || (normalAlgin.m_z > ndFloat32(0.9999f)))) - { - // 0.25 degrees - const ndFloat32 tiltAngle = ndFloat32(0.005f); - const ndFloat32 tiltAngle2 = tiltAngle * tiltAngle; - ndPlane testPlane(normal, -(normal.DotProduct(support[0]).GetScalar())); - - featureCount = 1; - const ndConvexSimplexEdge* const edge = vertToEdgeMapping[edgeIndex]; - const ndConvexSimplexEdge* ptr = edge; - do - { - const ndVector& p = m_vertex[ptr->m_twin->m_vertex]; - ndFloat32 test1 = testPlane.Evalue(p); - ndVector dist1(p - support[0]); - ndFloat32 angle2 = test1 * test1 / (dist1.DotProduct(dist1).GetScalar()); - if (angle2 < tiltAngle2) - { - support[featureCount] = p; - featureCount++; - } - ptr = ptr->m_twin->m_next; - } while ((ptr != edge) && (featureCount < 3)); - } - } - } - - ndInt32 count = 0; - switch (featureCount) - { - case 1: - { - contactsOut[0] = support[0] - normal * normal.DotProduct(support[0] - point); - count = 1; - break; - } - - case 2: - { - contactsOut[0] = support[0] - normal * normal.DotProduct(support[0] - point); - contactsOut[1] = support[1] - normal * normal.DotProduct(support[1] - point); - count = 2; - break; - } - - default: - { - ndFloat32 test[8]; - ndAssert(normal.m_w == ndFloat32(0.0f)); - ndPlane plane(normal, -(normal.DotProduct(point).GetScalar())); - for (ndInt32 i = 0; i < 8; ++i) - { - ndAssert(m_vertex[i].m_w == ndFloat32(0.0f)); - test[i] = plane.DotProduct(m_vertex[i] | ndVector::m_wOne).m_x; - } - - ndConvexSimplexEdge* edge = nullptr; - for (ndInt32 i = 0; i < ndInt32(sizeof(m_edgeEdgeMap) / sizeof(m_edgeEdgeMap[0])); ++i) - { - ndConvexSimplexEdge* const ptr = m_edgeEdgeMap[i]; - ndFloat32 side0 = test[ptr->m_vertex]; - ndFloat32 side1 = test[ptr->m_twin->m_vertex]; - if ((side0 * side1) < ndFloat32(0.0f)) - { - edge = ptr; - break; - } - } - - if (edge) - { - if (test[edge->m_vertex] < ndFloat32(0.0f)) - { - edge = edge->m_twin; - } - ndAssert(test[edge->m_vertex] > ndFloat32(0.0f)); - - ndConvexSimplexEdge* ptr = edge; - ndConvexSimplexEdge* firstEdge = nullptr; - ndFloat32 side0 = test[edge->m_vertex]; - do - { - ndAssert(m_vertex[ptr->m_twin->m_vertex].m_w == ndFloat32(0.0f)); - ndFloat32 side1 = test[ptr->m_twin->m_vertex]; - if (side1 < side0) - { - if (side1 < ndFloat32(0.0f)) - { - firstEdge = ptr; - break; - } - - side0 = side1; - edge = ptr->m_twin; - ptr = edge; - } - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - - if (firstEdge) - { - edge = firstEdge; - ptr = edge; - do - { - ndVector dp(m_vertex[ptr->m_twin->m_vertex] - m_vertex[ptr->m_vertex]); - ndFloat32 t = plane.DotProduct(dp).m_x; - if (t >= ndFloat32(-1.e-24f)) - { - t = ndFloat32(0.0f); - } - else - { - t = test[ptr->m_vertex] / t; - if (t > ndFloat32(0.0f)) - { - t = ndFloat32(0.0f); - } - if (t < ndFloat32(-1.0f)) - { - t = ndFloat32(-1.0f); - } - } - - ndAssert(t <= ndFloat32(0.01f)); - ndAssert(t >= ndFloat32(-1.05f)); - contactsOut[count] = m_vertex[ptr->m_vertex] - dp.Scale(t); - count++; - - ndConvexSimplexEdge* ptr1 = ptr->m_next; - for (; ptr1 != ptr; ptr1 = ptr1->m_next) - { - ndInt32 index0 = ptr1->m_twin->m_vertex; - if (test[index0] >= ndFloat32(0.0f)) - { - ndAssert(test[ptr1->m_vertex] <= ndFloat32(0.0f)); - break; - } - } - ndAssert(ptr != ptr1); - ptr = ptr1->m_twin; - - } while ((ptr != edge) && (count < 8)); - } - } - } - } - - if (count > 2) - { - count = RectifyConvexSlice(count, normal, contactsOut); - } - return count; -} - -ndShapeInfo ndShapeBox::GetShapeInfo() const -{ - ndShapeInfo info(ndShapeConvex::GetShapeInfo()); - info.m_box.m_x = m_size[0].m_x * ndFloat32(2.0f); - info.m_box.m_y = m_size[0].m_y * ndFloat32(2.0f); - info.m_box.m_z = m_size[0].m_z * ndFloat32(2.0f); - return info; -} - -ndUnsigned64 ndShapeBox::GetHash(ndUnsigned64 hash) const -{ - ndShapeInfo info(GetShapeInfo()); - return info.GetHash(hash); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeBox.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeBox.h deleted file mode 100644 index 5734228b09..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeBox.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_BOX_H__ -#define __ND_SHAPE_BOX_H__ - -#include "ndShapeConvex.h" - -D_MSV_NEWTON_ALIGN_32 -class ndShapeBox: public ndShapeConvex -{ - public: - D_CLASS_REFLECTION(ndShapeBox,ndShapeConvex) - D_COLLISION_API ndShapeBox(ndFloat32 size_x, ndFloat32 size_y, ndFloat32 size_z); - D_COLLISION_API virtual ~ndShapeBox(); - - D_COLLISION_API virtual ndShapeBox* GetAsShapeBox() { return this; } - - protected: - D_COLLISION_API void Init (ndFloat32 size_x, ndFloat32 size_y, ndFloat32 size_z); - D_COLLISION_API virtual void MassProperties(); - - D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; - D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; - D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; - D_COLLISION_API virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - - D_COLLISION_API const ndConvexSimplexEdge** GetVertexToEdgeMapping() const; - D_COLLISION_API virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - - - virtual ndVector SupportFeatureVertex(const ndVector& dir, ndInt32* const vertexIndex) const; - ndVector m_size[2]; - ndVector m_vertex[8]; - - static ndInt32 m_initSimplex; - static ndInt32 m_faces[][4]; - static ndVector m_indexMark; - static ndVector m_penetrationTol; - static ndConvexSimplexEdge m_edgeArray[]; - static ndConvexSimplexEdge* m_edgeEdgeMap[]; - static ndConvexSimplexEdge* m_vertexToEdgeMap[]; -} D_GCC_NEWTON_ALIGN_32; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCapsule.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCapsule.cpp deleted file mode 100644 index 0211fd06df..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCapsule.cpp +++ /dev/null @@ -1,507 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndShapeCapsule.h" -#include "ndContactSolver.h" - -#define DG_CAPSULE_SEGMENTS 10 -#define DG_CAPSULE_CAP_SEGMENTS 12 - -ndShapeCapsule::ndShapeCapsule(ndFloat32 radius0, ndFloat32 radius1, ndFloat32 height) - :ndShapeConvex(m_capsule) -{ - Init(radius0, radius1, height); -} - -void ndShapeCapsule::Init(ndFloat32 radio0, ndFloat32 radio1, ndFloat32 height) -{ - radio0 = ndMax(ndAbs(radio0), D_MIN_CONVEX_SHAPE_SIZE); - radio1 = ndMax(ndAbs(radio1), D_MIN_CONVEX_SHAPE_SIZE); - height = ndMax(ndAbs(height), D_MIN_CONVEX_SHAPE_SIZE); - - m_transform = ndVector(ndFloat32(1.0f), ndFloat32(1.0f), ndFloat32(1.0f), ndFloat32(0.0f)); - if (radio0 > radio1) - { - m_transform.m_x = ndFloat32(-1.0f); - m_transform.m_y = ndFloat32(-1.0f); - ndSwap(radio0, radio1); - } - - m_radius0 = radio0; - m_radius1 = radio1; - m_height = height * ndFloat32(0.5f); - - m_p0 = ndVector(-m_height, m_radius0, ndFloat32(0.0f), ndFloat32(0.0f)); - m_p1 = ndVector( m_height, m_radius1, ndFloat32(0.0f), ndFloat32(0.0f)); - m_normal = ndVector(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector side(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f)); - - for (ndInt32 i = 0; i < 16; ++i) - { - ndVector p1p0(m_p1 - m_p0); - m_normal = side.CrossProduct(p1p0).Normalize(); - ndVector support0(m_normal.Scale(m_radius0)); - ndVector support1(m_normal.Scale(m_radius1)); - support0.m_x -= m_height; - support1.m_x += m_height; - ndFloat32 distance0 = support0.DotProduct(m_normal).GetScalar(); - ndFloat32 distance1 = support1.DotProduct(m_normal).GetScalar(); - - if (distance1 > distance0) - { - m_p1 = support1; - } - else if (distance1 < distance0) - { - m_p0 = support0; - } - else - { - i = 1000; - } - } - - ndVector tempVertex[4 * DG_CAPSULE_CAP_SEGMENTS * DG_CAPSULE_SEGMENTS + 100]; - ndInt32 index = 0; - ndInt32 dx0 = ndInt32(ndFloor(DG_CAPSULE_SEGMENTS * ((m_p0.m_x + m_height + m_radius0) / m_radius0)) + ndFloat32(1.0f)); - ndFloat32 step = m_radius0 / DG_CAPSULE_SEGMENTS; - ndFloat32 x0 = m_p0.m_x - step * (ndFloat32)dx0; - for (ndInt32 j = 0; j < dx0; ++j) - { - x0 += step; - ndFloat32 x = x0 + m_height; - ndFloat32 arg = ndMax(m_radius0 * m_radius0 - x * x, ndFloat32(1.0e-3f)); - ndFloat32 r0 = ndSqrt(arg); - - ndFloat32 angle = ndFloat32(0.0f); - for (ndInt32 i = 0; i < DG_CAPSULE_CAP_SEGMENTS; ++i) - { - ndFloat32 z = ndSin(angle); - ndFloat32 y = ndCos(angle); - tempVertex[index] = ndVector(x0, y * r0, z * r0, ndFloat32(0.0f)); - index++; - angle += (ndFloat32(2.0f) * ndPi) / DG_CAPSULE_CAP_SEGMENTS; - ndAssert(index < ndInt32 (sizeof(tempVertex) / sizeof(tempVertex[0]))); - } - } - - ndFloat32 x1 = m_p1.m_x; - ndInt32 dx1 = ndInt32(ndFloor(DG_CAPSULE_SEGMENTS * ((m_height + m_radius1 - m_p1.m_x) / m_radius1)) + ndFloat32(1.0f)); - step = m_radius1 / DG_CAPSULE_SEGMENTS; - for (ndInt32 j = 0; j < dx1; ++j) - { - ndFloat32 x = x1 - m_height; - ndFloat32 arg = ndMax(m_radius1 * m_radius1 - x * x, ndFloat32(1.0e-3f)); - ndFloat32 r1 = ndSqrt(arg); - ndFloat32 angle = ndFloat32(0.0f); - for (ndInt32 i = 0; i < DG_CAPSULE_CAP_SEGMENTS; ++i) - { - ndFloat32 z = ndSin(angle); - ndFloat32 y = ndCos(angle); - tempVertex[index] = ndVector(x1, y * r1, z * r1, ndFloat32(0.0f)); - index++; - angle += (ndFloat32(2.0f) * ndPi) / DG_CAPSULE_CAP_SEGMENTS; - ndAssert(index < ndInt32 (sizeof(tempVertex) / sizeof(tempVertex[0]))); - } - x1 += step; - } - - m_vertexCount = ndUnsigned16(index); - ndShapeConvex::m_vertex = (ndVector*)ndMemory::Malloc(size_t(m_vertexCount * sizeof(ndVector))); - ndMemCpy(ndShapeConvex::m_vertex, tempVertex, m_vertexCount); - - ndPolyhedra polyhedra; - polyhedra.BeginFace(); - - ndInt32 wireframe[DG_CAPSULE_SEGMENTS + 10]; - - ndInt32 i1 = 0; - ndInt32 i0 = DG_CAPSULE_CAP_SEGMENTS - 1; - const ndInt32 n = index / DG_CAPSULE_CAP_SEGMENTS - 1; - for (ndInt32 j = 0; j < n; ++j) - { - for (ndInt32 i = 0; i < DG_CAPSULE_CAP_SEGMENTS; ++i) - { - wireframe[0] = i0; - wireframe[1] = i1; - wireframe[2] = i1 + DG_CAPSULE_CAP_SEGMENTS; - wireframe[3] = i0 + DG_CAPSULE_CAP_SEGMENTS; - i0 = i1; - i1++; - polyhedra.AddFace(4, wireframe); - } - i0 = i1 + DG_CAPSULE_CAP_SEGMENTS - 1; - } - - for (ndInt32 i = 0; i < DG_CAPSULE_CAP_SEGMENTS; ++i) - { - wireframe[i] = DG_CAPSULE_CAP_SEGMENTS - i - 1; - } - polyhedra.AddFace(DG_CAPSULE_CAP_SEGMENTS, wireframe); - - for (ndInt32 i = 0; i < DG_CAPSULE_CAP_SEGMENTS; ++i) - { - wireframe[i] = index - DG_CAPSULE_CAP_SEGMENTS + i; - } - polyhedra.AddFace(DG_CAPSULE_CAP_SEGMENTS, wireframe); - polyhedra.EndFace(); - - ndAssert(SanityCheck(polyhedra)); - - m_edgeCount = ndUnsigned16(polyhedra.GetEdgeCount()); - m_simplex = (ndConvexSimplexEdge*)ndMemory::Malloc(size_t(m_edgeCount * sizeof(ndConvexSimplexEdge))); - - ndUnsigned64 i = 0; - ndPolyhedra::Iterator iter(polyhedra); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - edge->m_userData = i; - i++; - } - - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - - ndConvexSimplexEdge* const ptr = &m_simplex[edge->m_userData]; - - ptr->m_vertex = edge->m_incidentVertex; - ptr->m_next = &m_simplex[edge->m_next->m_userData]; - ptr->m_prev = &m_simplex[edge->m_prev->m_userData]; - ptr->m_twin = &m_simplex[edge->m_twin->m_userData]; - } - SetVolumeAndCG(); -} - -ndShapeInfo ndShapeCapsule::GetShapeInfo() const -{ - ndShapeInfo info(ndShapeConvex::GetShapeInfo()); - - info.m_capsule.m_radio0 = m_radius0; - info.m_capsule.m_radio1 = m_radius1; - info.m_capsule.m_height = ndFloat32(2.0f) * m_height; - - if (m_transform.m_x < ndFloat32(0.0f)) - { - ndSwap(info.m_capsule.m_radio0, info.m_capsule.m_radio1); - } - return info; -} - -void ndShapeCapsule::TesselateTriangle(ndInt32 level, const ndVector& p0, const ndVector& p1, const ndVector& p2, ndInt32& count, ndVector* ouput) const -{ - if (level) - { - ndAssert(ndAbs(p0.DotProduct(p0).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p1.DotProduct(p1).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p2.DotProduct(p2).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndVector p01(p0 + p1); - ndVector p12(p1 + p2); - ndVector p20(p2 + p0); - - p01 = p01.Scale(ndRsqrt(p01.DotProduct(p01).GetScalar())); - p12 = p12.Scale(ndRsqrt(p12.DotProduct(p12).GetScalar())); - p20 = p20.Scale(ndRsqrt(p20.DotProduct(p20).GetScalar())); - - ndAssert(ndAbs(p01.DotProduct(p01).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p12.DotProduct(p12).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p20.DotProduct(p20).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - - TesselateTriangle(level - 1, p0, p01, p20, count, ouput); - TesselateTriangle(level - 1, p1, p12, p01, count, ouput); - TesselateTriangle(level - 1, p2, p20, p12, count, ouput); - TesselateTriangle(level - 1, p01, p12, p20, count, ouput); - } - else - { - ouput[count + 0] = p0.Scale(m_radius0); - ouput[count + 1] = p1.Scale(m_radius0); - ouput[count + 2] = p2.Scale(m_radius0); - count += 3; - } -} - -void ndShapeCapsule::DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const -{ - if (m_radius0 == m_radius1) - { - #define POWER 2 - ndVector tmpVectex[512]; - - ndVector p0(ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p1(-ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p2(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p3(ndFloat32(0.0f), -ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p4(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f)); - ndVector p5(ndFloat32(0.0f), ndFloat32(0.0f), -ndFloat32(1.0f), ndFloat32(0.0f)); - - ndInt32 count = 0; - TesselateTriangle(POWER, p0, p2, p4, count, tmpVectex); - TesselateTriangle(POWER, p0, p4, p3, count, tmpVectex); - TesselateTriangle(POWER, p0, p3, p5, count, tmpVectex); - TesselateTriangle(POWER, p0, p5, p2, count, tmpVectex); - - TesselateTriangle(POWER, p1, p4, p2, count, tmpVectex); - TesselateTriangle(POWER, p1, p3, p4, count, tmpVectex); - TesselateTriangle(POWER, p1, p5, p3, count, tmpVectex); - TesselateTriangle(POWER, p1, p2, p5, count, tmpVectex); - - ndVector face[4]; - ndShapeDebugNotify::ndEdgeType edgeType[4]; - memset(edgeType, ndShapeDebugNotify::m_shared, sizeof(edgeType)); - - for (ndInt32 i = 0; i < count; i += 3) - { - ndInt32 positive = 0; - for (ndInt32 j = 0; j < 3; ++j) - { - if (tmpVectex[i + j].m_x > ndFloat32(0.0f)) - { - positive++; - } - } - - if (positive) - { - face[0] = tmpVectex[i + 0]; - face[1] = tmpVectex[i + 1]; - face[2] = tmpVectex[i + 2]; - face[0].m_x += m_height; - face[1].m_x += m_height; - face[2].m_x += m_height; - matrix.TransformTriplex(&face[0].m_x, sizeof(ndVector), &face[0].m_x, sizeof(ndVector), 3); - - debugCallback.DrawPolygon(3, face, edgeType); - } - else - { - - face[0] = tmpVectex[i + 0]; - face[1] = tmpVectex[i + 1]; - face[2] = tmpVectex[i + 2]; - face[0].m_x -= m_height; - face[1].m_x -= m_height; - face[2].m_x -= m_height; - matrix.TransformTriplex(&face[0].m_x, sizeof(ndVector), &face[0].m_x, sizeof(ndVector), 3); - - debugCallback.DrawPolygon(3, face, edgeType); - } - if (positive == 1) - { - ndVector q0(tmpVectex[i + 0]); - ndVector q1(tmpVectex[i + 1]); - if ((tmpVectex[i + 1].m_x == ndFloat32(0.0f)) && (tmpVectex[i + 2].m_x == ndFloat32(0.0f))) - { - q0 = tmpVectex[i + 1]; - q1 = tmpVectex[i + 2]; - } - else if ((tmpVectex[i + 2].m_x == ndFloat32(0.0f)) && (tmpVectex[i + 0].m_x == ndFloat32(0.0f))) - { - q0 = tmpVectex[i + 2]; - q1 = tmpVectex[i + 0]; - } - - face[0] = q1; - face[1] = q0; - face[2] = q0; - face[3] = q1; - face[0].m_x += m_height; - face[1].m_x += m_height; - face[2].m_x -= m_height; - face[3].m_x -= m_height; - matrix.TransformTriplex(&face[0].m_x, sizeof(ndVector), &face[0].m_x, sizeof(ndVector), 4); - - debugCallback.DrawPolygon(4, face, edgeType); - } - } - } - else - { - ndMatrix transform(matrix); - transform[0] = transform[0].Scale(m_transform.m_x); - transform[1] = transform[1].Scale(m_transform.m_y); - transform[2] = transform[2].Scale(m_transform.m_z); - ndShapeConvex::DebugShape(transform, debugCallback); - } -} - -ndVector ndShapeCapsule::SupportVertexSpecialProjectPoint(const ndVector& testPoint, const ndVector& direction) const -{ - ndVector dir(direction * m_transform); - ndVector point(testPoint * m_transform); - point += dir.Scale(m_radius0 - D_PENETRATION_TOL); - return m_transform * point; -} - - -ndVector ndShapeCapsule::SupportVertex(const ndVector& direction) const -{ - ndVector dir(direction * m_transform); - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - - ndVector p0(dir.Scale(m_radius0)); - ndVector p1(dir.Scale(m_radius1)); - p0.m_x -= m_height; - p1.m_x += m_height; - ndFloat32 dir0 = p0.DotProduct(dir).GetScalar(); - ndFloat32 dir1 = p1.DotProduct(dir).GetScalar(); - if (dir1 > dir0) - { - p0 = p1; - } - return p0 * m_transform; -} - -ndVector ndShapeCapsule::SupportVertexSpecial(const ndVector& direction, ndFloat32) const -{ - ndVector dir(direction * m_transform); - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - - ndVector p0(ndVector::m_zero); - ndVector p1(dir.Scale(m_radius1 - m_radius0)); - p0.m_x -= m_height; - p1.m_x += m_height; - ndFloat32 dir0 = p0.DotProduct(dir).GetScalar(); - ndFloat32 dir1 = p1.DotProduct(dir).GetScalar(); - if (dir1 > dir0) - { - p0 = p1; - } - return p0 * m_transform; -} - -ndFloat32 ndShapeCapsule::RayCast(ndRayCastNotify& callback, const ndVector& r0, const ndVector& r1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const -{ - ndVector q0(r0 * m_transform); - ndVector q1(r1 * m_transform); - - ndVector origin0(-m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector origin1(m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndFloat32 t0 = ndRayCastSphere(q0, q1, origin0, m_radius0); - ndFloat32 t1 = ndRayCastSphere(q0, q1, origin1, m_radius1); - if ((t0 < ndFloat32(1.0f)) && (t1 < ndFloat32 (1.0f))) - { - if (t0 < t1) - { - ndVector q(q0 + (q1 - q0).Scale(t0)); - ndVector n(q - origin0); - ndAssert(n.m_w == ndFloat32(0.0f)); - //contactOut.m_normal = m_transform * n * n.DotProduct(n).InvSqrt(); - contactOut.m_normal = m_transform * n.Normalize(); - return t0; - } - else - { - ndVector q(q0 + (q1 - q0).Scale(t1)); - ndVector n(q - origin1); - ndAssert(n.m_w == ndFloat32(0.0f)); - //contactOut.m_normal = m_transform * n * n.DotProduct(n).InvSqrt(); - contactOut.m_normal = m_transform * n.Normalize(); - return t1; - } - } - else if (t1 < ndFloat32(1.0f)) - { - ndVector q(q0 + (q1 - q0).Scale(t1)); - if (q.m_x >= m_p1.m_x) - { - ndVector n(q - origin1); - ndAssert(n.m_w == ndFloat32(0.0f)); - //contactOut.m_normal = m_transform * n * n.DotProduct(n).InvSqrt(); - contactOut.m_normal = m_transform * n.Normalize(); - return t1; - } - } - else if (t0 < ndFloat32(1.0f)) - { - ndVector q(q0 + (q1 - q0).Scale(t0)); - if (q.m_x <= m_p0.m_x) - { - ndVector n(q - origin0); - ndAssert(n.m_w == ndFloat32(0.0f)); - //contactOut.m_normal = m_transform * n * n.DotProduct(n).InvSqrt(); - contactOut.m_normal = m_transform * n.Normalize(); - return t0; - } - } - - ndFloat32 ret = ndShapeConvex::RayCast(callback, q0, q1, maxT, body, contactOut); - if (ret <= ndFloat32(1.0f)) - { - contactOut.m_normal = m_transform * contactOut.m_normal; - } - return ret; -} - -ndInt32 ndShapeCapsule::CalculatePlaneIntersection(const ndVector& direction, const ndVector& point, ndVector* const contactsOut) const -{ - ndVector normal(direction * m_transform); - ndVector origin(point * m_transform); - - ndInt32 count = 0; - ndVector p0(-m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector dir0(p0 - origin); - ndFloat32 dist0 = dir0.DotProduct(normal).GetScalar(); - if ((dist0 * dist0 - ndFloat32(5.0e-5f)) < (m_radius0 * m_radius0)) - { - contactsOut[count] = m_transform * (p0 - normal.Scale(dist0)); - count++; - } - - ndVector p1(m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector dir1(p1 - origin); - ndFloat32 dist1 = dir1.DotProduct(normal).GetScalar(); - if ((dist1 * dist1 - ndFloat32(5.0e-5f)) < (m_radius1 * m_radius1)) - { - contactsOut[count] = m_transform * (p1 - normal.Scale(dist1)); - count++; - } - return count; -} - -void ndShapeCapsule::CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const -{ - ndVector size0(m_radius0); - ndVector size1(m_radius1); - ndVector q0(matrix.m_posit - matrix.m_front.Scale(m_height)); - ndVector q1(matrix.m_posit + matrix.m_front.Scale(m_height)); - - ndVector min_q0(q0 - size0); - ndVector min_q1(q1 - size1); - - ndVector max_q0(q0 + size1); - ndVector max_q1(q1 + size1); - - p0 = min_q0.GetMin(min_q1) & ndVector::m_triplexMask; - p1 = max_q0.GetMax(max_q1) & ndVector::m_triplexMask; -} - -ndUnsigned64 ndShapeCapsule::GetHash(ndUnsigned64 hash) const -{ - ndShapeInfo info(GetShapeInfo()); - return info.GetHash(hash); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCapsule.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCapsule.h deleted file mode 100644 index fa191adb73..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCapsule.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_CAPSULE_H__ -#define __ND_SHAPE_CAPSULE_H__ - -#include "ndShapeConvex.h" - -D_MSV_NEWTON_ALIGN_32 -class ndShapeCapsule : public ndShapeConvex -{ - public: - D_CLASS_REFLECTION(ndShapeCapsule,ndShapeConvex) - D_COLLISION_API ndShapeCapsule (ndFloat32 radio0, ndFloat32 radio1, ndFloat32 height); - - virtual ndShapeCapsule* GetAsShapeCapsule() { return this; } - - protected: - D_COLLISION_API void Init (ndFloat32 radio0, ndFloat32 radio1, ndFloat32 height); - - D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; - D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; - D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; - D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - D_COLLISION_API virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - void TesselateTriangle(ndInt32 level, const ndVector& p0, const ndVector& p1, const ndVector& p2, ndInt32& count, ndVector* ouput) const; - - ndVector m_p0; - ndVector m_p1; - ndVector m_normal; - ndVector m_transform; - ndFloat32 m_height; - ndFloat32 m_radius0; - ndFloat32 m_radius1; -} D_GCC_NEWTON_ALIGN_32; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeChamferCylinder.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeChamferCylinder.cpp deleted file mode 100644 index 599521a52c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeChamferCylinder.cpp +++ /dev/null @@ -1,411 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndContactSolver.h" -#include "ndShapeChamferCylinder.h" - -ndInt32 ndShapeChamferCylinder::m_shapeRefCount = 0; -ndVector ndShapeChamferCylinder::m_yzMask (0, 0xffffffff, 0xffffffff, 0); -ndVector ndShapeChamferCylinder::m_shapesDirs[DG_MAX_CHAMFERCYLINDER_DIR_COUNT]; -ndShapeConvex::ndConvexSimplexEdge ndShapeChamferCylinder::m_edgeArray[(4 * DG_CHAMFERCYLINDER_SLICES + 2)* DG_CHAMFERCYLINDER_BRAKES]; - -ndShapeChamferCylinder::ndShapeChamferCylinder(ndFloat32 radius, ndFloat32 height) - :ndShapeConvex(m_chamferCylinder) -{ - Init (radius, height); -} - -ndShapeChamferCylinder::~ndShapeChamferCylinder() -{ - m_shapeRefCount --; - ndAssert (m_shapeRefCount >= 0); - - ndShapeConvex::m_simplex = nullptr; - ndShapeConvex::m_vertex = nullptr; -} - -void ndShapeChamferCylinder::Init (ndFloat32 radius, ndFloat32 height) -{ - m_radius = ndMax (ndAbs (radius), D_MIN_CONVEX_SHAPE_SIZE); - m_height = ndMax (ndAbs (height * ndFloat32 (0.5f)), D_MIN_CONVEX_SHAPE_SIZE); - - ndFloat32 sliceAngle = ndFloat32 (0.0f); - ndFloat32 sliceStep = ndPi / DG_CHAMFERCYLINDER_SLICES; - ndFloat32 breakStep = ndFloat32 (2.0f) * ndPi / DG_CHAMFERCYLINDER_BRAKES; - - ndMatrix rot (ndPitchMatrix (breakStep)); - ndInt32 index = 0; - for (ndInt32 j = 0; j <= DG_CHAMFERCYLINDER_SLICES; ++j) - { - ndVector p0 (-m_height * ndCos(sliceAngle), ndFloat32 (0.0f), m_radius + m_height * ndSin(sliceAngle), ndFloat32 (0.0f)); - sliceAngle += sliceStep; - for (ndInt32 i = 0; i < DG_CHAMFERCYLINDER_BRAKES; ++i) - { - m_vertex[index] = p0; - index ++; - p0 = rot.UnrotateVector (p0); - } - } - - m_edgeCount = (4 * DG_CHAMFERCYLINDER_SLICES + 2)* DG_CHAMFERCYLINDER_BRAKES; - m_vertexCount = DG_CHAMFERCYLINDER_BRAKES * (DG_CHAMFERCYLINDER_SLICES + 1); - ndShapeConvex::m_vertex = m_vertex; - - if (!m_shapeRefCount) - { - ndPolyhedra polyhedra; - ndInt32 wireframe[DG_CHAMFERCYLINDER_SLICES + 10]; - - ndVector locus(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - for (ndInt32 i = 0; i < DG_MAX_CHAMFERCYLINDER_DIR_COUNT; ++i) - { - ndMatrix matrix (ndPitchMatrix (ndFloat32 (2.0f) * ndPi * ndFloat32 (i) / DG_MAX_CHAMFERCYLINDER_DIR_COUNT)); - m_shapesDirs[i] = matrix.RotateVector (locus); - } - - ndInt32 index0 = 0; - for (ndInt32 j = 0; j < DG_CHAMFERCYLINDER_SLICES; ++j) - { - ndInt32 index1 = index0 + DG_CHAMFERCYLINDER_BRAKES - 1; - for (ndInt32 i = 0; i < DG_CHAMFERCYLINDER_BRAKES; ++i) - { - wireframe[0] = index0; - wireframe[1] = index1; - wireframe[2] = index1 + DG_CHAMFERCYLINDER_BRAKES; - wireframe[3] = index0 + DG_CHAMFERCYLINDER_BRAKES; - - index1 = index0; - index0 ++; - polyhedra.AddFace (4, wireframe); - } - } - - for (ndInt32 i = 0; i < DG_CHAMFERCYLINDER_BRAKES; ++i) - { - wireframe[i] = i; - } - polyhedra.AddFace (DG_CHAMFERCYLINDER_BRAKES, wireframe); - - for (ndInt32 i = 0; i < DG_CHAMFERCYLINDER_BRAKES; ++i) - { - wireframe[i] = DG_CHAMFERCYLINDER_BRAKES * (DG_CHAMFERCYLINDER_SLICES + 1) - i - 1; - } - polyhedra.AddFace (DG_CHAMFERCYLINDER_BRAKES, wireframe); - polyhedra.EndFace (); - - ndAssert (SanityCheck (polyhedra)); - - ndUnsigned64 i = 0; - ndPolyhedra::Iterator iter (polyhedra); - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - edge->m_userData = i; - i ++; - } - - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - - ndConvexSimplexEdge* const ptr = &m_edgeArray[edge->m_userData]; - ptr->m_vertex = edge->m_incidentVertex; - ptr->m_next = &m_edgeArray[edge->m_next->m_userData]; - ptr->m_prev = &m_edgeArray[edge->m_prev->m_userData]; - ptr->m_twin = &m_edgeArray[edge->m_twin->m_userData]; - } - } - - m_shapeRefCount ++; - ndShapeConvex::m_simplex = m_edgeArray; - - SetVolumeAndCG (); -} - -ndShapeInfo ndShapeChamferCylinder::GetShapeInfo() const -{ - ndShapeInfo info(ndShapeConvex::GetShapeInfo()); - - info.m_chamferCylinder.m_r = m_radius; - info.m_chamferCylinder.m_height = m_height * ndFloat32(2.0f); - return info; -} - -void ndShapeChamferCylinder::CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const -{ - ndShapeConvex::CalculateAabb(matrix, p0, p1); - -// ndAssert(0); - //ndVector size0(m_radius0); - //ndVector size1(m_radius1); - //ndVector q0(matrix.m_posit - matrix.m_front.Scale(m_height)); - //ndVector q1(matrix.m_posit + matrix.m_front.Scale(m_height)); - // - //ndVector min_q0(q0 - size0); - //ndVector min_q1(q1 - size1); - // - //ndVector max_q0(q0 + size1); - //ndVector max_q1(q1 + size1); - // - //p0 = min_q0.GetMin(min_q1) & ndVector::m_triplexMask; - //p1 = max_q0.GetMax(max_q1) & ndVector::m_triplexMask; -} - -void ndShapeChamferCylinder::DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const -{ - ndInt32 slices = 12; - ndInt32 brakes = 24; - ndFloat32 sliceAngle = ndFloat32(0.0f); - ndFloat32 sliceStep = ndPi / (ndFloat32)slices; - ndFloat32 breakStep = ndFloat32(2.0f) * ndPi / (ndFloat32)brakes; - ndVector pool[24 * (12 + 1)]; - - ndMatrix rot(ndPitchMatrix(breakStep)); - ndInt32 index = 0; - for (ndInt32 j = 0; j <= slices; ++j) - { - ndVector p0(-m_height * ndCos(sliceAngle), ndFloat32(0.0f), m_radius + m_height * ndSin(sliceAngle), ndFloat32(0.0f)); - sliceAngle += sliceStep; - for (ndInt32 i = 0; i < brakes; ++i) - { - pool[index] = p0; - p0 = rot.UnrotateVector(p0); - index++; - } - } - - matrix.TransformTriplex(&pool[0].m_x, sizeof(ndVector), &pool[0].m_x, sizeof(ndVector), 24 * (12 + 1)); - - ndVector face[32]; - ndShapeDebugNotify::ndEdgeType edgeType[32]; - memset(edgeType, ndShapeDebugNotify::m_shared, sizeof(edgeType)); - - index = 0; - for (ndInt32 j = 0; j < slices; ++j) - { - ndInt32 index0 = index + brakes - 1; - for (ndInt32 i = 0; i < brakes; ++i) - { - face[0] = pool[index]; - face[1] = pool[index0]; - face[2] = pool[index0 + brakes]; - face[3] = pool[index + brakes]; - index0 = index; - index++; - debugCallback.DrawPolygon(4, face, edgeType); - } - } - - for (ndInt32 i = 0; i < brakes; ++i) - { - face[i] = pool[i]; - } - debugCallback.DrawPolygon(24, face, edgeType); - - for (ndInt32 i = 0; i < brakes; ++i) - { - face[i] = pool[brakes * (slices + 1) - i - 1]; - } - debugCallback.DrawPolygon(24, face, edgeType); -} - -ndVector ndShapeChamferCylinder::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const -{ - ndAssert(dir.m_w == 0.0f); - return point + dir.Scale(m_height - D_PENETRATION_TOL); -} - -ndVector ndShapeChamferCylinder::SupportVertex(const ndVector& dir) const -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - - ndFloat32 x = dir.GetScalar(); - if (ndAbs(x) > ndFloat32(0.9999f)) - { - return ndVector(ndSign(x) * m_height, m_radius, ndFloat32(0.0f), ndFloat32(0.0f)); - } - - ndVector sideDir(m_yzMask & dir); - sideDir = sideDir.Normalize(); - return sideDir.Scale(m_radius) + dir.Scale(m_height); -} - -ndVector ndShapeChamferCylinder::SupportVertexSpecial(const ndVector& dir, ndFloat32) const -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - - ndFloat32 x = dir.GetScalar(); - if (ndAbs(x) > ndFloat32(0.99995f)) - { - return ndVector(ndFloat32(0.0f), m_radius, ndFloat32(0.0f), ndFloat32(0.0f)); - } - - ndVector sideDir(m_yzMask & dir); - ndAssert(sideDir.DotProduct(sideDir).GetScalar() > ndFloat32(0.0f)); - return sideDir.Normalize().Scale(m_radius); -} - -ndFloat32 ndShapeChamferCylinder::RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const -{ - if (localP0.m_x > m_height) - { - if (localP1.m_x < m_height) - { - ndFloat32 t1 = (m_height - localP0.m_x) / (localP1.m_x - localP0.m_x); - ndFloat32 y = localP0.m_y + (localP1.m_y - localP0.m_y) * t1; - ndFloat32 z = localP0.m_z + (localP1.m_z - localP0.m_z) * t1; - if ((y * y + z * z) < m_radius * m_radius) - { - contactOut.m_normal = ndVector(ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - return t1; - } - } - } - - if (localP0.m_x < -m_height) - { - if (localP1.m_x > -m_height) - { - ndFloat32 t1 = (-m_height - localP0.m_x) / (localP1.m_x - localP0.m_x); - ndFloat32 y = localP0.m_y + (localP1.m_y - localP0.m_y) * t1; - ndFloat32 z = localP0.m_z + (localP1.m_z - localP0.m_z) * t1; - if ((y * y + z * z) < m_radius * m_radius) - { - contactOut.m_normal = ndVector(ndFloat32(-1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - return t1; - } - } - } - - ndVector dq((localP1 - localP0) & ndVector::m_triplexMask); - - // avoid NaN as a result of a division by zero - if (dq.DotProduct(dq).GetScalar() <= 0.0f) - { - return ndFloat32(1.2f); - } - - //ndVector dir(dq * dq.InvMagSqrt()); - ndVector dir(dq.Normalize()); - if (ndAbs(dir.m_x) > 0.9999f) - { - //return ndShapeConvex::RayCast(localP0, localP1, maxT, contactOut, body, nullptr, nullptr); - return ndShapeConvex::RayCast(callback, localP0, localP1, maxT, body, contactOut); - } - - ndVector p0(localP0 & ndVector::m_triplexMask); - ndVector p1(localP1 & ndVector::m_triplexMask); - - p0.m_x = ndFloat32(0.0f); - p1.m_x = ndFloat32(0.0f); - - ndVector dp(p1 - p0); - ndFloat32 a = dp.DotProduct(dp).GetScalar(); - ndFloat32 b = ndFloat32(2.0f) * dp.DotProduct(p0).GetScalar(); - ndFloat32 c = p0.DotProduct(p0).GetScalar() - m_radius * m_radius; - - ndFloat32 disc = b * b - ndFloat32(4.0f) * a * c; - if (disc >= ndFloat32(0.0f)) - { - disc = ndSqrt(disc); - ndVector origin0(p0 + dp.Scale((-b + disc) / (ndFloat32(2.0f) * a))); - ndVector origin1(p0 + dp.Scale((-b - disc) / (ndFloat32(2.0f) * a))); - ndFloat32 t0 = ndRayCastSphere(localP0, localP1, origin0, m_height); - ndFloat32 t1 = ndRayCastSphere(localP0, localP1, origin1, m_height); - if (t1 < t0) - { - t0 = t1; - origin0 = origin1; - } - - if ((t0 >= 0.0f) && (t0 <= 1.0f)) - { - contactOut.m_normal = localP0 + dq.Scale(t0) - origin0; - ndAssert(contactOut.m_normal.m_w == ndFloat32(0.0f)); - - //contactOut.m_normal = contactOut.m_normal * contactOut.m_normal.DotProduct(contactOut.m_normal).InvSqrt(); - contactOut.m_normal = contactOut.m_normal.Normalize(); - return t0; - } - } - else - { - ndVector origin0(ndPointToRayDistance(ndVector::m_zero, p0, p1)); - origin0 = origin0.Scale(m_radius / ndSqrt(origin0.DotProduct(origin0).GetScalar())); - ndFloat32 t0 = ndRayCastSphere(localP0, localP1, origin0, m_height); - if ((t0 >= 0.0f) && (t0 <= 1.0f)) - { - contactOut.m_normal = localP0 + dq.Scale(t0) - origin0; - ndAssert(contactOut.m_normal.m_w == ndFloat32(0.0f)); - - //contactOut.m_normal = contactOut.m_normal * contactOut.m_normal.DotProduct(contactOut.m_normal).InvSqrt(); - contactOut.m_normal = contactOut.m_normal.Normalize(); - return t0; - } - } - return ndFloat32(1.2f); -} - -ndInt32 ndShapeChamferCylinder::CalculatePlaneIntersection(const ndVector& normal, const ndVector& origin, ndVector* const contactsOut) const -{ - ndInt32 count = 0; - const ndFloat32 inclination = ndFloat32(0.9999f); - //if (normal.m_x < -inclination) - //{ - // ndMatrix matrix(ndGramSchmidtMatrix(normal)); - // ndFloat32 x = ndSqrt(ndMax(m_height * m_height - origin.m_x * origin.m_x, ndFloat32(0.0f))); - // matrix.m_posit.m_x = origin.m_x; - // count = BuildCylinderCapPoly(m_radius + x, matrix, contactsOut); - // //count = RectifyConvexSlice(n, normal, contactsOut); - //} - //else if (normal.m_x > inclination) - //{ - // ndMatrix matrix(ndGramSchmidtMatrix(normal)); - // ndFloat32 x = ndSqrt(ndMax(m_height * m_height - origin.m_x * origin.m_x, ndFloat32(0.0f))); - // matrix.m_posit.m_x = origin.m_x; - // count = BuildCylinderCapPoly(m_radius + x, matrix, contactsOut); - // //count = RectifyConvexSlice(n, normal, contactsOut); - //} - if (ndAbs(normal.m_x) > inclination) - { - ndMatrix matrix(ndGramSchmidtMatrix(normal)); - ndFloat32 x = ndSqrt(ndMax(m_height * m_height - origin.m_x * origin.m_x, ndFloat32(0.0f))); - matrix.m_posit.m_x = origin.m_x; - count = BuildCylinderCapPoly(m_radius + x, matrix, contactsOut); - } - else - { - count = 1; - contactsOut[0] = SupportVertex(normal); - } - return count; -} - -ndUnsigned64 ndShapeChamferCylinder::GetHash(ndUnsigned64 hash) const -{ - ndShapeInfo info(GetShapeInfo()); - return info.GetHash(hash); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeChamferCylinder.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeChamferCylinder.h deleted file mode 100644 index 6d94025838..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeChamferCylinder.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_CHAMFER_CYLINDER_H__ -#define __ND_SHAPE_CHAMFER_CYLINDER_H__ - -#include "ndShapeConvex.h" - -#define DG_CHAMFERCYLINDER_SLICES 4 -#define DG_CHAMFERCYLINDER_BRAKES 8 -#define DG_MAX_CHAMFERCYLINDER_DIR_COUNT 8 - -class ndShapeChamferCylinder: public ndShapeConvex -{ - public: - D_CLASS_REFLECTION(ndShapeChamferCylinder, ndShapeConvex) - D_COLLISION_API ndShapeChamferCylinder(ndFloat32 radius, ndFloat32 height); - D_COLLISION_API virtual ~ndShapeChamferCylinder(); - - virtual ndShapeChamferCylinder* GetAsShapeChamferCylinder() { return this; } - - protected: - - D_COLLISION_API void Init(ndFloat32 radius, ndFloat32 height); - - D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; - D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; - D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; - D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - D_COLLISION_API virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - - private: - ndFloat32 m_height; - ndFloat32 m_radius; - - ndVector m_vertex[DG_CHAMFERCYLINDER_BRAKES * (DG_CHAMFERCYLINDER_SLICES + 1)]; - static ndInt32 m_shapeRefCount; - static ndConvexSimplexEdge m_edgeArray[]; - static ndVector m_shapesDirs[]; - static ndVector m_yzMask; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCompound.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCompound.cpp deleted file mode 100644 index 23ccdff150..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCompound.cpp +++ /dev/null @@ -1,1246 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndShapeInstance.h" -#include "ndContactSolver.h" -#include "ndBodyKinematic.h" -#include "ndShapeCompound.h" - -#define D_MAX_MIN_VOLUME ndFloat32 (1.0e-3f) - -ndShapeCompound::ndNodeBase::~ndNodeBase() -{ - if (m_shapeInstance) - { - delete m_shapeInstance; - } - if (m_left) - { - delete m_left; - } - if (m_right) - { - delete m_right; - } -} - -ndShapeCompound::ndNodeBase::ndNodeBase() - :ndClassAlloc() - ,m_type(m_node) - ,m_left(nullptr) - ,m_right(nullptr) - ,m_parent(nullptr) - ,m_myNode(nullptr) - ,m_shapeInstance(nullptr) -{ -} - -ndShapeCompound::ndNodeBase::ndNodeBase(const ndNodeBase& copyFrom) - :ndClassAlloc() - ,m_p0(copyFrom.m_p0) - ,m_p1(copyFrom.m_p1) - ,m_size(copyFrom.m_size) - ,m_origin(copyFrom.m_origin) - ,m_area(copyFrom.m_area) - ,m_type(copyFrom.m_type) - ,m_left(nullptr) - ,m_right(nullptr) - ,m_parent(nullptr) - ,m_myNode(nullptr) - ,m_shapeInstance(nullptr) -{ - ndAssert(!copyFrom.m_shapeInstance); -} - -ndShapeCompound::ndNodeBase::ndNodeBase(ndShapeInstance* const instance) - :ndClassAlloc() - ,m_type(m_leaf) - ,m_left(nullptr) - ,m_right(nullptr) - ,m_parent(nullptr) - ,m_myNode(nullptr) - ,m_shapeInstance(new ndShapeInstance(*instance)) -{ - CalculateAABB(); -} - -ndShapeCompound::ndNodeBase::ndNodeBase(ndNodeBase* const left, ndNodeBase* const right) - :ndClassAlloc() - ,m_type(m_node) - ,m_left(left) - ,m_right(right) - ,m_parent(nullptr) - ,m_myNode(nullptr) - ,m_shapeInstance(nullptr) -{ - m_left->m_parent = this; - m_right->m_parent = this; - - ndVector p0(left->m_p0.GetMin(right->m_p0)); - ndVector p1(left->m_p1.GetMax(right->m_p1)); - SetBox(p0, p1); -} - -ndShapeInstance* ndShapeCompound::ndNodeBase::GetShape() const -{ - return m_shapeInstance; -} - -inline void ndShapeCompound::ndNodeBase::CalculateAABB() -{ - ndVector p0; - ndVector p1; - m_shapeInstance->CalculateAabb(m_shapeInstance->GetLocalMatrix(), p0, p1); - SetBox(p0, p1); -} - -inline void ndShapeCompound::ndNodeBase::SetBox(const ndVector& p0, const ndVector& p1) -{ - m_p0 = p0; - m_p1 = p1; - ndAssert(m_p0.m_w == ndFloat32(0.0f)); - ndAssert(m_p1.m_w == ndFloat32(0.0f)); - m_size = ndVector::m_half * (m_p1 - m_p0); - m_origin = ndVector::m_half * (m_p1 + m_p0); - m_area = m_size.DotProduct(m_size.ShiftTripleRight()).m_x; -} - -const ndShapeCompound::ndTreeArray& ndShapeCompound::GetTree() const -{ - return m_array; -} - -class ndShapeCompound::ndSpliteInfo -{ - public: - ndSpliteInfo(ndNodeBase** const boxArray, ndInt32 boxCount) - { - ndVector minP(ndFloat32(1.0e15f)); - ndVector maxP(-ndFloat32(1.0e15f)); - - if (boxCount == 2) - { - m_axis = 1; - for (ndInt32 i = 0; i < boxCount; ++i) - { - ndNodeBase* const node = boxArray[i]; - ndAssert(node->m_type == m_leaf); - minP = minP.GetMin(node->m_p0); - maxP = maxP.GetMax(node->m_p1); - } - } - else - { - ndVector median(ndVector::m_zero); - ndVector varian(ndVector::m_zero); - - for (ndInt32 i = 0; i < boxCount; ++i) - { - ndNodeBase* const node = boxArray[i]; - ndAssert(node->m_type == m_leaf); - minP = minP.GetMin(node->m_p0); - maxP = maxP.GetMax(node->m_p1); - ndVector p(ndVector::m_half * (node->m_p0 + node->m_p1)); - median += p; - varian += p * p; - } - - varian = varian.Scale(ndFloat32(boxCount)) - median * median; - - ndInt32 index = 0; - ndFloat32 maxVarian = ndFloat32(-1.0e10f); - for (ndInt32 i = 0; i < 3; ++i) - { - if (varian[i] > maxVarian) - { - index = i; - maxVarian = varian[i]; - } - } - - ndVector center = median.Scale(ndFloat32(1.0f) / ndFloat32(boxCount)); - - ndFloat32 test = center[index]; - - ndInt32 i0 = 0; - ndInt32 i1 = boxCount - 1; - do - { - for (; i0 <= i1; i0++) - { - ndNodeBase* const node = boxArray[i0]; - ndFloat32 val = (node->m_p0[index] + node->m_p1[index]) * ndFloat32(0.5f); - if (val > test) - { - break; - } - } - - for (; i1 >= i0; i1--) - { - ndNodeBase* const node = boxArray[i1]; - ndFloat32 val = (node->m_p0[index] + node->m_p1[index]) * ndFloat32(0.5f); - if (val < test) - { - break; - } - } - - if (i0 < i1) - { - ndSwap(boxArray[i0], boxArray[i1]); - i0++; - i1--; - } - - } while (i0 <= i1); - - if (i0 > 0) - { - i0--; - } - if ((i0 + 1) >= boxCount) - { - i0 = boxCount - 2; - } - - m_axis = i0 + 1; - } - - ndAssert(maxP.m_x - minP.m_x >= ndFloat32(0.0f)); - ndAssert(maxP.m_y - minP.m_y >= ndFloat32(0.0f)); - ndAssert(maxP.m_z - minP.m_z >= ndFloat32(0.0f)); - m_p0 = minP; - m_p1 = maxP; - } - - ndInt32 m_axis; - ndVector m_p0; - ndVector m_p1; -}; - -ndShapeCompound::ndTreeArray::ndTreeArray() - :ndTree>() -{ -} - -void ndShapeCompound::ndTreeArray::AddNode(ndNodeBase* const node, ndInt32 index, const ndShapeInstance* const parent) -{ - ndTreeArray::ndNode* const myNode = Insert(node, index); - node->m_myNode = myNode; - node->m_shapeInstance->m_parent = parent; - node->m_shapeInstance->m_subCollisionHandle = myNode; -} - -ndShapeCompound::ndShapeCompound() - :ndShape(m_compound) - ,m_array() - ,m_treeEntropy(ndFloat32(0.0f)) - ,m_boxMinRadius(ndFloat32(0.0f)) - ,m_boxMaxRadius(ndFloat32(0.0f)) - ,m_root(nullptr) - ,m_myInstance(nullptr) - ,m_idIndex(0) -{ -} - -ndShapeCompound::ndShapeCompound(const ndShapeCompound& source, const ndShapeInstance* const myInstance) - :ndShape(source) - ,m_array() - ,m_treeEntropy(ndFloat32(0.0f)) - ,m_boxMinRadius(ndFloat32(0.0f)) - ,m_boxMaxRadius(ndFloat32(0.0f)) - ,m_root(nullptr) - ,m_myInstance(myInstance) - ,m_idIndex(0) -{ - ndTreeArray::Iterator iter(source.m_array); - for (iter.Begin(); iter; iter++) - { - ndNodeBase* const node = iter.GetNode()->GetInfo(); - ndShapeInstance* const shape = node->GetShape(); - ndNodeBase* const newNode = new ndNodeBase(shape); - m_array.AddNode(newNode, iter.GetNode()->GetKey(), m_myInstance); - } - - if (source.m_root) - { - ndNodeBase* pool[D_COMPOUND_STACK_DEPTH]; - ndNodeBase* parents[D_COMPOUND_STACK_DEPTH]; - pool[0] = source.m_root; - parents[0] = nullptr; - ndInt32 stack = 1; - while (stack) - { - stack--; - ndNodeBase* const sourceNode = pool[stack]; - - ndNodeBase* parent = nullptr; - if (sourceNode->m_type == m_node) - { - parent = new ndNodeBase(*sourceNode); - if (!sourceNode->m_parent) - { - m_root = parent; - } - else - { - parent->m_parent = parents[stack]; - if (parent->m_parent) - { - if (sourceNode->m_parent->m_left == sourceNode) - { - parent->m_parent->m_left = parent; - } - else - { - ndAssert(sourceNode->m_parent->m_right == sourceNode); - parent->m_parent->m_right = parent; - } - } - } - } - else - { - ndNodeBase* const node = m_array.Find(sourceNode->m_myNode->GetKey())->GetInfo(); - ndAssert(node); - node->m_parent = parents[stack]; - if (node->m_parent) - { - if (sourceNode->m_parent->m_left == sourceNode) - { - node->m_parent->m_left = node; - } - else - { - ndAssert(sourceNode->m_parent->m_right == sourceNode); - node->m_parent->m_right = node; - } - } - else - { - m_root = node; - } - } - - if (sourceNode->m_left) - { - parents[stack] = parent; - pool[stack] = sourceNode->m_left; - stack++; - ndAssert(stack < D_COMPOUND_STACK_DEPTH); - } - - if (sourceNode->m_right) - { - parents[stack] = parent; - pool[stack] = sourceNode->m_right; - stack++; - ndAssert(stack < D_COMPOUND_STACK_DEPTH); - } - } - } -} - -ndShapeCompound::~ndShapeCompound() -{ - if (m_root) - { - delete m_root; - } -} - -/* -//ndInt32 ndShapeCompound::CalculatePlaneIntersection(const ndFloat32* const vertex, const ndInt32* const index, ndInt32 indexCount, ndInt32 stride, const dPlane& localPlane, ndVector* const contactsOut) const -ndInt32 ndShapeCompound::CalculatePlaneIntersection(const ndFloat32* const, const ndInt32* const, ndInt32, ndInt32, const dPlane&, ndVector* const) const -{ - ndAssert(0); - return 0; - //ndInt32 count = 0; - //ndInt32 j = index[indexCount - 1] * stride; - //ndVector p0(&vertex[j]); - //p0 = p0 & ndVector::m_triplexMask; - //ndFloat32 side0 = localPlane.Evalue(p0); - //for (ndInt32 i = 0; i < indexCount; ++i) - //{ - // j = index[i] * stride; - // ndVector p1(&vertex[j]); - // p1 = p1 & ndVector::m_triplexMask; - // ndFloat32 side1 = localPlane.Evalue(p1); - // - // if (side0 < ndFloat32(0.0f)) { - // if (side1 >= ndFloat32(0.0f)) { - // ndVector dp(p1 - p0); - // ndAssert(dp.m_w == ndFloat32(0.0f)); - // ndFloat32 t = localPlane.DotProduct(dp).GetScalar(); - // ndAssert(dgAbs(t) >= ndFloat32(0.0f)); - // if (dgAbs(t) < ndFloat32(1.0e-8f)) { - // t = dgSign(t) * ndFloat32(1.0e-8f); - // } - // ndAssert(0); - // contactsOut[count] = p0 - dp.Scale(side0 / t); - // count++; - // - // } - // } - // else if (side1 <= ndFloat32(0.0f)) { - // ndVector dp(p1 - p0); - // ndAssert(dp.m_w == ndFloat32(0.0f)); - // ndFloat32 t = localPlane.DotProduct(dp).GetScalar(); - // ndAssert(dgAbs(t) >= ndFloat32(0.0f)); - // if (dgAbs(t) < ndFloat32(1.0e-8f)) { - // t = dgSign(t) * ndFloat32(1.0e-8f); - // } - // ndAssert(0); - // contactsOut[count] = p0 - dp.Scale(side0 / t); - // count++; - // } - // - // side0 = side1; - // p0 = p1; - //} - // - //return count; -} -*/ - -ndShapeInfo ndShapeCompound::GetShapeInfo() const -{ - ndShapeInfo info(ndShape::GetShapeInfo()); - info.m_compound.m_noUsed = 0; - return info; -} - -//void DebugShape(ndShapeCompound* const shapeInstance) -//{ -// const ndShapeCompound::ndTreeArray& shapeList = shapeInstance->GetTree(); -// ndShapeCompound::ndTreeArray::Iterator iter(shapeList); -// for (iter.Begin(); iter; iter++) -// { -// ndShapeInstance* const collision = iter.GetNode()->GetInfo()->GetShape(); -// /// do what you wnat here -// } -//} - -void ndShapeCompound::DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const -{ - ndTreeArray::Iterator iter(m_array); - for (iter.Begin(); iter; iter++) - { - ndShapeInstance* const collision = iter.GetNode()->GetInfo()->GetShape(); - collision->DebugShape(matrix, debugCallback); - } -} - -ndFloat32 ndShapeCompound::GetVolume() const -{ - ndAssert(0); - return ndFloat32(0.0f); -} - -ndFloat32 ndShapeCompound::GetBoxMinRadius() const -{ - return m_boxMinRadius; -} - -ndFloat32 ndShapeCompound::GetBoxMaxRadius() const -{ - return m_boxMaxRadius; -} - -void ndShapeCompound::CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const -{ - if (m_root) - { - const ndVector origin(matrix.TransformVector(m_root->m_origin)); - const ndVector size(matrix.m_front.Abs().Scale(m_root->m_size.m_x) + matrix.m_up.Abs().Scale(m_root->m_size.m_y) + matrix.m_right.Abs().Scale(m_root->m_size.m_z)); - p0 = (origin - size) & ndVector::m_triplexMask; - p1 = (origin + size) & ndVector::m_triplexMask; - } - else - { - p0 = ndVector::m_zero; - p1 = ndVector::m_zero; - } -} - -ndVector ndShapeCompound::SupportVertex(const ndVector&) const -{ - ndAssert(0); - return ndVector::m_zero; -} - -ndVector ndShapeCompound::SupportVertexSpecialProjectPoint(const ndVector&, const ndVector&) const -{ - ndAssert(0); - return ndVector::m_zero; -} - -ndVector ndShapeCompound::SupportVertexSpecial(const ndVector& dir, ndFloat32) const -{ - ndAssert(0); - return SupportVertex(dir); -} - -ndInt32 ndShapeCompound::CalculatePlaneIntersection(const ndVector&, const ndVector&, ndVector* const) const -{ - ndAssert(0); - return 0; -} - -ndVector ndShapeCompound::CalculateVolumeIntegral(const ndMatrix&, const ndVector&, const ndShapeInstance&) const -{ - ndAssert(0); - return ndVector::m_zero; -} - -ndFloat32 ndShapeCompound::RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const -{ - if (!m_root) - { - return ndFloat32 (1.2f); - } - - ndFloat32 distance[D_COMPOUND_STACK_DEPTH]; - const ndNodeBase* stackPool[D_COMPOUND_STACK_DEPTH]; - -// ndFloat32 maxParam = maxT; - ndFastRay ray (localP0, localP1); - - ndInt32 stack = 1; - stackPool[0] = m_root; - distance[0] = ray.BoxIntersect(m_root->m_p0, m_root->m_p1); - while (stack) - { - stack --; - ndFloat32 dist = distance[stack]; - - if (dist > maxT) - { - break; - } - else - { - const ndNodeBase* const me = stackPool[stack]; - ndAssert (me); - if (me->m_type == m_leaf) - { - ndContactPoint tmpContactOut; - ndShapeInstance* const shape = me->GetShape(); - const ndVector p0 (shape->GetLocalMatrix().UntransformVector (localP0) & ndVector::m_triplexMask); - const ndVector p1 (shape->GetLocalMatrix().UntransformVector (localP1) & ndVector::m_triplexMask); - //ndFloat32 param = shape->RayCast (p0, p1, maxT, tmpContactOut, preFilter, body, userData); - ndFloat32 param = shape->RayCast(callback, p0, p1, body, tmpContactOut); - if (param < maxT) - { - maxT = param; - contactOut.m_normal = shape->GetLocalMatrix().RotateVector (tmpContactOut.m_normal); - contactOut.m_shapeId0 = tmpContactOut.m_shapeId0; - contactOut.m_shapeId1 = tmpContactOut.m_shapeId0; - contactOut.m_shapeInstance0 = tmpContactOut.m_shapeInstance0; - contactOut.m_shapeInstance1 = tmpContactOut.m_shapeInstance1; - } - } - else - { - ndAssert (me->m_type == m_node); - const ndNodeBase* const left = me->m_left; - ndAssert (left); - ndFloat32 dist1 = ray.BoxIntersect(left->m_p0, left->m_p1); - if (dist1 < maxT) - { - ndInt32 j = stack; - for ( ; j && (dist1 > distance[j - 1]); j --) - { - stackPool[j] = stackPool[j - 1]; - distance[j] = distance[j - 1]; - } - stackPool[j] = left; - distance[j] = dist1; - stack++; - ndAssert (stack < ndInt32 (sizeof (stackPool) / sizeof (stackPool[0]))); - } - - const ndNodeBase* const right = me->m_right; - ndAssert (right); - dist1 = ray.BoxIntersect(right->m_p0, right->m_p1); - if (dist1 < maxT) - { - ndInt32 j = stack; - for ( ; j && (dist1 > distance[j - 1]); j --) - { - stackPool[j] = stackPool[j - 1]; - distance[j] = distance[j - 1]; - } - stackPool[j] = right; - distance[j] = dist1; - stack++; - ndAssert (stack < ndInt32 (sizeof (stackPool) / sizeof (stackPool[0]))); - } - } - } - } - return maxT; -} - -void ndShapeCompound::BeginAddRemove() -{ - ndAssert(m_myInstance); -} - -ndFloat32 ndShapeCompound::CalculateSurfaceArea(ndNodeBase* const node0, ndNodeBase* const node1, ndVector& minBox, ndVector& maxBox) const -{ - minBox = node0->m_p0.GetMin(node1->m_p0); - maxBox = node0->m_p1.GetMax(node1->m_p1); - ndVector side0(ndVector::m_half * (maxBox - minBox)); - return side0.DotProduct(side0.ShiftTripleRight()).GetScalar(); -} - -void ndShapeCompound::ImproveNodeFitness(ndNodeBase* const node) const -{ - ndAssert(node->m_left); - ndAssert(node->m_right); - - if (node->m_parent) - { - if (node->m_parent->m_left == node) - { - ndFloat32 cost0 = node->m_area; - - ndVector cost1P0; - ndVector cost1P1; - ndFloat32 cost1 = CalculateSurfaceArea(node->m_right, node->m_parent->m_right, cost1P0, cost1P1); - - ndVector cost2P0; - ndVector cost2P1; - ndFloat32 cost2 = CalculateSurfaceArea(node->m_left, node->m_parent->m_right, cost2P0, cost2P1); - - ndAssert(node->m_parent->m_p0.m_w == ndFloat32(0.0f)); - ndAssert(node->m_parent->m_p1.m_w == ndFloat32(0.0f)); - - if ((cost1 <= cost0) && (cost1 <= cost2)) - { - ndNodeBase* const parent = node->m_parent; - node->m_p0 = parent->m_p0; - node->m_p1 = parent->m_p1; - node->m_area = parent->m_area; - node->m_size = parent->m_size; - node->m_origin = parent->m_origin; - - if (parent->m_parent) - { - if (parent->m_parent->m_left == parent) - { - parent->m_parent->m_left = node; - } - else - { - ndAssert(parent->m_parent->m_right == parent); - parent->m_parent->m_right = node; - } - } - node->m_parent = parent->m_parent; - parent->m_parent = node; - node->m_right->m_parent = parent; - parent->m_left = node->m_right; - node->m_right = parent; - parent->m_p0 = cost1P0; - parent->m_p1 = cost1P1; - parent->m_area = cost1; - parent->m_size = (parent->m_p1 - parent->m_p0) * ndVector::m_half; - parent->m_origin = (parent->m_p1 + parent->m_p0) * ndVector::m_half; - - } - else if ((cost2 <= cost0) && (cost2 <= cost1)) - { - ndNodeBase* const parent = node->m_parent; - node->m_p0 = parent->m_p0; - node->m_p1 = parent->m_p1; - node->m_area = parent->m_area; - node->m_size = parent->m_size; - node->m_origin = parent->m_origin; - - if (parent->m_parent) - { - if (parent->m_parent->m_left == parent) - { - parent->m_parent->m_left = node; - } - else - { - ndAssert(parent->m_parent->m_right == parent); - parent->m_parent->m_right = node; - } - } - node->m_parent = parent->m_parent; - parent->m_parent = node; - node->m_left->m_parent = parent; - parent->m_left = node->m_left; - node->m_left = parent; - - parent->m_p0 = cost2P0; - parent->m_p1 = cost2P1; - parent->m_area = cost2; - parent->m_size = (parent->m_p1 - parent->m_p0) * ndVector::m_half; - parent->m_origin = (parent->m_p1 + parent->m_p0) * ndVector::m_half; - } - } - else - { - ndFloat32 cost0 = node->m_area; - - ndVector cost1P0; - ndVector cost1P1; - ndFloat32 cost1 = CalculateSurfaceArea(node->m_left, node->m_parent->m_left, cost1P0, cost1P1); - - ndVector cost2P0; - ndVector cost2P1; - ndFloat32 cost2 = CalculateSurfaceArea(node->m_right, node->m_parent->m_left, cost2P0, cost2P1); - - if ((cost1 <= cost0) && (cost1 <= cost2)) - { - ndNodeBase* const parent = node->m_parent; - node->m_p0 = parent->m_p0; - node->m_p1 = parent->m_p1; - node->m_area = parent->m_area; - node->m_size = parent->m_size; - node->m_origin = parent->m_origin; - - if (parent->m_parent) - { - if (parent->m_parent->m_left == parent) - { - parent->m_parent->m_left = node; - } - else - { - ndAssert(parent->m_parent->m_right == parent); - parent->m_parent->m_right = node; - } - } - node->m_parent = parent->m_parent; - parent->m_parent = node; - node->m_left->m_parent = parent; - parent->m_right = node->m_left; - node->m_left = parent; - - parent->m_p0 = cost1P0; - parent->m_p1 = cost1P1; - parent->m_area = cost1; - parent->m_size = (parent->m_p1 - parent->m_p0) * ndVector::m_half; - parent->m_origin = (parent->m_p1 + parent->m_p0) * ndVector::m_half; - - } - else if ((cost2 <= cost0) && (cost2 <= cost1)) - { - ndNodeBase* const parent = node->m_parent; - node->m_p0 = parent->m_p0; - node->m_p1 = parent->m_p1; - node->m_area = parent->m_area; - node->m_size = parent->m_size; - node->m_origin = parent->m_origin; - - if (parent->m_parent) - { - if (parent->m_parent->m_left == parent) - { - parent->m_parent->m_left = node; - } - else - { - ndAssert(parent->m_parent->m_right == parent); - parent->m_parent->m_right = node; - } - } - node->m_parent = parent->m_parent; - parent->m_parent = node; - node->m_right->m_parent = parent; - parent->m_right = node->m_right; - node->m_right = parent; - - parent->m_p0 = cost2P0; - parent->m_p1 = cost2P1; - parent->m_area = cost2; - parent->m_size = (parent->m_p1 - parent->m_p0) * ndVector::m_half; - parent->m_origin = (parent->m_p1 + parent->m_p0) * ndVector::m_half; - } - } - } -} - -ndFloat64 ndShapeCompound::CalculateEntropy(ndInt32 count, ndNodeBase** array) -{ - ndFloat64 cost0 = ndFloat32(1.0e20f); - ndFloat64 cost1 = cost0; - do { - cost1 = cost0; - //for (dgList::dgListNode* listNode = list.GetFirst(); listNode; listNode = listNode->GetNext()) { - for (ndInt32 i = 0; i < count; ++i) - { - ndNodeBase* const node = array[i]; - ImproveNodeFitness(node); - } - - cost0 = ndFloat32(0.0f); - //for (dgList::dgListNode* listNode = list.GetFirst(); listNode; listNode = listNode->GetNext()) { - for (ndInt32 i = 0; i < count; ++i) - { - //ndNodeBase* const node = listNode->GetInfo(); - ndNodeBase* const node = array[i]; - cost0 += node->m_area; - } - } while (cost0 < (cost1 * ndFloat32(0.9999f))); - return cost0; -} - - -ndShapeCompound::ndNodeBase* ndShapeCompound::BuildTopDown(ndNodeBase** const leafArray, ndInt32 firstBox, ndInt32 lastBox, ndNodeBase** rootNodesMemory, ndInt32& rootIndex) -{ - ndAssert(lastBox >= 0); - ndAssert(firstBox >= 0); - - if (lastBox == firstBox) - { - ndNodeBase* const node = leafArray[firstBox]; - return node; - } - - ndSpliteInfo info(&leafArray[firstBox], lastBox - firstBox + 1); - - ndNodeBase* const parent = rootNodesMemory[rootIndex]; - rootIndex++; - parent->m_parent = nullptr; - - parent->SetBox(info.m_p0, info.m_p1); - parent->m_right = BuildTopDown(leafArray, firstBox + info.m_axis, lastBox, rootNodesMemory, rootIndex); - parent->m_right->m_parent = parent; - - parent->m_left = BuildTopDown(leafArray, firstBox, firstBox + info.m_axis - 1, rootNodesMemory, rootIndex); - parent->m_left->m_parent = parent; - return parent; -} - -ndShapeCompound::ndNodeBase* ndShapeCompound::BuildTopDownBig(ndNodeBase** const leafArray, ndInt32 firstBox, ndInt32 lastBox, ndNodeBase** rootNodesMemory, ndInt32& rootIndex) -{ - if (lastBox == firstBox) - { - return BuildTopDown(leafArray, firstBox, lastBox, rootNodesMemory, rootIndex); - } - - ndInt32 midPoint = -1; - const ndFloat32 scale = ndFloat32(10.0f); - const ndFloat32 scale2 = ndFloat32(3.0f) * scale * scale; - const ndInt32 count = lastBox - firstBox; - for (ndInt32 i = 0; i < count; ++i) - { - const ndNodeBase* const node0 = leafArray[firstBox + i]; - const ndNodeBase* const node1 = leafArray[firstBox + i + 1]; - if (node1->m_area > (scale2 * node0->m_area)) - { - midPoint = i; - break; - } - } - - if (midPoint == -1) - { - return BuildTopDown(leafArray, firstBox, lastBox, rootNodesMemory, rootIndex); - } - - ndNodeBase* const parent = rootNodesMemory[rootIndex]; - rootIndex++; - parent->m_parent = nullptr; - - ndVector minP(ndFloat32(1.0e15f)); - ndVector maxP(-ndFloat32(1.0e15f)); - for (ndInt32 i = 0; i <= count; ++i) - { - const ndNodeBase* const node = leafArray[firstBox + i]; - ndAssert(node->m_shapeInstance); - minP = minP.GetMin(node->m_p0); - maxP = maxP.GetMax(node->m_p1); - } - - parent->SetBox(minP, maxP); - parent->m_left = BuildTopDown(leafArray, firstBox, firstBox + midPoint, rootNodesMemory, rootIndex); - parent->m_left->m_parent = parent; - - parent->m_right = BuildTopDownBig(leafArray, firstBox + midPoint + 1, lastBox, rootNodesMemory, rootIndex); - parent->m_right->m_parent = parent; - return parent; -} - -void ndShapeCompound::EndAddRemove() -{ - if (m_root) - { - //dgScopeSpinLock lock(&m_criticalSectionLock); - - ndTreeArray::Iterator iter(m_array); - for (iter.Begin(); iter; iter++) - { - ndNodeBase* const node = iter.GetNode()->GetInfo(); - node->CalculateAABB(); - } - - ndInt32 stack = 1; - ndInt32 nodeCount = 0; - ndNodeBase** nodeArray = ndAlloca(ndNodeBase*, m_array.GetCount() + 10); - ndNodeBase* stackBuffer[D_COMPOUND_STACK_DEPTH]; - - stackBuffer[0] = m_root; - while (stack) - { - stack--; - ndNodeBase* const node = stackBuffer[stack]; - - if (node->m_type == m_node) - { - nodeArray[nodeCount] = node; - nodeCount++; - ndAssert(nodeCount <= m_array.GetCount()); - - stackBuffer[stack] = node->m_right; - stack++; - ndAssert(stack < ndInt32 (sizeof(stackBuffer) / sizeof(stackBuffer[0]))); - - stackBuffer[stack] = node->m_left; - stack++; - ndAssert(stack < ndInt32(sizeof(stackBuffer) / sizeof(stackBuffer[0]))); - } - } - - if (nodeCount) - { - ndFloat64 cost = CalculateEntropy(nodeCount, nodeArray); - if ((cost > m_treeEntropy * ndFloat32(2.0f)) || (cost < m_treeEntropy * ndFloat32(0.5f))) - { - ndInt32 leafNodesCount = 0; - ndNodeBase** leafArray = ndAlloca(ndNodeBase*, nodeCount + 12); - for (ndInt32 i = 0; i < nodeCount; ++i) - { - ndNodeBase* const node = nodeArray[i]; - if (node->m_left->m_type == m_leaf) - { - leafArray[leafNodesCount] = node->m_left; - leafNodesCount++; - ndAssert(leafNodesCount <= (nodeCount + 1)); - } - if (node->m_right->m_type == m_leaf) - { - leafArray[leafNodesCount] = node->m_right; - leafNodesCount++; - ndAssert(leafNodesCount <= (nodeCount + 1)); - } - } - - class CompareNodes - { - public: - CompareNodes(void*) - { - } - - ndInt32 Compare(const ndNodeBase* const elementA, const ndNodeBase* const elementB) const - { - ndFloat32 areaA = elementA->m_area; - ndFloat32 areaB = elementB->m_area; - if (areaA < areaB) - { - return 1; - } - if (areaA > areaB) - { - return -1; - } - return 0; - } - }; - ndSort(leafArray, leafNodesCount, nullptr); - - ndInt32 rootIndex = 0; - m_root = BuildTopDownBig(&leafArray[0], 0, leafNodesCount - 1, nodeArray, rootIndex); - - //m_root->Sanity(); - m_treeEntropy = CalculateEntropy(nodeCount, nodeArray); - } - while (m_root->m_parent) - { - m_root = m_root->m_parent; - } - - //m_root->Sanity(); - } - else - { - m_treeEntropy = ndFloat32(2.0f); - } - - ndAssert(m_root->m_size.m_w == ndFloat32(0.0f)); - m_boxMinRadius = ndMin(ndMin(m_root->m_size.m_x, m_root->m_size.m_y), m_root->m_size.m_z); - m_boxMaxRadius = ndSqrt(m_root->m_size.DotProduct(m_root->m_size).GetScalar()); - - m_boxSize = m_root->m_size; - m_boxOrigin = m_root->m_origin; - MassProperties(); - } -} - -//void ndShapeCompound::RemoveNode(ndTreeArray::ndNode* const node) -void ndShapeCompound::RemoveNode(ndTreeArray::ndNode* const) -{ - ndAssert(0); -} - -ndShapeInstance* ndShapeCompound::GetShapeInstance(ndTreeArray::ndNode* const node) -{ - return node->GetInfo()->GetShape(); -} - -ndShapeCompound::ndTreeArray::ndNode* ndShapeCompound::AddCollision(ndShapeInstance* const subInstance) -{ - ndAssert(m_myInstance); - ndNodeBase* const newNode = new ndNodeBase(subInstance); - m_array.AddNode(newNode, m_idIndex, m_myInstance); - - m_idIndex++; - - if (!m_root) - { - m_root = newNode; - } - else - { - ndVector p0; - ndVector p1; - ndNodeBase* sibling = m_root; - ndFloat32 surfaceArea = CalculateSurfaceArea(newNode, sibling, p0, p1); - while (sibling->m_left && sibling->m_right) - { - if (surfaceArea > sibling->m_area) - { - break; - } - - sibling->SetBox(p0, p1); - - ndVector leftP0; - ndVector leftP1; - ndFloat32 leftSurfaceArea = CalculateSurfaceArea(newNode, sibling->m_left, leftP0, leftP1); - - ndVector rightP0; - ndVector rightP1; - ndFloat32 rightSurfaceArea = CalculateSurfaceArea(newNode, sibling->m_right, rightP0, rightP1); - - if (leftSurfaceArea < rightSurfaceArea) - { - sibling = sibling->m_left; - p0 = leftP0; - p1 = leftP1; - surfaceArea = leftSurfaceArea; - } - else - { - sibling = sibling->m_right; - p0 = rightP0; - p1 = rightP1; - surfaceArea = rightSurfaceArea; - } - } - - if (!sibling->m_parent) - { - m_root = new ndNodeBase(sibling, newNode); - } - else - { - ndNodeBase* const parent = sibling->m_parent; - if (parent->m_left == sibling) - { - ndNodeBase* const node = new ndNodeBase(sibling, newNode); - parent->m_left = node; - node->m_parent = parent; - } - else - { - ndAssert(parent->m_right == sibling); - ndNodeBase* const node = new ndNodeBase(sibling, newNode); - parent->m_right = node; - node->m_parent = parent; - } - } - } - - return newNode->m_myNode; -} - -void ndShapeCompound::MassProperties() -{ -#ifdef _DEBUG - // ndVector origin_ (ndVector::m_zero); - // ndVector inertia_ (ndVector::m_zero); - // ndVector crossInertia_ (ndVector::m_zero); - // dgPolyhedraMassProperties localData; - // DebugCollision (dgGetIdentityMatrix(), CalculateInertia, &localData); - // ndFloat32 volume_ = localData.MassProperties (origin_, inertia_, crossInertia_); - // ndAssert (volume_ > ndFloat32 (0.0f)); - // ndFloat32 invVolume_ = ndFloat32 (1.0f)/volume_; - // m_centerOfMass = origin_.Scale (invVolume_); - // m_centerOfMass.m_w = volume_; - // m_inertia = inertia_.Scale (invVolume_); - // m_crossInertia = crossInertia_.Scale(invVolume_); -#endif - - ndFloat32 volume = ndFloat32(0.0f); - ndVector origin(ndVector::m_zero); - ndVector inertiaII(ndVector::m_zero); - ndVector inertiaIJ(ndVector::m_zero); - ndTreeArray::Iterator iter(m_array); - bool hasVolume = true; - for (iter.Begin(); iter; iter++) - { - ndShapeInstance* const collision = iter.GetNode()->GetInfo()->GetShape(); - ndMatrix shapeInertia(collision->CalculateInertia()); - ndFloat32 shapeVolume = collision->GetVolume(); - - hasVolume = hasVolume && (collision->GetShape()->GetAsShapeStaticMesh() != nullptr); - volume += shapeVolume; - origin += shapeInertia.m_posit.Scale(shapeVolume); - inertiaII += ndVector(shapeInertia[0][0], shapeInertia[1][1], shapeInertia[2][2], ndFloat32(0.0f)).Scale(shapeVolume); - inertiaIJ += ndVector(shapeInertia[1][2], shapeInertia[0][2], shapeInertia[0][1], ndFloat32(0.0f)).Scale(shapeVolume); - } - - m_inertia = ndVector::m_zero; - m_crossInertia = ndVector::m_zero; - m_centerOfMass = ndVector::m_zero; - if (hasVolume && (volume > ndFloat32(0.0f))) - { - ndFloat32 invVolume = ndFloat32(1.0f) / volume; - m_inertia = inertiaII.Scale(invVolume); - m_crossInertia = inertiaIJ.Scale(invVolume); - m_centerOfMass = origin.Scale(invVolume); - m_centerOfMass.m_w = volume; - ndShape::MassProperties(); - } -} - -void ndShapeCompound::SetSubShapeOwner(ndBodyKinematic* const body) -{ - ndTreeArray::Iterator iter(m_array); - for (iter.Begin(); iter; iter++) - { - ndNodeBase* const node = iter.GetNode()->GetInfo(); - ndShapeInstance* const collision = node->GetShape(); - collision->m_ownerBody = body; - } -} - -void ndShapeCompound::ApplyScale(const ndVector& scale) -{ - ndTreeArray::Iterator iter(m_array); - - ndMatrix scaleMatrix(ndGetIdentityMatrix()); - scaleMatrix[0][0] = scale.m_x; - scaleMatrix[1][1] = scale.m_y; - scaleMatrix[2][2] = scale.m_z; - for (iter.Begin(); iter; iter++) - { - ndNodeBase* const node = iter.GetNode()->GetInfo(); - ndShapeInstance* const collision = node->GetShape(); - const ndMatrix matrix(collision->GetScaledTransform(scaleMatrix)); - collision->SetLocalMatrix(ndGetIdentityMatrix()); - collision->SetGlobalScale(matrix); - } - m_treeEntropy = ndFloat32(0.0f); - EndAddRemove(); -} - -ndFloat32 ndShapeCompound::CalculateMassProperties(const ndMatrix& offset, ndVector& inertia, ndVector& crossInertia, ndVector& centerOfMass) const -{ - class ndCalculateMassProperties: public ndShapeDebugNotify - { - public: - - virtual void DrawPolygon(ndInt32 vertexCount, const ndVector* const faceArray, const ndEdgeType* const) - { - m_localData.AddInertiaAndCrossFace(vertexCount, faceArray); - } - - ndPolyhedraMassProperties m_localData; - }; - - ndCalculateMassProperties massPropretiesCalculator; - DebugShape(offset, massPropretiesCalculator); - return massPropretiesCalculator.m_localData.MassProperties(centerOfMass, inertia, crossInertia); -} - -ndMatrix ndShapeCompound::CalculateInertiaAndCenterOfMass(const ndMatrix& alignMatrix, const ndVector& localScale, const ndMatrix& matrix) const -{ - ndVector inertiaII; - ndVector crossInertia; - ndVector centerOfMass; - ndMatrix scaledMatrix(matrix); - scaledMatrix[0] = scaledMatrix[0].Scale(localScale.m_x); - scaledMatrix[1] = scaledMatrix[1].Scale(localScale.m_y); - scaledMatrix[2] = scaledMatrix[2].Scale(localScale.m_z); - scaledMatrix = alignMatrix * scaledMatrix; - - ndFloat32 volume = CalculateMassProperties(scaledMatrix, inertiaII, crossInertia, centerOfMass); - if (volume < D_MAX_MIN_VOLUME) - { - volume = D_MAX_MIN_VOLUME; - } - - ndFloat32 invVolume = ndFloat32(1.0f) / volume; - centerOfMass = centerOfMass.Scale(invVolume); - inertiaII = inertiaII.Scale(invVolume); - crossInertia = crossInertia.Scale(invVolume); - ndMatrix inertia(ndGetIdentityMatrix()); - inertia[0][0] = inertiaII[0]; - inertia[1][1] = inertiaII[1]; - inertia[2][2] = inertiaII[2]; - inertia[0][1] = crossInertia[2]; - inertia[1][0] = crossInertia[2]; - inertia[0][2] = crossInertia[1]; - inertia[2][0] = crossInertia[1]; - inertia[1][2] = crossInertia[0]; - inertia[2][1] = crossInertia[0]; - inertia[3] = centerOfMass; - return inertia; -} - -ndUnsigned64 ndShapeCompound::GetHash(ndUnsigned64 hash) const -{ - ndUnsigned64 crc = hash; - ndShapeCompound::ndTreeArray::Iterator it(GetTree()); - - ndShapeCompound* const compoundShape = (ndShapeCompound*)this; - for (it.Begin(); it; it++) - { - const ndShapeInstance* const childInstance = compoundShape->GetShapeInstance(it.GetNode()); - const ndShape* const childShape = childInstance->GetShape(); - crc = childShape->GetHash(crc); - } - return crc; -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCompound.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCompound.h deleted file mode 100644 index e15db0f153..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCompound.h +++ /dev/null @@ -1,159 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_COMPOUND_H__ -#define __ND_SHAPE_COMPOUND_H__ - -#include "ndCollisionStdafx.h" -#include "ndShape.h" - -class ndBodyKinematic; - -#define D_COMPOUND_STACK_DEPTH 256 - -class ndShapeCompound: public ndShape -{ - public: - enum ndNodeType - { - m_leaf, - m_node, - }; - - class ndNodeBase; - class ndTreeArray : public ndTree> - { - public: - D_COLLISION_API ndTreeArray(); - D_COLLISION_API void AddNode(ndNodeBase* const node, ndInt32 index, const ndShapeInstance* const parent); - }; - - D_CLASS_REFLECTION(ndShapeCompound,ndShape) - - D_COLLISION_API ndShapeCompound(); - D_COLLISION_API virtual ~ndShapeCompound(); - - void SetOwner(const ndShapeInstance* const myInstance); - - D_COLLISION_API const ndTreeArray& GetTree() const; - D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; - - D_COLLISION_API virtual void BeginAddRemove(); - D_COLLISION_API virtual void RemoveNode(ndTreeArray::ndNode* const node); - D_COLLISION_API virtual ndTreeArray::ndNode* AddCollision(ndShapeInstance* const part); - D_COLLISION_API virtual ndShapeInstance* GetShapeInstance(ndTreeArray::ndNode* const node); - D_COLLISION_API virtual void EndAddRemove(); - - protected: - class ndSpliteInfo; - D_COLLISION_API ndShapeCompound(const ndShapeCompound& source, const ndShapeInstance* const myInstance); - - virtual ndShapeInfo GetShapeInfo() const; - virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - - virtual ndFloat32 GetVolume() const; - virtual ndFloat32 GetBoxMinRadius() const; - virtual ndFloat32 GetBoxMaxRadius() const; - - virtual ndShapeCompound* GetAsShapeCompound(); - virtual ndVector SupportVertex(const ndVector& dir) const; - virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& plane, const ndShapeInstance& parentScale) const; - - D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; - //D_COLLISION_API ndInt32 CalculatePlaneIntersection(const ndFloat32* const vertex, const ndInt32* const index, ndInt32 indexCount, ndInt32 strideInFloat, const dPlane& localPlane, dVector* const contactsOut) const; - - virtual void MassProperties(); - void ApplyScale(const ndVector& scale); - void SetSubShapeOwner(ndBodyKinematic* const body); - void ImproveNodeFitness(ndNodeBase* const node) const; - ndFloat64 CalculateEntropy(ndInt32 count, ndNodeBase** array); - ndNodeBase* BuildTopDown(ndNodeBase** const leafArray, ndInt32 firstBox, ndInt32 lastBox, ndNodeBase** rootNodesMemory, ndInt32& rootIndex); - ndNodeBase* BuildTopDownBig(ndNodeBase** const leafArray, ndInt32 firstBox, ndInt32 lastBox, ndNodeBase** rootNodesMemory, ndInt32& rootIndex); - ndFloat32 CalculateSurfaceArea(ndNodeBase* const node0, ndNodeBase* const node1, ndVector& minBox, ndVector& maxBox) const; - ndMatrix CalculateInertiaAndCenterOfMass(const ndMatrix& alignMatrix, const ndVector& localScale, const ndMatrix& matrix) const; - ndFloat32 CalculateMassProperties(const ndMatrix& offset, ndVector& inertia, ndVector& crossInertia, ndVector& centerOfMass) const; - - ndTreeArray m_array; - ndFloat64 m_treeEntropy; - ndFloat32 m_boxMinRadius; - ndFloat32 m_boxMaxRadius; - ndNodeBase* m_root; - const ndShapeInstance* m_myInstance; - ndInt32 m_idIndex; - - friend class ndBodyKinematic; - friend class ndShapeInstance; - friend class ndContactSolver; -}; - -inline ndShapeCompound* ndShapeCompound::GetAsShapeCompound() -{ - return this; -} - -inline void ndShapeCompound::SetOwner(const ndShapeInstance* const instance) -{ - m_myInstance = instance; -} - -class ndShapeCompound::ndNodeBase: public ndClassAlloc -{ - public: - D_COLLISION_API ndNodeBase(); - D_COLLISION_API ndNodeBase(const ndNodeBase& copyFrom); - D_COLLISION_API ndNodeBase(ndShapeInstance* const instance); - D_COLLISION_API ndNodeBase(ndNodeBase* const left, ndNodeBase* const right); - D_COLLISION_API ~ndNodeBase(); - - //void Sanity(int level = 0); - D_COLLISION_API ndShapeInstance* GetShape() const; - - private: - void CalculateAABB(); - void SetBox(const ndVector& p0, const ndVector& p1); - - ndVector m_p0; - ndVector m_p1; - ndVector m_size; - ndVector m_origin; - ndFloat32 m_area; - ndInt32 m_type; - ndNodeBase* m_left; - ndNodeBase* m_right; - ndNodeBase* m_parent; - ndTreeArray::ndNode* m_myNode; - ndShapeInstance* m_shapeInstance; - - friend class ndStackEntry; - friend class ndContactSolver; - friend class ndShapeCompound; - friend class ndStackBvhStackEntry; -}; - - -#endif - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCone.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCone.cpp deleted file mode 100644 index d1f3f2388c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCone.cpp +++ /dev/null @@ -1,359 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndShapeCone.h" -#include "ndContactSolver.h" - -ndInt32 ndShapeCone::m_shapeRefCount = 0; -ndShapeConvex::ndConvexSimplexEdge ndShapeCone::m_edgeArray[D_CONE_SEGMENTS * 4]; - -ndShapeCone::ndShapeCone(ndFloat32 radius, ndFloat32 height) - :ndShapeConvex(m_cone) -{ - Init(radius, height); -} - -ndShapeCone::~ndShapeCone() -{ - m_shapeRefCount--; - ndAssert(m_shapeRefCount >= 0); - ndShapeConvex::m_vertex = nullptr; - ndShapeConvex::m_simplex = nullptr; -} - -void ndShapeCone::Init(ndFloat32 radius, ndFloat32 height) -{ - m_radius = ndMax(ndAbs(radius), D_MIN_CONVEX_SHAPE_SIZE); - m_height = ndMax(ndAbs(height * ndFloat32(0.5f)), D_MIN_CONVEX_SHAPE_SIZE); - - ndFloat32 angle = ndFloat32(0.0f); - for (ndInt32 i = 0; i < D_CONE_SEGMENTS; ++i) - { - ndFloat32 sinAngle = ndSin(angle); - ndFloat32 cosAngle = ndCos(angle); - m_vertex[i] = ndVector(-m_height, m_radius * cosAngle, m_radius * sinAngle, ndFloat32(0.0f)); - angle += ndFloat32 (2.0f) * ndPi / D_CONE_SEGMENTS; - } - m_vertex[D_CONE_SEGMENTS] = ndVector(m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - - m_edgeCount = D_CONE_SEGMENTS * 4; - m_vertexCount = D_CONE_SEGMENTS + 1; - ndShapeConvex::m_vertex = m_vertex; - - if (!m_shapeRefCount) - { - ndPolyhedra polyhedra; - ndInt32 wireframe[D_CONE_SEGMENTS]; - - ndInt32 j = D_CONE_SEGMENTS - 1; - polyhedra.BeginFace(); - for (ndInt32 i = 0; i < D_CONE_SEGMENTS; ++i) - { - wireframe[0] = j; - wireframe[1] = i; - wireframe[2] = D_CONE_SEGMENTS; - j = i; - polyhedra.AddFace(3, wireframe); - } - - for (ndInt32 i = 0; i < D_CONE_SEGMENTS; ++i) - { - wireframe[i] = D_CONE_SEGMENTS - 1 - i; - } - polyhedra.AddFace(D_CONE_SEGMENTS, wireframe); - polyhedra.EndFace(); - - ndAssert(SanityCheck(polyhedra)); - - ndUnsigned64 i = 0; - ndPolyhedra::Iterator iter(polyhedra); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - edge->m_userData = i; - i++; - } - - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - - ndConvexSimplexEdge* const ptr = &m_edgeArray[edge->m_userData]; - - ptr->m_vertex = edge->m_incidentVertex; - ptr->m_next = &m_edgeArray[edge->m_next->m_userData]; - ptr->m_prev = &m_edgeArray[edge->m_prev->m_userData]; - ptr->m_twin = &m_edgeArray[edge->m_twin->m_userData]; - } - } - - m_profile[0] = ndVector(m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - m_profile[1] = ndVector(-m_height, m_radius, ndFloat32(0.0f), ndFloat32(0.0f)); - m_profile[2] = ndVector(-m_height, -m_radius, ndFloat32(0.0f), ndFloat32(0.0f)); - - m_shapeRefCount++; - ndShapeConvex::m_simplex = m_edgeArray; - - SetVolumeAndCG(); -} - -ndShapeInfo ndShapeCone::GetShapeInfo() const -{ - ndShapeInfo info(ndShapeConvex::GetShapeInfo()); - - info.m_cone.m_radius = m_radius; - info.m_cylinder.m_height = ndFloat32(2.0f) * m_height; - return info; -} - -void ndShapeCone::DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const -{ - #define NUMBER_OF_DEBUG_SEGMENTS 40 - ndVector pool[NUMBER_OF_DEBUG_SEGMENTS + 1]; - ndVector face[NUMBER_OF_DEBUG_SEGMENTS]; - ndShapeDebugNotify::ndEdgeType edgeType[NUMBER_OF_DEBUG_SEGMENTS]; - memset(edgeType, ndShapeDebugNotify::m_shared, sizeof(edgeType)); - - ndFloat32 angle = ndFloat32(0.0f); - for (ndInt32 i = 0; i < NUMBER_OF_DEBUG_SEGMENTS; ++i) - { - ndFloat32 z = ndSin(angle) * m_radius; - ndFloat32 y = ndCos(angle) * m_radius; - pool[i].m_x = -m_height; - pool[i].m_y = y; - pool[i].m_z = z; - angle += ndFloat32 (2.0f) * ndPi / ndFloat32(NUMBER_OF_DEBUG_SEGMENTS); - } - - pool[NUMBER_OF_DEBUG_SEGMENTS].m_x = m_height; - pool[NUMBER_OF_DEBUG_SEGMENTS].m_y = ndFloat32(0.0f); - pool[NUMBER_OF_DEBUG_SEGMENTS].m_z = ndFloat32(0.0f); - pool[NUMBER_OF_DEBUG_SEGMENTS].m_w = ndFloat32(0.0f); - - matrix.TransformTriplex(&pool[0].m_x, sizeof(ndVector), &pool[0].m_x, sizeof(ndVector), NUMBER_OF_DEBUG_SEGMENTS + 1); - ndInt32 j = NUMBER_OF_DEBUG_SEGMENTS - 1; - for (ndInt32 i = 0; i < NUMBER_OF_DEBUG_SEGMENTS; ++i) - { - face[0] = pool[j]; - face[1] = pool[i]; - face[2] = pool[NUMBER_OF_DEBUG_SEGMENTS]; - j = i; - debugCallback.DrawPolygon(3, face, edgeType); - } - - for (ndInt32 i = 0; i < NUMBER_OF_DEBUG_SEGMENTS; ++i) - { - face[i] = pool[NUMBER_OF_DEBUG_SEGMENTS - 1 - i]; - } - debugCallback.DrawPolygon(NUMBER_OF_DEBUG_SEGMENTS, face, edgeType); -} - -ndVector ndShapeCone::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - return point + dir.Scale(D_PENETRATION_TOL); -} - -ndVector ndShapeCone::SupportVertex(const ndVector& dir) const -{ - //ndAssert(dir.m_w == ndFloat32(0.0f)); - //ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - // - //if (dir.m_x < ndFloat32(-0.9999f)) - //{ - // return ndVector(-m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - //} - //else if (dir.m_x > ndFloat32(0.9999f)) - //{ - // return ndVector(m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - //} - // - //ndVector dir_yz(dir); - //dir_yz.m_x = ndFloat32(0.0f); - //ndAssert(dir_yz.DotProduct(dir_yz).GetScalar() > ndFloat32(0.0f)); - //dir_yz = dir_yz.Normalize(); - // - //ndVector p0(dir_yz.Scale(m_radius)); - //ndVector p1(ndVector::m_zero); - // - //p0.m_x = -m_height; - //p1.m_x = m_height; - // - //ndFloat32 dist0 = dir.DotProduct(p0).GetScalar(); - //ndFloat32 dist1 = dir.DotProduct(p1).GetScalar(); - // - //if (dist1 >= dist0) - //{ - // p0 = p1; - //} - //return p0; - return SupportVertexSpecial(dir, ndFloat32 (0.0f)); -} - -ndVector ndShapeCone::SupportVertexSpecial(const ndVector& dir, ndFloat32) const -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - - if (dir.m_x < ndFloat32(-0.9999f)) - { - return ndVector(-m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - } - else if (dir.m_x > ndFloat32(0.9999f)) - { - return ndVector(m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - } - - ndVector dir_yz(dir); - dir_yz.m_x = ndFloat32(0.0f); - ndAssert(dir_yz.DotProduct(dir_yz).GetScalar() > ndFloat32(0.0f)); - dir_yz = dir_yz.Normalize(); - - ndVector p1(ndVector::m_zero); - ndVector p0(dir_yz.Scale(m_radius)); - - p1.m_x = m_height; - p0.m_x = -m_height; - - ndFloat32 dist0 = dir.DotProduct(p0).GetScalar(); - ndFloat32 dist1 = dir.DotProduct(p1).GetScalar(); - - if (dist1 >= dist0) - { - p0 = p1; - } - return p0; -} - -ndFloat32 ndShapeCone::RayCast(ndRayCastNotify& callback, const ndVector& r0, const ndVector& r1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const -{ - return ndShapeConvex::RayCast(callback, r0, r1, maxT, body, contactOut); -} - -ndInt32 ndShapeCone::CalculatePlaneIntersection(const ndVector& normal, const ndVector& origin, ndVector* const contactsOut) const -{ - ndInt32 count = 0; - if (normal.m_x > ndFloat32(0.99f)) - { - contactsOut[0] = ndVector(m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - count = 1; - } - else if (normal.m_x < ndFloat32(-0.995f)) - { - const ndFloat32 inclination = ndFloat32(0.9998f); - if (normal.m_x < -inclination) - { - ndMatrix matrix(ndGramSchmidtMatrix(normal)); - matrix.m_posit.m_x = origin.m_x; - count = BuildCylinderCapPoly(m_radius, matrix, contactsOut); - } - else - { - ndFloat32 magInv = ndRsqrt(normal.m_y * normal.m_y + normal.m_z * normal.m_z); - ndFloat32 cosAng = normal.m_y * magInv; - ndFloat32 sinAng = normal.m_z * magInv; - - ndAssert(ndAbs(normal.m_z * cosAng - normal.m_y * sinAng) < ndFloat32(1.0e-4f)); - ndVector normal1(normal.m_x, normal.m_y * cosAng + normal.m_z * sinAng, ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector origin1(origin.m_x, origin.m_y * cosAng + origin.m_z * sinAng, origin.m_z * cosAng - origin.m_y * sinAng, ndFloat32(0.0f)); - - count = ndShapeConvex::CalculatePlaneIntersection(normal1, origin1, contactsOut); - if (count > 6) - { - ndInt32 dy = 2 * 6; - ndInt32 dx = 2 * count; - ndInt32 acc = dy - count; - ndInt32 index = 0; - for (ndInt32 i = 0; i < count; ++i) - { - if (acc > 0) - { - contactsOut[index] = contactsOut[i]; - index++; - acc -= dx; - } - acc += dy; - } - count = index; - } - - for (ndInt32 i = 0; i < count; ++i) - { - ndFloat32 y = contactsOut[i].m_y; - ndFloat32 z = contactsOut[i].m_z; - contactsOut[i].m_y = y * cosAng - z * sinAng; - contactsOut[i].m_z = z * cosAng + y * sinAng; - } - } - } - else - { - ndFloat32 magInv = ndRsqrt(normal.m_y * normal.m_y + normal.m_z * normal.m_z); - ndFloat32 cosAng = normal.m_y * magInv; - ndFloat32 sinAng = normal.m_z * magInv; - - ndAssert(ndAbs(normal.m_z * cosAng - normal.m_y * sinAng) < ndFloat32(1.0e-4f)); - ndVector normal1(normal.m_x, normal.m_y * cosAng + normal.m_z * sinAng, ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector origin1(origin.m_x, origin.m_y * cosAng + origin.m_z * sinAng, origin.m_z * cosAng - origin.m_y * sinAng, ndFloat32(0.0f)); - - count = 0; - ndInt32 i0 = 2; - ndVector test0((m_profile[i0] - origin1).DotProduct(normal1)); - for (ndInt32 i = 0; (i < 3) && (count < 2); ++i) - { - ndVector test1((m_profile[i] - origin1).DotProduct(normal1)); - ndVector acrossPlane(test0 * test1); - if (acrossPlane.m_x < 0.0f) - { - ndVector step(m_profile[i] - m_profile[i0]); - contactsOut[count] = m_profile[i0] - step.Scale(test0.m_x / (step.DotProduct(normal1).m_x)); - count++; - } - i0 = i; - test0 = test1; - } - - for (ndInt32 i = 0; i < count; ++i) - { - ndFloat32 y = contactsOut[i].m_y; - ndFloat32 z = contactsOut[i].m_z; - contactsOut[i].m_y = y * cosAng - z * sinAng; - contactsOut[i].m_z = z * cosAng + y * sinAng; - } - } - - return count; -} - -void ndShapeCone::CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const -{ - ndShapeConvex::CalculateAabb(matrix, p0, p1); -} - -ndUnsigned64 ndShapeCone::GetHash(ndUnsigned64 hash) const -{ - ndShapeInfo info(GetShapeInfo()); - return info.GetHash(hash); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCone.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCone.h deleted file mode 100644 index 712e0a6b1a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCone.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_CONE_H__ -#define __ND_SHAPE_CONE_H__ - -#include "ndShapeConvex.h" - -#define D_CONE_SEGMENTS 12 - -D_MSV_NEWTON_ALIGN_32 -class ndShapeCone : public ndShapeConvex -{ - public: - D_CLASS_REFLECTION(ndShapeCone, ndShapeConvex) - D_COLLISION_API ndShapeCone(ndFloat32 radio, ndFloat32 height); - D_COLLISION_API ~ndShapeCone(); - - virtual ndShapeCone* GetAsShapeCone() { return this; } - - protected: - D_COLLISION_API void Init (ndFloat32 radio, ndFloat32 height); - - D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; - D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; - D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; - D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - D_COLLISION_API virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - - ndVector m_profile[3]; - ndFloat32 m_height; - ndFloat32 m_radius; - ndVector m_vertex[D_CONE_SEGMENTS + 1]; - - static ndInt32 m_shapeRefCount; - static ndConvexSimplexEdge m_edgeArray[]; - -} D_GCC_NEWTON_ALIGN_32; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvex.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvex.cpp deleted file mode 100644 index 69cdf42b28..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvex.cpp +++ /dev/null @@ -1,1035 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndScene.h" -#include "ndContact.h" -#include "ndShapeNull.h" -#include "ndShapeConvex.h" -#include "ndShapeInstance.h" -#include "ndContactSolver.h" -#include "ndBodyKinematic.h" - -#define D_MAX_MIN_VOLUME ndFloat32 (1.0e-6f) -#define D_MAX_VERTEX_CLIP_FACE 16 - -ndShapeConvex::ndShapeConvex(ndShapeID id) - :ndShape(id) - ,m_vertex(nullptr) - ,m_simplex(nullptr) - ,m_boxMinRadius(ndFloat32(0.0f)) - ,m_boxMaxRadius(ndFloat32(0.0f)) - ,m_simplexVolume(ndFloat32(0.0f)) - ,m_edgeCount(0) - ,m_vertexCount(0) -{ -} - -ndShapeConvex::~ndShapeConvex() -{ - if (m_vertex) - { - ndMemory::Free(m_vertex); - } - - if (m_simplex) - { - ndMemory::Free(m_simplex); - } -} - -void ndShapeConvex::DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const -{ - ndVector tmp[D_MAX_EDGE_COUNT]; - ndVector vertex[D_MAX_EDGE_COUNT]; - ndInt8 mark[D_MAX_EDGE_COUNT]; - ndShapeDebugNotify::ndEdgeType edgeType[D_MAX_EDGE_COUNT]; - - ndAssert(m_edgeCount < D_MAX_EDGE_COUNT); - ndAssert(m_vertexCount < D_MAX_EDGE_COUNT); - - memset(mark, 0, sizeof(mark)); - memset(edgeType, ndShapeDebugNotify::m_shared, sizeof(edgeType)); - matrix.TransformTriplex(&tmp[0].m_x, sizeof(ndVector), &m_vertex[0].m_x, sizeof(ndVector), m_vertexCount); - for (ndInt32 i = 0; i < m_edgeCount; ++i) - { - if (!mark[i]) - { - ndConvexSimplexEdge* const face = &m_simplex[i]; - ndConvexSimplexEdge* edge = face; - ndInt32 count = 0; - do - { - mark[edge - m_simplex] = '1'; - ndInt32 index = edge->m_vertex; - vertex[count] = tmp[index] & ndVector::m_triplexMask; - count++; - edge = edge->m_next; - } while (edge != face); - debugCallback.DrawPolygon(count, vertex, edgeType); - } - } -} - -void ndShapeConvex::SetVolumeAndCG() -{ - ndVector faceVertex[D_MAX_EDGE_COUNT]; - ndInt8* const edgeMarks = ndAlloca(ndInt8, m_edgeCount + 32); - memset(&edgeMarks[0], 0, sizeof(ndInt8) * m_edgeCount); - - ndPolyhedraMassProperties localData; - for (ndInt32 i = 0; i < m_edgeCount; ++i) - { - ndConvexSimplexEdge* const face = &m_simplex[i]; - if (!edgeMarks[i]) { - ndConvexSimplexEdge* edge = face; - ndInt32 count = 0; - do - { - ndAssert((edge - m_simplex) >= 0); - edgeMarks[ndInt32(edge - m_simplex)] = '1'; - faceVertex[count] = m_vertex[edge->m_vertex]; - count++; - ndAssert(count < ndInt32(sizeof(faceVertex) / sizeof(faceVertex[0]))); - edge = edge->m_next; - } while (edge != face); - - localData.AddCGFace(count, faceVertex); - } - } - - ndVector origin; - ndVector inertia; - ndVector crossInertia; - ndFloat32 volume = localData.MassProperties(origin, inertia, crossInertia); - m_simplexVolume = volume; - - // calculate the origin of the bound box of this primitive - ndVector p0(ndVector::m_zero); - ndVector p1(ndVector::m_zero); - - for (ndInt32 i = 0; i < 3; ++i) - { - ndVector dir(ndFloat32(0.0f)); - dir[i] = ndFloat32(-1.0f); - p0[i] = SupportVertex(dir)[i]; - - dir[i] = ndFloat32(1.0f); - p1[i] = SupportVertex(dir)[i]; - } - - ndAssert(p0.m_w == ndFloat32(0.0f)); - ndAssert(p1.m_w == ndFloat32(0.0f)); - m_boxSize = (p1 - p0) * ndVector::m_half; - m_boxOrigin = (p1 + p0) * ndVector::m_half; - m_boxMinRadius = ndMin(ndMin(m_boxSize.m_x, m_boxSize.m_y), m_boxSize.m_z); - m_boxMaxRadius = ndSqrt((m_boxSize.DotProduct(m_boxSize)).GetScalar()); - - MassProperties(); -} - -void ndShapeConvex::MassProperties() -{ - ndFloat32 volume = CalculateMassProperties(ndGetIdentityMatrix(), m_inertia, m_crossInertia, m_centerOfMass); - if (volume < D_MAX_MIN_VOLUME) - { - volume = D_MAX_MIN_VOLUME; - } - ndFloat32 invVolume = ndFloat32(1.0f) / volume; - m_inertia = m_inertia.Scale(invVolume); - m_crossInertia = m_crossInertia.Scale(invVolume); - m_centerOfMass = m_centerOfMass.Scale(invVolume); - m_centerOfMass.m_w = volume; - - // complete the calculation - ndShape::MassProperties(); -} - -ndFloat32 ndShapeConvex::CalculateMassProperties(const ndMatrix& offset, ndVector& inertia, ndVector& crossInertia, ndVector& centerOfMass) const -{ - class dMassPropertiesCalculator : public ndShapeDebugNotify - { - public: - dMassPropertiesCalculator() - :m_localData() - { - } - - virtual void DrawPolygon(ndInt32 vertexCount, const ndVector* const faceArray, const ndEdgeType* const) - { - m_localData.AddInertiaAndCrossFace(vertexCount, faceArray); - } - - ndPolyhedraMassProperties m_localData; - }; - - dMassPropertiesCalculator massPropretiesCalculator; - - DebugShape(offset, massPropretiesCalculator); - return massPropretiesCalculator.m_localData.MassProperties(centerOfMass, inertia, crossInertia); -} - -ndMatrix ndShapeConvex::CalculateInertiaAndCenterOfMass(const ndMatrix& alignMatrix, const ndVector& localScale, const ndMatrix& matrix) const -{ - if ((ndAbs(localScale.m_x - localScale.m_y) < ndFloat32(1.0e-5f)) && - (ndAbs(localScale.m_x - localScale.m_z) < ndFloat32(1.0e-5f)) && - (ndAbs(localScale.m_y - localScale.m_z) < ndFloat32(1.0e-5f))) - { - ndAssert(alignMatrix.TestIdentity()); - - // using general central theorem, is much faster and more accurate; - //IImatrix = IIorigin + mass * [(displacemnet % displacemnet) * identityMatrix - transpose(displacement) * displacement)]; - ndFloat32 mag2 = localScale.m_x * localScale.m_x; - ndMatrix inertia(ndGetIdentityMatrix()); - inertia[0][0] = m_inertia[0] * mag2; - inertia[1][1] = m_inertia[1] * mag2; - inertia[2][2] = m_inertia[2] * mag2; - inertia[0][1] = m_crossInertia[2] * mag2; - inertia[1][0] = m_crossInertia[2] * mag2; - inertia[0][2] = m_crossInertia[1] * mag2; - inertia[2][0] = m_crossInertia[1] * mag2; - inertia[1][2] = m_crossInertia[0] * mag2; - inertia[2][1] = m_crossInertia[0] * mag2; - inertia = matrix.OrthoInverse() * inertia * matrix; - - ndAssert(localScale.m_w == ndFloat32(0.0f)); - ndVector origin(matrix.TransformVector(m_centerOfMass * localScale)); - - origin.m_w = ndFloat32(0.0f); - ndFloat32 originMag2 = origin.DotProduct(origin).GetScalar(); - ndMatrix covariance(ndCovarianceMatrix(origin, origin)); - ndMatrix parallel(ndGetIdentityMatrix()); - for (ndInt32 i = 0; i < 3; ++i) - { - parallel[i][i] = originMag2; - inertia[i] += (parallel[i] - covariance[i]); - ndAssert(inertia[i][i] > ndFloat32(0.0f)); - } - - inertia.m_posit = origin; - inertia.m_posit.m_w = ndFloat32 (1.0f); - return inertia; - } - else - { - // for non uniform scale we need to the general divergence theorem - ndVector inertiaII; - ndVector crossInertia; - ndVector centerOfMass; - ndMatrix scaledMatrix(matrix); - scaledMatrix[0] = scaledMatrix[0].Scale(localScale.m_x); - scaledMatrix[1] = scaledMatrix[1].Scale(localScale.m_y); - scaledMatrix[2] = scaledMatrix[2].Scale(localScale.m_z); - scaledMatrix = alignMatrix * scaledMatrix; - - ndFloat32 volume = CalculateMassProperties(scaledMatrix, inertiaII, crossInertia, centerOfMass); - if (volume < D_MAX_MIN_VOLUME) { - volume = D_MAX_MIN_VOLUME; - } - - ndFloat32 invVolume = ndFloat32(1.0f) / volume; - centerOfMass = centerOfMass.Scale(invVolume); - inertiaII = inertiaII.Scale(invVolume); - crossInertia = crossInertia.Scale(invVolume); - ndMatrix inertia(ndGetIdentityMatrix()); - inertia[0][0] = inertiaII[0]; - inertia[1][1] = inertiaII[1]; - inertia[2][2] = inertiaII[2]; - inertia[0][1] = crossInertia[2]; - inertia[1][0] = crossInertia[2]; - inertia[0][2] = crossInertia[1]; - inertia[2][0] = crossInertia[1]; - inertia[1][2] = crossInertia[0]; - inertia[2][1] = crossInertia[0]; - inertia[3] = centerOfMass; - return inertia; - } -} - -void ndShapeConvex::CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const -{ - ndVector origin(matrix.TransformVector(m_boxOrigin)); - ndVector size(matrix.m_front.Abs().Scale(m_boxSize.m_x) + matrix.m_up.Abs().Scale(m_boxSize.m_y) + matrix.m_right.Abs().Scale(m_boxSize.m_z)); - - p0 = (origin - size) & ndVector::m_triplexMask; - p1 = (origin + size) & ndVector::m_triplexMask; -} - -ndFloat32 ndShapeConvex::RayCast(ndRayCastNotify&, const ndVector& localP0, const ndVector& localP1, ndFloat32, const ndBody* const body, ndContactPoint& contactOut) const -{ - ndBodyKinematic* const kinBody = ((ndBodyKinematic*)body)->GetAsBodyKinematic(); - ndShapeInstance tempInstance (kinBody->GetCollisionShape(), (ndShape*)this); - ndContactNotify* const notify = kinBody->GetScene() ? kinBody->GetScene()->GetContactNotify() : nullptr; - ndContactSolver rayCaster(&tempInstance, notify, ndFloat32 (1.0f), 0); - return rayCaster.RayCast(localP0, localP1, contactOut); -} - -ndVector ndShapeConvex::SupportVertex(const ndVector& dir) const -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - - ndInt16 cache[16]; - memset(cache, -1, sizeof(cache)); - ndConvexSimplexEdge* edge = &m_simplex[0]; - - ndInt32 index = edge->m_vertex; - ndFloat32 side0 = m_vertex[index].DotProduct(dir).GetScalar(); - - cache[index & (sizeof(cache) / sizeof(cache[0]) - 1)] = ndInt16(index); - ndConvexSimplexEdge* ptr = edge; - ndInt32 maxCount = 128; - do - { - ndInt32 index1 = ptr->m_twin->m_vertex; - if (cache[index1 & (sizeof(cache) / sizeof(cache[0]) - 1)] != index1) - { - cache[index1 & (sizeof(cache) / sizeof(cache[0]) - 1)] = ndInt16(index1); - ndFloat32 side1 = m_vertex[index1].DotProduct(dir).GetScalar(); - if (side1 > side0) - { - index = index1; - side0 = side1; - edge = ptr->m_twin; - ptr = edge; - } - } - ptr = ptr->m_twin->m_next; - maxCount--; - } while ((ptr != edge) && maxCount); - ndAssert(maxCount); - - ndAssert(index != -1); - return m_vertex[index]; -} - -bool ndShapeConvex::SanityCheck(ndInt32 count, const ndVector& normal, ndVector* const contactsOut) const -{ - if (count > 1) - { - ndInt32 j = count - 1; - for (ndInt32 i = 0; i < count; ++i) - { - ndVector error(contactsOut[i] - contactsOut[j]); - ndAssert(error.m_w == ndFloat32(0.0f)); - if (error.DotProduct(error).GetScalar() <= ndFloat32(1.0e-20f)) - { - return false; - } - j = i; - } - - if (count >= 3) - { - ndVector n(ndFloat32(0.0f)); - ndVector e0(contactsOut[1] - contactsOut[0]); - for (ndInt32 i = 2; i < count; ++i) - { - ndVector e1(contactsOut[i] - contactsOut[0]); - n += e0.CrossProduct(e1); - e0 = e1; - } - ndAssert(n.m_w == ndFloat32(0.0f)); - ndAssert(n.DotProduct(n).GetScalar() > ndFloat32(0.0f)); - n = n.Scale(ndRsqrt(n.DotProduct(n).GetScalar())); - ndFloat32 projection; - projection = n.DotProduct(normal).GetScalar(); - ndAssert(projection > ndFloat32(0.9f)); - if (projection < ndFloat32(0.9f)) - { - return false; - } - - e0 = contactsOut[count - 1] - contactsOut[count - 2]; - j = count - 1; - for (ndInt32 i = 0; i < count; ++i) - { - ndVector e1(contactsOut[i] - contactsOut[j]); - ndVector n1(e0.CrossProduct(e1)); - ndAssert(n1.m_w == ndFloat32(0.0f)); - ndFloat32 error = n1.DotProduct(normal).GetScalar(); - ndAssert(error >= ndFloat32(-1.0e-4f)); - if (error < ndFloat32(-1.0e-4f)) - { - return false; - } - j = i; - e0 = e1; - } - } - } - return true; -} - -ndInt32 ndShapeConvex::RectifyConvexSlice(ndInt32 count, const ndVector& normal, ndVector* const contactsOut) const -{ - class ndConvexFaceNode - { - public: - ndInt32 m_vertexIndex; - ndConvexFaceNode* m_next; - ndConvexFaceNode* m_prev; - ndInt32 m_mask; - }; - - ndConvexFaceNode convexHull[D_MAX_CONTATCS + 1]; - char buffer[D_MAX_CONTATCS * (sizeof(void*) + sizeof(ndFloat32))]; - - ndInt32 start = count; - ndInt32 i0 = count - 1; - for (ndInt32 i = 0; i < count; ++i) - { - convexHull[i].m_vertexIndex = i; - convexHull[i].m_next = &convexHull[i + 1]; - convexHull[i].m_prev = &convexHull[i0]; - i0 = i; - } - convexHull[count - 1].m_next = &convexHull[0]; - - ndVector hullArea(ndVector::m_zero); - ndVector edge0(contactsOut[1] - contactsOut[0]); - for (ndInt32 i = 2; i < count; ++i) - { - ndVector edge1(contactsOut[i] - contactsOut[0]); - hullArea += edge1.CrossProduct(edge0); - edge0 = edge1; - } - - ndFloat32 totalArea = ndAbs(hullArea.DotProduct(normal).GetScalar()); - if (totalArea < ndFloat32(1.0e-5f)) - { - return 1; - } - ndConvexFaceNode* hullPoint = &convexHull[0]; - - bool hasLinearCombination = true; - ndUpHeap sortHeap(buffer, sizeof(buffer)); - while (hasLinearCombination) - { - hasLinearCombination = false; - sortHeap.Flush(); - ndConvexFaceNode* ptr = hullPoint; - ndVector e0(contactsOut[ptr->m_next->m_vertexIndex] - contactsOut[ptr->m_vertexIndex]); - do - { - ndVector e1(contactsOut[ptr->m_next->m_next->m_vertexIndex] - contactsOut[ptr->m_next->m_vertexIndex]); - ndFloat32 area = ndAbs(e0.CrossProduct(e1).DotProduct(normal).GetScalar()); - sortHeap.Push(ptr->m_next, area); - e0 = e1; - ptr->m_mask = 1; - ptr = ptr->m_next; - } while (ptr != hullPoint); - - while (sortHeap.GetCount() && (sortHeap.Value() * ndFloat32(32.0f) < totalArea)) - { - ndConvexFaceNode* const corner = sortHeap[0]; - if (corner->m_mask && corner->m_prev->m_mask) - { - if (hullPoint == corner) - { - hullPoint = corner->m_prev; - } - count--; - hasLinearCombination = true; - corner->m_prev->m_mask = 0; - corner->m_next->m_prev = corner->m_prev; - corner->m_prev->m_next = corner->m_next; - } - sortHeap.Pop(); - } - } - - const ndInt32 maxVertexCount = D_MAX_VERTEX_CLIP_FACE; - while (count > maxVertexCount) - { - sortHeap.Flush(); - ndConvexFaceNode* ptr = hullPoint; - ndVector e0(contactsOut[ptr->m_next->m_vertexIndex] - contactsOut[ptr->m_vertexIndex]); - do - { - ndVector e1(contactsOut[ptr->m_next->m_next->m_vertexIndex] - contactsOut[ptr->m_next->m_vertexIndex]); - ndFloat32 area = ndAbs(e0.CrossProduct(e1).DotProduct(normal).GetScalar()); - sortHeap.Push(ptr->m_next, area); - e0 = e1; - ptr->m_mask = 1; - ptr = ptr->m_next; - } while (ptr != hullPoint); - - while (sortHeap.GetCount() && (count > maxVertexCount)) - { - ndConvexFaceNode* const corner = sortHeap[0]; - if (corner->m_mask && corner->m_prev->m_mask) - { - if (hullPoint == corner) - { - hullPoint = corner->m_prev; - } - count--; - corner->m_prev->m_mask = 0; - corner->m_next->m_prev = corner->m_prev; - corner->m_prev->m_next = corner->m_next; - } - sortHeap.Pop(); - } - } - - ndInt32 index = start; - ndConvexFaceNode* ptr = hullPoint; - do - { - contactsOut[index] = contactsOut[ptr->m_vertexIndex]; - index++; - ptr = ptr->m_next; - } while (ptr != hullPoint); - ndMemCpy(contactsOut, &contactsOut[start], count); - - ndAssert(SanityCheck(count, normal, contactsOut)); - return count; -} - -ndVector ndShapeConvex::SupportFeatureVertex(const ndVector&, ndInt32* const) const -{ - ndAssert(0); - return ndVector::m_zero; -} - -ndInt32 ndShapeConvex::CalculatePlaneIntersection(const ndVector& normal, const ndVector& origin, ndVector* const contactsOut) const -{ - ndVector support[4]; - ndInt32 featureCount = 3; - const ndConvexSimplexEdge* edge = &m_simplex[0]; - const ndConvexSimplexEdge** const vertToEdgeMapping = GetVertexToEdgeMapping(); - ndAssert(normal.m_w == ndFloat32(0.0f)); - if (vertToEdgeMapping) - { - ndInt32 edgeIndex; - featureCount = 1; - support[0] = SupportFeatureVertex(normal, &edgeIndex); - edge = vertToEdgeMapping[edgeIndex]; - - // 5 degrees - const ndFloat32 tiltAngle = ndFloat32(0.087f); - const ndFloat32 tiltAngle2 = tiltAngle * tiltAngle; - ndPlane testPlane(normal, -(normal.DotProduct(support[0]).GetScalar())); - const ndConvexSimplexEdge* ptr = edge; - do - { - const ndVector& p = m_vertex[ptr->m_twin->m_vertex]; - ndFloat32 test = testPlane.Evalue(p); - ndVector dist(p - support[0]); - ndAssert(dist.m_w == ndFloat32(0.0f)); - ndFloat32 angle2 = test * test / (dist.DotProduct(dist).GetScalar()); - - if (angle2 < tiltAngle2) - { - support[featureCount] = p; - featureCount++; - } - ptr = ptr->m_twin->m_next; - } while ((ptr != edge) && (featureCount < 3)); - } - - ndInt32 count = 0; - ndPlane plane(normal, -normal.DotProduct(origin).GetScalar()); - switch (featureCount) - { - case 1: - contactsOut[0] = support[0] - normal * normal.DotProduct(support[0] - origin); - count = 1; - break; - - case 2: - contactsOut[0] = support[0] - normal * normal.DotProduct(support[0] - origin); - contactsOut[1] = support[1] - normal * normal.DotProduct(support[1] - origin); - count = 2; - break; - - default: - { - ndFloat32 side0 = plane.Evalue(m_vertex[edge->m_vertex]); - ndFloat32 side1 = side0; - const ndConvexSimplexEdge* firstEdge = nullptr; - if (side0 > ndFloat32(0.0f)) - { - const ndConvexSimplexEdge* ptr = edge; - do - { - ndAssert(m_vertex[ptr->m_twin->m_vertex].m_w == ndFloat32(0.0f)); - side1 = plane.Evalue(m_vertex[ptr->m_twin->m_vertex]); - if (side1 < side0) - { - if (side1 < ndFloat32(0.0f)) - { - firstEdge = ptr; - break; - } - - side0 = side1; - edge = ptr->m_twin; - ptr = edge; - } - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - - - if (!firstEdge) - { - // we may have a local minimal in the convex hull do to a big flat face - for (ndInt32 i = 0; i < m_edgeCount; ++i) - { - ptr = &m_simplex[i]; - side0 = plane.Evalue(m_vertex[ptr->m_vertex]); - side1 = plane.Evalue(m_vertex[ptr->m_twin->m_vertex]); - if ((side1 < ndFloat32(0.0f)) && (side0 > ndFloat32(0.0f))) - { - firstEdge = ptr; - break; - } - } - } - - } - else if (side0 < ndFloat32(0.0f)) - { - const ndConvexSimplexEdge* ptr = edge; - do - { - ndAssert(m_vertex[ptr->m_twin->m_vertex].m_w == ndFloat32(0.0f)); - side1 = plane.Evalue(m_vertex[ptr->m_twin->m_vertex]); - if (side1 > side0) - { - if (side1 >= ndFloat32(0.0f)) - { - side0 = side1; - firstEdge = ptr->m_twin; - break; - } - - side0 = side1; - edge = ptr->m_twin; - ptr = edge; - } - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - - if (!firstEdge) - { - // we may have a local minimal in the convex hull due to a big flat face - for (ndInt32 i = 0; i < m_edgeCount; ++i) - { - ptr = &m_simplex[i]; - side0 = plane.Evalue(m_vertex[ptr->m_vertex]); - //ndFloat32 side1 = plane.Evalue (m_vertex[ptr->m_twin->m_vertex]); - side1 = plane.Evalue(m_vertex[ptr->m_twin->m_vertex]); - if ((side1 < ndFloat32(0.0f)) && (side0 > ndFloat32(0.0f))) - { - firstEdge = ptr; - break; - } - } - } - } - - if (firstEdge) - { - ndAssert(side0 >= ndFloat32(0.0f)); - ndAssert((side1 = plane.Evalue(m_vertex[firstEdge->m_vertex])) >= ndFloat32(0.0f)); - ndAssert((side1 = plane.Evalue(m_vertex[firstEdge->m_twin->m_vertex])) < ndFloat32(0.0f)); - ndAssert(ndAbs(side0 - plane.Evalue(m_vertex[firstEdge->m_vertex])) < ndFloat32(1.0e-5f)); - - ndInt32 maxCount = 0; - const ndConvexSimplexEdge* ptr = firstEdge; - do - { - if (side0 > ndFloat32(0.0f)) - { - ndAssert(plane.Evalue(m_vertex[ptr->m_vertex]) > ndFloat32(0.0f)); - ndAssert(plane.Evalue(m_vertex[ptr->m_twin->m_vertex]) < ndFloat32(0.0f)); - - ndVector dp(m_vertex[ptr->m_twin->m_vertex] - m_vertex[ptr->m_vertex]); - ndAssert(dp.m_w == ndFloat32(0.0f)); - ndFloat32 t = plane.DotProduct(dp).GetScalar(); - if (t >= ndFloat32(-1.e-24f)) - { - t = ndFloat32(0.0f); - } - else - { - t = side0 / t; - if (t > ndFloat32(0.0f)) - { - t = ndFloat32(0.0f); - } - if (t < ndFloat32(-1.0f)) - { - t = ndFloat32(-1.0f); - } - } - - ndAssert(t <= ndFloat32(0.01f)); - ndAssert(t >= ndFloat32(-1.05f)); - contactsOut[count] = m_vertex[ptr->m_vertex] - dp.Scale(t); - - ndConvexSimplexEdge* ptr1 = ptr->m_next; - for (; ptr1 != ptr; ptr1 = ptr1->m_next) - { - ndAssert(m_vertex[ptr->m_twin->m_vertex].m_w == ndFloat32(0.0f)); - side0 = plane.Evalue(m_vertex[ptr1->m_twin->m_vertex]); - if (side0 >= ndFloat32(0.0f)) - { - break; - } - } - ndAssert(ptr1 != ptr); - ptr = ptr1->m_twin; - } - else - { - contactsOut[count] = m_vertex[ptr->m_vertex]; - ndConvexSimplexEdge* ptr1 = ptr->m_next; - for (; ptr1 != ptr; ptr1 = ptr1->m_next) - { - ndAssert(m_vertex[ptr1->m_twin->m_vertex].m_w == ndFloat32(0.0f)); - side0 = plane.Evalue(m_vertex[ptr1->m_twin->m_vertex]); - if (side0 >= ndFloat32(0.0f)) - { - break; - } - } - - if (ptr1 == ptr) - { - ptr = ptr1->m_prev->m_twin; - } - else - { - ptr = ptr1->m_twin; - } - } - - count++; - maxCount++; - if (count >= D_CLIP_MAX_POINT_COUNT) - { - for (count = 0; count < (D_CLIP_MAX_POINT_COUNT >> 1); count++) - { - contactsOut[count] = contactsOut[count * 2]; - } - } - - } while ((ptr != firstEdge) && (maxCount < D_CLIP_MAX_COUNT)); - ndAssert(maxCount < D_CLIP_MAX_COUNT); - - if (count > 2) - { - count = RectifyConvexSlice(count, normal, contactsOut); - } - } - } - } - return count; -} - -ndShapeInfo ndShapeConvex::GetShapeInfo() const -{ - ndShapeInfo info(ndShape::GetShapeInfo()); - return info; -} - -ndFloat32 ndShapeConvex::GetVolume() const -{ - return m_centerOfMass.m_w; -} - -ndFloat32 ndShapeConvex::GetBoxMinRadius() const -{ - return m_boxMinRadius; -} - -ndFloat32 ndShapeConvex::GetBoxMaxRadius() const -{ - return m_boxMaxRadius; -} - -bool ndShapeConvex::SanityCheck(ndPolyhedra& hull) const -{ - ndPolyhedra::Iterator iter(hull); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if (edge->m_incidentFace < 0) - { - return false; - } - ndEdge* ptr = edge; - ndVector p0(m_vertex[edge->m_incidentVertex]); - ptr = ptr->m_next; - ndVector p1(m_vertex[ptr->m_incidentVertex]); - ndVector e1(p1 - p0); - ndVector n0(ndFloat32(0.0f)); - for (ptr = ptr->m_next; ptr != edge; ptr = ptr->m_next) - { - ndVector p2(m_vertex[ptr->m_incidentVertex]); - ndVector e2(p2 - p0); - n0 += e1.CrossProduct(e2); - e1 = e2; - } - - ndAssert(n0.m_w == ndFloat32(0.0f)); - ptr = edge; - do - { - ndVector q0(m_vertex[ptr->m_twin->m_incidentVertex]); - for (ndEdge* neiborg = ptr->m_twin->m_next->m_next; neiborg != ptr->m_twin; neiborg = neiborg->m_next) - { - ndVector q1(m_vertex[neiborg->m_incidentVertex]); - ndVector q1q0(q1 - q0); - ndFloat32 project = q1q0.DotProduct(n0).GetScalar(); - if (project > ndFloat32(1.0e-5f)) - { - return false; - } - } - - ptr = ptr->m_next; - } while (ptr != edge); - } - - return true; -} - -ndVector ndShapeConvex::CalculateVolumeIntegral(const ndPlane& plane) const -{ - ndInt8* const mark = ndAlloca(ndInt8, m_edgeCount + 256); - ndFloat32* test = ndAlloca(ndFloat32, m_edgeCount + 256); - ndVector* faceVertex = ndAlloca(ndVector, m_edgeCount + 256); - - ndInt32 positive = 0; - ndInt32 negative = 0; - for (ndInt32 i = 0; i < m_vertexCount; ++i) - { - test[i] = plane.Evalue(m_vertex[i]); - if (test[i] > ndFloat32(1.0e-5f)) - { - positive++; - } - else if (test[i] < -ndFloat32(1.0e-5f)) - { - negative++; - } - else - { - test[i] = ndFloat32(0.0f); - } - } - - if (positive == m_vertexCount) - { - return ndVector::m_zero; - } - - if (negative == m_vertexCount) - { - return m_centerOfMass; - } - - ndPolyhedraMassProperties localData; - ndConvexSimplexEdge* capEdge = nullptr; - - ndVector cg(ndVector::m_zero); - memset(mark, 0, m_edgeCount); - for (ndInt32 i = 0; i < m_edgeCount; ++i) - { - if (!mark[i]) - { - ndConvexSimplexEdge* const face = &m_simplex[i]; - ndConvexSimplexEdge* edge = face; - ndInt32 count = 0; - ndFloat32 size0 = test[edge->m_prev->m_vertex]; - do - { - mark[edge - m_simplex] = '1'; - ndFloat32 size1 = test[edge->m_vertex]; - if (size0 <= ndFloat32(0.0f)) - { - faceVertex[count] = m_vertex[edge->m_prev->m_vertex]; - count++; - if (size1 > ndFloat32(0.0f)) - { - ndVector dp(m_vertex[edge->m_vertex] - m_vertex[edge->m_prev->m_vertex]); - ndAssert(dp.m_w == ndFloat32(0.0f)); - faceVertex[count] = m_vertex[edge->m_prev->m_vertex] - dp.Scale(size0 / dp.DotProduct(plane).GetScalar()); - count++; - } - } - else if (size1 < ndFloat32(0.0f)) - { - ndVector dp(m_vertex[edge->m_vertex] - m_vertex[edge->m_prev->m_vertex]); - ndAssert(dp.m_w == ndFloat32(0.0f)); - faceVertex[count] = m_vertex[edge->m_prev->m_vertex] - dp.Scale(size0 / dp.DotProduct(plane).GetScalar()); - count++; - ndAssert(count <= m_vertexCount); - } - - if (!capEdge) - { - if ((size1 > ndFloat32(0.0f)) && (size0 < ndFloat32(0.0f))) - { - capEdge = edge->m_prev->m_twin; - } - } - - size0 = size1; - edge = edge->m_next; - } while (edge != face); - - if (count) - { - localData.AddCGFace(count, faceVertex); - } - } - } - - if (capEdge) - { - ndInt32 count = 0; - ndConvexSimplexEdge* edge = capEdge; - ndConvexSimplexEdge* ptr = nullptr; - do - { - ndVector dp(m_vertex[edge->m_twin->m_vertex] - m_vertex[edge->m_vertex]); - ndAssert(dp.m_w == ndFloat32(0.0f)); - faceVertex[count] = m_vertex[edge->m_vertex] - dp.Scale(test[edge->m_vertex] / dp.DotProduct(plane).GetScalar()); - count++; - if (count >= m_edgeCount) - { - ndTrace(("%s something is wrong return zero\n", __FUNCTION__)); - return ndVector::m_zero; - } - - for (ptr = edge->m_next; ptr != edge; ptr = ptr->m_next) - { - ndInt32 index0 = ptr->m_twin->m_vertex; - if (test[index0] > ndFloat32(0.0f)) - { - index0 = ptr->m_vertex; - if (test[index0] < ndFloat32(0.0f)) - { - break; - } - } - } - edge = ptr->m_twin; - } while (edge != capEdge); - localData.AddCGFace(count, faceVertex); - } - - ndVector inertia; - ndVector crossInertia; - ndFloat32 volume = localData.MassProperties(cg, inertia, crossInertia); - cg = cg.Scale(ndFloat32(1.0f) / ndMax(volume, ndFloat32(1.0e-6f))); - cg.m_w = volume; - return cg; -} - -ndVector ndShapeConvex::CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& globalPlane, const ndShapeInstance& parentScale) const -{ - ndPlane localPlane(globalMatrix.UntransformPlane(globalPlane)); - - const ndVector& scale = parentScale.m_scale; - switch (parentScale.m_scaleType) - { - case ndShapeInstance::m_unit: - { - break; - } - - case ndShapeInstance::m_uniform: - { - localPlane.m_w *= parentScale.m_invScale.m_x; - break; - } - - case ndShapeInstance::m_nonUniform: - { - localPlane = localPlane * (scale | ndVector::m_wOne); - ndFloat32 mag2 = localPlane.DotProduct(localPlane & ndVector::m_triplexMask).GetScalar(); - localPlane = localPlane.Scale(ndRsqrt(mag2)); - break; - } - - case ndShapeInstance::m_global: - default: - { - localPlane = localPlane * (scale | ndVector::m_wOne); - ndFloat32 mag2 = localPlane.DotProduct(localPlane & ndVector::m_triplexMask).GetScalar(); - localPlane = localPlane.Scale(ndRsqrt(mag2)); - localPlane = parentScale.GetAlignmentMatrix().UntransformPlane(localPlane); - } - } - - ndVector cg(CalculateVolumeIntegral(localPlane)); - - ndFloat32 volume = cg.m_w * scale.m_x * scale.m_y * scale.m_z; - cg = parentScale.GetAlignmentMatrix().RotateVector(cg); - cg = cg * scale; - cg = globalMatrix.TransformVector(cg); - cg.m_w = volume; - return cg; -} - -//ndInt32 dgCollisionConvex::BuildCylinderCapPoly(ndFloat32 radius, const dMatrix& transform, ndVector* const vertexOut) const -ndInt32 ndShapeConvex::BuildCylinderCapPoly(ndFloat32 radius, const ndMatrix& transform, ndVector* const vertexOut) const -{ - /* - ndFloat32 h = 2.0; - ndInt32 n = 8; - ndFloat32 a0 = h * h * (dgPi / n); - - ndFloat32 h0 = h * dgSin (0.5 * dgPI2 / n); - ndFloat32 h1 = h * dgCos (0.5 * dgPI2 / n); - ndFloat32 a1 = h * h * (dgSin (0.5 * dgPI2 / n) * dgCos (0.5 * dgPI2 / n)); - - ndFloat32 a = h * h * (dgPi / n - 0.5f * dgSin (dgPI2 / n)); - - for (ndInt32 i = 8; i < 16; ++i) { - ndFloat32 den = dgPi / i - 0.5f * dgSin (dgPI2 / i); - ndFloat32 h1 = dgSqrt (a / den); - ndFloat32 h2 = dgSqrt (a / den); - } - */ - - ndInt32 count = (radius < ndFloat32(1.0f)) ? 8 : ((radius < ndFloat32(2.0f)) ? 12 : 16); - - ndFloat32 angle = ndFloat32 (2.0f) * ndPi / (ndFloat32)count; - ndVector r(ndFloat32(0.0f), ndFloat32(0.0f), radius, ndFloat32(0.0f)); - ndMatrix rotation(ndPitchMatrix(angle)); - - for (ndInt32 i = 0; i < count; ++i) - { - vertexOut[i] = transform.TransformVector(r); - r = rotation.RotateVector(r); - } - - return count; -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvex.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvex.h deleted file mode 100644 index 8dab2379ea..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvex.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_CONVEX_H__ -#define __ND_SHAPE_CONVEX_H__ - -#include "ndCollisionStdafx.h" -#include "ndShape.h" - -#define D_CLIP_MAX_COUNT 512 -#define D_CLIP_MAX_POINT_COUNT 64 -#define D_MIN_CONVEX_SHAPE_SIZE ndFloat32 (1.0f/128.0f) - -D_MSV_NEWTON_ALIGN_32 -class ndShapeConvex: public ndShape -{ - public: - D_CLASS_REFLECTION(ndShapeConvex,ndShape) - class ndConvexSimplexEdge - { - public: - ndConvexSimplexEdge* m_twin; - ndConvexSimplexEdge* m_next; - ndConvexSimplexEdge* m_prev; - ndInt32 m_vertex; - }; - - protected: - D_COLLISION_API ndShapeConvex (ndShapeID id); - D_COLLISION_API ~ndShapeConvex (); - - virtual ndShapeConvex* GetAsShapeConvex() { return this; } - - D_COLLISION_API void SetVolumeAndCG(); - D_COLLISION_API virtual void MassProperties(); - D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - D_COLLISION_API virtual ndFloat32 CalculateMassProperties(const ndMatrix& offset, ndVector& inertia, ndVector& crossInertia, ndVector& centerOfMass) const; - D_COLLISION_API virtual ndMatrix CalculateInertiaAndCenterOfMass(const ndMatrix& alignMatrix, const ndVector& localScale, const ndMatrix& matrix) const; - - D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; - D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; - D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const; - D_COLLISION_API virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - D_COLLISION_API virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& globalPlane, const ndShapeInstance& parentScale) const; - D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - - bool SanityCheck(ndPolyhedra& hull) const; - bool SanityCheck(ndInt32 count, const ndVector& normal, ndVector* const contactsOut) const; - ndInt32 RectifyConvexSlice(ndInt32 count, const ndVector& normal, ndVector* const contactsOut) const; - virtual ndInt32 GetConvexVertexCount() const { return m_vertexCount; } - virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32) const; - virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector&) const; - virtual const ndConvexSimplexEdge** GetVertexToEdgeMapping() const; - - virtual ndFloat32 GetVolume() const; - virtual ndFloat32 GetBoxMinRadius() const; - virtual ndFloat32 GetBoxMaxRadius() const; - virtual ndVector SupportFeatureVertex(const ndVector& dir, ndInt32* const vertexIndex) const; - - ndVector CalculateVolumeIntegral(const ndPlane& plane) const; - ndInt32 BuildCylinderCapPoly (ndFloat32 radius, const ndMatrix& transform, ndVector* const vertexOut) const; - - ndVector* m_vertex; - ndConvexSimplexEdge* m_simplex; - - ndFloat32 m_boxMinRadius; - ndFloat32 m_boxMaxRadius; - ndFloat32 m_simplexVolume; - ndUnsigned16 m_edgeCount; - ndUnsigned16 m_vertexCount; - friend class ndMeshEffect; - friend class ndContactSolver; -} D_GCC_NEWTON_ALIGN_32 ; - -inline ndVector ndShapeConvex::SupportVertexSpecial(const ndVector& dir, ndFloat32) const -{ - return SupportVertex(dir); -} - -inline ndVector ndShapeConvex::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector&) const -{ - return point; -} - -inline const ndShapeConvex::ndConvexSimplexEdge** ndShapeConvex::GetVertexToEdgeMapping() const -{ - return nullptr; -} - - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexHull.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexHull.cpp deleted file mode 100644 index b58a79b33e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexHull.cpp +++ /dev/null @@ -1,1002 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndShapeInstance.h" -#include "ndShapeConvexHull.h" - -#define D_CONVEX_VERTEX_SPLIT_BOX 8 -#define D_CONVEX_VERTEX_BRUTE_FORCE_SPLIT (3 * D_CONVEX_VERTEX_SPLIT_BOX) - -D_MSV_NEWTON_ALIGN_32 -class ndShapeConvexHull::ndConvexBox -{ - public: - ndVector m_box[2]; - ndInt32 m_vertexStart; - ndInt32 m_vertexCount; - ndInt32 m_soaVertexStart; - ndInt32 m_soaVertexCount; - ndInt32 m_leftBox; - ndInt32 m_rightBox; -} D_GCC_NEWTON_ALIGN_32; - - -ndShapeConvexHull::ndShapeConvexHull (ndInt32 count, ndInt32 strideInBytes, ndFloat32 tolerance, const ndFloat32* const vertexArray, ndInt32 maxPointsOut) - :ndShapeConvex(m_convexHull) - ,m_supportTree(nullptr) - ,m_faceArray(nullptr) - ,m_soa_x(nullptr) - ,m_soa_y(nullptr) - ,m_soa_z(nullptr) - ,m_soa_index(nullptr) - ,m_vertexToEdgeMapping(nullptr) - ,m_faceCount(0) - ,m_soaVertexCount(0) - ,m_supportTreeCount(0) -{ - m_edgeCount = 0; - m_vertexCount = 0; - m_vertex = nullptr; - m_simplex = nullptr; - Create(count, strideInBytes, vertexArray, tolerance, maxPointsOut); - ndAssert(m_faceCount > 0); - //if (m_faceCount == 0) - //{ - // ndAssert(m_faceCount > 0); - // Create(count, strideInBytes, vertexArray, tolerance); - //} -} - -ndShapeConvexHull::~ndShapeConvexHull() -{ - if (m_vertexToEdgeMapping) - { - ndMemory::Free(m_vertexToEdgeMapping); - } - - if (m_faceArray) - { - ndMemory::Free(m_faceArray); - } - - if (m_supportTree) - { - ndMemory::Free(m_supportTree); - } - - if (m_soa_index) - { - ndMemory::Free(m_soa_x); - ndMemory::Free(m_soa_y); - ndMemory::Free(m_soa_z); - ndMemory::Free(m_soa_index); - } -} - -bool ndShapeConvexHull::Create(ndInt32 count, ndInt32 strideInBytes, const ndFloat32* const vertexArray, ndFloat32 tolerance, ndInt32 maxPointsOut) -{ - ndStack buffer(2 * count); - ndInt32 stride = strideInBytes / ndInt32(sizeof(ndFloat32)); - for (ndInt32 i = 0; i < count; ++i) - { - buffer[i] = ndBigVector(vertexArray[i * stride + 0], vertexArray[i * stride + 1], vertexArray[i * stride + 2], ndFloat32(0.0f)); - } - - ndConvexHull3d* convexHull = new ndConvexHull3d(&buffer[0].m_x, sizeof (ndBigVector), count, tolerance, maxPointsOut); - if (!convexHull->GetCount()) - { - ndAssert(0); - //// this is a degenerated hull, add some thickness and form a thick plane - //delete convexHull; - - //ndStack tmp(3 * count); - //for (ndInt32 i = 0; i < count; ++i) - //{ - // tmp[i][0] = ndFloat32(buffer[i].m_x); - // tmp[i][1] = ndFloat32(buffer[i].m_y); - // tmp[i][2] = ndFloat32(buffer[i].m_z); - // tmp[i][3] = ndFloat32(0.0f); - //} - // - //dObb sphere; - //sphere.SetDimensions(&tmp[0][0], sizeof(ndVector), count); - // - //ndInt32 index = 0; - //ndFloat32 size = ndFloat32(1.0e10f); - //for (ndInt32 i = 0; i < 3; ++i) - //{ - // if (sphere.m_size[i] < size) - // { - // index = i; - // size = sphere.m_size[i]; - // } - //} - //ndVector normal(ndFloat32(0.0f)); - //normal[index] = ndFloat32(1.0f); - //ndVector step = sphere.RotateVector(normal.Scale(ndFloat32(0.05f))); - //for (ndInt32 i = 0; i < count; ++i) - //{ - // ndVector p1(tmp[i] + step); - // ndVector p2(tmp[i] - step); - // - // buffer[i * 3 + 0] = p1.m_x; - // buffer[i * 3 + 1] = p1.m_y; - // buffer[i * 3 + 2] = p1.m_z; - // buffer[(i + count) * 3 + 0] = p2.m_x; - // buffer[(i + count) * 3 + 1] = p2.m_y; - // buffer[(i + count) * 3 + 2] = p2.m_z; - //} - //count *= 2; - //convexHull = new ndConvexHull3d(&buffer[0].m_x, sizeof(ndBigVector), count, tolerance); - //if (!convexHull->GetCount()) - //{ - // delete convexHull; - // return false; - //} - } - - // check for degenerated faces - for (bool success = false; !success; ) - { - success = true; - //const ndBigVector* const hullVertexArray = convexHull->GetVertexPool(); - const ndArray& hullVertexArray = convexHull->GetVertexPool(); - - ndStack mask(ndInt32(hullVertexArray.GetCount())); - memset(&mask[0], 1, size_t(mask.GetSizeInBytes())); - for (ndConvexHull3d::ndNode* node = convexHull->GetFirst(); node; node = node->GetNext()) - { - ndConvexHull3dFace& face = node->GetInfo(); - const ndBigVector& p0 = hullVertexArray[face.m_index[0]]; - const ndBigVector& p1 = hullVertexArray[face.m_index[1]]; - const ndBigVector& p2 = hullVertexArray[face.m_index[2]]; - ndAssert(p0.m_w == p1.m_w); - ndAssert(p0.m_w == p2.m_w); - ndBigVector p1p0(p1 - p0); - ndBigVector p2p0(p2 - p0); - ndBigVector normal(p2p0.CrossProduct(p1p0)); - ndFloat64 mag2 = normal.DotProduct(normal).GetScalar(); - if (mag2 < ndFloat64(1.0e-6f * 1.0e-6f)) - { - success = false; - ndInt32 index = -1; - ndBigVector p2p1(p2 - p1); - ndFloat64 dist10 = p1p0.DotProduct(p1p0).GetScalar(); - ndFloat64 dist20 = p2p0.DotProduct(p2p0).GetScalar(); - ndFloat64 dist21 = p2p1.DotProduct(p2p1).GetScalar(); - if ((dist10 >= dist20) && (dist10 >= dist21)) - { - index = 2; - } - else if ((dist20 >= dist10) && (dist20 >= dist21)) - { - index = 1; - } - else if ((dist21 >= dist10) && (dist21 >= dist20)) - { - index = 0; - } - ndAssert(index != -1); - mask[face.m_index[index]] = 0; - } - } - if (!success) - { - ndInt32 count1 = 0; - //ndInt32 vertexCount = convexHull->GetVertexCount(); - const ndInt32 vertexCount = ndInt32(convexHull->GetVertexPool().GetCount()); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - if (mask[i]) - { - buffer[count1] = hullVertexArray[i] & ndBigVector::m_triplexMask; - count1++; - } - } - delete convexHull; - convexHull = new ndConvexHull3d(&buffer[0].m_x, sizeof(ndBigVector), count1, tolerance); - } - } - - ndAssert(convexHull); - //ndInt32 vertexCount = convexHull->GetVertexCount(); - ndInt32 vertexCount = ndInt32(convexHull->GetVertexPool().GetCount()); - if (vertexCount < 4) - { - delete convexHull; - return false; - } - - //const ndBigVector* const hullVertexArray = convexHull->GetVertexPool(); - const ndArray& hullVertexArray = convexHull->GetVertexPool(); - ndPolyhedra polyhedra; - polyhedra.BeginFace(); - for (ndConvexHull3d::ndNode* node = convexHull->GetFirst(); node; node = node->GetNext()) - { - ndConvexHull3dFace& face = node->GetInfo(); - polyhedra.AddFace(face.m_index[0], face.m_index[1], face.m_index[2]); - } - polyhedra.EndFace(); - - if (vertexCount > 4) - { - while (RemoveCoplanarEdge(polyhedra, &hullVertexArray[0])); - } - - ndStack vertexMap(vertexCount); - memset(&vertexMap[0], -1, vertexCount * sizeof(ndInt32)); - - ndInt32 mark = polyhedra.IncLRU(); - ndPolyhedra::Iterator iter(polyhedra); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if (edge->m_mark != mark) - { - if (vertexMap[edge->m_incidentVertex] == -1) - { - vertexMap[edge->m_incidentVertex] = m_vertexCount; - m_vertexCount++; - } - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - ptr->m_userData = m_edgeCount; - m_edgeCount++; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - } - } - - m_vertex = (ndVector*)ndMemory::Malloc(size_t(m_vertexCount * sizeof(ndVector))); - m_simplex = (ndConvexSimplexEdge*)ndMemory::Malloc(size_t(m_edgeCount * sizeof(ndConvexSimplexEdge))); - m_vertexToEdgeMapping = (const ndConvexSimplexEdge**)ndMemory::Malloc(size_t(m_vertexCount * sizeof(ndConvexSimplexEdge*))); - - for (ndInt32 i = 0; i < vertexCount; ++i) - { - if (vertexMap[i] != -1) - { - m_vertex[vertexMap[i]] = hullVertexArray[i]; - m_vertex[vertexMap[i]].m_w = ndFloat32(0.0f); - } - } - delete convexHull; - - vertexCount = m_vertexCount; - mark = polyhedra.IncLRU();; - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &iter.GetNode()->GetInfo(); - if (edge->m_mark != mark) - { - ndEdge *ptr = edge; - do - { - ptr->m_mark = mark; - ndConvexSimplexEdge* const simplexPtr = &m_simplex[ptr->m_userData]; - simplexPtr->m_vertex = vertexMap[ptr->m_incidentVertex]; - simplexPtr->m_next = &m_simplex[ptr->m_next->m_userData]; - simplexPtr->m_prev = &m_simplex[ptr->m_prev->m_userData]; - simplexPtr->m_twin = &m_simplex[ptr->m_twin->m_userData]; - - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - } - } - - m_faceCount = 0; - ndStack faceMarks(m_edgeCount); - memset(&faceMarks[0], 0, m_edgeCount * sizeof(ndInt8)); - - ndStack faceArray(m_edgeCount); - - for (ndInt32 i = 0; i < m_edgeCount; ++i) - { - ndConvexSimplexEdge* const face = &m_simplex[i]; - if (!faceMarks[i]) - { - ndConvexSimplexEdge* ptr = face; - do - { - ndAssert((ptr - m_simplex) >= 0); - faceMarks[ndInt32(ptr - m_simplex)] = '1'; - ptr = ptr->m_next; - } while (ptr != face); - - faceArray[m_faceCount] = face; - m_faceCount++; - } - } - m_faceArray = (ndConvexSimplexEdge **)ndMemory::Malloc(size_t(m_faceCount * sizeof(ndConvexSimplexEdge *))); - ndMemCpy(m_faceArray, &faceArray[0], m_faceCount); - - ndFixSizeArray array; - array.SetCount(D_CONVEX_VERTEX_BRUTE_FORCE_SPLIT); - if (vertexCount > D_CONVEX_VERTEX_BRUTE_FORCE_SPLIT) - { - // create a face structure for support vertex - ndStack boxTree(vertexCount); - ndTree sortTree; - ndStack::ndNode*> vertexNodeList(vertexCount); - - ndVector boxP0(ndFloat32(1.0e15f)); - ndVector boxP1(-ndFloat32(1.0e15f)); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - const ndVector& p = m_vertex[i]; - vertexNodeList[i] = sortTree.Insert(p, i); - boxP0 = boxP0.GetMin(p); - boxP1 = boxP1.GetMax(p); - } - - boxTree[0].m_box[0] = boxP0 & ndVector::m_triplexMask; - boxTree[0].m_box[1] = boxP1 & ndVector::m_triplexMask; - boxTree[0].m_leftBox = -1; - boxTree[0].m_rightBox = -1; - boxTree[0].m_vertexStart = 0; - boxTree[0].m_vertexCount = vertexCount; - boxTree[0].m_soaVertexStart = -1; - boxTree[0].m_soaVertexCount = -1; - ndInt32 boxCount = 1; - - ndInt32 stack = 1; - ndInt32 stackBoxPool[64]; - stackBoxPool[0] = 0; - - while (stack) - { - stack--; - ndInt32 boxIndex = stackBoxPool[stack]; - ndConvexBox& box = boxTree[boxIndex]; - if (box.m_vertexCount > D_CONVEX_VERTEX_SPLIT_BOX) - { - ndVector median(ndVector::m_zero); - ndVector varian(ndVector::m_zero); - for (ndInt32 i = 0; i < box.m_vertexCount; ++i) - { - const ndVector& p = vertexNodeList[box.m_vertexStart + i]->GetInfo(); - median += p; - varian += p * p; - boxP0 = boxP0.GetMin(p); - boxP1 = boxP1.GetMax(p); - } - - ndInt32 index = 0; - ndFloat64 maxVarian = ndFloat64(-1.0e10f); - varian = varian.Scale(ndFloat32(box.m_vertexCount)) - median * median; - for (ndInt32 i = 0; i < 3; ++i) - { - if (varian[i] > maxVarian) - { - index = i; - maxVarian = varian[i]; - } - } - ndVector center = median.Scale(ndFloat32(1.0f) / ndFloat32(box.m_vertexCount)); - ndFloat32 test = center[index]; - - ndInt32 i0 = 0; - ndInt32 i1 = box.m_vertexCount - 1; - - #if 0 - do - { - for (; i0 <= i1; i0++) - { - ndFloat32 val = vertexNodeList[box.m_vertexStart + i0]->GetInfo()[index]; - if (val > test) - { - break; - } - } - - for (; i1 >= i0; i1--) - { - ndFloat32 val = vertexNodeList[box.m_vertexStart + i1]->GetInfo()[index]; - if (val < test) - { - break; - } - } - - if (i0 < i1) - { - dSwap(vertexNodeList[box.m_vertexStart + i0], vertexNodeList[box.m_vertexStart + i1]); - i0++; - i1--; - } - } while (i0 <= i1); - if (i0 == 0) - { - i0 = box.m_vertexCount / 2; - } - if (i0 >= (box.m_vertexCount - 1)) - { - i0 = box.m_vertexCount / 2; - } - #else - while (i0 < i1) - { - while ((vertexNodeList[box.m_vertexStart + i0]->GetInfo()[index] <= test) && (i0 < i1)) - { - ++i0; - }; - - while ((vertexNodeList[box.m_vertexStart + i1]->GetInfo()[index] > test) && (i0 < i1)) - { - --i1; - } - - ndAssert(i0 <= i1); - if (i0 < i1) - { - ndSwap(vertexNodeList[box.m_vertexStart + i0], vertexNodeList[box.m_vertexStart + i1]); - ++i0; - --i1; - } - } - - while ((vertexNodeList[box.m_vertexStart + i0]->GetInfo()[index] <= test) && (i0 < box.m_vertexCount)) - { - ++i0; - }; - - #ifdef _DEBUG - ndAssert(i0 > 0); - ndAssert(i0 < box.m_vertexCount); - for (ndInt32 i = 0; i < i0; ++i) - { - ndAssert(vertexNodeList[box.m_vertexStart + i]->GetInfo()[index] <= test); - } - - for (ndInt32 i = i0; i < box.m_vertexCount; ++i) - { - ndAssert(vertexNodeList[box.m_vertexStart + i]->GetInfo()[index] > test); - } - #endif - #endif - - { - // insert right branch AABB - ndVector rightBoxP0(ndFloat32(1.0e15f)); - ndVector rightBoxP1(-ndFloat32(1.0e15f)); - for (ndInt32 i = i0; i < box.m_vertexCount; ++i) - { - const ndVector& p = vertexNodeList[box.m_vertexStart + i]->GetInfo(); - rightBoxP0 = rightBoxP0.GetMin(p); - rightBoxP1 = rightBoxP1.GetMax(p); - } - - box.m_rightBox = boxCount; - boxTree[boxCount].m_box[0] = rightBoxP0 & ndVector::m_triplexMask; - boxTree[boxCount].m_box[1] = rightBoxP1 & ndVector::m_triplexMask; - boxTree[boxCount].m_leftBox = -1; - boxTree[boxCount].m_rightBox = -1; - boxTree[boxCount].m_vertexStart = box.m_vertexStart + i0; - boxTree[boxCount].m_vertexCount = box.m_vertexCount - i0; - boxTree[boxCount].m_soaVertexStart = -1; - boxTree[boxCount].m_soaVertexCount = -1; - stackBoxPool[stack] = boxCount; - stack++; - boxCount++; - } - - { - // insert left branch AABB - ndVector leftBoxP0(ndFloat32(1.0e15f)); - ndVector leftBoxP1(-ndFloat32(1.0e15f)); - for (ndInt32 i = 0; i < i0; ++i) - { - const ndVector& p = vertexNodeList[box.m_vertexStart + i]->GetInfo(); - leftBoxP0 = leftBoxP0.GetMin(p); - leftBoxP1 = leftBoxP1.GetMax(p); - } - - box.m_leftBox = boxCount; - boxTree[boxCount].m_box[0] = leftBoxP0 & ndVector::m_triplexMask;; - boxTree[boxCount].m_box[1] = leftBoxP1 & ndVector::m_triplexMask;; - boxTree[boxCount].m_leftBox = -1; - boxTree[boxCount].m_rightBox = -1; - boxTree[boxCount].m_vertexStart = box.m_vertexStart; - boxTree[boxCount].m_vertexCount = i0; - boxTree[boxCount].m_soaVertexStart = -1; - boxTree[boxCount].m_soaVertexCount = -1; - - stackBoxPool[stack] = boxCount; - stack++; - boxCount++; - } - } - } - - for (ndInt32 i = 0; i < m_vertexCount; ++i) - { - m_vertex[i] = vertexNodeList[i]->GetInfo(); - vertexNodeList[i]->GetInfo().m_w = ndFloat32(i); - } - - m_supportTreeCount = boxCount; - m_supportTree = (ndConvexBox*)ndMemory::Malloc(size_t(boxCount * sizeof(ndConvexBox))); - ndMemCpy(m_supportTree, &boxTree[0], boxCount); - - for (ndInt32 i = 0; i < m_edgeCount; ++i) - { - ndConvexSimplexEdge* const ptr = &m_simplex[i]; - ndTree::ndNode* const node = sortTree.Find(ptr->m_vertex); - ndInt32 index = ndInt32(node->GetInfo().m_w); - ptr->m_vertex = ndInt16(index); - } - - m_soaVertexCount = 0; - for (ndInt32 i = 0; i < boxCount; ++i) - { - ndConvexBox* const box = &m_supportTree[i]; - if (box->m_leftBox == -1) - { - ndAssert(box->m_rightBox == -1); - ndInt32 soaCount = ((box->m_vertexCount + 3) & -4) / 4; - m_soaVertexCount += soaCount; - } - } - - m_soa_x = (ndVector*)ndMemory::Malloc(m_soaVertexCount * sizeof(ndVector)); - m_soa_y = (ndVector*)ndMemory::Malloc(m_soaVertexCount * sizeof(ndVector)); - m_soa_z = (ndVector*)ndMemory::Malloc(m_soaVertexCount * sizeof(ndVector)); - m_soa_index = (ndVector*)ndMemory::Malloc(m_soaVertexCount * sizeof(ndVector)); - - ndInt32 startAcc = 0; - for (ndInt32 k = 0; k < boxCount; ++k) - { - ndConvexBox* const box = &m_supportTree[k]; - if (box->m_leftBox == -1) - { - ndAssert(box->m_rightBox == -1); - const ndInt32 soaCount = ((box->m_vertexCount + 3) & -4) / 4; - - ndFloat32* const indexptr = &m_soa_index[startAcc].m_x; - for (ndInt32 i = 0; i < box->m_vertexCount; ++i) - { - array[i] = m_vertex[box->m_vertexStart + i]; - indexptr[i] = ndFloat32(box->m_vertexStart + i); - } - - for (ndInt32 i = box->m_vertexCount; i < soaCount * 4; ++i) - { - array[i] = m_vertex[box->m_vertexStart]; - indexptr[i] = ndFloat32(box->m_vertexStart); - } - - for (ndInt32 i = 0; i < box->m_vertexCount; i += 4) - { - ndVector temp; - ndInt32 j = startAcc + i / 4; - ndVector::Transpose4x4( - m_soa_x[j], m_soa_y[j], m_soa_z[j], temp, - array[i + 0], array[i + 1], array[i + 2], array[i + 3]); - } - - box->m_soaVertexStart = startAcc; - box->m_soaVertexCount = soaCount; - startAcc += soaCount; - } - } - } - else - { - m_soaVertexCount = ((m_vertexCount + 3) & -4) / 4; - m_soa_x = (ndVector*)ndMemory::Malloc(m_soaVertexCount * sizeof(ndVector)); - m_soa_y = (ndVector*)ndMemory::Malloc(m_soaVertexCount * sizeof(ndVector)); - m_soa_z = (ndVector*)ndMemory::Malloc(m_soaVertexCount * sizeof(ndVector)); - m_soa_index = (ndVector*)ndMemory::Malloc(m_soaVertexCount * sizeof(ndVector)); - - ndFloat32* const indexptr = &m_soa_index[0].m_x; - for (ndInt32 i = 0; i < m_vertexCount; ++i) - { - array[i] = m_vertex[i]; - indexptr[i] = ndFloat32(i); - } - - for (ndInt32 i = m_vertexCount; i < m_soaVertexCount * 4; ++i) - { - array[i] = m_vertex[0]; - indexptr[i] = ndFloat32(i); - } - - for (ndInt32 i = 0; i < m_soaVertexCount; ++i) - { - ndVector temp; - ndInt32 j = i * 4; - ndVector::Transpose4x4( - m_soa_x[i], m_soa_y[i], m_soa_z[i], temp, - array[j + 0], array[j + 1], array[j + 2], array[j + 3]); - } - } - - for (ndInt32 i = 0; i < m_edgeCount; ++i) - { - ndConvexSimplexEdge* const edge = &m_simplex[i]; - m_vertexToEdgeMapping[edge->m_vertex] = edge; - } - - SetVolumeAndCG(); - - return true; -} - -ndBigVector ndShapeConvexHull::FaceNormal(const ndEdge *face, const ndBigVector* const pool) const -{ - const ndEdge* edge = face; - ndBigVector p0(pool[edge->m_incidentVertex]); - edge = edge->m_next; - - ndBigVector p1(pool[edge->m_incidentVertex]); - ndBigVector e1(p1 - p0); - - ndBigVector normal(ndBigVector::m_zero); - for (edge = edge->m_next; edge != face; edge = edge->m_next) - { - ndBigVector p2(pool[edge->m_incidentVertex]); - ndBigVector e2(p2 - p0); - ndBigVector n1(e1.CrossProduct(e2)); -#ifdef _DEBUG - ndAssert(n1.m_w == ndFloat32(0.0f)); - ndFloat64 mag = normal.DotProduct(n1).GetScalar(); - ndAssert(mag >= -ndFloat32(0.1f)); -#endif - normal += n1; - e1 = e2; - } - - ndFloat64 den = sqrt(normal.DotProduct(normal).GetScalar()) + ndFloat64(1.0e-24f); - normal = normal.Scale(ndFloat64(1.0f) / den); - -#ifdef _DEBUG - edge = face; - ndBigVector e0(pool[edge->m_incidentVertex] - pool[edge->m_prev->m_incidentVertex]); - do - { - ndBigVector de1(pool[edge->m_next->m_incidentVertex] - pool[edge->m_incidentVertex]); - ndBigVector dn1(e0.CrossProduct(de1)); - ndFloat64 x = normal.DotProduct(dn1).GetScalar(); - ndAssert(x > -ndFloat64(0.01f)); - e0 = de1; - edge = edge->m_next; - } while (edge != face); -#endif - return normal; -} - -bool ndShapeConvexHull::RemoveCoplanarEdge(ndPolyhedra& polyhedra, const ndBigVector* const hullVertexArray) const -{ - bool removeEdge = false; - // remove coplanar edges - ndInt32 mark = polyhedra.IncLRU(); - ndPolyhedra::Iterator iter(polyhedra); - for (iter.Begin(); iter; ) - { - ndEdge* edge0 = &(*iter); - iter++; - - if (edge0->m_incidentFace != -1) - { - if (edge0->m_mark < mark) - { - edge0->m_mark = mark; - edge0->m_twin->m_mark = mark; - ndBigVector normal0(FaceNormal(edge0, &hullVertexArray[0])); - ndBigVector normal1(FaceNormal(edge0->m_twin, &hullVertexArray[0])); - - ndFloat64 test = normal0.DotProduct(normal1).GetScalar(); - if (test > ndFloat64(0.99995f)) - { - if ((edge0->m_twin->m_next->m_twin->m_next != edge0) && (edge0->m_next->m_twin->m_next != edge0->m_twin)) - { - #define DG_MAX_EDGE_ANGLE ndFloat32 (1.0e-3f) - if (edge0->m_twin == &(*iter)) - { - if (iter) - { - iter++; - } - } - - ndBigVector e1(hullVertexArray[edge0->m_twin->m_next->m_next->m_incidentVertex] - hullVertexArray[edge0->m_incidentVertex]); - ndBigVector e0(hullVertexArray[edge0->m_incidentVertex] - hullVertexArray[edge0->m_prev->m_incidentVertex]); - - ndAssert(e0.m_w == ndFloat64(0.0f)); - ndAssert(e1.m_w == ndFloat64(0.0f)); - ndAssert(e0.DotProduct(e0).GetScalar() >= ndFloat64(0.0f)); - ndAssert(e1.DotProduct(e1).GetScalar() >= ndFloat64(0.0f)); - - e0 = e0.Scale(ndFloat64(1.0f) / sqrt(e0.DotProduct(e0).GetScalar())); - e1 = e1.Scale(ndFloat64(1.0f) / sqrt(e1.DotProduct(e1).GetScalar())); - ndBigVector n1(e0.CrossProduct(e1)); - - ndFloat64 projection = n1.DotProduct(normal0).GetScalar(); - if (projection >= DG_MAX_EDGE_ANGLE) - { - ndBigVector e11(hullVertexArray[edge0->m_next->m_next->m_incidentVertex] - hullVertexArray[edge0->m_twin->m_incidentVertex]); - ndBigVector e00(hullVertexArray[edge0->m_twin->m_incidentVertex] - hullVertexArray[edge0->m_twin->m_prev->m_incidentVertex]); - ndAssert(e00.m_w == ndFloat64(0.0f)); - ndAssert(e11.m_w == ndFloat64(0.0f)); - ndAssert(e00.DotProduct(e00).GetScalar() >= ndFloat64(0.0f)); - ndAssert(e11.DotProduct(e11).GetScalar() >= ndFloat64(0.0f)); - e00 = e00.Scale(ndFloat64(1.0f) / sqrt(e00.DotProduct(e00).GetScalar())); - e11 = e11.Scale(ndFloat64(1.0f) / sqrt(e11.DotProduct(e11).GetScalar())); - - ndBigVector n11(e00.CrossProduct(e11)); - projection = n11.DotProduct(normal0).GetScalar(); - if (projection >= DG_MAX_EDGE_ANGLE) - { - ndAssert(&(*iter) != edge0); - ndAssert(&(*iter) != edge0->m_twin); - polyhedra.DeleteEdge(edge0); - removeEdge = true; - } - } - } - else - { - ndEdge* next = edge0->m_next; - ndEdge* prev = edge0->m_prev; - polyhedra.DeleteEdge(edge0); - for (edge0 = next; edge0->m_prev->m_twin == edge0; edge0 = next) - { - next = edge0->m_next; - polyhedra.DeleteEdge(edge0); - } - - for (edge0 = prev; edge0->m_next->m_twin == edge0; edge0 = prev) - { - prev = edge0->m_prev; - polyhedra.DeleteEdge(edge0); - } - iter.Begin(); - removeEdge = true; - } - } - } - } - } - - return removeEdge; -} - -ndVector ndShapeConvexHull::SupportVertexBruteForce(const ndVector& dir, ndInt32* const vertexIndex) const -{ - const ndVector dirX(dir.m_x); - const ndVector dirY(dir.m_y); - const ndVector dirZ(dir.m_z); - - ndVector support(m_soa_index[0]); - ndVector maxProj(m_soa_x[0] * dirX + m_soa_y[0] * dirY + m_soa_z[0] * dirZ); - for (ndInt32 i = 1; i < m_soaVertexCount; ++i) - { - ndVector dot(m_soa_x[i] * dirX + m_soa_y[i] * dirY + m_soa_z[i] * dirZ); - support = support.Select(m_soa_index[i], dot > maxProj); - maxProj = maxProj.GetMax(dot); - } - - ndVector dot(maxProj.ShiftRight().ShiftRight()); - ndVector support1(support.ShiftRight().ShiftRight()); - support = support.Select(support1, dot > maxProj); - maxProj = maxProj.GetMax(dot); - - dot = maxProj.ShiftRight(); - support1 = support.ShiftRight(); - support = support.Select(support1, dot > maxProj); - - const ndInt32 index = ndInt32(support.GetScalar()); - if (vertexIndex) - { - *vertexIndex = index; - } - ndAssert(index != -1); - return m_vertex[index]; -} - -ndVector ndShapeConvexHull::SupportVertexhierarchical(const ndVector& dir, ndInt32* const vertexIndex) const -{ - const ndInt32 ix = (dir[0] > ndFloat64(0.0f)) ? 1 : 0; - const ndInt32 iy = (dir[1] > ndFloat64(0.0f)) ? 1 : 0; - const ndInt32 iz = (dir[2] > ndFloat64(0.0f)) ? 1 : 0; - - const ndConvexBox& leftBox = m_supportTree[m_supportTree[0].m_leftBox]; - const ndConvexBox& rightBox = m_supportTree[m_supportTree[0].m_rightBox]; - - const ndVector leftP(leftBox.m_box[ix][0], leftBox.m_box[iy][1], leftBox.m_box[iz][2], ndFloat32(0.0f)); - const ndVector rightP(rightBox.m_box[ix][0], rightBox.m_box[iy][1], rightBox.m_box[iz][2], ndFloat32(0.0f)); - - const ndFloat32 leftDist = leftP.DotProduct(dir).GetScalar(); - const ndFloat32 rightDist = rightP.DotProduct(dir).GetScalar(); - - ndFloat32 distPool[32]; - const ndConvexBox* stackPool[32]; - if (rightDist >= leftDist) - { - distPool[0] = leftDist; - stackPool[0] = &leftBox; - - distPool[1] = rightDist; - stackPool[1] = &rightBox; - } - else - { - distPool[0] = rightDist; - stackPool[0] = &rightBox; - - distPool[1] = leftDist; - stackPool[1] = &leftBox; - } - - const ndVector dirX(dir.m_x); - const ndVector dirY(dir.m_y); - const ndVector dirZ(dir.m_z); - ndVector support(ndVector::m_negOne); - ndVector maxProj(ndFloat32(-1.0e20f)); - ndVector maxVertexProjection(maxProj); - - ndInt32 stack = 2; - while (stack) - { - stack--; - const ndFloat32 dist = distPool[stack]; - if (dist > maxProj.GetScalar()) - { - const ndConvexBox& box = *stackPool[stack]; - if (box.m_leftBox > 0) - { - ndAssert(box.m_rightBox > 0); - const ndConvexBox& leftBox1 = m_supportTree[box.m_leftBox]; - const ndConvexBox& rightBox1 = m_supportTree[box.m_rightBox]; - - const ndVector leftBoxP(leftBox1.m_box[ix][0], leftBox1.m_box[iy][1], leftBox1.m_box[iz][2], ndFloat32(0.0f)); - const ndVector rightBoxP(rightBox1.m_box[ix][0], rightBox1.m_box[iy][1], rightBox1.m_box[iz][2], ndFloat32(0.0f)); - - const ndFloat32 leftBoxDist = leftBoxP.DotProduct(dir).GetScalar(); - const ndFloat32 rightBoxDist = rightBoxP.DotProduct(dir).GetScalar(); - if (rightBoxDist >= leftBoxDist) - { - distPool[stack] = leftBoxDist; - stackPool[stack] = &leftBox1; - stack++; - ndAssert(stack < ndInt32 (sizeof(distPool) / sizeof(distPool[0]))); - - distPool[stack] = rightBoxDist; - stackPool[stack] = &rightBox1; - stack++; - ndAssert(stack < ndInt32 (sizeof(distPool) / sizeof(distPool[0]))); - } - else - { - distPool[stack] = rightBoxDist; - stackPool[stack] = &rightBox1; - stack++; - ndAssert(stack < ndInt32 (sizeof(distPool) / sizeof(distPool[0]))); - - distPool[stack] = leftBoxDist; - stackPool[stack] = &leftBox1; - stack++; - ndAssert(stack < ndInt32 (sizeof(distPool) / sizeof(distPool[0]))); - } - } - else - { - for (ndInt32 j = 0; j < box.m_soaVertexCount; ++j) - { - ndInt32 i = box.m_soaVertexStart + j; - ndVector dot(m_soa_x[i] * dirX + m_soa_y[i] * dirY + m_soa_z[i] * dirZ); - support = support.Select(m_soa_index[i], dot > maxVertexProjection); - maxVertexProjection = maxVertexProjection.GetMax(dot); - } - - maxProj = maxProj.GetMax(maxVertexProjection.ShiftRight().ShiftRight()); - maxProj = maxProj.GetMax(maxProj.ShiftRight()); - } - } - } - - ndVector support1(support.ShiftRight().ShiftRight()); - ndVector dot(maxVertexProjection.ShiftRight().ShiftRight()); - support = support.Select(support1, dot > maxVertexProjection); - maxVertexProjection = maxVertexProjection.GetMax(dot); - - support1 = support.ShiftRight(); - dot = maxVertexProjection.ShiftRight(); - support = support.Select(support1, dot > maxVertexProjection); - - const ndInt32 index = ndInt32(support.GetScalar()); - if (vertexIndex) - { - *vertexIndex = index; - } - ndAssert(index != -1); - return m_vertex[index]; -} - -ndVector ndShapeConvexHull::SupportVertex(const ndVector& dir) const -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - if (m_vertexCount > D_CONVEX_VERTEX_BRUTE_FORCE_SPLIT) - { - //return SupportVertexhierarchical(dir, vertexIndex); - return SupportVertexhierarchical(dir, nullptr); - } - else - { - //return SupportVertexBruteForce(dir, vertexIndex); - return SupportVertexBruteForce(dir, nullptr); - } -} - -ndVector ndShapeConvexHull::SupportFeatureVertex(const ndVector& dir, ndInt32* const vertexIndex) const -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - if (m_vertexCount > D_CONVEX_VERTEX_BRUTE_FORCE_SPLIT) - { - return SupportVertexhierarchical(dir, vertexIndex); - } - else - { - return SupportVertexBruteForce(dir, vertexIndex); - } -} - -ndShapeInfo ndShapeConvexHull::GetShapeInfo() const -{ - ndShapeInfo info(ndShapeConvex::GetShapeInfo()); - - info.m_convexhull.m_vertexCount = m_vertexCount; - info.m_convexhull.m_strideInBytes = sizeof(ndVector); - info.m_convexhull.m_faceCount = m_faceCount; - info.m_convexhull.m_vertex = &m_vertex[0]; - return info; -} - -void ndShapeConvexHull::DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const -{ - ndVector vertex[512]; - ndShapeDebugNotify::ndEdgeType edgeType[512]; - memset(edgeType, ndShapeDebugNotify::m_shared, sizeof(edgeType)); - for (ndInt32 i = 0; i < m_faceCount; ++i) - { - ndConvexSimplexEdge* const face = m_faceArray[i]; - ndConvexSimplexEdge* ptr = face; - ndInt32 count = 0; - do - { - vertex[count] = m_vertex[ptr->m_vertex]; - count++; - ndAssert(count < ndInt32 (sizeof(vertex) / sizeof(vertex[0]))); - ptr = ptr->m_next; - } while (ptr != face); - matrix.TransformTriplex(&vertex[0].m_x, sizeof(ndVector), &vertex[0].m_x, sizeof(ndVector), count); - debugCallback.DrawPolygon(count, vertex, edgeType); - } -} - -ndUnsigned64 ndShapeConvexHull::GetHash(ndUnsigned64 hash) const -{ - return ndCRC64(&m_vertex[0].m_x, m_vertexCount * ndInt32 (sizeof(ndVector)), hash); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexHull.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexHull.h deleted file mode 100644 index 83db514df9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexHull.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_CONVEXHULL_H__ -#define __ND_SHAPE_CONVEXHULL_H__ - -#include "ndShapeConvex.h" - -D_MSV_NEWTON_ALIGN_32 -class ndShapeConvexHull : public ndShapeConvex -{ - class ndConvexBox; - - public: - D_CLASS_REFLECTION(ndShapeConvexHull,ndShapeConvex) - D_COLLISION_API ndShapeConvexHull(ndInt32 count, ndInt32 strideInBytes, ndFloat32 tolerance, const ndFloat32* const vertexArray, ndInt32 maxPointsOut = 0x7fffffff); - D_COLLISION_API virtual ~ndShapeConvexHull(); - - protected: - D_COLLISION_API ndShapeInfo GetShapeInfo() const; - D_COLLISION_API ndUnsigned64 GetHash(ndUnsigned64 hash) const; - ndBigVector FaceNormal(const ndEdge *face, const ndBigVector* const pool) const; - bool RemoveCoplanarEdge(ndPolyhedra& convex, const ndBigVector* const hullVertexArray) const; - bool Create(ndInt32 count, ndInt32 strideInBytes, const ndFloat32* const vertexArray, ndFloat32 tolerance, ndInt32 maxPointsOut); - virtual ndVector SupportVertex(const ndVector& dir) const; - virtual ndVector SupportFeatureVertex(const ndVector& dir, ndInt32* const vertexIndex) const; - - private: - ndVector SupportVertexBruteForce(const ndVector& dir, ndInt32* const vertexIndex) const; - ndVector SupportVertexhierarchical(const ndVector& dir, ndInt32* const vertexIndex) const; - - void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - - ndConvexBox* m_supportTree; - ndConvexSimplexEdge** m_faceArray; - ndVector* m_soa_x; - ndVector* m_soa_y; - ndVector* m_soa_z; - ndVector* m_soa_index; - - const ndConvexSimplexEdge** m_vertexToEdgeMapping; - ndInt32 m_faceCount; - ndInt32 m_soaVertexCount; - ndInt32 m_supportTreeCount; -} D_GCC_NEWTON_ALIGN_32; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexPolygon.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexPolygon.cpp deleted file mode 100644 index a7508cdf4b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexPolygon.cpp +++ /dev/null @@ -1,853 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndShapeInstance.h" -#include "ndContactSolver.h" -#include "ndBodyKinematic.h" -#include "ndShapeConvexPolygon.h" - -//#define D_CONVEX_POLYGON_SKIRT_LENGTH ndFloat32 (0.025f) -#define D_CONVEX_POLYGON_SKIRT_LENGTH ndFloat32 (0.25f) - -ndShapeConvexPolygon::ndShapeConvexPolygon () - :ndShapeConvex(m_polygonCollision) - ,m_faceClipSize(0) - ,m_count(0) - ,m_paddedCount(0) - ,m_stride(0) - ,m_faceNormalIndex(0) - ,m_vertex(nullptr) - ,m_vertexIndex(nullptr) - ,m_adjacentFaceEdgeNormalIndex(nullptr) -{ -} - -ndShapeConvexPolygon::~ndShapeConvexPolygon () -{ -} - -ndInt32 ndShapeConvexPolygon::Release() const -{ - ndInt32 count = m_refCount.fetch_add(-1); - return count; -} - -ndInt32 ndShapeConvexPolygon::CalculatePlaneIntersection (const ndVector& normalIn, const ndVector& origin, ndVector* const contactsOut) const -{ - ndAssert (normalIn.m_w == ndFloat32 (0.0f)); - ndVector normal(normalIn); - ndInt32 count = 0; - ndFloat32 maxDist = ndFloat32 (1.0f); - ndFloat32 projectFactor = m_normal.DotProduct(normal).GetScalar(); - if (projectFactor < ndFloat32 (0.0f)) - { - projectFactor *= ndFloat32 (-1.0f); - normal = normal * ndVector::m_negOne; - } - - if (projectFactor > ndFloat32 (0.9999f)) - { - for (ndInt32 i = 0; i < m_count; ++i) - { - contactsOut[count] = m_localPoly[i]; - count ++; - } - - #ifdef _DEBUG - ndInt32 j = count - 1; - for (ndInt32 i = 0; i < count; ++i) - { - ndVector error (contactsOut[i] - contactsOut[j]); - ndAssert (error.m_w == ndFloat32 (0.0f)); - ndAssert (error.DotProduct(error).GetScalar() > ndFloat32 (1.0e-20f)); - j = i; - } - #endif - - } - else if (projectFactor > ndFloat32 (0.1736f)) - { - maxDist = ndFloat32 (0.0f); - ndPlane plane (normal, - normal.DotProduct(origin).GetScalar()); - - ndVector p0 (m_localPoly[m_count - 1]); - ndFloat32 side0 = plane.Evalue (p0); - for (ndInt32 i = 0; i < m_count; ++i) - { - ndVector p1 (m_localPoly[i]); - ndFloat32 side1 = plane.Evalue (p1); - - if (side0 > ndFloat32 (0.0f)) - { - maxDist = ndMax (maxDist, side0); - contactsOut[count] = p0 - normal.Scale (side0); - count ++; - if (count > 1) - { - ndVector edgeSegment (contactsOut[count - 1] - contactsOut[count - 2]); - ndAssert (edgeSegment.m_w == ndFloat32 (0.0f)); - ndFloat32 error = edgeSegment.DotProduct(edgeSegment).GetScalar(); - if (error < ndFloat32 (1.0e-8f)) { - count --; - } - } - - if (side1 <= ndFloat32 (0.0f)) - { - ndVector dp (p1 - p0); - ndFloat32 t = normal.DotProduct(dp).GetScalar(); - ndAssert (ndAbs (t) >= ndFloat32 (0.0f)); - if (ndAbs (t) < ndFloat32 (1.0e-8f)) - { - t = ndSign(t) * ndFloat32 (1.0e-8f); - } - contactsOut[count] = p0 - dp.Scale (side0 / t); - count ++; - if (count > 1) - { - ndVector edgeSegment (contactsOut[count - 1] - contactsOut[count - 2]); - ndAssert (edgeSegment.m_w == ndFloat32 (0.0f)); - ndFloat32 error = edgeSegment.DotProduct(edgeSegment).GetScalar(); - if (error < ndFloat32 (1.0e-8f)) - { - count --; - } - } - } - } - else if (side1 > ndFloat32 (0.0f)) - { - ndVector dp (p1 - p0); - ndFloat32 t = normal.DotProduct(dp).GetScalar(); - ndAssert (ndAbs (t) >= ndFloat32 (0.0f)); - if (ndAbs (t) < ndFloat32 (1.0e-8f)) - { - t = ndSign(t) * ndFloat32 (1.0e-8f); - } - contactsOut[count] = p0 - dp.Scale (side0 / t); - count ++; - if (count > 1) - { - ndVector edgeSegment (contactsOut[count - 1] - contactsOut[count - 2]); - ndAssert (edgeSegment.m_w == ndFloat32 (0.0f)); - ndFloat32 error = edgeSegment.DotProduct(edgeSegment).GetScalar(); - if (error < ndFloat32 (1.0e-8f)) - { - count --; - } - } - } - - side0 = side1; - p0 = p1; - } - } - else - { - maxDist = ndFloat32 (1.0e10f); - ndPlane plane (normal, - normal.DotProduct(origin).GetScalar()); - - ndVector p0 (m_localPoly[m_count - 1]); - ndFloat32 side0 = plane.Evalue (p0); - for (ndInt32 i = 0; i < m_count; ++i) - { - ndVector p1 (m_localPoly[i]); - ndFloat32 side1 = plane.Evalue (p1); - - if ((side0 * side1) < ndFloat32 (0.0f)) - { - ndVector dp (p1 - p0); - ndFloat32 t = normal.DotProduct(dp).GetScalar(); - ndAssert (ndAbs (t) >= ndFloat32 (0.0f)); - if (ndAbs (t) < ndFloat32 (1.0e-8f)) - { - t = ndSign(t) * ndFloat32 (1.0e-8f); - } - contactsOut[count] = p0 - dp.Scale (side0 / t); - count ++; - if (count > 1) - { - ndVector edgeSegment (contactsOut[count - 1] - contactsOut[count - 2]); - ndAssert (edgeSegment.m_w == ndFloat32 (0.0f)); - ndFloat32 error = edgeSegment.DotProduct(edgeSegment).GetScalar(); - if (error < ndFloat32 (1.0e-8f)) - { - count --; - } - } - } - side0 = side1; - p0 = p1; - } - } - - if (count > 1) - { - if (maxDist < ndFloat32 (1.0e-3f)) - { - ndVector maxPoint (contactsOut[0]); - ndVector minPoint (contactsOut[0]); - ndVector lineDir (m_normal.CrossProduct(normal)); - - ndAssert (lineDir.m_w == ndFloat32 (0.0f)); - ndFloat32 proj = contactsOut[0].DotProduct(lineDir).GetScalar(); - ndFloat32 maxProjection = proj; - ndFloat32 minProjection = proj; - for (ndInt32 i = 1; i < count; ++i) - { - proj = contactsOut[i].DotProduct(lineDir).GetScalar(); - if (proj > maxProjection) - { - maxProjection = proj; - maxPoint = contactsOut[i]; - } - if (proj < minProjection) - { - minProjection = proj; - minPoint = contactsOut[i]; - } - } - - contactsOut[0] = maxPoint; - contactsOut[1] = minPoint; - count = 2; - } - - ndVector error (contactsOut[count - 1] - contactsOut[0]); - ndAssert (error.m_w == ndFloat32 (0.0f)); - if (error.DotProduct(error).GetScalar() < ndFloat32 (1.0e-8f)) - { - count --; - } - } - - #ifdef _DEBUG - if (count > 1) - { - ndInt32 j = count - 1; - for (ndInt32 i = 0; i < count; ++i) - { - ndVector error (contactsOut[i] - contactsOut[j]); - ndAssert (error.m_w == ndFloat32 (0.0f)); - ndAssert (error.DotProduct(error).GetScalar() > ndFloat32 (1.0e-20f)); - j = i; - } - - if (count >= 3) - { - ndVector n (ndFloat32 (0.0f)); - ndVector e0 (contactsOut[1] - contactsOut[0]); - for (ndInt32 i = 2; i < count; ++i) - { - ndVector e1 (contactsOut[i] - contactsOut[0]); - n += e0.CrossProduct(e1); - e0 = e1; - } - ndAssert (n.m_w == ndFloat32 (0.0f)); - n = n.Normalize(); - ndAssert (n.DotProduct(normal).GetScalar() > ndFloat32 (0.9f)); - } - } - #endif - return count; -} - -ndVector ndShapeConvexPolygon::SupportVertex(const ndVector& dir) const -{ - ndAssert(ndAbs(dir.m_w) == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - 1.0f) < ndFloat32(1.0e-2f)); - - ndInt32 index = 0; - ndFloat32 val = m_localPoly[0].DotProduct(dir).GetScalar(); - for (ndInt32 i = 1; i < m_paddedCount; ++i) - { - ndFloat32 val1 = m_localPoly[i].DotProduct(dir).GetScalar(); - if (val1 > val) - { - val = val1; - index = i; - } - } - //ndAssert(vertexIndex == nullptr); - return m_localPoly[index]; -} - -ndVector ndShapeConvexPolygon::CalculateGlobalNormal(const ndShapeInstance* const parentMesh, const ndVector& localNormal) const -{ - const ndVector& invScale = parentMesh->GetInvScale(); - const ndMatrix& globalMatrix = parentMesh->GetGlobalMatrix(); - const ndMatrix& aligmentMatrix = parentMesh->GetAlignmentMatrix(); - - ndVector normal(aligmentMatrix.RotateVector(localNormal)); - normal = normal * invScale; - ndAssert(normal.m_w == ndFloat32(0.0f)); - normal = normal.Normalize(); - return globalMatrix.RotateVector(normal); -} - -void ndShapeConvexPolygon::GenerateConvexCap(const ndShapeInstance* const parentMesh) -{ - ndInt32 count = m_count; - const ndVector skirt(D_CONVEX_POLYGON_SKIRT_LENGTH); - ndInt32 i0 = m_count - 1; - for (ndInt32 i = 0; i < m_count; ++i) - { - const ndVector faceEddge(m_localPoly[i] - m_localPoly[i0]); - ndAssert(faceEddge.m_w == ndFloat32(0.0f)); - ndAssert(faceEddge.DotProduct(faceEddge).GetScalar() > ndFloat32(0.0f)); - const ndVector edge(faceEddge.Normalize()); - const ndInt32 adjacentNormalIndex = m_adjacentFaceEdgeNormalIndex[i0] & (~D_CONCAVE_EDGE_MASK); - const ndVector localAdjacentNormal(&m_vertex[adjacentNormalIndex * m_stride]); - const ndVector adjacentNormal(CalculateGlobalNormal(parentMesh, localAdjacentNormal & ndVector::m_triplexMask)); - - //TODO: - //this could be a big problem, the edge shared by two faces should be perpendicular to the two normal - //and it is not, I need to debug this with a repro, but for now just ignore it. - //ndAssert(edge.DotProduct(adjacentNormal).GetScalar() < ndFloat32(5.0e-2f)); - ndAssert(edge.DotProduct(adjacentNormal).GetScalar() < ndFloat32(2.0e-1f)); - - const ndVector edgeSkirt(edge.CrossProduct(adjacentNormal) * skirt); - - m_localPoly[count + 0] = m_localPoly[i] + edgeSkirt; - m_localPoly[count + 1] = m_localPoly[i0] + edgeSkirt; - count += 2; - i0 = i; - } - m_paddedCount = count; -} - -bool ndShapeConvexPolygon::BeamClipping(const ndVector& origin, ndFloat32 dist, const ndShapeInstance* const parentMesh) -{ - ndPlane planes[4]; - ndVector points[128]; - - dgClippedFaceEdge clippedFace[2 * sizeof(m_localPoly) / sizeof(m_localPoly[0]) + 8]; - - ndVector dir(m_localPoly[1] - m_localPoly[0]); - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(dir.DotProduct(dir).GetScalar() > ndFloat32(1.0e-8f)); - dir = dir.Normalize(); - - ndFloat32 distH = origin.DotProduct(dir).GetScalar(); - planes[0] = ndPlane(dir, dist - distH); - planes[2] = ndPlane(dir * ndVector::m_negOne, dist + distH); - - dir = m_normal.CrossProduct(dir); - ndFloat32 distV = origin.DotProduct(dir).GetScalar(); - planes[1] = ndPlane(dir, dist - distV); - planes[3] = ndPlane(dir * ndVector::m_negOne, dist + distV); - - for (ndInt32 i = 0; i < m_count; ++i) - { - ndInt32 j = i << 1; - ndAssert(j < ndInt32 (sizeof(clippedFace) / sizeof(clippedFace[0]))); - - points[i] = m_localPoly[i]; - - clippedFace[j + 0].m_twin = &clippedFace[j + 1]; - clippedFace[j + 0].m_next = &clippedFace[j + 2]; - clippedFace[j + 0].m_incidentVertex = i; - clippedFace[j + 0].m_incidentNormal = m_adjacentFaceEdgeNormalIndex[i] & (~D_CONCAVE_EDGE_MASK); - - clippedFace[j + 1].m_twin = &clippedFace[j + 0]; - clippedFace[j + 1].m_next = &clippedFace[j - 2]; - clippedFace[j + 1].m_incidentVertex = i + 1; - clippedFace[j + 1].m_incidentNormal = -1; - } - - clippedFace[1].m_next = &clippedFace[m_count * 2 - 2 + 1]; - ndAssert((m_count * 2 - 2) >= 0); - clippedFace[m_count * 2 - 2].m_next = &clippedFace[0]; - clippedFace[m_count * 2 - 2 + 1].m_incidentVertex = 0; - - const ndFloat32 tol = ndFloat32(1.0e-5f); - ndInt32 edgeCount = m_count * 2; - ndInt32 indexCount = m_count; - dgClippedFaceEdge* first = &clippedFace[0]; - for (ndInt32 i = 0; i < 4; ++i) - { - const ndPlane& plane = planes[i]; - - ndInt32 conectCount = 0; - dgClippedFaceEdge* connect[2]; - dgClippedFaceEdge* ptr = first; - dgClippedFaceEdge* newFirst = first; - ndFloat32 test0 = plane.Evalue(points[ptr->m_incidentVertex]); - do - { - ndFloat32 test1 = plane.Evalue(points[ptr->m_next->m_incidentVertex]); - - if (test0 > tol) - { - if (test1 <= -tol) - { - const ndVector& p0 = points[ptr->m_incidentVertex]; - const ndVector& p1 = points[ptr->m_next->m_incidentVertex]; - ndVector dp(p1 - p0); - points[indexCount] = p0 - dp.Scale(test0 / dp.DotProduct(plane).GetScalar()); - - dgClippedFaceEdge* const newEdge = &clippedFace[edgeCount]; - newEdge->m_twin = newEdge + 1; - newEdge->m_twin->m_twin = newEdge; - - newEdge->m_twin->m_incidentNormal = ptr->m_incidentNormal; - newEdge->m_incidentNormal = ptr->m_incidentNormal; - - newEdge->m_incidentVertex = indexCount; - newEdge->m_twin->m_incidentVertex = ptr->m_next->m_incidentVertex; - ptr->m_twin->m_incidentVertex = indexCount; - - newEdge->m_next = ptr->m_next; - ptr->m_next->m_twin->m_next = newEdge->m_twin; - newEdge->m_twin->m_next = ptr->m_twin; - ptr->m_next = newEdge; - - connect[conectCount] = ptr; - conectCount++; - indexCount++; - edgeCount += 2; - ptr = newEdge; - ndAssert(indexCount < ndInt32 (sizeof(points) / sizeof(points[0]))); - } - } - else - { - if ((test1 > tol) && (test0 * test1) < ndFloat32(0.0f)) - { - newFirst = ptr->m_next; - - const ndVector& p0 = points[ptr->m_incidentVertex]; - const ndVector& p1 = points[ptr->m_next->m_incidentVertex]; - ndVector dp(p1 - p0); - points[indexCount] = p0 - dp.Scale(test0 / dp.DotProduct(plane).GetScalar()); - - dgClippedFaceEdge* const newEdge = &clippedFace[edgeCount]; - newEdge->m_twin = newEdge + 1; - newEdge->m_twin->m_twin = newEdge; - - newEdge->m_twin->m_incidentNormal = ptr->m_incidentNormal; - newEdge->m_incidentNormal = ptr->m_incidentNormal; - - newEdge->m_incidentVertex = indexCount; - newEdge->m_twin->m_incidentVertex = ptr->m_next->m_incidentVertex; - ptr->m_twin->m_incidentVertex = indexCount; - - newEdge->m_next = ptr->m_next; - ptr->m_next->m_twin->m_next = newEdge->m_twin; - newEdge->m_twin->m_next = ptr->m_twin; - ptr->m_next = newEdge; - - connect[conectCount] = ptr; - conectCount++; - indexCount++; - edgeCount += 2; - - ptr = newEdge; - ndAssert(indexCount < ndInt32 (sizeof(points) / sizeof(points[0]))); - } - } - - test0 = test1; - ptr = ptr->m_next; - } while (ptr != first); - - if (conectCount > 1) - { - first = newFirst; - ndAssert(conectCount == 2); - - dgClippedFaceEdge* const newEdge = &clippedFace[edgeCount]; - newEdge->m_twin = newEdge + 1; - newEdge->m_twin->m_twin = newEdge; - - newEdge->m_incidentNormal = m_faceNormalIndex; - newEdge->m_incidentVertex = connect[0]->m_next->m_incidentVertex; - newEdge->m_twin->m_next = connect[0]->m_next; - connect[0]->m_next = newEdge; - - newEdge->m_twin->m_incidentNormal = m_faceNormalIndex; - newEdge->m_twin->m_incidentVertex = connect[1]->m_next->m_incidentVertex; - newEdge->m_next = connect[1]->m_next; - connect[1]->m_next = newEdge->m_twin; - - edgeCount += 2; - } - } - - dgClippedFaceEdge* ptr = first; - do - { - ndVector dist1(points[ptr->m_next->m_incidentVertex] - points[ptr->m_incidentVertex]); - ndAssert(dist1.m_w == ndFloat32(0.0f)); - ndFloat32 error = dist1.DotProduct(dist1).GetScalar(); - if (error < ndFloat32(1.0e-6f)) - { - ptr->m_next = ptr->m_next->m_next; - first = ptr; - } - ptr = ptr->m_next; - } while (ptr != first); - - ndInt32 count = 0; - m_adjacentFaceEdgeNormalIndex = &m_clippEdgeNormal[0]; - do - { - m_clippEdgeNormal[count] = ptr->m_incidentNormal; - m_localPoly[count] = points[ptr->m_incidentVertex]; - count++; - ptr = ptr->m_next; - ndAssert(m_count < D_CONVEX_POLYGON_MAX_VERTEX_COUNT); - } while (ptr != first); - - m_count = count; - - if (m_count >= 3) - { - GenerateConvexCap(parentMesh); - //const ndVector skirt(D_CONVEX_POLYGON_SKIRT_LENGTH); - //ndInt32 i0 = m_count - 1; - //for (ndInt32 i = 0; i < m_count; ++i) - //{ - // const ndVector faceEddge(m_localPoly[i] - m_localPoly[i0]); - // ndAssert(faceEddge.m_w == ndFloat32(0.0f)); - // ndAssert(faceEddge.DotProduct(faceEddge).GetScalar() > ndFloat32(0.0f)); - // const ndVector edge (faceEddge.Normalize()); - // const ndInt32 adjacentNormalIndex = m_adjacentFaceEdgeNormalIndex[i0]; - // const ndVector localAdjacentNormal(&m_vertex[adjacentNormalIndex * m_stride]); - // const ndVector adjacentNormal(CalculateGlobalNormal(parentMesh, localAdjacentNormal & ndVector::m_triplexMask)); - // ndAssert(edge.DotProduct(adjacentNormal).GetScalar() < ndFloat32(5.0e-2f)); - // const ndVector edgeSkirt(edge.CrossProduct(adjacentNormal) * skirt); - // - // m_localPoly[count + 0] = m_localPoly[i] + edgeSkirt; - // m_localPoly[count + 1] = m_localPoly[i0] + edgeSkirt; - // count += 2; - // i0 = i; - //} - //m_paddedCount = count; - } - return (m_count >= 3); -} - -ndInt32 ndShapeConvexPolygon::CalculateContactToConvexHullContinue(const ndShapeInstance* const parentMesh, ndContactSolver& contactSolver) -{ - ndAssert(contactSolver.m_instance0.GetShape()->GetAsShapeConvex()); - ndAssert(contactSolver.m_instance1.GetShape()->GetAsShapeAsConvexPolygon()); - ndAssert(contactSolver.m_instance1.GetGlobalMatrix().TestIdentity()); - ndAssert(this == contactSolver.m_instance1.GetShape()); - ndAssert(m_count); - ndAssert(m_count < ndInt32(sizeof(m_localPoly) / sizeof(m_localPoly[0]))); - ndAssert(contactSolver.m_instance1.GetGlobalMatrix().TestIdentity()); - - const ndBodyKinematic* const body0 = contactSolver.m_contact->m_body0; - const ndBodyKinematic* const body1 = contactSolver.m_contact->m_body1; - - ndVector relativeVelocity(body0->GetVelocity() - body1->GetVelocity()); - ndAssert(relativeVelocity.m_w == ndFloat32(0.0f)); - if (relativeVelocity.DotProduct(relativeVelocity).GetScalar() < ndFloat32(1.0e-4f)) - { - return 0; - } - - ndFloat32 den = m_normal.DotProduct(relativeVelocity).GetScalar(); - if (den > ndFloat32(-1.0e-10f)) - { - return 0; - } - - ndMatrix polygonMatrix; - ndVector right(m_localPoly[1] - m_localPoly[0]); - polygonMatrix[0] = right.Normalize(); - polygonMatrix[1] = m_normal; - polygonMatrix[2] = polygonMatrix[0].CrossProduct(m_normal); - polygonMatrix[3] = m_localPoly[0]; - polygonMatrix[3].m_w = ndFloat32(1.0f); - ndAssert(polygonMatrix.TestOrthogonal()); - - ndVector polyBoxP0(ndFloat32(1.0e15f)); - ndVector polyBoxP1(ndFloat32(-1.0e15f)); - for (ndInt32 i = 0; i < m_count; ++i) - { - const ndVector point(polygonMatrix.UntransformVector(m_localPoly[i])); - polyBoxP0 = polyBoxP0.GetMin(point); - polyBoxP1 = polyBoxP1.GetMax(point); - } - - ndVector hullBoxP0; - ndVector hullBoxP1; - ndMatrix hullMatrix(contactSolver.m_instance0.m_globalMatrix * polygonMatrix.OrthoInverse()); - contactSolver.m_instance0.CalculateAabb(hullMatrix, hullBoxP0, hullBoxP1); - ndVector minBox(polyBoxP0 - hullBoxP1); - ndVector maxBox(polyBoxP1 - hullBoxP0); - - ndVector relStep(relativeVelocity.Scale(ndMax(contactSolver.m_timestep, ndFloat32(1.0e-12f)))); - ndFastRay ray(ndVector::m_zero, polygonMatrix.UnrotateVector(relStep)); - ndFloat32 distance = ray.BoxIntersect(minBox, maxBox); - - ndFloat32 relStepSpeed = m_normal.DotProduct(relStep).GetScalar(); - ndInt32 count = 0; - if ((distance < ndFloat32(1.0f)) && (ndAbs(relStepSpeed) > ndFloat32(1.0e-12f))) - { - bool inside = false; - ndAssert(m_normal.DotProduct(relStep).GetScalar() == relStepSpeed); - ndFloat32 invSpeed = ndFloat32(1.0f) / relStepSpeed; - ndVector sphOrigin(polygonMatrix.TransformVector((hullBoxP1 + hullBoxP0) * ndVector::m_half)); - ndVector pointInPlane(sphOrigin - relStep.Scale(m_normal.DotProduct(sphOrigin - m_localPoly[0]).GetScalar() * invSpeed)); - - ndVector sphRadius(ndVector::m_half * (hullBoxP1 - hullBoxP0)); - ndFloat32 radius = ndSqrt(sphRadius.DotProduct(sphRadius).GetScalar()); - ndVector planeMinkStep(m_normal.Scale(radius)); - sphOrigin -= planeMinkStep; - ndAssert(m_normal.DotProduct(relStep).GetScalar() == relStepSpeed); - ndVector supportPoint(sphOrigin - relStep.Scale(m_normal.DotProduct(sphOrigin - m_localPoly[0]).GetScalar() * invSpeed)); - - supportPoint -= pointInPlane; - ndAssert(supportPoint.m_w == ndFloat32(0.0f)); - radius = ndMax(ndSqrt(supportPoint.DotProduct(supportPoint).GetScalar()), radius); - - inside = true; - ndInt32 i0 = m_count - 1; - for (ndInt32 i = 0; i < m_count; ++i) - { - const ndVector e(m_localPoly[i] - m_localPoly[i0]); - const ndVector n((e.CrossProduct(m_normal) & ndVector::m_triplexMask).Normalize()); - ndFloat32 dist1 = n.DotProduct(pointInPlane - m_localPoly[i0]).GetScalar(); - - if (dist1 > radius) - { - return 0; - } - inside &= (dist1 <= ndFloat32(0.0f)); - i0 = i; - } - - ndFloat32 convexSphapeUmbra = ndMax(contactSolver.m_instance0.GetUmbraClipSize(), radius); - if (m_faceClipSize > convexSphapeUmbra) - { - BeamClipping(pointInPlane, convexSphapeUmbra, parentMesh); - m_faceClipSize = contactSolver.m_instance0.GetShape()->GetBoxMaxRadius(); - } - - const ndUnsigned64 hullId = contactSolver.m_instance0.GetUserDataID(); - if (inside & !contactSolver.m_intersectionTestOnly) - { - const ndMatrix& matrixInstance0 = contactSolver.m_instance0.m_globalMatrix; - //const ndVector normalInHull(matrixInstance0.UnrotateVector(m_normal.Scale(ndFloat32(-1.0f)))); - const ndVector normalInHull(matrixInstance0.UnrotateVector(m_normal * ndVector::m_negOne)); - ndVector pointInHull(contactSolver.m_instance0.SupportVertex(normalInHull)); - const ndVector p0(matrixInstance0.TransformVector(pointInHull)); - - ndFloat32 timetoImpact = ndFloat32(0.0f); - ndAssert(m_normal.m_w == ndFloat32(0.0f)); - ndFloat32 penetration = m_normal.DotProduct(m_localPoly[0] - p0).GetScalar() + contactSolver.m_skinMargin; - if (penetration < ndFloat32(0.0f)) - { - timetoImpact = penetration / relativeVelocity.DotProduct(m_normal).GetScalar(); - ndAssert(timetoImpact >= ndFloat32(0.0f)); - } - - if (timetoImpact <= contactSolver.m_timestep) - { - ndVector contactPoints[64]; - contactSolver.m_timestep = timetoImpact; - contactSolver.m_separatingVector = m_normal; - contactSolver.m_closestPoint0 = p0; - contactSolver.m_closestPoint1 = p0 + m_normal.Scale(penetration); - - if (!contactSolver.m_intersectionTestOnly) - { - pointInHull -= normalInHull.Scale(D_PENETRATION_TOL); - count = contactSolver.m_instance0.CalculatePlaneIntersection(normalInHull, pointInHull, contactPoints); - - ndVector step(relativeVelocity.Scale(timetoImpact)); - penetration = ndMax(penetration, ndFloat32(0.0f)); - ndContactPoint* const contactsOut = contactSolver.m_contactBuffer; - for (ndInt32 i = 0; i < count; ++i) - { - contactsOut[i].m_point = matrixInstance0.TransformVector(contactPoints[i]) + step; - contactsOut[i].m_normal = m_normal; - contactsOut[i].m_shapeId0 = ndInt64(hullId); - contactsOut[i].m_shapeId1 = m_faceId; - contactsOut[i].m_penetration = penetration; - } - } - } - } - else - { - m_vertexCount = ndUnsigned16(m_count); - count = contactSolver.ConvexToConvexContactsContinue(); - if (count >= 1) - { - ndContactPoint* const contactsOut = contactSolver.m_contactBuffer; - for (ndInt32 i = 0; i < count; ++i) - { - contactsOut[i].m_shapeId0 = ndInt64(hullId); - contactsOut[i].m_shapeId1 = m_faceId; - } - } - } - } - return count; -} - -ndInt32 ndShapeConvexPolygon::CalculateContactToConvexHullDescrete(const ndShapeInstance* const parentMesh, ndContactSolver& contactSolver) -{ - ndAssert(contactSolver.m_instance0.GetShape()->GetAsShapeConvex()); - ndAssert(contactSolver.m_instance1.GetShape()->GetAsShapeAsConvexPolygon()); - ndAssert(contactSolver.m_instance1.GetGlobalMatrix().TestIdentity()); - ndAssert(this == contactSolver.m_instance1.GetShape()); - ndAssert(m_count); - ndAssert(m_count < ndInt32(sizeof(m_localPoly) / sizeof(m_localPoly[0]))); - - const ndMatrix& hullMatrix = contactSolver.m_instance0.m_globalMatrix; - const ndShapeInstance* const hull = &contactSolver.m_instance0; - - ndAssert(m_normal.m_w == ndFloat32(0.0f)); - const ndVector obbOrigin(hullMatrix.TransformVector(contactSolver.m_instance0.GetShape()->GetObbOrigin())); - const ndFloat32 shapeSide = m_normal.DotProduct(obbOrigin - m_localPoly[0]).GetScalar(); - if (shapeSide < ndFloat32(0.0f)) - { - return 0; - } - - const ndVector normalInHull(hullMatrix.UnrotateVector(m_normal)); - const ndVector pointInHull(hull->SupportVertex(normalInHull.Scale(ndFloat32(-1.0f)))); - const ndVector p0(hullMatrix.TransformVector(pointInHull)); - - ndFloat32 penetration = m_normal.DotProduct(m_localPoly[0] - p0).GetScalar() + contactSolver.m_skinMargin; - if (penetration < -(D_PENETRATION_TOL * ndFloat32(5.0f))) - { - contactSolver.m_separatingVector = m_normal; - contactSolver.m_closestPoint0 = p0; - contactSolver.m_closestPoint1 = p0 + m_normal.Scale(penetration); - contactSolver.m_separationDistance = -penetration; - return 0; - } - - const ndVector p1(hullMatrix.TransformVector(hull->SupportVertex(normalInHull))); - - ndFloat32 distance = m_normal.DotProduct(m_localPoly[0] - p1).GetScalar(); - if (distance >= ndFloat32(0.0f)) - { - return 0; - } - - ndVector boxSize; - ndVector boxOrigin; - hull->CalculateObb(boxOrigin, boxSize); - ndAssert(boxOrigin.m_w == ndFloat32(0.0f)); - boxOrigin += ndVector::m_wOne; - - bool inside = true; - ndInt32 i0 = m_count - 1; - for (ndInt32 i = 0; i < m_count; ++i) - { - ndVector e(m_localPoly[i] - m_localPoly[i0]); - ndVector edgeBoundaryNormal(m_normal.CrossProduct(e)); - ndAssert(edgeBoundaryNormal.m_w == ndFloat32(0.0f)); - ndPlane plane(edgeBoundaryNormal, -m_localPoly[i0].DotProduct(edgeBoundaryNormal).GetScalar()); - plane = hullMatrix.UntransformPlane(plane); - - ndFloat32 supportDist = boxSize.DotProduct(plane.Abs()).GetScalar(); - ndFloat32 centerDist = plane.DotProduct(boxOrigin).GetScalar(); - - if ((centerDist + supportDist) < ndFloat32(0.0f)) - { - return 0; - } - - if ((centerDist - supportDist) < ndFloat32(0.0f)) - { - inside = false; - break; - } - i0 = i; - } - - bool needSkirts = true; - ndFloat32 convexSphapeUmbra = hull->GetUmbraClipSize(); - if (m_faceClipSize > convexSphapeUmbra) - { - ndVector boxP0; - ndVector boxP1; - hull->CalculateAabb(hullMatrix, boxP0, boxP1); - ndVector origin(ndVector::m_half * (boxP1 + boxP1)); - - if (!BeamClipping(origin, convexSphapeUmbra, parentMesh)) - { - return 0; - } - needSkirts = false; - m_faceClipSize = hull->GetShape()->GetBoxMaxRadius(); - } - - ndInt32 count = 0; - const ndUnsigned64 hullId = hull->GetUserDataID(); - if (inside & !contactSolver.m_intersectionTestOnly) - { - contactSolver.m_separationDistance = -penetration; - contactSolver.m_separatingVector = m_normal; - contactSolver.m_closestPoint0 = p0; - contactSolver.m_closestPoint1 = p0 + m_normal.Scale(penetration); - - penetration = ndMax(ndFloat32(0.0f), penetration); - ndAssert(penetration >= ndFloat32(0.0f)); - ndVector contactPoints[128]; - ndVector point(pointInHull + normalInHull.Scale(penetration - D_PENETRATION_TOL)); - - count = hull->CalculatePlaneIntersection(normalInHull.Scale(ndFloat32(-1.0f)), point, contactPoints); - ndVector step(normalInHull.Scale((contactSolver.m_skinMargin - penetration) * ndFloat32(0.5f))); - - ndContactPoint* const contactsOut = contactSolver.m_contactBuffer; - for (ndInt32 i = 0; i < count; ++i) - { - contactsOut[i].m_point = hullMatrix.TransformVector(contactPoints[i] + step); - contactsOut[i].m_normal = m_normal; - contactsOut[i].m_shapeId0 = ndInt64(hullId); - contactsOut[i].m_shapeId1 = m_faceId; - contactsOut[i].m_penetration = penetration; - } - } - else - { - if (needSkirts) - { - GenerateConvexCap(parentMesh); - } - m_vertexCount = ndUnsigned16(m_count); - count = contactSolver.ConvexToConvexContactsDiscrete(); - ndAssert(contactSolver.m_intersectionTestOnly || (count >= 0)); - if (count >= 1) - { - ndContactPoint* const contactsOut = contactSolver.m_contactBuffer; - for (ndInt32 i = 0; i < count; ++i) - { - contactsOut[i].m_shapeId0 = ndInt64(hullId); - contactsOut[i].m_shapeId1 = m_faceId; - } - } - } - - return count; -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexPolygon.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexPolygon.h deleted file mode 100644 index 47338c9feb..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeConvexPolygon.h +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_COLLISION_CONVEX_POLYGON_H__ -#define __ND_COLLISION_CONVEX_POLYGON_H__ - -#include "ndShapeConvex.h" -class ndShapeInstance; - -#define D_CONVEX_POLYGON_MAX_VERTEX_COUNT 64 - -D_MSV_NEWTON_ALIGN_32 -class ndShapeConvexPolygon: public ndShapeConvex -{ - public: - class dgClippedFaceEdge - { - public: - dgClippedFaceEdge* m_next; - dgClippedFaceEdge* m_twin; - ndInt32 m_incidentNormal; - ndInt32 m_incidentVertex; - }; - - ndShapeConvexPolygon (); - ~ndShapeConvexPolygon (); - - virtual ndShapeConvexPolygon* GetAsShapeAsConvexPolygon(); - - ndVector CalculateGlobalNormal(const ndShapeInstance* const parentMesh, const ndVector& localNormal) const; - ndInt32 CalculateContactToConvexHullDescrete(const ndShapeInstance* const parentMesh, ndContactSolver& proxy); - ndInt32 CalculateContactToConvexHullContinue(const ndShapeInstance* const parentMesh, ndContactSolver& proxy); - - virtual ndFloat32 GetVolume() const; - virtual ndFloat32 GetBoxMinRadius() const; - virtual ndFloat32 GetBoxMaxRadius() const; - void GenerateConvexCap(const ndShapeInstance* const parentMesh); - virtual ndVector SupportVertex(const ndVector& dir) const; - bool BeamClipping(const ndVector& origin, ndFloat32 size, const ndShapeInstance* const parentMesh); - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - - virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - - virtual ndInt32 Release() const; - - ndVector m_normal; - ndVector m_localPoly[D_CONVEX_POLYGON_MAX_VERTEX_COUNT]; - ndInt32 m_clippEdgeNormal[D_CONVEX_POLYGON_MAX_VERTEX_COUNT]; - ndFloat32 m_faceClipSize; - ndInt32 m_count; - ndInt32 m_paddedCount; - ndInt32 m_faceId; - ndInt32 m_stride; - ndInt32 m_faceNormalIndex; - - const ndFloat32* m_vertex; - const ndInt32* m_vertexIndex; - const ndInt32* m_adjacentFaceEdgeNormalIndex; -} D_GCC_NEWTON_ALIGN_32; - -inline ndShapeConvexPolygon* ndShapeConvexPolygon::GetAsShapeAsConvexPolygon() -{ - return this; -} - -inline ndFloat32 ndShapeConvexPolygon::RayCast(ndRayCastNotify&, const ndVector&, const ndVector&, ndFloat32, const ndBody* const, ndContactPoint&) const -{ - return ndFloat32(1.2f); -} - -inline ndFloat32 ndShapeConvexPolygon::GetVolume() const -{ - return ndFloat32(0.0f); -} - -inline ndFloat32 ndShapeConvexPolygon::GetBoxMinRadius() const -{ - return m_faceClipSize; -} - -inline ndFloat32 ndShapeConvexPolygon::GetBoxMaxRadius() const -{ - return GetBoxMinRadius(); -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCylinder.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCylinder.cpp deleted file mode 100644 index b1c5127e44..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCylinder.cpp +++ /dev/null @@ -1,419 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndShapeCylinder.h" -#include "ndContactSolver.h" - -ndInt32 ndShapeCylinder::m_shapeRefCount = 0; -ndShapeConvex::ndConvexSimplexEdge ndShapeCylinder::m_edgeArray[D_TAPED_CYLINDER_SEGMENTS * 2 * 3]; - -ndShapeCylinder::ndShapeCylinder(ndFloat32 radius0, ndFloat32 radius1, ndFloat32 height) - :ndShapeConvex(m_cylinder) -{ - Init(radius0, radius1, height); -} - -ndShapeCylinder::~ndShapeCylinder() -{ - m_shapeRefCount--; - ndAssert(m_shapeRefCount >= 0); - ndShapeConvex::m_vertex = nullptr; - ndShapeConvex::m_simplex = nullptr; -} - -void ndShapeCylinder::Init(ndFloat32 radio0, ndFloat32 radio1, ndFloat32 height) -{ - m_radius0 = ndMax(ndAbs(radio0), D_MIN_CONVEX_SHAPE_SIZE); - m_radius1 = ndMax(ndAbs(radio1), D_MIN_CONVEX_SHAPE_SIZE); - m_height = ndMax(ndAbs(height) * ndFloat32(0.5f), D_MIN_CONVEX_SHAPE_SIZE); - - ndFloat32 angle = ndFloat32(0.0f); - const ndInt32 offset0 = 0; - const ndInt32 offset1 = D_TAPED_CYLINDER_SEGMENTS; - for (ndInt32 i = 0; i < D_TAPED_CYLINDER_SEGMENTS; ++i) - { - ndFloat32 sinAngle = ndSin(angle); - ndFloat32 cosAngle = ndCos(angle); - m_vertex[i + offset0] = ndVector(-m_height, m_radius0 * cosAngle, m_radius0 * sinAngle, ndFloat32(0.0f)); - m_vertex[i + offset1] = ndVector( m_height, m_radius1 * cosAngle, m_radius1 * sinAngle, ndFloat32(0.0f)); - angle += ndFloat32 (2.0f) * ndPi / D_TAPED_CYLINDER_SEGMENTS; - } - - m_edgeCount = D_TAPED_CYLINDER_SEGMENTS * 6; - m_vertexCount = D_TAPED_CYLINDER_SEGMENTS * 2; - ndShapeConvex::m_vertex = m_vertex; - - if (!m_shapeRefCount) - { - ndPolyhedra polyhedra; - ndInt32 wireframe[D_TAPED_CYLINDER_SEGMENTS]; - - ndInt32 j = D_TAPED_CYLINDER_SEGMENTS - 1; - polyhedra.BeginFace(); - for (ndInt32 i = 0; i < D_TAPED_CYLINDER_SEGMENTS; ++i) - { - wireframe[0] = j; - wireframe[1] = i; - wireframe[2] = i + D_TAPED_CYLINDER_SEGMENTS; - wireframe[3] = j + D_TAPED_CYLINDER_SEGMENTS; - j = i; - polyhedra.AddFace(4, wireframe); - } - - for (ndInt32 i = 0; i < D_TAPED_CYLINDER_SEGMENTS; ++i) - { - wireframe[i] = D_TAPED_CYLINDER_SEGMENTS - 1 - i; - } - polyhedra.AddFace(D_TAPED_CYLINDER_SEGMENTS, wireframe); - - for (ndInt32 i = 0; i < D_TAPED_CYLINDER_SEGMENTS; ++i) - { - wireframe[i] = i + D_TAPED_CYLINDER_SEGMENTS; - } - polyhedra.AddFace(D_TAPED_CYLINDER_SEGMENTS, wireframe); - polyhedra.EndFace(); - - ndAssert(SanityCheck(polyhedra)); - - ndUnsigned64 i = 0; - ndPolyhedra::Iterator iter(polyhedra); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - edge->m_userData = i; - i++; - } - - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - - ndConvexSimplexEdge* const ptr = &m_edgeArray[edge->m_userData]; - ptr->m_vertex = edge->m_incidentVertex; - ptr->m_next = &m_edgeArray[edge->m_next->m_userData]; - ptr->m_prev = &m_edgeArray[edge->m_prev->m_userData]; - ptr->m_twin = &m_edgeArray[edge->m_twin->m_userData]; - } - } - - m_profile[0] = ndVector(m_height, m_radius1, ndFloat32(0.0f), ndFloat32(0.0f)); - m_profile[1] = ndVector(-m_height, m_radius0, ndFloat32(0.0f), ndFloat32(0.0f)); - m_profile[2] = ndVector(-m_height, -m_radius0, ndFloat32(0.0f), ndFloat32(0.0f)); - m_profile[3] = ndVector(m_height, -m_radius1, ndFloat32(0.0f), ndFloat32(0.0f)); - - m_shapeRefCount++; - ndShapeConvex::m_simplex = m_edgeArray; - - SetVolumeAndCG(); -} - -ndShapeInfo ndShapeCylinder::GetShapeInfo() const -{ - ndShapeInfo info(ndShapeConvex::GetShapeInfo()); - - info.m_cylinder.m_radio0 = m_radius0; - info.m_cylinder.m_radio1 = m_radius1; - info.m_cylinder.m_height = ndFloat32(2.0f) * m_height; - return info; -} - -void ndShapeCylinder::DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const -{ - #define NUMBER_OF_DEBUG_SEGMENTS 24 - ndVector face[NUMBER_OF_DEBUG_SEGMENTS]; - ndVector pool[NUMBER_OF_DEBUG_SEGMENTS * 2]; - ndShapeDebugNotify::ndEdgeType edgeType[NUMBER_OF_DEBUG_SEGMENTS]; - memset(edgeType, ndShapeDebugNotify::m_shared, sizeof(edgeType)); - - ndFloat32 angle = ndFloat32(0.0f); - for (ndInt32 i = 0; i < NUMBER_OF_DEBUG_SEGMENTS; ++i) - { - ndFloat32 z = ndSin(angle); - ndFloat32 y = ndCos(angle); - pool[i].m_x = -m_height; - pool[i].m_y = y * m_radius0; - pool[i].m_z = z * m_radius0; - pool[i].m_w = ndFloat32 (0.0f); - pool[i + NUMBER_OF_DEBUG_SEGMENTS].m_x = m_height; - pool[i + NUMBER_OF_DEBUG_SEGMENTS].m_y = y * m_radius1; - pool[i + NUMBER_OF_DEBUG_SEGMENTS].m_z = z * m_radius1; - pool[i + NUMBER_OF_DEBUG_SEGMENTS].m_w = ndFloat32(0.0f); - angle += ndFloat32 (2.0) * ndPi / ndFloat32(NUMBER_OF_DEBUG_SEGMENTS); - } - - matrix.TransformTriplex(&pool[0].m_x, sizeof(ndVector), &pool[0].m_x, sizeof(ndVector), NUMBER_OF_DEBUG_SEGMENTS * 2); - - ndInt32 j = NUMBER_OF_DEBUG_SEGMENTS - 1; - for (ndInt32 i = 0; i < NUMBER_OF_DEBUG_SEGMENTS; ++i) - { - face[0] = pool[j]; - face[1] = pool[i]; - face[2] = pool[i + NUMBER_OF_DEBUG_SEGMENTS]; - face[3] = pool[j + NUMBER_OF_DEBUG_SEGMENTS]; - j = i; - debugCallback.DrawPolygon(4, face, edgeType); - } - - for (ndInt32 i = 0; i < NUMBER_OF_DEBUG_SEGMENTS; ++i) - { - face[i] = pool[NUMBER_OF_DEBUG_SEGMENTS - 1 - i]; - } - debugCallback.DrawPolygon(NUMBER_OF_DEBUG_SEGMENTS, face, edgeType); - - for (ndInt32 i = 0; i < NUMBER_OF_DEBUG_SEGMENTS; ++i) - { - face[i] = pool[i + NUMBER_OF_DEBUG_SEGMENTS]; - } - debugCallback.DrawPolygon(NUMBER_OF_DEBUG_SEGMENTS, face, edgeType); -} - -ndVector ndShapeCylinder::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - return point + dir.Scale(D_PENETRATION_TOL); -} - -ndVector ndShapeCylinder::SupportVertex(const ndVector& dir) const -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - - if (dir.m_x < ndFloat32(-0.9999f)) - { - return ndVector(-m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - } - else if (dir.m_x > ndFloat32(0.9999f)) - { - return ndVector(m_height, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - } - - ndVector dir_yz(dir); - dir_yz.m_x = ndFloat32(0.0f); - ndAssert(dir_yz.DotProduct(dir_yz).GetScalar() > ndFloat32(0.0f)); - dir_yz = dir_yz.Normalize(); - ndVector p0(dir_yz.Scale(m_radius0)); - ndVector p1(dir_yz.Scale(m_radius1)); - - p0.m_x = -m_height; - p1.m_x = m_height; - - ndFloat32 dist0 = dir.DotProduct(p0).GetScalar(); - ndFloat32 dist1 = dir.DotProduct(p1).GetScalar(); - - if (dist1 >= dist0) - { - p0 = p1; - } - return p0; -} - -ndVector ndShapeCylinder::SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - - const ndFloat32 thickness = D_PENETRATION_TOL + skinMargin; - if (dir.m_x < ndFloat32(-0.9999f)) - { - return ndVector(-(m_height - thickness), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - } - else if (dir.m_x > ndFloat32(0.9999f)) - { - return ndVector(m_height - thickness, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - } - - ndVector dir_yz(dir); - dir_yz.m_x = ndFloat32(0.0f); - - dir_yz = dir_yz.Normalize(); - ndVector p0(dir_yz.Scale(m_radius0 - thickness)); - ndVector p1(dir_yz.Scale(m_radius1 - thickness)); - - p0.m_x = -(m_height - thickness); - p1.m_x = m_height - thickness; - - ndFloat32 dist0 = dir.DotProduct(p0).GetScalar(); - ndFloat32 dist1 = dir.DotProduct(p1).GetScalar(); - - if (dist1 >= dist0) - { - p0 = p1; - } - return p0; -} - -ndFloat32 ndShapeCylinder::RayCast(ndRayCastNotify& callback, const ndVector& r0, const ndVector& r1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const -{ - return ndShapeConvex::RayCast(callback, r0, r1, maxT, body, contactOut); -} - -ndInt32 ndShapeCylinder::CalculatePlaneIntersection(const ndVector& normal, const ndVector& origin, ndVector* const contactsOut) const -{ - ndInt32 count = 0; - const ndFloat32 inclination = ndFloat32(0.9998f); - if (normal.m_x < ndFloat32(-0.995f)) - { - if (normal.m_x < -inclination) - { - ndMatrix matrix(ndGramSchmidtMatrix (normal)); - matrix.m_posit.m_x = origin.m_x; - count = BuildCylinderCapPoly(m_radius0, matrix, contactsOut); - //count = RectifyConvexSlice(n, normal, contactsOut); - } - else - { - ndFloat32 magInv = ndRsqrt(normal.m_y * normal.m_y + normal.m_z * normal.m_z); - ndFloat32 cosAng = normal.m_y * magInv; - ndFloat32 sinAng = normal.m_z * magInv; - - ndAssert(ndAbs(normal.m_z * cosAng - normal.m_y * sinAng) < ndFloat32(1.0e-4f)); - ndVector normal1(normal.m_x, normal.m_y * cosAng + normal.m_z * sinAng, ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector origin1(origin.m_x, origin.m_y * cosAng + origin.m_z * sinAng, origin.m_z * cosAng - origin.m_y * sinAng, ndFloat32(0.0f)); - - count = ndShapeConvex::CalculatePlaneIntersection(normal1, origin1, contactsOut); - if (count > 6) - { - ndInt32 dy = 2 * 6; - ndInt32 dx = 2 * count; - ndInt32 acc = dy - count; - ndInt32 index = 0; - for (ndInt32 i = 0; i < count; ++i) - { - if (acc > 0) - { - contactsOut[index] = contactsOut[i]; - index++; - acc -= dx; - } - acc += dy; - } - count = index; - } - - for (ndInt32 i = 0; i < count; ++i) - { - ndFloat32 y = contactsOut[i].m_y; - ndFloat32 z = contactsOut[i].m_z; - contactsOut[i].m_y = y * cosAng - z * sinAng; - contactsOut[i].m_z = z * cosAng + y * sinAng; - } - } - } - else if (normal.m_x > ndFloat32(0.995f)) - { - if (normal.m_x > inclination) - { - ndMatrix matrix(ndGramSchmidtMatrix(normal)); - matrix.m_posit.m_x = origin.m_x; - count = BuildCylinderCapPoly(m_radius1, matrix, contactsOut); - //count = RectifyConvexSlice(n, normal, contactsOut); - } - else - { - ndFloat32 magInv = ndRsqrt(normal.m_y * normal.m_y + normal.m_z * normal.m_z); - ndFloat32 cosAng = normal.m_y * magInv; - ndFloat32 sinAng = normal.m_z * magInv; - - ndAssert(ndAbs(normal.m_z * cosAng - normal.m_y * sinAng) < ndFloat32(1.0e-4f)); - ndVector normal1(normal.m_x, normal.m_y * cosAng + normal.m_z * sinAng, ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector origin1(origin.m_x, origin.m_y * cosAng + origin.m_z * sinAng, origin.m_z * cosAng - origin.m_y * sinAng, ndFloat32(0.0f)); - - count = ndShapeConvex::CalculatePlaneIntersection(normal1, origin1, contactsOut); - if (count > 6) - { - ndInt32 dy = 2 * 6; - ndInt32 dx = 2 * count; - ndInt32 acc = dy - count; - ndInt32 index = 0; - for (ndInt32 i = 0; i < count; ++i) - { - if (acc > 0) - { - contactsOut[index] = contactsOut[i]; - index++; - acc -= dx; - } - acc += dy; - } - count = index; - } - - for (ndInt32 i = 0; i < count; ++i) - { - ndFloat32 y = contactsOut[i].m_y; - ndFloat32 z = contactsOut[i].m_z; - contactsOut[i].m_y = y * cosAng - z * sinAng; - contactsOut[i].m_z = z * cosAng + y * sinAng; - } - } - } - else - { - ndFloat32 magInv = ndRsqrt(normal.m_y * normal.m_y + normal.m_z * normal.m_z); - ndFloat32 cosAng = normal.m_y * magInv; - ndFloat32 sinAng = normal.m_z * magInv; - - ndAssert(ndAbs(normal.m_z * cosAng - normal.m_y * sinAng) < ndFloat32(1.0e-4f)); - ndVector normal1(normal.m_x, normal.m_y * cosAng + normal.m_z * sinAng, ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector origin1(origin.m_x, origin.m_y * cosAng + origin.m_z * sinAng, origin.m_z * cosAng - origin.m_y * sinAng, ndFloat32(0.0f)); - - count = 0; - ndInt32 i0 = 3; - ndVector test0((m_profile[i0] - origin1).DotProduct(normal1)); - for (ndInt32 i = 0; (i < 4) && (count < 2); ++i) - { - ndVector test1((m_profile[i] - origin1).DotProduct(normal1)); - ndVector acrossPlane(test0 * test1); - if (acrossPlane.m_x < 0.0f) - { - ndVector step(m_profile[i] - m_profile[i0]); - contactsOut[count] = m_profile[i0] - step.Scale(test0.m_x / (step.DotProduct(normal1).m_x)); - count++; - } - i0 = i; - test0 = test1; - } - - for (ndInt32 i = 0; i < count; ++i) - { - ndFloat32 y = contactsOut[i].m_y; - ndFloat32 z = contactsOut[i].m_z; - contactsOut[i].m_y = y * cosAng - z * sinAng; - contactsOut[i].m_z = z * cosAng + y * sinAng; - } - } - return count; -} - -void ndShapeCylinder::CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const -{ - ndShapeConvex::CalculateAabb(matrix, p0, p1); -} - -ndUnsigned64 ndShapeCylinder::GetHash(ndUnsigned64 hash) const -{ - ndShapeInfo info(GetShapeInfo()); - return info.GetHash(hash); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCylinder.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCylinder.h deleted file mode 100644 index 9133741cc7..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeCylinder.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_CYLINDER_H__ -#define __ND_SHAPE_CYLINDER_H__ - -#include "ndShapeConvex.h" - -#define D_TAPED_CYLINDER_SEGMENTS 12 - -D_MSV_NEWTON_ALIGN_32 -class ndShapeCylinder : public ndShapeConvex -{ - public: - D_CLASS_REFLECTION(ndShapeCylinder,ndShapeConvex) - D_COLLISION_API ndShapeCylinder(ndFloat32 radio0, ndFloat32 radio1, ndFloat32 height); - D_COLLISION_API ~ndShapeCylinder(); - - D_COLLISION_API virtual ndShapeCylinder* GetAsShapeCylinder() { return this; } - - protected: - D_COLLISION_API void Init (ndFloat32 radio0, ndFloat32 radio1, ndFloat32 height); - - D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; - D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; - D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; - D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - D_COLLISION_API virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - - ndVector m_profile[4]; - ndVector m_vertex[D_TAPED_CYLINDER_SEGMENTS * 2]; - ndFloat32 m_radius0; - ndFloat32 m_radius1; - ndFloat32 m_height; - - static ndInt32 m_shapeRefCount; - static ndConvexSimplexEdge m_edgeArray[]; -} D_GCC_NEWTON_ALIGN_32; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeHeightfield.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeHeightfield.cpp deleted file mode 100644 index 6e9e70057b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeHeightfield.cpp +++ /dev/null @@ -1,812 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndBodyKinematic.h" -#include "ndShapeInstance.h" -#include "ndPolygonMeshDesc.h" -#include "ndShapeHeightfield.h" - -ndVector ndShapeHeightfield::m_yMask(0xffffffff, 0, 0xffffffff, 0); -ndVector ndShapeHeightfield::m_padding(ndFloat32(0.25f), ndFloat32(0.25f), ndFloat32(0.25f), ndFloat32(0.0f)); -ndVector ndShapeHeightfield::m_elevationPadding(ndFloat32(0.0f), ndFloat32(1.0e10f), ndFloat32(0.0f), ndFloat32(0.0f)); - -ndInt32 ndShapeHeightfield::m_cellIndices[][4] = -{ - { 0, 1, 2, 3 }, - { 1, 3, 0, 2 } -}; - -ndShapeHeightfield::ndShapeHeightfield( - ndInt32 width, ndInt32 height, ndGridConstruction constructionMode, - ndFloat32 horizontalScale_x, ndFloat32 horizontalScale_z) - :ndShapeStaticMesh(m_heightField) - ,m_minBox(ndVector::m_zero) - ,m_maxBox(ndVector::m_zero) - ,m_attributeMap(width * height) - ,m_elevationMap(width * height) - ,m_horizontalScale_x(horizontalScale_x) - ,m_horizontalScale_z(horizontalScale_z) - ,m_horizontalScaleInv_x(ndFloat32(1.0f) / horizontalScale_x) - ,m_horizontalScaleInv_z(ndFloat32(1.0f) / horizontalScale_z) - ,m_width(width) - ,m_height(height) - ,m_diagonalMode(constructionMode) -{ - ndAssert(width >= 2); - ndAssert(height >= 2); - m_attributeMap.SetCount(width * height); - m_elevationMap.SetCount(width * height); - - ndMemSet(&m_attributeMap[0], ndInt8(0), m_attributeMap.GetCount()); - ndMemSet(&m_elevationMap[0], ndReal(0.0f), m_elevationMap.GetCount()); - - CalculateLocalObb(); -} - -ndShapeHeightfield::~ndShapeHeightfield(void) -{ -} - -ndShapeInfo ndShapeHeightfield::GetShapeInfo() const -{ - ndShapeInfo info(ndShapeStaticMesh::GetShapeInfo()); - - info.m_heightfield.m_width = m_width; - info.m_heightfield.m_height = m_height; - info.m_heightfield.m_gridsDiagonals = m_diagonalMode; - info.m_heightfield.m_horizonalScale_x = m_horizontalScale_x; - info.m_heightfield.m_horizonalScale_z = m_horizontalScale_z; - info.m_heightfield.m_elevation = (ndReal*)&m_elevationMap[0]; - info.m_heightfield.m_atributes = (ndInt8*)&m_attributeMap[0]; - - return info; -} - -ndArray& ndShapeHeightfield::GetElevationMap() -{ - return m_elevationMap; -} - -const ndArray& ndShapeHeightfield::GetElevationMap() const -{ - return m_elevationMap; -} - -ndArray& ndShapeHeightfield::GetAttributeMap() -{ - return m_attributeMap; -} - -const ndArray& ndShapeHeightfield::GetAttributeMap() const -{ - return m_attributeMap; -} - -ndInt32 ndShapeHeightfield::FastInt(ndFloat32 x) const -{ - ndInt32 i = ndInt32(x); - if (ndFloat32(i) > x) - { - i--; - } - return i; -} - -void ndShapeHeightfield::CalculateLocalObb() -{ - ndReal y0 = ndReal (1.0e10f); - ndReal y1 = -ndReal(1.0e10f); - for (ndInt32 i = ndInt32(m_elevationMap.GetCount()-1); i >= 0; --i) - { - y0 = ndMin(y0, m_elevationMap[i]); - y1 = ndMax(y1, m_elevationMap[i]); - } - - m_minBox = ndVector(ndFloat32(0.0f), ndFloat32 (y0), ndFloat32(0.0f), ndFloat32(0.0f)); - m_maxBox = ndVector(ndFloat32(m_width-1) * m_horizontalScale_x, ndFloat32(y1), ndFloat32(m_height-1) * m_horizontalScale_z, ndFloat32(0.0f)); - - m_boxSize = (m_maxBox - m_minBox) * ndVector::m_half; - m_boxOrigin = (m_maxBox + m_minBox) * ndVector::m_half; -} - -void ndShapeHeightfield::UpdateElevationMapAabb() -{ - CalculateLocalObb(); -} - -const ndInt32* ndShapeHeightfield::GetIndexList() const -{ - return &m_cellIndices[(m_diagonalMode == m_normalDiagonals) ? 0 : 1][0]; -} - -void ndShapeHeightfield::DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const -{ - ndVector points[4]; - ndVector triangle[3]; - - ndShapeDebugNotify::ndEdgeType edgeType[4]; - memset(edgeType, ndShapeDebugNotify::m_shared, sizeof(edgeType)); - - const ndInt32* const indirectIndex = GetIndexList(); - const ndInt32 i0 = indirectIndex[0]; - const ndInt32 i1 = indirectIndex[1]; - const ndInt32 i2 = indirectIndex[2]; - const ndInt32 i3 = indirectIndex[3]; - - ndInt32 base = 0; - for (ndInt32 z = 0; z < m_height - 1; ++z) - { - const ndVector p0 ((ndFloat32)(0 + 0) * m_horizontalScale_x, ndFloat32(m_elevationMap[base + 0]), (ndFloat32)(z + 0) * m_horizontalScale_z, ndFloat32(0.0f)); - const ndVector p1 ((ndFloat32)(0 + 0) * m_horizontalScale_x, ndFloat32(m_elevationMap[base + 0 + m_width + 0]), (ndFloat32)(z + 1) * m_horizontalScale_z, ndFloat32(0.0f)); - - points[0 * 2 + 0] = matrix.TransformVector(p0); - points[1 * 2 + 0] = matrix.TransformVector(p1); - - for (ndInt32 x = 0; x < m_width - 1; ++x) - { - const ndVector p2 ((ndFloat32)(x + 1) * m_horizontalScale_x, ndFloat32(m_elevationMap[base + x + 1]), (ndFloat32)(z + 0) * m_horizontalScale_z, ndFloat32(0.0f)); - const ndVector p3 ((ndFloat32)(x + 1) * m_horizontalScale_x, ndFloat32(m_elevationMap[base + x + m_width + 1]), (ndFloat32)(z + 1) * m_horizontalScale_z, ndFloat32(0.0f)); - - points[0 * 2 + 1] = matrix.TransformVector(p2); - points[1 * 2 + 1] = matrix.TransformVector(p3); - - triangle[0] = points[i1]; - triangle[1] = points[i0]; - triangle[2] = points[i2]; - debugCallback.DrawPolygon(3, triangle, edgeType); - - triangle[0] = points[i1]; - triangle[1] = points[i2]; - triangle[2] = points[i3]; - debugCallback.DrawPolygon(3, triangle, edgeType); - - points[0 * 2 + 0] = points[0 * 2 + 1]; - points[1 * 2 + 0] = points[1 * 2 + 1]; - } - base += m_width; - } -} - -void ndShapeHeightfield::CalculateMinExtend2d(const ndVector& p0, const ndVector& p1, ndVector& boxP0, ndVector& boxP1) const -{ - const ndVector scale(m_horizontalScale_x, ndFloat32(0.0f), m_horizontalScale_z, ndFloat32(0.0f)); - const ndVector q0(p0.GetMin(p1) - m_padding); - const ndVector q1(p0.GetMax(p1) + scale + m_padding); - - const ndVector invScale(m_horizontalScaleInv_x, ndFloat32(0.0f), m_horizontalScaleInv_z, ndFloat32(0.0f)); - boxP0 = (((q0 * invScale).Floor() * scale) & m_yMask) - m_elevationPadding; - boxP1 = (((q1 * invScale).Floor() * scale + scale) & m_yMask) + m_elevationPadding; - ndAssert(boxP0.m_w == ndFloat32(0.0f)); - ndAssert(boxP1.m_w == ndFloat32(0.0f)); - - const ndVector minBox(boxP0.Select(m_minBox, m_yMask)); - const ndVector maxBox(boxP1.Select(m_maxBox, m_yMask)); - - boxP0 = boxP0.GetMax(minBox); - boxP1 = boxP1.GetMin(maxBox); -} - -void ndShapeHeightfield::CalculateMinExtend3d(const ndVector& p0, const ndVector& p1, ndVector& boxP0, ndVector& boxP1) const -{ - ndAssert(p0.m_x <= p1.m_x); - ndAssert(p0.m_y <= p1.m_y); - ndAssert(p0.m_z <= p1.m_z); - ndAssert(p0.m_w == ndFloat32(0.0f)); - ndAssert(p1.m_w == ndFloat32(0.0f)); - - const ndVector scale(m_horizontalScale_x, ndFloat32(0.0f), m_horizontalScale_z, ndFloat32(0.0f)); - const ndVector q0(p0.GetMin(p1) - m_padding); - const ndVector q1(p0.GetMax(p1) + scale + m_padding); - const ndVector invScale(m_horizontalScaleInv_x, ndFloat32(0.0f), m_horizontalScaleInv_z, ndFloat32(0.0f)); - - boxP0 = q0.Select((q0 * invScale).Floor() * scale, m_yMask); - boxP1 = q1.Select((q1 * invScale).Floor() * scale + scale, m_yMask); - - boxP0 = boxP0.Select(boxP0.GetMax(m_minBox), m_yMask); - boxP1 = boxP1.Select(boxP1.GetMax(m_minBox), m_yMask); - - boxP0 = boxP0.Select(boxP0.GetMin(m_maxBox), m_yMask); - boxP1 = boxP1.Select(boxP1.GetMin(m_maxBox), m_yMask); - - ndAssert(boxP0.m_x <= boxP1.m_x); - ndAssert(boxP0.m_z <= boxP1.m_z); -} - -void ndShapeHeightfield::GetLocalAabb(const ndVector& q0, const ndVector& q1, ndVector& boxP0, ndVector& boxP1) const -{ - // the user data is the pointer to the collision geometry - CalculateMinExtend3d(q0, q1, boxP0, boxP1); - - const ndVector p0(boxP0.Scale(m_horizontalScaleInv_x).GetInt()); - const ndVector p1(boxP1.Scale(m_horizontalScaleInv_x).GetInt()); - - ndAssert(p0.m_ix == FastInt(boxP0.m_x * m_horizontalScaleInv_x)); - ndAssert(p0.m_iz == FastInt(boxP0.m_z * m_horizontalScaleInv_x)); - ndAssert(p1.m_ix == FastInt(boxP1.m_x * m_horizontalScaleInv_x)); - ndAssert(p1.m_iz == FastInt(boxP1.m_z * m_horizontalScaleInv_x)); - - ndInt32 x0 = ndInt32(p0.m_ix); - ndInt32 x1 = ndInt32(p1.m_ix); - ndInt32 z0 = ndInt32(p0.m_iz); - ndInt32 z1 = ndInt32(p1.m_iz); - - ndFloat32 minHeight = ndFloat32(1.0e10f); - ndFloat32 maxHeight = ndFloat32(-1.0e10f); - CalculateMinAndMaxElevation(x0, x1, z0, z1, minHeight, maxHeight); - boxP0.m_y = minHeight; - boxP1.m_y = maxHeight; - ndAssert(boxP0.m_x <= boxP1.m_x); - ndAssert(boxP0.m_y <= boxP1.m_y); - ndAssert(boxP0.m_z <= boxP1.m_z); -} - -ndFloat32 ndShapeHeightfield::RayCastCell(const ndFastRay& ray, ndInt32 xIndex0, ndInt32 zIndex0, ndVector& normalOut, ndFloat32 maxT) const -{ - ndVector points[4]; - ndInt32 triangle[3]; - - // get the 3d point at the corner of the cell - if ((xIndex0 < 0) || (zIndex0 < 0) || (xIndex0 >= (m_width - 1)) || (zIndex0 >= (m_height - 1))) - { - return ndFloat32(1.2f); - } - - ndAssert(maxT <= 1.0); - - ndInt32 base = zIndex0 * m_width + xIndex0; - - points[0 * 2 + 0] = ndVector((ndFloat32)(xIndex0 + 0) * m_horizontalScale_x, ndFloat32 (m_elevationMap[base + 0]), (ndFloat32)(zIndex0 + 0) * m_horizontalScale_z, ndFloat32(0.0f)); - points[0 * 2 + 1] = ndVector((ndFloat32)(xIndex0 + 1) * m_horizontalScale_x, ndFloat32 (m_elevationMap[base + 1]), (ndFloat32)(zIndex0 + 0) * m_horizontalScale_z, ndFloat32(0.0f)); - points[1 * 2 + 1] = ndVector((ndFloat32)(xIndex0 + 1) * m_horizontalScale_x, ndFloat32 (m_elevationMap[base + m_width + 1]), (ndFloat32)(zIndex0 + 1) * m_horizontalScale_z, ndFloat32(0.0f)); - points[1 * 2 + 0] = ndVector((ndFloat32)(xIndex0 + 0) * m_horizontalScale_x, ndFloat32 (m_elevationMap[base + m_width + 0]), (ndFloat32)(zIndex0 + 1) * m_horizontalScale_z, ndFloat32(0.0f)); - - ndFloat32 t = ndFloat32(1.2f); - if (m_diagonalMode == m_normalDiagonals) - { - triangle[0] = 1; - triangle[1] = 2; - triangle[2] = 3; - - ndVector e10(points[2] - points[1]); - ndVector e20(points[3] - points[1]); - ndVector normal(e10.CrossProduct(e20)); - normal = normal.Normalize(); - t = ray.PolygonIntersect(normal, maxT, &points[0].m_x, sizeof(ndVector), triangle, 3); - if (t < maxT) - { - normalOut = normal; - return t; - } - - triangle[0] = 1; - triangle[1] = 0; - triangle[2] = 2; - - ndVector e30(points[0] - points[1]); - normal = e30.CrossProduct(e10); - normal = normal.Normalize(); - t = ray.PolygonIntersect(normal, maxT, &points[0].m_x, sizeof(ndVector), triangle, 3); - if (t < maxT) - { - normalOut = normal; - return t; - } - } - else - { - triangle[0] = 0; - triangle[1] = 2; - triangle[2] = 3; - - ndVector e10(points[2] - points[0]); - ndVector e20(points[3] - points[0]); - ndVector normal(e10.CrossProduct(e20)); - normal = normal.Normalize(); - t = ray.PolygonIntersect(normal, maxT, &points[0].m_x, sizeof(ndVector), triangle, 3); - if (t < maxT) - { - normalOut = normal; - return t; - } - - triangle[0] = 0; - triangle[1] = 3; - triangle[2] = 1; - - ndVector e30(points[1] - points[0]); - normal = e20.CrossProduct(e30); - normal = normal.Normalize(); - t = ray.PolygonIntersect(normal, maxT, &points[0].m_x, sizeof(ndVector), triangle, 3); - if (t < maxT) - { - normalOut = normal; - return t; - } - } - return t; -} - -ndFloat32 ndShapeHeightfield::RayCast(ndRayCastNotify&, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const, ndContactPoint& contactOut) const -{ - ndVector boxP0; - ndVector boxP1; - - // calculate the ray bounding box - CalculateMinExtend2d(localP0, localP1, boxP0, boxP1); - - ndVector p0(localP0); - ndVector p1(localP1); - - // clip the line against the bounding box - if (ndRayBoxClip(p0, p1, boxP0, boxP1)) - { - ndVector dp(p1 - p0); - ndVector normalOut(ndVector::m_zero); - - ndFloat32 scale_x = m_horizontalScale_x; - ndFloat32 invScale_x = m_horizontalScaleInv_x; - ndFloat32 scale_z = m_horizontalScale_z; - ndFloat32 invScale_z = m_horizontalScaleInv_z; - ndInt32 ix0 = FastInt(p0.m_x * invScale_x); - ndInt32 iz0 = FastInt(p0.m_z * invScale_z); - - // implement a 3ddda line algorithm - ndInt32 xInc; - ndFloat32 tx; - ndFloat32 stepX; - if (dp.m_x > ndFloat32(0.0f)) - { - xInc = 1; - ndFloat32 val = ndFloat32(1.0f) / dp.m_x; - stepX = scale_x * val; - tx = (scale_x * ((ndFloat32)ix0 + ndFloat32(1.0f)) - p0.m_x) * val; - } - else if (dp.m_x < ndFloat32(0.0f)) - { - xInc = -1; - ndFloat32 val = -ndFloat32(1.0f) / dp.m_x; - stepX = scale_x * val; - tx = -(scale_x * (ndFloat32)ix0 - p0.m_x) * val; - } - else - { - xInc = 0; - stepX = ndFloat32(0.0f); - tx = ndFloat32(1.0e10f); - } - - ndInt32 zInc; - ndFloat32 tz; - ndFloat32 stepZ; - if (dp.m_z > ndFloat32(0.0f)) - { - zInc = 1; - ndFloat32 val = ndFloat32(1.0f) / dp.m_z; - stepZ = scale_z * val; - tz = (scale_z * ((ndFloat32)iz0 + ndFloat32(1.0f)) - p0.m_z) * val; - } - else if (dp.m_z < ndFloat32(0.0f)) - { - zInc = -1; - ndFloat32 val = -ndFloat32(1.0f) / dp.m_z; - stepZ = scale_z * val; - tz = -(scale_z * (ndFloat32)iz0 - p0.m_z) * val; - } - else - { - zInc = 0; - stepZ = ndFloat32(0.0f); - tz = ndFloat32(1.0e10f); - } - - ndFloat32 txAcc = tx; - ndFloat32 tzAcc = tz; - ndInt32 xIndex0 = ix0; - ndInt32 zIndex0 = iz0; - ndFastRay ray(localP0, localP1); - - // for each cell touched by the line - do - { - ndFloat32 t = RayCastCell(ray, xIndex0, zIndex0, normalOut, maxT); - if (t < maxT) - { - // bail out at the first intersection and copy the data into the descriptor - ndAssert(normalOut.m_w == ndFloat32(0.0f)); - contactOut.m_normal = normalOut.Normalize(); - contactOut.m_shapeId0 = m_attributeMap[zIndex0 * m_width + xIndex0]; - contactOut.m_shapeId1 = m_attributeMap[zIndex0 * m_width + xIndex0]; - - return t; - } - - if (txAcc < tzAcc) - { - xIndex0 += xInc; - tx = txAcc; - txAcc += stepX; - } - else - { - zIndex0 += zInc; - tz = tzAcc; - tzAcc += stepZ; - } - } while ((tx <= ndFloat32(1.0f)) || (tz <= ndFloat32(1.0f))); - } - - // if no cell was hit, return a large value - return ndFloat32(1.2f); -} - -void ndShapeHeightfield::CalculateMinAndMaxElevation(ndInt32 x0, ndInt32 x1, ndInt32 z0, ndInt32 z1, ndFloat32& minHeight, ndFloat32& maxHeight) const -{ - ndReal minVal = ndReal(1.0e10f); - ndReal maxVal = -ndReal(1.0e10f); - - ndInt32 base = z0 * m_width; - for (ndInt32 z = z0; z <= z1; ++z) - { - for (ndInt32 x = x0; x <= x1; ++x) - { - ndReal high = m_elevationMap[base + x]; - minVal = ndMin(high, minVal); - maxVal = ndMax(high, maxVal); - } - base += m_width; - } - - minHeight = minVal; - maxHeight = maxVal; -} - -void ndShapeHeightfield::GetCollidingFaces(ndPolygonMeshDesc* const data) const -{ - ndVector boxP0; - ndVector boxP1; - - // the user data is the pointer to the collision geometry - CalculateMinExtend3d(data->GetOrigin(), data->GetTarget(), boxP0, boxP1); - boxP0 += data->m_boxDistanceTravelInMeshSpace & (data->m_boxDistanceTravelInMeshSpace < ndVector::m_zero); - boxP1 += data->m_boxDistanceTravelInMeshSpace & (data->m_boxDistanceTravelInMeshSpace > ndVector::m_zero); - - boxP0 = boxP0.Select(boxP0.GetMax(m_minBox), m_yMask); - boxP1 = boxP1.Select(boxP1.GetMin(m_maxBox), m_yMask); - - ndVector p0(boxP0.Scale(m_horizontalScaleInv_x).GetInt()); - ndVector p1(boxP1.Scale(m_horizontalScaleInv_x).GetInt()); - - ndAssert(p0.m_ix == FastInt(boxP0.m_x * m_horizontalScaleInv_x)); - ndAssert(p0.m_iz == FastInt(boxP0.m_z * m_horizontalScaleInv_x)); - ndAssert(p1.m_ix == FastInt(boxP1.m_x * m_horizontalScaleInv_x)); - ndAssert(p1.m_iz == FastInt(boxP1.m_z * m_horizontalScaleInv_x)); - - ndInt32 x0 = ndInt32(p0.m_ix); - ndInt32 x1 = ndInt32(p1.m_ix); - ndInt32 z0 = ndInt32(p0.m_iz); - ndInt32 z1 = ndInt32(p1.m_iz); - - if ((x1 == x0) || (z1 == z0)) - { - data->m_staticMeshQuery->m_faceIndexCount.SetCount(0); - return; - } - - ndFloat32 minHeight = ndFloat32(1.0e10f); - ndFloat32 maxHeight = ndFloat32(-1.0e10f); - data->SetSeparatingDistance(ndFloat32(0.0f)); - CalculateMinAndMaxElevation(x0, x1, z0, z1, minHeight, maxHeight); - - if (!((maxHeight < boxP0.m_y) || (minHeight > boxP1.m_y))) - { - ndPolygonMeshDesc::ndStaticMeshFaceQuery& query = *data->m_staticMeshQuery; - ndArray& vertex = data->m_proceduralStaticMeshFaceQuery->m_vertex; - - // scan the vertices's intersected by the box extend - ndInt32 vertexCount = (z1 - z0 + 1) * (x1 - x0 + 1) + 2 * (z1 - z0) * (x1 - x0); - vertex.SetCount(vertexCount); - - ndInt32 vertexIndex = 0; - ndInt32 base = z0 * m_width; - for (ndInt32 z = z0; z <= z1; ++z) - { - ndFloat32 zVal = m_horizontalScale_z * (ndFloat32)z; - for (ndInt32 x = x0; x <= x1; ++x) - { - vertex[vertexIndex] = ndVector(m_horizontalScale_x * (ndFloat32)x, ndFloat32(m_elevationMap[base + x]), zVal, ndFloat32(0.0f)); - vertexIndex++; - ndAssert(vertexIndex <= vertex.GetCount()); - } - base += m_width; - } - - ndInt32 normalBase = vertexIndex; - vertexIndex = 0; - ndInt32 quadCount = 0; - ndInt32 step = x1 - x0 + 1; - - ndArray& quadDataArray = query.m_faceVertexIndex; - ndArray& faceIndexCount = query.m_faceIndexCount; - ndFloat32 maxDiagonal = ndMax(m_horizontalScale_x, m_horizontalScale_z) * ndFloat32(2.0f); - ndInt32 faceSize = ndInt32(ndFloor(maxDiagonal / D_FACE_CLIP_DIAGONAL_SCALE + ndFloat32(1.0f))); - const ndInt32* const indirectIndex = GetIndexList(); - - quadDataArray.SetCount(2 * (x1 - x0) * (z1 - z0) * ndInt32(sizeof(ndGridQuad) / sizeof(ndInt32))); - if (quadDataArray.GetCount()) - { - ndGridQuad* const quadArray = (ndGridQuad*)&quadDataArray[0]; - for (ndInt32 z = z0; z < z1; ++z) - { - ndInt32 zStep = z * m_width; - for (ndInt32 x = x0; x < x1; ++x) - { - ndInt32 vIndex[4]; - vIndex[0] = vertexIndex; - vIndex[1] = vertexIndex + 1; - vIndex[2] = vertexIndex + step; - vIndex[3] = vertexIndex + step + 1; - - const ndInt32 i0 = vIndex[indirectIndex[0]]; - const ndInt32 i1 = vIndex[indirectIndex[1]]; - const ndInt32 i2 = vIndex[indirectIndex[2]]; - const ndInt32 i3 = vIndex[indirectIndex[3]]; - - const ndVector e0(vertex[i0] - vertex[i1]); - const ndVector e1(vertex[i2] - vertex[i1]); - const ndVector e2(vertex[i3] - vertex[i1]); - ndVector n0(e0.CrossProduct(e1)); - ndVector n1(e1.CrossProduct(e2)); - ndAssert(n0.m_w == ndFloat32(0.0f)); - ndAssert(n1.m_w == ndFloat32(0.0f)); - - ndAssert(n0.DotProduct(n0).GetScalar() > ndFloat32(0.0f)); - ndAssert(n1.DotProduct(n1).GetScalar() > ndFloat32(0.0f)); - - //normalBase - const ndInt32 normalIndex0 = normalBase; - const ndInt32 normalIndex1 = normalBase + 1; - - n0 = n0.Normalize(); - n1 = n1.Normalize(); - vertex[normalIndex0] = n0; - vertex[normalIndex1] = n1; - - ndGridQuad& quad = quadArray[quadCount]; - - faceIndexCount.PushBack(3); - quad.m_triangle0.m_i0 = i2; - quad.m_triangle0.m_i1 = i1; - quad.m_triangle0.m_i2 = i0; - quad.m_triangle0.m_material = m_attributeMap[zStep + x]; - quad.m_triangle0.m_normal = normalIndex0; - quad.m_triangle0.m_normal_edge01 = normalIndex0; - quad.m_triangle0.m_normal_edge12 = normalIndex0; - quad.m_triangle0.m_normal_edge20 = normalIndex0; - quad.m_triangle0.m_area = faceSize; - - faceIndexCount.PushBack(3); - quad.m_triangle1.m_i0 = i1; - quad.m_triangle1.m_i1 = i2; - quad.m_triangle1.m_i2 = i3; - quad.m_triangle1.m_material = m_attributeMap[zStep + x]; - quad.m_triangle1.m_normal = normalIndex1; - quad.m_triangle1.m_normal_edge01 = normalIndex1; - quad.m_triangle1.m_normal_edge12 = normalIndex1; - quad.m_triangle1.m_normal_edge20 = normalIndex1; - quad.m_triangle1.m_area = faceSize; - - ndVector dp(vertex[i3] - vertex[i1]); - ndAssert(dp.m_w == ndFloat32(0.0f)); - ndFloat32 dist = n0.DotProduct(dp).GetScalar(); - if (dist < -ndFloat32(1.0e-3f)) - { - quad.m_triangle0.m_normal_edge01 = normalIndex1; - quad.m_triangle1.m_normal_edge01 = normalIndex0; - } - - normalBase += 2; - quadCount++; - vertexIndex++; - } - vertexIndex++; - } - - if (m_diagonalMode == m_invertedDiagonals) - { - for (ndInt32 z = (z1 - z0) - 1; z >= 0; --z) - { - ndInt32 z_step = z * (x1 - x0); - for (ndInt32 x = (x1 - x0) - 1; x >= 1; --x) - { - ndInt32 quadIndex = z_step + x; - ndGridQuad& quad0 = quadArray[quadIndex - 1]; - ndGridQuad& quad1 = quadArray[quadIndex - 0]; - - ndTriangle& triangle0 = quad0.m_triangle0; - ndTriangle& triangle1 = quad1.m_triangle1; - - const ndVector& origin = vertex[triangle1.m_i1]; - const ndVector& testPoint = vertex[triangle1.m_i0]; - const ndVector& normal = vertex[triangle0.m_normal]; - ndAssert(normal.m_w == ndFloat32(0.0f)); - ndFloat32 dist(normal.DotProduct(testPoint - origin).GetScalar()); - if (dist < -ndFloat32(1.0e-3f)) - { - ndInt32 n0 = triangle0.m_normal; - ndInt32 n1 = triangle1.m_normal; - triangle0.m_normal_edge12 = n1; - triangle1.m_normal_edge12 = n0; - } - } - } - - for (ndInt32 x = (x1 - x0) - 1; x >= 0; --x) - { - ndInt32 x_step = x1 - x0; - for (ndInt32 z = (z1 - z0) - 1; z >= 1; --z) - { - ndInt32 quadIndex = x_step * z + x; - - ndGridQuad& quad0 = quadArray[quadIndex - x_step]; - ndGridQuad& quad1 = quadArray[quadIndex]; - - ndTriangle& triangle0 = quad0.m_triangle1; - ndTriangle& triangle1 = quad1.m_triangle0; - - const ndVector& origin = vertex[triangle1.m_i0]; - const ndVector& testPoint = vertex[triangle1.m_i1]; - const ndVector& normal = vertex[triangle0.m_normal]; - ndAssert(normal.m_w == ndFloat32(0.0f)); - ndFloat32 dist(normal.DotProduct(testPoint - origin).GetScalar()); - if (dist < -ndFloat32(1.0e-3f)) - { - ndInt32 n0 = triangle0.m_normal; - ndInt32 n1 = triangle1.m_normal; - triangle0.m_normal_edge20 = n1; - triangle1.m_normal_edge20 = n0; - } - - } - } - } - else - { - for (ndInt32 z = (z1 - z0) - 1; z >= 0; --z) - { - ndInt32 z_step = z * (x1 - x0); - for (ndInt32 x = (x1 - x0) - 1; x >= 1; --x) - { - ndInt32 quadIndex = z_step + x; - ndGridQuad& quad0 = quadArray[quadIndex - 1]; - ndGridQuad& quad1 = quadArray[quadIndex - 0]; - - ndTriangle& triangle0 = quad0.m_triangle1; - ndTriangle& triangle1 = quad1.m_triangle0; - - const ndVector& origin = vertex[triangle1.m_i0]; - const ndVector& testPoint = vertex[triangle1.m_i1]; - const ndVector& normal = vertex[triangle0.m_normal]; - ndAssert(normal.m_w == ndFloat32(0.0f)); - ndFloat32 dist(normal.DotProduct(testPoint - origin).GetScalar()); - if (dist < -ndFloat32(1.0e-3f)) - { - ndInt32 n0 = triangle0.m_normal; - ndInt32 n1 = triangle1.m_normal; - triangle0.m_normal_edge20 = n1; - triangle1.m_normal_edge20 = n0; - } - } - } - - for (ndInt32 x = (x1 - x0) - 1; x >= 0; --x) - { - ndInt32 x_step = x1 - x0; - for (ndInt32 z = (z1 - z0) - 1; z >= 1; --z) - { - ndInt32 quadIndex = x_step * z + x; - - ndGridQuad& quad0 = quadArray[quadIndex - x_step]; - ndGridQuad& quad1 = quadArray[quadIndex]; - - ndTriangle& triangle0 = quad0.m_triangle1; - ndTriangle& triangle1 = quad1.m_triangle0; - - const ndVector& origin = vertex[triangle1.m_i1]; - const ndVector& testPoint = vertex[triangle1.m_i0]; - const ndVector& normal = vertex[triangle0.m_normal]; - ndAssert(normal.m_w == ndFloat32(0.0f)); - ndFloat32 dist(normal.DotProduct(testPoint - origin).GetScalar()); - if (dist < -ndFloat32(1.0e-3f)) - { - ndInt32 n0 = triangle0.m_normal; - ndInt32 n1 = triangle1.m_normal; - triangle0.m_normal_edge12 = n1; - triangle1.m_normal_edge12 = n0; - } - } - } - } - } - - ndInt32 stride = sizeof(ndVector) / sizeof(ndFloat32); - ndInt32 faceCount0 = 0; - ndInt32 faceIndexCount0 = 0; - ndInt32 faceIndexCount1 = 0; - - ndArray& address = query.m_faceIndexStart; - ndArray& hitDistance = query.m_hitDistance; - - if (data->m_doContinueCollisionTest) - { - //ndAssert(0); - ndInt32* const indices = &quadDataArray[0]; - ndFastRay ray(ndVector::m_zero, data->m_boxDistanceTravelInMeshSpace); - for (ndInt32 i = 0; i < quadCount * 2; ++i) - { - const ndInt32* const indexArray = &indices[faceIndexCount1]; - const ndVector& faceNormal = vertex[indexArray[4]]; - ndFloat32 dist = data->PolygonBoxRayDistance(faceNormal, 3, indexArray, stride, &vertex[0].m_x, ray); - if (dist < ndFloat32(1.0f)) - { - hitDistance.PushBack(dist); - address.PushBack(faceIndexCount0); - ndMemCpy(&indices[faceIndexCount0], indexArray, 9); - faceCount0++; - faceIndexCount0 += 9; - } - faceIndexCount1 += 9; - } - } - else - { - ndInt32* const indices = &quadDataArray[0]; - for (ndInt32 i = 0; i < quadCount * 2; ++i) - { - const ndInt32* const indexArray = &indices[faceIndexCount1]; - const ndVector& faceNormal = vertex[indexArray[4]]; - ndFloat32 dist = data->PolygonBoxDistance(faceNormal, 3, indexArray, stride, &vertex[0].m_x); - if (dist > ndFloat32(0.0f)) - { - hitDistance.PushBack(dist); - address.PushBack(faceIndexCount0); - ndMemCpy(&indices[faceIndexCount0], indexArray, 9); - faceCount0++; - faceIndexCount0 += 9; - } - faceIndexCount1 += 9; - } - } - - faceIndexCount.SetCount(faceCount0); - data->m_vertex = &vertex[0].m_x; - data->m_vertexStrideInBytes = sizeof(ndVector); - } -} - -ndUnsigned64 ndShapeHeightfield::GetHash(ndUnsigned64 hash) const -{ - hash = ndCRC64(&m_attributeMap[0], ndInt32(m_attributeMap.GetCount()) * ndInt32(sizeof(ndInt8)), hash); - hash = ndCRC64(&m_elevationMap[0], ndInt32(m_elevationMap.GetCount()) * ndInt32(sizeof(ndReal)), hash); - return hash; -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeHeightfield.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeHeightfield.h deleted file mode 100644 index f59f217362..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeHeightfield.h +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_HEIGHT_FIELD__ -#define __ND_SHAPE_HEIGHT_FIELD__ - -#include "ndCollisionStdafx.h" -#include "ndShapeStaticMesh.h" - -class ndShapeHeightfield: public ndShapeStaticMesh -{ - public: - class ndTriangle - { - public: - ndInt32 m_i0; - ndInt32 m_i1; - ndInt32 m_i2; - ndInt32 m_material; - ndInt32 m_normal; - ndInt32 m_normal_edge01; - ndInt32 m_normal_edge12; - ndInt32 m_normal_edge20; - ndInt32 m_area; - }; - - class ndGridQuad - { - public: - ndTriangle m_triangle0; - ndTriangle m_triangle1; - }; - - enum ndGridConstruction - { - m_normalDiagonals = 0, - m_invertedDiagonals, - }; - - D_CLASS_REFLECTION(ndShapeHeightfield,ndShapeStaticMesh) - D_COLLISION_API ndShapeHeightfield(ndInt32 width, ndInt32 height, ndGridConstruction constructionMode,ndFloat32 horizontalScale_x, ndFloat32 horizontalScale_z); - D_COLLISION_API virtual ~ndShapeHeightfield(); - - D_COLLISION_API ndArray& GetElevationMap(); - D_COLLISION_API const ndArray& GetElevationMap() const; - - D_COLLISION_API ndArray& GetAttributeMap(); - D_COLLISION_API const ndArray& GetAttributeMap() const; - - D_COLLISION_API void UpdateElevationMapAabb(); - D_COLLISION_API void GetLocalAabb(const ndVector& p0, const ndVector& p1, ndVector& boxP0, ndVector& boxP1) const; - - protected: - virtual ndShapeInfo GetShapeInfo() const; - virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; - virtual ndShapeHeightfield* GetAsShapeHeightfield() { return this; } - virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; - - private: - void CalculateLocalObb(); - ndInt32 FastInt(ndFloat32 x) const; - const ndInt32* GetIndexList() const; - void CalculateMinExtend2d(const ndVector& p0, const ndVector& p1, ndVector& boxP0, ndVector& boxP1) const; - void CalculateMinExtend3d(const ndVector& p0, const ndVector& p1, ndVector& boxP0, ndVector& boxP1) const; - ndFloat32 RayCastCell(const ndFastRay& ray, ndInt32 xIndex0, ndInt32 zIndex0, ndVector& normalOut, ndFloat32 maxT) const; - void CalculateMinAndMaxElevation(ndInt32 x0, ndInt32 x1, ndInt32 z0, ndInt32 z1, ndFloat32& minHeight, ndFloat32& maxHeight) const; - - ndVector m_minBox; - ndVector m_maxBox; - ndArray m_attributeMap; - ndArray m_elevationMap; - ndFloat32 m_horizontalScale_x; - ndFloat32 m_horizontalScale_z; - ndFloat32 m_horizontalScaleInv_x; - ndFloat32 m_horizontalScaleInv_z; - ndInt32 m_width; - ndInt32 m_height; - ndGridConstruction m_diagonalMode; - - static ndVector m_yMask; - static ndVector m_padding; - static ndVector m_elevationPadding; - static ndInt32 m_cellIndices[][4]; - - friend class ndContactSolver; -}; - - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeInstance.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeInstance.cpp deleted file mode 100644 index dd91b337cb..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeInstance.cpp +++ /dev/null @@ -1,518 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndScene.h" -#include "ndContact.h" -#include "ndShapeInstance.h" -#include "ndRayCastNotify.h" -#include "ndBodyKinematic.h" -#include "ndShapeCompound.h" - -ndVector ndShapeInstance::m_padding(D_MAX_SHAPE_AABB_PADDING, D_MAX_SHAPE_AABB_PADDING, D_MAX_SHAPE_AABB_PADDING, ndFloat32(0.0f)); - -ndShapeInstance::ndShapeInstance(ndShape* const shape) - :ndContainersFreeListAlloc() - ,m_globalMatrix(ndGetIdentityMatrix()) - ,m_localMatrix(ndGetIdentityMatrix()) - ,m_alignmentMatrix(ndGetIdentityMatrix()) - ,m_scale(ndVector::m_one & ndVector::m_triplexMask) - ,m_invScale(ndVector::m_one & ndVector::m_triplexMask) - ,m_maxScale(ndVector::m_one & ndVector::m_triplexMask) - ,m_shape(shape ? shape->AddRef() : shape) - ,m_ownerBody(nullptr) - ,m_subCollisionHandle(nullptr) - ,m_parent(nullptr) - ,m_skinMargin(ndFloat32(0.0f)) - ,m_scaleType(m_unit) - ,m_collisionMode(true) -{ - if (shape) - { - ndShapeCompound* const compound = shape->GetAsShapeCompound(); - if (compound) - { - compound->SetOwner(this); - } - } -} - -ndShapeInstance::ndShapeInstance(const ndShapeInstance& instance) - :ndContainersFreeListAlloc() - ,m_globalMatrix(instance.m_globalMatrix) - ,m_localMatrix(instance.m_localMatrix) - ,m_alignmentMatrix(instance.m_alignmentMatrix) - ,m_scale(instance.m_scale) - ,m_invScale(instance.m_invScale) - ,m_maxScale(instance.m_maxScale) - ,m_shapeMaterial(instance.m_shapeMaterial) - ,m_shape(instance.m_shape->AddRef()) - ,m_ownerBody(instance.m_ownerBody) - ,m_subCollisionHandle(instance.m_subCollisionHandle) - ,m_parent(instance.m_parent) - ,m_skinMargin(instance.m_skinMargin) - ,m_scaleType(instance.m_scaleType) - ,m_collisionMode(instance.m_collisionMode) -{ - ndShapeCompound* const compound = ((ndShape*)m_shape)->GetAsShapeCompound(); - if (compound) - { - m_shape->Release(); - m_shape = new ndShapeCompound(*compound, this); - m_shape->AddRef(); - } -} - -ndShapeInstance::ndShapeInstance(const ndShapeInstance& instance, ndShape* const shape) - :ndContainersFreeListAlloc() - ,m_globalMatrix(instance.m_globalMatrix) - ,m_localMatrix(instance.m_localMatrix) - ,m_alignmentMatrix(instance.m_alignmentMatrix) - ,m_scale(instance.m_scale) - ,m_invScale(instance.m_invScale) - ,m_maxScale(instance.m_maxScale) - ,m_shapeMaterial(instance.m_shapeMaterial) - ,m_shape(shape->AddRef()) - ,m_ownerBody(instance.m_ownerBody) - ,m_subCollisionHandle(instance.m_subCollisionHandle) - ,m_parent(instance.m_parent) - ,m_skinMargin(instance.m_skinMargin) - ,m_scaleType(instance.m_scaleType) - ,m_collisionMode(instance.m_collisionMode) -{ -} - -ndShapeInstance::~ndShapeInstance() -{ - if (m_shape) - { - m_shape->Release(); - } -} - -void ndShapeInstance::SavePLY(const char* const fileName) const -{ - class ndDrawShape : public ndShapeDebugNotify - { - public: - ndDrawShape() - :ndShapeDebugNotify() - { - } - - virtual void DrawPolygon(ndInt32 vertexCount, const ndVector* const faceVertex, const ndEdgeType* const) - { - m_faceVertexCount.PushBack(vertexCount); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - m_vertex.PushBack(faceVertex[i] & ndVector::m_triplexMask); - } - } - - ndArray m_vertex; - ndArray m_faceVertexCount; - }; - - ndDrawShape drawShapes; - DebugShape(ndGetIdentityMatrix(), drawShapes); - if (drawShapes.m_vertex.GetCount()) - { - FILE* const file = fopen(fileName, "wb"); - fprintf(file, "ply\n"); - fprintf(file, "format ascii 1.0\n"); - - fprintf(file, "element vertex %d\n", ndInt32(drawShapes.m_vertex.GetCount())); - fprintf(file, "property float x\n"); - fprintf(file, "property float y\n"); - fprintf(file, "property float z\n"); - fprintf(file, "element face %d\n", ndInt32(drawShapes.m_faceVertexCount.GetCount())); - fprintf(file, "property list uchar int vertex_index\n"); - fprintf(file, "end_header\n"); - - for (ndInt32 i = 0; i < drawShapes.m_vertex.GetCount(); ++i) - { - const ndVector& point = drawShapes.m_vertex[i]; - fprintf(file, "%f %f %f\n", point.m_x, point.m_y, point.m_z); - } - - ndInt32 index = 0; - for (ndInt32 i = 0; i < drawShapes.m_faceVertexCount.GetCount(); ++i) - { - ndInt32 count = drawShapes.m_faceVertexCount[i]; - fprintf(file, "%d", count); - for (ndInt32 j = 0; j < count; ++j) - { - fprintf(file, " %d", index + j); - } - index += count; - fprintf(file, "\n"); - } - fclose(file); - } -} - -ndShapeInstance& ndShapeInstance::operator=(const ndShapeInstance& instance) -{ - m_globalMatrix = instance.m_globalMatrix; - m_localMatrix = instance.m_localMatrix; - m_alignmentMatrix = instance.m_alignmentMatrix; - m_scale = instance.m_scale; - m_invScale = instance.m_invScale; - m_maxScale = instance.m_maxScale; - m_scaleType = instance.m_scaleType; - m_shapeMaterial = instance.m_shapeMaterial; - m_skinMargin = instance.m_skinMargin; - m_collisionMode = instance.m_collisionMode; - if (m_shape != nullptr) - { - m_shape->Release(); - } - m_shape = instance.m_shape->AddRef(); - m_ownerBody = instance.m_ownerBody; - - m_subCollisionHandle = instance.m_subCollisionHandle; - m_parent = instance.m_parent; - - return *this; -} - -void ndShapeInstance::DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const -{ - debugCallback.m_instance = this; - m_shape->DebugShape(GetScaledTransform(matrix), debugCallback); -} - -ndShapeInfo ndShapeInstance::GetShapeInfo() const -{ - ndShapeInfo info(m_shape->GetShapeInfo()); - info.m_offsetMatrix = m_localMatrix; - info.m_scale = m_scale; - return info; -} - -ndMatrix ndShapeInstance::CalculateInertia() const -{ - ndShape* const shape = (ndShape*)m_shape; - if (shape->GetAsShapeNull() || !(shape->GetAsShapeConvex() || shape->GetAsShapeCompound())) - { - return ndGetZeroMatrix(); - } - else - { - return m_shape->CalculateInertiaAndCenterOfMass(m_alignmentMatrix, m_scale, m_localMatrix); - } -} - -void ndShapeInstance::CalculateObb(ndVector& origin, ndVector& size) const -{ - size = m_shape->GetObbSize(); - origin = m_shape->GetObbOrigin(); - - switch (m_scaleType) - { - case m_unit: - { - size += m_padding; - break; - } - - case m_uniform: - case m_nonUniform: - { - size = size * m_scale + m_padding; - origin = origin * m_scale; - break; - } - case m_global: - { - ndVector p0; - ndVector p1; - m_shape->CalculateAabb(m_alignmentMatrix, p0, p1); - size = (ndVector::m_half * (p1 - p0) * m_scale + m_padding) & ndVector::m_triplexMask; - origin = (ndVector::m_half * (p1 + p0) * m_scale) & ndVector::m_triplexMask;; - break; - } - } - - ndAssert(size.m_w == ndFloat32(0.0f)); - ndAssert(origin.m_w == ndFloat32(0.0f)); -} - -ndFloat32 ndShapeInstance::RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, const ndBody* const body, ndContactPoint& contactOut) const -{ - ndFloat32 t = ndFloat32(1.2f); - if (callback.OnRayPrecastAction(body, this)) - { - switch (m_scaleType) - { - case m_unit: - { - t = m_shape->RayCast(callback, localP0, localP1, ndFloat32(1.0f), body, contactOut); - if (t < ndFloat32 (1.0f)) - { - contactOut.m_shapeInstance0 = this; - contactOut.m_shapeInstance1 = this; - } - break; - } - - case m_uniform: - { - ndVector p0(localP0 * m_invScale); - ndVector p1(localP1 * m_invScale); - t = m_shape->RayCast(callback, p0, p1, ndFloat32(1.0f), body, contactOut); - if (t < ndFloat32(1.0f)) - { - ndAssert(!((ndShape*)m_shape)->GetAsShapeCompound()); - contactOut.m_shapeInstance0 = this; - contactOut.m_shapeInstance1 = this; - } - break; - } - - case m_nonUniform: - { - ndVector p0(localP0 * m_invScale); - ndVector p1(localP1 * m_invScale); - t = m_shape->RayCast(callback, p0, p1, ndFloat32(1.0f), body, contactOut); - if (t < ndFloat32(1.0f)) - { - ndAssert(!((ndShape*)m_shape)->GetAsShapeCompound()); - ndVector normal(m_invScale * contactOut.m_normal); - contactOut.m_normal = normal.Normalize(); - contactOut.m_shapeInstance0 = this; - contactOut.m_shapeInstance1 = this; - } - break; - } - - case m_global: - default: - { - ndVector p0(m_alignmentMatrix.UntransformVector(localP0 * m_invScale)); - ndVector p1(m_alignmentMatrix.UntransformVector(localP1 * m_invScale)); - t = m_shape->RayCast(callback, p0, p1, ndFloat32(1.0f), body, contactOut); - if (t < ndFloat32(1.0f)) - { - ndAssert(!((ndShape*)m_shape)->GetAsShapeCompound()); - ndVector normal(m_alignmentMatrix.RotateVector(m_invScale * contactOut.m_normal)); - contactOut.m_normal = normal.Normalize(); - contactOut.m_shapeInstance0 = this; - contactOut.m_shapeInstance1 = this; - } - break; - } - } - } - return t; -} - -ndInt32 ndShapeInstance::CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const -{ - ndInt32 count = 0; - ndAssert(normal.m_w == ndFloat32(0.0f)); - switch (m_scaleType) - { - case m_unit: - { - count = m_shape->CalculatePlaneIntersection(normal, point, contactsOut); - break; - } - case m_uniform: - { - ndVector point1(m_invScale * point); - count = m_shape->CalculatePlaneIntersection(normal, point1, contactsOut); - for (ndInt32 i = 0; i < count; ++i) - { - contactsOut[i] = m_scale * contactsOut[i]; - } - break; - } - - case m_nonUniform: - { - // support((p * S), n) = S * support (p, n * transp(S)) - ndVector point1(m_invScale * point); - ndVector normal1(m_scale * normal); - normal1 = normal1.Normalize(); - count = m_shape->CalculatePlaneIntersection(normal1, point1, contactsOut); - for (ndInt32 i = 0; i < count; ++i) - { - contactsOut[i] = m_scale * contactsOut[i]; - } - break; - } - - case m_global: - default: - { - ndVector point1(m_alignmentMatrix.UntransformVector(m_invScale * point)); - //ndVector normal1(m_alignmentMatrix.UntransformVector(m_scale * normal)); - ndVector normal1(m_alignmentMatrix.UnrotateVector(m_scale * normal)); - normal1 = normal1.Normalize(); - count = m_shape->CalculatePlaneIntersection(normal1, point1, contactsOut); - for (ndInt32 i = 0; i < count; ++i) - { - contactsOut[i] = m_scale * m_alignmentMatrix.TransformVector(contactsOut[i]); - } - } - } - return count; -} - -void ndShapeInstance::SetScale(const ndVector& scale) -{ - ndFloat32 scaleX = ndAbs(scale.m_x); - ndFloat32 scaleY = ndAbs(scale.m_y); - ndFloat32 scaleZ = ndAbs(scale.m_z); - ndAssert(scaleX > ndFloat32(0.0f)); - ndAssert(scaleY > ndFloat32(0.0f)); - ndAssert(scaleZ > ndFloat32(0.0f)); - - if (((ndShape*)m_shape)->GetAsShapeCompound()) - { - ndAssert(m_scaleType == m_unit); - ndShapeCompound* const compound = ((ndShape*)m_shape)->GetAsShapeCompound(); - compound->ApplyScale(scale); - } - else if ((ndAbs(scaleX - scaleY) < ndFloat32(1.0e-4f)) && (ndAbs(scaleX - scaleZ) < ndFloat32(1.0e-4f))) - { - if ((ndAbs(scaleX - ndFloat32(1.0f)) < ndFloat32(1.0e-4f))) - { - m_scaleType = m_unit; - m_scale = ndVector(ndFloat32(1.0f), ndFloat32(1.0f), ndFloat32(1.0f), ndFloat32(0.0f)); - m_maxScale = m_scale; - m_invScale = m_scale; - } - else - { - m_scaleType = m_uniform; - m_scale = ndVector(scaleX, scaleX, scaleX, ndFloat32(0.0f)); - m_maxScale = m_scale; - m_invScale = ndVector(ndFloat32(1.0f) / scaleX, ndFloat32(1.0f) / scaleX, ndFloat32(1.0f) / scaleX, ndFloat32(0.0f)); - } - } - else - { - m_scaleType = m_nonUniform; - m_maxScale = ndMax(ndMax(scaleX, scaleY), scaleZ); - m_scale = ndVector(scaleX, scaleY, scaleZ, ndFloat32(0.0f)); - m_invScale = ndVector(ndFloat32(1.0f) / scaleX, ndFloat32(1.0f) / scaleY, ndFloat32(1.0f) / scaleZ, ndFloat32(0.0f)); - } -} - -void ndShapeInstance::SetGlobalScale(const ndMatrix& scaleMatrix) -{ - const ndMatrix matrix(scaleMatrix * m_localMatrix); - - ndVector scale; - matrix.PolarDecomposition(m_localMatrix, scale, m_alignmentMatrix); - bool uniform = (ndAbs(scale[0] - scale[1]) < ndFloat32(1.0e-4f)) && (ndAbs(scale[0] - scale[2]) < ndFloat32(1.0e-4f)); - if (uniform) - { - SetScale(scale); - } - else - { - bool isIdentity = m_alignmentMatrix.TestIdentity(); - m_scaleType = isIdentity ? m_nonUniform : m_global; - m_scale = scale; - m_invScale = ndVector(ndFloat32(1.0f) / m_scale[0], ndFloat32(1.0f) / m_scale[1], ndFloat32(1.0f) / m_scale[2], ndFloat32(0.0f)); - } -} - -void ndShapeInstance::SetGlobalScale(const ndVector& scale) -{ - ndMatrix matrix(ndGetIdentityMatrix()); - matrix[0][0] = scale.m_x; - matrix[1][1] = scale.m_y; - matrix[2][2] = scale.m_z; - SetGlobalScale(matrix); -} - -ndFloat32 ndShapeInstance::CalculateBuoyancyCenterOfPresure(ndVector& com, const ndMatrix& matrix, const ndVector& fluidPlane) const -{ - com = m_shape->CalculateVolumeIntegral(m_localMatrix * matrix, fluidPlane, *this); - ndFloat32 volume = com.m_w; - com.m_w = ndFloat32(0.0f); - return volume; -} - -ndFloat32 ndShapeInstance::GetBoxPadding() -{ - return m_padding.m_x; -} - -bool ndShapeInstance::ndDistanceCalculator::ClosestPoint() -{ - ndContact contact; - ndBodyKinematic body0; - ndBodyKinematic body1; - - body0.SetCollisionShape(*m_shape0); - body1.SetCollisionShape(*m_shape1); - - ndMatrix matrix0(m_matrix0); - ndMatrix matrix1(m_matrix1); - - matrix0.m_posit = ndVector::m_wOne; - matrix1.m_posit = (m_matrix1.m_posit - m_matrix0.m_posit) | ndVector::m_wOne; - - body0.SetMatrix(matrix0); - body1.SetMatrix(matrix1); - body0.SetMassMatrix(ndVector::m_one); - contact.SetBodies(&body0, &body1); - - ndShapeInstance& shape0 = body0.GetCollisionShape(); - ndShapeInstance& shape1 = body1.GetCollisionShape(); - shape0.SetGlobalMatrix(shape0.GetLocalMatrix() * body0.GetMatrix()); - shape1.SetGlobalMatrix(shape1.GetLocalMatrix() * body1.GetMatrix()); - - ndContactSolver solver(&contact, m_scene->GetContactNotify(), m_scene->GetTimestep(), 0); - bool ret = solver.CalculateClosestPoints(); - - m_normal = solver.m_separatingVector; - m_point0 = solver.m_closestPoint0 + m_matrix0.m_posit; - m_point1 = solver.m_closestPoint1 + m_matrix0.m_posit; - m_point0.m_w = ndFloat32(1.0f); - m_point1.m_w = ndFloat32(1.0f); - return ret; -} - -void ndShapeInstance::CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const -{ - ndMatrix scaleMatrix; - scaleMatrix[0] = matrix[0].Scale(m_scale.m_x); - scaleMatrix[1] = matrix[1].Scale(m_scale.m_y); - scaleMatrix[2] = matrix[2].Scale(m_scale.m_z); - scaleMatrix[3] = matrix[3]; - scaleMatrix = m_alignmentMatrix * scaleMatrix; - - const ndVector size0(m_shape->GetObbSize()); - const ndVector origin(scaleMatrix.TransformVector(m_shape->GetObbOrigin())); - const ndVector size(scaleMatrix.m_front.Abs().Scale(size0.m_x) + scaleMatrix.m_up.Abs().Scale(size0.m_y) + scaleMatrix.m_right.Abs().Scale(size0.m_z)); - - p0 = (origin - size - m_padding) & ndVector::m_triplexMask; - p1 = (origin + size + m_padding) & ndVector::m_triplexMask; - ndAssert(p0.m_w == ndFloat32(0.0f)); - ndAssert(p1.m_w == ndFloat32(0.0f)); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeInstance.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeInstance.h deleted file mode 100644 index 71104bcef2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeInstance.h +++ /dev/null @@ -1,418 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_INSTANCE_H__ -#define __ND_SHAPE_INSTANCE_H__ - -#define D_MAX_SHAPE_AABB_PADDING ndFloat32 (1.0f / 16.0f) - -#include "ndShape.h" - -class ndBody; -class ndScene; -class ndShapeInfo; -class ndContactPoint; -class ndShapeInstance; -class ndRayCastNotify; - -D_MSV_NEWTON_ALIGN_32 -class ndShapeDebugNotify : public ndClassAlloc -{ - public: - enum ndEdgeType - { - m_shared, - m_open, - }; - - ndShapeDebugNotify() - :m_instance(nullptr) - { - } - - virtual ~ndShapeDebugNotify() - { - } - - virtual void DrawPolygon(ndInt32 vertexCount, const ndVector* const faceArray, const ndEdgeType* const edgeType) = 0; - - const ndShapeInstance* m_instance; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndShapeInstance: public ndContainersFreeListAlloc -{ - public: - class ndDistanceCalculator - { - public: - ndDistanceCalculator(ndScene* const scene) - { - m_scene = scene; - } - - ndDistanceCalculator(ndScene* const scene, - ndShapeInstance* const shape0, const ndMatrix& matrix0, - ndShapeInstance* const shape1, const ndMatrix& matrix1) - :m_matrix0(matrix0) - ,m_matrix1(matrix1) - ,m_point0(ndVector::m_wOne) - ,m_point1(ndVector::m_wOne) - ,m_normal(ndVector::m_zero) - ,m_scene(scene) - ,m_shape0(shape0) - ,m_shape1(shape1) - { - } - - D_COLLISION_API bool ClosestPoint(); - - ndMatrix m_matrix0; - ndMatrix m_matrix1; - ndVector m_point0; - ndVector m_point1; - ndVector m_normal; - ndScene* m_scene; - ndShapeInstance* m_shape0; - ndShapeInstance* m_shape1; - }; - - enum ndScaleType - { - m_unit, - m_uniform, - m_nonUniform, - m_global, - }; - - D_COLLISION_API ndShapeInstance(ndShape* const shape); - D_COLLISION_API ndShapeInstance(const ndShapeInstance& instance); - D_COLLISION_API ndShapeInstance(const ndShapeInstance& instance, ndShape* const shape); - D_COLLISION_API ~ndShapeInstance(); - - D_COLLISION_API ndShapeInstance& operator=(const ndShapeInstance& src); - - D_COLLISION_API ndMatrix CalculateInertia() const; - D_COLLISION_API void CalculateObb(ndVector& origin, ndVector& size) const; - D_COLLISION_API void CalculateAabb(const ndMatrix& matrix, ndVector& minP, ndVector& maxP) const; - D_COLLISION_API void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - D_COLLISION_API ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, const ndBody* const body, ndContactPoint& contactOut) const; - - //D_COLLISION_API ndInt32 ClosestPoint(const ndMatrix& matrix, const ndVector& point, ndVector& contactPoint) const; - - D_COLLISION_API ndShapeInfo GetShapeInfo() const; - D_COLLISION_API ndFloat32 CalculateBuoyancyCenterOfPresure(ndVector& com, const ndMatrix& matrix, const ndVector& fluidPlane) const; - - D_COLLISION_API static ndFloat32 GetBoxPadding(); - - D_COLLISION_API void SavePLY(const char* const fileName) const; - - const char* ClassName() const; - static const char* StaticClassName(); - const char* SuperClassName() const; - - ndShape* GetShape(); - const ndShape* GetShape() const; - void SetShape(ndShape* const shape); - ndVector SupportVertex(const ndVector& dir) const; - ndMatrix GetScaledTransform(const ndMatrix& matrix) const; - ndVector SupportVertexSpecial(const ndVector& dir) const; - ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - - const ndMatrix& GetLocalMatrix() const; - void SetLocalMatrix(const ndMatrix& matrix); - - const ndMatrix& GetGlobalMatrix() const; - void SetGlobalMatrix(const ndMatrix& scale); - - bool GetCollisionMode() const; - void SetCollisionMode(bool mode); - ndInt32 GetConvexVertexCount() const; - - ndShapeMaterial GetMaterial() const; - void SetMaterial(const ndShapeMaterial& material); - - const ndVector& GetScale() const; - const ndVector& GetInvScale() const; - const ndMatrix& GetAlignmentMatrix() const; - - D_COLLISION_API void SetScale(const ndVector& scale); - D_COLLISION_API void SetGlobalScale(const ndVector& scale); - D_COLLISION_API void SetGlobalScale(const ndMatrix& scaleMatrix); - D_COLLISION_API ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - - ndFloat32 GetVolume() const; - ndFloat32 GetBoxMinRadius() const; - ndFloat32 GetBoxMaxRadius() const; - - ndScaleType GetScaleType() const; - ndFloat32 GetUmbraClipSize() const; - ndUnsigned64 GetUserDataID() const; - - ndMatrix m_globalMatrix; - ndMatrix m_localMatrix; - ndMatrix m_alignmentMatrix; - ndVector m_scale; - ndVector m_invScale; - ndVector m_maxScale; - - ndShapeMaterial m_shapeMaterial; - const ndShape* m_shape; - const ndBody* m_ownerBody; - const void* m_subCollisionHandle; - const ndShapeInstance* m_parent; - ndFloat32 m_skinMargin; - ndScaleType m_scaleType; - bool m_collisionMode; - - private: - static ndVector m_padding; -} D_GCC_NEWTON_ALIGN_32 ; - -inline ndShape* ndShapeInstance::GetShape() -{ - return (ndShape*)m_shape; -} - -inline const ndShape* ndShapeInstance::GetShape() const -{ - return m_shape; -} - -inline const ndMatrix& ndShapeInstance::GetAlignmentMatrix() const -{ - return m_alignmentMatrix; -} - -inline const ndMatrix& ndShapeInstance::GetLocalMatrix() const -{ - return m_localMatrix; -} - -inline void ndShapeInstance::SetLocalMatrix(const ndMatrix& matrix) -{ - m_localMatrix = matrix; -} - -inline const ndMatrix& ndShapeInstance::GetGlobalMatrix() const -{ - return m_globalMatrix; -} - -inline void ndShapeInstance::SetGlobalMatrix(const ndMatrix& matrix) -{ - m_globalMatrix = matrix; -} - -inline ndMatrix ndShapeInstance::GetScaledTransform(const ndMatrix& matrix) const -{ - ndMatrix scale(ndGetIdentityMatrix()); - scale[0][0] = m_scale.m_x; - scale[1][1] = m_scale.m_y; - scale[2][2] = m_scale.m_z; - return m_alignmentMatrix * scale * m_localMatrix * matrix; -} - -inline ndInt32 ndShapeInstance::GetConvexVertexCount() const -{ - return m_shape->GetConvexVertexCount(); -} - -inline ndVector ndShapeInstance::SupportVertex(const ndVector& inDir) const -{ - const ndVector dir(inDir & ndVector::m_triplexMask); - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-2f)); - switch (m_scaleType) - { - case m_unit: - { - return m_shape->SupportVertex(dir); - } - case m_uniform: - { - return m_scale * m_shape->SupportVertex(dir); - } - case m_nonUniform: - { - // support((p * S), n) = S * support (p, n * transp(S)) - const ndVector dir1((m_scale * dir).Normalize()); - return m_scale * m_shape->SupportVertex(dir1); - } - - case m_global: - default: - { - const ndVector dir1(m_alignmentMatrix.UnrotateVector((m_scale * dir).Normalize())); - return m_scale * m_alignmentMatrix.TransformVector(m_shape->SupportVertex(dir1)); - } - } -} - -inline ndVector ndShapeInstance::SupportVertexSpecial(const ndVector& inDir) const -{ - const ndVector dir(inDir & ndVector::m_triplexMask); - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-2f)); - switch (m_scaleType) - { - case m_unit: - { - return m_shape->SupportVertexSpecial(dir, m_skinMargin); - } - case m_uniform: - { - return m_scale * m_shape->SupportVertexSpecial(dir, m_skinMargin); - } - - case m_global: - case m_nonUniform: - default: - return SupportVertex(dir); - } -} - -inline ndVector ndShapeInstance::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& inDir) const -{ - const ndVector dir(inDir & ndVector::m_triplexMask); - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-2f)); - switch (m_scaleType) - { - case m_unit: - { - return m_shape->SupportVertexSpecialProjectPoint(point, dir); - } - case m_uniform: - { - return m_scale * m_shape->SupportVertexSpecialProjectPoint(point * m_invScale, dir); - } - - case m_global: - case m_nonUniform: - default: - return point; - -#if 0 - case m_nonUniform: - { - // support((p * S), n) = S * support (p/S, n * transp(S)) - dVector dir1((m_scale * dir).Normalize()); - return m_scale * m_shape->SupportVertexSpecialProjectPoint(point * m_invScale, dir1); - } - - case m_global: - default: - { - dVector dir1(m_alignmentMatrix.UnrotateVector((m_scale * dir).Normalize())); - return m_scale * m_alignmentMatrix.TransformVector(m_shape->SupportVertexSpecialProjectPoint(m_alignmentMatrix.UntransformVector(point * m_invScale), dir1)); - } -#endif - } -} - -inline bool ndShapeInstance::GetCollisionMode() const -{ - return m_collisionMode; -} - -inline void ndShapeInstance::SetCollisionMode(bool mode) -{ - m_collisionMode = mode; -} - -inline const ndVector& ndShapeInstance::GetScale() const -{ - return m_scale; -} - -inline const ndVector& ndShapeInstance::GetInvScale() const -{ - return m_invScale; -} - -inline ndFloat32 ndShapeInstance::GetBoxMinRadius() const -{ - return m_shape->GetBoxMinRadius() * m_maxScale.m_x; -} - -inline ndFloat32 ndShapeInstance::GetBoxMaxRadius() const -{ - return m_shape->GetBoxMaxRadius() * m_maxScale.m_x; -} - -inline ndFloat32 ndShapeInstance::GetVolume() const -{ - return m_shape->GetVolume() * m_scale.m_x * m_scale.m_y * m_scale.m_z; -} - -inline ndShapeMaterial ndShapeInstance::GetMaterial() const -{ - return m_shapeMaterial; -} - -inline void ndShapeInstance::SetMaterial(const ndShapeMaterial& material) -{ - m_shapeMaterial = material; -} - -inline ndShapeInstance::ndScaleType ndShapeInstance::GetScaleType() const -{ - return m_scaleType; -} - -inline ndFloat32 ndShapeInstance::GetUmbraClipSize() const -{ - return m_shape->GetUmbraClipSize() * m_maxScale.m_x; -} - -inline ndUnsigned64 ndShapeInstance::GetUserDataID() const -{ - return ndUnsigned64 (m_shapeMaterial.m_userId); -} - -inline void ndShapeInstance::SetShape(ndShape* const shape) -{ - if (m_shape) - { - m_shape->Release(); - } - m_shape = shape ? shape->AddRef() : shape; -} - -inline const char* ndShapeInstance::ClassName() const -{ - return "ndShapeInstance"; -} - -inline const char* ndShapeInstance::StaticClassName() -{ - return "ndShapeInstance"; -} - -inline const char* ndShapeInstance::SuperClassName() const -{ - return "ndShapeInstance"; -} - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeNull.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeNull.cpp deleted file mode 100644 index fa4c0e2668..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeNull.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndShapeNull.h" - -ndShapeNull::ndShapeNull() - :ndShape(m_nullCollision) -{ - m_inertia = ndVector::m_one | ndVector::m_triplexMask; -} - -ndShapeNull::~ndShapeNull() -{ -} - -ndShapeNull* ndShapeNull::GetAsShapeNull() -{ - return this; -} - -ndVector ndShapeNull::SupportVertex(const ndVector&) const -{ - return ndVector::m_zero; -} - -ndVector ndShapeNull::SupportVertexSpecial(const ndVector&, ndFloat32) const -{ - return ndVector::m_zero; -} - -ndFloat32 ndShapeNull::RayCast(ndRayCastNotify&, const ndVector&, const ndVector&, ndFloat32, const ndBody* const, ndContactPoint&) const -{ - return ndFloat32(1.2f); -} - -void ndShapeNull::DebugShape(const ndMatrix&, ndShapeDebugNotify&) const -{ -} - -void ndShapeNull::CalculateAabb(const ndMatrix&, ndVector& p0, ndVector& p1) const -{ - p0 = ndVector::m_zero; - p1 = ndVector::m_zero; -} - -ndShapeInfo ndShapeNull::GetShapeInfo() const -{ - ndAssert(0); - ndShapeInfo info; - return info; -} - -ndFloat32 ndShapeNull::GetVolume() const -{ - return ndFloat32(0.0f); -} - -ndFloat32 ndShapeNull::GetBoxMinRadius() const -{ - return ndFloat32(0.0f); -} - -ndFloat32 ndShapeNull::GetBoxMaxRadius() const -{ - return ndFloat32(0.0f); -} - -ndVector ndShapeNull::CalculateVolumeIntegral(const ndMatrix&, const ndVector&, const ndShapeInstance&) const -{ - return ndVector::m_zero; -} - -ndVector ndShapeNull::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector&) const -{ - return point; -} - -ndInt32 ndShapeNull::CalculatePlaneIntersection(const ndVector&, const ndVector&, ndVector* const) const -{ - return 0; -} - -ndUnsigned64 ndShapeNull::GetHash(ndUnsigned64) const -{ - return 12345678; -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeNull.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeNull.h deleted file mode 100644 index 98627a7261..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeNull.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_NULL_H__ -#define __ND_SHAPE_NULL_H__ - -#include "ndCollisionStdafx.h" -#include "ndShape.h" - -class ndShapeNull : public ndShape -{ - public: - D_CLASS_REFLECTION(ndShapeNull, ndShape) - D_COLLISION_API ndShapeNull(); - D_COLLISION_API virtual ~ndShapeNull(); - - D_COLLISION_API virtual ndShapeNull* GetAsShapeNull(); - - D_COLLISION_API virtual ndFloat32 GetVolume() const; - D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; - D_COLLISION_API virtual ndFloat32 GetBoxMinRadius() const; - D_COLLISION_API virtual ndFloat32 GetBoxMaxRadius() const; - D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; - D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; - D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const; - D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - D_COLLISION_API virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - D_COLLISION_API virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - D_COLLISION_API virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& globalPlane, const ndShapeInstance& parentScale) const; - D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapePoint.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapePoint.cpp deleted file mode 100644 index f49c2c3dc2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapePoint.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndShapePoint.h" -#include "ndContactSolver.h" - -ndShapePoint::ndShapePoint() - :ndShapeConvex(m_pointCollision) -{ -} - -ndShapePoint::~ndShapePoint() -{ -} - -void ndShapePoint::MassProperties() -{ - ndAssert(0); - //m_centerOfMass = ndVector::m_zero; - //m_crossInertia = ndVector::m_zero; - //ndFloat32 volume = ndFloat32(4.0f * dPi / 3.0f) * m_radius * m_radius * m_radius; - //ndFloat32 II = ndFloat32(2.0f / 5.0f) * m_radius * m_radius; - //m_inertia = ndVector(II, II, II, ndFloat32(0.0f)); - //m_centerOfMass.m_w = volume; -} - -void ndShapePoint::CalculateAabb(const ndMatrix&, ndVector &, ndVector &) const -{ - ndAssert(0); - //ndVector size(m_radius); - //p0 = (matrix[3] - size) & ndVector::m_triplexMask; - //p1 = (matrix[3] + size) & ndVector::m_triplexMask; -} - -ndVector ndShapePoint::SupportVertexSpecialProjectPoint(const ndVector&, const ndVector&) const -{ - ndAssert(0); - //return dir.Scale(m_radius - D_PENETRATION_TOL); - return ndVector::m_zero; -} - -ndVector ndShapePoint::SupportVertexSpecial(const ndVector&, ndFloat32) const -{ - return ndVector::m_zero; -} - -ndVector ndShapePoint::SupportVertex(const ndVector&) const -{ - ndAssert(0); - //ndAssert(dir.m_w == ndFloat32(0.0f)); - //ndAssert(dAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - //ndAssert(dir.m_w == 0.0f); - //return dir.Scale(m_radius); - return ndVector::m_zero; -} - -ndInt32 ndShapePoint::CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const -{ - ndAssert(normal.m_w == 0.0f); - ndAssert(normal.DotProduct(normal).GetScalar() > ndFloat32(0.999f)); - contactsOut[0] = normal * normal.DotProduct(point); - return 1; -} - -ndFloat32 ndShapePoint::RayCast(ndRayCastNotify&, const ndVector&, const ndVector&, ndFloat32, const ndBody* const, ndContactPoint&) const -{ - ndAssert(0); - return ndFloat32 (1.2f); - //ndFloat32 t = dRayCastSphere(localP0, localP1, ndVector::m_zero, m_radius); - //if (t < maxT) - //{ - // ndVector contact(localP0 + (localP1 - localP0).Scale(t)); - // ndAssert(contact.m_w == ndFloat32(0.0f)); - // //contactOut.m_normal = contact.Scale (dgRsqrt (contact.DotProduct(contact).GetScalar())); - // contactOut.m_normal = contact.Normalize(); - // //contactOut.m_userId = SetUserDataID(); - //} - //return t; -} - -ndShapeInfo ndShapePoint::GetShapeInfo() const -{ - ndShapeInfo info(ndShapeConvex::GetShapeInfo()); - info.m_point.m_noUsed = ndFloat32 (0.0f); - return info; -} - -void ndShapePoint::DebugShape(const ndMatrix&, ndShapeDebugNotify&) const -{ - ndAssert(0); - //ndVector tmpVectex[1024 * 2]; - // - //ndVector p0(ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - //ndVector p1(-ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - //ndVector p2(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - //ndVector p3(ndFloat32(0.0f), -ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - //ndVector p4(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f)); - //ndVector p5(ndFloat32(0.0f), ndFloat32(0.0f), -ndFloat32(1.0f), ndFloat32(0.0f)); - // - //ndInt32 index = 3; - //ndInt32 count = 0; - //TesselateTriangle(index, p4, p0, p2, count, tmpVectex); - //TesselateTriangle(index, p4, p2, p1, count, tmpVectex); - //TesselateTriangle(index, p4, p1, p3, count, tmpVectex); - //TesselateTriangle(index, p4, p3, p0, count, tmpVectex); - //TesselateTriangle(index, p5, p2, p0, count, tmpVectex); - //TesselateTriangle(index, p5, p1, p2, count, tmpVectex); - //TesselateTriangle(index, p5, p3, p1, count, tmpVectex); - //TesselateTriangle(index, p5, p0, p3, count, tmpVectex); - // - //for (ndInt32 i = 0; i < count; ++i) - //{ - // tmpVectex[i] = matrix.TransformVector(tmpVectex[i].Scale(m_radius)) & ndVector::m_triplexMask; - //} - // - //for (ndInt32 i = 0; i < count; i += 3) - //{ - // debugCallback.DrawPolygon(3, &tmpVectex[i]); - //} -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapePoint.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapePoint.h deleted file mode 100644 index eed0b15a18..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapePoint.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_POINT_H__ -#define __ND_SHAPE_POINT_H__ - -#include "ndShapeConvex.h" - - -D_MSV_NEWTON_ALIGN_32 -class ndShapePoint: public ndShapeConvex -{ - public: - D_COLLISION_API ndShapePoint(); - D_COLLISION_API virtual ~ndShapePoint(); - - virtual ndShapePoint* GetAsShapePoint() { return this; } - - protected: - D_COLLISION_API virtual void MassProperties(); - - D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; - D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; - D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - D_COLLISION_API virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; -} D_GCC_NEWTON_ALIGN_32; - - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeSphere.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeSphere.cpp deleted file mode 100644 index f73b4361ce..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeSphere.cpp +++ /dev/null @@ -1,272 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndShapeSphere.h" -#include "ndContactSolver.h" - -#define D_SPHERE_EDGE_COUNT 96 - -ndInt32 ndShapeSphere::m_shapeRefCount = 0; -ndVector ndShapeSphere::m_unitSphere[D_SPHERE_VERTEX_COUNT]; -ndShapeConvex::ndConvexSimplexEdge ndShapeSphere::m_edgeArray[D_SPHERE_EDGE_COUNT]; - -ndShapeSphere::ndShapeSphere(ndFloat32 radius) - :ndShapeConvex(m_sphere) -{ - Init(radius); -} - -ndShapeSphere::~ndShapeSphere() -{ - m_shapeRefCount--; - ndAssert(m_shapeRefCount >= 0); - - ndShapeConvex::m_simplex = nullptr; - ndShapeConvex::m_vertex = nullptr; -} - -void ndShapeSphere::TesselateTriangle(ndInt32 level, const ndVector& p0, const ndVector& p1, const ndVector& p2, ndInt32& count, ndVector* const ouput) const -{ - if (level) - { - ndAssert(ndAbs(p0.DotProduct(p0).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p1.DotProduct(p1).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p2.DotProduct(p2).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndVector p01(p0 + p1); - ndVector p12(p1 + p2); - ndVector p20(p2 + p0); - - p01 = p01.Normalize(); - p12 = p12.Normalize(); - p20 = p20.Normalize(); - - ndAssert(ndAbs(p01.DotProduct(p01).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p12.DotProduct(p12).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p20.DotProduct(p20).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - - TesselateTriangle(level - 1, p0, p01, p20, count, ouput); - TesselateTriangle(level - 1, p1, p12, p01, count, ouput); - TesselateTriangle(level - 1, p2, p20, p12, count, ouput); - TesselateTriangle(level - 1, p01, p12, p20, count, ouput); - } - else - { - ouput[count++] = p0; - ouput[count++] = p1; - ouput[count++] = p2; - } -} - -void ndShapeSphere::Init(ndFloat32 radius) -{ - m_radius = ndMax(ndAbs(radius), D_MIN_CONVEX_SHAPE_SIZE); - - m_edgeCount = D_SPHERE_EDGE_COUNT; - m_vertexCount = D_SPHERE_VERTEX_COUNT; - ndShapeConvex::m_vertex = m_vertex; - - if (!m_shapeRefCount) - { - ndVector p0(ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p1(-ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p2(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p3(ndFloat32(0.0f), -ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p4(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f)); - ndVector p5(ndFloat32(0.0f), ndFloat32(0.0f), -ndFloat32(1.0f), ndFloat32(0.0f)); - - ndVector tmpVectex[256]; - ndInt32 indexList[256]; - ndInt32 index = 1; - ndInt32 count = 0; - TesselateTriangle(index, p4, p0, p2, count, tmpVectex); - TesselateTriangle(index, p4, p2, p1, count, tmpVectex); - TesselateTriangle(index, p4, p1, p3, count, tmpVectex); - TesselateTriangle(index, p4, p3, p0, count, tmpVectex); - TesselateTriangle(index, p5, p2, p0, count, tmpVectex); - TesselateTriangle(index, p5, p1, p2, count, tmpVectex); - TesselateTriangle(index, p5, p3, p1, count, tmpVectex); - TesselateTriangle(index, p5, p0, p3, count, tmpVectex); - - ndInt32 vertexCount = ndVertexListToIndexList(&tmpVectex[0].m_x, sizeof(ndVector), 3, count, indexList, 0.001f); - - ndAssert(vertexCount == D_SPHERE_VERTEX_COUNT); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - m_unitSphere[i] = tmpVectex[i]; - } - - ndPolyhedra polyhedra; - - polyhedra.BeginFace(); - for (ndInt32 i = 0; i < count; i += 3) - { - #ifdef _DEBUG - ndEdge* const edge = polyhedra.AddFace(indexList[i], indexList[i + 1], indexList[i + 2]); - ndAssert(edge); - #else - polyhedra.AddFace(indexList[i], indexList[i + 1], indexList[i + 2]); - #endif - } - polyhedra.EndFace(); - - ndUnsigned64 i1 = 0; - ndPolyhedra::Iterator iter(polyhedra); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - edge->m_userData = i1; - i1++; - } - - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - - ndConvexSimplexEdge* const ptr = &m_edgeArray[edge->m_userData]; - - ptr->m_vertex = edge->m_incidentVertex; - ptr->m_next = &m_edgeArray[edge->m_next->m_userData]; - ptr->m_prev = &m_edgeArray[edge->m_prev->m_userData]; - ptr->m_twin = &m_edgeArray[edge->m_twin->m_userData]; - } - } - - for (ndInt32 i = 0; i < D_SPHERE_VERTEX_COUNT; ++i) - { - m_vertex[i] = m_unitSphere[i].Scale(m_radius); - } - - m_shapeRefCount++; - ndShapeConvex::m_simplex = m_edgeArray; - SetVolumeAndCG(); -} - -void ndShapeSphere::MassProperties() -{ - m_centerOfMass = ndVector::m_zero; - m_crossInertia = ndVector::m_zero; - ndFloat32 volume = ndFloat32(4.0f * ndPi / 3.0f) * m_radius * m_radius * m_radius; - ndFloat32 II = ndFloat32(2.0f / 5.0f) * m_radius * m_radius; - m_inertia = ndVector(II, II, II, ndFloat32(0.0f)); - m_centerOfMass.m_w = volume; -} - -void ndShapeSphere::CalculateAabb(const ndMatrix& matrix, ndVector &p0, ndVector &p1) const -{ - //ndMatrix transp(matrix.Transpose4X4()); - ////ndVector size(matrix.m_front.Abs().Scale(m_radius) + matrix.m_up.Abs().Scale(m_radius) + matrix.m_right.Abs().Scale(m_radius)); - //ndVector size(transp.m_front.Abs() + transp.m_up.Abs() + transp.m_right.Abs()); - //size = size.Scale(m_radius); - ndVector size(m_radius); - p0 = (matrix[3] - size) & ndVector::m_triplexMask; - p1 = (matrix[3] + size) & ndVector::m_triplexMask; -} - -ndVector ndShapeSphere::SupportVertexSpecialProjectPoint(const ndVector&, const ndVector& dir) const -{ - return dir.Scale(m_radius - D_PENETRATION_TOL); -} - -ndVector ndShapeSphere::SupportVertexSpecial(const ndVector&, ndFloat32) const -{ - return ndVector::m_zero; -} - -ndVector ndShapeSphere::SupportVertex(const ndVector& dir) const -{ - ndAssert(dir.m_w == ndFloat32(0.0f)); - ndAssert(ndAbs(dir.DotProduct(dir).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-3f)); - ndAssert(dir.m_w == 0.0f); - return dir.Scale(m_radius); -} - -ndInt32 ndShapeSphere::CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const -{ - ndAssert(normal.m_w == 0.0f); - ndAssert(normal.DotProduct(normal).GetScalar() > ndFloat32(0.999f)); - contactsOut[0] = normal * normal.DotProduct(point); - return 1; -} - -ndFloat32 ndShapeSphere::RayCast(ndRayCastNotify&, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const, ndContactPoint& contactOut) const -{ - ndFloat32 t = ndRayCastSphere(localP0, localP1, ndVector::m_zero, m_radius); - if (t < maxT) - { - ndVector contact(localP0 + (localP1 - localP0).Scale(t)); - ndAssert(contact.m_w == ndFloat32(0.0f)); - //contactOut.m_normal = contact.Scale (dgRsqrt (contact.DotProduct(contact).GetScalar())); - contactOut.m_normal = contact.Normalize(); - //contactOut.m_userId = SetUserDataID(); - } - return t; -} - -ndShapeInfo ndShapeSphere::GetShapeInfo() const -{ - ndShapeInfo info(ndShapeConvex::GetShapeInfo()); - info.m_sphere.m_radius = m_radius; - return info; -} - -void ndShapeSphere::DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const -{ - ndVector tmpVectex[1024 * 2]; - ndShapeDebugNotify::ndEdgeType edgeType[1024 * 2]; - - ndVector p0(ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p1(-ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p2(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p3(ndFloat32(0.0f), -ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p4(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f)); - ndVector p5(ndFloat32(0.0f), ndFloat32(0.0f), -ndFloat32(1.0f), ndFloat32(0.0f)); - - ndInt32 index = 3; - ndInt32 count = 0; - TesselateTriangle(index, p4, p0, p2, count, tmpVectex); - TesselateTriangle(index, p4, p2, p1, count, tmpVectex); - TesselateTriangle(index, p4, p1, p3, count, tmpVectex); - TesselateTriangle(index, p4, p3, p0, count, tmpVectex); - TesselateTriangle(index, p5, p2, p0, count, tmpVectex); - TesselateTriangle(index, p5, p1, p2, count, tmpVectex); - TesselateTriangle(index, p5, p3, p1, count, tmpVectex); - TesselateTriangle(index, p5, p0, p3, count, tmpVectex); - - for (ndInt32 i = 0; i < count; ++i) - { - edgeType[i] = ndShapeDebugNotify::m_shared; - tmpVectex[i] = matrix.TransformVector(tmpVectex[i].Scale(m_radius)) & ndVector::m_triplexMask; - } - - for (ndInt32 i = 0; i < count; i += 3) - { - debugCallback.DrawPolygon(3, &tmpVectex[i], &edgeType[i]); - } -} - -ndUnsigned64 ndShapeSphere::GetHash(ndUnsigned64 hash) const -{ - ndShapeInfo info(GetShapeInfo()); - return info.GetHash(hash); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeSphere.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeSphere.h deleted file mode 100644 index f2c41670b7..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeSphere.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_SPHERE_H__ -#define __ND_SHAPE_SPHERE_H__ - -#include "ndShapeConvex.h" - -#define D_SPHERE_VERTEX_COUNT 18 - -D_MSV_NEWTON_ALIGN_32 -class ndShapeSphere: public ndShapeConvex -{ - public: - D_CLASS_REFLECTION(ndShapeSphere,ndShapeConvex) - D_COLLISION_API ndShapeSphere(ndFloat32 radius); - D_COLLISION_API virtual ~ndShapeSphere(); - - virtual ndShapeSphere* GetAsShapeSphere() { return this; } - - protected: - D_COLLISION_API void Init(ndFloat32 radius); - D_COLLISION_API virtual void MassProperties(); - - D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; - D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; - D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; - D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - D_COLLISION_API virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const; - D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - - void TesselateTriangle(ndInt32 level, const ndVector& p0, const ndVector& p1, const ndVector& p2, ndInt32& count, ndVector* const ouput) const; - - ndVector m_vertex[D_SPHERE_VERTEX_COUNT]; - ndFloat32 m_radius; - - static ndInt32 m_shapeRefCount; - static ndVector m_unitSphere[]; - static ndConvexSimplexEdge m_edgeArray[]; -} D_GCC_NEWTON_ALIGN_32; - - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.cpp deleted file mode 100644 index 395c493858..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndShapeInstance.h" -#include "ndContactSolver.h" -#include "ndCollisionStdafx.h" -#include "ndShapeStaticMesh.h" - -ndShapeStaticMesh::ndShapeStaticMesh(ndShapeID id) - :ndShape(id) -{ -} - -ndShapeStaticMesh::~ndShapeStaticMesh() -{ -} - -void ndShapeStaticMesh::CalculateAabb(const ndMatrix& matrix, ndVector &p0, ndVector &p1) const -{ - ndVector origin(matrix.TransformVector(m_boxOrigin)); - ndVector size(matrix.m_front.Abs().Scale(m_boxSize.m_x) + matrix.m_up.Abs().Scale(m_boxSize.m_y) + matrix.m_right.Abs().Scale(m_boxSize.m_z)); - - p0 = (origin - size) & ndVector::m_triplexMask; - p1 = (origin + size) & ndVector::m_triplexMask; -} - -ndInt32 ndShapeStaticMesh::CalculatePlaneIntersection(const ndFloat32* const, const ndInt32* const, ndInt32, ndInt32, const ndPlane&, ndVector* const) const -{ - ndAssert(0); - return 0; - //ndInt32 count = 0; - //ndInt32 j = index[indexCount - 1] * stride; - //ndVector p0(&vertex[j]); - //p0 = p0 & ndVector::m_triplexMask; - //ndFloat32 side0 = localPlane.Evalue(p0); - //for (ndInt32 i = 0; i < indexCount; ++i) - //{ - // j = index[i] * stride; - // ndVector p1(&vertex[j]); - // p1 = p1 & ndVector::m_triplexMask; - // ndFloat32 side1 = localPlane.Evalue(p1); - // - // if (side0 < ndFloat32(0.0f)) { - // if (side1 >= ndFloat32(0.0f)) { - // ndVector dp(p1 - p0); - // ndAssert(dp.m_w == ndFloat32(0.0f)); - // ndFloat32 t = localPlane.DotProduct(dp).GetScalar(); - // ndAssert(dgAbs(t) >= ndFloat32(0.0f)); - // if (dgAbs(t) < ndFloat32(1.0e-8f)) { - // t = dgSign(t) * ndFloat32(1.0e-8f); - // } - // ndAssert(0); - // contactsOut[count] = p0 - dp.Scale(side0 / t); - // count++; - // - // } - // } - // else if (side1 <= ndFloat32(0.0f)) { - // ndVector dp(p1 - p0); - // ndAssert(dp.m_w == ndFloat32(0.0f)); - // ndFloat32 t = localPlane.DotProduct(dp).GetScalar(); - // ndAssert(dgAbs(t) >= ndFloat32(0.0f)); - // if (dgAbs(t) < ndFloat32(1.0e-8f)) { - // t = dgSign(t) * ndFloat32(1.0e-8f); - // } - // ndAssert(0); - // contactsOut[count] = p0 - dp.Scale(side0 / t); - // count++; - // } - // - // side0 = side1; - // p0 = p1; - //} - // - //return count; -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.h deleted file mode 100644 index 8a974b7a5f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.h +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_STATIC_MESH_H__ -#define __ND_SHAPE_STATIC_MESH_H__ - -#include "ndCollisionStdafx.h" -#include "ndShape.h" - -class ndShapeInstance; -class ndPolygonMeshDesc; - -class ndShapeStaticMesh: public ndShape -{ - public: - D_CLASS_REFLECTION(ndShapeStaticMesh,ndShape) - D_COLLISION_API ndShapeStaticMesh(ndShapeID id); - D_COLLISION_API virtual ~ndShapeStaticMesh(); - - virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; - - protected: - virtual ndFloat32 GetVolume() const; - virtual ndFloat32 GetBoxMinRadius() const; - virtual ndFloat32 GetBoxMaxRadius() const; - virtual ndShapeStaticMesh* GetAsShapeStaticMesh(); - virtual ndVector SupportVertex(const ndVector& dir) const; - virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& plane, const ndShapeInstance& parentScale) const; - - D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; - D_COLLISION_API ndInt32 CalculatePlaneIntersection(const ndFloat32* const vertex, const ndInt32* const index, ndInt32 indexCount, ndInt32 strideInFloat, const ndPlane& localPlane, ndVector* const contactsOut) const; - - D_MSV_NEWTON_ALIGN_32 - class ndMeshVertexListIndexList - { - public: - ndInt32* m_indexList; - ndInt32* m_userDataList; - ndFloat32* m_veterxArray; - ndInt32 m_triangleCount; - ndInt32 m_maxIndexCount; - ndInt32 m_vertexCount; - ndInt32 m_vertexStrideInBytes; - } D_GCC_NEWTON_ALIGN_32; -}; - -inline ndFloat32 ndShapeStaticMesh::GetVolume() const -{ - return ndFloat32(0.0f); -} - -inline ndFloat32 ndShapeStaticMesh::GetBoxMinRadius() const -{ - return ndFloat32(0.0f); -} - -inline ndFloat32 ndShapeStaticMesh::GetBoxMaxRadius() const -{ - return ndFloat32(0.0f); -} - -inline ndVector ndShapeStaticMesh::SupportVertex(const ndVector&) const -{ - ndAssert(0); - return ndVector::m_zero; -} - -inline ndVector ndShapeStaticMesh::SupportVertexSpecial(const ndVector& dir, ndFloat32) const -{ - ndAssert(0); - return SupportVertex(dir); -} - -inline ndVector ndShapeStaticMesh::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector&) const -{ - return point; -} - -inline ndInt32 ndShapeStaticMesh::CalculatePlaneIntersection(const ndVector&, const ndVector&, ndVector* const) const -{ - return 0; -} - -inline ndVector ndShapeStaticMesh::CalculateVolumeIntegral(const ndMatrix&, const ndVector&, const ndShapeInstance&) const -{ - return ndVector::m_zero; -} - -inline ndShapeStaticMesh* ndShapeStaticMesh::GetAsShapeStaticMesh() -{ - return this; -} - - -inline void ndShapeStaticMesh::DebugShape(const ndMatrix&, ndShapeDebugNotify&) const -{ -} - -inline ndFloat32 ndShapeStaticMesh::RayCast(ndRayCastNotify&, const ndVector&, const ndVector&, ndFloat32, const ndBody* const, ndContactPoint&) const -{ - return ndFloat32(1.2f); -} - -inline void ndShapeStaticMesh::GetCollidingFaces(ndPolygonMeshDesc* const) const -{ -} - -#endif - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticProceduralMesh.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticProceduralMesh.cpp deleted file mode 100644 index db802c619c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticProceduralMesh.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndBodyKinematic.h" -#include "ndShapeInstance.h" -#include "ndPolygonMeshDesc.h" -#include "ndShapeStaticProceduralMesh.h" - -ndShapeStaticProceduralMesh::ndShapeStaticProceduralMesh(ndFloat32 sizex, ndFloat32 sizey, ndFloat32 sizez) - :ndShapeStaticMesh(m_staticProceduralMesh) -{ - m_boxOrigin = ndVector::m_zero; - m_boxSize = ndVector(sizex, sizey, sizez, ndFloat32 (0.0f)) * ndVector::m_half; -} - -ndShapeStaticProceduralMesh::~ndShapeStaticProceduralMesh(void) -{ -} - -ndShapeInfo ndShapeStaticProceduralMesh::GetShapeInfo() const -{ - ndShapeInfo info(ndShapeStaticMesh::GetShapeInfo()); - info.m_procedural.m_noUsed = 0; - return info; -} - -void ndShapeStaticProceduralMesh::GetCollidingFaces(ndPolygonMeshDesc* const data) const -{ - ndPolygonMeshDesc::ndStaticMeshFaceQuery& query = *data->m_staticMeshQuery; - ndPolygonMeshDesc::ndProceduralStaticMeshFaceQuery& meshPatch = *data->m_proceduralStaticMeshFaceQuery; - - ndArray& vertex = meshPatch.m_vertex; - ndArray& faceList = query.m_faceIndexCount; - ndArray& indexList = meshPatch.m_indexListList; - ndArray& faceMaterialList = meshPatch.m_faceMaterial; - GetCollidingFaces(data->GetOrigin(), data->GetTarget(), vertex, faceList, faceMaterialList, indexList); - - if (faceList.GetCount() == 0) - { - return; - } - - ndEdgeMap edgeMap; - //ndInt32 index = 0; - ndInt32 faceStart = 0; - ndArray& indices = query.m_faceVertexIndex; - ndArray& faceIndexCount = query.m_faceIndexCount; - - for (ndInt32 i = 0; i < faceList.GetCount(); ++i) - { - ndInt32 i0 = indexList[faceStart + 0]; - ndInt32 i1 = indexList[faceStart + 1]; - ndVector normal(ndVector::m_zero); - ndVector edge0(vertex[i1] - vertex[i0]); - - ndFloat32 maxDiagonal2 = edge0.DotProduct(edge0).GetScalar(); - for (ndInt32 j = 2; j < faceList[i]; ++j) - { - ndInt32 i2 = indexList[faceStart + j]; - const ndVector edge1(vertex[i2] - vertex[i0]); - maxDiagonal2 = ndMax(maxDiagonal2, edge1.DotProduct(edge1).GetScalar()); - normal += edge0.CrossProduct(edge1); - edge0 = edge1; - } - - ndInt32 normalIndex = ndInt32(vertex.GetCount()); - ndAssert(normal.m_w == ndFloat32(0.0f)); - vertex.PushBack(normal.Normalize()); - - ndInt32 quantizedDiagSize = ndInt32(ndFloor(ndSqrt(maxDiagonal2) / D_FACE_CLIP_DIAGONAL_SCALE + ndFloat32(1.0f))); - - const ndPlane plane(normal, -normal.DotProduct(vertex[i0]).GetScalar()); - - ndInt32 index = ndInt32(indices.GetCount()); - indices.SetCount(index + faceList[i] * 2 + 3); - indices[index + faceList[i] + 0] = faceMaterialList[i]; - indices[index + faceList[i] + 1] = normalIndex; - indices[index + 2 * faceList[i] + 2] = quantizedDiagSize; - - ndInt32 j0 = faceList[i] - 1; - ndInt32 testIndex = j0 - 1; - const ndInt32 faceVectexCount = faceList[i]; - faceIndexCount[i] = faceVectexCount; - for (ndInt32 j1 = 0; j1 < faceVectexCount; ++j1) - { - ndInt32 k0 = indexList[faceStart + j0]; - ndInt32 k1 = indexList[faceStart + j1]; - ndInt32 test = indexList[faceStart + testIndex]; - const ndEdge edge(k0, k1, plane, test); - ndInt32 normalEntryIndex = index + j1 + faceVectexCount + 2; - edgeMap.Insert(normalEntryIndex, edge); - - indices[index + j1] = indexList[faceStart + j0]; - indices[normalEntryIndex] = normalIndex; - - testIndex = j0; - j0 = j1; - } - faceStart += faceVectexCount; - } - - ndEdgeMap::Iterator iter(edgeMap); - for (iter.Begin(); iter; iter++) - { - ndEdgeMap::ndNode* const edgeNode = iter.GetNode(); - if (edgeNode->GetInfo() != -1) - { - ndEdge edge(iter.GetKey()); - ndSwap(edge.m_i0, edge.m_i1); - ndEdgeMap::ndNode* const twinNode = edgeMap.Find(edge); - if (twinNode) - { - const ndPlane& plane = twinNode->GetKey().m_plane; - ndFloat32 dist = plane.Evalue(vertex[edge.m_testIndex]); - if (dist < -ndFloat32(1.0e-3f)) - { - ndInt32 i0 = edgeNode->GetInfo(); - ndInt32 i1 = twinNode->GetInfo(); - ndSwap(indices[i0], indices[i1]); - } - twinNode->GetInfo() = -1; - } - } - edgeNode->GetInfo() = -1; - } - - ndInt32 faceCount0 = 0; - ndInt32 faceIndexCount0 = 0; - ndInt32 faceIndexCount1 = 0; - ndInt32 stride = sizeof(ndVector) / sizeof(ndFloat32); - - //ndInt32* const address = data->m_meshData.m_globalFaceIndexStart; - ndArray& address = query.m_faceIndexStart; - ndArray& hitDistance = query.m_hitDistance; - if (data->m_doContinueCollisionTest) - { - ndFastRay ray(ndVector::m_zero, data->m_boxDistanceTravelInMeshSpace); - for (ndInt32 i = 0; i < faceList.GetCount(); ++i) - { - const ndInt32 vertexCount = faceIndexCount[i]; - const ndInt32* const indexArray = &indices[faceIndexCount1]; - const ndVector& faceNormal = vertex[indexArray[4]]; - ndFloat32 dist = data->PolygonBoxRayDistance(faceNormal, 3, indexArray, stride, &vertex[0].m_x, ray); - if (dist < ndFloat32(1.0f)) - { - hitDistance.PushBack(dist); - address.PushBack(faceIndexCount0); - ndMemCpy(&indices[faceIndexCount0], indexArray, vertexCount * 2 + 3); - faceCount0++; - faceIndexCount0 += vertexCount * 2 + 3; - } - faceIndexCount1 += vertexCount * 2 + 3; - } - } - else - { - for (ndInt32 i = 0; i < faceList.GetCount(); ++i) - { - const ndInt32 vertexCount = faceIndexCount[i]; - const ndInt32* const indexArray = &indices[faceIndexCount1]; - const ndVector& faceNormal = vertex[indexArray[vertexCount + 1]]; - ndFloat32 dist = data->PolygonBoxDistance(faceNormal, vertexCount, indexArray, stride, &vertex[0].m_x); - if (dist > ndFloat32(0.0f)) - { - hitDistance.PushBack(dist); - address.PushBack(faceIndexCount0); - ndMemCpy(&indices[faceIndexCount0], indexArray, vertexCount * 2 + 3); - faceCount0++; - faceIndexCount0 += vertexCount * 2 + 3; - } - faceIndexCount1 += vertexCount * 2 + 3; - } - } - - // initialize the callback data structure - faceIndexCount.SetCount(faceCount0); - data->m_vertex = &vertex[0].m_x; - data->m_vertexStrideInBytes = sizeof(ndVector); -} - -ndUnsigned64 ndShapeStaticProceduralMesh::GetHash(ndUnsigned64 hash) const -{ - return hash + 1; -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticProceduralMesh.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticProceduralMesh.h deleted file mode 100644 index 9fa216082a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticProceduralMesh.h +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_STATIC_PROCEDURAL_MESH__ -#define __ND_SHAPE_STATIC_PROCEDURAL_MESH__ - -#include "ndCollisionStdafx.h" -#include "ndShapeStaticMesh.h" - -class ndShapeStaticProceduralMesh: public ndShapeStaticMesh -{ - public: - class ndEdge - { - public: - ndEdge(); - ndEdge(ndInt32 i0, ndInt32 i1, const ndPlane& plane, ndInt32 testIndex); - - bool operator< (const ndEdge& edge) const; - bool operator> (const ndEdge& edge) const; - - ndPlane m_plane; - ndInt32 m_testIndex; - union - { - ndUnsigned64 m_key; - struct - { - ndInt32 m_i0; - ndInt32 m_i1; - }; - }; - }; - - class ndEdgeMap : public ndTree> - { - public: - ndEdgeMap(); - }; - - D_CLASS_REFLECTION(ndShapeStaticProceduralMesh, ndShapeStaticMesh) - D_COLLISION_API ndShapeStaticProceduralMesh(ndFloat32 sizex, ndFloat32 sizey, ndFloat32 sizez); - D_COLLISION_API virtual ~ndShapeStaticProceduralMesh(); - - virtual ndShapeStaticProceduralMesh* GetAsShapeStaticProceduralMesh() { return this; } - virtual void GetCollidingFaces(const ndVector& minBox, const ndVector& maxBox, ndArray& vertex, ndArray& faceList, ndArray& faceMaterial, ndArray& indexListList) const; - - protected: - D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; - D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; - - D_COLLISION_API virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; - - private: - friend class ndContactSolver; -}; - -inline void ndShapeStaticProceduralMesh::GetCollidingFaces(const ndVector&, const ndVector&, ndArray&, ndArray&, ndArray&, ndArray&) const -{ - ndAssert(0); -} - -inline ndShapeStaticProceduralMesh::ndEdge::ndEdge() -{ -} - -inline ndShapeStaticProceduralMesh::ndEdge::ndEdge(ndInt32 i0, ndInt32 i1, - const ndPlane& plane, ndInt32 testIndex) - :m_plane(plane) - ,m_testIndex(testIndex) - ,m_i0(i0) - ,m_i1(i1) -{ -} - -inline bool ndShapeStaticProceduralMesh::ndEdge::operator< (const ndEdge& edge) const -{ - return m_key < edge.m_key; -} - -inline bool ndShapeStaticProceduralMesh::ndEdge::operator> (const ndEdge& edge) const -{ - return m_key > edge.m_key; -} - -inline ndShapeStaticProceduralMesh::ndEdgeMap::ndEdgeMap() - :ndTree>() -{ -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.cpp deleted file mode 100644 index f171ae768e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.cpp +++ /dev/null @@ -1,236 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndCollisionStdafx.h" -#include "ndContact.h" -#include "ndBodyKinematic.h" -#include "ndShapeInstance.h" -#include "ndPolygonMeshDesc.h" -#include "ndShapeStatic_bvh.h" - -class ndCollisionBvhShowPolyContext -{ - public: - ndMatrix m_matrix; - void* m_userData; - ndShapeDebugNotify* m_callback; -}; - -D_MSV_NEWTON_ALIGN_32 -class ndBvhRay: public ndFastRay -{ - public: - ndBvhRay(const ndVector& l0, const ndVector& l1) - :ndFastRay (l0, l1) - { - } - - ndMatrix m_matrix; - ndVector m_normal; - ndUnsigned32 m_id; - ndFloat32 m_t; - ndRayCastNotify* m_callback; - const ndBodyKinematic* m_myBody; - const ndShapeStatic_bvh* m_me; -} D_GCC_NEWTON_ALIGN_32; - - -ndShapeStatic_bvh::ndShapeStatic_bvh() - :ndShapeStaticMesh(m_boundingBoxHierachy) - ,ndAabbPolygonSoup() - ,m_trianglesCount(0) -{ -} - -ndShapeStatic_bvh::ndShapeStatic_bvh(const ndPolygonSoupBuilder& builder) - :ndShapeStaticMesh(m_boundingBoxHierachy) - ,ndAabbPolygonSoup() - ,m_trianglesCount(0) -{ - Create(builder); - CalculateAdjacent(); - - ndVector p0; - ndVector p1; - GetAABB(p0, p1); - m_boxSize = (p1 - p0) * ndVector::m_half; - m_boxOrigin = (p1 + p0) * ndVector::m_half; - - ndMeshVertexListIndexList data; - data.m_indexList = nullptr; - data.m_userDataList = nullptr; - data.m_maxIndexCount = 1000000000; - data.m_triangleCount = 0; - ndVector zero(ndVector::m_zero); - ndFastAabb box(ndGetIdentityMatrix(), ndVector(ndFloat32(1.0e15f))); - ForAllSectors(box, zero, ndFloat32(1.0f), GetTriangleCount, &data); - m_trianglesCount = data.m_triangleCount; -} - -ndShapeStatic_bvh::~ndShapeStatic_bvh(void) -{ -} - -ndIntersectStatus ndShapeStatic_bvh::GetTriangleCount(void* const context, const ndFloat32* const, ndInt32, const ndInt32* const, ndInt32 indexCount, ndFloat32) -{ - ndMeshVertexListIndexList& data = (*(ndMeshVertexListIndexList*)context); - - if ((data.m_triangleCount + indexCount - 2) * 3 > data.m_maxIndexCount) - { - return m_stopSearch; - } - - data.m_triangleCount += (indexCount - 2); - ndAssert((data.m_triangleCount * 3) <= data.m_maxIndexCount); - return m_continueSearh; -} - -ndShapeInfo ndShapeStatic_bvh::GetShapeInfo() const -{ - ndShapeInfo info(ndShapeStaticMesh::GetShapeInfo()); - - info.m_bvh.m_vertexCount = GetVertexCount(); - info.m_bvh.m_indexCount = m_trianglesCount * 3; - return info; -} - -ndIntersectStatus ndShapeStatic_bvh::ShowDebugPolygon(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32) -{ - ndVector poly[128]; - ndShapeDebugNotify::ndEdgeType edgeType[128]; - - ndInt32 stride = ndInt32(strideInBytes / sizeof(ndFloat32)); - - ndCollisionBvhShowPolyContext& data = *(ndCollisionBvhShowPolyContext*)context; - for (ndInt32 i = 0; i < indexCount; ++i) - { - ndVector p(&polygon[indexArray[i] * stride]); - poly[i] = data.m_matrix.TransformVector(p & ndVector::m_triplexMask); - ndInt32 edgeIndexType = (indexArray[i + indexCount + 2]) & D_CONCAVE_EDGE_MASK; - edgeType[i] = edgeIndexType ? ndShapeDebugNotify::m_open : ndShapeDebugNotify::m_shared; - } - data.m_callback->DrawPolygon(indexCount, poly, edgeType); - return m_continueSearh; -} - -void ndShapeStatic_bvh::DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const -{ - ndCollisionBvhShowPolyContext context; - - context.m_matrix = matrix; - context.m_userData = (void*)this; - context.m_callback = &debugCallback; - - ndFastAabb box(ndGetIdentityMatrix(), ndVector(1.0e15f)); - ForAllSectors(box, ndVector::m_zero, ndFloat32(1.0f), ShowDebugPolygon, &context); -} - -ndFloat32 ndShapeStatic_bvh::RayHit(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount) -{ - ndBvhRay& me = *((ndBvhRay*)context); - ndVector normal(&polygon[indexArray[indexCount + 1] * (strideInBytes / sizeof(ndFloat32))]); - normal = normal & ndVector::m_triplexMask; - ndFloat32 t = me.PolygonIntersect(normal, me.m_t, polygon, strideInBytes, indexArray, indexCount); - if (t <= (me.m_t * ndFloat32(1.0001f))) - { - me.m_t = t; - me.m_normal = normal; - me.m_id = me.m_me->GetTagId(indexArray, indexCount); - } - return t; -} - -ndFloat32 ndShapeStatic_bvh::RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const -{ - ndBvhRay ray(localP0, localP1); - ray.m_t = ndFloat32(1.0f); - ray.m_me = this; - ray.m_myBody = ((ndBody*)body)->GetAsBodyKinematic(); - ray.m_callback = &callback; - ndFloat32 t = ndFloat32 (1.2f); - ForAllSectorsRayHit(ray, maxT, RayHit, &ray); - if (ray.m_t < maxT) - { - t = ray.m_t; - ndAssert(ray.m_normal.m_w == ndFloat32(0.0f)); - ndAssert(ray.m_normal.DotProduct(ray.m_normal).GetScalar() > ndFloat32(0.0f)); - contactOut.m_normal = ray.m_normal.Normalize(); - contactOut.m_shapeId0 = ray.m_id; - contactOut.m_shapeId1 = ray.m_id; - } - return t; -} - -ndIntersectStatus ndShapeStatic_bvh::GetPolygon(void* const context, const ndFloat32* const, ndInt32, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance) -{ - ndPolygonMeshDesc& data = (*(ndPolygonMeshDesc*)context); - ndPolygonMeshDesc::ndStaticMeshFaceQuery& query = *data.m_staticMeshQuery; - - ndInt32 count = indexCount * 2 + 3; - query.m_hitDistance.PushBack(hitDistance); - query.m_faceIndexCount.PushBack(indexCount); - query.m_faceIndexStart.PushBack(ndInt32(query.m_faceVertexIndex.GetCount())); - - for (ndInt32 i = 0; i < count; ++i) - { - query.m_faceVertexIndex.PushBack(indexArray[i]); - } - return m_continueSearh; -} - -void ndShapeStatic_bvh::GetCollidingFaces(ndPolygonMeshDesc* const data) const -{ - data->m_vertex = GetLocalVertexPool(); - data->m_vertexStrideInBytes = GetStrideInBytes(); - ForAllSectors(*data, data->m_boxDistanceTravelInMeshSpace, data->m_maxT, GetPolygon, data); -} - - -ndIntersectStatus ndShapeStatic_bvh::CalculateHash( - void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, - const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32) -{ - ndUnsigned64* hash = (ndUnsigned64*)context; - - ndInt32 stride = strideInBytes / ndInt32 (sizeof(ndFloat32)); - for (ndInt32 i = 0; i < indexCount; ++i) - { - ndInt32 j = indexArray[i]; - ndVector p(polygon[j * stride + 0], polygon[j * stride + 1], polygon[j * stride + 2], ndFloat32(0.0f)); - *hash = ndCRC64(&p.m_x, ndInt32 (sizeof(ndVector)), *hash); - } - *hash = ndCRC64(&indexArray[indexCount], ndInt32 (sizeof(ndInt32)), *hash); - - return m_continueSearh; -} - -ndUnsigned64 ndShapeStatic_bvh::GetHash(ndUnsigned64 hash) const -{ - ndVector p0(ndFloat32(-1.0e15f), ndFloat32(-1.0e15f), ndFloat32(-1.0e15f), ndFloat32(0.0f)); - ndVector p1(ndFloat32(1.0e15f), ndFloat32(1.0e15f), ndFloat32(1.0e15f), ndFloat32(0.0f)); - ndFastAabb aabb(p0, p1); - - ndUnsigned64 tempHash = hash; - ForAllSectors(aabb, ndVector::m_zero, ndFloat32 (0.0f), CalculateHash, &tempHash); - - return tempHash; -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.h deleted file mode 100644 index 52298735a2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SHAPE_STATIC_BVH__ -#define __ND_SHAPE_STATIC_BVH__ - -#include "ndCollisionStdafx.h" -#include "ndShapeStaticMesh.h" - -class ndShapeStatic_bvh: public ndShapeStaticMesh, public ndAabbPolygonSoup -{ - public: - D_CLASS_REFLECTION(ndShapeStatic_bvh,ndShapeStaticMesh) - - D_COLLISION_API ndShapeStatic_bvh(); - D_COLLISION_API ndShapeStatic_bvh(const ndPolygonSoupBuilder& builder); - D_COLLISION_API virtual ~ndShapeStatic_bvh(); - - void *operator new (size_t size); - void operator delete (void* ptr); - - protected: - D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; - D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; - - virtual ndShapeStatic_bvh* GetAsShapeStaticBVH() { return this; } - virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; - - static ndFloat32 RayHit(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount); - static ndIntersectStatus ShowDebugPolygon(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); - static ndIntersectStatus GetTriangleCount(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); - static ndIntersectStatus GetPolygon(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); - - private: - - static ndIntersectStatus CalculateHash ( - void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, - const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); - - ndInt32 m_trianglesCount; - - friend class ndContactSolver; -}; - -inline void* ndShapeStatic_bvh::operator new (size_t size) -{ - return ndShapeStaticMesh::operator new (size); -} - -inline void ndShapeStatic_bvh::operator delete (void* ptr) -{ - ndShapeStaticMesh::operator delete(ptr); -} - - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndAabbPolygonSoup.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndAabbPolygonSoup.cpp deleted file mode 100644 index 8d6b01eff2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndAabbPolygonSoup.cpp +++ /dev/null @@ -1,1466 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndHeap.h" -#include "ndStack.h" -#include "ndList.h" -#include "ndMatrix.h" -#include "ndPolyhedra.h" -#include "ndAabbPolygonSoup.h" -#include "ndPolygonSoupBuilder.h" - -#define DG_STACK_DEPTH 512 - -D_MSV_NEWTON_ALIGN_32 -class ndAabbPolygonSoup::ndNodeBuilder: public ndAabbPolygonSoup::ndNode -{ - public: - ndNodeBuilder (const ndVector& p0, const ndVector& p1) - :ndNode() - ,m_left (nullptr) - ,m_right (nullptr) - ,m_parent (nullptr) - ,m_indexBox0(0) - ,m_indexBox1(0) - ,m_enumeration(-1) - ,m_faceIndex(0) - ,m_indexCount(0) - ,m_faceIndices(nullptr) - { - SetBox (p0, p1); - } - - ndNodeBuilder (const ndVector* const vertexArray, ndInt32 faceIndex, ndInt32 indexCount, const ndInt32* const indexArray) - :ndNode() - ,m_left (nullptr) - ,m_right (nullptr) - ,m_parent (nullptr) - ,m_indexBox0(0) - ,m_indexBox1(0) - ,m_enumeration(-1) - ,m_faceIndex(faceIndex) - ,m_indexCount(indexCount) - ,m_faceIndices(indexArray) - { - ndVector minP ( ndFloat32 (1.0e15f)); - ndVector maxP (-ndFloat32 (1.0e15f)); - for (ndInt32 i = 0; i < indexCount; ++i) - { - ndInt32 index = indexArray[i]; - const ndVector& p (vertexArray[index]); - minP = p.GetMin(minP); - maxP = p.GetMax(maxP); - } - minP -= ndVector (ndFloat32 (1.0e-3f)); - maxP += ndVector (ndFloat32 (1.0e-3f)); - minP = minP & ndVector::m_triplexMask; - maxP = maxP & ndVector::m_triplexMask; - SetBox (minP, maxP); - } - - ndNodeBuilder (ndNodeBuilder* const left, ndNodeBuilder* const right) - :ndNode() - ,m_left(left) - ,m_right(right) - ,m_parent(nullptr) - ,m_indexBox0(0) - ,m_indexBox1(0) - ,m_enumeration(-1) - ,m_faceIndex(0) - ,m_indexCount(0) - ,m_faceIndices(nullptr) - { - m_left->m_parent = this; - m_right->m_parent = this; - - ndVector p0 (left->m_p0.GetMin(right->m_p0)); - ndVector p1 (left->m_p1.GetMax(right->m_p1)); - SetBox(p0, p1); - } - - void SetBox (const ndVector& p0, const ndVector& p1) - { - m_p0 = p0; - m_p1 = p1; - } - - ndVector m_p0; - ndVector m_p1; - ndNodeBuilder* m_left; - ndNodeBuilder* m_right; - ndNodeBuilder* m_parent; - ndInt32 m_indexBox0; - ndInt32 m_indexBox1; - ndInt32 m_enumeration; - ndInt32 m_faceIndex; - ndInt32 m_indexCount; - const ndInt32* m_faceIndices; -} D_GCC_NEWTON_ALIGN_32; - -class ndAabbPolygonSoup::ndSplitInfo -{ - public: - ndSplitInfo (ndNodeBuilder* const boxArray, ndInt32 boxCount) - { - ndVector minP ( ndFloat32 (1.0e15f)); - ndVector maxP (-ndFloat32 (1.0e15f)); - - if (boxCount == 2) - { - m_axis = 1; - for (ndInt32 i = 0; i < boxCount; ++i) - { - const ndNodeBuilder& box = boxArray[i]; - const ndVector& p0 = box.m_p0; - const ndVector& p1 = box.m_p1; - minP = minP.GetMin (p0); - maxP = maxP.GetMax (p1); - } - - } - else - { - ndVector median (ndVector::m_zero); - ndVector varian (ndVector::m_zero); - for (ndInt32 i = 0; i < boxCount; ++i) - { - const ndNodeBuilder& box = boxArray[i]; - - const ndVector& p0 = box.m_p0; - const ndVector& p1 = box.m_p1; - - minP = minP.GetMin (p0); - maxP = maxP.GetMax (p1); - ndVector p (ndVector::m_half * (p0 + p1)); - - median += p; - varian += p * p; - } - - varian = varian.Scale (ndFloat32 (boxCount)) - median * median; - - ndInt32 index = 0; - ndFloat32 maxVarian = ndFloat32 (-1.0e10f); - for (ndInt32 i = 0; i < 3; ++i) - { - if (varian[i] > maxVarian) - { - index = i; - maxVarian = varian[i]; - } - } - - ndVector center = median.Scale (ndFloat32 (1.0f) / ndFloat32 (boxCount)); - ndFloat32 test = center[index]; - ndInt32 i0 = 0; - ndInt32 i1 = boxCount - 1; - do - { - for (; i0 <= i1; ++i0) - { - const ndNodeBuilder& box = boxArray[i0]; - ndFloat32 val = (box.m_p0[index] + box.m_p1[index]) * ndFloat32 (0.5f); - if (val > test) - { - break; - } - } - - for (; i1 >= i0; --i1) - { - const ndNodeBuilder& box = boxArray[i1]; - ndFloat32 val = (box.m_p0[index] + box.m_p1[index]) * ndFloat32 (0.5f); - if (val < test) - { - break; - } - } - - if (i0 < i1) - { - ndSwap(boxArray[i0], boxArray[i1]); - i0++; - i1--; - } - } while (i0 <= i1); - - if (i0 > 0) - { - i0 --; - } - if ((i0 + 1) >= boxCount) - { - i0 = boxCount - 2; - } - - m_axis = i0 + 1; - } - - ndAssert (maxP.m_x - minP.m_x >= ndFloat32 (0.0f)); - ndAssert (maxP.m_y - minP.m_y >= ndFloat32 (0.0f)); - ndAssert (maxP.m_z - minP.m_z >= ndFloat32 (0.0f)); - m_p0 = minP; - m_p1 = maxP; - } - - ndInt32 m_axis; - ndVector m_p0; - ndVector m_p1; -}; - -ndAabbPolygonSoup::ndAabbPolygonSoup () - :ndPolygonSoupDatabase() - ,m_aabb(nullptr) - ,m_indices(nullptr) - ,m_nodesCount(0) - ,m_indexCount(0) -{ -} - -ndAabbPolygonSoup::~ndAabbPolygonSoup () -{ - if (m_aabb) - { - ndMemory::Free(m_aabb); - ndMemory::Free(m_indices); - } -} - -ndFloat32 ndAabbPolygonSoup::CalculateFaceMaxDiagonal (const ndVector* const vertex, ndInt32 indexCount, const ndInt32* const indexArray) const -{ - ndFloat32 maxSize = ndFloat32 (0.0f); - ndInt32 index = indexArray[indexCount - 1]; - ndVector p0 (vertex[index]); - for (ndInt32 i = 0; i < indexCount; ++i) - { - ndInt32 index1 = indexArray[i]; - ndVector p1 (vertex[index1]); - - ndVector dir (p1 - p0); - ndAssert (dir.m_w == ndFloat32 (0.0f)); - dir = dir.Normalize(); - - ndFloat32 maxVal = ndFloat32 (-1.0e10f); - ndFloat32 minVal = ndFloat32 ( 1.0e10f); - for (ndInt32 j = 0; j < indexCount; ++j) - { - ndInt32 index2 = indexArray[j]; - ndVector q (vertex[index2]); - ndFloat32 val = dir.DotProduct(q).GetScalar(); - minVal = ndMin(minVal, val); - maxVal = ndMax(maxVal, val); - } - - ndFloat32 size = maxVal - minVal; - maxSize = ndMax(maxSize, size); - p0 = p1; - } - - return maxSize; -} - -void ndAabbPolygonSoup::GetAABB (ndVector& p0, ndVector& p1) const -{ - if (m_aabb) - { - GetNodeAabb (m_aabb, p0, p1); - } - else - { - p0 = ndVector::m_zero; - p1 = ndVector::m_zero; - } -} - -void ndAabbPolygonSoup::CalculateAdjacent () -{ - ndVector p0; - ndVector p1; - GetAABB (p0, p1); - ndFastAabb box (p0, p1); - - ndPolyhedra adjacentMesh; - adjacentMesh.BeginFace(); - ForAllSectors(box, ndVector::m_zero, ndFloat32(1.0f), CalculateAllFaceEdgeNormals, &adjacentMesh); - adjacentMesh.EndFace(); - - ndInt32 mark = adjacentMesh.IncLRU(); - ndPolyhedra::Iterator iter(adjacentMesh); - const ndTriplex* const vertexArray = (ndTriplex*)GetLocalVertexPool(); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_mark != mark) && (edge->m_incidentFace >= 0) && (edge->m_twin->m_incidentFace >= 0)) - { - ndInt32 indexCount0 = 0; - ndInt32 indexCount1 = 0; - ndInt32 offsetIndex0 = -1; - ndInt32 offsetIndex1 = -1; - ndInt32* const indexArray0 = (ndInt32*)edge->m_userData; - ndInt32* const indexArray1 = (ndInt32*)edge->m_twin->m_userData; - ndEdge* ptr = edge; - do - { - indexCount0++; - ptr = ptr->m_next; - } while (ptr != edge); - - ptr = edge->m_twin; - do - { - indexCount1++; - ptr = ptr->m_next; - } while (ptr != edge->m_twin); - - ndVector n0(&vertexArray[indexArray0[indexCount0 + 1]].m_x); - ndVector q0(&vertexArray[indexArray0[0]].m_x); - n0 = n0 & ndVector::m_triplexMask; - q0 = q0 & ndVector::m_triplexMask; - - ndVector n1(&vertexArray[indexArray1[indexCount1 + 1]].m_x); - ndVector q1(&vertexArray[indexArray1[0]].m_x); - n1 = n1 & ndVector::m_triplexMask; - q1 = q1 & ndVector::m_triplexMask; - - ndPlane plane0(n0, -n0.DotProduct(q0).GetScalar()); - ndPlane plane1(n1, -n1.DotProduct(q1).GetScalar()); - - ndFloat32 maxDist0 = ndFloat32(-1.0f); - for (ndInt32 i = 0; i < indexCount1; ++i) - { - if (edge->m_twin->m_incidentVertex == indexArray1[i]) - { - offsetIndex1 = i; - } - ndVector point(&vertexArray[indexArray1[i]].m_x); - ndFloat32 dist(plane0.Evalue(point & ndVector::m_triplexMask)); - maxDist0 = ndMax(maxDist0, dist); - } - - ndFloat32 maxDist1 = ndFloat32(-1.0f); - for (ndInt32 i = 0; i < indexCount0; ++i) - { - if (edge->m_incidentVertex == indexArray0[i]) - { - offsetIndex0 = i; - } - ndVector point(&vertexArray[indexArray0[i]].m_x); - ndFloat32 dist(plane1.Evalue(point & ndVector::m_triplexMask)); - maxDist1 = ndMax(maxDist1, dist); - } - - bool edgeIsConvex = (maxDist0 <= ndFloat32(1.0e-3f)); - edgeIsConvex = edgeIsConvex && (maxDist1 <= ndFloat32(1.0e-3f)); - edgeIsConvex = edgeIsConvex || (n0.DotProduct(n1).GetScalar() > ndFloat32(0.9991f)); - - //hacks for testing adjacency - //edgeIsConvex = edgeIsConvex || (n0.DotProduct(n1).GetScalar() > ndFloat32(0.5f)); - //edgeIsConvex = true; - if (edgeIsConvex) - { - ndAssert(offsetIndex0 >= 0); - ndAssert(offsetIndex1 >= 0); - indexArray0[indexCount0 + 2 + offsetIndex0] = indexArray1[indexCount1 + 1]; - indexArray1[indexCount1 + 2 + offsetIndex1] = indexArray0[indexCount0 + 1]; - } - } - edge->m_mark = mark; - edge->m_twin->m_mark = mark; - } - - ndStack pool ((m_indexCount / 2) - 1); - ndInt32 normalCount = 0; - for (ndInt32 i = 0; i < m_nodesCount; ++i) - { - const ndNode* const node = &m_aabb[i]; - if (node->m_left.IsLeaf()) - { - ndInt32 vCount = ndInt32 (node->m_left.GetCount()); - if (vCount) - { - ndInt32 index = ndInt32 (node->m_left.GetIndex()); - ndInt32* const face = &m_indices[index]; - - ndInt32 j0 = 2 * (vCount + 1) - 1; - ndVector normal (&vertexArray[face[vCount + 1]].m_x); - normal = normal & ndVector::m_triplexMask; - ndAssert (ndAbs (normal.DotProduct(normal).GetScalar() - ndFloat32 (1.0f)) < ndFloat32 (1.0e-6f)); - ndVector q0 (&vertexArray[face[vCount - 1]].m_x); - q0 = q0 & ndVector::m_triplexMask; - for (ndInt32 j = 0; j < vCount; ++j) - { - ndInt32 j1 = vCount + 2 + j; - ndVector q1 (&vertexArray[face[j]].m_x); - q1 = q1 & ndVector::m_triplexMask; - if (face[j0] & D_CONCAVE_EDGE_MASK) - { - ndVector e (q1 - q0); - ndVector n (e.CrossProduct(normal).Normalize()); - ndAssert (ndAbs (n.DotProduct(n).GetScalar() - ndFloat32 (1.0f)) < ndFloat32 (1.0e-6f)); - pool[normalCount].m_x = n.m_x; - pool[normalCount].m_y = n.m_y; - pool[normalCount].m_z = n.m_z; - face[j0] = normalCount | D_CONCAVE_EDGE_MASK; - normalCount ++; - } - q0 = q1; - j0 = j1; - } - } - } - - if (node->m_right.IsLeaf()) - { - ndInt32 vCount = ndInt32 (node->m_right.GetCount()); - if (vCount) - { - ndInt32 index = ndInt32 (node->m_right.GetIndex()); - ndInt32* const face = &m_indices[index]; - - ndInt32 j0 = 2 * (vCount + 1) - 1; - ndVector normal (&vertexArray[face[vCount + 1]].m_x); - normal = normal & ndVector::m_triplexMask; - ndAssert (ndAbs (normal.DotProduct(normal).GetScalar() - ndFloat32 (1.0f)) < ndFloat32 (1.0e-6f)); - ndVector q0 (&vertexArray[face[vCount - 1]].m_x); - q0 = q0 & ndVector::m_triplexMask; - for (ndInt32 j = 0; j < vCount; ++j) - { - ndInt32 j1 = vCount + 2 + j; - ndVector q1 (&vertexArray[face[j]].m_x); - q1 = q1 & ndVector::m_triplexMask; - if (face[j0] & D_CONCAVE_EDGE_MASK) - { - ndVector e (q1 - q0); - ndVector n (e.CrossProduct(normal).Normalize()); - ndAssert (ndAbs (n.DotProduct(n).GetScalar() - ndFloat32 (1.0f)) < ndFloat32 (1.0e-6f)); - pool[normalCount].m_x = n.m_x; - pool[normalCount].m_y = n.m_y; - pool[normalCount].m_z = n.m_z; - face[j0] = normalCount | D_CONCAVE_EDGE_MASK; - normalCount ++; - } - q0 = q1; - j0 = j1; - } - } - } - } - - if (normalCount) - { - ndStack indexArray (normalCount); - ndInt32 newNormalCount = ndVertexListToIndexList (&pool[0].m_x, sizeof (ndTriplex), 3, normalCount, &indexArray[0], ndFloat32 (1.0e-6f)); - - ndInt32 oldCount = GetVertexCount(); - ndTriplex* const vertexArray1 = (ndTriplex*)ndMemory::Malloc (sizeof (ndTriplex) * (oldCount + newNormalCount)); - ndMemCpy(vertexArray1, (ndTriplex*)GetLocalVertexPool(), oldCount); - ndMemCpy(&vertexArray1[oldCount], &pool[0], newNormalCount); - - ndMemory::Free(GetLocalVertexPool()); - - m_localVertex = &vertexArray1[0].m_x; - m_vertexCount = oldCount + newNormalCount; - - for (ndInt32 i = 0; i < m_nodesCount; ++i) - { - const ndNode* const node = &m_aabb[i]; - if (node->m_left.IsLeaf()) - { - ndInt32 vCount = ndInt32 (node->m_left.GetCount()); - ndInt32 index = ndInt32 (node->m_left.GetIndex()); - ndInt32* const face = &m_indices[index]; - for (ndInt32 j = 0; j < vCount; ++j) - { - ndInt32 edgeIndexNormal = face[vCount + 2 + j]; - if (edgeIndexNormal & D_CONCAVE_EDGE_MASK) - { - ndInt32 k = edgeIndexNormal & (~D_CONCAVE_EDGE_MASK); - face[vCount + 2 + j] = (indexArray[k] + oldCount) | D_CONCAVE_EDGE_MASK; - } - #ifdef _DEBUG - //ndVector normal (&vertexArray1[face[vCount + 2 + j]].m_x); - ndVector normal (&vertexArray1[face[vCount + 2 + j] & (~D_CONCAVE_EDGE_MASK)].m_x); - normal = normal & ndVector::m_triplexMask; - ndAssert (ndAbs (normal.DotProduct(normal).GetScalar() - ndFloat32 (1.0f)) < ndFloat32 (1.0e-6f)); - #endif - } - } - - if (node->m_right.IsLeaf()) - { - ndInt32 vCount = ndInt32 (node->m_right.GetCount()); - ndInt32 index = ndInt32 (node->m_right.GetIndex()); - ndInt32* const face = &m_indices[index]; - for (ndInt32 j = 0; j < vCount; ++j) - { - ndInt32 edgeIndexNormal = face[vCount + 2 + j]; - if (edgeIndexNormal & D_CONCAVE_EDGE_MASK) - { - ndInt32 k = edgeIndexNormal & (~D_CONCAVE_EDGE_MASK); - face[vCount + 2 + j] = (indexArray[k] + oldCount) | D_CONCAVE_EDGE_MASK; - } - - #ifdef _DEBUG - //ndVector normal (&vertexArray1[face[vCount + 2 + j]].m_x); - ndVector normal(&vertexArray1[face[vCount + 2 + j] & (~D_CONCAVE_EDGE_MASK)].m_x); - normal = normal & ndVector::m_triplexMask; - ndAssert (ndAbs (normal.DotProduct(normal).GetScalar() - ndFloat32 (1.0f)) < ndFloat32 (1.0e-6f)); - #endif - } - } - } - } -} - -ndIntersectStatus ndAabbPolygonSoup::CalculateAllFaceEdgeNormals(void* const context, const ndFloat32* const, ndInt32, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32) -{ - ndInt32 face[256]; - ndInt64 data[256]; - ndPolyhedra& adjacency = *((ndPolyhedra*)context); - - ndIntPtr userData; - userData.m_ptr = (void*)indexArray; - for (ndInt32 i = 0; i < indexCount; ++i) - { - face[i] = indexArray[i]; - data[i] = userData.m_int; - } - adjacency.AddFace(indexCount, face, data); - return m_continueSearh; -} - -ndAabbPolygonSoup::ndNodeBuilder* ndAabbPolygonSoup::BuildTopDown (ndNodeBuilder* const leafArray, ndInt32 firstBox, ndInt32 lastBox, ndNodeBuilder** const allocator) const -{ - ndAssert (firstBox >= 0); - ndAssert (lastBox >= 0); - - if (lastBox == firstBox) - { - return &leafArray[firstBox]; - } - else - { - ndSplitInfo info (&leafArray[firstBox], lastBox - firstBox + 1); - - ndNodeBuilder* const parent = new (*allocator) ndNodeBuilder (info.m_p0, info.m_p1); - *allocator = *allocator + 1; - - ndAssert (parent); - parent->m_right = BuildTopDown (leafArray, firstBox + info.m_axis, lastBox, allocator); - parent->m_right->m_parent = parent; - - parent->m_left = BuildTopDown (leafArray, firstBox, firstBox + info.m_axis - 1, allocator); - parent->m_left->m_parent = parent; - return parent; - } -} - -void ndAabbPolygonSoup::Create (const ndPolygonSoupBuilder& builder) -{ - if (builder.m_faceVertexCount.GetCount() == 0) - { - return; - } - ndAssert (builder.m_faceVertexCount.GetCount() >= 1); - m_strideInBytes = sizeof (ndTriplex); - m_nodesCount = ((builder.m_faceVertexCount.GetCount() - 1) < 1) ? 1 : ndInt32(builder.m_faceVertexCount.GetCount()) - 1; - m_aabb = (ndNode*) ndMemory::Malloc (sizeof (ndNode) * m_nodesCount); - m_indexCount = ndInt32(builder.m_vertexIndex.GetCount() * 2 + builder.m_faceVertexCount.GetCount()); - - if (builder.m_faceVertexCount.GetCount() == 1) - { - m_indexCount *= 2; - } - - m_indices = (ndInt32*) ndMemory::Malloc (sizeof (ndInt32) * m_indexCount); - ndStack tmpVertexArrayCount(ndInt32(builder.m_vertexPoints.GetCount() + builder.m_normalPoints.GetCount() + builder.m_faceVertexCount.GetCount() * 2 + 4)); - - ndVector* const tmpVertexArray = &tmpVertexArrayCount[0]; - for (ndInt32 i = 0; i < builder.m_vertexPoints.GetCount(); ++i) - { - tmpVertexArray[i] = builder.m_vertexPoints[i]; - } - - for (ndInt32 i = 0; i < builder.m_normalPoints.GetCount(); ++i) - { - tmpVertexArray[i + builder.m_vertexPoints.GetCount()] = builder.m_normalPoints[i]; - } - - const ndInt32* const indices = &builder.m_vertexIndex[0]; - ndStack constructor (ndInt32(builder.m_faceVertexCount.GetCount() * 2 + 16)); - - ndInt32 polygonIndex = 0; - ndInt32 allocatorIndex = 0; - if (builder.m_faceVertexCount.GetCount() == 1) - { - ndInt32 indexCount = builder.m_faceVertexCount[0] - 1; - new (&constructor[allocatorIndex]) ndNodeBuilder (&tmpVertexArray[0], 0, indexCount, &indices[0]); - allocatorIndex ++; - } - for (ndInt32 i = 0; i < builder.m_faceVertexCount.GetCount(); ++i) - { - ndInt32 indexCount = builder.m_faceVertexCount[i] - 1; - new (&constructor[allocatorIndex]) ndNodeBuilder (&tmpVertexArray[0], i, indexCount, &indices[polygonIndex]); - allocatorIndex ++; - polygonIndex += (indexCount + 1); - } - - ndNodeBuilder* constructorAllocator = &constructor[allocatorIndex]; - ndNodeBuilder* const root = BuildTopDown (&constructor[0], 0, allocatorIndex - 1, &constructorAllocator); - - ndAssert (root); - ndList list; - list.Append(root); - ndInt32 nodeIndex = 0; - while (list.GetCount()) - { - ndNodeBuilder* const node = list.GetFirst()->GetInfo(); - list.Remove(list.GetFirst()); - - if (node->m_left) - { - node->m_enumeration = nodeIndex; - nodeIndex ++; - ndAssert (node->m_right); - list.Append(node->m_left); - list.Append(node->m_right); - } - } - ndAssert(!list.GetCount()); - - ndInt32 aabbBase = ndInt32(builder.m_vertexPoints.GetCount() + builder.m_normalPoints.GetCount()); - - ndVector* const aabbPoints = &tmpVertexArray[aabbBase]; - - ndInt32 vertexIndex = 0; - ndInt32 aabbNodeIndex = 0; - list.Append(root); - ndInt32 indexMap = 0; - while (list.GetCount()) - { - ndNodeBuilder* const node = list.GetFirst()->GetInfo(); - list.Remove(list.GetFirst()); - - if (node->m_enumeration >= 0) - { - ndAssert (node->m_left); - ndAssert (node->m_right); - ndNode& aabbNode = m_aabb[aabbNodeIndex]; - aabbNodeIndex ++; - ndAssert (aabbNodeIndex <= m_nodesCount); - - if (node->m_parent) - { - if (node->m_parent->m_left == node) - { - m_aabb[node->m_parent->m_enumeration].m_left = ndNode::ndLeafNodePtr (ndUnsigned32 (&m_aabb[node->m_enumeration] - m_aabb)); - } - else - { - ndAssert (node->m_parent->m_right == node); - m_aabb[node->m_parent->m_enumeration].m_right = ndNode::ndLeafNodePtr (ndUnsigned32 (&m_aabb[node->m_enumeration] - m_aabb)); - } - } - - aabbPoints[vertexIndex + 0] = node->m_p0; - aabbPoints[vertexIndex + 1] = node->m_p1; - - aabbNode.m_indexBox0 = aabbBase + vertexIndex; - aabbNode.m_indexBox1 = aabbBase + vertexIndex + 1; - - vertexIndex += 2; - } - else - { - ndAssert (!node->m_left); - ndAssert (!node->m_right); - - if (node->m_parent) - { - if (node->m_parent->m_left == node) - { - m_aabb[node->m_parent->m_enumeration].m_left = ndNode::ndLeafNodePtr (ndUnsigned32(node->m_indexCount), ndUnsigned32(indexMap)); - } - else - { - ndAssert (node->m_parent->m_right == node); - m_aabb[node->m_parent->m_enumeration].m_right = ndNode::ndLeafNodePtr (ndUnsigned32(node->m_indexCount), ndUnsigned32(indexMap)); - } - } - - // index format i0, i1, i2, ... , id, normal, e0Normal, e1Normal, e2Normal, ..., faceSize - for (ndInt32 j = 0; j < node->m_indexCount; ++j) - { - m_indices[indexMap + j] = node->m_faceIndices[j]; - m_indices[indexMap + j + node->m_indexCount + 2] = D_CONCAVE_EDGE_MASK | 0xffffffff; - } - - // face attribute - m_indices[indexMap + node->m_indexCount] = node->m_faceIndices[node->m_indexCount]; - // face normal - m_indices[indexMap + node->m_indexCount + 1] = ndInt32(builder.m_vertexPoints.GetCount()) + builder.m_normalIndex[node->m_faceIndex]; - // face size - ndFloat32 faceMaxDiag = CalculateFaceMaxDiagonal(&tmpVertexArray[0], node->m_indexCount, node->m_faceIndices); - ndInt32 quantizedDiagSize = ndInt32(ndFloor(faceMaxDiag / D_FACE_CLIP_DIAGONAL_SCALE + ndFloat32(1.0f))); - m_indices[indexMap + node->m_indexCount * 2 + 2] = quantizedDiagSize; - - indexMap += node->m_indexCount * 2 + 3; - } - - if (node->m_left) - { - ndAssert (node->m_right); - list.Append(node->m_left); - list.Append(node->m_right); - } - } - - ndStack indexArray (vertexIndex); - ndInt32 aabbPointCount = ndVertexListToIndexList (&aabbPoints[0].m_x, sizeof (ndVector), 3, vertexIndex, &indexArray[0], ndFloat32 (1.0e-6f)); - - m_vertexCount = aabbBase + aabbPointCount; - m_localVertex = (ndFloat32*) ndMemory::Malloc (sizeof (ndTriplex) * m_vertexCount); - - ndTriplex* const dstPoints = (ndTriplex*)m_localVertex; - for (ndInt32 i = 0; i < m_vertexCount; ++i) - { - dstPoints[i].m_x = tmpVertexArray[i].m_x; - dstPoints[i].m_y = tmpVertexArray[i].m_y; - dstPoints[i].m_z = tmpVertexArray[i].m_z; - } - - for (ndInt32 i = 0; i < m_nodesCount; ++i) - { - ndNode& box = m_aabb[i]; - - ndInt32 j = box.m_indexBox0 - aabbBase; - box.m_indexBox0 = indexArray[j] + aabbBase; - - j = box.m_indexBox1 - aabbBase; - box.m_indexBox1 = indexArray[j] + aabbBase; - } - - if (builder.m_faceVertexCount.GetCount() == 1) - { - m_aabb[0].m_right = ndNode::ndLeafNodePtr (0, 0); - } -} - -void ndAabbPolygonSoup::Serialize (const char* const path) const -{ - FILE* const file = fopen(path, "wb"); - if (file) - { - fwrite(&m_vertexCount, sizeof(ndInt32), 1, file); - fwrite(&m_indexCount, sizeof(ndInt32), 1, file); - fwrite(&m_nodesCount, sizeof(ndInt32), 1, file); - if (m_aabb) - { - fwrite(m_localVertex, sizeof(ndTriplex) * m_vertexCount, 1, file); - fwrite(m_indices, sizeof(ndInt32) * m_indexCount, 1, file); - fwrite(m_aabb, sizeof(ndNode) * m_nodesCount, 1, file); - } - fclose(file); - } -} - -void ndAabbPolygonSoup::Deserialize (const char* const path) -{ - FILE* const file = fopen(path, "rb"); - if (file) - { - size_t readValues = 0; - readValues++; - m_strideInBytes = sizeof(ndTriplex); - readValues = fread(&m_vertexCount, sizeof(ndInt32), 1, file); - readValues = fread(&m_indexCount, sizeof(ndInt32), 1, file); - readValues = fread(&m_nodesCount, sizeof(ndInt32), 1, file); - - if (m_vertexCount) - { - m_localVertex = (ndFloat32*)ndMemory::Malloc(sizeof(ndTriplex) * m_vertexCount); - m_indices = (ndInt32*)ndMemory::Malloc(sizeof(ndInt32) * m_indexCount); - m_aabb = (ndNode*)ndMemory::Malloc(sizeof(ndNode) * m_nodesCount); - - readValues = fread(m_localVertex, sizeof(ndTriplex) * m_vertexCount, 1, file); - readValues = fread(m_indices, sizeof(ndInt32) * m_indexCount, 1, file); - readValues = fread(m_aabb, sizeof(ndNode) * m_nodesCount, 1, file); - } - else - { - m_localVertex = nullptr; - m_indices = nullptr; - m_aabb = nullptr; - } - - fclose(file); - } -} - -ndVector ndAabbPolygonSoup::ForAllSectorsSupportVertex (const ndVector& dir) const -{ - ndVector supportVertex (ndFloat32 (0.0f)); - if (m_aabb) - { - ndFloat32 aabbProjection[DG_STACK_DEPTH]; - const ndNode *stackPool[DG_STACK_DEPTH]; - - ndInt32 stack = 1; - stackPool[0] = m_aabb; - aabbProjection[0] = ndFloat32 (1.0e10f); - const ndTriplex* const boxArray = (ndTriplex*)m_localVertex; - - ndFloat32 maxProj = ndFloat32 (-1.0e20f); - ndInt32 ix = (dir[0] > ndFloat32 (0.0f)) ? 1 : 0; - ndInt32 iy = (dir[1] > ndFloat32 (0.0f)) ? 1 : 0; - ndInt32 iz = (dir[2] > ndFloat32 (0.0f)) ? 1 : 0; - - while (stack) - { - ndFloat32 boxSupportValue; - - stack--; - boxSupportValue = aabbProjection[stack]; - if (boxSupportValue > maxProj) { - ndFloat32 backSupportDist = ndFloat32 (0.0f); - ndFloat32 frontSupportDist = ndFloat32 (0.0f); - const ndNode* const me = stackPool[stack]; - if (me->m_left.IsLeaf()) - { - backSupportDist = ndFloat32 (-1.0e20f); - ndInt32 index = ndInt32 (me->m_left.GetIndex()); - ndInt32 vCount = ndInt32 (me->m_left.GetCount()); - ndVector vertex (ndFloat32 (0.0f)); - for (ndInt32 j = 0; j < vCount; ++j) - { - ndInt32 i0 = m_indices[index + j] * ndInt32 (sizeof (ndTriplex) / sizeof (ndFloat32)); - ndVector p (&boxArray[i0].m_x); - p = p & ndVector::m_triplexMask; - ndFloat32 dist = p.DotProduct(dir).GetScalar(); - if (dist > backSupportDist) - { - backSupportDist = dist; - vertex = p; - } - } - - if (backSupportDist > maxProj) - { - maxProj = backSupportDist; - supportVertex = vertex; - } - - } - else - { - ndVector box[2]; - const ndNode* const node = me->m_left.GetNode(m_aabb); - box[0].m_x = boxArray[node->m_indexBox0].m_x; - box[0].m_y = boxArray[node->m_indexBox0].m_y; - box[0].m_z = boxArray[node->m_indexBox0].m_z; - box[1].m_x = boxArray[node->m_indexBox1].m_x; - box[1].m_y = boxArray[node->m_indexBox1].m_y; - box[1].m_z = boxArray[node->m_indexBox1].m_z; - - ndVector supportPoint (box[ix].m_x, box[iy].m_y, box[iz].m_z, ndFloat32 (0.0)); - backSupportDist = supportPoint.DotProduct(dir).GetScalar(); - } - - if (me->m_right.IsLeaf()) - { - frontSupportDist = ndFloat32 (-1.0e20f); - ndInt32 index = ndInt32 (me->m_right.GetIndex()); - ndInt32 vCount = ndInt32 (me->m_right.GetCount()); - ndVector vertex (ndFloat32 (0.0f)); - for (ndInt32 j = 0; j < vCount; ++j) - { - ndInt32 i0 = m_indices[index + j] * ndInt32 (sizeof (ndTriplex) / sizeof (ndFloat32)); - ndVector p (&boxArray[i0].m_x); - p = p & ndVector::m_triplexMask; - ndFloat32 dist = p.DotProduct(dir).GetScalar(); - if (dist > frontSupportDist) - { - frontSupportDist = dist; - vertex = p; - } - } - if (frontSupportDist > maxProj) - { - maxProj = frontSupportDist; - supportVertex = vertex; - } - - } - else - { - ndVector box[2]; - const ndNode* const node = me->m_right.GetNode(m_aabb); - box[0].m_x = boxArray[node->m_indexBox0].m_x; - box[0].m_y = boxArray[node->m_indexBox0].m_y; - box[0].m_z = boxArray[node->m_indexBox0].m_z; - box[1].m_x = boxArray[node->m_indexBox1].m_x; - box[1].m_y = boxArray[node->m_indexBox1].m_y; - box[1].m_z = boxArray[node->m_indexBox1].m_z; - - ndVector supportPoint (box[ix].m_x, box[iy].m_y, box[iz].m_z, ndFloat32 (0.0f)); - frontSupportDist = supportPoint.DotProduct(dir).GetScalar(); - } - - if (frontSupportDist >= backSupportDist) - { - if (!me->m_left.IsLeaf()) - { - aabbProjection[stack] = backSupportDist; - stackPool[stack] = me->m_left.GetNode(m_aabb); - stack++; - } - - if (!me->m_right.IsLeaf()) - { - aabbProjection[stack] = frontSupportDist; - stackPool[stack] = me->m_right.GetNode(m_aabb); - stack++; - } - - } - else - { - if (!me->m_right.IsLeaf()) - { - aabbProjection[stack] = frontSupportDist; - stackPool[stack] = me->m_right.GetNode(m_aabb); - stack++; - } - - if (!me->m_left.IsLeaf()) - { - aabbProjection[stack] = backSupportDist; - stackPool[stack] = me->m_left.GetNode(m_aabb); - stack++; - } - } - } - } - } - return supportVertex; -} - -void ndAabbPolygonSoup::ForAllSectorsRayHit (const ndFastRay& raySrc, ndFloat32 maxParam, ndRayIntersectCallback callback, void* const context) const -{ - const ndNode *stackPool[DG_STACK_DEPTH]; - ndFloat32 distance[DG_STACK_DEPTH]; - ndFastRay ray (raySrc); - - ndInt32 stack = 1; - const ndTriplex* const vertexArray = (ndTriplex*) m_localVertex; - - stackPool[0] = m_aabb; - distance[0] = m_aabb->RayDistance(ray, vertexArray); - while (stack) - { - stack --; - ndFloat32 dist = distance[stack]; - if (dist > maxParam) - { - break; - } - else - { - const ndNode *const me = stackPool[stack]; - if (me->m_left.IsLeaf()) - { - ndInt32 vCount = ndInt32 (me->m_left.GetCount()); - if (vCount > 0) - { - ndInt32 index = ndInt32 (me->m_left.GetIndex()); - ndFloat32 param = callback(context, &vertexArray[0].m_x, sizeof (ndTriplex), &m_indices[index], vCount); - ndAssert (param >= ndFloat32 (0.0f)); - if (param < maxParam) - { - maxParam = param; - if (maxParam == ndFloat32 (0.0f)) - { - break; - } - } - } - - } - else - { - const ndNode* const node = me->m_left.GetNode(m_aabb); - ndFloat32 dist1 = node->RayDistance(ray, vertexArray); - if (dist1 < maxParam) - { - ndInt32 j = stack; - for ( ; j && (dist1 > distance[j - 1]); j --) - { - stackPool[j] = stackPool[j - 1]; - distance[j] = distance[j - 1]; - } - ndAssert (stack < DG_STACK_DEPTH); - stackPool[j] = node; - distance[j] = dist1; - stack++; - } - } - - if (me->m_right.IsLeaf()) - { - ndInt32 vCount = ndInt32 (me->m_right.GetCount()); - if (vCount > 0) - { - ndInt32 index = ndInt32 (me->m_right.GetIndex()); - ndFloat32 param = callback(context, &vertexArray[0].m_x, sizeof (ndTriplex), &m_indices[index], vCount); - ndAssert (param >= ndFloat32 (0.0f)); - if (param < maxParam) - { - maxParam = param; - if (maxParam == ndFloat32 (0.0f)) - { - break; - } - } - } - } - else - { - const ndNode* const node = me->m_right.GetNode(m_aabb); - ndFloat32 dist1 = node->RayDistance(ray, vertexArray); - if (dist1 < maxParam) - { - ndInt32 j = stack; - for ( ; j && (dist1 > distance[j - 1]); j --) - { - stackPool[j] = stackPool[j - 1]; - distance[j] = distance[j - 1]; - } - ndAssert (stack < DG_STACK_DEPTH); - stackPool[j] = node; - distance[j] = dist1; - stack++; - } - } - } - } -} - -void ndAabbPolygonSoup::ForAllSectors (const ndFastAabb& obbAabbInfo, const ndVector& boxDistanceTravel, ndFloat32, ndAaabbIntersectCallback callback, void* const context) const -{ - ndAssert (ndAbs(ndAbs(obbAabbInfo[0][0]) - obbAabbInfo.m_absDir[0][0]) < ndFloat32 (1.0e-4f)); - ndAssert (ndAbs(ndAbs(obbAabbInfo[1][1]) - obbAabbInfo.m_absDir[1][1]) < ndFloat32 (1.0e-4f)); - ndAssert (ndAbs(ndAbs(obbAabbInfo[2][2]) - obbAabbInfo.m_absDir[2][2]) < ndFloat32 (1.0e-4f)); - - ndAssert (ndAbs(ndAbs(obbAabbInfo[0][1]) - obbAabbInfo.m_absDir[1][0]) < ndFloat32 (1.0e-4f)); - ndAssert (ndAbs(ndAbs(obbAabbInfo[0][2]) - obbAabbInfo.m_absDir[2][0]) < ndFloat32 (1.0e-4f)); - ndAssert (ndAbs(ndAbs(obbAabbInfo[1][2]) - obbAabbInfo.m_absDir[2][1]) < ndFloat32 (1.0e-4f)); - - if (m_aabb) - { - ndFloat32 distance[DG_STACK_DEPTH]; - const ndNode* stackPool[DG_STACK_DEPTH]; - - const ndInt32 stride = sizeof (ndTriplex) / sizeof (ndFloat32); - const ndTriplex* const vertexArray = (ndTriplex*) m_localVertex; - - ndAssert (boxDistanceTravel.m_w == ndFloat32 (0.0f)); - if (boxDistanceTravel.DotProduct(boxDistanceTravel).GetScalar() < ndFloat32 (1.0e-8f)) - { - ndInt32 stack = 1; - stackPool[0] = m_aabb; - distance[0] = m_aabb->BoxPenetration(obbAabbInfo, vertexArray); - if (distance[0] <= ndFloat32(0.0f)) - { - obbAabbInfo.m_separationDistance = ndMin(obbAabbInfo.m_separationDistance[0], -distance[0]); - } - while (stack) - { - stack --; - ndFloat32 dist = distance[stack]; - if (dist > ndFloat32 (0.0f)) - { - const ndNode* const me = stackPool[stack]; - if (me->m_left.IsLeaf()) - { - ndInt32 index = ndInt32 (me->m_left.GetIndex()); - ndInt32 vCount = ndInt32 (me->m_left.GetCount()); - if (vCount > 0) - { - const ndInt32* const indices = &m_indices[index]; - ndInt32 normalIndex = indices[vCount + 1]; - ndVector faceNormal (&vertexArray[normalIndex].m_x); - faceNormal = faceNormal & ndVector::m_triplexMask; - ndFloat32 dist1 = obbAabbInfo.PolygonBoxDistance (faceNormal, vCount, indices, stride, &vertexArray[0].m_x); - if (dist1 > ndFloat32 (0.0f)) - { - obbAabbInfo.m_separationDistance = ndFloat32(0.0f); - ndAssert (vCount >= 3); - if (callback(context, &vertexArray[0].m_x, sizeof (ndTriplex), indices, vCount, dist1) == m_stopSearch) - { - return; - } - } - else - { - obbAabbInfo.m_separationDistance = ndMin(obbAabbInfo.m_separationDistance[0], -dist1); - } - } - } - else - { - const ndNode* const node = me->m_left.GetNode(m_aabb); - ndFloat32 dist1 = node->BoxPenetration(obbAabbInfo, vertexArray); - if (dist1 > ndFloat32 (0.0f)) - { - ndInt32 j = stack; - for ( ; j && (dist1 > distance[j - 1]); j --) - { - stackPool[j] = stackPool[j - 1]; - distance[j] = distance[j - 1]; - } - ndAssert (stack < DG_STACK_DEPTH); - stackPool[j] = node; - distance[j] = dist1; - stack++; - } - else - { - obbAabbInfo.m_separationDistance = ndMin(obbAabbInfo.m_separationDistance[0], -dist1); - } - } - - if (me->m_right.IsLeaf()) - { - ndInt32 index = ndInt32 (me->m_right.GetIndex()); - ndInt32 vCount = ndInt32 (me->m_right.GetCount()); - if (vCount > 0) - { - const ndInt32* const indices = &m_indices[index]; - ndInt32 normalIndex = indices[vCount + 1]; - ndVector faceNormal (&vertexArray[normalIndex].m_x); - faceNormal = faceNormal & ndVector::m_triplexMask; - ndFloat32 dist1 = obbAabbInfo.PolygonBoxDistance (faceNormal, vCount, indices, stride, &vertexArray[0].m_x); - if (dist1 > ndFloat32 (0.0f)) - { - ndAssert (vCount >= 3); - obbAabbInfo.m_separationDistance = ndFloat32(0.0f); - if (callback(context, &vertexArray[0].m_x, sizeof (ndTriplex), indices, vCount, dist1) == m_stopSearch) - { - return; - } - } - else - { - obbAabbInfo.m_separationDistance = ndMin(obbAabbInfo.m_separationDistance[0], -dist1); - } - } - } - else - { - const ndNode* const node = me->m_right.GetNode(m_aabb); - ndFloat32 dist1 = node->BoxPenetration(obbAabbInfo, vertexArray); - if (dist1 > ndFloat32 (0.0f)) - { - ndInt32 j = stack; - for ( ; j && (dist1 > distance[j - 1]); j --) - { - stackPool[j] = stackPool[j - 1]; - distance[j] = distance[j - 1]; - } - ndAssert (stack < DG_STACK_DEPTH); - stackPool[j] = node; - distance[j] = dist1; - stack++; - } - else - { - obbAabbInfo.m_separationDistance = ndMin(obbAabbInfo.m_separationDistance[0], -dist1); - } - } - } - } - } - else - { - ndFastRay ray (ndVector::m_zero, boxDistanceTravel); - ndFastRay obbRay (ndVector::m_zero, obbAabbInfo.UnrotateVector(boxDistanceTravel)); - ndInt32 stack = 1; - stackPool[0] = m_aabb; - distance [0] = m_aabb->BoxIntersect (ray, obbRay, obbAabbInfo, vertexArray); - - while (stack) - { - stack --; - const ndFloat32 dist = distance[stack]; - const ndNode* const me = stackPool[stack]; - if (dist < ndFloat32 (1.0f)) - { - if (me->m_left.IsLeaf()) - { - ndInt32 index = ndInt32 (me->m_left.GetIndex()); - ndInt32 vCount = ndInt32 (me->m_left.GetCount()); - if (vCount > 0) - { - const ndInt32* const indices = &m_indices[index]; - ndInt32 normalIndex = indices[vCount + 1]; - ndVector faceNormal (&vertexArray[normalIndex].m_x); - faceNormal = faceNormal & ndVector::m_triplexMask; - ndFloat32 hitDistance = obbAabbInfo.PolygonBoxRayDistance (faceNormal, vCount, indices, stride, &vertexArray[0].m_x, ray); - if (hitDistance < ndFloat32 (1.0f)) - { - ndAssert (vCount >= 3); - if (callback(context, &vertexArray[0].m_x, sizeof (ndTriplex), indices, vCount, hitDistance) == m_stopSearch) - { - return; - } - } - } - } - else - { - const ndNode* const node = me->m_left.GetNode(m_aabb); - ndFloat32 dist1 = node->BoxIntersect (ray, obbRay, obbAabbInfo, vertexArray); - if (dist1 < ndFloat32 (1.0f)) - { - ndInt32 j = stack; - for ( ; j && (dist1 > distance[j - 1]); j --) - { - stackPool[j] = stackPool[j - 1]; - distance[j] = distance[j - 1]; - } - ndAssert (stack < DG_STACK_DEPTH); - stackPool[j] = node; - distance[j] = dist1; - stack++; - } - } - - if (me->m_right.IsLeaf()) - { - ndInt32 index = ndInt32 (me->m_right.GetIndex()); - ndInt32 vCount = ndInt32 (me->m_right.GetCount()); - if (vCount > 0) - { - const ndInt32* const indices = &m_indices[index]; - ndInt32 normalIndex = indices[vCount + 1]; - ndVector faceNormal (&vertexArray[normalIndex].m_x); - faceNormal = faceNormal & ndVector::m_triplexMask; - ndFloat32 hitDistance = obbAabbInfo.PolygonBoxRayDistance (faceNormal, vCount, indices, stride, &vertexArray[0].m_x, ray); - if (hitDistance < ndFloat32 (1.0f)) - { - ndAssert (vCount >= 3); - if (callback(context, &vertexArray[0].m_x, sizeof (ndTriplex), indices, vCount, hitDistance) == m_stopSearch) { - return; - } - } - } - } - else - { - const ndNode* const node = me->m_right.GetNode(m_aabb); - ndFloat32 dist1 = node->BoxIntersect (ray, obbRay, obbAabbInfo, vertexArray); - if (dist1 < ndFloat32 (1.0f)) - { - ndInt32 j = stack; - for ( ; j && (dist1 > distance[j - 1]); j --) - { - stackPool[j] = stackPool[j - 1]; - distance[j] = distance[j - 1]; - } - ndAssert (stack < DG_STACK_DEPTH); - stackPool[j] = node; - distance[j] = dist1; - stack ++; - } - } - } - } - } - } -} - -void ndAabbPolygonSoup::ForThisSector(const ndAabbPolygonSoup::ndNode* const node, const ndFastAabb& obbAabbInfo, const ndVector& boxDistanceTravel, ndFloat32, ndAaabbIntersectCallback callback, void* const context) const -{ - ndAssert(ndAbs(ndAbs(obbAabbInfo[0][0]) - obbAabbInfo.m_absDir[0][0]) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(ndAbs(obbAabbInfo[1][1]) - obbAabbInfo.m_absDir[1][1]) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(ndAbs(obbAabbInfo[2][2]) - obbAabbInfo.m_absDir[2][2]) < ndFloat32(1.0e-4f)); - - ndAssert(ndAbs(ndAbs(obbAabbInfo[0][1]) - obbAabbInfo.m_absDir[1][0]) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(ndAbs(obbAabbInfo[0][2]) - obbAabbInfo.m_absDir[2][0]) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(ndAbs(obbAabbInfo[1][2]) - obbAabbInfo.m_absDir[2][1]) < ndFloat32(1.0e-4f)); - - if (m_aabb) - { - const ndInt32 stride = sizeof(ndTriplex) / sizeof(ndFloat32); - const ndTriplex* const vertexArray = (ndTriplex*)m_localVertex; - - ndAssert(boxDistanceTravel.m_w == ndFloat32(0.0f)); - if (boxDistanceTravel.DotProduct(boxDistanceTravel).GetScalar() < ndFloat32(1.0e-8f)) - { - ndFloat32 dist = node->BoxPenetration(obbAabbInfo, vertexArray); - if (dist <= ndFloat32(0.0f)) - { - obbAabbInfo.m_separationDistance = ndMin(obbAabbInfo.m_separationDistance[0], dist); - } - if (dist > ndFloat32(0.0f)) - { - if (node->m_left.IsLeaf()) - { - ndInt32 index = ndInt32(node->m_left.GetIndex()); - ndInt32 vCount = ndInt32(node->m_left.GetCount()); - if (vCount > 0) - { - const ndInt32* const indices = &m_indices[index]; - ndInt32 normalIndex = indices[vCount + 1]; - ndVector faceNormal(&vertexArray[normalIndex].m_x); - faceNormal = faceNormal & ndVector::m_triplexMask; - ndFloat32 dist1 = obbAabbInfo.PolygonBoxDistance(faceNormal, vCount, indices, stride, &vertexArray[0].m_x); - if (dist1 > ndFloat32(0.0f)) - { - obbAabbInfo.m_separationDistance = ndFloat32(0.0f); - ndAssert(vCount >= 3); - callback(context, &vertexArray[0].m_x, sizeof(ndTriplex), indices, vCount, dist1); - } - } - } - - if (node->m_right.IsLeaf()) - { - ndInt32 index = ndInt32(node->m_right.GetIndex()); - ndInt32 vCount = ndInt32(node->m_right.GetCount()); - if (vCount > 0) - { - const ndInt32* const indices = &m_indices[index]; - ndInt32 normalIndex = indices[vCount + 1]; - ndVector faceNormal(&vertexArray[normalIndex].m_x); - faceNormal = faceNormal & ndVector::m_triplexMask; - ndFloat32 dist1 = obbAabbInfo.PolygonBoxDistance(faceNormal, vCount, indices, stride, &vertexArray[0].m_x); - if (dist1 > ndFloat32(0.0f)) - { - ndAssert(vCount >= 3); - obbAabbInfo.m_separationDistance = ndFloat32(0.0f); - callback(context, &vertexArray[0].m_x, sizeof(ndTriplex), indices, vCount, dist1); - } - } - } - } - } - else - { - ndAssert(0); - //ndFastRay ray(ndVector(ndFloat32(0.0f)), boxDistanceTravel); - //ndFastRay obbRay(ndVector(ndFloat32(0.0f)), obbAabbInfo.UnrotateVector(boxDistanceTravel)); - //ndInt32 stack = 1; - //stackPool[0] = m_aabb; - //distance[0] = m_aabb->BoxIntersect(ray, obbRay, obbAabbInfo, vertexArray); - // - //while (stack) - //{ - // stack--; - // const ndFloat32 dist = distance[stack]; - // const ndNode* const me = stackPool[stack]; - // if (dist < ndFloat32(1.0f)) - // { - // if (me->m_left.IsLeaf()) - // { - // ndInt32 index = ndInt32(me->m_left.GetIndex()); - // ndInt32 vCount = ndInt32(me->m_left.GetCount()); - // if (vCount > 0) - // { - // const ndInt32* const indices = &m_indices[index]; - // ndInt32 normalIndex = indices[vCount + 1]; - // ndVector faceNormal(&vertexArray[normalIndex].m_x); - // faceNormal = faceNormal & ndVector::m_triplexMask; - // ndFloat32 hitDistance = obbAabbInfo.PolygonBoxRayDistance(faceNormal, vCount, indices, stride, &vertexArray[0].m_x, ray); - // if (hitDistance < ndFloat32(1.0f)) - // { - // ndAssert(vCount >= 3); - // if (callback(context, &vertexArray[0].m_x, sizeof(ndTriplex), indices, vCount, hitDistance) == m_stopSearch) - // { - // return; - // } - // } - // } - // } - // else - // { - // const ndNode* const node = me->m_left.GetNode(m_aabb); - // ndFloat32 dist1 = node->BoxIntersect(ray, obbRay, obbAabbInfo, vertexArray); - // if (dist1 < ndFloat32(1.0f)) - // { - // ndInt32 j = stack; - // for (; j && (dist1 > distance[j - 1]); j--) - // { - // stackPool[j] = stackPool[j - 1]; - // distance[j] = distance[j - 1]; - // } - // ndAssert(stack < DG_STACK_DEPTH); - // stackPool[j] = node; - // distance[j] = dist1; - // stack++; - // } - // } - // - // if (me->m_right.IsLeaf()) - // { - // ndInt32 index = ndInt32(me->m_right.GetIndex()); - // ndInt32 vCount = ndInt32(me->m_right.GetCount()); - // if (vCount > 0) - // { - // const ndInt32* const indices = &m_indices[index]; - // ndInt32 normalIndex = indices[vCount + 1]; - // ndVector faceNormal(&vertexArray[normalIndex].m_x); - // faceNormal = faceNormal & ndVector::m_triplexMask; - // ndFloat32 hitDistance = obbAabbInfo.PolygonBoxRayDistance(faceNormal, vCount, indices, stride, &vertexArray[0].m_x, ray); - // if (hitDistance < ndFloat32(1.0f)) - // { - // ndAssert(vCount >= 3); - // if (callback(context, &vertexArray[0].m_x, sizeof(ndTriplex), indices, vCount, hitDistance) == m_stopSearch) { - // return; - // } - // } - // } - // } - // else - // { - // const ndNode* const node = me->m_right.GetNode(m_aabb); - // ndFloat32 dist1 = node->BoxIntersect(ray, obbRay, obbAabbInfo, vertexArray); - // if (dist1 < ndFloat32(1.0f)) - // { - // ndInt32 j = stack; - // for (; j && (dist1 > distance[j - 1]); j--) - // { - // stackPool[j] = stackPool[j - 1]; - // distance[j] = distance[j - 1]; - // } - // ndAssert(stack < DG_STACK_DEPTH); - // stackPool[j] = node; - // distance[j] = dist1; - // stack++; - // } - // } - // } - //} - } - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndAabbPolygonSoup.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndAabbPolygonSoup.h deleted file mode 100644 index af210d896f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndAabbPolygonSoup.h +++ /dev/null @@ -1,277 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __NDG_AABB_POLYGONSOUP_H_ -#define __NDG_AABB_POLYGONSOUP_H_ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndFastRay.h" -#include "ndFastAabb.h" -#include "ndIntersections.h" -#include "ndPolygonSoupDatabase.h" - -class ndPolygonSoupBuilder; - -// index format: i0, i1, i2, ... , id, normal, e0Normal, e1Normal, e2Normal, ..., faceSize -#define D_CONCAVE_EDGE_MASK (1<<31) -#define D_FACE_CLIP_DIAGONAL_SCALE ndFloat32 (0.25f) - -enum ndIntersectStatus -{ - m_stopSearch, - m_continueSearh -}; - -typedef ndIntersectStatus(*ndAaabbIntersectCallback) (void* const context, - const ndFloat32* const polygon, ndInt32 strideInBytes, - const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); - -typedef ndFloat32(*ndRayIntersectCallback) (void* const context, - const ndFloat32* const polygon, ndInt32 strideInBytes, - const ndInt32* const indexArray, ndInt32 indexCount); - -/// Base class for creating a leafless bounding box hierarchy for queering a polygon list index list mesh. -class ndAabbPolygonSoup: public ndPolygonSoupDatabase -{ - public: - class ndNode - { - public: - enum ndNodeType - { - m_binary = 0, - m_leaf, - }; - - class ndLeafNodePtr - { - #define DG_INDEX_COUNT_BITS 6 - - public: - inline ndLeafNodePtr () - { - ndAssert (0); - } - - inline ndLeafNodePtr (ndUnsigned32 node) - { - m_node = node; - ndAssert (!IsLeaf()); - } - - inline ndUnsigned32 IsLeaf () const - { - return m_node & 0x80000000; - } - - inline ndUnsigned32 GetCount() const - { - ndAssert (IsLeaf()); - return (m_node & (~0x80000000)) >> (32 - DG_INDEX_COUNT_BITS - 1); - } - - inline ndUnsigned32 GetIndex() const - { - ndAssert (IsLeaf()); - return m_node & (~(-(1 << (32 - DG_INDEX_COUNT_BITS - 1)))); - } - - inline ndLeafNodePtr (ndUnsigned32 faceIndexCount, ndUnsigned32 faceIndexStart) - { - ndAssert (faceIndexCount < (1<= minBox.m_x); - ndAssert(maxBox.m_y >= minBox.m_y); - ndAssert(maxBox.m_z >= minBox.m_z); - - ndVector mask ((minBox * maxBox) < ndVector::m_zero); - ndVector dist (maxBox.GetMin (minBox.Abs()) & mask); - dist = dist.GetMin(dist.ShiftTripleRight()); - dist = dist.GetMin(dist.ShiftTripleRight()); - - if (dist.GetScalar() > ndFloat32 (0.0f)) - { - ndVector origin (ndVector::m_half * (p1 + p0)); - ndVector size (ndVector::m_half * (p1 - p0)); - - origin = obb.UntransformVector(origin); - size = obb.m_absDir.RotateVector(size); - ndVector q0 (origin - size); - ndVector q1 (origin + size); - ndVector minBox1 (q0 - obb.m_size); - ndVector maxBox1 (q1 + obb.m_size); - ndAssert(maxBox1.m_x >= minBox1.m_x); - ndAssert(maxBox1.m_y >= minBox1.m_y); - ndAssert(maxBox1.m_z >= minBox1.m_z); - ndVector mask1 ((minBox1 * maxBox1) < ndVector::m_zero); - ndVector dist1 (maxBox1.GetMin (minBox1.Abs()) & mask1); - dist1 = dist1.GetMin(dist1.ShiftTripleRight()); - dist1 = dist1.GetMin(dist1.ShiftTripleRight()); - dist = dist.GetMin(dist1); - } - else - { - ndVector p1p0((minBox.Abs()).GetMin(maxBox.Abs()).AndNot(mask)); - dist = p1p0.DotProduct(p1p0); - dist = dist.Sqrt() * ndVector::m_negOne; - } - return dist.GetScalar(); - } - - inline ndFloat32 BoxIntersect (const ndFastRay& ray, const ndFastRay& obbRay, const ndFastAabb& obb, const ndTriplex* const vertexArray) const - { - ndVector p0 (&vertexArray[m_indexBox0].m_x); - ndVector p1 (&vertexArray[m_indexBox1].m_x); - p0 = p0 & ndVector::m_triplexMask; - p1 = p1 & ndVector::m_triplexMask; - - ndVector minBox (p0 - obb.m_p1); - ndVector maxBox (p1 - obb.m_p0); - ndFloat32 dist = ray.BoxIntersect(minBox, maxBox); - if (dist < ndFloat32 (1.0f)) - { - ndVector origin (ndVector::m_half * (p1 + p0)); - ndVector size (ndVector::m_half * (p1 - p0)); - - origin = obb.UntransformVector(origin); - size = obb.m_absDir.RotateVector(size); - ndVector q0 (origin - size); - ndVector q1 (origin + size); - - ndVector minBox1 (q0 - obb.m_size); - ndVector maxBox1 (q1 + obb.m_size); - ndFloat32 dist1 = obbRay.BoxIntersect(minBox1, maxBox1); - dist = (dist1 > ndFloat32 (1.0f)) ? dist1 : ndMax (dist1, dist); - } - return dist; - } - - ndInt32 m_indexBox0; - ndInt32 m_indexBox1; - ndLeafNodePtr m_left; - ndLeafNodePtr m_right; - }; - - class ndSplitInfo; - class ndNodeBuilder; - - /// get the root node bounding box of the mesh. - D_CORE_API virtual void GetAABB (ndVector& p0, ndVector& p1) const; - - /// writes the entire database to a binary file named path. - D_CORE_API virtual void Serialize (const char* const path) const; - - /// Reads a previously saved database binary file named path. - D_CORE_API virtual void Deserialize (const char* const path); - - protected: - D_CORE_API ndAabbPolygonSoup (); - D_CORE_API virtual ~ndAabbPolygonSoup (); - - D_CORE_API void Create (const ndPolygonSoupBuilder& builder); - D_CORE_API void CalculateAdjacent (); - D_CORE_API virtual ndVector ForAllSectorsSupportVertex(const ndVector& dir) const; - D_CORE_API virtual void ForAllSectorsRayHit (const ndFastRay& ray, ndFloat32 maxT, ndRayIntersectCallback callback, void* const context) const; - D_CORE_API virtual void ForAllSectors (const ndFastAabb& obbAabb, const ndVector& boxDistanceTravel, ndFloat32 maxT, ndAaabbIntersectCallback callback, void* const context) const; - D_CORE_API virtual void ForThisSector(const ndAabbPolygonSoup::ndNode* const node, const ndFastAabb& obbAabb, const ndVector& boxDistanceTravel, ndFloat32 maxT, ndAaabbIntersectCallback callback, void* const context) const; - - public: - /// Get the root node of the hierarchy. - inline ndNode* GetRootNode() const - { - return m_aabb; - } - - /// Returns the back child node of the hierarchy. - /// Return nullptr if node was a leaf. - inline ndNode* GetBackNode(const ndNode* const node) const - { - return node->m_left.IsLeaf() ? nullptr : node->m_left.GetNode(m_aabb); - } - - /// Returns the front child node of the hierarchy. - /// Return nullptr if node was a leaf. - inline ndNode* GetFrontNode(const ndNode* const node) const - { - return node->m_right.IsLeaf() ? nullptr : node->m_right.GetNode(m_aabb); - } - - /// Returns the bounding box of node in point p0 and p1. - inline void GetNodeAabb(const ndNode* const node, ndVector& p0, ndVector& p1) const - { - p0 = ndVector (&((ndTriplex*)m_localVertex)[node->m_indexBox0].m_x); - p1 = ndVector (&((ndTriplex*)m_localVertex)[node->m_indexBox1].m_x); - p0 = p0 & ndVector::m_triplexMask; - p1 = p1 & ndVector::m_triplexMask; - } - - private: - ndNodeBuilder* BuildTopDown (ndNodeBuilder* const leafArray, ndInt32 firstBox, ndInt32 lastBox, ndNodeBuilder** const allocator) const; - ndFloat32 CalculateFaceMaxDiagonal (const ndVector* const vertex, ndInt32 indexCount, const ndInt32* const indexArray) const; - static ndIntersectStatus CalculateAllFaceEdgeNormals(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); - - ndNode* m_aabb; - ndInt32* m_indices; - ndInt32 m_nodesCount; - ndInt32 m_indexCount; - friend class ndContactSolver; -}; - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndArray.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndArray.h deleted file mode 100644 index af1c22ea6c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndArray.h +++ /dev/null @@ -1,290 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -/**************************************************************************** -* -* Visual C++ 6.0 created by: Julio Jerez -* -****************************************************************************/ -#ifndef __ND_ARRAY_H__ -#define __ND_ARRAY_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndVector.h" -#include "ndClassAlloc.h" -#include "ndProbability.h" - -/// Generic template vector. -/// note: this template vector is similar to std::vector but has some significant differences. -/// therefore is not meant to be a replacement of the sdt::vector, it is simple a tool for this engine -template -class ndArray: public ndClassAlloc -{ - public: - /// constructor, set count and capacity to zero, not memory is allocated. - ndArray(); - /// constructor, set count and capacity, allocated space for count elements. - ndArray(ndInt64 count); - /// copy constructor, allocate and copy only m_size elements from source. - ndArray(const ndArray& source); - - /// deallocate all memory, dos not call destructor on any of th elements. - ~ndArray (); - - /// return the size of the array. - ndInt64 GetCount() const; - - /// Set a new size. - /// if count is larger than m_size, the array resized by doubling its size, - /// all the data is simply copied to the new array and old array is deleted. - void SetCount(ndInt64 count); - - //void Clear(); - /// Set a new size. - /// the array resized to count, all the data is simply copied - /// to the new array and old array is deleted. - void Resize(ndInt64 count); - - /// return the capacity of the array. - ndInt64 GetCapacity() const; - - /// Get the i element for the array. - /// behavior is undefined is i is larger of equal to the array size - T& operator[] (ndInt64 i); - - /// Get the i element for the array. - /// behavior is undefined is i is larger of equal to the array size - const T& operator[] (ndInt64 i) const; - - /// Interchange all the information with other. - /// other must be of the same type. - void Swap(ndArray& other); - - /// Add element to the end of the buffer. - /// size is incremented by one, and the array is resized if it reaches max capacity - void PushBack(const T& element); - - /// Randomize the vector entries. - void RandomShuffle(ndInt64 count); - - /// set all member to 0. - /// useful for when making vectors of vectors (ex matrices) - void ResetMembers(); - - /// assign all members. - /// useful for when making vectors of vectors (ex matrices) - void SetMembers(ndInt64 size, void* const memory); - - private: - void CopyData(T* const dst, const T* const src, ndInt64 elements); - - protected: - T* m_array; - ndInt64 m_size; - ndInt64 m_capacity; -}; - -template -ndArray::ndArray() - :ndClassAlloc() - ,m_array(nullptr) - ,m_size(0) - ,m_capacity(0) -{ -} - -template -ndArray::ndArray(ndInt64 count) - :ndClassAlloc() - ,m_array(nullptr) - ,m_size(0) - ,m_capacity(0) -{ - Resize(count); -} - -template -ndArray::ndArray(const ndArray& source) - :ndClassAlloc() - ,m_array(nullptr) - ,m_size(0) - ,m_capacity(0) -{ - if (source.m_array) - { - Resize(source.m_capacity); - SetCount(source.m_size); - for (ndInt64 i = 0; i < source.m_size; ++i) - { - m_array[i] = source[i]; - } - } -} - -template -ndArray::~ndArray () -{ - if (m_array) - { - ndMemory::Free(m_array); - } -} - -template -const T& ndArray::operator[] (ndInt64 i) const -{ - ndAssert(i >= 0); - ndAssert(i < m_size); - return m_array[i]; -} - -template -T& ndArray::operator[] (ndInt64 i) -{ - ndAssert(i >= 0); - ndAssert(i < m_size); - return m_array[i]; -} - -template -void ndArray::PushBack(const T& element) -{ - ndAssert(m_size <= m_capacity); - if (m_size == m_capacity) - { - Resize(m_capacity * 2); - } - m_array[m_size] = element; - m_size++; -} - -template -ndInt64 ndArray::GetCount() const -{ - return m_size; -} - -template -void ndArray::SetCount(ndInt64 count) -{ - while (count > m_capacity) - { - Resize(m_capacity * 2); - } - m_size = count; -} - -template -ndInt64 ndArray::GetCapacity() const -{ - return m_capacity; -} - -template -void ndArray::CopyData(T* const dstPtr, const T* const srcPtr, ndInt64 elements) -{ - ndMemCpy(dstPtr, srcPtr, elements); -} - -template -void ndArray::Resize(ndInt64 newSize) -{ - // note: I know some tools will detect a warning here - // because it is copying object from one array - // to another without calling the copy constructor - // and destructor, but the ndArray is designed for - // high performance memory resizing of structures, - // if an application needs to use an array with - // for general purpose classes, - // please use standart lib std::vector - if (newSize > m_capacity || (m_capacity == 0)) - { - newSize = ndMax(newSize, ndInt64(16)); - T* const newArray = (T*)ndMemory::Malloc(size_t(sizeof(T) * newSize)); - if (m_array) - { - if (m_size) - { - CopyData(newArray, m_array, m_size); - } - ndMemory::Free(m_array); - } - m_array = newArray; - m_capacity = newSize; - } - else if (newSize < m_capacity) - { - newSize = ndMax(newSize, ndInt64(16)); - T* const newArray = (T*)ndMemory::Malloc(size_t(sizeof(T) * newSize)); - if (m_array) - { - CopyData(newArray, m_array, newSize); - ndMemory::Free(m_array); - } - m_size = newSize; - m_array = newArray; - m_capacity = newSize; - } -} - -template -void ndArray::Swap(ndArray& other) -{ - ndSwap(m_array, other.m_array); - ndSwap(m_size, other.m_size); - ndSwap(m_capacity, other.m_capacity); -} - -template -void ndArray::SetMembers(ndInt64 size, void* const memory) -{ - m_size = size; - m_capacity = size + 1; - m_array = (T*)memory; -} - -template -void ndArray::ResetMembers() -{ - m_size = 0; - m_capacity = 0; - m_array = nullptr; -} - -template -void ndArray::RandomShuffle(ndInt64 count) -{ - const ndInt64 size = ndMin (count, GetCount()); - for (ndInt64 i = size - 1; i >= 0; --i) - { - ndInt64 randomIndex = ndRandInt(); - ndInt64 j = randomIndex % size; - ndSwap (m_array[i], m_array[j]); - } -} - -#endif - - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndBezierSpline.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndBezierSpline.cpp deleted file mode 100644 index b794f0b650..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndBezierSpline.cpp +++ /dev/null @@ -1,793 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndMemory.h" -#include "ndArray.h" -#include "ndVector.h" -#include "ndBezierSpline.h" - -ndBezierSpline::ndBezierSpline () - :ndClassAlloc() - ,m_knotVector() - ,m_controlPoints() - ,m_degree(0) - ,m_knotsCount(0) - ,m_controlPointsCount(0) -{ -} - -ndBezierSpline::ndBezierSpline (const ndBezierSpline& src) - :ndClassAlloc() - ,m_knotVector() - ,m_controlPoints() - ,m_degree(0) - ,m_knotsCount(0) - ,m_controlPointsCount(0) -{ - if (src.m_knotsCount) - { - CreateFromKnotVectorAndControlPoints (src.m_degree, src.m_knotsCount - 2 * src.m_degree, &src.m_knotVector[src.m_degree], &src.m_controlPoints[0]); - } -} - -ndBezierSpline::~ndBezierSpline () -{ - Clear(); -} - -void ndBezierSpline::Clear() -{ - m_degree = 0; - m_knotsCount = 0; - m_controlPointsCount = 0; -} - -void ndBezierSpline::Trace() const -{ - const ndInt32 knotsCount = m_knotsCount - m_degree * 2; - ndTrace(("dregree %d\n", m_degree)); - ndTrace(("knotsCount %d\n", knotsCount)); - ndTrace(("controlPointsCount %d\n", m_controlPointsCount)); - - ndTrace(("knots: ")); - for (ndInt32 i = 0; i < knotsCount; ++i) - { - ndTrace(("%f ", m_knotVector[i + m_degree])); - } - - ndTrace(("\n")); - ndTrace(("controlPoints:\n")); - for (ndInt32 i = 0; i < m_controlPointsCount; ++i) - { - ndTrace(("%f %f %f\n", m_controlPoints[i].m_x, m_controlPoints[i].m_y, m_controlPoints[i].m_z)); - } -} - -ndBezierSpline& ndBezierSpline::operator = (const ndBezierSpline ©) -{ - Clear(); - if (copy.m_knotsCount) - { - CreateFromKnotVectorAndControlPoints (copy.m_degree, copy.m_knotsCount - 2 * copy.m_degree, ©.m_knotVector[copy.m_degree], ©.m_controlPoints[0]); - } - return *this; -} - -ndInt32 ndBezierSpline::GetDegree () const -{ - return m_degree; -} - -void ndBezierSpline::CreateFromKnotVectorAndControlPoints (ndInt32 degree, ndInt32 knotCount, const ndFloat64* const knotVector, const ndBigVector* const controlPoints) -{ - Clear(); - ndAssert (knotCount); - ndAssert (knotVector[0] == ndFloat32 (0.0f)); - ndAssert (knotVector[knotCount - 1] == ndFloat32 (1.0f)); - - m_degree = degree; - m_knotsCount = knotCount + 2 * degree; - m_controlPointsCount = knotCount + m_degree - 1; - m_knotVector.SetCount(m_knotsCount); - m_controlPoints.SetCount(m_controlPointsCount); - - for (ndInt32 i = 0; i < m_controlPointsCount; ++i) - { - m_controlPoints[i] = controlPoints[i]; - } - - for (ndInt32 i = 0; i < m_degree; ++i) - { - m_knotVector[i] = ndFloat32 (0.0f); - m_knotVector[i + m_knotsCount - m_degree] = ndFloat64(ndFloat32 (1.0f)); - } - - for (ndInt32 i = 0; i < knotCount; ++i) - { - m_knotVector[i + m_degree] = knotVector[i]; - ndAssert (m_knotVector[i + m_degree] >= m_knotVector[i + m_degree - 1]); - } -} - -ndInt32 ndBezierSpline::GetKnotCount() const -{ - return m_knotsCount; -} - -ndArray& ndBezierSpline::GetKnotArray() -{ - return m_knotVector; -} - -const ndArray& ndBezierSpline::GetKnotArray() const -{ - return m_knotVector; -} - -ndFloat64 ndBezierSpline::GetKnot(ndInt32 i) const -{ - return m_knotVector[i]; -} - -ndInt32 ndBezierSpline::GetControlPointCount() const -{ - return m_controlPointsCount; -} - -ndBigVector ndBezierSpline::GetControlPoint(ndInt32 i) const -{ - return m_controlPoints[i]; -} - -void ndBezierSpline::SetControlPoint(ndInt32 i, const ndBigVector& point) -{ - m_controlPoints[i] = point; -} - -ndArray& ndBezierSpline::GetControlPointArray() -{ - return m_controlPoints; -} - -const ndArray& ndBezierSpline::GetControlPointArray() const -{ - return m_controlPoints; -} - -ndInt32 ndBezierSpline::GetSpan(ndFloat64 u) const -{ - ndInt32 low = m_degree; - ndInt32 high = m_knotsCount - m_degree - 1; - - ndAssert (u >= ndFloat32 (0.0f)); - ndAssert (u <= ndFloat32 (1.0f)); - while ((high - low) >= 4) - { - ndInt32 mid = (low + high) >> 1; - if (u > m_knotVector[mid]) - { - low = mid; - } - else - { - high = mid; - } - } - - ndAssert (m_knotVector[low] <= u); - for (ndInt32 i = low; i < m_degree + m_knotsCount + 1; ++i) - { - if (m_knotVector[i + 1] >= u) - { - return i; - } - } - ndAssert (0); - return 0; -} - -void ndBezierSpline::BasicsFunctions (ndFloat64 u, ndInt32 span, ndFloat64* const BasicFunctionsOut) const -{ - BasicFunctionsOut[0] = ndFloat32 (1.0f); - - ndFloat64* const left = ndAlloca(ndFloat64, m_knotsCount + 32); - ndFloat64* const right = ndAlloca(ndFloat64, m_knotsCount + 32); - - for (ndInt32 j = 1; j <= m_degree; ++j) - { - left[j] = u - m_knotVector[span + 1 - j]; - right[j] = m_knotVector[span + j] - u; - - ndFloat64 saved = ndFloat32 (0.0f); - for (ndInt32 r = 0; r < j; ++r) - { - ndFloat64 temp = BasicFunctionsOut[r] / (right[r + 1] + left[j - r]); - BasicFunctionsOut[r] = saved + temp * right[r + 1]; - saved = temp * left[j - r]; - } - BasicFunctionsOut[j] = saved; - } -} - -void ndBezierSpline::BasicsFunctionsDerivatives (ndFloat64 u, ndInt32 span, ndFloat64* const derivativesOut) const -{ - ndFloat64* const a = ndAlloca(ndFloat64, m_knotsCount + 32); - ndFloat64* const ndu = ndAlloca(ndFloat64, m_knotsCount + 32); - ndFloat64* const left = ndAlloca(ndFloat64, m_knotsCount + 32); - ndFloat64* const right = ndAlloca(ndFloat64, m_knotsCount + 32); - - const ndInt32 width = m_degree + 1; - ndu[0] = ndFloat32 (1.0f); - for (ndInt32 j = 1; j <= m_degree; ++j) - { - left[j] = u - m_knotVector[span + 1 - j]; - right[j] = m_knotVector[span + j] - u; - ndFloat64 saved = ndFloat32 (0.0f); - for (ndInt32 r = 0; r < j; ++r) - { - ndu[j * width + r] = right[r + 1] + left[j - r]; - - ndFloat64 temp = ndu[r * width + j - 1] / ndu[j * width + r]; - ndu[r * width + j] = saved + temp * right[r + 1]; - saved = temp * left[j - r]; - } - ndu[j * width + j] = saved; - } - - - for (ndInt32 j = 0; j <= m_degree; ++j) - { - derivativesOut[width * 0 + j] = ndu [width * j + m_degree]; - } - - for (ndInt32 r = 0; r <= m_degree; ++r) - { - ndInt32 s1 = 0; - ndInt32 s2 = 1; - a[0] = ndFloat32 (1.0f); - for (ndInt32 k = 1; k <= m_degree; ++k) - { - ndFloat64 d = ndFloat32 (0.0f); - ndInt32 rk = r - k; - ndInt32 pk = m_degree - k; - if (r >= k) - { - a[width * s2 + 0] = a[width * s1 + 0] / ndu[width * (pk + 1) + rk]; - d = a[width * s2 + 0] * ndu[width * rk + pk]; - } - ndInt32 j1 = 0; - ndInt32 j2 = 0; - if (rk >= -1) - { - j1 = 1; - } - else - { - j1 = -rk; - } - - if ((r - 1) <= pk) - { - j2 = k-1; - } - else - { - j2 = m_degree-r; - } - for (ndInt32 j = j1; j <= j2; ++j) - { - a[width * s2 + j] = (a[width * s1 + j] - a[width * s1 + j - 1]) / ndu[width * (pk + 1) + rk + j]; - d += a[width * s2 + j] * ndu[width * (rk + j) + pk]; - } - if (r <= pk) - { - a[width * s2 + k] = -a[width * s1 + k - 1] / ndu[width * (pk + 1) + r]; - d += a[width * s2 + k] * ndu[width * r + pk]; - } - derivativesOut[width * k + r] = d; - ndSwap(s1, s2); - } - } - - ndInt32 s = m_degree; - for (ndInt32 k = 1; k <= m_degree; ++k) - { - for (ndInt32 j = 0; j <= m_degree; ++j) - { - derivativesOut[width * k + j] *= s; - } - s *= (m_degree - k); - } -} - -ndBigVector ndBezierSpline::CurvePoint (ndFloat64 u, ndInt32 span) const -{ - ndBigVector point (ndFloat32 (0.0f)); - ndFloat64* const basicFunctions = ndAlloca(ndFloat64, m_knotsCount + 32); - BasicsFunctions (u, span, basicFunctions); - for (ndInt32 i = 0; i <= m_degree; ++i) - { - point += m_controlPoints[span - m_degree + i].Scale (basicFunctions[i]); - } - point.m_w = ndFloat32(1.0f); - return point; -} - -ndBigVector ndBezierSpline::CurvePoint (ndFloat64 u) const -{ - u = ndClamp (u, ndFloat64 (ndFloat32 (0.0f)), ndFloat64 (ndFloat32 (1.0f))); - ndInt32 span = GetSpan(u); - return CurvePoint (u, span); -} - -ndBigVector ndBezierSpline::CurveDerivative (ndFloat64 u, ndInt32 index) const -{ - u = ndClamp (u, ndFloat64 (ndFloat32 (0.0f)), ndFloat64 (ndFloat32 (1.0f))); - ndAssert (index <= m_degree); - - ndFloat64* const basicsFuncDerivatives = ndAlloca(ndFloat64, m_knotsCount + 32); - ndInt32 span = GetSpan(u); - BasicsFunctionsDerivatives (u, span, basicsFuncDerivatives); - - const ndInt32 with = m_degree + 1; - ndBigVector point (ndBigVector::m_zero); - for (ndInt32 i = 0; i <= m_degree; ++i) - { - point += m_controlPoints[span - m_degree + i].Scale (basicsFuncDerivatives[with * index + i]); - } - return point & ndBigVector::m_triplexMask; -} - -ndInt32 ndBezierSpline::CurveAllDerivatives (ndFloat64 u, ndBigVector* const derivatives) const -{ - u = ndMod (u, ndFloat64(ndFloat32 (1.0f))); - ndFloat64* const basicsFuncDerivatives = ndAlloca(ndFloat64, m_knotsCount + 32); - ndInt32 span = GetSpan(u); - BasicsFunctionsDerivatives (u, span, basicsFuncDerivatives); - - const ndInt32 with = m_degree + 1; - for (ndInt32 j = 0; j <= m_degree; ++j) - { - ndBigVector ck (ndBigVector::m_zero); - for (ndInt32 i = 0; i <= m_degree; ++i) - { - ck += m_controlPoints[span - m_degree + i].Scale (basicsFuncDerivatives[with * j + i]); - } - ck.m_w = ndFloat32(0.0f); - derivatives[j] = ck; - } - - return m_degree + 1; -} - -void ndBezierSpline::GlobalCubicInterpolation (ndInt32 count, const ndBigVector* const points, const ndBigVector& firstTangent, const ndBigVector& lastTangent) -{ - CreateCubicKnotVector (count, points); - CreateCubicControlPoints (count, points, firstTangent, lastTangent); -} - -void ndBezierSpline::CreateCubicKnotVector(ndInt32 count, const ndBigVector* const points) -{ - ndAssert (count >= 2); - - ndFloat64* const u = ndAlloca(ndFloat64, m_knotsCount + 32); -#if 0 - u[0] = dFloat32 (0.0f); - dFloat64 d = dFloat32(0.0f); - for (dInt32 i = 1; i < count; ++i) - { - dBigVector step (points[i] - points[i - 1]); - dAssert(step.m_w == dFloat32 (0.0f)); - dFloat64 len = dSqrt (step.DotProduct(step).GetScalar()); - u[i] = dSqrt (len); - d += u[i]; - } - - for (dInt32 i = 1; i < count; ++i) - { - u[i] = u[i-1] + u[i] / d; - } - -#else - - ndFloat64 d = ndFloat32(0.0f); - for (ndInt32 i = 1; i < count; ++i) - { - ndBigVector step(points[i] - points[i - 1]); - ndAssert(step.m_w == ndFloat32(0.0f)); - d += ndSqrt(step.DotProduct(step).GetScalar()); - u[i] = d; - } - - d = ndFloat32(1.0f) / d; - for (ndInt32 i = 0; i < count; ++i) - { - u[i] *= d; - } -#endif - - u[0] = ndFloat64 (ndFloat32 (0.0f)); - u[count - 1] = ndFloat64(ndFloat32 (1.0f)); - - m_degree = 3; - m_knotsCount = count + 2 * m_degree; - - m_knotVector.SetCount(m_knotsCount); - for (ndInt32 i = 0; i < (m_degree + 1); ++i) - { - m_knotVector[i] = ndFloat32 (0.0f); - m_knotVector[i + m_knotsCount - m_degree - 1] = ndFloat64(ndFloat32 (1.0f)); - } - - for (ndInt32 i = 1; i < (count - 1); ++i) - { - ndFloat64 acc = ndFloat64 (ndFloat32 (0.0f)); - for (ndInt32 j = 0; j < m_degree; ++j) - { - acc += u[j + i - 1]; - } - m_knotVector[m_degree + i] = acc / ndFloat64 (3.0f); - } -} - -void ndBezierSpline::CreateCubicControlPoints(ndInt32 count, const ndBigVector* const points, const ndBigVector& firstTangentIn, const ndBigVector& lastTangentIn) -{ - ndFloat64 abc[4]; - - const ndBigVector lastTangent(lastTangentIn & ndBigVector::m_triplexMask); - const ndBigVector firstTangent(firstTangentIn & ndBigVector::m_triplexMask); - - if ((m_knotsCount - 2 * (m_degree - 1)) != m_controlPointsCount) - { - m_controlPointsCount = m_knotsCount - 2 * (m_degree - 1); - } - - m_controlPoints.SetCount(m_controlPointsCount); - m_controlPoints[0] = points[0]; - m_controlPoints[m_controlPointsCount - 1] = points[count - 1]; - - m_controlPoints[1] = m_controlPoints[0] + firstTangent.Scale (m_knotVector[m_degree + 1] / 3.0f); - m_controlPoints[m_controlPointsCount - 2] = m_controlPoints[m_controlPointsCount - 1] - lastTangent.Scale ((ndFloat32 (1.0f) - m_knotVector[m_knotsCount - m_degree - 2]) / 3.0f); - if (count == 3) - { - BasicsFunctions (m_knotVector[m_degree + 1], m_degree + 1, abc); - m_controlPoints[2] = points[1] - m_controlPoints[1].Scale (abc[0]) - m_controlPoints[3].Scale (abc[2]); - m_controlPoints[2] = m_controlPoints[2].Scale (ndFloat32 (1.0f) / abc[1]); - } - else - { - ndFloat64* const dd = ndAlloca(ndFloat64, m_knotsCount + 32); - BasicsFunctions (m_knotVector[m_degree + 1], m_degree + 1, abc); - ndFloat64 den = abc[1]; - m_controlPoints[2] = (points[1] - m_controlPoints[1].Scale (abc[0])).Scale (ndFloat32 (1.0f) / den); - for (ndInt32 i = 3; i < (count - 1); ++i) - { - dd[i + 1] = abc[2] / den; - BasicsFunctions (m_knotVector[i + 2], i + 2, abc); - den = abc[1] - abc[0] * dd[i + 1]; - m_controlPoints[i] = (points[i - 1] - m_controlPoints[i - 1].Scale (abc[0])).Scale (ndFloat32 (1.0f) / den); - } - - dd[count] = abc[2] / den; - BasicsFunctions (m_knotVector[count + 1], count + 1, abc); - den = abc[1] - abc[0] * dd[count]; - m_controlPoints[count - 1] = (points[count - 2] - m_controlPoints[count].Scale (abc[2]) - m_controlPoints[count - 2].Scale (abc[0])).Scale (ndFloat32 (1.0f) / den); - - for (ndInt32 i = count - 2; i >= 2; --i) - { - m_controlPoints[i] -= m_controlPoints[i + 1].Scale (dd[i + 2]); - } - } -} - -ndFloat64 ndBezierSpline::CalculateLength (ndFloat64 tol) const -{ - ndBigVector stackPool[32][3]; - ndInt32 stack = 0; - - ndFloat64 length = ndFloat32 (0.0f); - ndFloat64 tol2 = tol * tol; - ndFloat64 u0 = m_knotVector[m_degree]; - ndBigVector p0 (CurvePoint (u0)); - - for (ndInt32 i = m_degree; i < (m_knotsCount - m_degree - 1); ++i) - { - ndFloat64 u1 = m_knotVector[i + 1]; - ndBigVector p1 (CurvePoint (u1)); - stackPool[stack][0] = p0; - stackPool[stack][1] = p1; - stackPool[stack][2] = ndBigVector (u0, u1, ndFloat32 (0.0f), ndFloat32 (0.0f)); - stack ++; - while (stack) - { - stack --; - ndBigVector q0 (stackPool[stack][0]); - ndBigVector q1 (stackPool[stack][1]); - ndFloat64 t0 = stackPool[stack][2][0]; - ndFloat64 t1 = stackPool[stack][2][1]; - ndFloat64 t01 = (t1 + t0) * 0.5f; - - ndBigVector p01 ((q1 + q0).Scale (0.5f)); - ndBigVector q01 (CurvePoint (t01)); - ndBigVector err (q01 - p01); - ndAssert(err.m_w == ndFloat32 (0.0f)); - ndFloat64 err2 = err.DotProduct(err).GetScalar(); - if (err2 < tol2) - { - ndBigVector step (q1 - q0); - ndAssert(step.m_w == ndFloat32 (0.0f)); - length += ndSqrt (step.DotProduct(step).GetScalar()); - } - else - { - stackPool[stack][0] = q01; - stackPool[stack][1] = q1; - stackPool[stack][2] = ndBigVector (t01, t1, ndFloat32 (0.0f), ndFloat32 (0.0f)); - stack ++; - - stackPool[stack][0] = q0; - stackPool[stack][1] = q01; - stackPool[stack][2] = ndBigVector (t0, t01, ndFloat32 (0.0f), ndFloat32 (0.0f)); - stack ++; - } - } - u0 = u1; - p0 = p1; - } - - return length; -} - -void ndBezierSpline::InsertKnot (ndFloat64 u) -{ - const ndInt32 k = GetSpan(u); - ndInt32 multiplicity = 0; - for (ndInt32 i = 0; i < m_degree; ++i) - { - multiplicity += (ndAbs (m_knotVector[k + i + 1] - u) < ndFloat64 (1.0e-5f)) ? 1 : 0; - } - if (multiplicity == m_degree) - { - return; - } - - m_knotVector.SetCount(m_knotsCount + 1); - for (ndInt32 i = m_knotsCount; i > (k + 1); --i) - { - m_knotVector[i] = m_knotVector[i - 1]; - } - m_knotVector[k + 1] = u; - - ndBigVector Rw[16]; - for (ndInt32 i = 0; i <= m_degree; ++i) - { - Rw[i] = m_controlPoints[k - m_degree + i]; - } - - const ndInt32 m = k - m_degree + 1; - ndAssert(m >= 0); - ndAssert((k + 1 - 1 - 0) >= 0); - ndAssert((m_degree - 1 - 0) >= 0); - - for (ndInt32 i = 0; i <= (m_degree - 1); ++i) - { - ndFloat64 alpha = (u - m_knotVector[m + i]) / (m_knotVector[i + k + 1] - m_knotVector[m + i]); - Rw[i] = Rw[i + 1].Scale (alpha) + Rw[i].Scale (ndFloat64 (ndFloat32 (1.0f)) - alpha); - } - - m_controlPoints.SetCount(m_controlPointsCount + 1); - for (ndInt32 i = m_controlPointsCount; i > k; --i) - { - m_controlPoints[i] = m_controlPoints[i - 1]; - } - - m_controlPoints[m] = Rw[0]; - m_controlPoints[k + 1 - 1 - 0] = Rw[m_degree - 1 - 0]; - for (ndInt32 i = m + 1; i < k; ++i) - { - ndAssert((i - m) >= 0); - m_controlPoints[i] = Rw[i - m]; - } - - m_knotsCount ++; - m_controlPointsCount ++; -} - -bool ndBezierSpline::RemoveKnot (ndFloat64 u, ndFloat64 tol) -{ - ndInt32 r = GetSpan(u) + 1; - ndAssert (m_knotVector[r - 1] < u); - if (ndAbs (m_knotVector[r] - u) > 1.0e-5f) - { - return false; - } - - ndInt32 s = 1; - ndInt32 last = r - s; - ndInt32 first = r - m_degree; - ndInt32 ord = m_degree + 1; - ndBigVector temp[16]; - - bool removableFlag = false; - ndInt32 t = 0; - for ( ; t < m_degree; ++t) - { - ndInt32 off = first - 1; - temp[0] = m_controlPoints[off]; - temp[last + 1 - off] = m_controlPoints[last + 1]; - ndInt32 i = first; - ndInt32 j = last; - ndInt32 ii = 1; - ndInt32 jj = last - off; - - while ((j - i) > t) - { - ndFloat64 alpha_i = (u - m_knotVector[i]) / (m_knotVector[i + ord + t] - m_knotVector[i]); - ndFloat64 alpha_j = (u - m_knotVector[j - t]) / (m_knotVector[j + ord] - m_knotVector[j - t]); - temp[ii] = (m_controlPoints[i] - temp[ii - 1].Scale (ndFloat64 (ndFloat32 (1.0f)) - alpha_i)).Scale (ndFloat64 (ndFloat32 (1.0f)) / alpha_i); - temp[jj] = (m_controlPoints[j] - temp[jj + 1].Scale (alpha_j)).Scale (ndFloat64 (ndFloat32 (1.0f)) / (ndFloat64 (ndFloat32 (1.0f)) - alpha_j)); - i ++; - j --; - ii ++; - jj --; - } - if ((j - i) < t) - { - ndBigVector diff (temp[ii - 1] - temp[jj + 1]); - ndAssert(diff.m_w == ndFloat32 (0.0f)); - removableFlag = diff.DotProduct(diff).GetScalar() < (tol * tol); - } - else - { - ndFloat64 alpha_i = (u - m_knotVector[i]) / (m_knotVector[i + ord + t] - m_knotVector[i]); - ndBigVector p (temp[ii + t + 1].Scale (alpha_i) + temp[ii - 1].Scale (ndFloat64 (ndFloat32 (1.0f)) - alpha_i)); - ndBigVector diff (m_controlPoints[i] - p); - ndAssert(diff.m_w == ndFloat32 (0.0f)); - removableFlag = diff.DotProduct(diff).GetScalar() < (tol * tol); - } - if (!removableFlag) - { - break; - } - - i = first; - j = last; - while ((j - 1) > t) - { - m_controlPoints[i] = temp[i - off]; - m_controlPoints[j] = temp[j - off]; - i ++; - j --; - } - first --; - last ++; - } - - if (t) - { - for (ndInt32 k = r + t; k < m_knotsCount; ++k) - { - m_knotVector[k - t] = m_knotVector[k]; - } - - ndInt32 fOut = (2 * r - s - m_degree) / 2; - ndInt32 j = fOut; - ndInt32 i = j; - for (ndInt32 k = 1; k < t; ++k) - { - if ((k % 2) == 1) - { - i ++; - } - else - { - j = j - 1; - } - } - - for (ndInt32 k = i + 1; k < m_controlPointsCount; ++k) - { - m_controlPoints[j] = m_controlPoints[k]; - j ++; - } - - m_knotsCount -= t; - m_controlPointsCount -= t; - } - - return removableFlag; -} - -ndFloat64 ndBezierSpline::FindClosestKnot(ndBigVector& closestPoint, const ndBigVector& point, ndInt32 subdivitionSteps) const -{ - ndInt32 startSpan = m_degree; - ndFloat64 bestU = ndFloat32 (0.0f); - ndFloat64 distance2 = ndFloat32 (1.0e10f); - ndBigVector closestControlPoint(m_controlPoints[0]); - subdivitionSteps = ndMax(subdivitionSteps, 1); - ndFloat64 scale = ndFloat32 (1.0f) / (ndFloat64)subdivitionSteps; - for (ndInt32 span = m_degree; span < (m_knotsCount - m_degree - 1); ++span) - { - ndFloat64 param = ndFloat32 (0.0f); - for (ndInt32 i = 0; i < subdivitionSteps; ++i) - { - ndFloat64 u = m_knotVector[span] + (m_knotVector[span + 1] - m_knotVector[span]) * param; - param += scale; - ndBigVector p(CurvePoint(u, span)); - ndBigVector dp(p - point); - ndAssert(dp.m_w == ndFloat32 (0.0f)); - ndFloat64 dist2 = dp.DotProduct(dp).GetScalar(); - if (dist2 < distance2) - { - bestU = u; - startSpan = span; - distance2 = dist2; - closestControlPoint = p; - } - } - } - - ndBigVector p(CurvePoint(ndFloat32 (0.999f))); - ndBigVector dp(p - point); - ndAssert(dp.m_w == ndFloat32 (0.0f)); - ndFloat64 dist2 = dp.DotProduct(dp).GetScalar(); - if (dist2 < distance2) - { - bestU = ndFloat64(0.999f); - startSpan = m_knotsCount - m_degree - 2; - closestControlPoint = p; - } - - ndBigVector derivatives[32]; - ndFloat64 u0 = bestU; - - bool stop = false; - for (ndInt32 i = 0; (i < 20) && !stop; ++i) - { - CurveAllDerivatives(u0, derivatives); - - ndBigVector dist(closestControlPoint - point); - ndAssert(dist.m_w == ndFloat32 (0.0f)); - ndAssert(derivatives[1].m_w == ndFloat32 (0.0f)); - ndAssert(derivatives[2].m_w == ndFloat32 (0.0f)); - ndFloat64 num = derivatives[1].DotProduct(dist).GetScalar(); - ndFloat64 den = derivatives[2].DotProduct(dist).GetScalar() + derivatives[1].DotProduct(derivatives[1]).GetScalar(); - ndFloat64 u1 = u0; - if (ndAbs(den) > ndFloat64(1.0e-12)) - { - u1 -= num / den; - } - u1 = ndClamp(u1, ndFloat64(0.0), ndFloat64(1.0 - 1.0e-12)); - if (u1 < m_knotVector[startSpan]) - { - startSpan--; - ndAssert(startSpan >= 0); - } - else if (u1 >= m_knotVector[startSpan + 1]) - { - startSpan++; - ndAssert(startSpan < (m_knotsCount - m_degree)); - } - - ndAssert(startSpan >= m_degree); - ndAssert(startSpan <= (m_knotsCount - m_degree - 1)); - closestControlPoint = CurvePoint(u1, startSpan); - - stop |= (ndAbs(u1 - u0) < ndFloat64(1.0e-10)) || (num * num < ((dist.DotProduct(dist).GetScalar()) * (derivatives[1].DotProduct(derivatives[1]).GetScalar()) * ndFloat64(1.0e-10))); - u0 = u1; - } - - closestPoint = closestControlPoint; - return u0; -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndBezierSpline.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndBezierSpline.h deleted file mode 100644 index 28b2fd721a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndBezierSpline.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndArray.h" -#include "ndClassAlloc.h" - -#ifndef __ND_BEZIER_SPLINE_H__ -#define __ND_BEZIER_SPLINE_H__ - -class ndBezierSpline : public ndClassAlloc -{ - public: - - // empty spline - D_CORE_API ndBezierSpline (); - D_CORE_API ndBezierSpline (const ndBezierSpline& src); - - // create from knot vector and control points - D_CORE_API virtual ~ndBezierSpline (); - - D_CORE_API ndBezierSpline& operator = (const ndBezierSpline ©) ; - - D_CORE_API ndInt32 GetDegree () const; - - D_CORE_API ndBigVector CurvePoint (ndFloat64 u) const; - D_CORE_API ndBigVector CurveDerivative (ndFloat64 u, ndInt32 index = 1) const; - D_CORE_API ndInt32 CurveAllDerivatives (ndFloat64 u, ndBigVector* const defivatives) const; - - D_CORE_API ndFloat64 CalculateLength (ndFloat64 tol) const; - - D_CORE_API void GlobalCubicInterpolation (ndInt32 count, const ndBigVector* const points, const ndBigVector& firstTangent, const ndBigVector& lastTangent); - D_CORE_API void CreateFromKnotVectorAndControlPoints (ndInt32 degree, ndInt32 knotCount, const ndFloat64* const knotVector, const ndBigVector* const controlPoints); - - D_CORE_API void InsertKnot (ndFloat64 u); - D_CORE_API bool RemoveKnot (ndFloat64 u, ndFloat64 tol); - - D_CORE_API ndInt32 GetControlPointCount() const; - D_CORE_API ndArray& GetControlPointArray(); - D_CORE_API const ndArray& GetControlPointArray() const; - - D_CORE_API ndBigVector GetControlPoint(ndInt32 i) const; - D_CORE_API void SetControlPoint(ndInt32 i, const ndBigVector& point); - - D_CORE_API ndInt32 GetKnotCount() const; - D_CORE_API ndArray& GetKnotArray(); - D_CORE_API const ndArray& GetKnotArray() const; - - D_CORE_API ndFloat64 GetKnot(ndInt32 i) const; - D_CORE_API ndFloat64 FindClosestKnot (ndBigVector& closestPointOnCurve, const ndBigVector& point, ndInt32 subdivitionSteps = 2) const; - - D_CORE_API void Trace() const; - - - private: - void Clear(); - ndInt32 GetSpan(ndFloat64 u) const; - - ndBigVector CurvePoint (ndFloat64 u, ndInt32 span) const; - void CreateCubicKnotVector(ndInt32 count, const ndBigVector* const points); - void CreateCubicControlPoints(ndInt32 count, const ndBigVector* const points, const ndBigVector& firstTangent, const ndBigVector& lastTangent); - - void BasicsFunctions (ndFloat64 u, ndInt32 span, ndFloat64* const functionOut) const; - void BasicsFunctionsDerivatives (ndFloat64 u, ndInt32 span, ndFloat64* const derivatyivesOut) const; - - ndArray m_knotVector; - ndArray m_controlPoints; - - ndInt32 m_degree; - ndInt32 m_knotsCount; - ndInt32 m_controlPointsCount; -}; -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCRC.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCRC.cpp deleted file mode 100644 index bf66abd200..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCRC.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndCRC.h" - -#if 0 -static ndUnsigned64 randBits0[] = -{ - static_cast(7266447313870364031ULL), static_cast(4946485549665804864ULL), static_cast(16945909448695747420ULL), static_cast(16394063075524226720ULL), - static_cast(4873882236456199058ULL), static_cast(14877448043947020171ULL), static_cast(6740343660852211943ULL), static_cast(13857871200353263164ULL), - static_cast(5249110015610582907ULL), static_cast(10205081126064480383ULL), static_cast(1235879089597390050ULL), static_cast(17320312680810499042ULL), - static_cast(16489141110565194782ULL), static_cast(8942268601720066061ULL), static_cast(13520575722002588570ULL), static_cast(14226945236717732373ULL), - - static_cast(9383926873555417063ULL), static_cast(15690281668532552105ULL), static_cast(11510704754157191257ULL), static_cast(15864264574919463609ULL), - static_cast(6489677788245343319ULL), static_cast(5112602299894754389ULL), static_cast(10828930062652518694ULL), static_cast(15942305434158995996ULL), - static_cast(15445717675088218264ULL), static_cast(4764500002345775851ULL), static_cast(14673753115101942098ULL), static_cast(236502320419669032ULL), - static_cast(13670483975188204088ULL), static_cast(14931360615268175698ULL), static_cast(8904234204977263924ULL), static_cast(12836915408046564963ULL), - - static_cast(12120302420213647524ULL), static_cast(15755110976537356441ULL), static_cast(5405758943702519480ULL), static_cast(10951858968426898805ULL), - static_cast(17251681303478610375ULL), static_cast(4144140664012008120ULL), static_cast(18286145806977825275ULL), static_cast(13075804672185204371ULL), - static_cast(10831805955733617705ULL), static_cast(6172975950399619139ULL), static_cast(12837097014497293886ULL), static_cast(12903857913610213846ULL), - static_cast(560691676108914154ULL), static_cast(1074659097419704618ULL), static_cast(14266121283820281686ULL), static_cast(11696403736022963346ULL), - - static_cast(13383246710985227247ULL), static_cast(7132746073714321322ULL), static_cast(10608108217231874211ULL), static_cast(9027884570906061560ULL), - static_cast(12893913769120703138ULL), static_cast(15675160838921962454ULL), static_cast(2511068401785704737ULL), static_cast(14483183001716371453ULL), - static_cast(3774730664208216065ULL), static_cast(5083371700846102796ULL), static_cast(9583498264570933637ULL), static_cast(17119870085051257224ULL), - static_cast(5217910858257235075ULL), static_cast(10612176809475689857ULL), static_cast(1924700483125896976ULL), static_cast(7171619684536160599ULL), - - - static_cast(10949279256701751503ULL), static_cast(15596196964072664893ULL), static_cast(14097948002655599357ULL), static_cast(615821766635933047ULL), - static_cast(5636498760852923045ULL), static_cast(17618792803942051220ULL), static_cast(580805356741162327ULL), static_cast(425267967796817241ULL), - static_cast(8381470634608387938ULL), static_cast(13212228678420887626ULL), static_cast(16993060308636741960ULL), static_cast(957923366004347591ULL), - static_cast(6210242862396777185ULL), static_cast(1012818702180800310ULL), static_cast(15299383925974515757ULL), static_cast(17501832009465945633ULL), - - static_cast(17453794942891241229ULL), static_cast(15807805462076484491ULL), static_cast(8407189590930420827ULL), static_cast(974125122787311712ULL), - static_cast(1861591264068118966ULL), static_cast(997568339582634050ULL), static_cast(18046771844467391493ULL), static_cast(17981867688435687790ULL), - static_cast(3809841506498447207ULL), static_cast(9460108917638135678ULL), static_cast(16172980638639374310ULL), static_cast(958022432077424298ULL), - static_cast(4393365126459778813ULL), static_cast(13408683141069553686ULL), static_cast(13900005529547645957ULL), static_cast(15773550354402817866ULL), - - static_cast(16475327524349230602ULL), static_cast(6260298154874769264ULL), static_cast(12224576659776460914ULL), static_cast(6405294864092763507ULL), - static_cast(7585484664713203306ULL), static_cast(5187641382818981381ULL), static_cast(12435998400285353380ULL), static_cast(13554353441017344755ULL), - static_cast(646091557254529188ULL), static_cast(11393747116974949255ULL), static_cast(16797249248413342857ULL), static_cast(15713519023537495495ULL), - static_cast(12823504709579858843ULL), static_cast(4738086532119935073ULL), static_cast(4429068783387643752ULL), static_cast(585582692562183870ULL), - - static_cast(1048280754023674130ULL), static_cast(6788940719869959076ULL), static_cast(11670856244972073775ULL), static_cast(2488756775360218862ULL), - static_cast(2061695363573180185ULL), static_cast(6884655301895085032ULL), static_cast(3566345954323888697ULL), static_cast(12784319933059041817ULL), - static_cast(4772468691551857254ULL), static_cast(6864898938209826895ULL), static_cast(7198730565322227090ULL), static_cast(2452224231472687253ULL), - static_cast(13424792606032445807ULL), static_cast(10827695224855383989ULL), static_cast(11016608897122070904ULL), static_cast(14683280565151378358ULL), - - static_cast(7077866519618824360ULL), static_cast(17487079941198422333ULL), static_cast(3956319990205097495ULL), static_cast(5804870313319323478ULL), - static_cast(8017203611194497730ULL), static_cast(3310931575584983808ULL), static_cast(5009341981771541845ULL), static_cast(11772020174577005930ULL), - static_cast(3537640779967351792ULL), static_cast(6801855569284252424ULL), static_cast(17687268231192623388ULL), static_cast(12968358613633237218ULL), - static_cast(1429775571144180123ULL), static_cast(10427377732172208413ULL), static_cast(12155566091986788996ULL), static_cast(16465954421598296115ULL), - - static_cast(12710429690464359999ULL), static_cast(9547226351541565595ULL), static_cast(12156624891403410342ULL), static_cast(2985938688676214686ULL), - static_cast(18066917785985010959ULL), static_cast(5975570403614438776ULL), static_cast(11541343163022500560ULL), static_cast(11115388652389704592ULL), - static_cast(9499328389494710074ULL), static_cast(9247163036769651820ULL), static_cast(3688303938005101774ULL), static_cast(2210483654336887556ULL), - static_cast(15458161910089693228ULL), static_cast(6558785204455557683ULL), static_cast(1288373156735958118ULL), static_cast(18433986059948829624ULL), - - static_cast(3435082195390932486ULL), static_cast(16822351800343061990ULL), static_cast(3120532877336962310ULL), static_cast(16681785111062885568ULL), - static_cast(7835551710041302304ULL), static_cast(2612798015018627203ULL), static_cast(15083279177152657491ULL), static_cast(6591467229462292195ULL), - static_cast(10592706450534565444ULL), static_cast(7438147750787157163ULL), static_cast(323186165595851698ULL), static_cast(7444710627467609883ULL), - static_cast(8473714411329896576ULL), static_cast(2782675857700189492ULL), static_cast(3383567662400128329ULL), static_cast(3200233909833521327ULL), - - static_cast(12897601280285604448ULL), static_cast(3612068790453735040ULL), static_cast(8324209243736219497ULL), static_cast(15789570356497723463ULL), - static_cast(1083312926512215996ULL), static_cast(4797349136059339390ULL), static_cast(5556729349871544986ULL), static_cast(18266943104929747076ULL), - static_cast(1620389818516182276ULL), static_cast(172225355691600141ULL), static_cast(3034352936522087096ULL), static_cast(1266779576738385285ULL), - static_cast(3906668377244742888ULL), static_cast(6961783143042492788ULL), static_cast(17159706887321247572ULL), static_cast(4676208075243319061ULL), - - static_cast(10315634697142985816ULL), static_cast(13435140047933251189ULL), static_cast(716076639492622016ULL), static_cast(13847954035438697558ULL), - static_cast(7195811275139178570ULL), static_cast(10815312636510328870ULL), static_cast(6214164734784158515ULL), static_cast(16412194511839921544ULL), - static_cast(3862249798930641332ULL), static_cast(1005482699535576005ULL), static_cast(4644542796609371301ULL), static_cast(17600091057367987283ULL), - static_cast(4209958422564632034ULL), static_cast(5419285945389823940ULL), static_cast(11453701547564354601ULL), static_cast(9951588026679380114ULL), - - static_cast(7425168333159839689ULL), static_cast(8436306210125134906ULL), static_cast(11216615872596820107ULL), static_cast(3681345096403933680ULL), - static_cast(5770016989916553752ULL), static_cast(11102855936150871733ULL), static_cast(11187980892339693935ULL), static_cast(396336430216428875ULL), - static_cast(6384853777489155236ULL), static_cast(7551613839184151117ULL), static_cast(16527062023276943109ULL), static_cast(13429850429024956898ULL), - static_cast(9901753960477271766ULL), static_cast(9731501992702612259ULL), static_cast(5217575797614661659ULL), static_cast(10311708346636548706ULL), - - static_cast(15111747519735330483ULL), static_cast(4353415295139137513ULL), static_cast(1845293119018433391ULL), static_cast(11952006873430493561ULL), - static_cast(3531972641585683893ULL), static_cast(16852246477648409827ULL), static_cast(15956854822143321380ULL), static_cast(12314609993579474774ULL), - static_cast(16763911684844598963ULL), static_cast(16392145690385382634ULL), static_cast(1545507136970403756ULL), static_cast(17771199061862790062ULL), - static_cast(12121348462972638971ULL), static_cast(12613068545148305776ULL), static_cast(954203144844315208ULL), static_cast(1257976447679270605ULL), - - static_cast(3664184785462160180ULL), static_cast(2747964788443845091ULL), static_cast(15895917007470512307ULL), static_cast(15552935765724302120ULL), - static_cast(16366915862261682626ULL), static_cast(8385468783684865323ULL), static_cast(10745343827145102946ULL), static_cast(2485742734157099909ULL), - static_cast(916246281077683950ULL), static_cast(15214206653637466707ULL), static_cast(12895483149474345798ULL), static_cast(1079510114301747843ULL), - static_cast(10718876134480663664ULL), static_cast(1259990987526807294ULL), static_cast(8326303777037206221ULL), static_cast(14104661172014248293ULL), -}; - -// calculate a 32 bit crc of a string -ndUnsigned64 ndCRC64 (const char* const name, ndUnsigned64 crcAcc) -{ - if (name) - { - //const ndInt32 bitshift = (sizeof (ndUnsigned64)<<3) - 8; - const ndInt32 bitshift = 8; - for (ndInt32 i = 0; name[i]; ++i) - { - char c = name[i]; - ndInt32 index = ndInt32 (((crcAcc >> bitshift) ^ c) & 0xff); - ndUnsigned64 val = randBits0[index]; - crcAcc = (crcAcc << 8) ^ val; - } - } - return crcAcc; -} - -ndUnsigned64 ndCRC64 (const void* const buffer, ndInt32 size, ndUnsigned64 crcAcc) -{ - const unsigned char* const ptr = (unsigned char*)buffer; - - const ndInt32 bitshift = 8; - for (ndInt32 i = 0; i < size; ++i) - { - unsigned char c = ptr[i]; - ndUnsigned64 val = randBits0[((crcAcc >> bitshift) ^ c) & 0xff]; - crcAcc = (crcAcc << 8) ^ val; - } - return crcAcc; -} - -#else - -ndUnsigned64 ndCRC64(const char* const name, ndUnsigned64 crcAcc) -{ - // https://en.wikipedia.org/wiki/Jenkins_hash_function - // the simplest hash function I could find from wikipedia - // no sure how uniform distributed it is, - // but it seems pretty good so far. - //size_t i = 0; - //hash = 0; - //for (ndInt32 i = 0; i < size; ++i) - // hash += key[i++]; - // hash += hash << 10; - // hash ^= hash >> 6; - //} - //hash += hash << 3; - //hash ^= hash >> 11; - //hash += hash << 15; - //return hash; - - if (name) - { - for (ndInt32 i = 0; name[i]; ++i) - { - char c = name[i]; - crcAcc += c; - crcAcc += crcAcc << 10; - crcAcc ^= crcAcc >> 6; - } - crcAcc += crcAcc << 3; - crcAcc ^= crcAcc >> 11; - crcAcc += crcAcc << 15; - } - return crcAcc; -} - -ndUnsigned64 ndCRC64(const void* const buffer, ndInt32 size, ndUnsigned64 crcAcc) -{ - const unsigned char* const ptr = (unsigned char*)buffer; - for (ndInt32 i = 0; i < size; ++i) - { - unsigned char c = ptr[i]; - crcAcc += c; - crcAcc += crcAcc << 10; - crcAcc ^= crcAcc >> 6; - } - crcAcc += crcAcc << 3; - crcAcc ^= crcAcc >> 11; - crcAcc += crcAcc << 15; - return crcAcc; -} - -#endif - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCRC.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCRC.h deleted file mode 100644 index b040736588..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCRC.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __NDCRC_H__ -#define __NDCRC_H__ - -#include "ndCoreStdafx.h" - -D_CORE_API ndUnsigned64 ndCRC64 (const char* const string, ndUnsigned64 crcAcc = 0); -D_CORE_API ndUnsigned64 ndCRC64 (const void* const buffer, ndInt32 size, ndUnsigned64 crcAcc); - -inline ndUnsigned64 ndCombineCRC(ndUnsigned64 a, ndUnsigned64 b) -{ - return (a << 8) ^ b; -} - - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndClassAlloc.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndClassAlloc.cpp deleted file mode 100644 index 14f327c165..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndClassAlloc.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndMemory.h" -#include "ndClassAlloc.h" - -void* ndClassAlloc::Malloc(size_t size) -{ - return ndMemory::Malloc(size); -} - -void ndClassAlloc::Free(void* const ptr) -{ - ndMemory::Free(ptr); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndClassAlloc.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndClassAlloc.h deleted file mode 100644 index aaa823721e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndClassAlloc.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CLASS_ALLOC_H_ -#define __ND_CLASS_ALLOC_H_ - -#include "ndCoreStdafx.h" -#include "ndMemory.h" - -/// Base class for providing memory allocation for all other engine classes. -class ndClassAlloc -{ - public: - /// Empty default constructor - inline ndClassAlloc() - { - } - - D_OPERATOR_NEW_AND_DELETE - - /// Generic allocation for any function subclass from ndClassAlloc - D_CORE_API static void* Malloc(size_t size); - - /// Generic destruction for any function subclass from ndClassAlloc - D_CORE_API static void Free(void* const ptr); -}; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConjugateGradient.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConjugateGradient.h deleted file mode 100644 index e9a8d07ff6..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConjugateGradient.h +++ /dev/null @@ -1,238 +0,0 @@ - -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONJUGATE_GRADIENT_H__ -#define __ND_CONJUGATE_GRADIENT_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndClassAlloc.h" -#include "ndGeneralVector.h" -#include "ndGeneralMatrix.h" - -#define D_USE_JACOBI_PRECONDITIONER - -template -class ndDefaultMatrixOperator -{ - public: - ndDefaultMatrixOperator(ndInt32 size, const T* const matrix, T* const preconditonerBuffer) - :m_matrix(matrix) - ,m_preconditoner(preconditonerBuffer) - ,m_size(size) - { -#ifdef D_USE_JACOBI_PRECONDITIONER - // use Jacobi preconditiner - const T* row = m_matrix; - for (ndInt32 i = 0; i < size; ++i) - { - m_preconditoner[i] = T(1.0f) / row[i]; - row += m_size; - } -#endif - - // trying Gauss sidle preconditioned later, but does no seem to get any better result than Jacobi. - //ndMemCpy(A, matrix, sizeof(A)/sizeof(A[0][0])); - // - //dCholeskyFactorization(size, size, &A[0][0]); - //for (ndInt32 i = 2; i < 6; ++i) - //{ - // for (ndInt32 j = 0; j < i - 1; ++j) - // { - // A[i][j] = 0.0f; - // } - //} - - //for (ndInt32 i = 0; i < 6; ++i) - //{ - // for (ndInt32 j = i + 2; j < 6; ++j) - // { - // A[i][j] = 0.0f; - // A[j][i] = 0.0f; - // } - //} - // - //for (ndInt32 i = 0; i < 5; ++i) - //{ - // T val = dAbs(A[i][i] * T(0.99f)); - // if (val < dAbs(A[i][i + 1])) - // { - // //val *= dSign(A[i][i + 1]); - // val = 0; - // A[i][i + 1] = val; - // A[i + 1][i] = val; - // //A[i][i + 1] = 0; - // //A[i + 1][i] = 0; - // } - //} - // - //for (ndInt32 i = 1; i < 6; ++i) - //{ - // T val = dAbs(A[i][i] * T(0.99f)); - // if (val < dAbs(A[i][i - 1])) - // { - // //val *= dSign(A[i][i - 1]); - // val = 0; - // A[i][i - 1] = val; - // A[i - 1][i] = val; - // } - //} - // - // - //dCholeskyFactorization(size, size, &A[0][0]); - } - - void PreconditionerSolve(const T* const input, T* const output) - { -#ifdef D_USE_JACOBI_PRECONDITIONER - for (ndInt32 i = 0; i < m_size; ++i) - { - output[i] = input[i] * m_preconditoner[i]; - } -#endif - //dSolveCholesky(m_size, m_size, &A[0][0], output, input); - } - - void MatrixTimeVector(const T* const input, T* const output) - { - ndMatrixTimeVector(m_size, m_matrix, input, output); - } - - const T* m_matrix; - T* m_preconditoner; - ndInt32 m_size; - - T A[6][6]; -}; - -template> -class ndConjugateGradient : public ndClassAlloc -{ - public: - ndConjugateGradient(); - ndConjugateGradient(T* const r0, T* const z0, T* const p0, T* const q0); - ~ndConjugateGradient(); - - void SetBuffers(T* const r0, T* const z0, T* const p0, T* const q0); - T Solve(ndInt32 size, T tolerance, T* const x, const T* const b, const T* const matrix, T* const preconditionerBuffer); - - private: - T SolveInternal(ndInt32 size, T tolerance, T* const x, const T* const b, const T* const matrix, T* const preconditionerBuffer) const; - - T* m_r0; - T* m_z0; - T* m_p0; - T* m_q0; -}; - -template -ndConjugateGradient::ndConjugateGradient() -{ - SetBuffers(nullptr, nullptr, nullptr, nullptr); -} - -template -ndConjugateGradient::ndConjugateGradient(T* const r0, T* const z0, T* const p0, T* const q0) -{ - SetBuffers(r0, z0, p0, q0); -} - -template -ndConjugateGradient::~ndConjugateGradient() -{ -} - -template -void ndConjugateGradient::SetBuffers(T* const r0, T* const z0, T* const p0, T* const q0) -{ - m_r0 = r0; - m_z0 = z0; - m_p0 = p0; - m_q0 = q0; -} - -template -T ndConjugateGradient::Solve(ndInt32 size, T tolerance, T* const x, const T* const b, const T* const matrix, T* const preconditionerBuffer) -{ - if (m_r0) - { - return SolveInternal(size, tolerance, x, b, matrix, preconditionerBuffer); - } - else - { - T* const r0 = ndAlloca(T, size); - T* const z0 = ndAlloca(T, size); - T* const p0 = ndAlloca(T, size); - T* const q0 = ndAlloca(T, size); - SetBuffers(r0, z0, p0, q0); - T error = SolveInternal(size, tolerance, x, b, matrix, preconditionerBuffer); - SetBuffers(nullptr, nullptr, nullptr, nullptr); - return error; - } -} - -template -T ndConjugateGradient::SolveInternal(ndInt32 size, T tolerance, T* const x, const T* const b, const T* const matrix, T* const preconditionerBuffer) const -{ - ndMatrixOperator matrixOper(size, matrix, preconditionerBuffer); - - matrixOper.MatrixTimeVector(x, m_z0); - ndSub(size, m_r0, b, m_z0); - matrixOper.PreconditionerSolve(m_r0, m_p0); - - ndInt32 iter = 0; - T num = ndDotProduct(size, m_r0, m_p0); - T error2 = num; - for (ndInt32 j = 0; (j < size) && (error2 > tolerance); ++j) - { - matrixOper.MatrixTimeVector(m_p0, m_z0); - T den = ndDotProduct(size, m_p0, m_z0); - - ndAssert(fabs(den) > T(0.0f)); - T alpha = num / den; - - ndScaleAdd(size, x, x, m_p0, alpha); - if ((j % 50) != 49) - { - ndScaleAdd(size, m_r0, m_r0, m_z0, -alpha); - } - else - { - matrixOper.MatrixTimeVector(x, m_z0); - ndSub(size, m_r0, b, m_z0); - } - - matrixOper.PreconditionerSolve(m_r0, m_q0); - - T num1 = ndDotProduct(size, m_r0, m_q0); - T beta = num1 / num; - ndScaleAdd(size, m_p0, m_q0, m_p0, beta); - num = ndDotProduct(size, m_r0, m_q0); - iter++; - error2 = num; - } - ndAssert(iter <= size); - return num; -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndContainersAlloc.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndContainersAlloc.cpp deleted file mode 100644 index 996de4c202..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndContainersAlloc.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndUtils.h" -#include "ndMemory.h" -#include "ndClassAlloc.h" -#include "ndFixSizeArray.h" -#include "ndContainersAlloc.h" -#include "ndThreadSyncUtils.h" - -#define D_FREELIST_DICTIONARY_SIZE 64 - -class ndFreeListEntry -{ - public: - ndFreeListEntry* m_next; -}; - -class ndFreeListHeader -{ - public: - ndInt32 m_count; - ndInt32 m_schunkSize; - ndFreeListEntry* m_headPointer; -}; - -class ndFreeListDictionary: public ndFixSizeArray -{ - public: - ndFreeListDictionary() - :ndFixSizeArray() - ,m_lock() - { - } - - ~ndFreeListDictionary() - { - Flush(); - } - - static ndFreeListDictionary& GetHeader() - { - static ndFreeListDictionary dictionary; - return dictionary; - } - - void Flush(ndFreeListHeader* const header) - { - ndFreeListEntry* next; - for (ndFreeListEntry* node = header->m_headPointer; node; node = next) - { - next = node->m_next; - ndMemory::Free(node); - } - header->m_count = 0; - header->m_headPointer = nullptr; - } - - void* Malloc(ndInt32 size) - { - { - ndScopeSpinLock lock(m_lock); - ndFreeListHeader* const header = FindEntry(ndInt32(ndMemory::CalculateBufferSize(size_t(size)))); - ndAssert(header->m_count >= 0); - if (header->m_count) - { - header->m_count--; - ndFreeListEntry* const self = header->m_headPointer; - header->m_headPointer = self->m_next; - return self; - } - } - void* const ptr = ndMemory::Malloc(size_t(size)); - ndAssert(ndMemory::GetSize(ptr) == ndMemory::CalculateBufferSize(size_t(size))); - return ptr; - } - - void Free(void* ptr) - { - ndScopeSpinLock lock(m_lock); - ndFreeListHeader* const header = FindEntry(ndInt32(ndMemory::GetSize(ptr))); - ndAssert(header); - ndFreeListEntry* const self = (ndFreeListEntry*)ptr; - - self->m_next = header->m_headPointer; - header->m_count++; - header->m_headPointer = self; - } - - void Flush() - { - ndScopeSpinLock lock(m_lock); - ndFreeListDictionary& me = *this; - for (ndInt32 i = 0; i < GetCount(); ++i) - { - ndFreeListHeader* const header = &me[i]; - Flush(header); - } - SetCount(0); - } - - void Flush(ndInt32 size) - { - ndScopeSpinLock lock(m_lock); - ndFreeListHeader* const header = FindEntry(ndInt32(ndMemory::CalculateBufferSize(size_t(size)))); - Flush(header); - } - - private: - ndFreeListHeader* FindEntry(ndInt32 size) - { - ndInt32 i0 = 0; - ndInt32 i1 = GetCount() - 1; - ndFreeListDictionary& me = *this; - while ((i1 - i0 > 4)) - { - ndInt32 mid = (i1 + i0) / 2; - if (me[mid].m_schunkSize <= size) - { - i0 = mid; - } - else - { - i1 = mid; - } - } - - for (ndInt32 i = i0; i <= i1; ++i) - { - if (me[i].m_schunkSize == size) - { - return &me[i]; - } - } - - #ifdef _DEBUG - for (ndInt32 i = 0; i < GetCount(); ++i) - { - ndAssert(me[i].m_schunkSize != size); - } - #endif - - ndFreeListHeader header; - header.m_count = 0; - header.m_schunkSize = size; - header.m_headPointer = nullptr; - PushBack(header); - ndInt32 index = GetCount() - 1; - for (ndInt32 i = GetCount() - 2; i >= 0; --i) - { - if (size < me[i].m_schunkSize) - { - me[i + 1] = me[i]; - me[i + 0] = header; - index = i; - } - else - { - break; - } - } - return &me[index]; - } - - ndSpinLock m_lock; -}; - -void ndFreeListAlloc::Flush() -{ - ndFreeListDictionary& dictionary = ndFreeListDictionary::GetHeader(); - dictionary.Flush(); -} - -void* ndFreeListAlloc::operator new (size_t size) -{ - ndFreeListDictionary& dictionary = ndFreeListDictionary::GetHeader(); - return dictionary.Malloc(ndInt32 (size)); -} - -void ndFreeListAlloc::operator delete (void* ptr) -{ - ndFreeListDictionary& dictionary = ndFreeListDictionary::GetHeader(); - dictionary.Free(ptr); -} - -void ndFreeListAlloc::Flush(ndInt32 size) -{ - ndFreeListDictionary& dictionary = ndFreeListDictionary::GetHeader(); - dictionary.Flush(size); -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndContainersAlloc.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndContainersAlloc.h deleted file mode 100644 index 4df9d55c95..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndContainersAlloc.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONTAINERS_ALLOC_H_ -#define __ND_CONTAINERS_ALLOC_H_ - -#include "ndCoreStdafx.h" - -template -class ndContainersAlloc: public ndClassAlloc -{ - public: - ndContainersAlloc() - { - } - - ~ndContainersAlloc() - { - } - - static void FlushFreeList(ndInt32) - { - } -}; - -class ndFreeListAlloc -{ - public: - ndFreeListAlloc(); - D_CORE_API static void Flush(); - D_CORE_API static void Flush(ndInt32 size); - D_CORE_API void *operator new (size_t size); - D_CORE_API void operator delete (void* ptr); -}; - -inline ndFreeListAlloc::ndFreeListAlloc() -{ -} - -template -class ndContainersFreeListAlloc: public ndFreeListAlloc -{ - public: - ndContainersFreeListAlloc() - :ndFreeListAlloc() - { - } - - ~ndContainersFreeListAlloc() - { - } - - static void FlushFreeList(ndInt32 size) - { - Flush(size); - } -}; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull2d.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull2d.cpp deleted file mode 100644 index bdaaa97276..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull2d.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndSort.h" -#include "ndConvexHull2d.h" - -static ndFloat32 Cross(const ndVector &O, const ndVector &A, const ndVector &B) -{ - const ndVector A0(A - O); - const ndVector B0(B - O); - const ndFloat32 sign = A0.m_y * B0.m_x - A0.m_x * B0.m_y; - return sign; -} - -ndInt32 ndConvexHull2d(ndVector* const vertexCloud2d, ndInt32 count) -{ - if (count <= 3) - { - if (count == 3) - { - ndFloat32 area = Cross(vertexCloud2d[0], vertexCloud2d[1], vertexCloud2d[2]); - if (area < ndFloat32(0.0f)) - { - ndSwap(vertexCloud2d[1], vertexCloud2d[2]); - } - } - return count; - } - - ndVector* const hull = ndAlloca(ndVector, 2 * count); - - // Sort points lexicographically - class CompareVertex - { - public: - CompareVertex(void*) - { - } - - ndInt32 Compare(const ndVector& elementA, const ndVector& elementB) const - { - if (elementA.m_x < elementB.m_x) - { - return -1; - } - else if (elementA.m_x > elementB.m_x) - { - return 1; - } - else - { - if (elementA.m_y < elementB.m_y) - { - return -1; - } - else if (elementA.m_y > elementB.m_y) - { - return 1; - } - } - return 0; - } - }; - ndSort(vertexCloud2d, count, nullptr); - - // Build lower hull - ndInt32 k = 0; - for (ndInt32 i = 0; i < count; ++i) - { - while (k >= 2 && Cross(hull[k - 2], hull[k - 1], vertexCloud2d[i]) <= 0.0f) - { - --k; - } - hull[k] = vertexCloud2d[i]; - k++; - } - - // Build upper hull - for (ndInt32 i = count - 1, t = k + 1; i > 0; --i) - { - while (k >= t && Cross(hull[k - 2], hull[k - 1], vertexCloud2d[i - 1]) <= 0.0f) - { - --k; - } - hull[k] = vertexCloud2d[i - 1]; - k++; - } - - k--; - for (ndInt32 i = k - 1; i >= 0; --i) - { - vertexCloud2d[i] = hull[i]; - } - //return k - 1; - return k; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull2d.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull2d.h deleted file mode 100644 index dadb1e7c06..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull2d.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __NDG_CONVEXHULL_2D__ -#define __NDG_CONVEXHULL_2D__ - -#include "ndCoreStdafx.h" -#include "ndVector.h" - -D_CORE_API ndInt32 ndConvexHull2d(ndVector* const vertexCloud2d, ndInt32 count); - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull3d.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull3d.cpp deleted file mode 100644 index 5bd09099d9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull3d.cpp +++ /dev/null @@ -1,1209 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndSort.h" -#include "ndTree.h" -#include "ndStack.h" -#include "ndGoogol.h" -#include "ndConvexHull3d.h" -#include "ndSmallDeterminant.h" - -#define DG_CONVEXHULL_3D_VERTEX_CLUSTER_SIZE 8 - -#ifdef D_OLD_CONVEXHULL_3D -class ndConvexHull3d::ndNormalMap -{ - public: - ndNormalMap() - :m_count(sizeof(m_normal) / sizeof(m_normal[0])) - { - ndVector p0(ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p1(ndFloat32(-1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p2(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p3(ndFloat32(0.0f), ndFloat32(-1.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p4(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f)); - ndVector p5(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(-1.0f), ndFloat32(0.0f)); - - ndInt32 count = 0; - ndInt32 subdivitions = 2; - TessellateTriangle(subdivitions, p4, p0, p2, count); - TessellateTriangle(subdivitions, p0, p5, p2, count); - TessellateTriangle(subdivitions, p5, p1, p2, count); - TessellateTriangle(subdivitions, p1, p4, p2, count); - TessellateTriangle(subdivitions, p0, p4, p3, count); - TessellateTriangle(subdivitions, p5, p0, p3, count); - TessellateTriangle(subdivitions, p1, p5, p3, count); - TessellateTriangle(subdivitions, p4, p1, p3, count); - } - - static const ndNormalMap& GetNormaMap() - { - static ndNormalMap normalMap; - return normalMap; - } - - void TessellateTriangle(ndInt32 level, const ndVector& p0, const ndVector& p1, const ndVector& p2, ndInt32& count) - { - if (level) - { - ndAssert(ndAbs(p0.DotProduct(p0).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p1.DotProduct(p1).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p2.DotProduct(p2).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndVector p01(p0 + p1); - ndVector p12(p1 + p2); - ndVector p20(p2 + p0); - - p01 = p01.Scale(ndRsqrt(p01.DotProduct(p01).GetScalar())); - p12 = p12.Scale(ndRsqrt(p12.DotProduct(p12).GetScalar())); - p20 = p20.Scale(ndRsqrt(p20.DotProduct(p20).GetScalar())); - - ndAssert(ndAbs(p01.DotProduct(p01).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p12.DotProduct(p12).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p20.DotProduct(p20).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - - TessellateTriangle(level - 1, p0, p01, p20, count); - TessellateTriangle(level - 1, p1, p12, p01, count); - TessellateTriangle(level - 1, p2, p20, p12, count); - TessellateTriangle(level - 1, p01, p12, p20, count); - } - else - { - ndBigPlane n(p0, p1, p2); - n = n.Scale(ndFloat64(1.0f) / sqrt(n.DotProduct(n).GetScalar())); - n.m_w = ndFloat64(0.0f); - ndInt32 index = ndBitReversal(count, sizeof(m_normal) / sizeof(m_normal[0])); - m_normal[index] = n; - count++; - ndAssert(count <= ndInt32 (sizeof(m_normal) / sizeof(m_normal[0]))); - } - } - - ndBigVector m_normal[128]; - ndInt32 m_count; -}; -#endif - -class ndConvexHull3dVertex: public ndBigVector -{ - public: - ndInt32 m_mark; -}; - -class ndConvexHull3dAABBTreeNode -{ - public: - ndBigVector m_box[2]; - ndConvexHull3dAABBTreeNode* m_left; - ndConvexHull3dAABBTreeNode* m_right; - ndConvexHull3dAABBTreeNode* m_parent; -}; - -class ndConvexHull3dPointCluster: public ndConvexHull3dAABBTreeNode -{ - public: - ndInt32 m_count; - ndInt32 m_indices[DG_CONVEXHULL_3D_VERTEX_CLUSTER_SIZE]; -}; - -ndConvexHull3dFace::ndConvexHull3dFace() -{ - m_mark = 0; - m_twin[0] = nullptr; - m_twin[1] = nullptr; - m_twin[2] = nullptr; -} - -ndFloat64 ndConvexHull3dFace::Evalue (const ndBigVector* const pointArray, const ndBigVector& point) const -{ - const ndBigVector& p0 = pointArray[m_index[0]]; - const ndBigVector& p1 = pointArray[m_index[1]]; - const ndBigVector& p2 = pointArray[m_index[2]]; - - ndFloat64 matrix[3][3]; - for (ndInt32 i = 0; i < 3; ++i) - { - matrix[0][i] = p2[i] - p0[i]; - matrix[1][i] = p1[i] - p0[i]; - matrix[2][i] = point[i] - p0[i]; - } - - ndFloat64 error; - ndFloat64 det = Determinant3x3 (matrix, &error); - - // the code use double, however the threshold for accuracy test is the machine precision of a float. - // by changing this to a smaller number, the code should run faster since many small test will be considered valid - // the precision must be a power of two no smaller than the machine precision of a double, (1<<48) - // float64(1<<30) can be a good value - - // ndFloat64 precision = ndFloat64 (1.0f) / ndFloat64 (1<<30); - ndFloat64 precision = ndFloat64 (1.0f) / ndFloat64 (1<<24); - ndFloat64 errbound = error * precision; - if (fabs(det) > errbound) - { - return det; - } - - ndGoogol exactMatrix[3][3]; - for (ndInt32 i = 0; i < 3; ++i) - { - exactMatrix[0][i] = ndGoogol(p2[i]) - ndGoogol(p0[i]); - exactMatrix[1][i] = ndGoogol(p1[i]) - ndGoogol(p0[i]); - exactMatrix[2][i] = ndGoogol(point[i]) - ndGoogol(p0[i]); - } - - ndFloat64 ret = Determinant3x3(exactMatrix); - return ret; -} - -ndConvexHull3d::ndList::ndNode* ndConvexHull3dFace::GetTwin(ndInt32 index) const -{ - return m_twin[index]; -} - -ndBigPlane ndConvexHull3dFace::GetPlaneEquation (const ndBigVector* const pointArray, bool& isvalid) const -{ - const ndBigVector& p0 = pointArray[m_index[0]]; - const ndBigVector& p1 = pointArray[m_index[1]]; - const ndBigVector& p2 = pointArray[m_index[2]]; - ndBigPlane plane (p0, p1, p2); - - isvalid = false; - double mag2 = plane.DotProduct(plane & ndBigVector::m_triplexMask).GetScalar(); - if (mag2 > ndFloat32 (1.0e-16f)) - { - isvalid = true; - plane = plane.Scale(ndFloat32 (1.0f) / sqrt(mag2)); - } - return plane; -} - -ndConvexHull3d::ndConvexHull3d () - :ndList() - ,m_aabbP0(ndBigVector (ndFloat64 (0.0f))) - ,m_aabbP1(ndBigVector (ndFloat64 (0.0f))) - ,m_diag() - ,m_points() -{ -} - -ndConvexHull3d::ndConvexHull3d(const ndConvexHull3d& source) - :ndList() - ,m_aabbP0 (source.m_aabbP0) - ,m_aabbP1 (source.m_aabbP1) - ,m_diag(source.m_diag) - ,m_points(source.GetCount()) -{ - m_points.SetCount(source.GetCount()); - m_points[source.GetCount()-1].m_w = ndFloat64 (0.0f); - for (ndInt32 i = 0; i < source.GetCount(); ++i) - { - m_points[i] = source.m_points[i]; - } - - ndTree map; - for(ndNode* sourceNode = source.GetFirst(); sourceNode; sourceNode = sourceNode->GetNext() ) - { - ndNode* const node = Append(); - map.Insert(node, sourceNode); - } - - for(ndNode* sourceNode = source.GetFirst(); sourceNode; sourceNode = sourceNode->GetNext() ) { - ndNode* const node = map.Find(sourceNode)->GetInfo(); - - ndConvexHull3dFace& face = node->GetInfo(); - ndConvexHull3dFace& srcFace = sourceNode->GetInfo(); - - face.m_mark = 0; - for (ndInt32 i = 0; i < 3; ++i) { - face.m_index[i] = srcFace.m_index[i]; - face.m_twin[i] = map.Find (srcFace.m_twin[i])->GetInfo(); - } - } -} - -ndConvexHull3d::ndConvexHull3d(const ndFloat64* const vertexCloud, ndInt32 strideInBytes, ndInt32 count, ndFloat64 distTol, ndInt32 maxVertexCount) - :ndList() - ,m_aabbP0(ndBigVector::m_zero) - ,m_aabbP1(ndBigVector::m_zero) - ,m_diag() - ,m_points() -{ - BuildHull (vertexCloud, strideInBytes, count, distTol, maxVertexCount); -} - -ndConvexHull3d::~ndConvexHull3d(void) -{ -} - -void ndConvexHull3d::Save(const char* const filename) const -{ - FILE* const file = fopen(filename, "wb"); - ndInt32 index = 0; - //fprintf(file, "final\n"); - for (ndNode* nodePtr = GetFirst(); nodePtr; nodePtr = nodePtr->GetNext()) - { - fprintf(file, "triangle %d\n", index); - index++; - const ndConvexHull3dFace& face = nodePtr->GetInfo(); - const ndBigVector& p0 = m_points[face.m_index[0]]; - const ndBigVector& p1 = m_points[face.m_index[1]]; - const ndBigVector& p2 = m_points[face.m_index[2]]; - - fprintf(file, "p0(%f %f %f)\n", p0[0], p0[1], p0[2]); - fprintf(file, "p1(%f %f %f)\n", p1[0], p1[1], p1[2]); - fprintf(file, "p2(%f %f %f)\n", p2[0], p2[1], p2[2]); - } - fprintf(file, "\n"); - - fclose(file); -} - -void ndConvexHull3d::BuildHull (const ndFloat64* const vertexCloud, ndInt32 strideInBytes, ndInt32 count, ndFloat64 distTol, ndInt32 maxVertexCount) -{ - ndInt32 treeCount = count / (DG_CONVEXHULL_3D_VERTEX_CLUSTER_SIZE>>1); - if (treeCount < 4) - { - treeCount = 4; - } - treeCount *= 2; - - ndStack points (count); - ndStack treePool (treeCount + 256); - - const ndInt32 stride = ndInt32(strideInBytes / sizeof(ndFloat64)); - for (ndInt32 i = 0; i < count; ++i) - { - ndInt32 index = i * stride; - ndBigVector& vertex = points[i]; - vertex = ndBigVector(vertexCloud[index], vertexCloud[index + 1], vertexCloud[index + 2], ndFloat64(0.0f)); - ndAssert(ndCheckVector(vertex)); - points[i].m_mark = 0; - } - - count = InitVertexArray(&points[0], count, &treePool[0], treePool.GetSizeInBytes()); - -#ifdef D_OLD_CONVEXHULL_3D - if (m_points.GetCount() >= 4) - { - CalculateConvexHull3d (&treePool[0], &points[0], count, distTol, maxVertexCount); - } -#else - if (m_count >= 3) - { - if (CheckFlatSurface(&treePool[0], &points[0], count, distTol, maxVertexCount)) - { - CalculateConvexHull2d(&treePool[0], &points[0], count, distTol, maxVertexCount); - } - else - { - ndAssert(m_count == 4); - CalculateConvexHull3d(&treePool[0], &points[0], count, distTol, maxVertexCount); - } - } -#endif -} - -ndConvexHull3dAABBTreeNode* ndConvexHull3d::BuildTree (ndConvexHull3dAABBTreeNode* const parent, ndConvexHull3dVertex* const points, ndInt32 count, ndInt32 baseIndex, ndInt8** memoryPool, ndInt32& maxMemSize) const -{ - ndConvexHull3dAABBTreeNode* tree = nullptr; - - ndAssert (count); - ndBigVector minP ( ndFloat32 (1.0e15f)); - ndBigVector maxP (-ndFloat32 (1.0e15f)); - if (count <= DG_CONVEXHULL_3D_VERTEX_CLUSTER_SIZE) - { - ndConvexHull3dPointCluster* const clump = new (*memoryPool) ndConvexHull3dPointCluster; - *memoryPool += sizeof (ndConvexHull3dPointCluster); - maxMemSize -= sizeof (ndConvexHull3dPointCluster); - ndAssert (maxMemSize >= 0); - - ndAssert (clump); - clump->m_count = count; - for (ndInt32 i = 0; i < count; ++i) - { - clump->m_indices[i] = i + baseIndex; - - const ndBigVector& p = points[i]; - ndAssert(p.m_w == ndFloat32(0.0f)); - minP = minP.GetMin(p); - maxP = maxP.GetMax(p); - } - - clump->m_left = nullptr; - clump->m_right = nullptr; - tree = clump; - - } - else - { - ndBigVector median (ndBigVector::m_zero); - ndBigVector varian (ndBigVector::m_zero); - for (ndInt32 i = 0; i < count; ++i) - { - const ndBigVector& p = points[i]; - ndAssert(p.m_w == ndFloat32(0.0f)); - minP = minP.GetMin(p); - maxP = maxP.GetMax(p); - median += p; - varian += p * p; - } - - varian = varian.Scale(ndFloat32(count)) - median * median; - ndInt32 index = 0; - ndFloat64 maxVarian = ndFloat64 (-1.0e10f); - for (ndInt32 i = 0; i < 3; ++i) - { - if (varian[i] > maxVarian) - { - index = i; - maxVarian = varian[i]; - } - } - ndBigVector center (median.Scale (ndFloat64 (1.0f) / ndFloat64 (count))); - - ndFloat64 test = center[index]; - - ndInt32 i0 = 0; - ndInt32 i1 = count - 1; - do - { - for (; i0 <= i1; ++i0) - { - ndFloat64 val = points[i0][index]; - if (val > test) - { - break; - } - } - - for (; i1 >= i0; --i1) - { - ndFloat64 val = points[i1][index]; - if (val < test) - { - break; - } - } - - if (i0 < i1) - { - ndSwap(points[i0], points[i1]); - i0++; - i1--; - } - } while (i0 <= i1); - - if (i0 == 0) - { - i0 = count / 2; - } - if (i0 >= (count - 1)) - { - i0 = count / 2; - } - - tree = new (*memoryPool) ndConvexHull3dAABBTreeNode; - *memoryPool += sizeof (ndConvexHull3dAABBTreeNode); - maxMemSize -= sizeof (ndConvexHull3dAABBTreeNode); - ndAssert (maxMemSize >= 0); - - ndAssert (i0); - ndAssert (count - i0); - - tree->m_left = BuildTree (tree, points, i0, baseIndex, memoryPool, maxMemSize); - tree->m_right = BuildTree (tree, &points[i0], count - i0, i0 + baseIndex, memoryPool, maxMemSize); - } - - ndAssert (tree); - tree->m_parent = parent; - tree->m_box[0] = (minP - ndBigVector (ndFloat64 (1.0e-3f))) & ndBigVector::m_triplexMask; - tree->m_box[1] = (maxP + ndBigVector (ndFloat64 (1.0e-3f))) & ndBigVector::m_triplexMask; - return tree; -} - -ndInt32 ndConvexHull3d::GetUniquePoints(ndConvexHull3dVertex* const points, ndInt32 count) -{ - class CompareVertex - { - public: - CompareVertex(void*) - { - } - - ndInt32 Compare(const ndConvexHull3dVertex& elementA, const ndConvexHull3dVertex& elementB) const - { - for (ndInt32 i = 0; i < 3; ++i) - { - if (elementA[i] < elementB[i]) - { - return -1; - } - else if (elementA[i] > elementB[i]) - { - return 1; - } - } - return 0; - } - }; - - ndSort(points, count, nullptr); - - ndInt32 indexCount = 0; - CompareVertex compareVetex(nullptr); - for (ndInt32 i = 1; i < count; ++i) - { - for (; i < count; ++i) - { - if (compareVetex.Compare(points[indexCount], points[i])) - { - indexCount++; - points[indexCount] = points[i]; - break; - } - } - } - count = indexCount + 1; - return count; -} - -ndInt32 ndConvexHull3d::InitVertexArray(ndConvexHull3dVertex* const points, ndInt32 count, void* const memoryPool, ndInt32 maxMemSize) -{ - count = GetUniquePoints(points, count); - if (count < 4) - { - m_points.SetCount(0); - return count; - } - ndConvexHull3dAABBTreeNode* tree = BuildTree (nullptr, &points[0], count, 0, (ndInt8**) &memoryPool, maxMemSize); - - m_points.SetCount(count); - m_aabbP0 = tree->m_box[0]; - m_aabbP1 = tree->m_box[1]; - - ndBigVector boxSize (tree->m_box[1] - tree->m_box[0]); - ndAssert (boxSize.m_w == ndFloat32 (0.0f)); - m_diag = ndFloat32 (sqrt (boxSize.DotProduct(boxSize).GetScalar())); - -#ifdef D_OLD_CONVEXHULL_3D - const ndNormalMap& normalMap = ndNormalMap::GetNormaMap(); - - ndInt32 index0 = SupportVertex (&tree, points, normalMap.m_normal[0]); - m_points[0] = points[index0]; - points[index0].m_mark = 1; - - bool validTetrahedrum = false; - ndBigVector e1 (ndBigVector::m_zero); - for (ndInt32 i = 1; i < normalMap.m_count; ++i) - { - ndInt32 index = SupportVertex (&tree, points, normalMap.m_normal[i]); - ndAssert (index >= 0); - - e1 = points[index] - m_points[0]; - ndAssert (e1.m_w == ndFloat32 (0.0f)); - ndFloat64 error2 = e1.DotProduct(e1).GetScalar(); - if (error2 > (ndFloat32 (1.0e-4f) * m_diag * m_diag)) - { - m_points[1] = points[index]; - points[index].m_mark = 1; - validTetrahedrum = true; - break; - } - } - if (!validTetrahedrum) - { - m_points.SetCount(0); - ndAssert (0); - return count; - } - - validTetrahedrum = false; - ndBigVector e2(ndBigVector::m_zero); - ndBigVector normal (ndBigVector::m_zero); - for (ndInt32 i = 2; i < normalMap.m_count; ++i) - { - ndInt32 index = SupportVertex (&tree, points, normalMap.m_normal[i]); - ndAssert (index >= 0); - e2 = points[index] - m_points[0]; - normal = e1.CrossProduct(e2); - ndAssert (e2.m_w == ndFloat32 (0.0f)); - ndAssert (normal.m_w == ndFloat32 (0.0f)); - ndFloat64 error2 = sqrt (normal.DotProduct(normal).GetScalar()); - if (error2 > (ndFloat32 (1.0e-4f) * m_diag * m_diag)) - { - m_points[2] = points[index]; - points[index].m_mark = 1; - validTetrahedrum = true; - break; - } - } - - ndAssert(normal.m_w == ndFloat32(0.0f)); - if (!validTetrahedrum) - { - m_points.SetCount(0); - ndAssert (0); - return count; - } - - // find the largest possible tetrahedron - validTetrahedrum = false; - ndBigVector e3(ndBigVector::m_zero); - - index0 = SupportVertex (&tree, points, normal); - e3 = points[index0] - m_points[0]; - ndAssert (e3.m_w == ndFloat32 (0.0f)); - ndFloat64 err2 = normal.DotProduct(e3).GetScalar(); - if (fabs (err2) > (ndFloat64 (1.0e-6f) * m_diag * m_diag)) - { - // we found a valid tetrahedral, about and start build the hull by adding the rest of the points - m_points[3] = points[index0]; - points[index0].m_mark = 1; - validTetrahedrum = true; - } - if (!validTetrahedrum) - { - ndVector n (normal.Scale(ndFloat64 (-1.0f))); - ndInt32 index = SupportVertex (&tree, points, n); - e3 = points[index] - m_points[0]; - ndAssert (e3.m_w == ndFloat32 (0.0f)); - ndFloat64 error2 = normal.DotProduct(e3).GetScalar(); - if (fabs (error2) > (ndFloat64 (1.0e-6f) * m_diag * m_diag)) - { - // we found a valid tetrahedral, about and start build the hull by adding the rest of the points - m_points[3] = points[index]; - points[index].m_mark = 1; - validTetrahedrum = true; - } - } - if (!validTetrahedrum) - { - for (ndInt32 i = 3; i < normalMap.m_count; ++i) - { - ndInt32 index = SupportVertex (&tree, points, normalMap.m_normal[i]); - ndAssert (index >= 0); - - //make sure the volume of the fist tetrahedral is no negative - e3 = points[index] - m_points[0]; - ndAssert (e3.m_w == ndFloat32 (0.0f)); - ndFloat64 error2 = normal.DotProduct(e3).GetScalar(); - if (fabs (error2) > (ndFloat64 (1.0e-6f) * m_diag * m_diag)) - { - // we found a valid tetrahedral, about and start build the hull by adding the rest of the points - m_points[3] = points[index]; - points[index].m_mark = 1; - validTetrahedrum = true; - break; - } - } - } - if (!validTetrahedrum) - { - // the points do not form a convex hull - m_points.SetCount(0); - //ndAssert (0); - return count; - } - - //m_count = 4; - m_points.SetCount(4); - ndFloat64 volume = TetrahedrumVolume (m_points[0], m_points[1], m_points[2], m_points[3]); - if (volume > ndFloat64 (0.0f)) - { - ndSwap(m_points[2], m_points[3]); - } - ndAssert (TetrahedrumVolume(m_points[0], m_points[1], m_points[2], m_points[3]) < ndFloat64(0.0f)); - - return count; -#else - - ndBigVector origin((m_aabbP1 + m_aabbP0).Scale (0.5f)); - - ndBigVector dir(m_aabbP1 - m_aabbP0); - ndAssert(dir.DotProduct3(dir) > ndFloat32(1.0e-4f)); - dir = dir.Normalize(); - ndInt32 index0 = SupportVertex(&tree, points, dir); - m_points[0] = points[index0]; - points[index0].m_mark = 1; - - dir = origin - m_points[0]; - ndAssert(dir.DotProduct3(dir) > ndFloat32(1.0e-4f)); - dir = dir.Normalize(); - ndInt32 index1 = SupportVertex(&tree, points, dir); - m_points[1] = points[index1]; - points[index1].m_mark = 1; - - ndBigVector e0(m_points[1] - m_points[0]); - ndAssert(e0.DotProduct3(e0) > ndFloat32(1.0e-4f)); - ndFloat64 t = -e0.DotProduct3(origin - m_points[0]) / e0.DotProduct3(e0); - dir = m_points[0] + e0.Scale(t) - origin; - - ndAssert(dir.DotProduct3(dir) > ndFloat32(1.0e-4f)); - dir = dir.Normalize(); - ndInt32 index2 = SupportVertex(&tree, points, dir); - m_points[2] = points[index2]; - points[index2].m_mark = 1; - - ndBigVector e1 (m_points[2] - m_points[0]); - ndBigVector normal (e1.CrossProduct(e0)); - ndFloat64 error2 = sqrt(normal.DotProduct3(normal)); - if (error2 < (ndFloat32(1.0e-4f) * m_diag * m_diag)) - { - ndAssert(0); -// m_points[2] = points[index]; -// points[index].m_mark = 1; -// validTetrahedrum = true; -// break; - } - - m_count = 3; - return count; -#endif -} - -ndFloat64 ndConvexHull3d::TetrahedrumVolume (const ndBigVector& p0, const ndBigVector& p1, const ndBigVector& p2, const ndBigVector& p3) const -{ - const ndBigVector p1p0 (p1 - p0); - const ndBigVector p2p0 (p2 - p0); - const ndBigVector p3p0 (p3 - p0); - ndAssert (p1p0.m_w == ndFloat32 (0.0f)); - ndAssert (p2p0.m_w == ndFloat32 (0.0f)); - ndAssert (p3p0.m_w == ndFloat32 (0.0f)); - return p3p0.DotProduct(p1p0.CrossProduct(p2p0)).GetScalar(); -} - -ndInt32 ndConvexHull3d::SupportVertex (ndConvexHull3dAABBTreeNode** const treePointer, const ndConvexHull3dVertex* const points, const ndBigVector& dirPlane, const bool removeEntry) const -{ - #define DG_STACK_DEPTH_3D 64 - ndFloat64 aabbProjection[DG_STACK_DEPTH_3D]; - const ndConvexHull3dAABBTreeNode *stackPool[DG_STACK_DEPTH_3D]; - - ndBigVector dir(dirPlane & ndBigPlane::m_triplexMask); - ndAssert (dir.m_w == ndFloat32 (0.0f)); - - ndInt32 index = -1; - ndInt32 stack = 1; - stackPool[0] = *treePointer; - aabbProjection[0] = ndFloat32 (1.0e20f); - ndFloat64 maxProj = ndFloat64 (-1.0e20f); - ndInt32 ix = (dir[0] > ndFloat64 (0.0f)) ? 1 : 0; - ndInt32 iy = (dir[1] > ndFloat64 (0.0f)) ? 1 : 0; - ndInt32 iz = (dir[2] > ndFloat64 (0.0f)) ? 1 : 0; - while (stack) - { - stack--; - ndFloat64 boxSupportValue = aabbProjection[stack]; - if (boxSupportValue > maxProj) - { - const ndConvexHull3dAABBTreeNode* const me = stackPool[stack]; - - if (me->m_left && me->m_right) - { - const ndBigVector leftSupportPoint (me->m_left->m_box[ix].m_x, me->m_left->m_box[iy].m_y, me->m_left->m_box[iz].m_z, ndFloat32 (0.0f)); - ndFloat64 leftSupportDist = leftSupportPoint.DotProduct(dir).GetScalar(); - - const ndBigVector rightSupportPoint (me->m_right->m_box[ix].m_x, me->m_right->m_box[iy].m_y, me->m_right->m_box[iz].m_z, ndFloat32 (0.0f)); - ndFloat64 rightSupportDist = rightSupportPoint.DotProduct(dir).GetScalar(); - - if (rightSupportDist >= leftSupportDist) - { - aabbProjection[stack] = leftSupportDist; - stackPool[stack] = me->m_left; - stack++; - ndAssert (stack < DG_STACK_DEPTH_3D); - aabbProjection[stack] = rightSupportDist; - stackPool[stack] = me->m_right; - stack++; - ndAssert (stack < DG_STACK_DEPTH_3D); - } - else - { - aabbProjection[stack] = rightSupportDist; - stackPool[stack] = me->m_right; - stack++; - ndAssert (stack < DG_STACK_DEPTH_3D); - aabbProjection[stack] = leftSupportDist; - stackPool[stack] = me->m_left; - stack++; - ndAssert (stack < DG_STACK_DEPTH_3D); - } - } - else - { - ndConvexHull3dPointCluster* const cluster = (ndConvexHull3dPointCluster*) me; - for (ndInt32 i = 0; i < cluster->m_count; ++i) - { - const ndConvexHull3dVertex& p = points[cluster->m_indices[i]]; - ndAssert (p.m_x >= cluster->m_box[0].m_x); - ndAssert (p.m_x <= cluster->m_box[1].m_x); - ndAssert (p.m_y >= cluster->m_box[0].m_y); - ndAssert (p.m_y <= cluster->m_box[1].m_y); - ndAssert (p.m_z >= cluster->m_box[0].m_z); - ndAssert (p.m_z <= cluster->m_box[1].m_z); - if (!p.m_mark) - { - ndAssert (p.m_w == ndFloat32 (0.0f)); - ndFloat64 dist = p.DotProduct(dir).GetScalar(); - if (dist > maxProj) - { - maxProj = dist; - index = cluster->m_indices[i]; - } - } - else if (removeEntry) - { - cluster->m_indices[i] = cluster->m_indices[cluster->m_count - 1]; - cluster->m_count = cluster->m_count - 1; - i --; - } - } - - if (cluster->m_count == 0) - { - ndConvexHull3dAABBTreeNode* const parent = cluster->m_parent; - if (parent) - { - ndConvexHull3dAABBTreeNode* const sibling = (parent->m_left != cluster) ? parent->m_left : parent->m_right; - ndAssert (sibling != cluster); - ndConvexHull3dAABBTreeNode* const grandParent = parent->m_parent; - if (grandParent) - { - sibling->m_parent = grandParent; - if (grandParent->m_right == parent) - { - grandParent->m_right = sibling; - } - else - { - grandParent->m_left = sibling; - } - } - else - { - sibling->m_parent = nullptr; - *treePointer = sibling; - } - } - } - } - } - } - - ndAssert (index != -1); - return index; -} - -ndConvexHull3d::ndNode* ndConvexHull3d::AddFace (ndInt32 i0, ndInt32 i1, ndInt32 i2) -{ - ndNode* const node = Append(); - ndConvexHull3dFace& face = node->GetInfo(); - - face.m_index[0] = i0; - face.m_index[1] = i1; - face.m_index[2] = i2; - return node; -} - -void ndConvexHull3d::DeleteFace (ndNode* const node) -{ - Remove (node); -} - -bool ndConvexHull3d::Sanity() const -{ -/* - for (ndNode* node = GetFirst(); node; node = node->GetNext()) { - ndConvexHull3dFace* const face = &node->GetInfo(); - for (ndInt32 i = 0; i < 3; ++i) { - ndNode* const twinNode = face->m_twin[i]; - if (!twinNode) { - return false; - } - - ndInt32 count = 0; - ndNode* me = nullptr; - ndConvexHull3dFace* const twinFace = &twinNode->GetInfo(); - for (ndInt32 j = 0; j < 3; ++j) { - if (twinFace->m_twin[j] == node) { - count ++; - me = twinFace->m_twin[j]; - } - } - if (count != 1) { - return false; - } - if (me != node) { - return false; - } - } - } -*/ - return true; -} - -bool ndConvexHull3d::CheckFlatSurface(ndConvexHull3dAABBTreeNode* tree, ndConvexHull3dVertex* const points, ndInt32, ndFloat64, ndInt32) -{ - ndBigVector e0(m_points[1] - m_points[0]); - ndBigVector e1(m_points[2] - m_points[0]); - ndAssert(e0.m_w == ndFloat32(0.0f)); - ndAssert(e1.m_w == ndFloat32(0.0f)); - ndAssert(e0.DotProduct(e0).GetScalar() > ndFloat32(1.0e-4f)); - ndAssert(e1.DotProduct(e1).GetScalar() > ndFloat32(1.0e-4f)); - ndBigVector normal(e1.CrossProduct(e0)); - ndAssert(normal.m_w == ndFloat32(0.0f)); - ndAssert(normal.DotProduct(normal).GetScalar() > ndFloat32(1.0e-6f)); - normal = normal.Normalize(); - - ndInt32 index = SupportVertex(&tree, points, normal); - m_points[3] = points[index]; - - ndFloat64 volume = TetrahedrumVolume(m_points[0], m_points[1], m_points[2], m_points[3]); - if (ndAbs(volume) < ndFloat32(1.0e-9f)) { - normal = normal.Scale(ndFloat32(-1.0f)); - index = SupportVertex(&tree, points, normal); - m_points[3] = points[index]; - volume = TetrahedrumVolume(m_points[0], m_points[1], m_points[2], m_points[3]); - if (ndAbs(volume) < ndFloat32(1.0e-9f)) { - return true; - } - } - points[index].m_mark = 1; - if (volume > ndFloat64(0.0f)) - { - ndSwap(m_points[2], m_points[3]); - } - ndAssert(TetrahedrumVolume(m_points[0], m_points[1], m_points[2], m_points[3]) < ndFloat64(0.0f)); - //m_count = 4; - m_points.SetCount(4); - return false; -} - -void ndConvexHull3d::CalculateConvexHull2d(ndConvexHull3dAABBTreeNode*, ndConvexHull3dVertex* const, ndInt32, ndFloat64, ndInt32) -{ -} - -void ndConvexHull3d::CalculateConvexHull3d (ndConvexHull3dAABBTreeNode* vertexTree, ndConvexHull3dVertex* const points, ndInt32 count, ndFloat64 distTol, ndInt32 maxVertexCount) -{ - m_points.SetCount(count); - distTol = ndAbs (distTol) * m_diag; - ndNode* const f0Node = AddFace (0, 1, 2); - ndNode* const f1Node = AddFace (0, 2, 3); - ndNode* const f2Node = AddFace (2, 1, 3); - ndNode* const f3Node = AddFace (1, 0, 3); - - ndConvexHull3dFace* const f0 = &f0Node->GetInfo(); - ndConvexHull3dFace* const f1 = &f1Node->GetInfo(); - ndConvexHull3dFace* const f2 = &f2Node->GetInfo(); - ndConvexHull3dFace* const f3 = &f3Node->GetInfo(); - - f0->m_twin[0] = f3Node; - f0->m_twin[1] = f2Node; - f0->m_twin[2] = f1Node; - - f1->m_twin[0] = f0Node; - f1->m_twin[1] = f2Node; - f1->m_twin[2] = f3Node; - - f2->m_twin[0] = f0Node; - f2->m_twin[1] = f3Node; - f2->m_twin[2] = f1Node; - - f3->m_twin[0] = f0Node; - f3->m_twin[1] = f1Node; - f3->m_twin[2] = f2Node; - - ndList boundaryFaces; - - boundaryFaces.Append(f0Node); - boundaryFaces.Append(f1Node); - boundaryFaces.Append(f2Node); - boundaryFaces.Append(f3Node); - count -= 4; - maxVertexCount -= 4; - ndInt32 currentIndex = 4; - - ndStack stackPool(1024 + count); - ndStack coneListPool(1024 + count); - ndStack deleteListPool(1024 + count); - - ndNode** const stack = &stackPool[0]; - ndNode** const coneList = &stackPool[0]; - ndNode** const deleteList = &deleteListPool[0]; - - while (boundaryFaces.GetCount() && count && (maxVertexCount > 0)) - { - // my definition of the optimal convex hull of a given vertex count, - // is the convex hull formed by a subset of the input vertex that minimizes the volume difference - // between the perfect hull formed from all input vertex and the hull of the sub set of vertex. - // When using a priority heap this algorithms will generate the an optimal of a fix vertex count. - // Since all Newton's tools do not have a limit on the point count of a convex hull, I can use either a stack or a queue. - // a stack maximize construction speed, a Queue tend to maximize the volume of the generated Hull approaching a perfect Hull. - // For now we use a queue. - // For general hulls it does not make a difference if we use a stack, queue, or a priority heap. - // perfect optimal hull only apply for when build hull of a limited vertex count. - // - // Also when building Hulls of a limited vertex count, this function runs in constant time. - // yes that is correct, it does not makes a difference if you build a N point hull from 100 vertex - // or from 100000 vertex input array. - - #if 0 - // using stack (faster) - dNode* const faceNode = boundaryFaces.GetFirst()->GetInfo(); - #else - // using a queue (some what slower by better hull when reduced vertex count is desired) - ndNode* const faceNode = boundaryFaces.GetLast()->GetInfo(); - #endif - - bool isvalid; - ndConvexHull3dFace* const face = &faceNode->GetInfo(); - ndBigPlane planeEquation (face->GetPlaneEquation (&m_points[0], isvalid)); - - int index = 0; - double dist = 0; - ndBigVector p; - - if (isvalid) - { - index = SupportVertex(&vertexTree, points, planeEquation); - p = points[index]; - dist = planeEquation.Evalue(p); - } - - if (isvalid && (dist >= distTol) && (face->Evalue(&m_points[0], p) > ndFloat64(0.0f))) - { - ndAssert (Sanity()); - - ndAssert (faceNode); - stack[0] = faceNode; - - ndInt32 stackIndex = 1; - ndInt32 deletedCount = 0; - - while (stackIndex) - { - stackIndex --; - ndNode* const node1 = stack[stackIndex]; - ndConvexHull3dFace* const face1 = &node1->GetInfo(); - - if (!face1->m_mark && (face1->Evalue(&m_points[0], p) > ndFloat64(0.0f))) - { - #ifdef _DEBUG - for (ndInt32 i = 0; i < deletedCount; ++i) - { - ndAssert (deleteList[i] != node1); - } - #endif - - deleteList[deletedCount] = node1; - deletedCount ++; - ndAssert (deletedCount < ndInt32 (deleteListPool.GetElementsCount())); - face1->m_mark = 1; - for (ndInt32 i = 0; i < 3; ++i) - { - ndNode* const twinNode = face1->m_twin[i]; - ndAssert (twinNode); - ndConvexHull3dFace* const twinFace = &twinNode->GetInfo(); - if (!twinFace->m_mark) - { - stack[stackIndex] = twinNode; - stackIndex ++; - ndAssert (stackIndex < ndInt32 (stackPool.GetElementsCount())); - } - } - } - } - - m_points[currentIndex] = points[index]; - points[index].m_mark = 1; - - ndInt32 newCount = 0; - for (ndInt32 i = 0; i < deletedCount; ++i) - { - ndNode* const node1 = deleteList[i]; - ndConvexHull3dFace* const face1 = &node1->GetInfo(); - ndAssert (face1->m_mark == 1); - for (ndInt32 j0 = 0; j0 < 3; j0 ++) - { - ndNode* const twinNode = face1->m_twin[j0]; - ndConvexHull3dFace* const twinFace = &twinNode->GetInfo(); - if (!twinFace->m_mark) - { - ndInt32 j1 = (j0 == 2) ? 0 : j0 + 1; - ndNode* const newNode = AddFace (currentIndex, face1->m_index[j0], face1->m_index[j1]); - boundaryFaces.Addtop(newNode); - - ndConvexHull3dFace* const newFace = &newNode->GetInfo(); - newFace->m_twin[1] = twinNode; - for (ndInt32 k = 0; k < 3; ++k) - { - if (twinFace->m_twin[k] == node1) - { - twinFace->m_twin[k] = newNode; - } - } - coneList[newCount] = newNode; - newCount ++; - ndAssert (newCount < ndInt32 (coneListPool.GetElementsCount())); - } - } - } - - for (ndInt32 i = 0; i < newCount - 1; ++i) - { - ndNode* const nodeA = coneList[i]; - ndConvexHull3dFace* const faceA = &nodeA->GetInfo(); - ndAssert (faceA->m_mark == 0); - for (ndInt32 j = i + 1; j < newCount; ++j) - { - ndNode* const nodeB = coneList[j]; - ndConvexHull3dFace* const faceB = &nodeB->GetInfo(); - ndAssert (faceB->m_mark == 0); - if (faceA->m_index[2] == faceB->m_index[1]) - { - faceA->m_twin[2] = nodeB; - faceB->m_twin[0] = nodeA; - break; - } - } - - for (ndInt32 j = i + 1; j < newCount; ++j) - { - ndNode* const nodeB = coneList[j]; - ndConvexHull3dFace* const faceB = &nodeB->GetInfo(); - ndAssert (faceB->m_mark == 0); - if (faceA->m_index[1] == faceB->m_index[2]) - { - faceA->m_twin[0] = nodeB; - faceB->m_twin[2] = nodeA; - break; - } - } - } - - for (ndInt32 i = 0; i < deletedCount; ++i) - { - ndNode* const node = deleteList[i]; - boundaryFaces.Remove (node); - DeleteFace (node); - } - - maxVertexCount --; - currentIndex ++; - count --; - } - else - { - boundaryFaces.Remove (faceNode); - } - } - //m_count = currentIndex; - m_points.SetCount(currentIndex); -} - -void ndConvexHull3d::CalculateVolumeAndSurfaceArea (ndFloat64& volume, ndFloat64& surfaceArea) const -{ - ndFloat64 areaAcc = ndFloat32 (0.0f); - ndFloat64 volumeAcc = ndFloat32 (0.0f); - for (ndNode* node = GetFirst(); node; node = node->GetNext()) { - const ndConvexHull3dFace* const face = &node->GetInfo(); - ndInt32 i0 = face->m_index[0]; - ndInt32 i1 = face->m_index[1]; - ndInt32 i2 = face->m_index[2]; - const ndBigVector& p0 = m_points[i0]; - const ndBigVector& p1 = m_points[i1]; - const ndBigVector& p2 = m_points[i2]; - ndAssert(p0.m_w == ndFloat32(0.0f)); - ndAssert(p1.m_w == ndFloat32(0.0f)); - ndAssert(p2.m_w == ndFloat32(0.0f)); - ndBigVector normal ((p1 - p0).CrossProduct(p2 - p0)); - ndAssert(normal.m_w == ndFloat32(0.0f)); - ndFloat64 area = sqrt (normal.DotProduct(normal).GetScalar()); - areaAcc += area; - volumeAcc += p2.DotProduct(p0.CrossProduct(p1)).GetScalar(); - } - ndAssert (volumeAcc >= ndFloat64 (0.0f)); - volume = volumeAcc * ndFloat64 (1.0f/6.0f); - surfaceArea = areaAcc * ndFloat64 (0.5f); -} - -// this code has linear time complexity on the number of faces -ndFloat64 ndConvexHull3d::RayCast (const ndBigVector& localP0, const ndBigVector& localP1) const -{ - ndFloat64 interset = ndFloat32 (1.2f); - ndFloat64 tE = ndFloat64 (0.0f); // for the maximum entering segment parameter; - ndFloat64 tL = ndFloat64 (1.0f); // for the minimum leaving segment parameter; - ndBigVector dS (localP1 - localP0); // is the segment direction vector; - - ndAssert(dS.m_w == ndFloat32(0.0f)); - ndInt32 hasHit = 0; - - for (ndNode* node = GetFirst(); node; node = node->GetNext()) { - const ndConvexHull3dFace* const face = &node->GetInfo(); - - ndInt32 i0 = face->m_index[0]; - ndInt32 i1 = face->m_index[1]; - ndInt32 i2 = face->m_index[2]; - - const ndBigVector& p0 = m_points[i0]; - ndAssert(p0.m_w == ndFloat32(0.0f)); - ndBigVector normal ((m_points[i1] - p0).CrossProduct(m_points[i2] - p0)); - - ndAssert(normal.m_w == ndFloat32(0.0f)); - ndAssert(localP0.m_w == ndFloat32(0.0f)); - - //ndFloat64 N = -((localP0 - p0) % normal); - ndFloat64 D = normal.DotProduct(dS).GetScalar(); - ndFloat64 N = -normal.DotProduct(localP0 - p0).GetScalar(); - - if (fabs(D) < ndFloat64 (1.0e-12f)) { // - if (N < ndFloat64 (0.0f)) { - return ndFloat64 (1.2f); - } else { - continue; - } - } - - ndFloat64 t = N / D; - if (D < ndFloat64 (0.0f)) { - if (t > tE) { - tE = t; - hasHit = 1; - } - if (tE > tL) { - return ndFloat64 (1.2f); - } - } else { - ndAssert (D >= ndFloat64 (0.0f)); - tL = ndMin (tL, t); - if (tL < tE) { - return ndFloat64 (1.2f); - } - } - } - - if (hasHit) { - interset = tE; - } - - return interset; -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull3d.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull3d.h deleted file mode 100644 index efe74180b8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull3d.h +++ /dev/null @@ -1,121 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONVEXHULL_3D__ -#define __ND_CONVEXHULL_3D__ - -#include "ndCoreStdafx.h" -#include "ndList.h" -#include "ndArray.h" -#include "ndPlane.h" -#include "ndVector.h" -#include "ndMatrix.h" -#include "ndQuaternion.h" - -#define D_OLD_CONVEXHULL_3D - -class ndConvexHull3dVertex; -class ndConvexHull3dAABBTreeNode; - -class ndConvexHull3dFace -{ - public: - D_CORE_API ndConvexHull3dFace(); - - private: - void SetMark(ndInt32 mark) { m_mark = mark; } - ndInt32 GetMark() const { return m_mark; } - ndList::ndNode* GetTwin(ndInt32 index) const; - ndFloat64 Evalue (const ndBigVector* const pointArray, const ndBigVector& point) const; - ndBigPlane GetPlaneEquation (const ndBigVector* const pointArray, bool& isvalid) const; - - public: - ndInt32 m_index[3]; - - private: - ndInt32 m_mark; - ndList::ndNode* m_twin[3]; - friend class ndConvexHull3d; -}; - -D_MSV_NEWTON_ALIGN_32 -class ndConvexHull3d: public ndList -{ -#ifdef D_OLD_CONVEXHULL_3D - class ndNormalMap; -#endif - - public: - D_CORE_API ndConvexHull3d(const ndConvexHull3d& source); - D_CORE_API ndConvexHull3d(const ndFloat64* const vertexCloud, ndInt32 strideInBytes, ndInt32 count, ndFloat64 distTol, ndInt32 maxVertexCount = 0x7fffffff); - D_CORE_API virtual ~ndConvexHull3d(); - - const ndArray& GetVertexPool() const; - - ndFloat64 GetDiagonal() const; - void GetAABB (ndBigVector& boxP0, ndBigVector& boxP1) const; - ndFloat64 RayCast (const ndBigVector& localP0, const ndBigVector& localP1) const; - void CalculateVolumeAndSurfaceArea (ndFloat64& volume, ndFloat64& surcafeArea) const; - - protected: - ndConvexHull3d(); - void BuildHull (const ndFloat64* const vertexCloud, ndInt32 strideInBytes, ndInt32 count, ndFloat64 distTol, ndInt32 maxVertexCount); - - virtual ndNode* AddFace (ndInt32 i0, ndInt32 i1, ndInt32 i2); - virtual void DeleteFace (ndNode* const node) ; - virtual ndInt32 InitVertexArray(ndConvexHull3dVertex* const points, ndInt32 count, void* const memoryPool, ndInt32 maxMemSize); - - bool CheckFlatSurface(ndConvexHull3dAABBTreeNode* vertexTree, ndConvexHull3dVertex* const points, ndInt32 count, ndFloat64 distTol, ndInt32 maxVertexCount); - void CalculateConvexHull2d (ndConvexHull3dAABBTreeNode* vertexTree, ndConvexHull3dVertex* const points, ndInt32 count, ndFloat64 distTol, ndInt32 maxVertexCount); - void CalculateConvexHull3d (ndConvexHull3dAABBTreeNode* vertexTree, ndConvexHull3dVertex* const points, ndInt32 count, ndFloat64 distTol, ndInt32 maxVertexCount); - - ndInt32 SupportVertex (ndConvexHull3dAABBTreeNode** const tree, const ndConvexHull3dVertex* const points, const ndBigVector& dir, const bool removeEntry = true) const; - ndFloat64 TetrahedrumVolume (const ndBigVector& p0, const ndBigVector& p1, const ndBigVector& p2, const ndBigVector& p3) const; - - ndInt32 GetUniquePoints(ndConvexHull3dVertex* const points, ndInt32 count); - ndConvexHull3dAABBTreeNode* BuildTree (ndConvexHull3dAABBTreeNode* const parent, ndConvexHull3dVertex* const points, ndInt32 count, ndInt32 baseIndex, ndInt8** const memoryPool, ndInt32& maxMemSize) const; - - bool Sanity() const; - void Save (const char* const filename) const; - - ndBigVector m_aabbP0; - ndBigVector m_aabbP1; - ndFloat64 m_diag; - ndArray m_points; -} D_GCC_NEWTON_ALIGN_32; - -inline const ndArray& ndConvexHull3d::GetVertexPool() const -{ - return m_points; -} - -inline ndFloat64 ndConvexHull3d::GetDiagonal() const -{ - return m_diag; -} - -inline void ndConvexHull3d::GetAABB (ndBigVector& boxP0, ndBigVector& boxP1) const -{ - boxP0 = m_aabbP0; - boxP1 = m_aabbP1; -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull4d.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull4d.cpp deleted file mode 100644 index 7f376ad76e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull4d.cpp +++ /dev/null @@ -1,1148 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndSort.h" -#include "ndTree.h" -#include "ndHeap.h" -#include "ndStack.h" -#include "ndGoogol.h" -#include "ndConvexHull4d.h" -#include "ndSmallDeterminant.h" - -#define D_VERTEX_CLUMP_SIZE_4D 8 - - -ndConvexHull4d::ndNormalMap::ndNormalMap() - :m_count(sizeof (m_normal) / sizeof (m_normal[0])) -{ - ndVector p0(ndFloat32( 1.0f), ndFloat32( 0.0f), ndFloat32( 0.0f), ndFloat32(0.0f)); - ndVector p1(ndFloat32(-1.0f), ndFloat32( 0.0f), ndFloat32( 0.0f), ndFloat32(0.0f)); - ndVector p2(ndFloat32( 0.0f), ndFloat32( 1.0f), ndFloat32( 0.0f), ndFloat32(0.0f)); - ndVector p3(ndFloat32( 0.0f), ndFloat32(-1.0f), ndFloat32( 0.0f), ndFloat32(0.0f)); - ndVector p4(ndFloat32( 0.0f), ndFloat32( 0.0f), ndFloat32( 1.0f), ndFloat32(0.0f)); - ndVector p5(ndFloat32( 0.0f), ndFloat32( 0.0f), ndFloat32(-1.0f), ndFloat32(0.0f)); - - ndInt32 count = 0; - ndInt32 subdivitions = 2; - - ndBigVector tmp[128]; - TessellateTriangle(subdivitions, p4, p0, p2, tmp, count); - TessellateTriangle(subdivitions, p0, p5, p2, tmp, count); - TessellateTriangle(subdivitions, p5, p1, p2, tmp, count); - TessellateTriangle(subdivitions, p1, p4, p2, tmp, count); - TessellateTriangle(subdivitions, p0, p4, p3, tmp, count); - TessellateTriangle(subdivitions, p5, p0, p3, tmp, count); - TessellateTriangle(subdivitions, p1, p5, p3, tmp, count); - TessellateTriangle(subdivitions, p4, p1, p3, tmp, count); - - count = 0; - for (ndInt32 j = 0; j < 8; ++j) - { - ndFloat64 beta = (j - 4) * ndFloat64 (22.5f * ndDegreeToRad) + ndFloat64 (10.5f * ndDegreeToRad); - ndFloat64 sinBeta = sin(beta); - ndFloat64 cosBeta = cos(beta); - - ndFloat64 w = sinBeta; - for (ndInt32 i = 0; i < 128; ++i) - { - ndFloat64 z = cosBeta * tmp[i].m_z; - ndFloat64 y = cosBeta * tmp[i].m_y; - ndFloat64 x = cosBeta * tmp[i].m_x; - ndInt32 index = ndBitReversal(count, sizeof (m_normal) / sizeof (m_normal[0])); - ndAssert (index < ndInt32 (sizeof (m_normal) / sizeof (m_normal[0]))); - m_normal[index] = ndBigVector (x, y, z, w); - count ++; - } - } -} - -void ndConvexHull4d::ndNormalMap::TessellateTriangle(ndInt32 level, const ndVector& p0, const ndVector& p1, const ndVector& p2, ndBigVector* const buffer, ndInt32& count) -{ - ndAssert(p0.m_w == ndFloat32(0.0f)); - ndAssert(p1.m_w == ndFloat32(0.0f)); - ndAssert(p2.m_w == ndFloat32(0.0f)); - if (level) - { - ndAssert(ndAbs(p0.DotProduct(p0).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p1.DotProduct(p1).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p2.DotProduct(p2).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndVector p01(p0 + p1); - ndVector p12(p1 + p2); - ndVector p20(p2 + p0); - - ndAssert (p01.m_w == ndFloat32 (0.0f)); - ndAssert (p12.m_w == ndFloat32 (0.0f)); - ndAssert (p20.m_w == ndFloat32 (0.0f)); - //p01 = p01.Scale(dgRsqrt(p01.DotProduct(p01).GetScalar())); - //p12 = p12.Scale(dgRsqrt(p12.DotProduct(p12).GetScalar())); - //p20 = p20.Scale(dgRsqrt(p20.DotProduct(p20).GetScalar())); - p01 = p01.Normalize(); - p12 = p12.Normalize(); - p20 = p20.Normalize(); - - ndAssert(ndAbs(p01.DotProduct(p01).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p12.DotProduct(p12).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert(ndAbs(p20.DotProduct(p20).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - - TessellateTriangle(level - 1, p0, p01, p20, buffer, count); - TessellateTriangle(level - 1, p1, p12, p01, buffer, count); - TessellateTriangle(level - 1, p2, p20, p12, buffer, count); - TessellateTriangle(level - 1, p01, p12, p20, buffer, count); - } - else - { - ndBigPlane n(p0, p1, p2); - n = n.Scale(ndFloat64(1.0f) / sqrt(n.DotProduct(n).GetScalar())); - n.m_w = ndFloat64(0.0f); - ndInt32 index = ndBitReversal(count, 128); - buffer[index] = n; - ndAssert(count < 128); - count++; - } -} - -class ndConvexHull4dAABBTreeNode -{ - public: - #ifdef _DEBUG - ndConvexHull4dAABBTreeNode() - { - static ndInt32 id = 0; - m_id = id; - id ++; - } - ndInt32 m_id; - #endif - - ndBigVector m_box[2]; - ndConvexHull4dAABBTreeNode* m_left; - ndConvexHull4dAABBTreeNode* m_right; - ndConvexHull4dAABBTreeNode* m_parent; -}; - -class ndConvexHull4dPointCluster: public ndConvexHull4dAABBTreeNode -{ - public: - ndInt32 m_count; - ndInt32 m_indices[D_VERTEX_CLUMP_SIZE_4D]; -}; - -ndConvexHull4dTetraherum::ndTetrahedrumPlane::ndTetrahedrumPlane (const ndBigVector& p0, const ndBigVector& p1, const ndBigVector& p2, const ndBigVector& p3) - :ndBigVector ((p1 - p0).CrossProduct (p2 - p0, p3 - p0)) -{ - ndBigVector& me = *this; - ndFloat64 invMag2 = ndFloat32 (0.0f); - ndFloat64 val = me.DotProduct(me).m_x; - if (val > ndFloat64 (1.0e-38)) { - invMag2 = ndFloat64 (1.0f) / sqrt (val); - } else { - invMag2 = ndFloat32 (0.0f); - } - - me.m_x *= invMag2; - me.m_y *= invMag2; - me.m_z *= invMag2; - me.m_w *= invMag2; - m_dist = - me.DotProduct(p0).m_x; -} - -ndFloat64 ndConvexHull4dTetraherum::ndTetrahedrumPlane::Evalue (const ndBigVector& point) const -{ - const ndBigVector& me = *this; - return me.DotProduct(point).m_x + m_dist; -} - - -ndConvexHull4dTetraherum::ndConvexHull4dTetraherum() -{ -#ifdef _DEBUG - static ndInt32 debugID; - m_debugID = debugID; - debugID ++; -#endif - static ndInt32 m_monotonicID; - - m_uniqueID = m_monotonicID; - m_monotonicID ++; -} - -void ndConvexHull4dTetraherum::Init (const ndConvexHull4dVector* const, ndInt32 v0, ndInt32 v1, ndInt32 v2, ndInt32 v3) -{ - m_faces[0].m_index[0] = v0; - m_faces[0].m_index[1] = v1; - m_faces[0].m_index[2] = v2; - m_faces[0].m_index[3] = v3; - - m_faces[1].m_index[0] = v3; - m_faces[1].m_index[1] = v0; - m_faces[1].m_index[2] = v2; - m_faces[1].m_index[3] = v1; - - m_faces[2].m_index[0] = v3; - m_faces[2].m_index[1] = v2; - m_faces[2].m_index[2] = v1; - m_faces[2].m_index[3] = v0; - - m_faces[3].m_index[0] = v3; - m_faces[3].m_index[1] = v1; - m_faces[3].m_index[2] = v0; - m_faces[3].m_index[3] = v2; - - SetMark (0); - for (ndInt32 i = 0; i < 4; ++i) { - m_faces[i].m_twin = nullptr; - } - -#ifdef _DEBUG - //ndBigVector p1p0 (points[v1] - points[v0]); - //ndBigVector p2p0 (points[v2] - points[v0]); - //ndBigVector p3p0 (points[v3] - points[v0]); - //ndBigVector normal (p1p0.CrossProduct(p2p0, p3p0)); - //ndFloat64 volume = normal.DotProduct(normal).m_x; - //ndAssert (volume > ndFloat64 (0.0f)); -#endif -} - -ndFloat64 ndConvexHull4dTetraherum::Evalue (const ndConvexHull4dVector* const pointArray, const ndBigVector& point) const -{ - const ndBigVector &p0 = pointArray[m_faces[0].m_index[0]]; - const ndBigVector &p1 = pointArray[m_faces[0].m_index[1]]; - const ndBigVector &p2 = pointArray[m_faces[0].m_index[2]]; - const ndBigVector &p3 = pointArray[m_faces[0].m_index[3]]; - - ndFloat64 matrix[4][4]; - for (ndInt32 i = 0; i < 4; ++i) - { - matrix[0][i] = p1[i] - p0[i]; - matrix[1][i] = p2[i] - p0[i]; - matrix[2][i] = p3[i] - p0[i]; - matrix[3][i] = point[i] - p0[i]; - } - - ndFloat64 error; - ndFloat64 det = Determinant4x4 (matrix, &error); - ndFloat64 precision = ndFloat64 (1.0f) / ndFloat64 (1<<24); - ndFloat64 errbound = error * precision; - if (fabs(det) > errbound) - { - return det; - } - - ndGoogol exactMatrix[4][4]; - for (ndInt32 i = 0; i < 4; ++i) - { - exactMatrix[0][i] = ndGoogol(p1[i]) - ndGoogol(p0[i]); - exactMatrix[1][i] = ndGoogol(p2[i]) - ndGoogol(p0[i]); - exactMatrix[2][i] = ndGoogol(p3[i]) - ndGoogol(p0[i]); - exactMatrix[3][i] = ndGoogol(point[i]) - ndGoogol(p0[i]); - } - return Determinant4x4(exactMatrix); -} - -ndFloat64 ndConvexHull4dTetraherum::GetTetraVolume(const ndConvexHull4dVector* const points) const -{ - const ndBigVector &p0 = points[m_faces[0].m_index[0]]; - const ndBigVector &p1 = points[m_faces[0].m_index[1]]; - const ndBigVector &p2 = points[m_faces[0].m_index[2]]; - const ndBigVector &p3 = points[m_faces[0].m_index[3]]; - - ndFloat64 matrix[3][3]; - for (ndInt32 i = 0; i < 3; ++i) - { - matrix[0][i] = p2[i] - p0[i]; - matrix[1][i] = p1[i] - p0[i]; - matrix[2][i] = p3[i] - p0[i]; - } - - ndFloat64 error; - ndFloat64 det = Determinant3x3(matrix, &error); - - ndFloat64 precision = ndFloat64(1.0f) / ndFloat64(1 << 24); - ndFloat64 errbound = error * precision; - if (fabs(det) > errbound) - { - return det; - } - - ndGoogol exactMatrix[3][3]; - for (ndInt32 i = 0; i < 3; ++i) - { - exactMatrix[0][i] = ndGoogol(p2[i]) - ndGoogol(p0[i]); - exactMatrix[1][i] = ndGoogol(p1[i]) - ndGoogol(p0[i]); - exactMatrix[2][i] = ndGoogol(p3[i]) - ndGoogol(p0[i]); - } - return Determinant3x3(exactMatrix); -} - -ndBigVector ndConvexHull4dTetraherum::CircumSphereCenter (const ndConvexHull4dVector* const pointArray) const -{ - ndGoogol matrix[4][4]; - - ndBigVector points[4]; - points[0] = pointArray[m_faces[0].m_index[0]]; - points[1] = pointArray[m_faces[0].m_index[1]]; - points[2] = pointArray[m_faces[0].m_index[2]]; - points[3] = pointArray[m_faces[0].m_index[3]]; - - for (ndInt32 i = 0; i < 4; ++i) { - for (ndInt32 j = 0; j < 3; ++j) { - matrix[i][j] = ndGoogol (points[i][j]); - } - matrix[i][3] = ndGoogol (1.0f); - } - ndGoogol det (Determinant4x4(matrix)); - ndFloat64 invDen = ndFloat64 (1.0f) / (ndFloat64(det) * ndFloat64 (2.0f)); - - ndBigVector centerOut; - ndFloat64 sign = ndFloat64 (1.0f); - for (ndInt32 k = 0; k < 3; ++k) { - for (ndInt32 i = 0; i < 4; ++i) { - matrix[i][0] = ndGoogol (points[i][3]); - for (ndInt32 j = 0; j < 2; ++j) { - ndInt32 j1 = (j < k) ? j : j + 1; - matrix[i][j + 1] = ndGoogol (points[i][j1]); - } - matrix[i][3] = ndGoogol (1.0f); - } - ndGoogol det1 (Determinant4x4(matrix)); - ndFloat64 val = ndFloat64 (det1) * sign; - sign *= ndFloat64 (-1.0f); - centerOut[k] = val * invDen; - } - centerOut[3] = ndFloat32 (0.0f); - return centerOut; -} - -ndConvexHull4dTetraherum::ndTetrahedrumPlane ndConvexHull4dTetraherum::GetPlaneEquation (const ndConvexHull4dVector* const points) const -{ - const ndBigVector &p0 = points[m_faces[0].m_index[0]]; - const ndBigVector &p1 = points[m_faces[0].m_index[1]]; - const ndBigVector &p2 = points[m_faces[0].m_index[2]]; - const ndBigVector &p3 = points[m_faces[0].m_index[3]]; - return ndTetrahedrumPlane (p0, p1, p2, p3); -} - -ndConvexHull4d::ndConvexHull4d () - :ndList() - ,m_mark(0) - ,m_count(0) - ,m_diag(ndFloat32 (0.0f)) - ,m_points() -{ -} - -ndConvexHull4d::ndConvexHull4d(const ndConvexHull4d&) - :ndList() -{ - ndAssert(0); -} - -ndConvexHull4d::ndConvexHull4d (const ndFloat64* const vertexCloud, ndInt32 strideInBytes, ndInt32 count, ndFloat64 distTol) - :ndList() - ,m_mark(0) - ,m_count(0) - ,m_diag(ndFloat32(0.0f)) - ,m_points() -{ - BuildHull (vertexCloud, strideInBytes, count, distTol); -} - -ndConvexHull4d::~ndConvexHull4d(void) -{ -} - -void ndConvexHull4d::Save(const char* const filename) const -{ - FILE* const file = fopen(filename, "wb"); - ndInt32 index = 0; - //fprintf (file, "final\n"); - for (ndNode* nodePtr = GetFirst(); nodePtr; nodePtr = nodePtr->GetNext()) - { - fprintf(file, "tetra %d\n", index); - index++; - const ndConvexHull4dTetraherum& face = nodePtr->GetInfo(); - const ndBigVector& p0 = m_points[face.m_faces[0].m_index[0]]; - const ndBigVector& p1 = m_points[face.m_faces[0].m_index[1]]; - const ndBigVector& p2 = m_points[face.m_faces[0].m_index[2]]; - const ndBigVector& p3 = m_points[face.m_faces[0].m_index[3]]; - fprintf(file, "p0(%f %f %f %f)\n", p0[0], p0[1], p0[2], p0[3]); - fprintf(file, "p1(%f %f %f %f)\n", p1[0], p1[1], p1[2], p1[3]); - fprintf(file, "p2(%f %f %f %f)\n", p2[0], p2[1], p2[2], p2[3]); - fprintf(file, "p3(%f %f %f %f)\n", p3[0], p3[1], p3[2], p3[3]); - } - fprintf(file, "\n"); - - fclose(file); -} -const ndConvexHull4d::ndNormalMap& ndConvexHull4d::GetNormaMap() -{ - static ndNormalMap normalMap; - return normalMap; -} - -ndInt32 ndConvexHull4d::SupportVertex (ndConvexHull4dAABBTreeNode** const treePointer, const ndConvexHull4dVector* const points, const ndBigVector& dir, const bool removeEntry) const -{ - #define DG_STACK_DEPTH_4D 64 - ndFloat64 aabbProjection[DG_STACK_DEPTH_4D]; - const ndConvexHull4dAABBTreeNode *stackPool[DG_STACK_DEPTH_4D]; - - ndInt32 index = -1; - ndInt32 stack = 1; - stackPool[0] = *treePointer; - aabbProjection[0] = ndFloat32 (1.0e20f); - ndFloat64 maxProj = ndFloat64 (-1.0e20f); - ndInt32 ix = (dir[0] > ndFloat64 (0.0f)) ? 1 : 0; - ndInt32 iy = (dir[1] > ndFloat64 (0.0f)) ? 1 : 0; - ndInt32 iz = (dir[2] > ndFloat64 (0.0f)) ? 1 : 0; - ndInt32 iw = (dir[3] > ndFloat64 (0.0f)) ? 1 : 0; - while (stack) - { - stack--; - ndFloat64 boxSupportValue = aabbProjection[stack]; - if (boxSupportValue > maxProj) - { - const ndConvexHull4dAABBTreeNode* const me = stackPool[stack]; - - if (me->m_left && me->m_right) - { - ndBigVector leftSupportPoint (me->m_left->m_box[ix].m_x, me->m_left->m_box[iy].m_y, me->m_left->m_box[iz].m_z, me->m_left->m_box[iw].m_w); - ndFloat64 leftSupportDist = leftSupportPoint.DotProduct(dir).m_x; - - ndBigVector rightSupportPoint (me->m_right->m_box[ix].m_x, me->m_right->m_box[iy].m_y, me->m_right->m_box[iz].m_z, me->m_right->m_box[iw].m_w); - ndFloat64 rightSupportDist = rightSupportPoint.DotProduct(dir).m_x; - - if (rightSupportDist >= leftSupportDist) - { - aabbProjection[stack] = leftSupportDist; - stackPool[stack] = me->m_left; - stack++; - ndAssert (stack < DG_STACK_DEPTH_4D); - aabbProjection[stack] = rightSupportDist; - stackPool[stack] = me->m_right; - stack++; - ndAssert (stack < DG_STACK_DEPTH_4D); - } - else - { - aabbProjection[stack] = rightSupportDist; - stackPool[stack] = me->m_right; - stack++; - ndAssert (stack < DG_STACK_DEPTH_4D); - aabbProjection[stack] = leftSupportDist; - stackPool[stack] = me->m_left; - stack++; - ndAssert (stack < DG_STACK_DEPTH_4D); - } - } - else - { - ndConvexHull4dPointCluster* const cluster = (ndConvexHull4dPointCluster*) me; - for (ndInt32 i = 0; i < cluster->m_count; ++i) - { - const ndConvexHull4dVector& p = points[cluster->m_indices[i]]; - ndAssert (p.m_x >= cluster->m_box[0].m_x); - ndAssert (p.m_x <= cluster->m_box[1].m_x); - ndAssert (p.m_y >= cluster->m_box[0].m_y); - ndAssert (p.m_y <= cluster->m_box[1].m_y); - ndAssert (p.m_z >= cluster->m_box[0].m_z); - ndAssert (p.m_z <= cluster->m_box[1].m_z); - ndAssert (p.m_w >= cluster->m_box[0].m_w); - ndAssert (p.m_w <= cluster->m_box[1].m_w); - if (!p.m_mark) - { - ndFloat64 dist = p.DotProduct(dir).m_x; - if (dist > maxProj) - { - maxProj = dist; - index = cluster->m_indices[i]; - } - } - else if (removeEntry) - { - cluster->m_indices[i] = cluster->m_indices[cluster->m_count - 1]; - cluster->m_count = cluster->m_count - 1; - i --; - } - } - - if (cluster->m_count == 0) - { - ndConvexHull4dAABBTreeNode* const parent = cluster->m_parent; - if (parent) - { - ndConvexHull4dAABBTreeNode* const sibling = (parent->m_left != cluster) ? parent->m_left : parent->m_right; - ndAssert (sibling != cluster); - ndConvexHull4dAABBTreeNode* const grandParent = parent->m_parent; - if (grandParent) - { - sibling->m_parent = grandParent; - if (grandParent->m_right == parent) - { - grandParent->m_right = sibling; - } - else - { - grandParent->m_left = sibling; - } - } - else - { - sibling->m_parent = nullptr; - *treePointer = sibling; - } - } - } - } - } - } - - ndAssert (index != -1); - return index; -} - - -ndConvexHull4dAABBTreeNode* ndConvexHull4d::BuildTree (ndConvexHull4dAABBTreeNode* const parent, ndConvexHull4dVector* const points, ndInt32 count, ndInt32 baseIndex, ndInt8** memoryPool, ndInt32& maxMemSize) const -{ - ndConvexHull4dAABBTreeNode* tree = nullptr; - - ndAssert (count); - ndBigVector minP ( ndFloat32 (1.0e15f)); - ndBigVector maxP (-ndFloat32 (1.0e15f)); - if (count <= D_VERTEX_CLUMP_SIZE_4D) - { - ndConvexHull4dPointCluster* const clump = new (*memoryPool) ndConvexHull4dPointCluster; - *memoryPool += sizeof (ndConvexHull4dPointCluster); - maxMemSize -= sizeof (ndConvexHull4dPointCluster); - ndAssert (maxMemSize >= 0); - - ndAssert (clump); - clump->m_count = count; - for (ndInt32 i = 0; i < count; ++i) - { - clump->m_indices[i] = i + baseIndex; - const ndBigVector& p = points[i]; - minP = minP.GetMin(p); - maxP = maxP.GetMax(p); - } - - clump->m_left = nullptr; - clump->m_right = nullptr; - tree = clump; - } - else - { - ndBigVector median (ndBigVector::m_zero); - ndBigVector varian (ndBigVector::m_zero); - for (ndInt32 i = 0; i < count; ++i) - { - const ndBigVector& p = points[i]; - median += p; - varian += p * p; - minP = minP.GetMin(p); - maxP = maxP.GetMax(p); - } - - varian = varian.Scale (ndFloat32 (count)) - median * median; - - ndInt32 index = 0; - ndFloat64 maxVarian = ndFloat64 (-1.0e10f); - for (ndInt32 i = 0; i < 3; ++i) - { - if (varian[i] > maxVarian) - { - index = i; - maxVarian = varian[i]; - } - } - ndBigVector center = median.Scale (ndFloat64 (1.0f) / ndFloat64 (count)); - - ndFloat64 test = center[index]; - - ndInt32 i0 = 0; - ndInt32 i1 = count - 1; - do - { - for (; i0 <= i1; ++i0) - { - ndFloat64 val = points[i0][index]; - if (val > test) - { - break; - } - } - - for (; i1 >= i0; --i1) - { - ndFloat64 val = points[i1][index]; - if (val < test) - { - break; - } - } - - if (i0 < i1) - { - ndSwap(points[i0], points[i1]); - i0++; - i1--; - } - } while (i0 <= i1); - - if (i0 == 0) - { - i0 = count / 2; - } - - if (i0 >= (count - 1)) - { - i0 = count / 2; - } - - tree = new (*memoryPool) ndConvexHull4dAABBTreeNode; - *memoryPool += sizeof (ndConvexHull4dAABBTreeNode); - maxMemSize -= sizeof (ndConvexHull4dAABBTreeNode); - ndAssert (maxMemSize >= 0); - - ndAssert (i0); - ndAssert (count - i0); - - tree->m_left = BuildTree (tree, points, i0, baseIndex, memoryPool, maxMemSize); - tree->m_right = BuildTree (tree, &points[i0], count - i0, i0 + baseIndex, memoryPool, maxMemSize); - } - - ndAssert (tree); - tree->m_parent = parent; - tree->m_box[0] = minP - ndBigVector (ndFloat64 (1.0e-3f)); - tree->m_box[1] = maxP + ndBigVector (ndFloat64 (1.0e-3f)); - return tree; -} - -ndInt32 ndConvexHull4d::InitVertexArray(ndConvexHull4dVector* const points, const ndFloat64* const vertexCloud, ndInt32 strideInBytes, ndInt32 count, void* const memoryPool, ndInt32 maxMemSize) -{ - ndInt32 stride = ndInt32(strideInBytes / sizeof (ndFloat64)); - for (ndInt32 i = 0; i < count; ++i) - { - points[i] = ndBigVector (vertexCloud[i * stride + 0], vertexCloud[i * stride + 1], vertexCloud[i * stride + 2], vertexCloud[i * stride + 3]); - points[i].m_index = i; - points[i].m_mark = 0; - } - - class CompareVertex - { - public: - CompareVertex(void*) - { - } - - ndInt32 Compare(const ndConvexHull4dVector& elementA, const ndConvexHull4dVector& elementB) const - { - for (ndInt32 i = 0; i < 4; ++i) - { - if (elementA[i] < elementB[i]) - { - return -1; - } - else if (elementA[i] > elementB[i]) - { - return 1; - } - } - return 0; - } - }; - ndSort(points, count, nullptr); - - ndInt32 indexCount = 0; - CompareVertex compareVetex(nullptr); - for (ndInt32 i = 1; i < count; ++i) - { - for (; i < count; ++i) - { - if (compareVetex.Compare (points[indexCount], points[i])) - { - indexCount ++; - points[indexCount] = points[i]; - break; - } - } - } - count = indexCount + 1; - if (count < 4) - { - m_count = 0; - return count; - } - - ndConvexHull4dAABBTreeNode* tree = BuildTree (nullptr, points, count, 0, (ndInt8**) &memoryPool, maxMemSize); - - ndBigVector boxSize (tree->m_box[1] - tree->m_box[0]); - m_diag = ndFloat32 (sqrt (boxSize.DotProduct(boxSize).m_x)); - - ndInt32 marks[4]; - m_points.SetCount(count); - bool validTetrahedrum = false; - ndConvexHull4dVector* const convexPoints = &m_points[0]; - const ndFloat64 testVol = ndFloat32 (1.0e-6f) * m_diag * m_diag * m_diag; - - const ndNormalMap& normalMap = GetNormaMap(); - for (ndInt32 i = 0; !validTetrahedrum && (i < normalMap.m_count); ++i) - { - ndInt32 index = SupportVertex(&tree, points, normalMap.m_normal[i], false); - convexPoints[0] = points[index]; - marks[0] = index; - for (ndInt32 j = i + 1; !validTetrahedrum && (j < normalMap.m_count); ++j) - { - ndInt32 index1 = SupportVertex(&tree, points, normalMap.m_normal[j], false); - convexPoints[1] = points[index1]; - ndBigVector p10(convexPoints[1] - convexPoints[0]); - if (p10.DotProduct(p10).GetScalar() >(ndFloat32(1.0e-3f) * m_diag)) - { - marks[1] = index1; - for (ndInt32 k = j + 1; !validTetrahedrum && (k < normalMap.m_count); ++k) - { - ndInt32 index2 = SupportVertex(&tree, points, normalMap.m_normal[k], false); - convexPoints[2] = points[index2]; - ndBigVector p20(convexPoints[2] - convexPoints[0]); - ndBigVector p21(convexPoints[2] - convexPoints[1]); - bool test = p20.DotProduct(p20).GetScalar() > (ndFloat32(1.0e-3f) * m_diag); - test = test && (p21.DotProduct(p21).GetScalar() > (ndFloat32(1.0e-3f) * m_diag)); - if (test) - { - marks[2] = index2; - for (ndInt32 l = k + 1; !validTetrahedrum && (l < normalMap.m_count); l++) - { - ndInt32 index3 = SupportVertex(&tree, points, normalMap.m_normal[l], false); - convexPoints[3] = points[index3]; - ndBigVector p30(convexPoints[3] - convexPoints[0]); - ndBigVector plane(p10.CrossProduct(p20, p30)); - ndFloat64 volume = plane.DotProduct(plane).GetScalar(); - if (volume > testVol) - { - validTetrahedrum = true; - marks[3] = index3; - } - } - } - } - } - } - } - - m_count = 4; - if (!validTetrahedrum) - { - m_count = 0; - } - - if (validTetrahedrum) - { - for (ndInt32 i = 0; i < 4; ++i) - { - points[marks[i]].m_mark = 1; - } - } - - return count; -} - -ndConvexHull4d::ndNode* ndConvexHull4d::AddFace (ndInt32 i0, ndInt32 i1, ndInt32 i2, ndInt32 i3) -{ - ndNode* const node = Append(); - ndConvexHull4dTetraherum& face = node->GetInfo(); - face.Init (&m_points[0], i0, i1, i2, i3); - return node; -} - -void ndConvexHull4d::DeleteFace (ndNode* const node) -{ - Remove (node); -} - -bool ndConvexHull4d::Sanity() const -{ - for (ndNode* node = GetFirst(); node; node = node->GetNext()) - { - ndConvexHull4dTetraherum* const tetra = &node->GetInfo(); - - for (ndInt32 i = 0; i < 4; ++i) - { - ndConvexHull4dTetraherum::ndTetrahedrumFace* const face = &tetra->m_faces[i]; - ndNode* const twinNode = face->m_twin; - if (!twinNode) - { - return false; - } - } - } - -/* - ndList tetraList(GetAllocator()); - const dgHullVector* const points = &m_points[0]; - for (ndNode* node = GetFirst(); node; node = node->GetNext()) { - ndConvexHull4dTetraherum* const tetra = &node->GetInfo(); - const ndBigVector &p0 = points[tetra->m_faces[0].m_index[0]]; - const ndBigVector &p1 = points[tetra->m_faces[0].m_index[1]]; - const ndBigVector &p2 = points[tetra->m_faces[0].m_index[2]]; - const ndBigVector &p3 = points[tetra->m_faces[0].m_index[3]]; - - ndBigVector p1p0 (p1.Sub4(p0)); - ndBigVector p2p0 (p2.Sub4(p0)); - ndBigVector p3p0 (p3.Sub4(p0)); - ndBigVector normal (p1p0.CrossProduct (p2p0, p3p0)); - - if (normal.m_w < ndFloat64 (0.0f)) { - tetraList.Append(node); - } - } - - for (ndList::ndNode* node0 = tetraList.GetFirst(); node0; node0 = node0->GetNext()) { - ndNode* const tetraNode0 = node0->GetInfo(); - ndConvexHull4dTetraherum* const tetra0 = &tetraNode0->GetInfo(); - - ndInt32 index0[4]; - index0[0] = tetra0->m_faces[0].m_index[0]; - index0[1] = tetra0->m_faces[0].m_index[1]; - index0[2] = tetra0->m_faces[0].m_index[2]; - index0[3] = tetra0->m_faces[0].m_index[3]; - - const ndBigVector &p0 = points[index0[0]]; - const ndBigVector &p1 = points[index0[1]]; - const ndBigVector &p2 = points[index0[2]]; - const ndBigVector &p3 = points[index0[3]]; - for (ndList::ndNode* node1 = node0->GetNext(); node1; node1 = node1->GetNext()) { - ndNode* const tetraNode1 = node1->GetInfo(); - ndConvexHull4dTetraherum* const tetra1 = &tetraNode1->GetInfo(); - - ndInt32 index1[4]; - index1[0] = tetra1->m_faces[0].m_index[0]; - index1[1] = tetra1->m_faces[0].m_index[1]; - index1[2] = tetra1->m_faces[0].m_index[2]; - index1[3] = tetra1->m_faces[0].m_index[3]; - - for (ndInt32 i = 0; i < 4; ++i) { - ndInt32 count = 0; - ndInt32 k = index1[i]; - for (ndInt32 j = 0; j < 4; ++j) { - count += (k == index0[j]); - } - if (!count){ -// const ndBigVector &p = points[k]; -// ndFloat64 size = -insphere(&p0.m_x, &p1.m_x, &p2.m_x, &p3.m_x, &p.m_x); -// if (size < ndFloat64 (0.0f)) { -// return false; -// } - } - } - } - } -*/ - return true; -} - -void ndConvexHull4d::LinkSibling (ndNode* node0, ndNode* node1) const -{ - ndConvexHull4dTetraherum* const tetra0 = &node0->GetInfo(); - ndConvexHull4dTetraherum* const tetra1 = &node1->GetInfo(); - for (ndInt32 i = 0; i < 4; ++i) - { - ndConvexHull4dTetraherum::ndTetrahedrumFace* const face0 = &tetra0->m_faces[i]; - if (!face0->m_twin) - { - ndInt32 i0 = face0->m_index[0]; - ndInt32 i1 = face0->m_index[1]; - ndInt32 i2 = face0->m_index[2]; - for (ndInt32 j = 0; j < 4; ++j) - { - ndConvexHull4dTetraherum::ndTetrahedrumFace* const face1 = &tetra1->m_faces[j]; - if (!face1->m_twin) - { - ndInt32 j2 = face1->m_index[0]; - ndInt32 j1 = face1->m_index[1]; - ndInt32 j0 = face1->m_index[2]; - - if (((i0 == j0) && (i1 == j1) && (i2 == j2)) || ((i1 == j0) && (i2 == j1) && (i0 == j2)) || ((i2 == j0) && (i0 == j1) && (i1 == j2))) - { - face0->m_twin = node1; - face1->m_twin = node0; - return; - } - } - } - } - } -} - -void ndConvexHull4d::InsertNewVertex(ndInt32 vertexIndex, ndNode* const frontFace, ndTempList& deletedFaces, ndTempList& newFaces) -{ - ndAssert (Sanity()); - - ndTempList stack; - - ndInt32 mark = IncMark(); - stack.Append(frontFace); - ndConvexHull4dVector* const hullVertexArray = &m_points[0]; - const ndBigVector& p = hullVertexArray[vertexIndex]; - while (stack.GetCount()) - { - ndTempList::ndNode* const stackNode = stack.GetLast(); - ndNode* const node = stackNode->GetInfo(); - stack.Remove(stackNode); - ndConvexHull4dTetraherum* const face = &node->GetInfo(); - if ((face->GetMark() != mark) && (face->Evalue(hullVertexArray, p) > ndFloat64(0.0f))) - { - #ifdef _DEBUG - for (ndTempList::ndNode* deleteNode = deletedFaces.GetFirst(); deleteNode; deleteNode = deleteNode->GetNext()) - { - ndAssert (deleteNode->GetInfo() != node); - } - #endif - deletedFaces.Append(node); - - face->SetMark(mark); - for (ndInt32 i = 0; i < 4; ++i) - { - ndNode* const twinNode = (ndNode*)face->m_faces[i].m_twin; - ndAssert (twinNode); - ndConvexHull4dTetraherum* const twinFace = &twinNode->GetInfo(); - - if (twinFace->GetMark() != mark) - { - stack.Append(twinNode); - } - } - } - } - - ndTree perimeter; - for (ndTempList::ndNode* deleteNode = deletedFaces.GetFirst(); deleteNode; deleteNode = deleteNode->GetNext()) - { - ndNode* const deleteTetraNode = deleteNode->GetInfo(); - ndConvexHull4dTetraherum* const deletedTetra = &deleteTetraNode->GetInfo(); - ndAssert (deletedTetra->GetMark() == mark); - for (ndInt32 i = 0; i < 4; ++i) - { - ndNode* const twinNode = deletedTetra->m_faces[i].m_twin; - ndConvexHull4dTetraherum* const twinTetra = &twinNode->GetInfo(); - - if (twinTetra->GetMark() != mark) - { - if (!perimeter.Find(twinTetra->m_uniqueID)) - { - perimeter.Insert(twinNode, twinTetra->m_uniqueID); - } - } - deletedTetra->m_faces[i].m_twin = nullptr; - } - } - - ndTempList coneList; - ndTree::Iterator iter (perimeter); - for (iter.Begin(); iter; iter ++) - { - ndNode* const perimeterNode = iter.GetNode()->GetInfo(); - ndConvexHull4dTetraherum* const perimeterTetra = &perimeterNode->GetInfo(); - for (ndInt32 i = 0; i < 4; ++i) - { - ndConvexHull4dTetraherum::ndTetrahedrumFace* const perimeterFace = &perimeterTetra->m_faces[i]; - - if (perimeterFace->m_twin->GetInfo().GetMark() == mark) - { - ndNode* const newNode = AddFace (vertexIndex, perimeterFace->m_index[0], perimeterFace->m_index[1], perimeterFace->m_index[2]); - newFaces.Addtop(newNode); - - ndConvexHull4dTetraherum* const newTetra = &newNode->GetInfo(); - newTetra->m_faces[2].m_twin = perimeterNode; - perimeterFace->m_twin = newNode; - coneList.Append (newNode); - } - } - } - - for (ndTempList::ndNode* coneNode = coneList.GetFirst(); coneNode->GetNext(); coneNode = coneNode->GetNext()) - { - ndNode* const coneNodeA = coneNode->GetInfo(); - for (ndTempList::ndNode* nextConeNode = coneNode->GetNext(); nextConeNode; nextConeNode = nextConeNode->GetNext()) - { - ndNode* const coneNodeB = nextConeNode->GetInfo(); - LinkSibling (coneNodeA, coneNodeB); - } - } -} - -ndConvexHull4d::ndNode* ndConvexHull4d::FindFacingNode(const ndBigVector& vertex) -{ - const ndConvexHull4dVector* const hullVertexArray = &m_points[0]; - - ndNode* bestNode = GetFirst(); - ndConvexHull4dTetraherum* const tetra = &bestNode->GetInfo(); - ndConvexHull4dTetraherum::ndTetrahedrumPlane plane (tetra->GetPlaneEquation (hullVertexArray)); - ndFloat64 dist = plane.Evalue(vertex); - ndInt32 mark = IncMark(); - tetra->SetMark(mark); - - ndInt8 buffer[1024 * 2 * sizeof (ndFloat64)]; - ndDownHeap heap (buffer, sizeof (buffer)); - - heap.Push(bestNode, dist); - ndInt32 maxCount = heap.GetMaxCount() - 1; - ndInt32 releafCount = maxCount >> 3; - while (heap.GetCount()) - { - ndNode* const node1 = heap[0]; - ndFloat64 dist1 = heap.Value(); - if (dist1 > ndFloat64 (1.0e-5f)) - { - return node1; - } - heap.Pop(); - ndConvexHull4dTetraherum* const tetra1 = &node1->GetInfo(); - for (ndInt32 i = 0; i < 4; ++i) - { - ndNode* neigborghNode = tetra1->m_faces[i].m_twin; - ndConvexHull4dTetraherum* const neighborgh = &neigborghNode->GetInfo(); - if (neighborgh->GetMark() != mark) - { - neighborgh->SetMark(mark); - if (heap.GetCount() >= maxCount) - { - for (ndInt32 j = 0; j < releafCount; ++j) - { - heap.Remove(heap.GetCount() - 1); - } - } - ndConvexHull4dTetraherum::ndTetrahedrumPlane plane1 (neighborgh->GetPlaneEquation (hullVertexArray)); - heap.Push(neigborghNode, plane1.Evalue(vertex)); - } - } - } - - for (ndNode* node1 = GetFirst(); node1; node1 = node1->GetNext()) - { - ndConvexHull4dTetraherum* const tetra1 = &node1->GetInfo(); - ndFloat64 dist1 = tetra1->Evalue(hullVertexArray, vertex); - if (dist1 > ndFloat64(0.0f)) - { - return node1; - } - } - - return nullptr; -} - -ndInt32 ndConvexHull4d::AddVertex (const ndBigVector& vertex) -{ - ndInt32 index = -1; - ndNode* const faceNode = FindFacingNode(vertex); - if (faceNode) - { - index = m_count; - m_points[index] = vertex; - m_points[index].m_index = index; - m_count ++; - - ndAssert(0); - ndTempList newFaces; - ndTempList deleteList; - - InsertNewVertex(index, faceNode, deleteList, newFaces); - for (ndTempList::ndNode* deleteNode = deleteList.GetFirst(); deleteNode; deleteNode = deleteNode->GetNext()) - { - ndNode* const node = deleteNode->GetInfo(); - DeleteFace (node); - } - } - return index; -} - -void ndConvexHull4d::BuildHull (const ndFloat64* const vertexCloud, ndInt32 strideInBytes, ndInt32 count, ndFloat64 distTol) -{ - ndInt32 treeCount = count / (D_VERTEX_CLUMP_SIZE_4D>>1); - if (treeCount < 4) - { - treeCount = 4; - } - treeCount *= 2; - - ndStack points (count); - ndStack treePool (treeCount + 256); - - count = InitVertexArray(&points[0], vertexCloud, strideInBytes, count, &treePool[0], treePool.GetSizeInBytes()); - if (m_count >= 4) - { - CalculateConvexHull (&treePool[0], &points[0], count, distTol); - } -} - -void ndConvexHull4d::CalculateConvexHull (ndConvexHull4dAABBTreeNode* vertexTree, ndConvexHull4dVector* const points, ndInt32 count, ndFloat64 distTol) -{ - distTol = fabs (distTol) * m_diag; - ndNode* const nodes0 = AddFace (0, 1, 2, 3); - ndNode* const nodes1 = AddFace (0, 1, 3, 2); - - ndTempList boundaryFaces; - boundaryFaces.Append(nodes0); - boundaryFaces.Append(nodes1); - - LinkSibling (nodes0, nodes1); - LinkSibling (nodes0, nodes1); - LinkSibling (nodes0, nodes1); - LinkSibling (nodes0, nodes1); - - IncMark(); - count -= 4; - ndInt32 currentIndex = 4; - while (boundaryFaces.GetCount() && count) - { - ndConvexHull4dVector* const hullVertexArray = &m_points[0]; - ndNode* const faceNode = boundaryFaces.GetFirst()->GetInfo(); - ndConvexHull4dTetraherum* const face = &faceNode->GetInfo(); - ndConvexHull4dTetraherum::ndTetrahedrumPlane planeEquation (face->GetPlaneEquation (hullVertexArray)); - - ndInt32 index = SupportVertex (&vertexTree, points, planeEquation); - - const ndConvexHull4dVector& p = points[index]; - ndFloat64 dist = planeEquation.Evalue(p); - if ((dist > distTol) && (face->Evalue(hullVertexArray, p) > ndFloat64(0.0f))) - { - m_points[currentIndex] = p; - points[index].m_mark = 1; - - ndTempList deleteList; - InsertNewVertex(currentIndex, faceNode, deleteList, boundaryFaces); - - for (ndTempList::ndNode* deleteNode = deleteList.GetFirst(); deleteNode; deleteNode = deleteNode->GetNext()) - { - ndNode* const node = deleteNode->GetInfo(); - boundaryFaces.Remove (node); - DeleteFace (node); - } - - currentIndex ++; - count --; - } - else - { - boundaryFaces.Remove (faceNode); - } - } - m_count = currentIndex; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull4d.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull4d.h deleted file mode 100644 index c335a9ff51..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndConvexHull4d.h +++ /dev/null @@ -1,190 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __NDG_CONVEXHULL_4D__ -#define __NDG_CONVEXHULL_4D__ - -#include "ndCoreStdafx.h" -#include "ndList.h" -#include "ndArray.h" -#include "ndPlane.h" -#include "ndVector.h" -#include "ndMatrix.h" -#include "ndQuaternion.h" - -class ndConvexHull4dAABBTreeNode; - -class ndConvexHull4dVector: public ndBigVector -{ - public: - void operator = (const ndBigVector& a) - { - m_x = a.m_x; - m_y = a.m_y; - m_z = a.m_z; - m_w = a.m_w; - m_index = 0; - m_mark = 0; - } - - ndInt32 m_index; - ndInt32 m_mark; -}; - -class ndConvexHull4dTetraherum -{ - public: - class ndTetrahedrumFace - { - public: - ndInt32 m_index[4]; - ndList::ndNode* m_twin; - }; - - class ndTetrahedrumPlane: public ndBigVector - { - public: - ndTetrahedrumPlane (const ndBigVector& p0, const ndBigVector& p1, const ndBigVector& p2, const ndBigVector& p3); - ndFloat64 Evalue (const ndBigVector& point) const; - ndFloat64 m_dist; - }; - - D_CORE_API ndConvexHull4dTetraherum(); - D_CORE_API ndBigVector CircumSphereCenter(const ndConvexHull4dVector* const pointArray) const; - - private: - void Init (const ndConvexHull4dVector* const points, ndInt32 v0, ndInt32 v1, ndInt32 v2, ndInt32 v3); - ndTetrahedrumPlane GetPlaneEquation(const ndConvexHull4dVector* const points) const; - ndFloat64 GetTetraVolume(const ndConvexHull4dVector* const pointArray) const; - ndFloat64 Evalue(const ndConvexHull4dVector* const pointArray, const ndBigVector& point) const; - ndInt32 GetMark() const { return m_mark; } - void SetMark(ndInt32 mark) { m_mark = mark; } - - public: - ndTetrahedrumFace m_faces[4]; - ndInt32 m_mark; - ndInt32 m_uniqueID; - -#ifdef _DEBUG - ndInt32 m_debugID; -#endif - friend class ndConvexHull4d; - friend class ndDelaunayTetrahedralization; -}; - -class ndConvexHull4d: public ndList -{ - public: - class ndTempList: public ndList> - { - }; - - D_CORE_API ndConvexHull4d(const ndConvexHull4d& source); - D_CORE_API ndConvexHull4d(const ndFloat64* const vertexCloud, ndInt32 strideInBytes, ndInt32 count, ndFloat64 distTol); - D_CORE_API virtual ~ndConvexHull4d(); - - ndInt32 GetVertexCount() const; - ndInt32 GetVertexIndex(ndInt32 i) const; - const ndBigVector& GetVertex(ndInt32 i) const; - - const ndConvexHull4dVector* GetHullVertexArray() const; - ndFloat64 GetTetraVolume (const ndConvexHull4dTetraherum* const tetra) const; - - ndInt32 IncMark (); - void Save (const char* const filename) const; - - protected: - ndConvexHull4d(); - - void BuildHull (const ndFloat64* const vertexCloud, ndInt32 strideInBytes, ndInt32 count, ndFloat64 distTol); - - virtual ndInt32 AddVertex (const ndBigVector& vertex); - virtual ndInt32 InitVertexArray(ndConvexHull4dVector* const points, const ndFloat64* const vertexCloud, ndInt32 strideInBytes, ndInt32 count, void* const memoryPool, ndInt32 maxMemSize); - - virtual ndNode* AddFace (ndInt32 i0, ndInt32 i1, ndInt32 i2, ndInt32 i3); - virtual void DeleteFace (ndNode* const node); - - ndNode* FindFacingNode(const ndBigVector& vertex); - - void InsertNewVertex(ndInt32 vertexIndex, ndNode* const frontFace, ndTempList& deletedFaces, ndTempList& newFaces); - ndInt32 SupportVertex (ndConvexHull4dAABBTreeNode** const tree, const ndConvexHull4dVector* const points, const ndBigVector& dir, const bool removeEntry = true) const; - - void CalculateConvexHull (ndConvexHull4dAABBTreeNode* vertexTree, ndConvexHull4dVector* const points, ndInt32 count, ndFloat64 distTol); - void LinkSibling (ndNode* node0, ndNode* node1) const; - bool Sanity() const; - ndConvexHull4dAABBTreeNode* BuildTree (ndConvexHull4dAABBTreeNode* const parent, ndConvexHull4dVector* const points, ndInt32 count, ndInt32 baseIndex, ndInt8** const memoryPool, ndInt32& maxMemSize) const; - - class ndNormalMap - { - public: - ndNormalMap(); - private: - void TessellateTriangle(ndInt32 level, const ndVector& p0, const ndVector& p1, const ndVector& p2, ndBigVector* const buffer, ndInt32& count); - - ndBigVector m_normal[1024]; - ndInt32 m_count; - friend class ndConvexHull4d; - }; - static const ndNormalMap& GetNormaMap(); - - ndInt32 m_mark; - ndInt32 m_count; - ndFloat64 m_diag; - ndArray m_points; -}; - -inline ndInt32 ndConvexHull4d::IncMark () -{ - m_mark ++; - return m_mark; -} - -inline ndInt32 ndConvexHull4d::GetVertexCount() const -{ - return m_count; -} - -inline ndInt32 ndConvexHull4d::GetVertexIndex(ndInt32 index) const -{ - ndAssert (index >= 0); - ndAssert (index < m_count); - return m_points[index].m_index; -} - - -inline const ndBigVector& ndConvexHull4d::GetVertex(ndInt32 index) const -{ - ndAssert (index >= 0); - ndAssert (index < m_count); - return m_points[index]; -} - -inline const ndConvexHull4dVector* ndConvexHull4d::GetHullVertexArray() const -{ - return &m_points[0]; -} - -inline ndFloat64 ndConvexHull4d::GetTetraVolume (const ndConvexHull4dTetraherum* const tetra) const -{ - return tetra->GetTetraVolume (&m_points[0]); -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCore.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCore.h deleted file mode 100644 index ace27e49fe..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCore.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CORE_H__ -#define __ND_CORE_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCoreStdafx.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCoreStdafx.cpp deleted file mode 100644 index 0a102ee28f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCoreStdafx.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" - -#ifdef _D_CORE_DLL - #include "ndTypes.h" - #include "ndMemory.h" - - #ifndef D_USE_DEFAULT_NEW_AND_DELETE - void *operator new (size_t size) - { - // this should not happens on this test - // newton should never use global operator new and delete. - return ndMemory::Malloc(size); - } - - void operator delete (void* ptr) noexcept - { - ndMemory::Free(ptr); - } - #endif - -#if (defined(WIN32) || defined(_WIN32)) - BOOL APIENTRY DllMain(HMODULE, DWORD ul_reason_for_call, LPVOID) - { - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; - } -#endif -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCoreStdafx.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCoreStdafx.h deleted file mode 100644 index 5f0c8c2161..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndCoreStdafx.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef _ND_TYPES_H_ -#define _ND_TYPES_H_ - -#include "ndTypes.h" - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDebug.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDebug.cpp deleted file mode 100644 index 44f4c68d05..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDebug.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - - -#include "ndCoreStdafx.h" -#include "ndDebug.h" - -void ndExpandTraceMessage(const char* const fmt, ...) -{ - va_list v_args; - char text[4096]; - - text[0] = 0; - va_start(v_args, fmt); - vsnprintf(text, sizeof(text), fmt, v_args); - va_end(v_args); - -#if (defined(WIN32) || defined(_WIN32)) - OutputDebugStringA(text); -#else - printf("%s\n", text); -#endif -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDebug.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDebug.h deleted file mode 100644 index 9985fa87ef..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDebug.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_DEBUG_H__ -#define __ND_DEBUG_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" - -#ifdef _MSC_VER - #ifdef _DEBUG - #define D_TRACE - #endif -#endif - - D_CORE_API void ndExpandTraceMessage(const char* const fmt, ...); -#ifdef D_TRACE - #define ndTrace(x) ndExpandTraceMessage x; -#else - #define ndTrace(x); -#endif - -#ifdef _DEBUG - inline void TraceFuntionName (const char *name) - { - // static dInt32 trace; - // ndTrace (("%d %s\n", trace, name)); - ndTrace (("%s\n", name)); - } - - //#define TRACE_FUNCTION(name) TraceFuntionName (name) - #define TRACE_FUNCTION(name) -#else - #define TRACE_FUNCTION(name) -#endif - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDelaunayTetrahedralization.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDelaunayTetrahedralization.cpp deleted file mode 100644 index c4c151c9e2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDelaunayTetrahedralization.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndSort.h" -#include "ndStack.h" -#include "ndGoogol.h" -#include "ndSmallDeterminant.h" -#include "ndDelaunayTetrahedralization.h" - -ndDelaunayTetrahedralization::ndDelaunayTetrahedralization(const ndFloat64* const vertexCloud, ndInt32 count, ndInt32 strideInByte, ndFloat64 distTol) - :ndConvexHull4d() -{ - ndStack pool(count + 2); - - ndBigVector* const points = &pool[0]; - ndInt32 stride = ndInt32 (strideInByte / sizeof (ndFloat64)); - for (ndInt32 i = 0; i < count; ++i) - { - ndFloat64 x = ndRoundToFloat (vertexCloud[i * stride + 0]); - ndFloat64 y = ndRoundToFloat (vertexCloud[i * stride + 1]); - ndFloat64 z = ndRoundToFloat (vertexCloud[i * stride + 2]); - points[i] = ndBigVector (x, y, z, x * x + y * y + z * z); - } - - ndInt32 oldCount = count; - BuildHull (&pool[0].m_x, sizeof (ndBigVector), count, distTol); - if (oldCount > m_count) - { - // the mesh is convex, need to add two steiners point to make tractable - ndBigVector origin (ndFloat64 (0.0f)); - ndFloat64 maxW = ndFloat64 (-1.0e20f); - for (ndInt32 i = 0; i < count; ++i) - { - ndFloat64 x = ndRoundToFloat(vertexCloud[i * stride + 0]); - ndFloat64 y = ndRoundToFloat(vertexCloud[i * stride + 1]); - ndFloat64 z = ndRoundToFloat(vertexCloud[i * stride + 2]); - points[i] = ndBigVector(x, y, z, x * x + y * y + z * z); - origin += points[i]; - maxW = ndMax (points[i].m_w, maxW); - } - origin = origin.Scale (ndFloat64 (1.0f) / count); - points[count + 0] = origin; - points[count + 1] = origin; - points[count + 0].m_w += ndFloat64 (1.0f); - points[count + 1].m_w -= ndFloat64 (1.0f); - BuildHull (&pool[0].m_x, sizeof (ndBigVector), count + 2, distTol); - } - - if (oldCount > m_count) - { - // this is probably a regular convex solid, which will have a zero volume hull - // add the rest of the points by incremental insertion with small perturbation - ndInt32 hullCount = m_count; - - for (ndInt32 i = 0; i < count; ++i) - { - bool inHull = false; - const ndConvexHull4dVector* const hullPoints = &m_points[0]; - for (ndInt32 j = 0; j < hullCount; ++j) - { - if (hullPoints[j].m_index == i) - { - inHull = true; - break; - } - } - if (!inHull) - { - ndBigVector q (points[i]); - ndInt32 index = AddVertex(q); - if (index == -1) - { - q.m_x += ndFloat64 (1.0e-3f); - q.m_y += ndFloat64 (1.0e-3f); - q.m_z += ndFloat64 (1.0e-3f); - index = AddVertex(q); - ndAssert (index != -1); - } - ndAssert (index != -1); - m_points[index].m_index = i; - } - } - } - - SortVertexArray (); - - ndTempList::FlushFreeList(); -} - -ndDelaunayTetrahedralization::~ndDelaunayTetrahedralization() -{ -} - -ndInt32 ndDelaunayTetrahedralization::AddVertex (const ndBigVector& vertex) -{ - ndBigVector p (vertex); - ndAssert(p.m_w == ndFloat32(0.0f)); - p.m_w = p.DotProduct(p).GetScalar(); - ndInt32 index = ndConvexHull4d::AddVertex(p); - - return index; -} - -void ndDelaunayTetrahedralization::SortVertexArray () -{ - ndConvexHull4dVector* const points = &m_points[0]; - for (ndNode* node = GetFirst(); node; node = node->GetNext()) - { - ndConvexHull4dTetraherum* const tetra = &node->GetInfo(); - for (ndInt32 i = 0; i < 4; ++i) - { - ndConvexHull4dTetraherum::ndTetrahedrumFace& face = tetra->m_faces[i]; - for (ndInt32 j = 0; j < 4; ++j) - { - ndInt32 index = face.m_index[j]; - face.m_index[j] = points[index].m_index; - } - } - } - - class CompareVertex - { - public: - CompareVertex(void*) - { - } - - ndInt32 Compare(const ndConvexHull4dVector& elementA, const ndConvexHull4dVector& elementB) const - { - if (elementA.m_index < elementB.m_index) - { - return -1; - } - else if (elementA.m_index > elementB.m_index) - { - return 1; - } - return 0; - } - }; - ndSort(points, m_count, nullptr); -} - -void ndDelaunayTetrahedralization::RemoveUpperHull () -{ - ndNode* nextNode = NULL; - for (ndNode* node = GetFirst(); node; node = nextNode) - { - nextNode = node->GetNext(); - - ndConvexHull4dTetraherum* const tetra = &node->GetInfo(); - tetra->SetMark(0); - ndFloat64 w = GetTetraVolume (tetra); - if (w >= ndFloat64 (0.0f)) - { - DeleteFace(node); - } - } -} - -void ndDelaunayTetrahedralization::DeleteFace (ndNode* const node) -{ - ndConvexHull4dTetraherum* const tetra = &node->GetInfo(); - for (ndInt32 i = 0; i < 4; ++i) - { - ndNode* const twinNode = tetra->m_faces[i].m_twin; - if (twinNode) - { - ndConvexHull4dTetraherum* const twinTetra = &twinNode->GetInfo(); - for (ndInt32 j = 0; j < 4; ++j) - { - if (twinTetra->m_faces[j].m_twin == node) - { - twinTetra->m_faces[j].m_twin = NULL; - break; - } - } - } - } - ndConvexHull4d::DeleteFace (node); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDelaunayTetrahedralization.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDelaunayTetrahedralization.h deleted file mode 100644 index 4204b48e23..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndDelaunayTetrahedralization.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __NDG_DEALUNAY_TETRAHEDRALIZAION_4D__ -#define __NDG_DEALUNAY_TETRAHEDRALIZAION_4D__ - -#include "ndCoreStdafx.h" -#include "ndConvexHull4d.h" - -class ndDelaunayTetrahedralization: public ndConvexHull4d -{ - public: - D_CORE_API ndDelaunayTetrahedralization(const ndFloat64* const vertexCloud, ndInt32 count, ndInt32 strideInByte, ndFloat64 distTol); - D_CORE_API virtual ~ndDelaunayTetrahedralization(); - D_CORE_API void RemoveUpperHull (); - - D_CORE_API ndInt32 AddVertex (const ndBigVector& vertex); - - protected: - D_CORE_API void SortVertexArray(); - D_CORE_API virtual void DeleteFace (ndNode* const node) ; -}; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.cpp deleted file mode 100644 index 689df33657..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndMemory.h" -#include "ndVector.h" -#include "ndPlane.h" -#include "ndGoogol.h" -#include "ndFastRay.h" -#include "ndFastAabb.h" -#include "ndIntersections.h" - -#define D_USE_FLOAT_VERSION -#define D_RAY_TOL_ERROR (ndFloat32 (-1.0e-3f)) -#define D_RAY_TOL_ADAPTIVE_ERROR (ndFloat32 (1.0e-1f)) - -void ndFastAabb::MakeBox1(ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray, ndVector& minBox, ndVector& maxBox) const -{ - ndVector faceBoxP0(&vertexArray[indexArray[0] * stride]); - faceBoxP0 = faceBoxP0 & ndVector::m_triplexMask; - ndVector faceBoxP1(faceBoxP0); - for (ndInt32 i = 1; i < indexCount; ++i) - { - ndVector p(&vertexArray[indexArray[i] * stride]); - p = p & ndVector::m_triplexMask; - faceBoxP0 = faceBoxP0.GetMin(p); - faceBoxP1 = faceBoxP1.GetMax(p); - } - - minBox = faceBoxP0 - m_p1; - maxBox = faceBoxP1 - m_p0; -} - -void ndFastAabb::MakeBox2(const ndMatrix& faceMatrix, ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray, ndVector& minBox, ndVector& maxBox) const -{ - ndVector faceBoxP0(faceMatrix.TransformVector(ndVector(&vertexArray[indexArray[0] * stride]) & ndVector::m_triplexMask)); - ndVector faceBoxP1(faceBoxP0); - for (ndInt32 i = 1; i < indexCount; ++i) - { - ndVector p(faceMatrix.TransformVector(ndVector(&vertexArray[indexArray[i] * stride]) & ndVector::m_triplexMask)); - faceBoxP0 = faceBoxP0.GetMin(p); - faceBoxP1 = faceBoxP1.GetMax(p); - } - faceBoxP0 = faceBoxP0 & ndVector::m_triplexMask; - faceBoxP1 = faceBoxP1 & ndVector::m_triplexMask; - - ndMatrix matrix = *this * faceMatrix; - ndVector size(matrix[0].Abs().Scale(m_size.m_x) + matrix[1].Abs().Scale(m_size.m_y) + matrix[2].Abs().Scale(m_size.m_z)); - ndVector boxP0((matrix.m_posit - size) & ndVector::m_triplexMask); - ndVector boxP1((matrix.m_posit + size) & ndVector::m_triplexMask); - - minBox = faceBoxP0 - boxP1; - maxBox = faceBoxP1 - boxP0; -} - -ndMatrix ndFastAabb::MakeFaceMatrix(const ndVector& faceNormal, ndInt32, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray) const -{ - ndMatrix faceMatrix; - ndVector origin(&vertexArray[indexArray[0] * stride]); - ndVector pin(&vertexArray[indexArray[0] * stride]); - pin = pin & ndVector::m_triplexMask; - origin = origin & ndVector::m_triplexMask; - - ndVector pin1(&vertexArray[indexArray[1] * stride]); - pin1 = pin1 & ndVector::m_triplexMask; - - faceMatrix[0] = faceNormal; - faceMatrix[1] = pin1 - origin; - faceMatrix[1] = faceMatrix[1].Normalize(); - faceMatrix[2] = faceMatrix[0].CrossProduct(faceMatrix[1]); - faceMatrix[3] = origin | ndVector::m_wOne; - return faceMatrix.OrthoInverse(); -} - -ndFloat32 ndFastAabb::PolygonBoxRayDistance(const ndVector& faceNormal, ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray, const ndFastRay& ray) const -{ - ndVector minBox; - ndVector maxBox; - MakeBox1(indexCount, indexArray, stride, vertexArray, minBox, maxBox); - ndFloat32 dist0 = ray.BoxIntersect(minBox, maxBox); - if (dist0 < ndFloat32(1.0f)) - { - ndMatrix faceMatrix(MakeFaceMatrix(faceNormal, indexCount, indexArray, stride, vertexArray)); - - MakeBox2(faceMatrix, indexCount, indexArray, stride, vertexArray, minBox, maxBox); - ndVector veloc(faceMatrix.RotateVector(ray.m_diff) & ndVector::m_triplexMask); - ndFastRay localRay(ndVector(ndFloat32(0.0f)), veloc); - ndFloat32 dist1 = localRay.BoxIntersect(minBox, maxBox); - dist0 = ndMax(dist1, dist0); - } - return dist0; -} - -ndFloat32 ndFastAabb::PolygonBoxDistance(const ndVector& faceNormal, ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray) const -{ - ndVector minBox; - ndVector maxBox; - MakeBox1(indexCount, indexArray, stride, vertexArray, minBox, maxBox); - - ndVector mask(minBox * maxBox < ndVector(ndFloat32(0.0f))); - ndVector dist(maxBox.GetMin(minBox.Abs()) & mask); - dist = dist.GetMin(dist.ShiftTripleRight()); - dist = dist.GetMin(dist.ShiftTripleRight()); - ndFloat32 dist0 = dist.GetScalar(); - if (dist0 > ndFloat32(0.0f)) - { - ndMatrix faceMatrix(MakeFaceMatrix(faceNormal, indexCount, indexArray, stride, vertexArray)); - MakeBox2(faceMatrix, indexCount, indexArray, stride, vertexArray, minBox, maxBox); - - ndVector mask2(minBox * maxBox < ndVector(ndFloat32(0.0f))); - ndVector dist2(maxBox.GetMin(minBox.Abs()) & mask2); - dist2 = dist2.GetMin(dist2.ShiftTripleRight()); - dist2 = dist2.GetMin(dist2.ShiftTripleRight()); - ndFloat32 dist1 = dist2.GetScalar(); - dist0 = (dist1 > ndFloat32(0.0f)) ? ndMax(dist0, dist1) : ndFloat32(0.0f); - if (dist0 <= ndFloat32(0.0f)) - { - // some how clang crashes in relese and release with debug, - // but not Visual studio, Intel or Gcc - // I do can't determine why because Clang inline teh code without debug - //ndVector p1p0((minBox.Abs()).GetMin(maxBox.Abs()).AndNot(mask2)); - const ndVector box0(minBox.Abs()); - const ndVector box1(maxBox.Abs()); - const ndVector p1p0((box0.GetMin(box1)).AndNot(mask2)); - dist2 = p1p0.DotProduct(p1p0); - dist2 = dist2.Sqrt() * ndVector::m_negOne; - dist0 = dist2.GetScalar(); - } - } - else - { - //ndVector p1p0((minBox.Abs()).GetMin(maxBox.Abs()).AndNot(mask)); - const ndVector box0(minBox.Abs()); - const ndVector box1(maxBox.Abs()); - const ndVector p1p0(box0.GetMin(box1).AndNot(mask)); - dist = p1p0.DotProduct(p1p0); - dist = dist.Sqrt() * ndVector::m_negOne; - dist0 = dist.GetScalar(); - } - return dist0; -} - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.h deleted file mode 100644 index e45278b89b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.h +++ /dev/null @@ -1,119 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_FAST_AABB_H__ -#define __ND_FAST_AABB_H__ - -#include "ndCoreStdafx.h" -#include "ndDebug.h" -#include "ndVector.h" -#include "ndMatrix.h" - -D_MSV_NEWTON_ALIGN_32 -class ndFastAabb : public ndMatrix -{ - public: - ndFastAabb(); - ndFastAabb(const ndVector& p0, const ndVector& p1); - ndFastAabb(const ndMatrix& matrix, const ndVector& size); - - const ndVector& GetOrigin() const; - const ndVector& GetTarget() const; - - void SetSeparatingDistance(const ndFloat32 distance); - void SetTransposeAbsMatrix(const ndMatrix& matrix); - - D_CORE_API ndFloat32 PolygonBoxDistance(const ndVector& faceNormal, ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray) const; - D_CORE_API ndFloat32 PolygonBoxRayDistance(const ndVector& faceNormal, ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray, const ndFastRay& ray) const; - - private: - ndMatrix MakeFaceMatrix(const ndVector& faceNormal, ndInt32, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray) const; - void MakeBox1(ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray, ndVector& minBox, ndVector& maxBox) const; - void MakeBox2(const ndMatrix& faceMatrix, ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray, ndVector& minBox, ndVector& maxBox) const; - - protected: - ndMatrix m_absDir; - ndVector m_p0; - ndVector m_p1; - ndVector m_size; - mutable ndVector m_separationDistance; - - friend class ndAabbPolygonSoup; -} D_GCC_NEWTON_ALIGN_32 ; - -inline ndFastAabb::ndFastAabb() - :ndMatrix(ndGetIdentityMatrix()) - ,m_absDir(ndGetIdentityMatrix()) - ,m_p0(ndVector::m_zero) - ,m_p1(ndVector::m_zero) - ,m_size(ndVector::m_zero) - ,m_separationDistance(ndFloat32(1.0e10f)) -{ -} - -inline ndFastAabb::ndFastAabb(const ndMatrix& matrix, const ndVector& size) - :ndMatrix(matrix) - ,m_separationDistance(ndFloat32(1.0e10f)) -{ - SetTransposeAbsMatrix(matrix); - m_size = ndVector(matrix[0].Abs().Scale(size.m_x) + matrix[1].Abs().Scale(size.m_y) + matrix[2].Abs().Scale(size.m_z)); - m_p0 = (matrix[3] - m_size) & ndVector::m_triplexMask; - m_p1 = (matrix[3] + m_size) & ndVector::m_triplexMask; -} - -inline ndFastAabb::ndFastAabb(const ndVector& p0, const ndVector& p1) - :ndMatrix(ndGetIdentityMatrix()) - ,m_absDir(ndGetIdentityMatrix()) - ,m_p0(p0) - ,m_p1(p1) - ,m_size(ndVector::m_half * (p1 - p0)) - ,m_separationDistance(ndFloat32(1.0e10f)) -{ - m_posit = (ndVector::m_half * (p1 + p0)) | ndVector::m_wOne; - ndAssert(m_size.m_w == ndFloat32(0.0f)); - ndAssert(m_posit.m_w == ndFloat32(1.0f)); -} - -inline const ndVector& ndFastAabb::GetOrigin() const -{ - return m_p0; -} - -inline const ndVector& ndFastAabb::GetTarget() const -{ - return m_p1; -} - -inline void ndFastAabb::SetSeparatingDistance(const ndFloat32 distance) -{ - m_separationDistance = distance; -} - -inline void ndFastAabb::SetTransposeAbsMatrix(const ndMatrix& matrix) -{ - m_absDir = matrix.Transpose3x3(); - m_absDir[0] = m_absDir[0].Abs(); - m_absDir[1] = m_absDir[1].Abs(); - m_absDir[2] = m_absDir[2].Abs(); -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastRay.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastRay.cpp deleted file mode 100644 index a7e29f4eb0..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastRay.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndVector.h" -#include "ndFastRay.h" - -ndFloat32 ndFastRay::PolygonIntersect (const ndVector& faceNormal, ndFloat32 maxT, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount) const -{ - ndAssert (m_p0.m_w == ndFloat32 (0.0f)); - ndAssert (m_p1.m_w == ndFloat32 (0.0f)); - - if (faceNormal.DotProduct(m_unitDir).GetScalar() < ndFloat32 (0.0f)) - { - ndInt32 stride = ndInt32(strideInBytes / sizeof (ndFloat32)); - ndBigVector v0(ndVector(&polygon[indexArray[indexCount - 1] * stride]) & ndVector::m_triplexMask); - ndBigVector p0(m_p0); - ndBigVector p0v0(v0 - p0); - - ndBigVector diff(m_diff); - ndBigVector normal(faceNormal); - ndFloat64 tOut = normal.DotProduct(p0v0).GetScalar() / normal.DotProduct(diff).GetScalar(); - if ((tOut >= ndFloat64(0.0f)) && (tOut <= maxT)) - { - ndBigVector p (p0 + diff.Scale (tOut)); - ndBigVector unitDir(m_unitDir); - for (ndInt32 i = 0; i < indexCount; ++i) - { - ndInt32 i2 = indexArray[i] * stride; - ndBigVector v1(ndVector(&polygon[i2]) & ndVector::m_triplexMask); - - ndBigVector edge0(p - v0); - ndBigVector edge1(v1 - v0); - ndFloat64 area = unitDir.DotProduct (edge0.CrossProduct(edge1)).GetScalar(); - if (area < ndFloat32 (0.0f)) - { - return ndFloat32 (1.2f); - } - v0 = v1; - } - - return ndFloat32(tOut); - } - } - - return ndFloat32 (1.2f); -} - -ndRay ndFastRay::RayDistance(const ndVector& ray_q0, const ndVector& ray_q1) const -{ - const ndVector u(m_diff); - const ndVector v(ndVector::m_triplexMask & (ray_q1 - ray_q0)); - const ndVector w(ndVector::m_triplexMask & (m_p0 - ray_q0)); - ndAssert(u.m_w == ndFloat32(0.0f)); - ndAssert(v.m_w == ndFloat32(0.0f)); - ndAssert(w.m_w == ndFloat32(0.0f)); - - const ndFloat32 a = u.DotProduct(u).GetScalar(); - const ndFloat32 b = u.DotProduct(v).GetScalar(); - const ndFloat32 c = v.DotProduct(v).GetScalar(); - const ndFloat32 d = u.DotProduct(w).GetScalar(); - const ndFloat32 e = v.DotProduct(w).GetScalar(); - const ndFloat32 D = a*c - b*b; - - ndFloat32 sD = D; - ndFloat32 tD = D; - ndFloat32 sN; - ndFloat32 tN; - - // compute the line parameters of the two closest points - if (D < ndFloat32(1.0e-8f)) - { - sN = ndFloat32(0.0f); - sD = ndFloat32(1.0f); - 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 < ndFloat32(0.0f)) - { - // sc < 0 => the s=0 edge is visible - sN = ndFloat32(0.0f); - 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 < ndFloat32(0.0f)) - { - // tc < 0 => the t=0 edge is visible - tN = ndFloat32(0.0f); - // recompute sc for this edge - if (-d < ndFloat32(0.0f)) - { - sN = ndFloat32(0.0f); - } - 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) < ndFloat32(0.0f)) - { - sN = ndFloat32(0.0f); - } - else if ((-d + b) > a) - { - sN = sD; - } - else - { - sN = (-d + b); - sD = a; - } - } - - // finally do the division to get sc and tc - ndFloat32 sc = (ndAbs(sN) < ndFloat32(1.0e-8f) ? ndFloat32(0.0f) : sN / sD); - ndFloat32 tc = (ndAbs(tN) < ndFloat32(1.0e-8f) ? ndFloat32(0.0f) : tN / tD); - - ndAssert(u.m_w == ndFloat32(0.0f)); - ndAssert(v.m_w == ndFloat32(0.0f)); - return ndRay(m_p0 + u.Scale(sc), ray_q0 + v.Scale(tc)); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastRay.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastRay.h deleted file mode 100644 index fbf93250fd..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastRay.h +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_FAST_RAY_H__ -#define __ND_FAST_RAY_H__ - -#include "ndCoreStdafx.h" -#include "ndDebug.h" -#include "ndVector.h" -#include "ndClassAlloc.h" - -D_MSV_NEWTON_ALIGN_32 -class ndRay: public ndClassAlloc -{ - public: - ndRay() - :ndClassAlloc() - { - } - - ndRay(const ndVector& l0, const ndVector& l1) - :ndClassAlloc() - ,m_p0(l0 & ndVector::m_triplexMask) - ,m_p1(l1 & ndVector::m_triplexMask) - { - } - - const ndVector m_p0; - const ndVector m_p1; -} D_GCC_NEWTON_ALIGN_32; - - -D_MSV_NEWTON_ALIGN_32 -class ndFastRay: public ndRay -{ - public: - ndFastRay(const ndVector& l0, const ndVector& l1); - - ndInt32 BoxTest(const ndVector& minBox, const ndVector& maxBox) const; - ndFloat32 BoxIntersect(const ndVector& minBox, const ndVector& maxBox) const; - - ndRay PointDistance(const ndVector& point) const; - D_CORE_API ndRay RayDistance(const ndVector& ray_p0, const ndVector& ray_p1) const; - D_CORE_API ndFloat32 PolygonIntersect(const ndVector& normal, ndFloat32 maxT, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount) const; - - const ndVector m_diff; - ndVector m_dpInv; - ndVector m_minT; - ndVector m_maxT; - ndVector m_unitDir; - ndVector m_isParallel; -} D_GCC_NEWTON_ALIGN_32 ; - -inline ndFastRay::ndFastRay(const ndVector& l0, const ndVector& l1) - :ndRay(l0, l1) - ,m_diff(m_p1 - m_p0) - ,m_minT(ndFloat32(0.0f)) - ,m_maxT(ndFloat32(1.0f)) -{ - ndAssert(m_p0.m_w == ndFloat32(0.0f)); - ndAssert(m_p1.m_w == ndFloat32(0.0f)); - ndAssert(m_diff.m_w == ndFloat32(0.0f)); - - ndAssert(m_diff.DotProduct(m_diff).GetScalar() > ndFloat32(0.0f)); - m_isParallel = (m_diff.Abs() < ndVector(1.0e-8f)); - m_dpInv = m_diff.Select(ndVector(ndFloat32(1.0e-20f)), m_isParallel).Reciproc() & ndVector::m_triplexMask; - m_unitDir = m_diff.Normalize(); -} - -inline ndRay ndFastRay::PointDistance(const ndVector& point) const -{ - //dBigVector dp(ray_p1 - ray_p0); - //ndAssert(dp.m_w == ndFloat32(0.0f)); - ndFloat32 t = ndClamp(m_diff.DotProduct(point - m_p0).GetScalar() / m_diff.DotProduct(m_diff).GetScalar(), ndFloat32(0.0f), ndFloat32(1.0f)); - return ndRay (m_p0 + m_diff.Scale(t), point); -} - -inline ndInt32 ndFastRay::BoxTest(const ndVector& minBox, const ndVector& maxBox) const -{ -#if 1 - ndVector test(((m_p0 <= minBox) | (m_p0 >= maxBox)) & m_isParallel); - if (test.GetSignMask() & 0x07) - { - return 0; - } - - ndVector tt0(m_dpInv * (minBox - m_p0)); - ndVector tt1(m_dpInv * (maxBox - m_p0)); - - ndVector t0(m_minT.GetMax(tt0.GetMin(tt1))); - ndVector t1(m_maxT.GetMin(tt0.GetMax(tt1))); - t0 = t0.GetMax(t0.ShiftTripleRight()); - t1 = t1.GetMin(t1.ShiftTripleRight()); - t0 = t0.GetMax(t0.ShiftTripleRight()); - t1 = t1.GetMin(t1.ShiftTripleRight()); - return ((t0 < t1).GetSignMask() & 1); - -#else - - ndFloat32 tmin = 0.0f; - ndFloat32 tmax = 1.0f; - - for (ndInt32 i = 0; i < 3; ++i) - { - if (m_isParallel[i]) - { - if (m_p0[i] <= minBox[i] || m_p0[i] >= maxBox[i]) - { - return 0; - } - } - else - { - ndFloat32 t1 = (minBox[i] - m_p0[i]) * m_dpInv[i]; - ndFloat32 t2 = (maxBox[i] - m_p0[i]) * m_dpInv[i]; - - if (t1 > t2) - { - ndSwap(t1, t2); - } - if (t1 > tmin) - { - tmin = t1; - } - if (t2 < tmax) - { - tmax = t2; - } - if (tmin > tmax) - { - return 0; - } - } - } - return 0x1; -#endif -} - -inline ndFloat32 ndFastRay::BoxIntersect(const ndVector& minBox, const ndVector& maxBox) const -{ - ndVector test(((m_p0 <= minBox) | (m_p0 >= maxBox)) & m_isParallel); - if (test.GetSignMask() & 0x07) - { - return ndFloat32(1.2f); - } - ndVector tt0(m_dpInv * (minBox - m_p0)); - ndVector tt1(m_dpInv * (maxBox - m_p0)); - ndVector t0(m_minT.GetMax(tt0.GetMin(tt1))); - ndVector t1(m_maxT.GetMin(tt0.GetMax(tt1))); - t0 = t0.GetMax(t0.ShiftTripleRight()); - t1 = t1.GetMin(t1.ShiftTripleRight()); - t0 = t0.GetMax(t0.ShiftTripleRight()); - t1 = t1.GetMin(t1.ShiftTripleRight()); - ndVector mask(t0 < t1); - ndVector maxDist(ndFloat32(1.2f)); - t0 = maxDist.Select(t0, mask); - ndAssert((mask.GetSignMask() & 1) == (t0.m_x < ndFloat32(1.0f))); - return t0.GetScalar(); -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFixSizeArray.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFixSizeArray.h deleted file mode 100644 index b5483ce9e9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFixSizeArray.h +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_FIX_SIZE_ARRAY_H__ -#define __ND_FIX_SIZE_ARRAY_H__ - -#include "ndCoreStdafx.h" - -template -class ndFixSizeArray: public ndClassAlloc -{ - public: - ndFixSizeArray(); - - ndInt32 GetCount() const; - void SetCount(ndInt32 count); - - ndInt32 GetCapacity() const; - - T& operator[] (ndInt32 i); - const T& operator[] (ndInt32 i) const; - - T Pop(); - void PushBack(const T& element); - - T m_array[maxSize]; - ndInt32 m_count; -}; - -template -ndFixSizeArray::ndFixSizeArray() - :ndClassAlloc() - ,m_count(0) -{ -} - -template -ndInt32 ndFixSizeArray::GetCapacity() const -{ - return maxSize; -} - -template -ndInt32 ndFixSizeArray::GetCount() const -{ - return m_count; -} - -template -void ndFixSizeArray::SetCount(ndInt32 count) -{ - m_count = (count < 0) ? 0 : ((count > maxSize) ? maxSize : count); -} - -template -T& ndFixSizeArray::operator[] (ndInt32 i) -{ - ndAssert(i >= 0); - ndAssert(i < maxSize); - return m_array[i]; -} - -template -const T& ndFixSizeArray::operator[] (ndInt32 i) const -{ - ndAssert(i >= 0); - ndAssert(i < maxSize); - return m_array[i]; -} - -template -T ndFixSizeArray::Pop() -{ - ndAssert(m_count >= 1); - m_count--; - return (*this)[m_count]; -} - -template -void ndFixSizeArray::PushBack(const T& element) -{ - ndAssert(m_count <= maxSize); - (*this)[m_count] = element; - m_count++; -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGeneralMatrix.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGeneralMatrix.h deleted file mode 100644 index 72d3891b0e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGeneralMatrix.h +++ /dev/null @@ -1,1285 +0,0 @@ - -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_GENERAL_MATRIX_H__ -#define __ND_GENERAL_MATRIX_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndGeneralVector.h" - -#define D_LCP_MAX_VALUE ndFloat32 (1.0e15f) - -//************************************************************* -// -// generic linear algebra functions -// -//************************************************************* -template -void ndMatrixTimeVector(ndInt32 size, const T* const matrix, const T* const v, T* const out) -{ - ndInt32 stride = 0; - for (ndInt32 i = 0; i < size; ++i) - { - const T* const row = &matrix[stride]; - out[i] = ndDotProduct(size, row, v); - stride += size; - } -} - -template -void ndMatrixTimeMatrix(ndInt32 size, const T* const matrixA, const T* const matrixB, T* const out) -{ - for (ndInt32 i = 0; i < size; ++i) - { - const T* const rowA = &matrixA[i * size]; - T* const rowOut = &out[i * size]; - for (ndInt32 j = 0; j < size; ++j) - { - T acc = T(0.0f); - for (ndInt32 k = 0; k < size; ++k) - { - acc += rowA[k] * matrixB[k * size + j]; - } - rowOut[j] = acc; - } - } -} - -template -void ndCovarianceMatrix(ndInt32 size, T* const matrix, const T* const vectorA, const T* const vectorB) -{ - ndInt32 stride = 0; - for (ndInt32 i = 0; i < size; ++i) - { - T scale(vectorA[i]); - T* const row = &matrix[stride]; - for (ndInt32 j = 0; j < size; ++j) - { - row[j] = scale * vectorB[j]; - } - stride += size; - } -} - -template -bool ndCholeskyFactorizationAddRow(ndInt32 stride, ndInt32 n, T* const matrix, T* const invDiagonalOut) -{ - T* const rowN = &matrix[stride * n]; - - ndInt32 base = 0; - for (ndInt32 j = 0; j < n; ++j) - { - T s(0.0f); - T* const rowJ = &matrix[base]; - for (ndInt32 k = 0; k < j; ++k) - { - s += rowN[k] * rowJ[k]; - } - rowJ[n] = T(0.0f); - rowN[j] = invDiagonalOut[j] * (rowN[j] - s); - base += stride; - } - - T s(0.0f); - const T* const rowJ = &matrix[base]; - for (ndInt32 k = 0; k < n; ++k) - { - s += rowN[k] * rowJ[k]; - } - - T diag = rowN[n] - s; -#ifdef D_NEWTON_USE_DOUBLE - if (diag < T(1.0e-12f)) -#else - if (diag < T(1.0e-6f)) -#endif - { - return false; - } - - rowN[n] = T(sqrt(diag)); - invDiagonalOut[n] = T(1.0f) / rowN[n]; - return true; -} - -template -bool ndCholeskyFactorization(ndInt32 size, ndInt32 stride, T* const psdMatrix) -{ - ndAssert(size); - bool state = true; - T* const invDiagonal = ndAlloca(T, size); - - ndAssert(psdMatrix[0] > T(0.0f)); - psdMatrix[0] = T(sqrt(psdMatrix[0])); - invDiagonal[0] = T(1.0f) / psdMatrix[0]; - for (ndInt32 i = 1; (i < size) && state; ++i) - { - state = state && ndCholeskyFactorizationAddRow(stride, i, psdMatrix, invDiagonal); - } - return state; -} - -template -bool ndTestPSDmatrix(ndInt32 size, ndInt32 stride, T* const matrix) -{ - ndInt32 row = 0; - T* const copy = ndAlloca(T, size * size); - for (ndInt32 i = 0; i < size; ++i) - { - ndMemCpy(©[i * size], &matrix[row], size); - row += stride; - } - return ndCholeskyFactorization(size, size, copy); -} - -template -void ndCholeskyApplyRegularizer (ndInt32 size, ndInt32 stride, T* const psdMatrix, T* const regularizer) -{ - bool isPsdMatrix = false; - ndFloat32* const lowerTriangule = ndAlloca(ndFloat32, stride * stride); - do - { - ndMemCpy(lowerTriangule, psdMatrix, stride * stride); - isPsdMatrix = ndCholeskyFactorization(size, stride, lowerTriangule); - if (!isPsdMatrix) - { - for (ndInt32 i = 0; i < size; ++i) - { - regularizer[i] *= ndFloat32(4.0f); - psdMatrix[i * stride + i] += regularizer[i]; - } - } - } while (!isPsdMatrix); -} - -template -void ndSolveCholesky(ndInt32 size, ndInt32 stride, const T* const choleskyMatrix, T* const x, const T* const b) -{ - ndInt32 rowStart = 0; - for (ndInt32 i = 0; i < size; ++i) - { - T acc(0.0f); - const T* const row = &choleskyMatrix[rowStart]; - for (ndInt32 j = 0; j < i; ++j) - { - acc = acc + row[j] * x[j]; - } - x[i] = (b[i] - acc) / row[i]; - rowStart += stride; - } - - for (ndInt32 i = size - 1; i >= 0; i--) - { - T acc = 0.0f; - for (ndInt32 j = i + 1; j < size; ++j) - { - acc = acc + choleskyMatrix[stride * j + i] * x[j]; - } - x[i] = (x[i] - acc) / choleskyMatrix[stride * i + i]; - } -} - -template -void ndSolveCholesky(ndInt32 size, T* const choleskyMatrix, T* const x) -{ - ndSolveCholesky(size, size, choleskyMatrix, x); -} - -template -bool ndSolveGaussian(ndInt32 size, T* const matrix, T* const b) -{ - for (ndInt32 i = 0; i < size - 1; ++i) - { - const T* const rowI = &matrix[i * size]; - ndInt32 m = i; - T maxVal (ndAbs(rowI[i])); - for (ndInt32 j = i + 1; j < size - 1; ++j) - { - T val (ndAbs(matrix[size * j + i])); - if (val > maxVal) - { - m = j; - maxVal = val; - } - } - - if (maxVal < T(1.0e-12f)) - { - return false; - } - - if (m != i) - { - T* const rowK = &matrix[m * size]; - T* const rowJ = &matrix[i * size]; - for (ndInt32 j = 0; j < size; ++j) - { - ndSwap(rowK[j], rowJ[j]); - } - ndSwap(b[i], b[m]); - } - - T den = T(1.0f) / rowI[i]; - for (ndInt32 k = i + 1; k < size; ++k) - { - T* const rowK = &matrix[size * k]; - T factor(-rowK[i] * den); - for (ndInt32 j = i + 1; j < size; ++j) - { - rowK[j] += rowI[j] * factor; - } - rowK[i] = T(0.0f); - b[k] += b[i] * factor; - } - } - - for (ndInt32 i = size - 1; i >= 0; i--) - { - T acc(0); - T* const rowI = &matrix[i * size]; - for (ndInt32 j = i + 1; j < size; ++j) - { - acc = acc + rowI[j] * b[j]; - } - b[i] = (b[i] - acc) / rowI[i]; - } - return true; -} - -template -void ndEigenValues(const ndInt32 size, const ndInt32 stride, const T* const symmetricMatrix, T* const eigenValues) -{ - T* const offDiag = ndAlloca(T, size); - T* const matrix = ndAlloca(T, size * stride); - - ndMemCpy(matrix, symmetricMatrix, size * stride); - for (ndInt32 i = size - 1; i > 0; i--) - { - T h(0.0f); - T* const rowI = &matrix[i * stride]; - - if (i > 1) - { - T scale(0.0f); - for (ndInt32 k = 0; k < i; ++k) - { - scale += ndAbs(rowI[k]); - } - - if (scale == T(0.0f)) - { - offDiag[i] = rowI[i - 1]; - } - else - { - for (ndInt32 k = 0; k < i; ++k) - { - rowI[k] /= scale; - h += rowI[k] * rowI[k]; - } - - T f(rowI[i - 1]); - T g((f >= T(0.0f) ? -T(sqrt(h)) : T(sqrt(h)))); - offDiag[i] = scale * g; - h -= f * g; - rowI[i - 1] = f - g; - f = T(0.0f); - - for (ndInt32 j = 0; j < i; ++j) - { - g = T(0.0f); - const T* const rowJ = &matrix[j * stride]; - for (ndInt32 k = 0; k <= j; ++k) - { - g += rowJ[k] * rowI[k]; - } - for (ndInt32 k = j + 1; k < i; ++k) - { - g += matrix[k * stride + j] * rowI[k]; - } - offDiag[j] = g / h; - f += offDiag[j] * rowI[j]; - } - - T hh(f / (h + h)); - for (ndInt32 j = 0; j < i; ++j) - { - T f1 (rowI[j]); - T g1(offDiag[j] - hh * f1); - offDiag[j] = g1; - T* const rowJ = &matrix[j * stride]; - for (ndInt32 k = 0; k <= j; ++k) - { - rowJ[k] -= (f1 * offDiag[k] + g1 * rowI[k]); - } - } - } - } - else - { - offDiag[i] = rowI[i - 1]; - } - eigenValues[i] = h; - } - - ndInt32 index = stride; - eigenValues[0] = matrix[0]; - for (ndInt32 i = 1; i < size; ++i) - { - eigenValues[i] = matrix[index + i]; - offDiag[i - 1] = offDiag[i]; - index += stride; - } - - for (ndInt32 i = 0; i < size; ++i) - { - ndInt32 j; - ndInt32 iter = 0; - do - { - for (j = i; j < size - 1; ++j) - { - T dd(ndAbs(eigenValues[j]) + ndAbs(eigenValues[j + 1])); - if (ndAbs(offDiag[j]) <= (T(1.e-6f) * dd)) - { - break; - } - } - - if (j != i) - { - iter++; - if (iter == 10) - { - ndAssert(0); - return; - } - - T g((eigenValues[i + 1] - eigenValues[i]) / (T(2.0f) * offDiag[i])); - T r(ndPythag(g, T(1.0f))); - g = eigenValues[j] - eigenValues[i] + offDiag[i] / (g + ndSign(r, g)); - T s(1.0f); - T c(1.0f); - T p(0.0f); - - ndInt32 k; - for (k = j - 1; k >= i; k--) - { - T f(s * offDiag[k]); - T b(c * offDiag[k]); - T d(ndPythag(f, g)); - offDiag[k + 1] = d; - if (d == T(0.0f)) - { - eigenValues[k + 1] -= p; - offDiag[j] = T(0.0f); - break; - } - s = f / d; - c = g / d; - g = eigenValues[k + 1] - p; - d = (eigenValues[k] - g) * s + T(2.0f) * c * b; - p = s * d; - eigenValues[k + 1] = g + p; - g = c * d - b; - } - - if (r == T(0.0f) && k >= i) - { - continue; - } - eigenValues[i] -= p; - offDiag[i] = g; - offDiag[j] = T(0.0f); - } - } while (j != i); - } -} - -template -T ndConditionNumber(const ndInt32 size, const ndInt32 stride, const T* const choleskyMatrix) -{ - T* const eigenValues = ndAlloca(T, size); - ndEigenValues(size, stride, choleskyMatrix, eigenValues); - - T minVal = T(1.0e20f); - T maxVal = T(-1.0e20f); - for (ndInt32 i = 0; i < size; ++i) - { - minVal = ndMin(minVal, eigenValues[i]); - maxVal = ndMax(maxVal, eigenValues[i]); - } - T condition = T(ndAbs(maxVal) / ndAbs(minVal)); - return condition; -} - -// solve a general Linear complementary program (LCP) -// A * x = b + r -// subjected to constraints -// x(i) = low(i), if r(i) >= 0 -// x(i) = high(i), if r(i) <= 0 -// low(i) <= x(i) <= high(i), if r(i) == 0 -// -// return true is the system has a solution. -// in return -// x is the solution, -// r is return in vector b -// note: although the system is called LCP, the solver is far more general than a strict LCP -// to solve a strict LCP, set the following -// low(i) = 0 -// high(i) = infinity. -// this the same as enforcing the constraint: x(i) * r(i) = 0 -template -void ndGaussSeidelLcpSor(const ndInt32 size, const T* const matrix, T* const x, const T* const b, const T* const low, const T* const high, T tol2, ndInt32 maxIterCount, ndInt16* const clipped, T sor) -{ - const T* const me = matrix; - T* const invDiag1 = ndAlloca(T, size); - - ndInt32 stride = 0; - for (ndInt32 i = 0; i < size; ++i) - { - x[i] = ndClamp(T(0.0f), low[i], high[i]); - invDiag1[i] = T(1.0f) / me[stride + i]; - stride += size; - } - - T tolerance(tol2 * 2.0f); - const T* const invDiag = invDiag1; -#ifdef _DEBUG - ndInt32 passes = 0; -#endif - for (ndInt32 i = 0; (i < maxIterCount) && (tolerance > tol2); ++i) - { - ndInt32 base = 0; - tolerance = T(0.0f); -#ifdef _DEBUG - passes++; -#endif - for (ndInt32 j = 0; j < size; ++j) - { - const T* const row = &me[base]; - T r(b[j] - ndDotProduct(size, row, x)); - T f((r + row[j] * x[j]) * invDiag[j]); - if (f > high[j]) - { - x[j] = high[j]; - clipped[j] = 1; - } - else if (f < low[j]) - { - x[j] = low[j]; - clipped[j] = 1; - } - else - { - clipped[j] = 0; - tolerance += r * r; - x[j] = x[j] + (f - x[j]) * sor; - } - base += size; - } - } -} - -template -void ndGaussSeidelLcpSor(const ndInt32 size, const ndInt32 stride, const T* const matrix, T* const x, const T* const b, const ndInt32* const normalIndex, const T* const low, const T* const high, T tol2, ndInt32 maxIterCount, T sor) -{ - const T* const me = matrix; - T* const invDiag1 = ndAlloca(T, size); - T* const u = ndAlloca(T, size + 1); - ndInt32* const index = ndAlloca(ndInt32, size); - - u[size] = T(1.0f); - ndInt32 rowStart = 0; - for (ndInt32 j = 0; j < size; ++j) - { - u[j] = x[j]; - index[j] = normalIndex[j] ? j + normalIndex[j] : size; - } - - for (ndInt32 j = 0; j < size; ++j) - { - const T val = u[index[j]]; - const T l = low[j] * val; - const T h = high[j] * val; - u[j] = ndClamp(u[j], l, h); - invDiag1[j] = T(1.0f) / me[rowStart + j]; - rowStart += stride; - } - - T tolerance(tol2 * 2.0f); - const T* const invDiag = invDiag1; - const ndInt32 maxCount = ndMax(8, size); - for (ndInt32 i = 0; (i < maxCount) && (tolerance > tol2); ++i) - { - ndInt32 base = 0; - tolerance = T(0.0f); - for (ndInt32 j = 0; j < size; ++j) - { - const T* const row = &me[base]; - T r(b[j] - ndDotProduct(size, row, u)); - T f((r + row[j] * u[j]) * invDiag[j]); - - const T val = u[index[j]]; - const T l = low[j] * val; - const T h = high[j] * val; - if (f > h) - { - u[j] = h; - } - else if (f < l) - { - u[j] = l; - } - else - { - tolerance += r * r; - u[j] = f; - } - base += stride; - } - } - -#ifdef _DEBUG - ndInt32 passes = 0; -#endif - for (ndInt32 i = 0; (i < maxIterCount) && (tolerance > tol2); ++i) - { - ndInt32 base = 0; - tolerance = T(0.0f); -#ifdef _DEBUG - passes++; -#endif - for (ndInt32 j = 0; j < size; ++j) - { - const T* const row = &me[base]; - T r(b[j] - ndDotProduct(size, row, u)); - T f((r + row[j] * u[j]) * invDiag[j]); - f = u[j] + (f - u[j]) * sor; - - const T val = u[index[j]]; - const T l = low[j] * val; - const T h = high[j] * val; - if (f > h) - { - u[j] = h; - } - else if (f < l) - { - u[j] = l; - } - else - { - tolerance += r * r; - u[j] = f; - } - base += stride; - } - } - - for (ndInt32 j = 0; j < size; ++j) - { - x[j] = u[j]; - } -} - -// solve a general Linear complementary program (LCP) -// A * x = b + r -// subjected to constraints -// x(i) = low(i), if r(i) >= 0 -// x(i) = high(i), if r(i) <= 0 -// low(i) <= x(i) <= high(i), if r(i) == 0 -// -// return true is the system has a solution. -// in return -// x is the solution, -// r is return in vector b -// note: although the system is called LCP, the solver is far more general than a strict LCP -// to solve a strict LCP, set the following -// low(i) = 0 -// high(i) = infinity. -// this the same as enforcing the constraint: x(i) * r(i) = 0 -template -void ndGaussSeidelLCP(const ndInt32 size, const T* const matrix, T* const x, const T* const b, const T* const low, const T* const high, T sor = T(1.2f)) -{ - ndInt16* const clipped = ndAlloca(ndInt16, size); - ndGaussSeidelLcpSor(size, matrix, x, b, low, high, T(1.0e-3f), size * size, clipped, sor); -} - -template -void ndPermuteRows(ndInt32 size, ndInt32 i, ndInt32 j, T* const matrix, T* const choleskyMatrix, T* const x, T* const r, T* const low, T* const high, ndInt16* const permute) -{ - if (i != j) - { - T* const A = &matrix[size * i]; - T* const B = &matrix[size * j]; - T* const invA = &choleskyMatrix[size * i]; - T* const invB = &choleskyMatrix[size * j]; - for (ndInt32 k = 0; k < size; ++k) - { - ndSwap(A[k], B[k]); - ndSwap(invA[k], invB[k]); - } - - ndInt32 stride = 0; - for (ndInt32 k = 0; k < size; ++k) - { - ndSwap(matrix[stride + i], matrix[stride + j]); - stride += size; - } - - ndSwap(x[i], x[j]); - ndSwap(r[i], r[j]); - ndSwap(low[i], low[j]); - ndSwap(high[i], high[j]); - ndSwap(permute[i], permute[j]); - } -} - -template -void ndCalculateDelta_x(ndInt32 size, ndInt32 n, const T* const matrix, const T* const choleskyMatrix, T* const delta_x) -{ - const T* const row = &matrix[size * n]; - for (ndInt32 i = 0; i < n; ++i) - { - delta_x[i] = -row[i]; - } - ndSolveCholesky(size, n, choleskyMatrix, delta_x, delta_x); - delta_x[n] = T(1.0f); -} - -// calculate delta_r = A * delta_x -template -void ndCalculateDelta_r(ndInt32 size, ndInt32 n, const T* const matrix, const T* const delta_x, T* const delta_r) -{ - ndInt32 stride = n * size; - const ndInt32 size1 = n + 1; - for (ndInt32 i = n; i < size; ++i) - { - delta_r[i] = ndDotProduct(size1, &matrix[stride], delta_x); - stride += size; - } -} - -template -void ndHouseholderReflection(ndInt32 size, ndInt32 row, ndInt32 colum, T* const choleskyMatrix, T* const tmp, T* const reflection) -{ - ndAssert(row <= colum); - if (row < colum) - { - for (ndInt32 i = row; i <= colum; ++i) - { - T* const rowI = &choleskyMatrix[size * i]; - T mag2(0.0f); - for (ndInt32 j = i + 1; j <= colum; ++j) - { - mag2 += rowI[j] * rowI[j]; - reflection[j] = rowI[j]; - } - if (mag2 > T(1.0e-14f)) - { - reflection[i] = rowI[i] + ndSign(rowI[i]) * T(sqrt(mag2 + rowI[i] * rowI[i])); - - const T vMag2(mag2 + reflection[i] * reflection[i]); - const T den = T(2.0f) / vMag2; - for (ndInt32 j = i; j < size; ++j) - { - T acc(0.0f); - T* const rowJ = &choleskyMatrix[size * j]; - for (ndInt32 k = i; k <= colum; ++k) { - acc += rowJ[k] * reflection[k]; - } - tmp[j] = acc; - } - - for (ndInt32 j = i + 1; j < size; ++j) - { - rowI[j] = T(0.0f); - T* const rowJ = &choleskyMatrix[size * j]; - const T a = tmp[j] * den; - for (ndInt32 k = i; k <= colum; ++k) - { - rowJ[k] -= a * reflection[k]; - } - } - rowI[i] -= tmp[i] * reflection[i] * den; - } - - if (rowI[i] < T(0.0f)) - { - for (ndInt32 k = i; k < size; ++k) - { - choleskyMatrix[size * k + i] = -choleskyMatrix[size * k + i]; - } - } - } - - for (ndInt32 i = row; i < size; ++i) - { - choleskyMatrix[size * i + i] = ndMax(choleskyMatrix[size * i + i], T(1.0e-6f)); - } - } -} - -template -void ndCholeskyUpdate(ndInt32 size, ndInt32 row, ndInt32 colum, T* const choleskyMatrix, T* const tmp, T* const reflexion, const T* const psdMatrix) -{ - const ndInt32 n0 = colum - row; - const ndInt32 n1 = n0 + 1; - const ndInt32 choleskyCost = size * size * size / 3; - const ndInt32 householdCost = n0 * (n0 + 1) / 2 + n1 * (n1 + 1) * (2 * (2 * n1 + 1) - 3 + 3 * (size - colum - 1)) / 6 - 1; - - if (householdCost < choleskyCost) - { - ndHouseholderReflection(size, row, colum, choleskyMatrix, tmp, reflexion); - } - else - { - ndMemCpy(choleskyMatrix, psdMatrix, size * size); - ndCholeskyFactorization(size, choleskyMatrix); - } - -//#if _DEBUG -#if 0 - T* const psdMatrixCopy = dAlloca(T, size * size); - ndMemCpy(psdMatrixCopy, psdMatrix, size * size); - dCholeskyFactorization(size, psdMatrixCopy); - - for (dInt32 i = 0; i < size; ++i) - { - for (dInt32 j = 0; j < size; ++j) - { - T err = psdMatrixCopy[i*size + j] - choleskyMatrix[i*size + j]; - dAssert(dAbs(err) < T(1.0e-4f)); - } - } -#endif -} - -// solve a general Linear complementary program (LCP) -// A * x = b + r -// subjected to constraints -// x(i) = low(i), if r(i) >= 0 -// x(i) = high(i), if r(i) <= 0 -// low(i) <= x(i) <= high(i), if r(i) == 0 -// -// return true is the system has a solution. -// in return -// x is the solution, -// r is return in vector b -// note: although the system is called LCP, the solver is far more general than a strict LCP -// to solve a strict LCP, set the following -// low(i) = 0 -// high(i) = infinity. -// this the same as enforcing the constraint: x(i) * r(i) = 0 -template -void ndSolveDantzigLcpLow(ndInt32 size, T* const symmetricMatrixPSD, T* const x, T* const b, T* const low, T* const high) -{ - T* const x0 = ndAlloca(T, size); - T* const r0 = ndAlloca(T, size); - T* const tmp0 = ndAlloca(T, size); - T* const tmp1 = ndAlloca(T, size); - T* const delta_r = ndAlloca(T, size); - T* const delta_x = ndAlloca(T, size); - T* const lowerTriangularMatrix = ndAlloca(T, size * size); - ndInt16* const permute = ndAlloca(ndInt16, size); - - for (ndInt32 i = 0; i < size; ++i) - { - permute[i] = ndInt16(i); - x0[i] = T(0.0f); - x[i] = ndMax (b[i] * b[i], T (1.0f)); - } - - for (ndInt32 n = size - 1, i = size - 1; i >= 0; i--) - { - if (x[i] > T(1.0)) - { - ndPermuteRows(size, n, i, symmetricMatrixPSD, lowerTriangularMatrix, x, b, low, high, permute); - n --; - } - } - - for (ndInt32 i = size - 1; (i >= 0) && (x[i] > T(1.0f)) ; i--) - { - ndInt32 min = i; - for (ndInt32 j = i - 1; (j >= 0) && (x[j] > T(1.0f)); j--) - { - if (x[j] > x[min]) - { - min = j; - } - } - if (min != i) - { - ndPermuteRows(size, i, min, symmetricMatrixPSD, lowerTriangularMatrix, x, b, low, high, permute); - } - } - - ndInt32 initialGuessCount = size; - while (x[initialGuessCount - 1] >= T(16.0f)) - { - initialGuessCount --; - } - ndMemCpy(lowerTriangularMatrix, symmetricMatrixPSD, size * size); - -#ifdef _DEBUG - bool valid = ndCholeskyFactorization(size, lowerTriangularMatrix); - ndAssert(valid); -#else - ndCholeskyFactorization(size, lowerTriangularMatrix); -#endif - for (ndInt32 j = 0; (j != -1) && initialGuessCount;) - { - ndSolveCholesky(size, initialGuessCount, lowerTriangularMatrix, x0, b); - - j = -1; - T alpha(1.0f); - T value(0.0f); - for (ndInt32 i = initialGuessCount - 1; i >= 0; i--) - { - T x1 = alpha * x0[i]; - if (x1 < low[i]) - { - j = i; - value = low[i]; - alpha = low[i] / x0[i]; - } - else if (x1 > high[i]) - { - j = i; - value = high[i]; - alpha = high[i] / x0[i]; - } - } - - if (j != -1) - { - x0[j] = value; - initialGuessCount--; - ndPermuteRows(size, j, initialGuessCount, symmetricMatrixPSD, lowerTriangularMatrix, x0, b, low, high, permute); - ndCholeskyUpdate(size, j, initialGuessCount, lowerTriangularMatrix, tmp0, tmp1, symmetricMatrixPSD); - } - } - - if (initialGuessCount == size) - { - for (ndInt32 i = 0; i < size; ++i) - { - ndInt32 j = permute[i]; - x[j] = x0[i]; - b[i] = T(0.0f); - } - return; - } - - ndInt32 clampedIndex = size; - ndInt32 index = initialGuessCount; - ndInt32 count = size - initialGuessCount; - ndInt32 stride = index * size; - - for (ndInt32 i = 0; i < size; ++i) - { - r0[i] = T(0.0f); - delta_x[i] = T(0.0f); - delta_r[i] = T(0.0f); - } - - for (ndInt32 i = index; i < size; ++i) - { - r0[i] = ndDotProduct(size, &symmetricMatrixPSD[stride], x0) - b[i]; - stride += size; - } - - - while (count) - { - bool loop = true; - - while (loop) - { - loop = false; - T clamp_x(0.0f); - ndInt32 swapIndex = -1; - - if (ndAbs(r0[index]) > T(1.0e-12f)) - { - ndCalculateDelta_x(size, index, symmetricMatrixPSD, lowerTriangularMatrix, delta_x); - ndCalculateDelta_r(size, index, symmetricMatrixPSD, delta_x, delta_r); - - ndAssert(delta_r[index] != T(0.0f)); - ndAssert(ndAbs(delta_x[index]) == T(1.0f)); - delta_r[index] = (delta_r[index] == T(0.0f)) ? T(1.0e-12f) : delta_r[index]; - - T scale = -r0[index] / delta_r[index]; - ndAssert(ndAbs(scale) >= T(0.0f)); - - for (ndInt32 i = 0; i <= index; ++i) - { - T x1 = x0[i] + scale * delta_x[i]; - if (x1 > high[i]) - { - swapIndex = i; - clamp_x = high[i]; - scale = (high[i] - x0[i]) / delta_x[i]; - } - else if (x1 < low[i]) - { - swapIndex = i; - clamp_x = low[i]; - scale = (low[i] - x0[i]) / delta_x[i]; - } - } - ndAssert(ndAbs(scale) >= T(0.0f)); - - for (ndInt32 i = clampedIndex; (i < size) && (scale > T(1.0e-12f)); ++i) - { - T r1 = r0[i] + scale * delta_r[i]; - if ((r1 * r0[i]) < T(0.0f)) - { - ndAssert(ndAbs(delta_r[i]) > T(0.0f)); - T s1 = -r0[i] / delta_r[i]; - ndAssert(ndAbs(s1) >= T(0.0f)); - ndAssert(ndAbs(s1) <= ndAbs(scale)); - if (ndAbs(s1) < ndAbs(scale)) - { - scale = s1; - swapIndex = i; - } - } - } - - if (ndAbs(scale) > T(1.0e-12f)) - { - for (ndInt32 i = 0; i < size; ++i) - { - x0[i] += scale * delta_x[i]; - r0[i] += scale * delta_r[i]; - } - } - } - - if (swapIndex == -1) - { - r0[index] = T(0.0f); - delta_r[index] = T(0.0f); - index++; - count--; - loop = false; - } - else if (swapIndex == index) - { - count--; - clampedIndex--; - x0[index] = clamp_x; - ndPermuteRows(size, index, clampedIndex, symmetricMatrixPSD, lowerTriangularMatrix, x0, r0, low, high, permute); - ndCholeskyUpdate(size, index, clampedIndex, lowerTriangularMatrix, tmp0, tmp1, symmetricMatrixPSD); - loop = count ? true : false; - } - else if (swapIndex > index) - { - loop = true; - r0[swapIndex] = T(0.0f); - ndAssert(swapIndex < size); - ndAssert(clampedIndex <= size); - if (swapIndex < clampedIndex) - { - count--; - clampedIndex--; - ndPermuteRows(size, clampedIndex, swapIndex, symmetricMatrixPSD, lowerTriangularMatrix, x0, r0, low, high, permute); - ndCholeskyUpdate(size, swapIndex, clampedIndex, lowerTriangularMatrix, tmp0, tmp1, symmetricMatrixPSD); - ndAssert(clampedIndex >= index); - } - else - { - count++; - ndAssert(clampedIndex < size); - ndPermuteRows(size, clampedIndex, swapIndex, symmetricMatrixPSD, lowerTriangularMatrix, x0, r0, low, high, permute); - ndCholeskyUpdate(size, clampedIndex, swapIndex, lowerTriangularMatrix, tmp0, tmp1, symmetricMatrixPSD); - clampedIndex++; - ndAssert(clampedIndex <= size); - ndAssert(clampedIndex >= index); - } - } - else - { - ndAssert(index > 0); - x0[swapIndex] = clamp_x; - delta_x[index] = T(0.0f); - - ndAssert(swapIndex < index); - ndPermuteRows(size, swapIndex, index - 1, symmetricMatrixPSD, lowerTriangularMatrix, x0, r0, low, high, permute); - ndPermuteRows(size, index - 1, index, symmetricMatrixPSD, lowerTriangularMatrix, x0, r0, low, high, permute); - ndPermuteRows(size, clampedIndex - 1, index, symmetricMatrixPSD, lowerTriangularMatrix, x0, r0, low, high, permute); - ndCholeskyUpdate (size, swapIndex, clampedIndex - 1, lowerTriangularMatrix, tmp0, tmp1, symmetricMatrixPSD); - - clampedIndex--; - index--; - loop = true; - } - } - } - - for (ndInt32 i = 0; i < size; ++i) - { - ndInt32 j = permute[i]; - x[j] = x0[i]; - b[j] = r0[i]; - } -} - -/* -// solve a general Linear complementary program (LCP) -// A * x = b + r -// subjected to constraints -// x(i) = low(i), if r(i) >= 0 -// x(i) = high(i), if r(i) <= 0 -// low(i) <= x(i) <= high(i), if r(i) == 0 -// -// return true is the system has a solution. -// in return -// x is the solution, -// r is return in vector b -// note: although the system is called LCP, the solver is far more general than a strict LCP -// to solve a strict LCP, set the following -// low(i) = 0 -// high(i) = infinity. -// this the same as enforcing the constraint: x(i) * r(i) = 0 -template -bool ndSolveDantzigLCP(ndInt32 size, T* const symetricMatrix, T* const x, T* const b, T* const low, T* const high) -{ - T* const choleskyMatrix = ndAlloca(T, size * size); - dCheckAligment(choleskyMatrix); - - ndMemCpy (choleskyMatrix, symetricMatrix, size * size); - ndCholeskyFactorization(size, choleskyMatrix); - for (ndInt32 i = 0; i < size; ++i) - { - T* const row = &choleskyMatrix[i * size]; - for (ndInt32 j = i + 1; j < size; ++j) - { - row[j] = T(0.0f); - } - } - return ndSolveDantzigLCP(size, symetricMatrix, choleskyMatrix, x, b, low, high); -} -*/ - -// solve a general Linear complementary program (LCP) -// A * x = b + r -// subjected to constraints -// x(i) = low(i), if r(i) >= 0 -// x(i) = high(i), if r(i) <= 0 -// low(i) <= x(i) <= high(i), if r(i) == 0 -// -// return true is the system has a solution. -// in return -// x is the solution, -// b is zero -// note: although the system is called LCP, the solver is far more general than a strict LCP -// to solve a strict LCP, set the following -// low(i) = 0 -// high(i) = infinity. -// this is the same as enforcing the constraint: x(i) * r(i) = 0 -template -bool ndSolvePartitionDantzigLCP(ndInt32 size, T* const symmetricMatrixPSD , T* const x, T* const b, T* const low, T* const high) -{ - ndInt16* const permute = ndAlloca(ndInt16, size); - - for (ndInt32 i = 0; i < size; ++i) - { - x[i] = b[i]; - permute[i] = ndInt16(i); - } - - ndInt32 unboundedSize = size; - for (ndInt32 i = 0; i < unboundedSize; ++i) - { - if ((low[i] <= T(-D_LCP_MAX_VALUE)) && (high[i] >= T(D_LCP_MAX_VALUE))) - { - ndAssert(0); - //ndCholeskyFactorizationAddRow(size, i, symmetricMatrixPSD ); - } - else - { - ndInt32 j = unboundedSize - 1; - if (i != j) - { - T* const A = &symmetricMatrixPSD [size * i]; - T* const B = &symmetricMatrixPSD [size * j]; - for (ndInt32 k = 0; k < size; ++k) - { - ndSwap(A[k], B[k]); - } - - ndInt32 stride = 0; - for (ndInt32 k = 0; k < size; ++k) - { - ndSwap(symmetricMatrixPSD [stride + i], symmetricMatrixPSD [stride + j]); - stride += size; - } - ndSwap(x[i], x[j]); - ndSwap(b[i], b[j]); - ndSwap(low[i], low[j]); - ndSwap(high[i], high[j]); - ndSwap(permute[i], permute[j]); - } - - i--; - unboundedSize--; - } - } - - bool ret = false; - if (unboundedSize > 0) - { - ndSolveCholesky(size, unboundedSize, symmetricMatrixPSD , x); - ndInt32 base = unboundedSize * size; - for (ndInt32 i = unboundedSize; i < size; ++i) - { - b[i] -= ndDotProduct(unboundedSize, &symmetricMatrixPSD[base], x); - base += size; - } - - const ndInt32 boundedSize = size - unboundedSize; - T* const l = ndAlloca(T, boundedSize); - T* const h = ndAlloca(T, boundedSize); - T* const c = ndAlloca(T, boundedSize); - T* const u = ndAlloca(T, boundedSize); - T* const a11 = ndAlloca(T, boundedSize * boundedSize); - T* const a10 = ndAlloca(T, boundedSize * unboundedSize); - - for (ndInt32 i = 0; i < boundedSize; ++i) - { - T* const g = &a10[i * unboundedSize]; - const T* const row = &symmetricMatrixPSD [(unboundedSize + i) * size]; - for (ndInt32 j = 0; j < unboundedSize; ++j) - { - g[j] = -row[j]; - } - ndSolveCholesky(size, unboundedSize, symmetricMatrixPSD, g); - - T* const arow = &a11[i * boundedSize]; - const T* const row2 = &symmetricMatrixPSD[(unboundedSize + i) * size]; - arow[i] = row2[unboundedSize + i] + ndDotProduct(unboundedSize, g, row2); - for (ndInt32 j = i + 1; j < boundedSize; ++j) - { - const T* const row1 = &symmetricMatrixPSD [(unboundedSize + j) * size]; - T elem = row1[unboundedSize + i] + ndDotProduct(unboundedSize, g, row1); - arow[j] = elem; - a11[j * boundedSize + i] = elem; - } - u[i] = T(0.0f); - c[i] = b[i + unboundedSize]; - l[i] = low[i + unboundedSize]; - h[i] = high[i + unboundedSize]; - } - - if (ndSolveDantzigLCP(boundedSize, a11, u, c, l, h)) - { - for (ndInt32 i = 0; i < boundedSize; ++i) - { - const T s = u[i]; - x[unboundedSize + i] = s; - const T* const g = &a10[i * unboundedSize]; - for (ndInt32 j = 0; j < unboundedSize; ++j) - { - x[j] += g[j] * s; - } - } - ret = true; - } - } - else - { - for (ndInt32 i = 0; i < size; ++i) - { - x[i] = T(0.0f); - } - ret = ndSolveDantzigLCP(size, symmetricMatrixPSD, x, b, low, high); - } - - for (ndInt32 i = 0; i < size; ++i) - { - b[i] = x[i]; - } - for (ndInt32 i = 0; i < size; ++i) - { - ndInt32 j = permute[i]; - x[j] = b[i]; - b[i] = T(0.0f); - } - return ret; -} - -template -void ndSolveDantzigLCP(ndInt32 size, T* const symmetricMatrixPSD, T* const x, T* const b, T* const low, T* const high) -{ - T tol2 = T(0.25f * 0.25f); - ndInt32 passes = ndClamp(size, 12, 20); - T* const r = ndAlloca(T, size); - ndInt16* const clipped = ndAlloca(ndInt16, size); - - // find an approximation to the solution - ndGaussSeidelLcpSor(size, symmetricMatrixPSD, x, b, low, high, tol2, passes, clipped, T(1.3f)); - - T err2(0.0f); - ndInt32 stride = 0; - ndInt32 clippeCount = 0; - for (ndInt32 i = 0; i < size; ++i) - { - const T* const row = &symmetricMatrixPSD[stride]; - r[i] = b[i] - ndDotProduct(size, row, x); - clippeCount += clipped[i]; - err2 += clipped[i] ? T(0.0f) : r[i] * r[i]; - stride += size; - } - - if (err2 > tol2) - { - // check for small lcp - if ((clippeCount < 16) && ((clippeCount < 32) && (err2 < T(16.0f)))) - { - // small lcp can be solved with direct method - T* const x0 = ndAlloca(T, size); - for (ndInt32 i = 0; i < size; ++i) - { - low[i] -= x[i]; - high[i] -= x[i]; - } - ndSolveDantzigLcpLow(size, symmetricMatrixPSD, x0, r, low, high); - for (ndInt32 i = 0; i < size; ++i) - { - x[i] += x0[i]; - } - } - else - { - // larger lcp are too hard for direct method, see if we can get better approximation - ndGaussSeidelLcpSor(size, symmetricMatrixPSD, x, b, low, high, tol2, 20, clipped, T(1.3f)); - } - } -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGeneralVector.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGeneralVector.h deleted file mode 100644 index 0f9be2926b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGeneralVector.h +++ /dev/null @@ -1,204 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_GENERAL_VECTOR_H__ -#define __ND_GENERAL_VECTOR_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" - -template -T ndSQRH(const T num, const T den) -{ - T r(num / den); - return T(sqrt(T(1.0f) + r * r)); -} - -template -T ndPythag(const T a, const T b) -{ - T absa(ndAbs(a)); - T absb(ndAbs(b)); - return (absa > absb) ? (absa * ndSQRH(absb, absa)) : ((absb == T(0.0f) ? T(0.0f) : (absb * ndSQRH(absa, absb)))); -} - -template -T ndSign(const T a, const T b) -{ - return (b >= T(0.0f)) ? (a >= T(0.0f) ? a : -a) : (a >= T(0.0f) ? -a : a); -} - -// return dot product -template -T ndDotProduct(ndInt32 size, const T* const A, const T* const B) -{ - T val(0.0f); - for (ndInt32 i = 0; i < size; ++i) - { - val = val + A[i] * B[i]; - ndAssert(ndCheckFloat(val)); - } - return val; -} - -template -void ndScale(ndInt32 size, T* const X, T scale) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] *= scale; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndScaleSet(ndInt32 size, T* const X, const T* const A, T scale) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] = A[i] * scale; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndScaleAdd(ndInt32 size, T* const X, const T* const B, T C) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] += B[i] * C; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndScaleAdd(ndInt32 size, T* const X, const T* const A, const T* const B, T C) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] = A[i] + B[i] * C; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndAdd(ndInt32 size, T* const X, const T* const A) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] += A[i]; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndAdd(ndInt32 size, T* const X, const T* const A, const T* const B) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] = A[i] + B[i]; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndSub(ndInt32 size, T* const X, const T* const A) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] -= A[i]; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndSub(ndInt32 size, T* const X, const T* const A, const T* const B) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] = A[i] - B[i]; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndMul(ndInt32 size, T* const X, const T* const A) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] *= A[i]; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndMul(ndInt32 size, T* const X, const T* const A, const T* const B) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] = A[i] * B[i]; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndMulAdd(ndInt32 size, T* const X, const T* const B, const T* const C) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] += B[i] * C[i]; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndMulAdd(ndInt32 size, T* const X, const T* const A, const T* const B, const T* const C) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] = A[i] + B[i] * C[i]; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndMulSub(ndInt32 size, T* const X, const T* const B, const T* const C) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] -= B[i] * C[i]; - ndAssert(ndCheckFloat(X[i])); - } -} - -template -void ndMulSub(ndInt32 size, T* const X, const T* const A, const T* const B, const T* const C) -{ - for (ndInt32 i = 0; i < size; ++i) - { - X[i] = A[i] - B[i] * C[i]; - ndAssert(ndCheckFloat(X[i])); - } -} - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGoogol.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGoogol.cpp deleted file mode 100644 index 235d2161c7..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGoogol.cpp +++ /dev/null @@ -1,534 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndGoogol.h" - -ndGoogol ndGoogol::m_zero(0.0); -ndGoogol ndGoogol::m_one(1.0); -ndGoogol ndGoogol::m_two(2.0); -ndGoogol ndGoogol::m_three(3.0); -ndGoogol ndGoogol::m_half(0.5); - -ndGoogol::ndGoogol(void) - :m_sign(0) - ,m_exponent(0) -{ - ndMemSet(m_mantissa, ndUnsigned64(0), sizeof(m_mantissa) / sizeof(m_mantissa[0])); -} - -ndGoogol::ndGoogol(ndFloat64 value) - :m_sign(0) - ,m_exponent(0) -{ - ndInt32 exp; - ndFloat64 mantissa = fabs (frexp(value, &exp)); - - m_exponent = ndInt16 (exp); - m_sign = (value >= 0) ? 0 : 1; - - ndMemSet(m_mantissa, ndUnsigned64(0), sizeof(m_mantissa) / sizeof(m_mantissa[0])); - - m_mantissa[0] = ndUnsigned64 (ndFloat64 (ndUnsigned64(1)<<62) * mantissa); - ndAssert ((m_mantissa[0] & ndUnsigned64(1)<<63) == 0); -} - -void ndGoogol::CopySignedMantissa (ndUnsigned64* const mantissa) const -{ - ndMemCpy(mantissa, m_mantissa, sizeof(m_mantissa) / sizeof(m_mantissa[0])); - if (m_sign) - { - NegateMantissa (mantissa); - } -} - -ndGoogol::operator double() const -{ - ndFloat64 mantissa = (ndFloat64(1.0f) / ndFloat64 (ndUnsigned64(1)<<62)) * ndFloat64 (m_mantissa[0]); - mantissa = ldexp(mantissa, m_exponent) * (m_sign ? ndFloat64 (-1.0f) : ndFloat64 (1.0f)); - return mantissa; -} - -ndGoogol ndGoogol::operator+ (const ndGoogol &A) const -{ - ndGoogol tmp; - ndAssert (ndInt64 (m_mantissa[0]) >= 0); - ndAssert (ndInt64 (A.m_mantissa[0]) >= 0); - - if (m_mantissa[0] && A.m_mantissa[0]) - { - ndUnsigned64 mantissa0[ND_GOOGOL_SIZE]; - ndUnsigned64 mantissa1[ND_GOOGOL_SIZE]; - ndUnsigned64 mantissa[ND_GOOGOL_SIZE]; - - CopySignedMantissa (mantissa0); - A.CopySignedMantissa (mantissa1); - - ndInt32 exponetDiff = m_exponent - A.m_exponent; - ndInt32 exponent = m_exponent; - if (exponetDiff > 0) - { - ShiftRightMantissa (mantissa1, exponetDiff); - } - else if (exponetDiff < 0) - { - exponent = A.m_exponent; - ShiftRightMantissa (mantissa0, -exponetDiff); - } - - ndUnsigned64 carrier = 0; - for (ndInt32 i = ND_GOOGOL_SIZE - 1; i >= 0; i --) - { - ndUnsigned64 m0 = mantissa0[i]; - ndUnsigned64 m1 = mantissa1[i]; - mantissa[i] = m0 + m1 + carrier; - carrier = CheckCarrier (m0, m1) | CheckCarrier (m0 + m1, carrier); - } - - ndInt8 sign = 0; - if (ndInt64 (mantissa[0]) < 0) - { - sign = 1; - NegateMantissa (mantissa); - } - - ndInt32 bits = NormalizeMantissa (mantissa); - if (bits <= (-64 * ND_GOOGOL_SIZE)) - { - tmp.m_sign = 0; - tmp.m_exponent = 0; - } - else - { - tmp.m_sign = sign; - tmp.m_exponent = ndInt16 (exponent + bits); - } - - ndMemCpy(tmp.m_mantissa, mantissa, sizeof(m_mantissa) / sizeof(m_mantissa[0])); - } - else if (A.m_mantissa[0]) - { - tmp = A; - } - else - { - tmp = *this; - } - - ndAssert (ndInt64 (tmp.m_mantissa[0]) >= 0); - return tmp; -} - -ndGoogol ndGoogol::operator- (const ndGoogol &A) const -{ - ndGoogol tmp (A); - tmp.m_sign = !tmp.m_sign; - return *this + tmp; -} - -void ndGoogol::ScaleMantissa (ndUnsigned64* const dst, ndUnsigned64 scale) const -{ - ndUnsigned64 carrier = 0; - for (ndInt32 i = ND_GOOGOL_SIZE - 1; i >= 0; i --) - { - if (m_mantissa[i]) - { - ndUnsigned64 low; - ndUnsigned64 high; - ExtendeMultiply (scale, m_mantissa[i], high, low); - ndUnsigned64 acc = low + carrier; - carrier = CheckCarrier (low, carrier); - ndAssert (CheckCarrier (carrier, high) == 0); - carrier += high; - dst[i + 1] = acc; - } - else - { - dst[i + 1] = carrier; - carrier = 0; - } - - } - dst[0] = carrier; -} - -ndGoogol ndGoogol::operator* (const ndGoogol &A) const -{ - ndAssert (ndInt64 (m_mantissa[0]) >= 0); - ndAssert (ndInt64 (A.m_mantissa[0]) >= 0); - - if (m_mantissa[0] && A.m_mantissa[0]) - { - ndUnsigned64 mantissaAcc[ND_GOOGOL_SIZE * 2]; - ndMemSet(mantissaAcc, ndUnsigned64(0), sizeof(mantissaAcc)/ sizeof(mantissaAcc[0])); - for (ndInt32 i = ND_GOOGOL_SIZE - 1; i >= 0; i --) - { - ndUnsigned64 a = m_mantissa[i]; - if (a) - { - ndUnsigned64 mantissaScale[2 * ND_GOOGOL_SIZE]; - ndMemSet(mantissaScale, ndUnsigned64(0), sizeof(mantissaScale)/sizeof (mantissaScale[0])); - A.ScaleMantissa (&mantissaScale[i], a); - - ndUnsigned64 carrier = 0; - for (ndInt32 j = 0; j < 2 * ND_GOOGOL_SIZE; ++j) - { - const ndInt32 k = 2 * ND_GOOGOL_SIZE - 1 - j; - ndUnsigned64 m0 = mantissaAcc[k]; - ndUnsigned64 m1 = mantissaScale[k]; - mantissaAcc[k] = m0 + m1 + carrier; - carrier = CheckCarrier (m0, m1) | CheckCarrier (m0 + m1, carrier); - } - } - } - - ndUnsigned64 carrier = 0; - //ndInt32 bits = ndUnsigned64(LeadingZeros (mantissaAcc[0]) - 2); - ndInt32 bits = LeadingZeros (mantissaAcc[0]) - 2; - for (ndInt32 i = 0; i < 2 * ND_GOOGOL_SIZE; ++i) - { - const ndInt32 k = 2 * ND_GOOGOL_SIZE - 1 - i; - ndUnsigned64 a = mantissaAcc[k]; - mantissaAcc[k] = (a << ndUnsigned64(bits)) | carrier; - carrier = a >> ndUnsigned64(64 - bits); - } - - ndInt32 exp = m_exponent + A.m_exponent - (bits - 2); - - ndGoogol tmp; - tmp.m_sign = m_sign ^ A.m_sign; - tmp.m_exponent = ndInt16 (exp); - ndMemCpy(tmp.m_mantissa, mantissaAcc, sizeof(m_mantissa)/sizeof (m_mantissa[0])); - - return tmp; - } - return ndGoogol(0.0); -} - -ndGoogol ndGoogol::operator/ (const ndGoogol &A) const -{ - ndGoogol tmp (1.0 / A); - tmp = tmp * (m_two - A * tmp); - tmp = tmp * (m_two - A * tmp); - ndInt32 test = 0; - ndInt32 passes = 0; - do - { - passes ++; - ndGoogol tmp0 (tmp); - tmp = tmp * (m_two - A * tmp); - test = memcmp (&tmp0, &tmp, sizeof (ndGoogol)); - } while (test && (passes < (2 * ND_GOOGOL_SIZE))); - ndAssert (passes <= (2 * ND_GOOGOL_SIZE)); - return (*this) * tmp; -} - -ndGoogol ndGoogol::Abs () const -{ - ndGoogol tmp (*this); - tmp.m_sign = 0; - return tmp; -} - -ndGoogol ndGoogol::Floor () const -{ - if (m_exponent < 1) - { - return ndGoogol (0.0); - } - ndInt32 bits = m_exponent + 2; - ndInt32 start = 0; - while (bits >= 64) - { - bits -= 64; - start ++; - } - - ndGoogol tmp (*this); - for (ndInt32 i = ND_GOOGOL_SIZE - 1; i > start; i --) - { - tmp.m_mantissa[i] = 0; - } - // some compilers do no like this and I do not know why is that - //ndUnsigned64 mask = (-1LL) << (64 - bits); - ndUnsigned64 mask (~0ULL); - mask <<= (64 - bits); - tmp.m_mantissa[start] &= mask; - if (m_sign) - { - ndAssert (0); - } - - return tmp; -} - -ndGoogol ndGoogol::InvSqrt () const -{ - const ndGoogol& me = *this; - ndGoogol x (1.0f / sqrt (me)); - - ndInt32 test = 0; - ndInt32 passes = 0; - do - { - passes ++; - ndGoogol tmp (x); - x = m_half * x * (m_three - me * x * x); - test = memcmp (&x, &tmp, sizeof (ndGoogol)); - } while (test && (passes < (2 * ND_GOOGOL_SIZE))); - ndAssert (passes <= (2 * ND_GOOGOL_SIZE)); - return x; -} - -ndGoogol ndGoogol::Sqrt () const -{ - return *this * InvSqrt(); -} - -void ndGoogol::ToString (char* const string) const -{ - ndGoogol tmp (*this); - ndGoogol base (10.0); - while (ndFloat64 (tmp) > 1.0) - { - tmp = tmp/base; - } - - ndInt32 index = 0; - while (tmp.m_mantissa[0]) - { - tmp = tmp * base; - ndGoogol digit (tmp.Floor()); - tmp -= digit; - ndFloat64 val = digit; - string[index] = char (val) + '0'; - index ++; - } - string[index] = 0; -} - -void ndGoogol::NegateMantissa (ndUnsigned64* const mantissa) const -{ - ndUnsigned64 carrier = 1; - for (ndInt32 i = ND_GOOGOL_SIZE - 1; i >= 0; i --) - { - ndUnsigned64 a = ~mantissa[i] + carrier; - if (a) - { - carrier = 0; - } - mantissa[i] = a; - } -} - -void ndGoogol::ShiftRightMantissa (ndUnsigned64* const mantissa, ndInt32 bits) const -{ - ndUnsigned64 carrier = 0; - if (ndInt64 (mantissa[0]) < ndInt64 (0)) - { - carrier = ndUnsigned64 (-1); - } - - while (bits >= 64) - { - for (ndInt32 i = ND_GOOGOL_SIZE - 2; i >= 0; i --) - { - mantissa[i + 1] = mantissa[i]; - } - mantissa[0] = carrier; - bits -= 64; - } - - if (bits > 0) - { - carrier <<= (64 - bits); - for (ndInt32 i = 0; i < ND_GOOGOL_SIZE; ++i) - { - ndUnsigned64 a = mantissa[i]; - mantissa[i] = (a >> bits) | carrier; - carrier = a << (64 - bits); - } - } -} - -ndInt32 ndGoogol::LeadingZeros (ndUnsigned64 a) const -{ - #define dgCOUNTBIT(mask,add) \ - { \ - ndUnsigned64 test = a & mask; \ - n += test ? 0 : add; \ - a = test ? test : (a & ~mask); \ - } - - ndInt32 n = 0; - ndAssert (a); - dgCOUNTBIT (0xffffffff00000000LL, 32); - dgCOUNTBIT (0xffff0000ffff0000LL, 16); - dgCOUNTBIT (0xff00ff00ff00ff00LL, 8); - dgCOUNTBIT (0xf0f0f0f0f0f0f0f0LL, 4); - dgCOUNTBIT (0xccccccccccccccccLL, 2); - dgCOUNTBIT (0xaaaaaaaaaaaaaaaaLL, 1); - - return n; -} - -ndInt32 ndGoogol::NormalizeMantissa (ndUnsigned64* const mantissa) const -{ - ndAssert (ndInt64 (mantissa[0]) >= 0); - - ndInt32 bits = 0; - if(ndInt64 (mantissa[0] * 2) < 0) - { - bits = 1; - ShiftRightMantissa (mantissa, 1); - } - else - { - while (!mantissa[0] && bits > (-64 * ND_GOOGOL_SIZE)) - { - bits -= 64; - for (ndInt32 i = 1; i < ND_GOOGOL_SIZE; ++i) { - mantissa[i - 1] = mantissa[i]; - } - mantissa[ND_GOOGOL_SIZE - 1] = 0; - } - - if (bits > (-64 * ND_GOOGOL_SIZE)) - { - ndInt32 n = LeadingZeros (mantissa[0]) - 2; - if (n > 0) - { - ndAssert (n > 0); - ndUnsigned64 carrier = 0; - for (ndInt32 i = ND_GOOGOL_SIZE-1; i >= 0; i --) - { - ndUnsigned64 a = mantissa[i]; - mantissa[i] = (a << n) | carrier; - carrier = a >> (64 - n); - } - bits -= n; - } - else if (n < 0) - { - // this is very rare but it does happens, whee the leading zeros of the mantissa is an exact multiple of 64 - ndAssert (mantissa[0] & ndUnsigned64(3)<<62); - ndUnsigned64 carrier = 0; - ndInt32 shift = -n; - for (ndInt32 i = 0; i < ND_GOOGOL_SIZE; ++i) - { - ndUnsigned64 a = mantissa[i]; - mantissa[i] = (a >> shift) | carrier; - carrier = a << (64 - shift); - } - bits -= n; - } - } - } - return bits; -} - -ndUnsigned64 ndGoogol::CheckCarrier (ndUnsigned64 a, ndUnsigned64 b) const -{ - return ((ndUnsigned64 (-1) - b) < a) ? ndUnsigned64(1) : 0; -} - -void ndGoogol::ExtendeMultiply (ndUnsigned64 a, ndUnsigned64 b, ndUnsigned64& high, ndUnsigned64& low) const -{ - ndUnsigned64 bLow = b & 0xffffffff; - ndUnsigned64 bHigh = b >> 32; - ndUnsigned64 aLow = a & 0xffffffff; - ndUnsigned64 aHigh = a >> 32; - - ndUnsigned64 l = bLow * aLow; - - ndUnsigned64 c1 = bHigh * aLow; - ndUnsigned64 c2 = bLow * aHigh; - ndUnsigned64 m = c1 + c2; - ndUnsigned64 carrier = CheckCarrier (c1, c2) << 32; - - ndUnsigned64 h = bHigh * aHigh + carrier; - - ndUnsigned64 ml = m << 32; - ndUnsigned64 ll = l + ml; - ndUnsigned64 mh = (m >> 32) + CheckCarrier (l, ml); - ndAssert ((mh & ~0xffffffff) == 0); - - ndUnsigned64 hh = h + mh; - - low = ll; - high = hh; -} - -ndGoogol ndGoogol::operator+= (const ndGoogol &A) -{ - *this = *this + A; - return *this; -} - -ndGoogol ndGoogol::operator-= (const ndGoogol &A) -{ - *this = *this - A; - return *this; -} - -bool ndGoogol::operator> (const ndGoogol &A) const -{ - ndGoogol tmp (*this - A); - return ndFloat64(tmp) > 0.0; -} - -bool ndGoogol::operator>= (const ndGoogol &A) const -{ - ndGoogol tmp (*this - A); - return ndFloat64 (tmp) >= 0.0; -} - -bool ndGoogol::operator< (const ndGoogol &A) const -{ - ndGoogol tmp (*this - A); - return ndFloat64 (tmp) < 0.0; -} - -bool ndGoogol::operator<= (const ndGoogol &A) const -{ - ndGoogol tmp (*this - A); - return ndFloat64 (tmp) <= 0.0; -} - -bool ndGoogol::operator== (const ndGoogol &A) const -{ - ndGoogol tmp (*this - A); - return ndFloat64 (tmp) == 0.0; -} - -bool ndGoogol::operator!= (const ndGoogol &A) const -{ - ndGoogol tmp (*this - A); - return ndFloat64 (tmp) != 0.0; -} - -void ndGoogol::Trace () const -{ - ndAssert(0); - //dTrace (("%f ", ndFloat64 (*this))); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGoogol.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGoogol.h deleted file mode 100644 index a0b785847e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndGoogol.h +++ /dev/null @@ -1,141 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __NDGoogol__ -#define __NDGoogol__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndMemory.h" -#include "ndArray.h" -#include "ndVector.h" -#include "ndClassAlloc.h" -#include "ndTemplateVector.h" - - -//#define ND_GOOGOL_SIZE 16 -#define ND_GOOGOL_SIZE 4 - -class ndGoogol -{ - public: - D_OPERATOR_NEW_AND_DELETE - - ndGoogol(void); - ndGoogol(ndFloat64 value); - - operator double() const; - ndGoogol operator+ (const ndGoogol &A) const; - ndGoogol operator- (const ndGoogol &A) const; - ndGoogol operator* (const ndGoogol &A) const; - ndGoogol operator/ (const ndGoogol &A) const; - - ndGoogol operator+= (const ndGoogol &A); - ndGoogol operator-= (const ndGoogol &A); - - bool operator> (const ndGoogol &A) const; - bool operator>= (const ndGoogol &A) const; - bool operator< (const ndGoogol &A) const; - bool operator<= (const ndGoogol &A) const; - bool operator== (const ndGoogol &A) const; - bool operator!= (const ndGoogol &A) const; - - ndGoogol Abs () const; - ndGoogol Sqrt () const; - ndGoogol InvSqrt () const; - ndGoogol Floor () const; - - void Trace () const; - void ToString (char* const string) const; - - private: - void InitFloatFloat (ndFloat64 value); - void NegateMantissa (ndUnsigned64* const mantissa) const; - void CopySignedMantissa (ndUnsigned64* const mantissa) const; - ndInt32 NormalizeMantissa (ndUnsigned64* const mantissa) const; - ndUnsigned64 CheckCarrier (ndUnsigned64 a, ndUnsigned64 b) const; - void ShiftRightMantissa (ndUnsigned64* const mantissa, ndInt32 bits) const; - - ndInt32 LeadingZeros (ndUnsigned64 a) const; - void ExtendeMultiply (ndUnsigned64 a, ndUnsigned64 b, ndUnsigned64& high, ndUnsigned64& low) const; - void ScaleMantissa (ndUnsigned64* const out, ndUnsigned64 scale) const; - - ndInt32 m_sign; - ndInt32 m_exponent; - ndUnsigned64 m_mantissa[ND_GOOGOL_SIZE]; - - public: - D_CORE_API static ndGoogol m_zero; - D_CORE_API static ndGoogol m_one; - D_CORE_API static ndGoogol m_two; - D_CORE_API static ndGoogol m_three; - D_CORE_API static ndGoogol m_half; -}; - -class ndHugeVector: public ndTemplateVector -{ - public: - ndHugeVector () - :ndTemplateVector() - { - } - - ndHugeVector (const ndBigVector& a) - :ndTemplateVector(ndGoogol (a.m_x), ndGoogol (a.m_y), ndGoogol (a.m_z), ndGoogol (a.m_w)) - { - } - - ndHugeVector (const ndTemplateVector& a) - :ndTemplateVector(a) - { - } - - ndHugeVector (ndFloat64 x, ndFloat64 y, ndFloat64 z, ndFloat64 w) - :ndTemplateVector(x, y, z, w) - { - } - - ndHugeVector(const ndGoogol& x, const ndGoogol& y, const ndGoogol& z, const ndGoogol& w) - :ndTemplateVector(x, y, z, w) - { - } - - ndGoogol EvaluePlane (const ndHugeVector& point) const - { - //return (point % (*this)) + m_w; - return DotProduct(point).GetScalar(); - } - -#ifdef _DEBUG - void Trace () const - { - m_x.Trace(); - m_y.Trace(); - m_z.Trace(); - m_w.Trace(); - ndAssert(0); -// dTrace (("\n")); - } -#endif -}; - - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndHeap.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndHeap.h deleted file mode 100644 index 5b851d31ef..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndHeap.h +++ /dev/null @@ -1,410 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -/**************************************************************************** -* -* Visual C++ 6.0 created by: Julio Jerez -* -****************************************************************************/ -#ifndef __ND_HEAP_H__ -#define __ND_HEAP_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndMemory.h" -#include "ndClassAlloc.h" - -//#define ND_HEAP_DEBUG_CHECK - -template -class ndHeap : public ndClassAlloc -{ - public: - ndHeap(ndInt32 maxElements); - ndHeap(const void * const buffer, ndInt32 sizeInBytes); - ~ndHeap(); - - void Flush(); - dKey MaxValue() const; - dKey Value(ndInt32 i = 0) const; - ndInt32 GetCount() const; - ndInt32 GetMaxCount() const; - const dItem& operator[] (ndInt32 i) const; - ndInt32 Find(dItem &obj); - ndInt32 Find(dKey key); - - void Pop(); - void Sort(); - void Remove(ndInt32 Index); - void Push(dItem &obj, dKey key); - bool SanityCheck(); - - protected: - struct ndRecord - { - ndRecord(dKey key, const dItem& obj) - :m_key(key) - ,m_obj(obj) - { - } - - dKey m_key; - dItem m_obj; - }; - - ndRecord* m_pool; - ndInt32 m_curCount; - ndInt32 m_maxCount; - bool m_bufferIsOwnned; -}; - -// ************************* -// -// implementation -// -// ************************* - -template -ndHeap::ndHeap(ndInt32 maxElements) - :ndClassAlloc() - ,m_pool((ndRecord *)ndMemory::Malloc(maxElements * sizeof(ndRecord))) - ,m_curCount(0) - ,m_maxCount(maxElements) - ,m_bufferIsOwnned(true) -{ - Flush(); -} - -template -ndHeap::ndHeap(const void * const buffer, ndInt32 sizeInBytes) - :ndClassAlloc() - ,m_pool((ndRecord *)buffer) - ,m_curCount(0) - ,m_maxCount(ndInt32(sizeInBytes / sizeof(ndRecord))) - ,m_bufferIsOwnned(false) -{ - Flush(); -} - -template -ndHeap::~ndHeap() -{ - if (m_bufferIsOwnned) - { - ndMemory::Free(m_pool); - } -} - -template -dKey ndHeap::Value(ndInt32 i) const -{ - return m_pool[i].m_key; -} - -template -ndInt32 ndHeap::GetCount() const -{ - return m_curCount; -} - -template -void ndHeap::Flush() -{ - m_curCount = 0; - -#ifdef _DEBUG - // ndHeap::m_pool[ndHeap::m_curCount].m_key = dKey (0); -#endif -} - -template -dKey ndHeap::MaxValue() const -{ - return m_pool[0].m_key; -} - -template -ndInt32 ndHeap::GetMaxCount() const -{ - return m_maxCount; -} - -template -ndInt32 ndHeap::Find(dItem &obj) -{ - // For now let perform a linear search - // this is efficient if the size of the heap is small - // ex: m_curCount < 32 - // this will be change to a binary search in the heap should the - // the size of the heap get larger than 32 - // ndAssert (m_curCount <= 32); - for (ndInt32 i = 0; i < m_curCount; ++i) - { - if (m_pool[i].obj == obj) - { - return i; - } - } - return -1; -} - -template -ndInt32 ndHeap::Find(dKey key) -{ - // ex: m_curCount < 32 - // this will be change to a binary search in the heap should the - // the size of the heap get larger than 32 - ndAssert(m_curCount <= 32); - for (ndInt32 i = 0; i < m_curCount; ++i) - { - if (m_pool[i].m_key == key) - { - return i; - } - } - return -1; -} - -template -const dItem& ndHeap::operator[] (ndInt32 i) const -{ - ndAssert(i <= m_curCount); - return m_pool[i].m_obj; -} - -template -bool ndHeap::SanityCheck() -{ - #ifdef ND_HEAP_DEBUG_CHECK - for (ndInt32 i = 0; i < m_curCount; ++i) - { - ndInt32 i1 = 2 * i + 1; - ndInt32 i2 = 2 * i + 2; - if ((i1 < m_curCount) && (ndHeap::m_pool[i].m_key < ndHeap::m_pool[i1].m_key)) - { - return false; - } - if ((i2 < m_curCount) && (ndHeap::m_pool[i].m_key < ndHeap::m_pool[i2].m_key)) - { - return false; - } - } - #endif - return true; -} - -template -void ndHeap::Push(dItem &obj, dKey key) -{ - ndHeap::m_curCount++; - - ndInt32 i = ndHeap::m_curCount; - for (ndInt32 j = 0; i; i = j) - { - j = i >> 1; - if (!j || (ndHeap::m_pool[j - 1].m_key > key)) - { - break; - } - ndHeap::m_pool[i - 1] = ndHeap::m_pool[j - 1]; - } - ndAssert(i); - ndHeap::m_pool[i - 1].m_key = key; - ndHeap::m_pool[i - 1].m_obj = obj; - - ndAssert(SanityCheck()); -} - -template -void ndHeap::Pop() -{ - Remove(0); -} - -template -void ndHeap::Remove(ndInt32 index) -{ - ndHeap::m_curCount--; - ndHeap::m_pool[index] = ndHeap::m_pool[ndHeap::m_curCount]; - while (index && ndHeap::m_pool[(index - 1) >> 1].m_key < ndHeap::m_pool[index].m_key) - { - ndSwap(ndHeap::m_pool[(index - 1) >> 1], ndHeap::m_pool[index]); - index = (index - 1) >> 1; - } - - while ((2 * index + 1) < ndHeap::m_curCount) - { - ndInt32 i0 = 2 * index + 1; - ndInt32 i1 = 2 * index + 2; - if (i1 < ndHeap::m_curCount) - { - i0 = (ndHeap::m_pool[i0].m_key > ndHeap::m_pool[i1].m_key) ? i0 : i1; - if (ndHeap::m_pool[i0].m_key <= ndHeap::m_pool[index].m_key) - { - break; - } - ndSwap(ndHeap::m_pool[i0], ndHeap::m_pool[index]); - index = i0; - } - else - { - if (ndHeap::m_pool[i0].m_key > ndHeap::m_pool[index].m_key) - { - ndSwap(ndHeap::m_pool[i0], ndHeap::m_pool[index]); - } - index = i0; - } - } - ndAssert(SanityCheck()); -} - -template -void ndHeap::Sort() -{ - ndInt32 count = ndHeap::m_curCount; - for (ndInt32 i = 1; i < count; ++i) - { - dKey key(ndHeap::m_pool[0].m_key); - dItem obj(ndHeap::m_pool[0].m_obj); - - Pop(); - - ndHeap::m_pool[ndHeap::m_curCount].m_key = key; - ndHeap::m_pool[ndHeap::m_curCount].m_obj = obj; - } - - ndHeap::m_curCount = count; - for (ndInt32 i = 0; i < count / 2; ++i) - { - dKey key(ndHeap::m_pool[i].m_key); - dItem obj(ndHeap::m_pool[i].m_obj); - - ndHeap::m_pool[i].m_key = ndHeap::m_pool[count - i - 1].m_key; - ndHeap::m_pool[i].m_obj = ndHeap::m_pool[count - i - 1].m_obj; - - ndHeap::m_pool[count - i - 1].m_key = key; - ndHeap::m_pool[count - i - 1].m_obj = obj; - } - ndAssert(SanityCheck()); -} - -// ***************************************** -// -// two typical instances of heaps, up and down. -// -// ***************************************** -template -class ndDownHeapCompare -{ - public: - ndDownHeapCompare(dKey key) - :m_key(key) - { - } - - bool operator> (const ndDownHeapCompare& key) const - { - return m_key > key.m_key; - } - - bool operator< (const ndDownHeapCompare& key) const - { - return m_key < key.m_key; - } - - bool operator<= (const ndDownHeapCompare& key) const - { - return m_key <= key.m_key; - } - - dKey m_key; -}; - -template -class ndDownHeap : public ndHeap> -{ - public: - ndDownHeap(ndInt32 maxElements) - :ndHeap>(maxElements) - { - } - - ndDownHeap(const void* const buffer, ndInt32 sizeInBytes) - :ndHeap>(buffer, sizeInBytes) - { - } - - dKey Value(ndInt32 i = 0) const - { - const ndDownHeapCompare key(ndHeap>::Value(i)); - return key.m_key; - } -}; - -template -class ndUpHeapCompare -{ - public: - ndUpHeapCompare(dKey key) - :m_key(key) - { - } - - bool operator> (const ndUpHeapCompare& key) const - { - return m_key < key.m_key; - } - - bool operator< (const ndUpHeapCompare& key) const - { - return m_key > key.m_key; - } - - bool operator<= (const ndUpHeapCompare& key) const - { - return m_key >= key.m_key; - } - - dKey m_key; -}; - -template -class ndUpHeap : public ndHeap> -{ - public: - ndUpHeap(ndInt32 maxElements) - :ndHeap>(maxElements) - { - } - - ndUpHeap(const void* const buffer, ndInt32 sizeInBytes) - :ndHeap>(buffer, sizeInBytes) - { - } - - dKey Value(ndInt32 i = 0) const - { - const ndUpHeapCompare key(ndHeap>::Value(i)); - return key.m_key; - } -}; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIntersections.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIntersections.cpp deleted file mode 100644 index a1070e6794..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIntersections.cpp +++ /dev/null @@ -1,515 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndSort.h" -#include "ndMemory.h" -#include "ndVector.h" -#include "ndPlane.h" -#include "ndGoogol.h" -#include "ndFastRay.h" -#include "ndIntersections.h" - -bool ndRayBoxClip (ndVector& p0, ndVector& p1, const ndVector& boxP0, const ndVector& boxP1) -{ - ndAssert (p0.m_w == ndFloat32(0.0f)); - ndAssert (p1.m_w == ndFloat32(0.0f)); - ndAssert (boxP0.m_w == ndFloat32(0.0f)); - ndAssert (boxP1.m_w == ndFloat32(0.0f)); - for (ndInt32 i = 0; i < 3; ++i) - { - ndFloat32 tmp0 = boxP1[i] - p0[i]; - if (tmp0 > ndFloat32 (0.0f)) - { - ndFloat32 tmp1 = boxP1[i] - p1[i]; - if (tmp1 < ndFloat32 (0.0f)) - { - p1 = p0 + (p1 - p0).Scale (tmp0 / (p1[i] - p0[i])); - p1[i] = boxP1[i]; - } - } - else - { - ndFloat32 tmp1 = boxP1[i] - p1[i]; - if (tmp1 > ndFloat32 (0.0f)) - { - p0 += (p1 - p0).Scale (tmp0 / (p1[i] - p0[i])); - p0[i] = boxP1[i]; - } - else - { - return false; - } - } - - tmp0 = boxP0[i] - p0[i]; - if (tmp0 < ndFloat32 (0.0f)) - { - ndFloat32 tmp1 = boxP0[i] - p1[i]; - if (tmp1 > ndFloat32 (0.0f)) - { - p1 = p0 + (p1 - p0).Scale (tmp0 / (p1[i] - p0[i])); - p1[i] = boxP0[i]; - } - } - else - { - ndFloat32 tmp1 = boxP0[i] - p1[i]; - if (tmp1 < ndFloat32 (0.0f)) - { - p0 += (p1 - p0).Scale (tmp0 / (p1[i] - p0[i])); - p0[i] = boxP0[i]; - } - else - { - return false; - } - } - } - return true; -} - -ndBigVector ndPointToRayDistance(const ndBigVector& point, const ndBigVector& ray_p0, const ndBigVector& ray_p1) -{ - ndBigVector dp (ray_p1 - ray_p0); - ndAssert (dp.m_w == ndFloat32 (0.0f)); - ndFloat64 t = ndClamp (dp.DotProduct(point - ray_p0).GetScalar() / dp.DotProduct(dp).GetScalar(), ndFloat64(0.0f), ndFloat64 (1.0f)); - return ray_p0 + dp.Scale (t); -} - -ndBigVector ndPointToTriangleDistance(const ndBigVector& point, const ndBigVector& p0, const ndBigVector& p1, const ndBigVector& p2) -{ - const ndBigVector e10(p1 - p0); - const ndBigVector e20(p2 - p0); - const ndFloat64 a00 = e10.DotProduct(e10).GetScalar(); - const ndFloat64 a11 = e20.DotProduct(e20).GetScalar(); - const ndFloat64 a01 = e10.DotProduct(e20).GetScalar(); - - const ndFloat64 det = a00 * a11 - a01 * a01; - ndAssert(det >= ndFloat32(0.0f)); - if (ndAbs(det) > ndFloat32(1.0e-24f)) - { - ndBigVector p0Point (point - p0); - const ndFloat64 b0 = e10.DotProduct(p0Point).GetScalar(); - const ndFloat64 b1 = e20.DotProduct(p0Point).GetScalar(); - - const ndFloat64 beta = b1 * a00 - a01 * b0; - const ndFloat64 alpha = b0 * a11 - a01 * b1; - if (beta < ndFloat32(0.0f)) - { - return ndPointToRayDistance (point, p0, p1); - } - else if (alpha < ndFloat32(0.0f)) - { - return ndPointToRayDistance (point, p0, p2); - } - else if ((alpha + beta) > det) - { - return ndPointToRayDistance (point, p1, p2); - } - return p0 + (e10.Scale(alpha) + e20.Scale(beta)).Scale(ndFloat64(1.0f) / det); - } - // this is a degenerated triangle. this should never happens - ndAssert(0); - return p0; -} - -ndBigVector ndPointToPolygonDistance(const ndBigVector& point, const ndBigVector* const points, ndInt32 vertexCount) -{ - const ndBigVector p0(points[0]); - ndBigVector p1(points[1]); - ndFloat64 dist2 = ndFloat32(1.0e10f); - ndBigVector minPoint(p0); - for (ndInt32 i = 2; i < vertexCount; ++i) - { - const ndBigVector p2(points[i]); - const ndBigVector p(ndPointToTriangleDistance(point, p0, p1, p2)); - const ndBigVector error(point - p); - const ndFloat64 newDist2 = error.DotProduct(error & ndBigVector::m_triplexMask).GetScalar(); - if (newDist2 < dist2) - { - minPoint = p; - dist2 = newDist2; - } - p1 = p2; - } - return minPoint; -} - -ndBigVector ndPointToTetrahedrumDistance (const ndBigVector& point, const ndBigVector& p0, const ndBigVector& p1, const ndBigVector& p2, const ndBigVector& p3) -{ - const ndBigVector e10(p1 - p0); - const ndBigVector e20(p2 - p0); - const ndBigVector e30(p3 - p0); - - const ndFloat64 d0 = sqrt(e10.DotProduct(e10).GetScalar()); - if (d0 > ndFloat64(0.0f)) - { - const ndFloat64 invd0 = ndFloat64(1.0f) / d0; - const ndFloat64 l10 = e20.DotProduct(e10).GetScalar() * invd0; - const ndFloat64 l20 = e30.DotProduct(e10).GetScalar() * invd0; - const ndFloat64 desc11 = e20.DotProduct(e20).GetScalar() - l10 * l10; - if (desc11 > ndFloat64(0.0f)) - { - const ndFloat64 d1 = sqrt(desc11); - const ndFloat64 invd1 = ndFloat64(1.0f) / d1; - const ndFloat64 l21 = (e30.DotProduct(e20).GetScalar() - l20 * l10) * invd1; - const ndFloat64 desc22 = e30.DotProduct(e30).GetScalar() - l20 * l20 - l21 * l21; - if (desc22 > ndFloat64(0.0f)) - { - ndBigVector p0Point (point - p0); - const ndFloat64 d2 = sqrt(desc22); - const ndFloat64 invd2 = ndFloat64(1.0f) / d2; - - const ndFloat64 b0 = e10.DotProduct(p0Point).GetScalar(); - const ndFloat64 b1 = e20.DotProduct(p0Point).GetScalar(); - const ndFloat64 b2 = e30.DotProduct(p0Point).GetScalar(); - - ndFloat64 u1 = b0 * invd0; - ndFloat64 u2 = (b1 - l10 * u1) * invd1; - ndFloat64 u3 = (b2 - l20 * u1 - l21 * u2) * invd2 * invd2; - u2 = (u2 - l21 * u3) * invd1; - u1 = (u1 - l10 * u2 - l20 * u3) * invd0; - if (u3 < ndFloat64(0.0f)) - { - // this looks funny but it is correct - return ndPointToTriangleDistance(point, p0, p1, p2); - } - else if (u2 < ndFloat64(0.0f)) - { - return ndPointToTriangleDistance(point, p0, p1, p3); - } - else if (u1 < ndFloat64(0.0f)) - { - return ndPointToTriangleDistance(point, p0, p2, p3); - } - else if (u1 + u2 + u3 > ndFloat64(1.0f)) - { - return ndPointToTriangleDistance(point, p1, p2, p3); - } - return p0 + e10.Scale(u1) + e20.Scale(u2) + e30.Scale(u3); - } - } - } - // this is a degenerated tetra. this should never happens - ndAssert(0); - return p0; -} - -void ndRayToRayDistance(const ndBigVector& ray_p0, const ndBigVector& ray_p1, const ndBigVector& ray_q0, const ndBigVector& ray_q1, ndBigVector& p0Out, ndBigVector& p1Out) -{ - ndFloat64 sN; - ndFloat64 tN; - - ndBigVector u(ray_p1 - ray_p0); - ndBigVector v(ray_q1 - ray_q0); - ndBigVector w(ray_p0 - ray_q0); - ndAssert(u.m_w == ndFloat64(0.0f)); - ndAssert(v.m_w == ndFloat64(0.0f)); - ndAssert(w.m_w == ndFloat64(0.0f)); - - ndFloat64 a = u.DotProduct(u).GetScalar(); - ndFloat64 b = u.DotProduct(v).GetScalar(); - ndFloat64 c = v.DotProduct(v).GetScalar(); - ndFloat64 d = u.DotProduct(w).GetScalar(); - ndFloat64 e = v.DotProduct(w).GetScalar(); - ndFloat64 D = a*c - b*b; - ndFloat64 sD = D; - ndFloat64 tD = D; - - // compute the line parameters of the two closest points - if (D < ndFloat64(1.0e-8f)) - { - sN = ndFloat64(0.0f); - sD = ndFloat64(1.0f); - 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 < ndFloat64(0.0f)) - { - // sc < 0 => the s=0 edge is visible - sN = ndFloat64(0.0f); - 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 < ndFloat64(0.0f)) - { - // tc < 0 => the t=0 edge is visible - tN = ndFloat64(0.0f); - // recompute sc for this edge - if (-d < ndFloat64(0.0f)) - { - sN = ndFloat64(0.0f); - } - 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) < ndFloat64(0.0f)) - { - sN = ndFloat64(0.0f); - } - else if ((-d + b) > a) - { - sN = sD; - } - else - { - sN = (-d + b); - sD = a; - } - } - - // finally do the division to get sc and tc - ndFloat64 sc = (ndAbs(sN) < ndFloat64(1.0e-8f) ? ndFloat64(0.0f) : sN / sD); - ndFloat64 tc = (ndAbs(tN) < ndFloat64(1.0e-8f) ? ndFloat64(0.0f) : tN / tD); - - ndAssert(u.m_w == ndFloat64(0.0f)); - ndAssert(v.m_w == ndFloat64(0.0f)); - p0Out = ray_p0 + u.Scale(sc); - p1Out = ray_q0 + v.Scale(tc); -} - -void ndRayToPolygonDistance(const ndBigVector& ray_p0, const ndBigVector& ray_p1, const ndBigVector* const points, ndInt32 vertexCount, ndBigVector& p0Out, ndBigVector& p1Out) -{ - ndBigVector normal(ndBigVector::m_zero); - ndBigVector e0(points[1] - points[0]); - for (ndInt32 i = 2; i < vertexCount; ++i) - { - ndBigVector e1(points[i] - points[0]); - normal += e1.CrossProduct(e0); - e0 = e1; - } - - normal = normal & ndBigVector::m_triplexMask; - ndBigVector segment(ray_p1 - ray_p0); - ndFloat64 param = ndClamp(-normal.DotProduct(ray_p0 - points[0]).GetScalar() / (normal.DotProduct(segment).GetScalar()), ndFloat64(0.0f), ndFloat64(1.0f)); - p0Out = ray_p0 + segment.Scale(param); - - ndFloat64 distance2 = ndFloat32(1.0e10f); - for (ndInt32 i = 2; i < vertexCount; ++i) - { - ndBigVector p (ndPointToTriangleDistance(p0Out, points[0], points[i-1], points[i])); - ndBigVector step (p - p0Out); - ndFloat64 d2 = step.DotProduct(step).GetScalar(); - if (d2 < distance2) - { - p1Out = p; - distance2 = d2; - } - } -} - -ndFloat32 ndRayCastBox(const ndVector& p0, const ndVector& p1, const ndVector& boxP0, const ndVector& boxP1, ndVector& normalOut) -{ - ndInt32 index = 0; - ndFloat32 signDir = ndFloat32(0.0f); - ndFloat32 tmin = ndFloat32(0.0f); - ndFloat32 tmax = ndFloat32(1.0f); - - for (ndInt32 i = 0; i < 3; ++i) - { - ndFloat32 dp = p1[i] - p0[i]; - if (ndAbs(dp) < ndFloat32(1.0e-8f)) - { - if (p0[i] <= boxP0[i] || p0[i] >= boxP1[i]) - { - return ndFloat32(1.2f); - } - } - else - { - dp = ndFloat32(1.0f) / dp; - ndFloat32 t1 = (boxP0[i] - p0[i]) * dp; - ndFloat32 t2 = (boxP1[i] - p0[i]) * dp; - - ndFloat32 sign = ndFloat32(-1.0f); - if (t1 > t2) - { - sign = 1; - ndSwap(t1, t2); - } - if (t1 > tmin) - { - signDir = sign; - index = i; - tmin = t1; - } - if (t2 < tmax) - { - tmax = t2; - } - if (tmin > tmax) - { - return ndFloat32(1.2f); - } - } - } - - if (tmin > ndFloat32(0.0f)) - { - ndAssert(tmin < 1.0f); - normalOut = ndVector(ndFloat32(0.0f)); - normalOut[index] = signDir; - } - else - { - tmin = ndFloat32(1.2f); - } - return tmin; -} - -ndFloat32 ndRayCastSphere (const ndVector& p0, const ndVector& p1, const ndVector& origin, ndFloat32 radius) -{ - ndVector p0Origin (p0 - origin); - ndAssert (p0Origin.m_w == ndFloat32 (0.0f)); - if (p0Origin.DotProduct(p0Origin).GetScalar() < (ndFloat32 (100.0f) * radius * radius)) - { - ndVector dp (p1 - p0); - ndAssert (dp.m_w == ndFloat32 (0.0f)); - ndFloat32 a = dp.DotProduct(dp).GetScalar(); - ndFloat32 b = ndFloat32 (2.0f) * p0Origin.DotProduct(dp).GetScalar(); - ndFloat32 c = p0Origin.DotProduct(p0Origin).GetScalar() - radius * radius; - ndFloat32 desc = b * b - ndFloat32 (4.0f) * a * c; - if (desc >= 0.0f) - { - desc = ndSqrt (desc); - ndFloat32 den = ndFloat32 (0.5f) / a; - ndFloat32 t0 = (-b + desc) * den; - ndFloat32 t1 = (-b - desc) * den; - if ((t0 >= ndFloat32 (0.0f)) && (t1 >= ndFloat32 (0.0f))) - { - t0 = ndMin(t0, t1); - if (t0 <= ndFloat32 (1.0f)) - { - return t0; - } - } - else if (t0 >= ndFloat32 (0.0f)) - { - if (t0 <= ndFloat32 (1.0f)) - { - return t0; - } - } - else - { - if ((t1 >= ndFloat32 (0.0f)) && (t1 <= ndFloat32 (1.0f))) - { - return t1; - } - } - } - } - else - { - ndBigVector p0Origin1 (p0Origin); - ndBigVector dp(p1 - p0); - ndAssert(dp.m_w == ndFloat32(0.0f)); - ndFloat64 a = dp.DotProduct(dp).GetScalar(); - ndFloat64 b = ndFloat32(2.0f) * p0Origin1.DotProduct(dp).GetScalar(); - ndFloat64 c = p0Origin1.DotProduct(p0Origin1).GetScalar() - ndFloat64(radius) * radius; - ndFloat64 desc = b * b - ndFloat32(4.0f) * a * c; - if (desc >= 0.0f) - { - desc = sqrt(desc); - ndFloat64 den = ndFloat32(0.5f) / a; - ndFloat64 t0 = (-b + desc) * den; - ndFloat64 t1 = (-b - desc) * den; - if ((t0 >= ndFloat32(0.0f)) && (t1 >= ndFloat32(0.0f))) - { - t0 = ndMin(t0, t1); - if (t0 <= ndFloat32(1.0f)) - { - return ndFloat32(t0); - } - } - else if (t0 >= ndFloat32(0.0f)) - { - if (t0 <= ndFloat32(1.0f)) - { - return ndFloat32(t0); - } - } - else - { - if ((t1 >= ndFloat32(0.0f)) && (t1 <= ndFloat32(1.0f))) - { - return ndFloat32(t1); - } - } - } - } - return ndFloat32(1.2f); -} - -bool ndRayCastSphere(const ndMatrix& origin, ndFloat32 radius, const ndVector& p0, const ndVector& p1, ndFloat32& t0, ndFloat32& t1) -{ - const ndVector p0Src(origin.UntransformVector(p0) & ndVector::m_triplexMask); - const ndVector p0Dst(origin.UntransformVector(p1) & ndVector::m_triplexMask); - const ndVector dp(p0Dst - p0Src); - ndFloat32 a = dp.DotProduct(dp).GetScalar(); - ndFloat32 b = ndFloat32(2.0f) * p0Src.DotProduct(dp).GetScalar(); - ndFloat32 c = p0Src.DotProduct(p0Src).GetScalar() - radius * radius; - ndAssert(p0Src.DotProduct(p0Src).GetScalar() < (ndFloat32(100.0f) * radius * radius)); - - ndFloat32 desc = b * b - ndFloat32(4.0f) * a * c; - bool ret = false; - if (desc >= 0.0f) - { - desc = ndSqrt(desc); - ndFloat32 den = ndFloat32(0.5f) / a; - t0 = (-b + desc) * den; - t1 = (-b - desc) * den; - if (t0 < t1) - { - ndSwap(t0, t1); - } - ret = true; - } - return ret; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIntersections.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIntersections.h deleted file mode 100644 index 87a520cde2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIntersections.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_INTERSECTION_H__ -#define __ND_INTERSECTION_H__ - -#include "ndCoreStdafx.h" -#include "ndDebug.h" -#include "ndVector.h" -#include "ndMatrix.h" - -class ndPlane; -class ndFastRay; - -D_CORE_API ndBigVector ndPointToRayDistance(const ndBigVector& point, const ndBigVector& ray_p0, const ndBigVector& ray_p1); -D_CORE_API ndBigVector ndPointToTriangleDistance(const ndBigVector& point, const ndBigVector& p0, const ndBigVector& p1, const ndBigVector& p2); -D_CORE_API ndBigVector ndPointToTetrahedrumDistance(const ndBigVector& point, const ndBigVector& p0, const ndBigVector& p1, const ndBigVector& p2, const ndBigVector& p3); -D_CORE_API ndBigVector ndPointToPolygonDistance(const ndBigVector& point, const ndBigVector* const points, ndInt32 vertexCount); - -D_CORE_API void ndRayToRayDistance(const ndBigVector& ray_p0, const ndBigVector& ray_p1, const ndBigVector& ray_q0, const ndBigVector& ray_q1, ndBigVector& p0Out, ndBigVector& p1Out); -D_CORE_API void ndRayToPolygonDistance(const ndBigVector& ray_p0, const ndBigVector& ray_p1, const ndBigVector* const points, ndInt32 vertexCount, ndBigVector& p0Out, ndBigVector& p1Out); - -D_CORE_API bool ndRayBoxClip (ndVector& ray_p0, ndVector& ray_p1, const ndVector& boxP0, const ndVector& boxP1); -D_CORE_API ndFloat32 ndRayCastBox (const ndVector& p0, const ndVector& p1, const ndVector& boxP0, const ndVector& boxP1, ndVector& normalOut); -D_CORE_API ndFloat32 ndRayCastSphere (const ndVector& p0, const ndVector& p1, const ndVector& origin, ndFloat32 radius); -D_CORE_API bool ndRayCastSphere(const ndMatrix& origin, ndFloat32 radius, const ndVector& p0, const ndVector& p1, ndFloat32& t0, ndFloat32& t1); - -inline ndInt32 ndOverlapTest (const ndVector& p0, const ndVector& p1, const ndVector& q0, const ndVector& q1) -{ - ndVector r0(p0 - q1); - ndVector r1(p1 - q0); - ndVector val(r0 * r1); - ndInt32 mask = val.GetSignMask() & 0x07; - return (mask == 0x07); -} - -inline ndInt32 ndBoxInclusionTest (const ndVector& p0, const ndVector& p1, const ndVector& q0, const ndVector& q1) -{ - ndVector val(ndVector::m_negOne & ((p0 >= q0) & (p1 <= q1))); - ndInt32 mask = val.GetSignMask() & 0x07; - return (mask == 0x07); -} - -inline ndInt32 ndCompareBox (const ndVector& p0, const ndVector& p1, const ndVector& q0, const ndVector& q1) -{ - ndAssert(0); - return (p0.m_x != q0.m_x) || (p0.m_y != q0.m_y) || (p0.m_z != q0.m_z) || (p1.m_x != q1.m_x) || (p1.m_y != q1.m_y) || (p1.m_z != q1.m_z); -} - -inline void ndMovingAABB (ndVector& p0, ndVector& p1, const ndVector& veloc, const ndVector& omega, ndFloat32 timestep, ndFloat32 maxRadius, ndFloat32 minRadius) -{ - ndVector linearStep (veloc.Scale (timestep)); - - // estimate the maximum effect of the angular velocity and enlarge that box by that value (use 45 degrees as max angle not 90) - ndAssert (omega.m_w == ndFloat32 (0.0f)); - ndFloat32 maxAngle = ndMin (ndSqrt (omega.DotProduct(omega).GetScalar() * timestep * timestep), ndFloat32 (45.0f * ndDegreeToRad)); - - ndFloat32 angularTravel = (maxRadius - minRadius) * maxAngle; - ndVector angularStep (angularTravel, angularTravel, angularTravel, ndFloat32 (0.0f)); - - ndVector r0 (p0 - angularStep); - ndVector r1 (p1 + angularStep); - ndVector q0 (r0 + linearStep); - ndVector q1 (r1 + linearStep); - p0 = r0.GetMin (q0) & ndVector::m_triplexMask; - p1 = r1.GetMax (q1) & ndVector::m_triplexMask; -} - -//inline ndFloat32 ndBoxPenetration (const ndVector& minBox, const ndVector& maxBox) -//{ -// ndAssert(maxBox.m_x >= minBox.m_x); -// ndAssert(maxBox.m_y >= minBox.m_y); -// ndAssert(maxBox.m_z >= minBox.m_z); -// -// ndVector mask ((minBox * maxBox) < ndVector::m_zero); -// ndVector dist (maxBox.GetMin (minBox.Abs()) & mask); -// dist = dist.GetMin(dist.ShiftTripleRight()); -// dist = dist.GetMin(dist.ShiftTripleRight()); -// return dist.GetScalar(); -//} - -inline ndFloat32 ndBoxDistanceToOrigin2 (const ndVector& minBox, const ndVector& maxBox) -{ - ndAssert(maxBox.m_x >= minBox.m_x); - ndAssert(maxBox.m_y >= minBox.m_y); - ndAssert(maxBox.m_z >= minBox.m_z); - const ndVector mask (((minBox * maxBox) > ndVector::m_zero) & ndVector::m_triplexMask); - const ndVector dist (maxBox.Abs().GetMin (minBox.Abs()) & mask); - return dist.DotProduct(dist).GetScalar(); -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIsoSurface.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIsoSurface.cpp deleted file mode 100644 index e851b06875..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIsoSurface.cpp +++ /dev/null @@ -1,3440 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndSort.h" -#include "ndDebug.h" -#include "ndVector.h" -#include "ndMatrix.h" -#include "ndProfiler.h" -#include "ndIsoSurface.h" - -// adapted from code by written by Paul Bourke may 1994 -//http://paulbourke.net/geometry/polygonise/ - -class ndIsoSurface::ndImplementation : public ndClassAlloc -{ - public: - class ndEdge - { - public: - ndInt32 m_midPoint; - ndInt32 m_p0; - ndInt32 m_p1; - }; - - class ndIsoCell - { - public: - ndVector m_isoValues[8]; - }; - - ndImplementation(); - ~ndImplementation(); - - void Clear(); - ndVector GetOrigin() const; - void BuildLowResolutionMesh(ndIsoSurface* const me, const ndArray& pointCloud, ndFloat32 gridSize); - void BuildHighResolutionMesh(ndIsoSurface* const me, const ndArray& pointCloud, ndFloat32 gridSize, ndCalculateIsoValue* const computeIsoValue); - - ndInt32 GenerateLowResIndexList(const ndIsoSurface* const me, - ndInt32* const indexList, ndInt32 strideInFloats, - ndReal* const posit, ndReal* const normals); - - private: - class ndGridHash - { - public: - ndGridHash() - { - } - - ndGridHash(const ndGridHash& src, ndInt8 cellType) - { - m_gridCellHash = src.m_gridCellHash; - m_cellType = ndUnsigned8(cellType); - } - - ndGridHash(ndInt32 x, ndInt32 y, ndInt32 z) - { - m_gridCellHash = 0; - m_x = ndUnsigned16(x); - m_y = ndUnsigned16(y); - m_z = ndUnsigned16(z); - } - - ndGridHash(const ndVector& grid) - { - ndAssert(grid.m_x >= ndFloat32(0.0f)); - ndAssert(grid.m_y >= ndFloat32(0.0f)); - ndAssert(grid.m_z >= ndFloat32(0.0f)); - ndAssert(grid.m_x < ndFloat32(256.0f * 256.0f)); - ndAssert(grid.m_y < ndFloat32(256.0f * 256.0f)); - ndAssert(grid.m_z < ndFloat32(256.0f * 256.0f)); - - ndVector hash(grid.GetInt()); - m_gridCellHash = 0; - m_x = ndUnsigned16(hash.m_ix); - m_y = ndUnsigned16(hash.m_iy); - m_z = ndUnsigned16(hash.m_iz); - } - - union - { - struct - { - ndUnsigned16 m_x; - ndUnsigned16 m_y; - ndUnsigned16 m_z; - ndUnsigned8 m_cellType; - }; - struct - { - ndUnsigned8 m_xLow; - ndUnsigned8 m_xHigh; - ndUnsigned8 m_yLow; - ndUnsigned8 m_yHigh; - ndUnsigned8 m_zLow; - ndUnsigned8 m_zHigh; - }; - ndUnsigned64 m_gridCellHash : 48; - ndUnsigned64 m_gridFullHash; - }; - }; - - class ndGridHashSteps - { - public: - ndGridHashSteps() - { - m_steps[0] = ndGridHash(-1, -1, -1); - m_steps[1] = ndGridHash(0, -1, -1); - m_steps[2] = ndGridHash(-1, 0, -1); - m_steps[3] = ndGridHash(0, 0, -1); - m_steps[4] = ndGridHash(-1, -1, 0); - m_steps[5] = ndGridHash(0, -1, 0); - m_steps[6] = ndGridHash(-1, 0, 0); - m_steps[7] = ndGridHash(0, 0, 0); - - m_cellType[0] = 5; - m_cellType[1] = 6; - m_cellType[2] = 1; - m_cellType[3] = 2; - m_cellType[4] = 4; - m_cellType[5] = 7; - m_cellType[6] = 0; - m_cellType[7] = 3; - } - - ndGridHash m_steps[8]; - ndUnsigned8 m_cellType[8]; - }; - - class ndUpperDigit - { - public: - ndUpperDigit() - :m_x(0) - ,m_y(0) - ,m_z(0) - { - } - ndInt32 m_x; - ndInt32 m_y; - ndInt32 m_z; - }; - - void CreateGrids(); - void ClearBuffers(); - void SortCellBuckects(); - void GenerateLowResIsoSurface(); - void ProcessLowResCell(ndIsoCell& cell); - void MakeTriangleList(ndIsoSurface* const me); - void CalculateNormals(ndIsoSurface* const me); - - void GenerateHighResIndexList(ndIsoSurface* const me); - void RemoveDuplicates(const ndArray& points); - void CalculateAabb(const ndArray& points, ndFloat32 gridSize); - void GenerateHighResIsoSurface(ndCalculateIsoValue* const computeIsoValue); - void ProcessHighResCell(ndIsoCell& cell, ndCalculateIsoValue* const computeIsoValue); - ndVector InterpolateLowResVertex(const ndVector& p1, const ndVector& p2) const; - ndVector InterpolateHighResVertex(ndFloat32 isolevel, const ndVector& p1, const ndVector& p2) const; - - ndVector m_boxP0; - ndVector m_boxP1; - ndVector m_gridSize; - ndVector m_invGridSize; - ndArray m_hashGridMap; - ndArray m_hashGridMapScratchBuffer; - ndArray m_triangles; - ndArray m_trianglesScratchBuffer; - - ndFloat32 m_isoValue; - ndInt32 m_volumeSizeX; - ndInt32 m_volumeSizeY; - ndInt32 m_volumeSizeZ; - ndUpperDigit m_upperDigitsIsValid; - - static ndEdge m_edges[]; - static ndInt32 m_faces[][3]; - static ndInt32 m_edgeScan[]; - static ndInt32 m_facesScan[]; - static ndVector m_gridCorners[]; - - friend class ndIsoSurface; -}; - -ndInt32 ndIsoSurface::ndImplementation::m_facesScan[] = { 0,0,1,2,4,5,7,9,12,13,15,17,20,22,25,28,30,31,33,35,38,40,43,46,50,52,55,58,62,65,69,73,76,77,79,81,84,86,89,92,96,98,101,104,108,111,115,119,122,124,127,130,132,135,139,143,146,149,153,157,160,164,169,174,176,177,179,181,184,186,189,192,196,198,201,204,208,211,215,219,222,224,227,230,234,237,241,245,250,253,257,261,266,270,275,280,284,286,289,292,296,299,303,305,308,311,315,319,324,328,333,336,338,341,345,349,352,356,361,364,366,370,375,380,384,389,391,395,396,397,399,401,404,406,409,412,416,418,421,424,428,431,435,439,442,444,447,450,454,457,461,465,470,473,475,479,482,486,489,494,496,498,501,504,508,511,515,519,524,527,531,535,540,544,549,554,558,561,565,569,572,576,581,586,590,594,597,602,604,609,613,615,616,618,621,624,628,631,635,639,644,647,651,655,660,662,665,668,670,673,677,681,686,690,695,700,702,706,709,714,718,721,723,727,728,731,735,739,744,748,753,756,760,764,769,774,776,779,783,785,786,788,791,794,796,799,803,805,806,809,811,815,816,818,819,820}; -ndInt32 ndIsoSurface::ndImplementation::m_edgeScan[] = { 0,0,3,6,10,13,19,23,28,31,35,41,46,50,55,60,64,67,71,77,82,88,95,102,108,114,119,128,134,141,147,155,160,163,169,173,178,184,193,198,204,210,217,224,230,237,245,251,256,260,265,270,274,281,289,295,300,307,313,321,326,334,341,348,352,355,361,367,374,378,385,390,396,402,409,418,426,431,437,443,448,454,461,470,478,485,493,501,508,517,525,537,546,554,561,570,576,580,587,592,598,603,611,615,620,627,635,643,650,656,663,668,672,677,683,689,694,700,707,712,716,724,731,740,746,753,759,765,768,771,777,783,790,796,805,812,820,824,829,836,842,847,853,859,864,868,873,880,886,893,901,909,916,921,925,933,938,944,949,956,960,966,975,982,990,999,1011,1019,1028,1035,1043,1051,1058,1066,1075,1082,1088,1093,1099,1105,1110,1118,1127,1134,1140,1146,1151,1158,1162,1169,1175,1181,1184,1188,1195,1202,1210,1215,1223,1229,1236,1241,1247,1255,1262,1266,1271,1276,1280,1285,1291,1299,1306,1312,1319,1326,1332,1338,1343,1352,1358,1363,1367,1373,1376,1381,1389,1395,1402,1408,1417,1422,1428,1434,1441,1448,1454,1459,1465,1469,1472,1476,1481,1486,1490,1495,1501,1505,1508,1513,1517,1523,1526,1530,1533,1536 }; - -ndIsoSurface::ndImplementation::ndEdge ndIsoSurface::ndImplementation::m_edges[] = -{ - { 0, 0, 1 }, - { 3, 3, 0 }, - { 8, 0, 4 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 9, 1, 5 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 10, 2, 6 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 11, 3, 7 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 11, 3, 7 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 4, 4, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 5, 6, 5 }, - { 6, 7, 6 }, - { 10, 2, 6 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 5, 6, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 4, 4, 5 }, - { 5, 6, 5 }, - { 9, 1, 5 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 4, 4, 5 }, - { 7, 7, 4 }, - { 8, 0, 4 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 10, 2, 6 }, - { 11, 3, 7 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 9, 1, 5 }, - { 11, 3, 7 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 8, 0, 4 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 11, 3, 7 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 2, 2, 3 }, - { 9, 1, 5 }, - { 10, 2, 6 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 3, 3, 0 }, - { 8, 0, 4 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 2, 2, 3 }, - { 10, 2, 6 }, - { 1, 1, 2 }, - { 3, 3, 0 }, - { 8, 0, 4 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 1, 1, 2 }, - { 9, 1, 5 }, - { 0, 0, 1 }, - { 3, 3, 0 }, - { 8, 0, 4 }, -}; - -ndInt32 ndIsoSurface::ndImplementation::m_faces[][3] = -{ - { 0, 8, 3 }, - { 0, 1, 9 }, - { 1, 8, 3 }, - { 9, 8, 1 }, - { 1, 2, 10 }, - { 0, 8, 3 }, - { 1, 2, 10 }, - { 9, 2, 10 }, - { 0, 2, 9 }, - { 2, 8, 3 }, - { 2, 10, 8 }, - { 10, 9, 8 }, - { 3, 11, 2 }, - { 0, 11, 2 }, - { 8, 11, 0 }, - { 1, 9, 0 }, - { 2, 3, 11 }, - { 1, 11, 2 }, - { 1, 9, 11 }, - { 9, 8, 11 }, - { 3, 10, 1 }, - { 11, 10, 3 }, - { 0, 10, 1 }, - { 0, 8, 10 }, - { 8, 11, 10 }, - { 3, 9, 0 }, - { 3, 11, 9 }, - { 11, 10, 9 }, - { 9, 8, 10 }, - { 10, 8, 11 }, - { 4, 7, 8 }, - { 4, 3, 0 }, - { 7, 3, 4 }, - { 0, 1, 9 }, - { 8, 4, 7 }, - { 4, 1, 9 }, - { 4, 7, 1 }, - { 7, 3, 1 }, - { 1, 2, 10 }, - { 8, 4, 7 }, - { 3, 4, 7 }, - { 3, 0, 4 }, - { 1, 2, 10 }, - { 9, 2, 10 }, - { 9, 0, 2 }, - { 8, 4, 7 }, - { 2, 10, 9 }, - { 2, 9, 7 }, - { 2, 7, 3 }, - { 7, 9, 4 }, - { 8, 4, 7 }, - { 3, 11, 2 }, - { 11, 4, 7 }, - { 11, 2, 4 }, - { 2, 0, 4 }, - { 9, 0, 1 }, - { 8, 4, 7 }, - { 2, 3, 11 }, - { 4, 7, 11 }, - { 9, 4, 11 }, - { 9, 11, 2 }, - { 9, 2, 1 }, - { 3, 10, 1 }, - { 3, 11, 10 }, - { 7, 8, 4 }, - { 1, 11, 10 }, - { 1, 4, 11 }, - { 1, 0, 4 }, - { 7, 11, 4 }, - { 4, 7, 8 }, - { 9, 0, 11 }, - { 9, 11, 10 }, - { 11, 0, 3 }, - { 4, 7, 11 }, - { 4, 11, 9 }, - { 9, 11, 10 }, - { 9, 5, 4 }, - { 9, 5, 4 }, - { 0, 8, 3 }, - { 0, 5, 4 }, - { 1, 5, 0 }, - { 8, 5, 4 }, - { 8, 3, 5 }, - { 3, 1, 5 }, - { 1, 2, 10 }, - { 9, 5, 4 }, - { 3, 0, 8 }, - { 1, 2, 10 }, - { 4, 9, 5 }, - { 5, 2, 10 }, - { 5, 4, 2 }, - { 4, 0, 2 }, - { 2, 10, 5 }, - { 3, 2, 5 }, - { 3, 5, 4 }, - { 3, 4, 8 }, - { 9, 5, 4 }, - { 2, 3, 11 }, - { 0, 11, 2 }, - { 0, 8, 11 }, - { 4, 9, 5 }, - { 0, 5, 4 }, - { 0, 1, 5 }, - { 2, 3, 11 }, - { 2, 1, 5 }, - { 2, 5, 8 }, - { 2, 8, 11 }, - { 4, 8, 5 }, - { 10, 3, 11 }, - { 10, 1, 3 }, - { 9, 5, 4 }, - { 4, 9, 5 }, - { 0, 8, 1 }, - { 8, 10, 1 }, - { 8, 11, 10 }, - { 5, 4, 0 }, - { 5, 0, 11 }, - { 5, 11, 10 }, - { 11, 0, 3 }, - { 5, 4, 8 }, - { 5, 8, 10 }, - { 10, 8, 11 }, - { 9, 7, 8 }, - { 5, 7, 9 }, - { 9, 3, 0 }, - { 9, 5, 3 }, - { 5, 7, 3 }, - { 0, 7, 8 }, - { 0, 1, 7 }, - { 1, 5, 7 }, - { 1, 5, 3 }, - { 3, 5, 7 }, - { 9, 7, 8 }, - { 9, 5, 7 }, - { 10, 1, 2 }, - { 10, 1, 2 }, - { 9, 5, 0 }, - { 5, 3, 0 }, - { 5, 7, 3 }, - { 8, 0, 2 }, - { 8, 2, 5 }, - { 8, 5, 7 }, - { 10, 5, 2 }, - { 2, 10, 5 }, - { 2, 5, 3 }, - { 3, 5, 7 }, - { 7, 9, 5 }, - { 7, 8, 9 }, - { 3, 11, 2 }, - { 9, 5, 7 }, - { 9, 7, 2 }, - { 9, 2, 0 }, - { 2, 7, 11 }, - { 2, 3, 11 }, - { 0, 1, 8 }, - { 1, 7, 8 }, - { 1, 5, 7 }, - { 11, 2, 1 }, - { 11, 1, 7 }, - { 7, 1, 5 }, - { 9, 5, 8 }, - { 8, 5, 7 }, - { 10, 1, 3 }, - { 10, 3, 11 }, - { 5, 7, 0 }, - { 5, 0, 9 }, - { 7, 11, 0 }, - { 1, 0, 10 }, - { 11, 10, 0 }, - { 11, 10, 0 }, - { 11, 0, 3 }, - { 10, 5, 0 }, - { 8, 0, 7 }, - { 5, 7, 0 }, - { 11, 10, 5 }, - { 7, 11, 5 }, - { 10, 6, 5 }, - { 0, 8, 3 }, - { 5, 10, 6 }, - { 9, 0, 1 }, - { 5, 10, 6 }, - { 1, 8, 3 }, - { 1, 9, 8 }, - { 5, 10, 6 }, - { 1, 6, 5 }, - { 2, 6, 1 }, - { 1, 6, 5 }, - { 1, 2, 6 }, - { 3, 0, 8 }, - { 9, 6, 5 }, - { 9, 0, 6 }, - { 0, 2, 6 }, - { 5, 9, 8 }, - { 5, 8, 2 }, - { 5, 2, 6 }, - { 3, 2, 8 }, - { 2, 3, 11 }, - { 10, 6, 5 }, - { 11, 0, 8 }, - { 11, 2, 0 }, - { 10, 6, 5 }, - { 0, 1, 9 }, - { 2, 3, 11 }, - { 5, 10, 6 }, - { 5, 10, 6 }, - { 1, 9, 2 }, - { 9, 11, 2 }, - { 9, 8, 11 }, - { 6, 3, 11 }, - { 6, 5, 3 }, - { 5, 1, 3 }, - { 0, 8, 11 }, - { 0, 11, 5 }, - { 0, 5, 1 }, - { 5, 11, 6 }, - { 3, 11, 6 }, - { 0, 3, 6 }, - { 0, 6, 5 }, - { 0, 5, 9 }, - { 6, 5, 9 }, - { 6, 9, 11 }, - { 11, 9, 8 }, - { 5, 10, 6 }, - { 4, 7, 8 }, - { 4, 3, 0 }, - { 4, 7, 3 }, - { 6, 5, 10 }, - { 1, 9, 0 }, - { 5, 10, 6 }, - { 8, 4, 7 }, - { 10, 6, 5 }, - { 1, 9, 7 }, - { 1, 7, 3 }, - { 7, 9, 4 }, - { 6, 1, 2 }, - { 6, 5, 1 }, - { 4, 7, 8 }, - { 1, 2, 5 }, - { 5, 2, 6 }, - { 3, 0, 4 }, - { 3, 4, 7 }, - { 8, 4, 7 }, - { 9, 0, 5 }, - { 0, 6, 5 }, - { 0, 2, 6 }, - { 7, 3, 9 }, - { 7, 9, 4 }, - { 3, 2, 9 }, - { 5, 9, 6 }, - { 2, 6, 9 }, - { 3, 11, 2 }, - { 7, 8, 4 }, - { 10, 6, 5 }, - { 5, 10, 6 }, - { 4, 7, 2 }, - { 4, 2, 0 }, - { 2, 7, 11 }, - { 0, 1, 9 }, - { 4, 7, 8 }, - { 2, 3, 11 }, - { 5, 10, 6 }, - { 9, 2, 1 }, - { 9, 11, 2 }, - { 9, 4, 11 }, - { 7, 11, 4 }, - { 5, 10, 6 }, - { 8, 4, 7 }, - { 3, 11, 5 }, - { 3, 5, 1 }, - { 5, 11, 6 }, - { 5, 1, 11 }, - { 5, 11, 6 }, - { 1, 0, 11 }, - { 7, 11, 4 }, - { 0, 4, 11 }, - { 0, 5, 9 }, - { 0, 6, 5 }, - { 0, 3, 6 }, - { 11, 6, 3 }, - { 8, 4, 7 }, - { 6, 5, 9 }, - { 6, 9, 11 }, - { 4, 7, 9 }, - { 7, 11, 9 }, - { 10, 4, 9 }, - { 6, 4, 10 }, - { 4, 10, 6 }, - { 4, 9, 10 }, - { 0, 8, 3 }, - { 10, 0, 1 }, - { 10, 6, 0 }, - { 6, 4, 0 }, - { 8, 3, 1 }, - { 8, 1, 6 }, - { 8, 6, 4 }, - { 6, 1, 10 }, - { 1, 4, 9 }, - { 1, 2, 4 }, - { 2, 6, 4 }, - { 3, 0, 8 }, - { 1, 2, 9 }, - { 2, 4, 9 }, - { 2, 6, 4 }, - { 0, 2, 4 }, - { 4, 2, 6 }, - { 8, 3, 2 }, - { 8, 2, 4 }, - { 4, 2, 6 }, - { 10, 4, 9 }, - { 10, 6, 4 }, - { 11, 2, 3 }, - { 0, 8, 2 }, - { 2, 8, 11 }, - { 4, 9, 10 }, - { 4, 10, 6 }, - { 3, 11, 2 }, - { 0, 1, 6 }, - { 0, 6, 4 }, - { 6, 1, 10 }, - { 6, 4, 1 }, - { 6, 1, 10 }, - { 4, 8, 1 }, - { 2, 1, 11 }, - { 8, 11, 1 }, - { 9, 6, 4 }, - { 9, 3, 6 }, - { 9, 1, 3 }, - { 11, 6, 3 }, - { 8, 11, 1 }, - { 8, 1, 0 }, - { 11, 6, 1 }, - { 9, 1, 4 }, - { 6, 4, 1 }, - { 3, 11, 6 }, - { 3, 6, 0 }, - { 0, 6, 4 }, - { 6, 4, 8 }, - { 11, 6, 8 }, - { 7, 10, 6 }, - { 7, 8, 10 }, - { 8, 9, 10 }, - { 0, 7, 3 }, - { 0, 10, 7 }, - { 0, 9, 10 }, - { 6, 7, 10 }, - { 10, 6, 7 }, - { 1, 10, 7 }, - { 1, 7, 8 }, - { 1, 8, 0 }, - { 10, 6, 7 }, - { 10, 7, 1 }, - { 1, 7, 3 }, - { 1, 2, 6 }, - { 1, 6, 8 }, - { 1, 8, 9 }, - { 8, 6, 7 }, - { 2, 6, 9 }, - { 2, 9, 1 }, - { 6, 7, 9 }, - { 0, 9, 3 }, - { 7, 3, 9 }, - { 7, 8, 0 }, - { 7, 0, 6 }, - { 6, 0, 2 }, - { 7, 3, 2 }, - { 6, 7, 2 }, - { 2, 3, 11 }, - { 10, 6, 8 }, - { 10, 8, 9 }, - { 8, 6, 7 }, - { 2, 0, 7 }, - { 2, 7, 11 }, - { 0, 9, 7 }, - { 6, 7, 10 }, - { 9, 10, 7 }, - { 1, 8, 0 }, - { 1, 7, 8 }, - { 1, 10, 7 }, - { 6, 7, 10 }, - { 2, 3, 11 }, - { 11, 2, 1 }, - { 11, 1, 7 }, - { 10, 6, 1 }, - { 6, 7, 1 }, - { 8, 9, 6 }, - { 8, 6, 7 }, - { 9, 1, 6 }, - { 11, 6, 3 }, - { 1, 3, 6 }, - { 0, 9, 1 }, - { 11, 6, 7 }, - { 7, 8, 0 }, - { 7, 0, 6 }, - { 3, 11, 0 }, - { 11, 6, 0 }, - { 7, 11, 6 }, - { 7, 6, 11 }, - { 3, 0, 8 }, - { 11, 7, 6 }, - { 0, 1, 9 }, - { 11, 7, 6 }, - { 8, 1, 9 }, - { 8, 3, 1 }, - { 11, 7, 6 }, - { 10, 1, 2 }, - { 6, 11, 7 }, - { 1, 2, 10 }, - { 3, 0, 8 }, - { 6, 11, 7 }, - { 2, 9, 0 }, - { 2, 10, 9 }, - { 6, 11, 7 }, - { 6, 11, 7 }, - { 2, 10, 3 }, - { 10, 8, 3 }, - { 10, 9, 8 }, - { 7, 2, 3 }, - { 6, 2, 7 }, - { 7, 0, 8 }, - { 7, 6, 0 }, - { 6, 2, 0 }, - { 2, 7, 6 }, - { 2, 3, 7 }, - { 0, 1, 9 }, - { 1, 6, 2 }, - { 1, 8, 6 }, - { 1, 9, 8 }, - { 8, 7, 6 }, - { 10, 7, 6 }, - { 10, 1, 7 }, - { 1, 3, 7 }, - { 10, 7, 6 }, - { 1, 7, 10 }, - { 1, 8, 7 }, - { 1, 0, 8 }, - { 0, 3, 7 }, - { 0, 7, 10 }, - { 0, 10, 9 }, - { 6, 10, 7 }, - { 7, 6, 10 }, - { 7, 10, 8 }, - { 8, 10, 9 }, - { 6, 8, 4 }, - { 11, 8, 6 }, - { 3, 6, 11 }, - { 3, 0, 6 }, - { 0, 4, 6 }, - { 8, 6, 11 }, - { 8, 4, 6 }, - { 9, 0, 1 }, - { 9, 4, 6 }, - { 9, 6, 3 }, - { 9, 3, 1 }, - { 11, 3, 6 }, - { 6, 8, 4 }, - { 6, 11, 8 }, - { 2, 10, 1 }, - { 1, 2, 10 }, - { 3, 0, 11 }, - { 0, 6, 11 }, - { 0, 4, 6 }, - { 4, 11, 8 }, - { 4, 6, 11 }, - { 0, 2, 9 }, - { 2, 10, 9 }, - { 10, 9, 3 }, - { 10, 3, 2 }, - { 9, 4, 3 }, - { 11, 3, 6 }, - { 4, 6, 3 }, - { 8, 2, 3 }, - { 8, 4, 2 }, - { 4, 6, 2 }, - { 0, 4, 2 }, - { 4, 6, 2 }, - { 1, 9, 0 }, - { 2, 3, 4 }, - { 2, 4, 6 }, - { 4, 3, 8 }, - { 1, 9, 4 }, - { 1, 4, 2 }, - { 2, 4, 6 }, - { 8, 1, 3 }, - { 8, 6, 1 }, - { 8, 4, 6 }, - { 6, 10, 1 }, - { 10, 1, 0 }, - { 10, 0, 6 }, - { 6, 0, 4 }, - { 4, 6, 3 }, - { 4, 3, 8 }, - { 6, 10, 3 }, - { 0, 3, 9 }, - { 10, 9, 3 }, - { 10, 9, 4 }, - { 6, 10, 4 }, - { 4, 9, 5 }, - { 7, 6, 11 }, - { 0, 8, 3 }, - { 4, 9, 5 }, - { 11, 7, 6 }, - { 5, 0, 1 }, - { 5, 4, 0 }, - { 7, 6, 11 }, - { 11, 7, 6 }, - { 8, 3, 4 }, - { 3, 5, 4 }, - { 3, 1, 5 }, - { 9, 5, 4 }, - { 10, 1, 2 }, - { 7, 6, 11 }, - { 6, 11, 7 }, - { 1, 2, 10 }, - { 0, 8, 3 }, - { 4, 9, 5 }, - { 7, 6, 11 }, - { 5, 4, 10 }, - { 4, 2, 10 }, - { 4, 0, 2 }, - { 3, 4, 8 }, - { 3, 5, 4 }, - { 3, 2, 5 }, - { 10, 5, 2 }, - { 11, 7, 6 }, - { 7, 2, 3 }, - { 7, 6, 2 }, - { 5, 4, 9 }, - { 9, 5, 4 }, - { 0, 8, 6 }, - { 0, 6, 2 }, - { 6, 8, 7 }, - { 3, 6, 2 }, - { 3, 7, 6 }, - { 1, 5, 0 }, - { 5, 4, 0 }, - { 6, 2, 8 }, - { 6, 8, 7 }, - { 2, 1, 8 }, - { 4, 8, 5 }, - { 1, 5, 8 }, - { 9, 5, 4 }, - { 10, 1, 6 }, - { 1, 7, 6 }, - { 1, 3, 7 }, - { 1, 6, 10 }, - { 1, 7, 6 }, - { 1, 0, 7 }, - { 8, 7, 0 }, - { 9, 5, 4 }, - { 4, 0, 10 }, - { 4, 10, 5 }, - { 0, 3, 10 }, - { 6, 10, 7 }, - { 3, 7, 10 }, - { 7, 6, 10 }, - { 7, 10, 8 }, - { 5, 4, 10 }, - { 4, 8, 10 }, - { 6, 9, 5 }, - { 6, 11, 9 }, - { 11, 8, 9 }, - { 3, 6, 11 }, - { 0, 6, 3 }, - { 0, 5, 6 }, - { 0, 9, 5 }, - { 0, 11, 8 }, - { 0, 5, 11 }, - { 0, 1, 5 }, - { 5, 6, 11 }, - { 6, 11, 3 }, - { 6, 3, 5 }, - { 5, 3, 1 }, - { 1, 2, 10 }, - { 9, 5, 11 }, - { 9, 11, 8 }, - { 11, 5, 6 }, - { 0, 11, 3 }, - { 0, 6, 11 }, - { 0, 9, 6 }, - { 5, 6, 9 }, - { 1, 2, 10 }, - { 11, 8, 5 }, - { 11, 5, 6 }, - { 8, 0, 5 }, - { 10, 5, 2 }, - { 0, 2, 5 }, - { 6, 11, 3 }, - { 6, 3, 5 }, - { 2, 10, 3 }, - { 10, 5, 3 }, - { 5, 8, 9 }, - { 5, 2, 8 }, - { 5, 6, 2 }, - { 3, 8, 2 }, - { 9, 5, 6 }, - { 9, 6, 0 }, - { 0, 6, 2 }, - { 1, 5, 8 }, - { 1, 8, 0 }, - { 5, 6, 8 }, - { 3, 8, 2 }, - { 6, 2, 8 }, - { 1, 5, 6 }, - { 2, 1, 6 }, - { 1, 3, 6 }, - { 1, 6, 10 }, - { 3, 8, 6 }, - { 5, 6, 9 }, - { 8, 9, 6 }, - { 10, 1, 0 }, - { 10, 0, 6 }, - { 9, 5, 0 }, - { 5, 6, 0 }, - { 0, 3, 8 }, - { 5, 6, 10 }, - { 10, 5, 6 }, - { 11, 5, 10 }, - { 7, 5, 11 }, - { 11, 5, 10 }, - { 11, 7, 5 }, - { 8, 3, 0 }, - { 5, 11, 7 }, - { 5, 10, 11 }, - { 1, 9, 0 }, - { 10, 7, 5 }, - { 10, 11, 7 }, - { 9, 8, 1 }, - { 8, 3, 1 }, - { 11, 1, 2 }, - { 11, 7, 1 }, - { 7, 5, 1 }, - { 0, 8, 3 }, - { 1, 2, 7 }, - { 1, 7, 5 }, - { 7, 2, 11 }, - { 9, 7, 5 }, - { 9, 2, 7 }, - { 9, 0, 2 }, - { 2, 11, 7 }, - { 7, 5, 2 }, - { 7, 2, 11 }, - { 5, 9, 2 }, - { 3, 2, 8 }, - { 9, 8, 2 }, - { 2, 5, 10 }, - { 2, 3, 5 }, - { 3, 7, 5 }, - { 8, 2, 0 }, - { 8, 5, 2 }, - { 8, 7, 5 }, - { 10, 2, 5 }, - { 9, 0, 1 }, - { 5, 10, 3 }, - { 5, 3, 7 }, - { 3, 10, 2 }, - { 9, 8, 2 }, - { 9, 2, 1 }, - { 8, 7, 2 }, - { 10, 2, 5 }, - { 7, 5, 2 }, - { 1, 3, 5 }, - { 3, 7, 5 }, - { 0, 8, 7 }, - { 0, 7, 1 }, - { 1, 7, 5 }, - { 9, 0, 3 }, - { 9, 3, 5 }, - { 5, 3, 7 }, - { 9, 8, 7 }, - { 5, 9, 7 }, - { 5, 8, 4 }, - { 5, 10, 8 }, - { 10, 11, 8 }, - { 5, 0, 4 }, - { 5, 11, 0 }, - { 5, 10, 11 }, - { 11, 3, 0 }, - { 0, 1, 9 }, - { 8, 4, 10 }, - { 8, 10, 11 }, - { 10, 4, 5 }, - { 10, 11, 4 }, - { 10, 4, 5 }, - { 11, 3, 4 }, - { 9, 4, 1 }, - { 3, 1, 4 }, - { 2, 5, 1 }, - { 2, 8, 5 }, - { 2, 11, 8 }, - { 4, 5, 8 }, - { 0, 4, 11 }, - { 0, 11, 3 }, - { 4, 5, 11 }, - { 2, 11, 1 }, - { 5, 1, 11 }, - { 0, 2, 5 }, - { 0, 5, 9 }, - { 2, 11, 5 }, - { 4, 5, 8 }, - { 11, 8, 5 }, - { 9, 4, 5 }, - { 2, 11, 3 }, - { 2, 5, 10 }, - { 3, 5, 2 }, - { 3, 4, 5 }, - { 3, 8, 4 }, - { 5, 10, 2 }, - { 5, 2, 4 }, - { 4, 2, 0 }, - { 3, 10, 2 }, - { 3, 5, 10 }, - { 3, 8, 5 }, - { 4, 5, 8 }, - { 0, 1, 9 }, - { 5, 10, 2 }, - { 5, 2, 4 }, - { 1, 9, 2 }, - { 9, 4, 2 }, - { 8, 4, 5 }, - { 8, 5, 3 }, - { 3, 5, 1 }, - { 0, 4, 5 }, - { 1, 0, 5 }, - { 8, 4, 5 }, - { 8, 5, 3 }, - { 9, 0, 5 }, - { 0, 3, 5 }, - { 9, 4, 5 }, - { 4, 11, 7 }, - { 4, 9, 11 }, - { 9, 10, 11 }, - { 0, 8, 3 }, - { 4, 9, 7 }, - { 9, 11, 7 }, - { 9, 10, 11 }, - { 1, 10, 11 }, - { 1, 11, 4 }, - { 1, 4, 0 }, - { 7, 4, 11 }, - { 3, 1, 4 }, - { 3, 4, 8 }, - { 1, 10, 4 }, - { 7, 4, 11 }, - { 10, 11, 4 }, - { 4, 11, 7 }, - { 9, 11, 4 }, - { 9, 2, 11 }, - { 9, 1, 2 }, - { 9, 7, 4 }, - { 9, 11, 7 }, - { 9, 1, 11 }, - { 2, 11, 1 }, - { 0, 8, 3 }, - { 11, 7, 4 }, - { 11, 4, 2 }, - { 2, 4, 0 }, - { 11, 7, 4 }, - { 11, 4, 2 }, - { 8, 3, 4 }, - { 3, 2, 4 }, - { 2, 9, 10 }, - { 2, 7, 9 }, - { 2, 3, 7 }, - { 7, 4, 9 }, - { 9, 10, 7 }, - { 9, 7, 4 }, - { 10, 2, 7 }, - { 8, 7, 0 }, - { 2, 0, 7 }, - { 3, 7, 10 }, - { 3, 10, 2 }, - { 7, 4, 10 }, - { 1, 10, 0 }, - { 4, 0, 10 }, - { 1, 10, 2 }, - { 8, 7, 4 }, - { 4, 9, 1 }, - { 4, 1, 7 }, - { 7, 1, 3 }, - { 4, 9, 1 }, - { 4, 1, 7 }, - { 0, 8, 1 }, - { 8, 7, 1 }, - { 4, 0, 3 }, - { 7, 4, 3 }, - { 4, 8, 7 }, - { 9, 10, 8 }, - { 10, 11, 8 }, - { 3, 0, 9 }, - { 3, 9, 11 }, - { 11, 9, 10 }, - { 0, 1, 10 }, - { 0, 10, 8 }, - { 8, 10, 11 }, - { 3, 1, 10 }, - { 11, 3, 10 }, - { 1, 2, 11 }, - { 1, 11, 9 }, - { 9, 11, 8 }, - { 3, 0, 9 }, - { 3, 9, 11 }, - { 1, 2, 9 }, - { 2, 11, 9 }, - { 0, 2, 11 }, - { 8, 0, 11 }, - { 3, 2, 11 }, - { 2, 3, 8 }, - { 2, 8, 10 }, - { 10, 8, 9 }, - { 9, 10, 2 }, - { 0, 9, 2 }, - { 2, 3, 8 }, - { 2, 8, 10 }, - { 0, 1, 8 }, - { 1, 10, 8 }, - { 1, 10, 2 }, - { 1, 3, 8 }, - { 9, 1, 8 }, - { 0, 9, 1 }, - { 0, 3, 8 }, -}; - -ndVector ndIsoSurface::ndImplementation::m_gridCorners[] = -{ - ndVector(ndFloat32(0.0f), ndFloat32(-1.0f), ndFloat32(-1.0f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.0f), ndFloat32(-1.0f), ndFloat32(0.0f), ndFloat32(0.0f)), - ndVector(ndFloat32(-1.0f), ndFloat32(-1.0f), ndFloat32(0.0f), ndFloat32(0.0f)), - ndVector(ndFloat32(-1.0f), ndFloat32(-1.0f), ndFloat32(-1.0f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(-1.0f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)), - ndVector(ndFloat32(-1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)), - ndVector(ndFloat32(-1.0f), ndFloat32(0.0f), ndFloat32(-1.0f), ndFloat32(0.0f)) -}; - -inline ndIsoSurface::ndImplementation::ndImplementation() - :ndClassAlloc() - ,m_boxP0(ndVector::m_zero) - ,m_boxP1(ndVector::m_zero) - ,m_gridSize(ndVector::m_zero) - ,m_invGridSize(ndVector::m_zero) - ,m_hashGridMap(256) - ,m_hashGridMapScratchBuffer(256) - ,m_triangles(256) - ,m_trianglesScratchBuffer(256) - ,m_isoValue(ndFloat32 (0.5f)) - //,m_worlToGridOrigin(ndFloat32(1.0f)) - //,m_worlToGridScale(ndFloat32(1.0f)) - ,m_volumeSizeX(1) - ,m_volumeSizeY(1) - ,m_volumeSizeZ(1) - ,m_upperDigitsIsValid() -{ -} - -ndIsoSurface::ndImplementation::~ndImplementation() -{ -} - -ndVector ndIsoSurface::ndImplementation::GetOrigin() const -{ - return m_boxP0; -} - -void ndIsoSurface::ndImplementation::Clear() -{ - m_triangles.Resize(256); - m_hashGridMap.Resize(256); - m_trianglesScratchBuffer.Resize(256); - m_hashGridMapScratchBuffer.Resize(256); -} - -void ndIsoSurface::ndImplementation::CalculateAabb(const ndArray& points, ndFloat32 gridSize) -{ - D_TRACKTIME(); - - m_isoValue = ndFloat32(0.5f); - m_gridSize = ndVector::m_triplexMask & ndVector(gridSize); - m_invGridSize = ndVector::m_triplexMask & ndVector(ndFloat32(1.0f) / gridSize); - - ndVector boxP0(ndFloat32(1.0e10f)); - ndVector boxP1(ndFloat32(-1.0e10f)); - for (ndInt32 i = 0; i < points.GetCount(); ++i) - { - boxP0 = boxP0.GetMin(points[i]); - boxP1 = boxP1.GetMax(points[i]); - } - boxP0 -= m_gridSize; - boxP1 += (m_gridSize + m_gridSize); - - // quantize the aabb to integers of the gird size - boxP0 = m_gridSize * (boxP0 * m_invGridSize).Floor(); - boxP1 = m_gridSize * (boxP1 * m_invGridSize).Floor(); - - // make sure the w component is zero. - m_boxP0 = boxP0 & ndVector::m_triplexMask; - m_boxP1 = boxP1 & ndVector::m_triplexMask; - - const ndVector sizeInGrids(((boxP1 - boxP0) * m_invGridSize + ndVector::m_one).Floor().GetInt()); - m_volumeSizeX = ndInt32(sizeInGrids.m_ix); - m_volumeSizeY = ndInt32(sizeInGrids.m_iy); - m_volumeSizeZ = ndInt32(sizeInGrids.m_iz); - - //m_worlToGridOrigin = m_boxP0.m_x; - //m_worlToGridScale = ndFloat32(1 << D_GRID_X_RESOLUTION) * m_volumeSizeX / (m_boxP1.m_x - m_boxP0.m_x); -} - -ndVector ndIsoSurface::ndImplementation::InterpolateLowResVertex(const ndVector& p0, const ndVector& p1) const -{ - ndAssert(ndAbs(p1.m_w - p0.m_w) == ndFloat32(1.0f)); - const ndVector p1p0(p1 - p0); - return ndVector(p0 + p1p0 * ndVector::m_half); -} - -ndVector ndIsoSurface::ndImplementation::InterpolateHighResVertex(ndFloat32, const ndVector& p0, const ndVector& p1) const -{ - //ndVector p; - //ndFloat32 mu = (isolevel - p0.m_w) / (p1.m_w - p0.m_w); - //p.m_x = p0.m_x + mu * (p1.m_x - p0.m_x); - //p.m_y = p0.m_y + mu * (p1.m_y - p0.m_y); - //p.m_z = p0.m_z + mu * (p1.m_z - p0.m_z); - //p.m_w = ndFloat32(0.0f); - //return p; - - //ndAssert(isolevel == ndFloat32(0.5f)); - ndAssert(ndAbs(p1.m_w - p0.m_w) == ndFloat32(1.0f)); - const ndVector p1p0(p1 - p0); - return ndVector(p0 + p1p0 * ndVector::m_half); -} - -void ndIsoSurface::ndImplementation::ProcessLowResCell(ndIsoCell& cell) -{ - ndInt32 tableIndex = 0; - for (ndInt32 i = 0; i < 8; ++i) - { - tableIndex |= (cell.m_isoValues[i].m_w > m_isoValue) << i; - } - - ndVector vertlist[12]; - const ndInt32 start = m_edgeScan[tableIndex]; - const ndInt32 edgeCount = m_edgeScan[tableIndex + 1] - start; - for (ndInt32 i = 0; i < edgeCount; ++i) - { - const ndEdge& edge = m_edges[start + i]; - const ndInt32 midPoint = edge.m_midPoint; - const ndInt32 p0 = edge.m_p0; - const ndInt32 p1 = edge.m_p1; - vertlist[midPoint] = InterpolateLowResVertex(cell.m_isoValues[p0], cell.m_isoValues[p1]); - } - - const ndInt32 index = ndInt32 (m_triangles.GetCount()); - const ndInt32 faceStart = m_facesScan[tableIndex]; - const ndInt32 faceVertexCount = m_facesScan[tableIndex + 1] - faceStart; - - m_triangles.SetCount(index + faceVertexCount * 3); - ndVector* const triangle = &m_triangles[index]; - for (ndInt32 i = 0; i < faceVertexCount; ++i) - { - const ndInt32 j = i * 3; - const ndInt32 j0 = m_faces[faceStart + i][0]; - const ndInt32 j1 = m_faces[faceStart + i][1]; - const ndInt32 j2 = m_faces[faceStart + i][2]; - - triangle[j + 0] = vertlist[j0]; - triangle[j + 1] = vertlist[j1]; - triangle[j + 2] = vertlist[j2]; - triangle[j + 0].m_w = ndFloat32(index + j + 0); - triangle[j + 1].m_w = ndFloat32(index + j + 1); - triangle[j + 2].m_w = ndFloat32(index + j + 2); - } -} - -void ndIsoSurface::ndImplementation::ProcessHighResCell(ndIsoCell& cell, ndCalculateIsoValue* const computeIsoValue) -{ - ndInt32 tableIndex = 0; - for (ndInt32 i = 0; i < 8; ++i) - { - const ndVector point(cell.m_isoValues[i] * m_gridSize); - cell.m_isoValues[i].m_w = computeIsoValue->CalculateIsoValue(point); - tableIndex |= (cell.m_isoValues[i].m_w > m_isoValue) << i; - } - - ndVector vertlist[12]; - const ndInt32 start = m_edgeScan[tableIndex]; - const ndInt32 edgeCount = m_edgeScan[tableIndex + 1] - start; - for (ndInt32 i = 0; i < edgeCount; ++i) - { - const ndEdge& edge = m_edges[start + i]; - const ndInt32 midPoint = edge.m_midPoint; - const ndInt32 p0 = edge.m_p0; - const ndInt32 p1 = edge.m_p1; - vertlist[midPoint] = InterpolateHighResVertex(m_isoValue, cell.m_isoValues[p0], cell.m_isoValues[p1]); - } - - const ndInt32 index = ndInt32 (m_triangles.GetCount()); - const ndInt32 faceStart = m_facesScan[tableIndex]; - const ndInt32 faceVertexCount = m_facesScan[tableIndex + 1] - faceStart; - - m_triangles.SetCount(index + faceVertexCount * 3); - ndVector* const triangle = &m_triangles[index]; - for (ndInt32 i = 0; i < faceVertexCount; ++i) - { - const ndInt32 j = i * 3; - const ndInt32 j0 = m_faces[faceStart + i][0]; - const ndInt32 j1 = m_faces[faceStart + i][1]; - const ndInt32 j2 = m_faces[faceStart + i][2]; - - triangle[j + 0] = vertlist[j0]; - triangle[j + 1] = vertlist[j1]; - triangle[j + 2] = vertlist[j2]; - triangle[j + 0].m_w = ndFloat32(index + j + 0); - triangle[j + 1].m_w = ndFloat32(index + j + 1); - triangle[j + 2].m_w = ndFloat32(index + j + 2); - } -} - -//void ndIsoSurface::ndImplementation::CalculateNormals(ndIsoSurface* const me) -void ndIsoSurface::ndImplementation::CalculateNormals(ndIsoSurface* const) -{ - D_TRACKTIME(); - ndAssert(0); - //ndArray& normals = me->m_normals; - //const ndArray& points = me->m_points; - //const ndArray& triangles = me->m_triangles; - //normals.SetCount(points.GetCount()); - // - //// Set all normals to 0. - //if (normals.GetCount()) - //{ - // memset(&normals[0], 0, normals.GetCount() * sizeof(ndVector)); - // - // for (ndInt32 i = 0; i < triangles.GetCount(); i += 3) - // { - // ndInt32 id0 = triangles[i + 0]; - // ndInt32 id1 = triangles[i + 1]; - // ndInt32 id2 = triangles[i + 2]; - // ndVector vec1(points[id1] - points[id0]); - // ndVector vec2(points[id2] - points[id0]); - // ndVector normal = vec1.CrossProduct(vec2); - // normals[id0] += normal; - // normals[id1] += normal; - // normals[id2] += normal; - // } - // - // // Normalize normals. - // for (ndInt32 i = 0; i < normals.GetCount(); ++i) - // { - // normals[i] = normals[i] * normals[i].InvMagSqrt(); - // } - //} -} - -void ndIsoSurface::ndImplementation::SortCellBuckects() -{ - D_TRACKTIME(); - class ndKey_xlow - { - public: - ndKey_xlow(void* const){} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_xLow; - } - }; - - class ndKey_ylow - { - public: - ndKey_ylow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_yLow; - } - }; - - class ndKey_zlow - { - public: - ndKey_zlow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_zLow; - } - }; - - class ndKey_xhigh - { - public: - ndKey_xhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_xHigh; - } - }; - - class ndKey_yhigh - { - public: - ndKey_yhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_yHigh; - } - }; - - class ndKey_zhigh - { - public: - ndKey_zhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_zHigh; - } - }; - - ndCountingSort(m_hashGridMap, m_hashGridMapScratchBuffer, nullptr, nullptr); - if (m_upperDigitsIsValid.m_x) - { - ndCountingSort(m_hashGridMap, m_hashGridMapScratchBuffer, nullptr, nullptr); - } - - ndCountingSort(m_hashGridMap, m_hashGridMapScratchBuffer, nullptr, nullptr); - if (m_upperDigitsIsValid.m_y) - { - ndCountingSort(m_hashGridMap, m_hashGridMapScratchBuffer, nullptr, nullptr); - } - - ndCountingSort(m_hashGridMap, m_hashGridMapScratchBuffer, nullptr, nullptr); - if (m_upperDigitsIsValid.m_z) - { - ndCountingSort(m_hashGridMap, m_hashGridMapScratchBuffer, nullptr, nullptr); - } -} - -void ndIsoSurface::ndImplementation::RemoveDuplicates(const ndArray& points) -{ - D_TRACKTIME(); - class ndKey_xlow - { - public: - ndKey_xlow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_xLow; - } - }; - - class ndKey_ylow - { - public: - ndKey_ylow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_yLow; - } - }; - - class ndKey_zlow - { - public: - ndKey_zlow(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_zLow; - } - }; - - class ndKey_xhigh - { - public: - ndKey_xhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_xHigh; - } - }; - - class ndKey_yhigh - { - public: - ndKey_yhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_yHigh; - } - }; - - class ndKey_zhigh - { - public: - ndKey_zhigh(void* const) {} - ndInt32 GetKey(const ndGridHash& cell) const - { - return cell.m_zHigh; - } - }; - - const ndVector origin(m_boxP0); - const ndVector invGridSize(m_invGridSize); - - const ndVector rounding(ndVector::m_zero); - ndUpperDigit upperDigits; - const ndGridHashSteps steps; - m_hashGridMapScratchBuffer.SetCount(points.GetCount()); - for (ndInt32 i = 0; i < points.GetCount(); ++i) - { - const ndVector r(points[i] - origin); - const ndVector p(r * invGridSize + rounding); - const ndGridHash hashKey(p); - m_hashGridMapScratchBuffer[i] = hashKey; - - upperDigits.m_x = ndMax(upperDigits.m_x, ndInt32(hashKey.m_xHigh)); - upperDigits.m_y = ndMax(upperDigits.m_y, ndInt32(hashKey.m_yHigh)); - upperDigits.m_z = ndMax(upperDigits.m_z, ndInt32(hashKey.m_zHigh)); - } - m_upperDigitsIsValid = upperDigits; - - ndCountingSort(m_hashGridMapScratchBuffer, m_hashGridMap, nullptr, nullptr); - if (m_upperDigitsIsValid.m_x) - { - ndCountingSort(m_hashGridMapScratchBuffer, m_hashGridMap, nullptr, nullptr); - } - - ndCountingSort(m_hashGridMapScratchBuffer, m_hashGridMap, nullptr, nullptr); - if (m_upperDigitsIsValid.m_y) - { - ndCountingSort(m_hashGridMapScratchBuffer, m_hashGridMap, nullptr, nullptr); - } - - ndCountingSort(m_hashGridMapScratchBuffer, m_hashGridMap, nullptr, nullptr); - if (m_upperDigitsIsValid.m_z) - { - ndCountingSort(m_hashGridMapScratchBuffer, m_hashGridMap, nullptr, nullptr); - } - - ndInt32 gridCount = 0; - for (ndInt32 i = 1; i < m_hashGridMapScratchBuffer.GetCount(); ++i) - { - const ndGridHash cell(m_hashGridMapScratchBuffer[i]); - gridCount += (cell.m_gridFullHash != m_hashGridMapScratchBuffer[i - 1].m_gridFullHash); - m_hashGridMapScratchBuffer[gridCount] = cell; - } - gridCount++; - m_hashGridMapScratchBuffer.SetCount(gridCount); -} - -void ndIsoSurface::ndImplementation::GenerateLowResIsoSurface() -{ - D_TRACKTIME(); - ndInt32 end = 0; - const ndInt32 gridCount = ndInt32(m_hashGridMap.GetCount()); - m_hashGridMap.PushBack(ndGridHash(0xffff, 0xffff, 0xffff)); - - m_triangles.SetCount(0); - for (ndInt32 i = 0; i < gridCount; i = end) - { - end = i + 1; - ndInt32 start = i; - const ndGridHash startGrid(m_hashGridMap[start], 0); - while (startGrid.m_gridCellHash == ndGridHash(m_hashGridMap[end], 0).m_gridCellHash) - { - end++; - } - ndInt32 count = end - start; - if (count < 8) - { - ndIsoCell cell; - ndVector* const isoValue = &cell.m_isoValues[0]; - ndVector origin(ndFloat32(startGrid.m_x + 1), ndFloat32(startGrid.m_y + 1), ndFloat32(startGrid.m_z + 1), ndFloat32(0.0f)); - for (ndInt32 j = 0; j < 8; ++j) - { - isoValue[j] = origin + m_gridCorners[j]; - } - for (ndInt32 j = 0; j < count; ++j) - { - ndInt32 index = m_hashGridMap[start + j].m_cellType; - isoValue[index].m_w = ndFloat32(1.0f); - } - ProcessLowResCell(cell); - } - } -} - -void ndIsoSurface::ndImplementation::GenerateHighResIsoSurface(ndCalculateIsoValue* const computeIsoValue) -{ - D_TRACKTIME(); - ndInt32 end = 0; - const ndInt32 gridCount = ndInt32(m_hashGridMap.GetCount()); - m_hashGridMap.PushBack(ndGridHash(0xffff, 0xffff, 0xffff)); - - m_triangles.SetCount(0); - for (ndInt32 i = 0; i < gridCount; i = end) - { - end = i + 1; - ndInt32 start = i; - const ndGridHash startGrid(m_hashGridMap[start], 0); - while (startGrid.m_gridCellHash == ndGridHash(m_hashGridMap[end], 0).m_gridCellHash) - { - end++; - } - ndInt32 count = end - start; - if (count < 8) - { - ndIsoCell cell; - ndVector* const isoValue = &cell.m_isoValues[0]; - ndVector origin(ndFloat32(startGrid.m_x + 1), ndFloat32(startGrid.m_y + 1), ndFloat32(startGrid.m_z + 1), ndFloat32(0.0f)); - for (ndInt32 j = 0; j < 8; ++j) - { - isoValue[j] = origin + m_gridCorners[j]; - } - for (ndInt32 j = 0; j < count; ++j) - { - ndInt32 index = m_hashGridMap[start + j].m_cellType; - isoValue[index].m_w = ndFloat32(1.0f); - } - ProcessHighResCell(cell, computeIsoValue); - } - } -} - -ndInt32 ndIsoSurface::ndImplementation::GenerateLowResIndexList( - const ndIsoSurface* const me, - ndInt32* const indexList, ndInt32 strideInFloats, - ndReal* const posit, ndReal* const normals) -{ - D_TRACKTIME(); - #define D_LOW_RES_BITS 1 - #define D_LOW_RES_FRACTION (1 << D_LOW_RES_BITS) - - class ndKey_lowX - { - public: - ndKey_lowX(void* const) {} - ndInt32 GetKey(const ndVector& point) const - { - ndFloat32 val = (point.m_x * D_LOW_RES_FRACTION); - ndInt32 key = ndInt32(val); - return key & 0xff; - } - }; - - class ndKey_midleX - { - public: - ndKey_midleX(void* const) {} - ndInt32 GetKey(const ndVector& point) const - { - ndFloat32 val = point.m_x * ndFloat32(D_LOW_RES_FRACTION); - ndInt32 key = ndInt32(val) >> 8; - return key & 0xff; - } - }; - - class ndKey_highX - { - public: - ndKey_highX(void* const) {} - ndInt32 GetKey(const ndVector& point) const - { - ndFloat32 val = point.m_x * ndFloat32(D_LOW_RES_FRACTION); - ndInt32 key = ndInt32(val) >> 16; - return key & 0xff; - } - }; - - class ndKey_lowY - { - public: - ndKey_lowY(void* const) {} - ndInt32 GetKey(const ndVector& point) const - { - ndFloat32 val = (point.m_y * D_LOW_RES_FRACTION); - ndInt32 key = ndInt32(val); - return key & 0xff; - } - }; - - class ndKey_midleY - { - public: - ndKey_midleY(void* const) {} - ndInt32 GetKey(const ndVector& point) const - { - ndFloat32 val = point.m_y * ndFloat32(D_LOW_RES_FRACTION); - ndInt32 key = ndInt32(val) >> 8; - return key & 0xff; - } - }; - - class ndKey_highY - { - public: - ndKey_highY(void* const) {} - ndInt32 GetKey(const ndVector& point) const - { - ndFloat32 val = point.m_y * ndFloat32(D_LOW_RES_FRACTION); - ndInt32 key = ndInt32(val) >> 16; - return key & 0xff; - } - }; - - class ndKey_lowZ - { - public: - ndKey_lowZ(void* const) {} - ndInt32 GetKey(const ndVector& point) const - { - ndFloat32 val = (point.m_z * D_LOW_RES_FRACTION); - ndInt32 key = ndInt32(val); - return key & 0xff; - } - }; - - class ndKey_midleZ - { - public: - ndKey_midleZ(void* const) {} - ndInt32 GetKey(const ndVector& point) const - { - ndFloat32 val = point.m_z * ndFloat32(D_LOW_RES_FRACTION); - ndInt32 key = ndInt32(val) >> 8; - return key & 0xff; - } - }; - - class ndKey_highZ - { - public: - ndKey_highZ(void* const) {} - ndInt32 GetKey(const ndVector& point) const - { - ndFloat32 val = point.m_z * ndFloat32(D_LOW_RES_FRACTION); - ndInt32 key = ndInt32(val) >> 16; - return key & 0xff; - } - }; - - class ndCompareKey - { - public: - ndCompareKey(const ndVector& base) - :m_base(base) - { - } - - ndInt32 Test(const ndVector& point) const - { - const ndVector test(point == m_base); - return ndInt32 (test.m_ix & test.m_iy & test.m_iz); - } - - ndVector m_base; - }; - - const ndVector invGrid(ndFloat32(1.0f) / me->m_gridSize); - const ndArray& points = me->m_points; - m_triangles.SetCount(points.GetCount()); - for (ndInt32 i = 0; i < points.GetCount(); ++i) - { - m_triangles[i] = points[i] * invGrid; - m_triangles[i].m_w = ndFloat32(i); - } - - const ndInt32 xDimSize = me->m_volumeSizeX * D_LOW_RES_FRACTION; - ndCountingSort(m_triangles, m_trianglesScratchBuffer, nullptr, nullptr); - if (xDimSize >= 256) - { - ndCountingSort(m_triangles, m_trianglesScratchBuffer, nullptr, nullptr); - } - if (xDimSize >= 256 * 256) - { - ndCountingSort(m_triangles, m_trianglesScratchBuffer, nullptr, nullptr); - } - - const ndInt32 yDimSize = me->m_volumeSizeY * D_LOW_RES_FRACTION; - ndCountingSort(m_triangles, m_trianglesScratchBuffer, nullptr, nullptr); - if (yDimSize >= 256) - { - ndCountingSort(m_triangles, m_trianglesScratchBuffer, nullptr, nullptr); - } - if (yDimSize >= 256 * 256) - { - ndCountingSort(m_triangles, m_trianglesScratchBuffer, nullptr, nullptr); - } - - const ndInt32 zDimSize = me->m_volumeSizeZ * D_LOW_RES_FRACTION; - ndCountingSort(m_triangles, m_trianglesScratchBuffer, nullptr, nullptr); - if (zDimSize >= 256) - { - ndCountingSort(m_triangles, m_trianglesScratchBuffer, nullptr, nullptr); - } - if (zDimSize >= 256 * 256) - { - ndCountingSort(m_triangles, m_trianglesScratchBuffer, nullptr, nullptr); - } - - const ndInt32 count = ndInt32 (m_triangles.GetCount()); - const ndArray& triangleList = m_triangles; - - ndInt32 vertexCount = 0; - m_triangles.PushBack(ndVector::m_one + (m_triangles[count - 1])); - for (ndInt32 i = 0; i < count; ++i) - { - m_trianglesScratchBuffer[vertexCount] = triangleList[i] * m_gridSize; - - const ndCompareKey comparator(m_triangles[i]); - const ndInt32 index = ndInt32(m_triangles[i].m_w); - indexList[index] = vertexCount; - for (i = i + 1; comparator.Test(m_triangles[i]); ++i) - { - const ndInt32 duplicateIndex = ndInt32(m_triangles[i].m_w); - indexList[duplicateIndex] = vertexCount; - } - --i; - vertexCount++; - } - - for (ndInt32 i = 0; i < vertexCount; ++i) - { - ndInt32 j = strideInFloats * i; - m_triangles[i] = ndVector::m_zero; - posit[j + 0] = ndReal(m_trianglesScratchBuffer[i].m_x); - posit[j + 1] = ndReal(m_trianglesScratchBuffer[i].m_y); - posit[j + 2] = ndReal(m_trianglesScratchBuffer[i].m_z); - } - - // calculate normals - for (ndInt32 i = 0; i < count; i += 3) - { - ndInt32 id0 = indexList[i + 0] * strideInFloats; - ndInt32 id1 = indexList[i + 1] * strideInFloats; - ndInt32 id2 = indexList[i + 2] * strideInFloats; - - const ndVector p0(posit[id0 + 0], posit[id0 + 1], posit[id0 + 2], ndFloat32(0.0f)); - const ndVector p1(posit[id1 + 0], posit[id1 + 1], posit[id1 + 2], ndFloat32(0.0f)); - const ndVector p2(posit[id2 + 0], posit[id2 + 1], posit[id2 + 2], ndFloat32(0.0f)); - const ndVector vec1(p1 - p0); - const ndVector vec2(p2 - p0); - - const ndVector normal = vec1.CrossProduct(vec2); - m_triangles[indexList[i + 0]] += normal; - m_triangles[indexList[i + 1]] += normal; - m_triangles[indexList[i + 2]] += normal; - } - - // Normalize normals. - for (ndInt32 i = 0; i < vertexCount; ++i) - { - ndVector normal(m_triangles[i] * m_triangles[i].InvMagSqrt()); - ndInt32 j = strideInFloats * i; - normals[j + 0] = ndReal (normal.m_x); - normals[j + 1] = ndReal (normal.m_y); - normals[j + 2] = ndReal (normal.m_z); - } - - return vertexCount; -} - -void ndIsoSurface::ndImplementation::MakeTriangleList(ndIsoSurface* const me) -{ - D_TRACKTIME(); - ndArray& points = me->m_points; - points.SetCount(m_triangles.GetCount()); - - for (ndInt32 i = 0; i < ndInt32 (m_triangles.GetCount()); ++i) - { - points[i] = m_triangles[i] * m_gridSize; - } -} - -//void ndIsoSurface::ndImplementation::GenerateHighResIndexList(ndIsoSurface* const me) -void ndIsoSurface::ndImplementation::GenerateHighResIndexList(ndIsoSurface* const) -{ - D_TRACKTIME(); - ndAssert(0); -} - -void ndIsoSurface::ndImplementation::CreateGrids() -{ - D_TRACKTIME(); - const ndGridHashSteps steps; - m_hashGridMap.SetCount(m_hashGridMapScratchBuffer.GetCount() * 8); - for (ndInt32 i = 0; i < m_hashGridMapScratchBuffer.GetCount(); ++i) - { - const ndGridHash hashKey(m_hashGridMapScratchBuffer[i]); - for (ndInt32 j = 0; j < 8; ++j) - { - ndGridHash cell(hashKey); - cell.m_x += steps.m_steps[j].m_x; - cell.m_y += steps.m_steps[j].m_y; - cell.m_z += steps.m_steps[j].m_z; - cell.m_cellType = steps.m_cellType[j]; - m_hashGridMap[i * 8 + j] = cell; - } - } -} - -void ndIsoSurface::ndImplementation::ClearBuffers() -{ - D_TRACKTIME(); - m_triangles.SetCount(0); - m_hashGridMap.SetCount(0); - m_trianglesScratchBuffer.SetCount(0); - m_hashGridMapScratchBuffer.SetCount(0); -} - -//void ndIsoSurface::ndImplementation::BuildHighResolutionMesh(ndIsoSurface* const me, const ndArray& points, ndFloat32 gridSize, ndCalculateIsoValue* const computeIsoValue) -void ndIsoSurface::ndImplementation::BuildHighResolutionMesh(ndIsoSurface* const, const ndArray&, ndFloat32, ndCalculateIsoValue* const) -{ - D_TRACKTIME(); - ndAssert(0); - //CalculateAabb(points, gridSize); - //RemoveDuplicates(points); - //CreateGrids(); - //SortCellBuckects(); - //GenerateHighResIsoSurface(computeIsoValue); - //GenerateLowResIndexList(me); - //CalculateNormals(me); - //ClearBuffers(); -} - -void ndIsoSurface::ndImplementation::BuildLowResolutionMesh(ndIsoSurface* const me, const ndArray& points, ndFloat32 gridSize) -{ - D_TRACKTIME(); - CalculateAabb(points, gridSize); - RemoveDuplicates(points); - CreateGrids(); - SortCellBuckects(); - GenerateLowResIsoSurface(); - MakeTriangleList(me); - //GenerateLowResIndexList(me); - //CalculateNormals(me); - ClearBuffers(); -} - -ndIsoSurface::ndIsoSurface() - :m_origin(ndVector::m_zero) - ,m_points(1024) - ,m_implementation(new ndImplementation()) - ,m_gridSize(ndFloat32(1.0f)) - ,m_volumeSizeX(1) - ,m_volumeSizeY(1) - ,m_volumeSizeZ(1) - ,m_isLowRes(true) -{ -} - -ndIsoSurface::~ndIsoSurface() -{ - //GetImplementation().Clear(); - if (m_implementation) - { - delete m_implementation; - } -} - -void ndIsoSurface::GenerateMesh(const ndArray& pointCloud, ndFloat32 gridSize, ndCalculateIsoValue* const computeIsoValue) -{ - if (pointCloud.GetCount()) - { - if (!computeIsoValue) - { - m_isLowRes = true; - m_implementation->BuildLowResolutionMesh(this, pointCloud, gridSize); - } - else - { - ndAssert(0); - m_isLowRes = false; - m_implementation->BuildHighResolutionMesh(this, pointCloud, gridSize, computeIsoValue); - } - m_gridSize = gridSize; - m_origin = m_implementation->GetOrigin(); - m_volumeSizeX = m_implementation->m_volumeSizeX; - m_volumeSizeY = m_implementation->m_volumeSizeY; - m_volumeSizeZ = m_implementation->m_volumeSizeZ; - } -} - -ndInt32 ndIsoSurface::GenerateListIndexList(ndInt32* const indexList, ndInt32 strideInFloats, ndReal* const posit, ndReal* const normals) const -{ - ndInt32 vertexCount = 0; - if (m_isLowRes) - { - vertexCount = m_implementation->GenerateLowResIndexList(this, indexList, strideInFloats, posit, normals); - } - else - { - ndAssert(0); - } - return vertexCount; -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIsoSurface.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIsoSurface.h deleted file mode 100644 index 984f350f40..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndIsoSurface.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_ISO_SURFACE_H__ -#define __ND_ISO_SURFACE_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndArray.h" -#include "ndTree.h" - -class ndIsoSurface: public ndClassAlloc -{ - public: - class ndCalculateIsoValue - { - public: - ndCalculateIsoValue() - { - } - - virtual ~ndCalculateIsoValue() - { - } - - virtual ndFloat32 CalculateIsoValue(const ndVector& point) const = 0; - }; - - class ndImplementation; - - D_CORE_API ndIsoSurface(); - D_CORE_API ~ndIsoSurface(); - - ndVector GetOrigin() const; - const ndArray& GetPoints() const; - - D_CORE_API void GenerateMesh(const ndArray& pointCloud, ndFloat32 gridSize, ndCalculateIsoValue* const computeIsoValue = nullptr); - D_CORE_API ndInt32 GenerateListIndexList(ndInt32 * const indexList, ndInt32 strideInFloat32, ndReal* const posit, ndReal* const normals) const; - - private: - ndVector m_origin; - ndArray m_points; - ndImplementation* m_implementation; - ndFloat32 m_gridSize; - ndInt32 m_volumeSizeX; - ndInt32 m_volumeSizeY; - ndInt32 m_volumeSizeZ; - bool m_isLowRes; -}; - -inline const ndArray& ndIsoSurface::GetPoints() const -{ - return m_points; -} - -inline ndVector ndIsoSurface::GetOrigin() const -{ - return m_origin; -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndList.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndList.h deleted file mode 100644 index 5dd21accaa..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndList.h +++ /dev/null @@ -1,690 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_LIST_H__ -#define __ND_LIST_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndMemory.h" -#include "ndClassAlloc.h" -#include "ndContainersAlloc.h" - -template > -class ndList: public ndClassAlloc -{ - public: - class ndNode: public allocator - { - ndNode (ndNode* const prev, ndNode* const next) - :allocator() - ,m_info () - ,m_next(next) - ,m_prev(prev) - { - if (m_prev) - { - m_prev->m_next = this; - } - if (m_next) - { - m_next->m_prev = this; - } - } - - ndNode (const T &info, ndNode* const prev, ndNode* const next) - :allocator() - ,m_info (info) - ,m_next(next) - ,m_prev(prev) - { - if (m_prev) - { - m_prev->m_next = this; - } - if (m_next) - { - m_next->m_prev = this; - } - } - - ~ndNode() - { - } - - void Unlink () - { - if (m_prev) - { - m_prev->m_next = m_next; - } - if (m_next) - { - m_next->m_prev = m_prev; - } - m_prev = nullptr; - m_next = nullptr; - } - - void AddLast(ndNode* const node) - { - m_next = node; - node->m_prev = this; - } - - void AddFirst(ndNode* const node) - { - m_prev = node; - node->m_next = this; - } - - public: - T& GetInfo() - { - return m_info; - } - - ndNode *GetNext() const - { - return m_next; - } - - ndNode *GetPrev() const - { - return m_prev; - } - - private: - T m_info; - ndNode *m_next; - ndNode *m_prev; - friend class ndList; - }; - - class Iterator - { - public: - Iterator (const ndList &me) - { - m_ptr = nullptr; - m_list = (ndList *)&me; - } - - ~Iterator () - { - } - - operator ndInt32() const - { - return m_ptr != nullptr; - } - - bool operator== (const Iterator &target) const - { - return (m_ptr == target.m_ptr) && (m_list == target.m_list); - } - - void Begin() - { - m_ptr = m_list->GetFirst(); - } - - void End() - { - m_ptr = m_list->GetLast(); - } - - void Set (ndNode* const node) - { - m_ptr = node; - } - - void operator++ () - { - ndAssert (m_ptr); - m_ptr = m_ptr->m_next(); - } - - void operator++ (ndInt32) - { - ndAssert (m_ptr); - m_ptr = m_ptr->GetNext(); - } - - void operator-- () - { - ndAssert (m_ptr); - m_ptr = m_ptr->GetPrev(); - } - - void operator-- (ndInt32) - { - ndAssert (m_ptr); - m_ptr = m_ptr->GetPrev(); - } - - T &operator* () const - { - return m_ptr->GetInfo(); - } - - ndNode *GetNode() const - { - return m_ptr; - } - - private: - ndList *m_list; - ndNode *m_ptr; - }; - - // *********************************************************** - // member functions - // *********************************************************** - public: - ndList (); - ndList(const ndList& src); - ~ndList (); - - operator ndInt32() const; - ndInt32 GetCount() const; - ndNode* GetLast() const; - ndNode* GetFirst() const; - ndNode* Append (); - ndNode* Append (ndNode* const node); - ndNode* Append (const T &element); - ndNode* Addtop (); - ndNode* Addtop (ndNode* const node); - ndNode* Addtop (const T &element); - - void RotateToEnd (ndNode* const node); - void RotateToBegin (ndNode* const node); - void InsertAfter (ndNode* const root, ndNode* const node); - void InsertBefore (ndNode* const root, ndNode* const node); - - ndNode* Find (const T &element) const; - ndNode* GetNodeFromInfo (T &m_info) const; - void Remove (ndNode* const node); - void Remove (const T &element); - void RemoveAll (); - - void Merge (ndList& list); - void Unlink (ndNode* const node); - bool SanityCheck () const; - - static void FlushFreeList() - { - allocator::FlushFreeList(sizeof (ndNode)); - } - - protected: - // *********************************************************** - // member variables - // *********************************************************** - private: - ndNode* m_first; - ndNode* m_last; - ndInt32 m_count; - friend class ndNode; -}; - -template -ndList::ndList () - :ndClassAlloc() - ,m_first(nullptr) - ,m_last(nullptr) - ,m_count(0) -{ -} - -template -ndList::ndList(const ndList& src) - :ndClassAlloc() - ,m_first(src.m_first) - ,m_last(src.m_last) - ,m_count(src.m_count) -{ - //steal the members. - //yes I know this is wrong, I have to add the move semantic, - //but since my code predate move semantic, I will do my own steal - //this will work as long as src is empty - ndAssert(src.m_count == 0); - ndAssert(src.m_first == nullptr); - ndAssert(src.m_last == nullptr); -} - -template -ndList::~ndList () -{ - RemoveAll (); -} - -template -ndInt32 ndList::GetCount() const -{ - return m_count; -} - -template -ndList::operator ndInt32() const -{ - return m_first != nullptr; -} - -template -typename ndList::ndNode *ndList::GetFirst() const -{ - return m_first; -} - -template -typename ndList::ndNode *ndList::GetLast() const -{ - return m_last; -} - -template -typename ndList::ndNode *ndList::Append (ndNode* const node) -{ - ndAssert (node->m_next == nullptr); - ndAssert (node->m_prev == nullptr); - m_count ++; - if (m_first == nullptr) - { - m_last = node; - m_first = node; - } - else - { - m_last->AddLast (node); - m_last = node; - } -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - return m_last; -} - -template -typename ndList::ndNode *ndList::Append () -{ - m_count ++; - if (m_first == nullptr) - { - m_first = new ndNode(nullptr, nullptr); - m_last = m_first; - } - else - { - m_last = new ndNode(m_last, nullptr); - } -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - return m_last; -} - -template -typename ndList::ndNode *ndList::Append (const T &element) -{ - m_count ++; - if (m_first == nullptr) - { - m_first = new ndNode(element, nullptr, nullptr); - m_last = m_first; - } - else - { - m_last = new ndNode(element, m_last, nullptr); - } -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - - return m_last; -} - -template -typename ndList::ndNode *ndList::Addtop (ndNode* const node) -{ - ndAssert (node->m_next == nullptr); - ndAssert (node->m_prev == nullptr); - m_count ++; - if (m_last == nullptr) - { - m_last = node; - m_first = node; - } - else - { - m_first->AddFirst(node); - m_first = node; - } -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - return m_first; -} - -template -typename ndList::ndNode *ndList::Addtop () -{ - m_count ++; - if (m_last == nullptr) - { - m_last = new ndNode(nullptr, nullptr); - m_first = m_last; - } - else - { - m_first = new ndNode(nullptr, m_first); - } -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - return m_first; -} - -template -typename ndList::ndNode *ndList::Addtop (const T &element) -{ - m_count ++; - if (m_last == nullptr) - { - m_last = new ndNode(element, nullptr, nullptr); - m_first = m_last; - } - else - { - m_first = new ndNode(element, nullptr, m_first); - } -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - return m_first; -} - -template -void ndList::InsertAfter (ndNode* const root, ndNode* const node) -{ - ndAssert (root); - if (node != root) - { - if (root->m_next != node) - { - if (node == m_first) - { - m_first = node->m_next; - } - if (node == m_last) - { - m_last = node->m_prev; - } - node->Unlink (); - - node->m_prev = root; - node->m_next = root->m_next; - if (root->m_next) - { - root->m_next->m_prev = node; - } - root->m_next = node; - - if (node->m_next == nullptr) - { - m_last = node; - } - - ndAssert (m_last); - ndAssert (!m_last->m_next); - ndAssert (m_first); - ndAssert (!m_first->m_prev); - ndAssert (SanityCheck ()); - } - } -} - -template -void ndList::InsertBefore (ndNode* const root, ndNode* const node) -{ - ndAssert (root); - if (node != root) - { - if (root->m_prev != node) - { - if (node == m_last) - { - m_last = node->m_prev; - } - if (node == m_first) { - m_first = node->m_next; - } - node->Unlink (); - - node->m_next = root; - node->m_prev = root->m_prev; - if (root->m_prev) - { - root->m_prev->m_next = node; - } - root->m_prev = node; - - if (node->m_prev == nullptr) { - m_first = node; - } - - ndAssert (m_first); - ndAssert (!m_first->m_prev); - ndAssert (m_last); - ndAssert (!m_last->m_next); - ndAssert (SanityCheck ()); - } - } -} - -template -void ndList::RotateToEnd (ndNode* const node) -{ - if (node != m_last) - { - if (m_last != m_first) - { - if (node == m_first) - { - m_first = m_first->GetNext(); - } - node->Unlink(); - m_last->AddLast(node); - m_last = node; - } - } - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif -} - -template -void ndList::RotateToBegin (ndNode* const node) -{ - if (node != m_first) - { - if (m_last != m_first) - { - if (node == m_last) - { - m_last = m_last->GetPrev(); - } - node->Unlink(); - m_first->AddFirst(node); - m_first = node; - } - } - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif -} - -template -typename ndList::ndNode *ndList::Find (const T &element) const -{ - ndNode *node; - for (node = m_first; node; node = node->GetNext()) - { - if (element == node->m_info) - { - break; - } - } - return node; -} - -template -typename ndList::ndNode *ndList::GetNodeFromInfo (T &info) const -{ - ndNode* const node = (ndNode *) &info; - ndInt64 offset = ((char*) &node->m_info) - ((char *) node); - ndNode* const retnode = (ndNode *) (((char *) node) - offset); - - ndAssert (&retnode->GetInfo () == &info); - return retnode; -} - -template -void ndList::Remove (const T &element) -{ - ndNode *const node = Find (element); - if (node) - { - Remove (node); - } -} - -template -void ndList::Unlink (ndNode* const node) -{ - ndAssert (node); - - m_count --; - ndAssert (m_count >= 0); - - if (node == m_first) - { - m_first = m_first->GetNext(); - } - if (node == m_last) - { - m_last = m_last->GetPrev(); - } - node->Unlink(); - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif -} - -template -void ndList::Merge (ndList& list) -{ - m_count += list.m_count; - if (list.m_first) - { - list.m_first->m_prev = m_last; - } - if (m_last) - { - m_last->m_next = list.m_first; - } - m_last = list.m_last; - if (!m_first) - { - m_first = list.m_first; - } - - list.m_count = 0; - list.m_last = nullptr; - list.m_first = nullptr; -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif -} - -template -void ndList::Remove (ndNode* const node) -{ - Unlink (node); - delete node; -} - -template -void ndList::RemoveAll () -{ - for (ndNode *node = m_first; node; node = m_first) - { - m_count --; - m_first = node->GetNext(); - node->Unlink(); - delete node; - } - ndAssert (m_count == 0); - m_last = nullptr; - m_first = nullptr; -} - -template -bool ndList::SanityCheck () const -{ - #ifdef _DEBUG - ndInt32 tCount = 0; - for (ndNode * node = m_first; node; node = node->GetNext()) - { - tCount ++; - if (node->GetPrev()) { - ndAssert (node->GetPrev() != node->GetNext()); - if (node->GetPrev()->GetNext() != node) - { - ndAssert (0); - return false; - } - } - if (node->GetNext()) - { - ndAssert (node->GetPrev() != node->GetNext()); - if (node->GetNext()->GetPrev() != node) - { - ndAssert (0); - return false; - } - } - } - if (tCount != m_count) - { - ndAssert (0); - return false; - } - #endif - return true; -} - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMatrix.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMatrix.cpp deleted file mode 100644 index aecfaa1cb5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMatrix.cpp +++ /dev/null @@ -1,766 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndMatrix.h" -#include "ndQuaternion.h" -#include "ndGeneralMatrix.h" - -ndMatrix::ndMatrix (const ndMatrix& transformMatrix, const ndVector& scale, const ndMatrix& stretchAxis) -{ - const ndMatrix scaledAxis( - stretchAxis[0].Scale(scale[0]), - stretchAxis[1].Scale(scale[1]), - stretchAxis[2].Scale(scale[2]), - stretchAxis[3]); - *this = stretchAxis.Transpose3x3() * scaledAxis * transformMatrix; -} - -ndMatrix ndMatrix::Multiply3X3 (const ndMatrix &B) const -{ - return ndMatrix (B.m_front * m_front.BroadcastX() + B.m_up * m_front.BroadcastY() + B.m_right * m_front.BroadcastZ(), - B.m_front * m_up.BroadcastX() + B.m_up * m_up.BroadcastY() + B.m_right * m_up.BroadcastZ(), - B.m_front * m_right.BroadcastX() + B.m_up * m_right.BroadcastY() + B.m_right * m_right.BroadcastZ(), - ndVector::m_wOne); -} - -ndMatrix ndMatrix::operator* (const ndMatrix &B) const -{ - return ndMatrix (B.m_front * m_front.BroadcastX() + B.m_up * m_front.BroadcastY() + B.m_right * m_front.BroadcastZ() + B.m_posit * m_front.BroadcastW(), - B.m_front * m_up.BroadcastX() + B.m_up * m_up.BroadcastY() + B.m_right * m_up.BroadcastZ() + B.m_posit * m_up.BroadcastW(), - B.m_front * m_right.BroadcastX() + B.m_up * m_right.BroadcastY() + B.m_right * m_right.BroadcastZ() + B.m_posit * m_right.BroadcastW(), - B.m_front * m_posit.BroadcastX() + B.m_up * m_posit.BroadcastY() + B.m_right * m_posit.BroadcastZ() + B.m_posit * m_posit.BroadcastW()); -} - -void ndMatrix::TransformTriplex (ndFloat32* const dst, ndInt32 dstStrideInBytes, const ndFloat32* const src, ndInt32 srcStrideInBytes, ndInt32 count) const -{ - ndInt32 dstStride = ndInt32 (dstStrideInBytes /sizeof (ndFloat32)); - ndInt32 srcStride = ndInt32 (srcStrideInBytes / sizeof (ndFloat32)); - - ndInt32 dstIndex = 0; - ndInt32 srcIndex = 0; - for (ndInt32 i = 0 ; i < count; i ++ ) - { - ndFloat32 x = src[srcIndex + 0]; - ndFloat32 y = src[srcIndex + 1]; - ndFloat32 z = src[srcIndex + 2]; - srcIndex += srcStride; - dst[dstIndex + 0] = x * m_front.m_x + y * m_up.m_x + z * m_right.m_x + m_posit.m_x; - dst[dstIndex + 1] = x * m_front.m_y + y * m_up.m_y + z * m_right.m_y + m_posit.m_y; - dst[dstIndex + 2] = x * m_front.m_z + y * m_up.m_z + z * m_right.m_z + m_posit.m_z; - dstIndex += dstStride; - } -} - -#ifndef D_NEWTON_USE_DOUBLE -void ndMatrix::TransformTriplex (ndFloat64* const dst, ndInt32 dstStrideInBytes, const ndFloat64* const src, ndInt32 srcStrideInBytes, ndInt32 count) const -{ - ndInt32 dstStride = ndInt32 (dstStrideInBytes /sizeof (ndFloat64)); - ndInt32 srcStride = ndInt32 (srcStrideInBytes / sizeof (ndFloat64)); - - ndInt32 dstIndex = 0; - ndInt32 srcIndex = 0; - for (ndInt32 i = 0 ; i < count; i ++ ) - { - ndFloat64 x = src[srcIndex + 0]; - ndFloat64 y = src[srcIndex + 1]; - ndFloat64 z = src[srcIndex + 2]; - srcIndex += srcStride; - dst[dstIndex + 0] = x * m_front.m_x + y * m_up.m_x + z * m_right.m_x + m_posit.m_x; - dst[dstIndex + 1] = x * m_front.m_y + y * m_up.m_y + z * m_right.m_y + m_posit.m_y; - dst[dstIndex + 2] = x * m_front.m_z + y * m_up.m_z + z * m_right.m_z + m_posit.m_z; - dstIndex += dstStride; - } -} - -void ndMatrix::TransformTriplex (ndFloat64* const dst, ndInt32 dstStrideInBytes, const ndFloat32* const src, ndInt32 srcStrideInBytes, ndInt32 count) const -{ - ndInt32 dstStride = ndInt32 (dstStrideInBytes /sizeof (ndFloat64)); - ndInt32 srcStride = ndInt32 (srcStrideInBytes / sizeof (ndFloat32)); - - ndInt32 dstIndex = 0; - ndInt32 srcIndex = 0; - for (ndInt32 i = 0 ; i < count; i ++ ) - { - ndFloat64 x = src[srcIndex + 0]; - ndFloat64 y = src[srcIndex + 1]; - ndFloat64 z = src[srcIndex + 2]; - srcIndex += srcStride; - dst[dstIndex + 0] = x * m_front.m_x + y * m_up.m_x + z * m_right.m_x + m_posit.m_x; - dst[dstIndex + 1] = x * m_front.m_y + y * m_up.m_y + z * m_right.m_y + m_posit.m_y; - dst[dstIndex + 2] = x * m_front.m_z + y * m_up.m_z + z * m_right.m_z + m_posit.m_z; - dstIndex += dstStride; - } -} -#endif - -void ndMatrix::TransformBBox (const ndVector& p0local, const ndVector& p1local, ndVector& p0, ndVector& p1) const -{ - const ndMatrix& matrix = *this; - ndVector size ((p1local - p0local) * ndVector::m_half); - ndVector center (TransformVector ((p1local + p0local) * ndVector::m_half)); - ndVector extends (size.m_x * ndAbs(matrix[0][0]) + size.m_y * ndAbs(matrix[1][0]) + size.m_z * ndAbs(matrix[2][0]), - size.m_x * ndAbs(matrix[0][1]) + size.m_y * ndAbs(matrix[1][1]) + size.m_z * ndAbs(matrix[2][1]), - size.m_x * ndAbs(matrix[0][2]) + size.m_y * ndAbs(matrix[1][2]) + size.m_z * ndAbs(matrix[2][2]), ndFloat32 (0.0f)); - - p0 = center - extends; - p1 = center + extends; -} - -ndMatrix ndMatrix::Inverse4x4 () const -{ - ndMatrix tmp (*this); - ndMatrix inv (ndGetIdentityMatrix()); - for (ndInt32 i = 0; i < 4; ++i) - { - ndFloat32 pivot = ndAbs(tmp[i][i]); - if (pivot < ndFloat32(0.01f)) - { - ndInt32 permute = i; - for (ndInt32 j = i + 1; j < 4; ++j) - { - ndFloat32 pivot1 = ndAbs(tmp[j][i]); - if (pivot1 > pivot) - { - permute = j; - pivot = pivot1; - } - } - if (permute != i) - { - ndAssert(pivot > ndFloat32(0.0f)); - ndAssert((pivot > ndFloat32(1.0e-6f)) || (ndConditionNumber(4, 4, (ndFloat32*)&(*this)[0][0]) < ndFloat32(1.0e5f))); - ndSwap(inv[i], inv[permute]); - ndSwap(tmp[i], tmp[permute]); - } - } - - for (ndInt32 j = i + 1; j < 4; ++j) - { - ndVector scale (tmp[j][i] / tmp[i][i]); - tmp[j] -= tmp[i] * scale; - inv[j] -= inv[i] * scale; - tmp[j][i] = ndFloat32 (0.0f); - } - } - - for (ndInt32 i = 3; i >= 0; --i) - { - ndVector acc(ndVector::m_zero); - for (ndInt32 j = i + 1; j < 4; ++j) - { - ndVector pivot(tmp[i][j]); - acc += pivot * inv[j]; - } - ndVector den(ndFloat32(1.0f) / tmp[i][i]); - inv[i] = den * (inv[i] - acc); - } - -#ifdef _DEBUG - tmp = *this * inv; - for (ndInt32 i = 0; i < 4; ++i) - { - ndFloat32 error = tmp[i][i] - ndFloat32(1.0f); - ndAssert(ndAbs(error) < ndFloat32(1.0e-3f)); - for (ndInt32 j = i + 1; j < 4; ++j) - { - ndAssert(ndAbs(tmp[i][j]) < ndFloat32(1.0e-3f)); - ndAssert(ndAbs(tmp[j][i]) < ndFloat32(1.0e-3f)); - } - } -#endif - - return inv; -} - -//#pragma optimize( "", off ) -ndVector ndMatrix::SolveByGaussianElimination(const ndVector &v) const -{ - ndMatrix tmp(*this); - ndVector ret(v); - for (ndInt32 i = 0; i < 4; ++i) - { - ndFloat32 pivot = ndAbs(tmp[i][i]); - if (pivot < ndFloat32(0.01f)) - { - ndInt32 permute = i; - for (ndInt32 j = i + 1; j < 4; ++j) - { - ndFloat32 pivot1 = ndAbs(tmp[j][i]); - if (pivot1 > pivot) - { - permute = j; - pivot = pivot1; - } - } - - if (permute != i) - { - ndAssert(pivot > ndFloat32(1.0e-6f)); - ndSwap(ret[i], ret[permute]); - ndSwap(tmp[i], tmp[permute]); - } - } - - for (ndInt32 j = i + 1; j < 4; ++j) - { - const ndVector scale(tmp[j][i] / tmp[i][i]); - tmp[j] -= tmp[i] * scale; - ret[j] -= ret[i] * scale.GetScalar(); - tmp[j][i] = ndFloat32(0.0f); - } - } - - for (ndInt32 i = 3; i >= 0; --i) - { - const ndVector pivot(tmp[i] * ret); - ret[i] = (ret[i] - pivot.AddHorizontal().GetScalar() + tmp[i][i] * ret[i]) / tmp[i][i]; - } - - return ret; -} - -ndVector ndMatrix::CalcPitchYawRoll (ndVector& euler1) const -{ - const ndMatrix& matrix = *this; - ndAssert (matrix[2].DotProduct(matrix[0].CrossProduct(matrix[1])).GetScalar() > 0.0f); - ndAssert (ndAbs (matrix[2].DotProduct(matrix[0].CrossProduct(matrix[1])).GetScalar() - ndFloat32 (1.0f)) < ndFloat32 (1.0e-4f)); - - euler1 = ndVector::m_zero; - ndVector euler0(ndVector::m_zero); - - // Assuming the angles are in radians. - if (matrix[0][2] > ndFloat32 (0.99995f)) - { - ndFloat32 picth0 = -ndAtan2(matrix[2][1], matrix[1][1]); - ndFloat32 yaw0 = -ndFloat32(ndPi * ndFloat32 (0.5f)); - ndFloat32 roll0 = ndFloat32(0.0f); - - euler0[0] = picth0; - euler0[1] = yaw0; - euler0[2] = roll0; - - euler1[0] = picth0; - euler1[1] = yaw0; - euler1[2] = roll0; - } - else if (matrix[0][2] < ndFloat32 (-0.99995f)) - { - ndFloat32 picth0 = -ndAtan2(matrix[2][1], matrix[1][1]); - ndFloat32 yaw0 = ndFloat32(ndPi * ndFloat32(0.5f)); - ndFloat32 roll0 = ndFloat32(0.0f); - euler0[0] = picth0; - euler0[1] = yaw0; - euler0[2] = roll0; - - euler1[0] = picth0; - euler1[1] = yaw0; - euler1[2] = roll0; - } - else - { - ndFloat32 yaw0 = -ndAsin(matrix[0][2]); - ndFloat32 yaw1 = ndFloat32(ndPi) - yaw0; - - ndFloat32 picth0 = ndAtan2( matrix[1][2], matrix[2][2]); - ndFloat32 picth1 = ndAtan2(-matrix[1][2], -matrix[2][2]); - - ndFloat32 roll0 = ndAtan2( matrix[0][1], matrix[0][0]); - ndFloat32 roll1 = ndAtan2(-matrix[0][1], -matrix[0][0]); - - if (yaw1 > ndFloat32 (ndPi)) - { - yaw1 -= ndFloat32 (2.0f * ndPi); - } - - euler0[0] = picth0; - euler0[1] = yaw0; - euler0[2] = roll0; - - euler1[0] = picth1; - euler1[1] = yaw1; - euler1[2] = roll1; - } - - euler0[3] = ndFloat32(0.0f); - euler1[3] = ndFloat32(0.0f); - -#ifdef _DEBUG - ndMatrix m0 (ndPitchMatrix (euler0[0]) * ndYawMatrix(euler0[1]) * ndRollMatrix(euler0[2])); - ndMatrix m1 (ndPitchMatrix (euler1[0]) * ndYawMatrix(euler1[1]) * ndRollMatrix(euler1[2])); - for (ndInt32 i = 0; i < 3; ++i) - { - for (ndInt32 j = 0; j < 3; ++j) - { - ndFloat32 error = ndAbs (m0[i][j] - matrix[i][j]); - ndAssert (error < 5.0e-2f); - error = ndAbs (m1[i][j] - matrix[i][j]); - ndAssert (error < 5.0e-2f); - } - } -#endif - return euler0; -} - -void ndMatrix::PolarDecomposition (ndMatrix& transformMatrix, ndVector& scale, ndMatrix& stretchAxis) const -{ - // a polar decomposition decompose matrix A = O * S - // where S = sqrt (transpose (L) * L) - - const ndMatrix& me = *this; - ndFloat32 sign = ndSign (me[2].DotProduct(me[0].CrossProduct(me[1])).GetScalar()); - stretchAxis = me * Transpose3x3(); - scale = stretchAxis.EigenVectors(); - - // I need to deal with by seeing of some of the Scale are duplicated - // do this later (maybe by a given rotation around the non uniform axis but I do not know if it will work) - // for now just us the matrix - - scale[0] = sign * ndSqrt (scale[0]); - scale[1] = sign * ndSqrt (scale[1]); - scale[2] = sign * ndSqrt (scale[2]); - scale[3] = ndFloat32 (0.0f); - - ndMatrix scaledAxis; - scaledAxis[0] = stretchAxis[0].Scale (ndFloat32 (1.0f) / scale[0]); - scaledAxis[1] = stretchAxis[1].Scale (ndFloat32 (1.0f) / scale[1]); - scaledAxis[2] = stretchAxis[2].Scale (ndFloat32 (1.0f) / scale[2]); - scaledAxis[3] = stretchAxis[3]; - ndMatrix symetricInv (stretchAxis.Transpose3x3() * scaledAxis); - - transformMatrix = symetricInv * (*this); - transformMatrix.m_posit = m_posit; -} - -ndVector ndMatrix::EigenVectors () -{ - ndMatrix matrix (*this); - ndMatrix eigenVectors(ndGetIdentityMatrix()); - -#if 0 - if (dAbs(m_front.m_z) > dFloat32(1.0e-6f)) { - // calculate initial guess by convert to tridiagonal matrix using householder - // but this fail since it changes the oder of the Eigen values and Eigen vectors - dVector u(m_front); - u.m_x = dFloat32(0.0f); - dVector v(dVector::m_zero); - v.m_y = dSqrt(u.DotProduct(u).GetScalar()); - dVector w(u - v); - w = w.Normalize(); - eigenVectors = dMatrix(w, w); - dMatrix ident(dGetIdentityMatrix()); - eigenVectors[0] = ident[0] - eigenVectors[0] * dVector::m_two; - eigenVectors[1] = ident[1] - eigenVectors[1] * dVector::m_two; - eigenVectors[2] = ident[2] - eigenVectors[2] * dVector::m_two; - matrix = eigenVectors * matrix * eigenVectors; - } - matrix[0][2] = dFloat32(0.0f); - matrix[2][0] = dFloat32(0.0f); -#endif - - // QR algorithm is really bad at converging matrices with very different eigenvalue. - // the solution is to use RD with double shift which I do not feel like implementing. - // using Jacobi diagonalize instead - ndVector d (matrix[0][0], matrix[1][1], matrix[2][2], ndFloat32 (0.0f)); - ndVector b (d); - for (ndInt32 i = 0; i < 50; ++i) - { - ndFloat32 sm = matrix[0][1] * matrix[0][1] + matrix[0][2] * matrix[0][2] + matrix[1][2] * matrix[1][2]; - if (sm < ndFloat32 (1.0e-12f)) - { - // make sure the the Eigen vectors are orthonormal - //ndVector tmp (eigenVectors.m_front.CrossProduct(eigenVectors.m_up)); - //if (tmp.DotProduct(eigenVectors.m_right).GetScalar() < ndFloat32(0.0f)) { - // eigenVectors.m_right = eigenVectors.m_right * ndVector::m_negOne; - //} - ndAssert (eigenVectors[0].DotProduct(eigenVectors[1].CrossProduct(eigenVectors[2])).GetScalar() > ndFloat32 (0.0f)); - break; - } - - ndFloat32 thresh = ndFloat32 (0.0f); - if (i < 3) - { - thresh = (ndFloat32)(0.2f / 9.0f) * sm; - } - - ndVector z (ndVector::m_zero); - for (ndInt32 j = 0; j < 2; ++j) - { - for (ndInt32 k = j + 1; k < 3; ++k) - { - ndFloat32 g = ndFloat32 (100.0f) * ndAbs(matrix[j][k]); - if ((i > 3) && ((ndAbs(d[j]) + g) == ndAbs(d[j])) && ((ndAbs(d[k]) + g) == ndAbs(d[k]))) - { - matrix[j][k] = ndFloat32 (0.0f); - } - else if (ndAbs(matrix[j][k]) > thresh) - { - ndFloat32 t; - ndFloat32 h = d[k] - d[j]; - if (ndAbs(h) + g == ndAbs(h)) - { - t = matrix[j][k] / h; - } - else - { - ndFloat32 theta = ndFloat32 (0.5f) * h / matrix[j][k]; - t = ndFloat32(1.0f) / (ndAbs(theta) + ndSqrt(ndFloat32(1.0f) + theta * theta)); - if (theta < ndFloat32 (0.0f)) - { - t = -t; - } - } - ndFloat32 c = ndRsqrt (ndFloat32 (1.0f) + t * t); - ndFloat32 s = t * c; - ndFloat32 tau = s / (ndFloat32(1.0f) + c); - h = t * matrix[j][k]; - z[j] -= h; - z[k] += h; - d[j] -= h; - d[k] += h; - matrix[j][k] = ndFloat32(0.0f); - - for (ndInt32 n = 0; n <= j - 1; n ++) - { - ndFloat32 g0 = matrix[n][j]; - ndFloat32 h0 = matrix[n][k]; - matrix[n][j] = g0 - s * (h0 + g0 * tau); - matrix[n][k] = h0 + s * (g0 - h0 * tau); - } - for (ndInt32 n = j + 1; n <= k - 1; n ++) - { - ndFloat32 g0 = matrix[j][n]; - ndFloat32 h0 = matrix[n][k]; - matrix[j][n] = g0 - s * (h0 + g0 * tau); - matrix[n][k] = h0 + s * (g0 - h0 * tau); - } - for (ndInt32 n = k + 1; n < 3; n ++) - { - ndFloat32 g0 = matrix[j][n]; - ndFloat32 h0 = matrix[k][n]; - matrix[j][n] = g0 - s * (h0 + g0 * tau); - matrix[k][n] = h0 + s * (g0 - h0 * tau); - } - - ndVector sv (s); - ndVector tauv (tau); - ndVector gv (eigenVectors[j]); - ndVector hv (eigenVectors[k]); - eigenVectors[j] -= sv * (hv + gv * tauv); - eigenVectors[k] += sv * (gv - hv * tauv); - } - } - } - - b += z; - d = b; - } - -#ifdef _DEBUG___ - ndMatrix diag(ndGetIdentityMatrix()); - diag[0][0] = d[0]; - diag[1][1] = d[1]; - diag[2][2] = d[2]; - ndMatrix E(eigenVectors.Transpose3x3()); - ndMatrix originalMatrix(*this); - ndMatrix tempMatrix(E * diag * E.Transpose3x3()); - tempMatrix = tempMatrix.Inverse4x4(); - ndMatrix unitMatrix(tempMatrix* originalMatrix); - - for (ndInt32 j = 0; j < 3; ++j) - { - ndAssert(ndAbs(unitMatrix[j][j] - ndFloat32(1.0f)) < ndFloat32(1.0e-6f)); - for (ndInt32 k = j + 1; k < 3; ++k) - { - ndAssert(ndAbs(unitMatrix[k][j]) < ndFloat32(1.0e-6f)); - ndAssert(ndAbs(unitMatrix[j][k]) < ndFloat32(1.0e-6f)); - } - } - #endif - - *this = eigenVectors; - return d; -} - -const ndMatrix& ndGetIdentityMatrix() -{ - static ndMatrix identityMatrix( - ndVector(ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f)), - ndVector::m_wOne); - return identityMatrix; -} - -const ndMatrix& ndGetZeroMatrix() -{ - static ndMatrix zeroMatrix(ndVector::m_zero, ndVector::m_zero, ndVector::m_zero, ndVector::m_zero); - return zeroMatrix; -} - -ndMatrix ndPitchMatrix(ndFloat32 ang) -{ - ndFloat32 sinAng = ndSin(ang); - ndFloat32 cosAng = ndCos(ang); - return ndMatrix( - ndVector(ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.0f), cosAng, sinAng, ndFloat32(0.0f)), - ndVector(ndFloat32(0.0f), -sinAng, cosAng, ndFloat32(0.0f)), - ndVector::m_wOne); -} - -ndMatrix ndYawMatrix(ndFloat32 ang) -{ - ndFloat32 sinAng = ndSin(ang); - ndFloat32 cosAng = ndCos(ang); - return ndMatrix( - ndVector(cosAng, ndFloat32(0.0f), -sinAng, ndFloat32(0.0f)), - ndVector(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)), - ndVector(sinAng, ndFloat32(0.0f), cosAng, ndFloat32(0.0f)), - ndVector::m_wOne); -} - -ndMatrix ndRollMatrix(ndFloat32 ang) -{ - ndFloat32 sinAng = ndSin(ang); - ndFloat32 cosAng = ndCos(ang); - return ndMatrix(ndVector(cosAng, sinAng, ndFloat32(0.0f), ndFloat32(0.0f)), - ndVector(-sinAng, cosAng, ndFloat32(0.0f), ndFloat32(0.0f)), - ndVector(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f)), - ndVector::m_wOne); -} - -ndMatrix ndCalculateMatrix(const ndQuaternion& quat, const ndVector& position) -{ - ndAssert((quat.DotProduct(quat).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - const ndQuaternion quat0(quat); - const ndQuaternion quat1(quat0.Scale(ndFloat32(2.0f))); - - const ndFloat32 x2 = quat0.m_x * quat1.m_x; - const ndFloat32 y2 = quat0.m_y * quat1.m_y; - const ndFloat32 z2 = quat0.m_z * quat1.m_z; - -#ifdef _DEBUG - ndFloat32 w2 = quat0.m_w * quat1.m_w; - ndAssert(ndAbs(w2 + x2 + y2 + z2 - ndFloat32(2.0f)) < ndFloat32(1.0e-3f)); -#endif - - const ndFloat32 xy = quat0.m_x * quat1.m_y; - const ndFloat32 xz = quat0.m_x * quat1.m_z; - const ndFloat32 xw = quat0.m_x * quat1.m_w; - const ndFloat32 yz = quat0.m_y * quat1.m_z; - const ndFloat32 yw = quat0.m_y * quat1.m_w; - const ndFloat32 zw = quat0.m_z * quat1.m_w; - - ndVector front(ndFloat32(1.0f) - y2 - z2, xy + zw, xz - yw, ndFloat32(0.0f)); - ndVector up(xy - zw, ndFloat32(1.0f) - x2 - z2, yz + xw, ndFloat32(0.0f)); - ndVector right(xz + yw, yz - xw, ndFloat32(1.0f) - x2 - y2, ndFloat32(0.0f)); - //ndVector posit (position); - return ndMatrix(front, up, right, position); -} - -ndMatrix ndCovarianceMatrix(const ndVector& p, const ndVector& q) -{ - return ndMatrix(q * p.BroadcastX(), q * p.BroadcastY(), q * p.BroadcastZ(), ndVector::m_wOne); -} - -ndMatrix ndGramSchmidtMatrix(const ndVector& dir) -{ - ndVector right; - ndVector front((dir & ndVector::m_triplexMask).Normalize()); - - if (ndAbs(front.m_z) > ndFloat32(0.577f)) - { - right = front.CrossProduct(ndVector(-front.m_y, front.m_z, ndFloat32(0.0f), ndFloat32(0.0f))); - } - else - { - right = front.CrossProduct(ndVector(-front.m_y, front.m_x, ndFloat32(0.0f), ndFloat32(0.0f))); - } - right = right.Normalize(); - ndVector up (right.CrossProduct(front)); - - ndAssert(ndMatrix(front, up, right, ndVector::m_wOne).TestOrthogonal()); - return ndMatrix(front, up, right, ndVector::m_wOne); -} - -ndMatrix ndMatrix::Transpose3x3() const -{ - ndMatrix inv; - ndVector::Transpose4x4(inv[0], inv[1], inv[2], inv[3], m_front, m_up, m_right, ndVector::m_wOne); - return inv; -} - -ndMatrix ndMatrix::Transpose4X4() const -{ - ndMatrix inv; - ndVector::Transpose4x4(inv[0], inv[1], inv[2], inv[3], m_front, m_up, m_right, m_posit); - return inv; -} - -ndVector ndMatrix::RotateVector(const ndVector& v) const -{ - return m_front * v.BroadcastX() + m_up * v.BroadcastY() + m_right * v.BroadcastZ(); -} - -ndVector ndMatrix::UnrotateVector(const ndVector& v) const -{ - return v.OptimizedVectorUnrotate(m_front, m_up, m_right); -} - -ndVector ndMatrix::TransformVector(const ndVector& v) const -{ - return m_front * v.BroadcastX() + m_up * v.BroadcastY() + m_right * v.BroadcastZ() + m_posit; -} - -ndVector ndMatrix::TransformVector1x4(const ndVector& v) const -{ - return m_front * v.BroadcastX() + m_up * v.BroadcastY() + m_right * v.BroadcastZ() + m_posit * v.BroadcastW(); -} - -ndVector ndMatrix::UntransformVector(const ndVector& v) const -{ - return UnrotateVector(v - m_posit) | ndVector::m_wOne; -} - -ndPlane ndMatrix::TransformPlane(const ndPlane& localPlane) const -{ - return ndPlane(RotateVector(localPlane), localPlane.m_w - (localPlane.DotProduct(UnrotateVector(m_posit)).GetScalar())); -} - -ndPlane ndMatrix::UntransformPlane(const ndPlane& globalPlane) const -{ - return ndPlane(UnrotateVector(globalPlane), globalPlane.Evalue(m_posit)); -} - -ndMatrix ndMatrix::Inverse() const -{ - ndTrace(("funtion: %s deprecated, please use ndMatrix::OrthoInverse instead", __FUNCTION__)); - ndAssert(0); - return OrthoInverse(); -} - -ndMatrix ndMatrix::OrthoInverse() const -{ - ndMatrix inv; - ndVector::Transpose4x4(inv[0], inv[1], inv[2], inv[3], m_front, m_up, m_right, ndVector::m_wOne); - inv.m_posit -= inv[0] * m_posit.BroadcastX() + inv[1] * m_posit.BroadcastY() + inv[2] * m_posit.BroadcastZ(); - return inv; -} - -bool ndMatrix::TestIdentity() const -{ - const ndMatrix& me = *this; - for (ndInt32 i = 0; i < 4; ++i) - { - if (me[i][i] != ndFloat32(1.0f)) - { - return false; - } - for (ndInt32 j = i + 1; j < 4; ++j) - { - if (me[i][j] != ndFloat32(0.0f)) - { - return false; - } - if (me[j][i] != ndFloat32(0.0f)) - { - return false; - } - } - } - return true; -} - -bool ndMatrix::TestOrthogonal(ndFloat32 tol) const -{ -#ifdef _DEBUG - for (ndInt32 i = 0; i < 4; ++i) - { - for (ndInt32 j = 0; j < 4; ++j) - { - ndAssert(ndCheckFloat((*this)[i][j])); - } - } -#endif - - ndVector n(m_front.CrossProduct(m_up)); - ndFloat32 a = m_right.DotProduct(m_right).GetScalar(); - ndFloat32 b = m_up.DotProduct(m_up).GetScalar(); - ndFloat32 c = m_front.DotProduct(m_front).GetScalar(); - ndFloat32 d = n.DotProduct(m_right).GetScalar(); - bool ret = (m_front[3] == ndFloat32(0.0f)) && - (m_up[3] == ndFloat32(0.0f)) && - (m_right[3] == ndFloat32(0.0f)) && - (m_posit[3] == ndFloat32(1.0f)) && - (ndAbs(a - ndFloat32(1.0f)) < tol) && - (ndAbs(b - ndFloat32(1.0f)) < tol) && - (ndAbs(c - ndFloat32(1.0f)) < tol) && - (ndAbs(d - ndFloat32(1.0f)) < tol); - if (!ret) - { - ndAssert(0); - } - return ret; -} - -bool ndMatrix::TestSymetric3x3() const -{ - const ndMatrix& me = *this; - return (ndAbs(me[0][1] - me[1][0]) < ndFloat32(1.0e-5f)) && - (ndAbs(me[0][2] - me[2][0]) < ndFloat32(1.0e-5f)) && - (ndAbs(me[1][2] - me[2][1]) < ndFloat32(1.0e-5f)) && - (me[0][3] == ndFloat32(0.0f)) && - (me[1][3] == ndFloat32(0.0f)) && - (me[2][3] == ndFloat32(0.0f)) && - (me[3][0] == ndFloat32(0.0f)) && - (me[3][1] == ndFloat32(0.0f)) && - (me[3][2] == ndFloat32(0.0f)) && - (me[3][3] == ndFloat32(1.0f)); -} - -bool ndMatrix::SanityCheck() const -{ - if (ndAbs(m_right.m_w) > ndFloat32(0.0f)) - { - return false; - } - if (ndAbs(m_up.m_w) > ndFloat32(0.0f)) - { - return false; - } - if (ndAbs(m_right.m_w) > ndFloat32(0.0f)) - { - return false; - } - if (ndAbs(m_posit.m_w) != ndFloat32(1.0f)) - { - return false; - } - - ndVector right(m_front.CrossProduct(m_up)); - if (ndAbs(right.DotProduct(m_right).GetScalar()) < ndFloat32(0.9999f)) - { - return false; - } - return true; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMatrix.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMatrix.h deleted file mode 100644 index 47659d0450..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMatrix.h +++ /dev/null @@ -1,146 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MATRIX_H__ -#define __ND_MATRIX_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndDebug.h" -#include "ndPlane.h" -#include "ndVector.h" - -class ndMatrix; -class ndQuaternion; - -D_CORE_API const ndMatrix& ndGetZeroMatrix (); -D_CORE_API const ndMatrix& ndGetIdentityMatrix(); -D_CORE_API ndMatrix ndYawMatrix(ndFloat32 ang); -D_CORE_API ndMatrix ndRollMatrix(ndFloat32 ang); -D_CORE_API ndMatrix ndPitchMatrix(ndFloat32 ang); -D_CORE_API ndMatrix ndGramSchmidtMatrix(const ndVector& dir); -D_CORE_API ndMatrix ndCovarianceMatrix(const ndVector& p, const ndVector& q); -D_CORE_API ndMatrix ndCalculateMatrix(const ndQuaternion& rotation, const ndVector& position = ndVector::m_wOne); - -D_MSV_NEWTON_ALIGN_32 -class ndMatrix -{ - public: - D_OPERATOR_NEW_AND_DELETE - - ndMatrix (); - ndMatrix (const ndFloat32* const array); - ndMatrix (const ndVector &front, const ndVector &up, const ndVector &right, const ndVector &posit); - - // please use function ndCalculateMatrix() - //D_CORE_API ndMatrix (const ndQuaternion &rotation, const ndVector &position); - - // create a orthonormal normal vector basis, front become m_front vector, and m_up and m_right are mutualiperpendicular to fron and to each other - // please use function ndGramSchmidtMatrix - //ndMatrix (const ndVector &front); - - // create a covariance Matrix = transpose(p) * q - // please use function ndCovariance - //ndMatrix (const ndVector& p, const ndVector& q); - - ndVector& operator[] (ndInt32 i); - const ndVector& operator[] (ndInt32 i) const; - - D_CORE_API ndMatrix Inverse() const; - D_CORE_API ndMatrix OrthoInverse() const; - D_CORE_API ndMatrix Transpose3x3 () const; - D_CORE_API ndMatrix Transpose4X4 () const; - D_CORE_API ndVector RotateVector (const ndVector &v) const; - D_CORE_API ndVector UnrotateVector (const ndVector &v) const; - D_CORE_API ndVector TransformVector (const ndVector &v) const; - D_CORE_API ndVector UntransformVector (const ndVector &v) const; - D_CORE_API ndVector TransformVector1x4(const ndVector& v) const; - D_CORE_API ndPlane TransformPlane (const ndPlane &localPlane) const; - D_CORE_API ndPlane UntransformPlane (const ndPlane &globalPlane) const; - - D_CORE_API ndMatrix Inverse4x4() const; - D_CORE_API ndVector SolveByGaussianElimination(const ndVector &v) const; - D_CORE_API void TransformBBox (const ndVector& p0local, const ndVector& p1local, ndVector& p0, ndVector& p1) const; - - D_CORE_API ndVector CalcPitchYawRoll (ndVector& euler) const; - D_CORE_API void TransformTriplex (ndFloat32* const dst, ndInt32 dstStrideInBytes, const ndFloat32* const src, ndInt32 srcStrideInBytes, ndInt32 count) const; - -#ifndef D_NEWTON_USE_DOUBLE - D_CORE_API void TransformTriplex ( - ndFloat64* const dst, ndInt32 dstStrideInBytes, - const ndFloat64* const src, ndInt32 srcStrideInBytes, ndInt32 count) const; - - D_CORE_API void TransformTriplex ( - ndFloat64* const dst, ndInt32 dstStrideInBytes, - const ndFloat32* const src, ndInt32 srcStrideInBytes, ndInt32 count) const; -#endif - D_CORE_API bool SanityCheck() const; - D_CORE_API bool TestIdentity() const; - D_CORE_API bool TestSymetric3x3() const; - D_CORE_API bool TestOrthogonal(ndFloat32 tol = ndFloat32 (1.0e-4f)) const; - - D_CORE_API ndMatrix Multiply3X3 (const ndMatrix &B) const; - D_CORE_API ndMatrix operator* (const ndMatrix &B) const; - - // these function can only be called when ndMatrix is a PDS matrix - //void EigenVectors (); - D_CORE_API ndVector EigenVectors (); - D_CORE_API void PolarDecomposition (ndMatrix& transformMatrix, ndVector& scale, ndMatrix& stretchAxis) const; - - // constructor for polar composition - D_CORE_API ndMatrix (const ndMatrix& transformMatrix, const ndVector& scale, const ndMatrix& stretchAxis); - - ndVector m_front; - ndVector m_up; - ndVector m_right; - ndVector m_posit; -} D_GCC_NEWTON_ALIGN_32 ; - -inline ndMatrix::ndMatrix () -{ -} - -inline ndMatrix::ndMatrix (const ndFloat32* const array) -{ - ndMemCpy(&m_front.m_x, array, sizeof(ndMatrix) / sizeof (ndFloat32)); -} - -inline ndMatrix::ndMatrix (const ndVector &front, const ndVector &up, const ndVector &right, const ndVector &posit) - :m_front (front), m_up(up), m_right(right), m_posit(posit) -{ -} - -inline ndVector& ndMatrix::operator[] (ndInt32 i) -{ - ndAssert (i < 4); - ndAssert (i >= 0); - return (&m_front)[i]; -} - -inline const ndVector& ndMatrix::operator[] (ndInt32 i) const -{ - ndAssert (i < 4); - ndAssert (i >= 0); - return (&m_front)[i]; -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMemory.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMemory.cpp deleted file mode 100644 index df83a503a8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMemory.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndMemory.h" - -ndAtomic ndMemory::m_memoryUsed(0); - -static ndMemFreeCallback m_freeMemory = free; -static ndMemAllocCallback m_allocMemory = malloc; - -class ndMemoryHeader -{ - public: - void* m_ptr; - ndUnsigned32 m_bufferSize; - ndUnsigned32 m_requestedSize; -}; - -#define ndGetBufferPaddingInBytes size_t(D_MEMORY_ALIGMNET - 1 + sizeof (ndMemoryHeader)) - -size_t ndMemory::CalculateBufferSize(size_t size) -{ - return size + ndGetBufferPaddingInBytes; -} - -void* ndMemory::Malloc(size_t size) -{ - ndIntPtr metToVal; - size_t bufferSize = size + ndGetBufferPaddingInBytes; - metToVal.m_ptr = m_allocMemory(bufferSize); - ndUnsigned64 val = ndUnsigned64(metToVal.m_int) + ndGetBufferPaddingInBytes; - ndInt64 mask = -ndInt64(D_MEMORY_ALIGMNET); - val = val & mask; - ndMemoryHeader* const ret = (ndMemoryHeader*)val; - ndMemoryHeader* const info = ret - 1; - ndAssert((char*)info >= (char*)metToVal.m_ptr); - info->m_ptr = metToVal.m_ptr; - info->m_bufferSize = ndUnsigned32 (bufferSize); - info->m_requestedSize = ndUnsigned32(size); - m_memoryUsed.fetch_add(bufferSize); - return ret; -} - -void ndMemory::Free(void* const ptr) -{ - if (ptr) - { - ndMemoryHeader* const info = ((ndMemoryHeader*)ptr) - 1; - m_memoryUsed.fetch_sub(ndUnsigned64(info->m_bufferSize)); - m_freeMemory(info->m_ptr); - } -} - -size_t ndMemory::GetSize(void* const ptr) -{ - ndMemoryHeader* const info = ((ndMemoryHeader*)ptr) - 1; - return info->m_bufferSize; -} - -size_t ndMemory::GetOriginalSize(void* const ptr) -{ - ndMemoryHeader* const info = ((ndMemoryHeader*)ptr) - 1; - return info->m_requestedSize; -} - -ndUnsigned64 ndMemory::GetMemoryUsed() -{ - return m_memoryUsed.load(); -} - -void ndMemory::SetMemoryAllocators(ndMemAllocCallback alloc, ndMemFreeCallback free) -{ - m_freeMemory = free; - m_allocMemory = alloc; -} - -void ndMemory::GetMemoryAllocators(ndMemAllocCallback& alloc, ndMemFreeCallback& free) -{ - free = m_freeMemory; - alloc = m_allocMemory; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMemory.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMemory.h deleted file mode 100644 index b72159a49d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndMemory.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MEMORY_H__ -#define __ND_MEMORY_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndThreadSyncUtils.h" - -#define D_MEMORY_ALIGMNET 32 -typedef void* (*ndMemAllocCallback) (size_t size); -typedef void (*ndMemFreeCallback) (void* const ptr); - -class ndMemory -{ - public: - /// General Memory allocation function. - /// All memory allocations used by the Newton Engine and Tools - /// are performed by calling this function. - D_CORE_API static void* Malloc(size_t size); - - /// Destroy a memory buffer previously allocated by Malloc. - D_CORE_API static void Free(void* const ptr); - - /// Get memory buffer size previously allocated by Malloc. include extra align padding. - D_CORE_API static size_t GetSize(void* const ptr); - - /// Get memory buffer size previously allocated by Malloc. - D_CORE_API static size_t GetOriginalSize(void* const ptr); - - /// Calculate buffer size. - D_CORE_API static size_t CalculateBufferSize(size_t size); - - /// Return the total memory allocated by the newton engine and tools. - D_CORE_API static ndUnsigned64 GetMemoryUsed(); - - /// Install low level system memory allocation functions. - /// \param ndMemAllocCallback alloc: is a function pointer callback to allocate a memory chunk. - /// \param ndMemFreeCallback free: is a function pointer callback to free a memory chunk. - /// \brief All memory allocated by alloc, does not need to be aligned, therefore an application can - /// write them using standard malloc and free. - /// By default the memory allocation is set to call the standard - /// library functions malloc and free, however if an application wants to - /// keep track of how memory is used, it must install the memory callbacks - /// by calling this function before any class of the Newton Engine or tool - /// was created or instantiated. The engine does not do any global - /// allocation using global operators new and delete, therefore it - /// is ok to install the memory allocator on the main of the - /// application or just before start using the engine. - D_CORE_API static void SetMemoryAllocators(ndMemAllocCallback alloc, ndMemFreeCallback free); - D_CORE_API static void GetMemoryAllocators(ndMemAllocCallback& alloc, ndMemFreeCallback& free); - - private: - static ndAtomic m_memoryUsed; -}; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndNodeHierarchy.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndNodeHierarchy.h deleted file mode 100644 index 1a0443adcb..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndNodeHierarchy.h +++ /dev/null @@ -1,215 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_NODE_HIERARCHY_H__ -#define __ND_NODE_HIERARCHY_H__ - -#include "ndCoreStdafx.h" -#include "ndContainersAlloc.h" - -template -class ndNodeHierarchy: public ndContainersFreeListAlloc -{ - public: - ndNodeHierarchy (); - virtual T* CreateClone() const; - - void Attach(ndNodeHierarchy* const parent); - void Detach (); - - T* GetParent() const; - T* GetLastChild() const; - T* GetFirstChild() const; - - T* GetPrev() const; - T* GetNext () const; - T* GetRoot () const; - - T* GetFirstIterator() const; - T* GetNextIterator() const; - - protected: - ndNodeHierarchy (const ndNodeHierarchy& clone); - virtual ~ndNodeHierarchy (); - - ndNodeHierarchy* m_next; - ndNodeHierarchy* m_prev; - ndNodeHierarchy* m_parent; - ndNodeHierarchy* m_lastChild; - ndNodeHierarchy* m_firstChild; -}; - -template -ndNodeHierarchy::ndNodeHierarchy () - :ndContainersFreeListAlloc() - ,m_next(nullptr) - ,m_prev(nullptr) - ,m_parent(nullptr) - ,m_lastChild(nullptr) - ,m_firstChild(nullptr) -{ -} - -template -ndNodeHierarchy::ndNodeHierarchy (const ndNodeHierarchy& clone) - :ndContainersFreeListAlloc() - ,m_next(nullptr) - ,m_prev(nullptr) - ,m_parent(nullptr) - ,m_lastChild(nullptr) - ,m_firstChild(nullptr) -{ - for (ndNodeHierarchy* obj = clone.m_firstChild; obj; obj = obj->m_next) - { - T* const child = obj->CreateClone(); - child->Attach(this); - } -} - -template -ndNodeHierarchy::~ndNodeHierarchy () -{ - while (m_firstChild) - { - delete m_firstChild; - } - if (m_parent) - { - if (m_next) - { - m_next->m_prev = m_prev; - } - else - { - m_parent->m_lastChild = m_prev; - } - if (m_prev) - { - m_prev->m_next = m_next; - } - else - { - m_parent->m_firstChild = m_next; - } - } - else if (m_next) - { - m_next->m_prev = m_prev; - } - else if (m_prev) - { - m_prev->m_next = m_next; - } - m_next = nullptr; - m_prev = nullptr; - - ndAssert(!m_lastChild); - ndAssert(!m_firstChild); -} - -template -T* ndNodeHierarchy::CreateClone() const -{ - return (T*) new ndNodeHierarchy(*this); -} - -template -void ndNodeHierarchy::Attach(ndNodeHierarchy* const parent) -{ - ndAssert(parent); - ndAssert(!m_parent); - - m_parent = parent; - if (m_parent->m_firstChild) - { - ndAssert(!m_prev); - m_prev = m_parent->m_lastChild; - m_parent->m_lastChild->m_next = this; - } - else - { - m_parent->m_firstChild = this; - } - m_parent->m_lastChild = this; -} - -template -void ndNodeHierarchy::Detach() -{ - ndAssert(0); - //NodeBaseHierarchy::Detach (); -} - -template -T* ndNodeHierarchy::GetFirstChild () const -{ - return (T*)m_firstChild; -} - -template -T* ndNodeHierarchy::GetLastChild() const -{ - return (T*)m_lastChild; -} - -template -T* ndNodeHierarchy::GetNext() const -{ - return (T*)m_next; -} - -template -T* ndNodeHierarchy::GetPrev() const -{ - return (T*)m_prev; -} - -template -T* ndNodeHierarchy::GetParent () const -{ - return (T*) m_parent; -} - -template -T* ndNodeHierarchy::GetRoot () const -{ - const ndNodeHierarchy* root = this; - for (; root->m_parent; root = root->m_parent); - return (T*)root; -} - -template -T* ndNodeHierarchy::GetFirstIterator() const -{ - const ndNodeHierarchy* ptr = this; - for (; ptr->m_firstChild; ptr = ptr->m_firstChild); - return (T*)ptr; -} - -template -T* ndNodeHierarchy::GetNextIterator() const -{ - if (m_next) - { - return m_next->GetFirstIterator(); - } - - const ndNodeHierarchy* x = this; - const ndNodeHierarchy* ptr = m_parent; - for (; ptr && (x == ptr->m_next); ptr = ptr->m_parent) - { - x = ptr; - } - return (T*)ptr; -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPerlinNoise.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPerlinNoise.cpp deleted file mode 100644 index 727b622997..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPerlinNoise.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndPerlinNoise.h" - -// From Wikipedia page -//https://en.wikipedia.org/wiki/Perlin_noise - - -static const ndUnsigned8 seed[256] = -{ - 151, 160, 137, 91, 90, 15, - 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, - 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, 57, 177, 33, - 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, 166, - 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, - 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, - 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, - 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, - 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, - 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, 246, 97, 228, - 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, 249, 14, 239, 107, - 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, - 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180 -}; - -static inline ndFloat32 Interpolate(ndFloat32 t, ndFloat32 v1, ndFloat32 v2) -{ - return v1 + t * (v2 - v1); -} - -static inline ndFloat32 CubicSmoothing(ndFloat32 val) -{ - ndFloat32 val3 = val * val * val; - ndFloat32 val4 = val3 * val; - return 6.0f * val4 * val - 15.0f * val4 + 10.0f * val3; -} - -static inline ndFloat32 Gradient(ndInt32 x, ndFloat32 dx) -{ - ndInt32 h = seed[x & 255]; - return ((h & 1) ? -dx : dx); -} - -static inline ndFloat32 Gradient(int32_t x, int32_t y, ndFloat32 dx, ndFloat32 dy) -{ - int32_t h = seed[(seed[x & 255] + y) & 255]; - return ((h & 1) ? -dx : dx) + ((h & 2) ? -dy : dy); -} - -static inline ndFloat32 Gradient(int32_t x, int32_t y, int32_t z, ndFloat32 dx, ndFloat32 dy, ndFloat32 dz) -{ - int32_t h = seed[seed[seed[x & 255] + y & 255] + z & 255]; - h &= 15; - - // Ken Perlins original implementation - ndFloat32 u = h < 8 ? dx : dy; - ndFloat32 v = h < 4 ? dy : (h == 12 || h == 14) ? dx : dz; - return ((h & 1) ? -u : u) + ((h & 2) ? -v : v); -} - -ndFloat32 dPerlinNoise(ndFloat32 x) -{ - ndInt32 ix = ndInt32(ndFloor(x)); - ndFloat32 dx = x - (ndFloat32)ix; - - ndFloat32 w00 = Gradient(ix, dx); - ndFloat32 w10 = Gradient(ix + 1, dx - 1.0f); - ndFloat32 wx = CubicSmoothing(dx); - ndFloat32 x0 = Interpolate(wx, w00, w10); - return x0; -} - -ndFloat32 dPerlinNoise(ndFloat32 x, ndFloat32 y) -{ - ndInt32 ix = ndInt32(ndFloor(x)); - ndInt32 iy = ndInt32(ndFloor(y)); - ndFloat32 dx = x - (ndFloat32)ix; - ndFloat32 dy = y - (ndFloat32)iy; - - ndFloat32 w00 = Gradient(ix, iy, dx, dy); - ndFloat32 w10 = Gradient(ix + 1, iy, dx - 1.0f, dy); - ndFloat32 w01 = Gradient(ix, iy + 1, dx, dy - 1.0f); - ndFloat32 w11 = Gradient(ix + 1, iy + 1, dx - 1.0f, dy - 1.0f); - - ndFloat32 wx = CubicSmoothing(dx); - ndFloat32 wy = CubicSmoothing(dy); - - ndFloat32 x0 = Interpolate(wx, w00, w10); - ndFloat32 x1 = Interpolate(wx, w01, w11); - - return Interpolate(wy, x0, x1); -} - -ndFloat32 dPerlinNoise(ndFloat32 x, ndFloat32 y, ndFloat32 z) -{ - ndInt32 ix = ndInt32(ndFloor(x)); - ndInt32 iy = ndInt32(ndFloor(y)); - ndInt32 iz = ndInt32(ndFloor(z)); - - ndFloat32 dx = x - (ndFloat32)ix; - ndFloat32 dy = y - (ndFloat32)iy; - ndFloat32 dz = z - (ndFloat32)iz; - - ndFloat32 w000 = Gradient(ix, iy, iz, dx, dy, dz); - ndFloat32 w100 = Gradient(ix + 1, iy, iz, dx - 1, dy, dz); - ndFloat32 w010 = Gradient(ix, iy + 1, iz, dx, dy - 1, dz); - ndFloat32 w110 = Gradient(ix + 1, iy + 1, iz, dx - 1, dy - 1, dz); - ndFloat32 w001 = Gradient(ix, iy, iz + 1, dx, dy, dz - 1); - ndFloat32 w101 = Gradient(ix + 1, iy, iz + 1, dx - 1, dy, dz - 1); - ndFloat32 w011 = Gradient(ix, iy + 1, iz + 1, dx, dy - 1, dz - 1); - ndFloat32 w111 = Gradient(ix + 1, iy + 1, iz + 1, dx - 1, dy - 1, dz - 1); - - ndFloat32 wx = CubicSmoothing(dx); - ndFloat32 wy = CubicSmoothing(dy); - ndFloat32 wz = CubicSmoothing(dz); - - ndFloat32 x00 = Interpolate(wx, w000, w100); - ndFloat32 x10 = Interpolate(wx, w010, w110); - ndFloat32 x01 = Interpolate(wx, w001, w101); - ndFloat32 x11 = Interpolate(wx, w011, w111); - - ndFloat32 y0 = Interpolate(wy, x00, x10); - ndFloat32 y1 = Interpolate(wy, x01, x11); - - return Interpolate(wz, y0, y1); -} - -ndFloat32 BrownianMotion(ndInt32 octaves, ndFloat32 persistence, ndFloat32 x) -{ - ndFloat32 noise = ndFloat32 (0.0f); - ndFloat32 amplitud = ndFloat32 (1.0f); - ndFloat32 frequency = ndFloat32 (1.0f); - - for (ndInt32 i = 0; i < octaves; ++i) - { - ndFloat32 fx = x * frequency; - noise += amplitud * dPerlinNoise(fx); - amplitud *= persistence; - frequency *= ndFloat32 (2.0f); - } - return noise; -} - -ndFloat32 BrownianMotion(ndInt32 octaves, ndFloat32 persistence, ndFloat32 x, ndFloat32 y) -{ - ndFloat32 noise = ndFloat32 (0.0f); - ndFloat32 amplitud = ndFloat32 (1.0f); - ndFloat32 frequency = ndFloat32 (1.0f); - - for (ndInt32 i = 0; i < octaves; ++i) - { - ndFloat32 fx = x * frequency; - ndFloat32 fy = y * frequency; - noise += amplitud * dPerlinNoise (fx, fy); - amplitud *= persistence; - frequency *= ndFloat32 (2.0f); - } - return noise; -} - -ndFloat32 BrownianMotion(ndInt32 octaves, ndFloat32 persistence, ndFloat32 x, ndFloat32 y, ndFloat32 z) -{ - ndFloat32 noise = ndFloat32 (0.0f); - ndFloat32 amplitud = ndFloat32 (1.0f); - ndFloat32 frequency = ndFloat32 (1.0f); - - for (ndInt32 i = 0; i < octaves; ++i) - { - ndFloat32 fx = x * frequency; - ndFloat32 fy = y * frequency; - ndFloat32 fz = z * frequency; - noise += amplitud * dPerlinNoise(fx, fy, fz); - amplitud *= persistence; - frequency *= ndFloat32 (2.0f); - } - return noise; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPerlinNoise.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPerlinNoise.h deleted file mode 100644 index ca221a1012..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPerlinNoise.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_PERLIN_NOISE_H__ -#define __ND_PERLIN_NOISE_H__ - -#include "ndCoreStdafx.h" - -D_CORE_API ndFloat32 dPerlinNoise(ndFloat32 x); -D_CORE_API ndFloat32 dPerlinNoise(ndFloat32 x, ndFloat32 y); -D_CORE_API ndFloat32 dPerlinNoise(ndFloat32 x, ndFloat32 y, ndFloat32 z); - -D_CORE_API ndFloat32 BrownianMotion(ndInt32 octaves, ndFloat32 persistence, ndFloat32 x); -D_CORE_API ndFloat32 BrownianMotion(ndInt32 octaves, ndFloat32 persistence, ndFloat32 x, ndFloat32 y); -D_CORE_API ndFloat32 BrownianMotion(ndInt32 octaves, ndFloat32 persistence, ndFloat32 x, ndFloat32 y, ndFloat32 z); -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPlane.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPlane.h deleted file mode 100644 index b18ca0567c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPlane.h +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_PLANE_H__ -#define __ND_PLANE_H__ - -#include "ndCoreStdafx.h" -#include "ndVector.h" - - -#ifdef D_NEWTON_USE_DOUBLE - #define ndPlane ndBigPlane -#else - -D_MSV_NEWTON_ALIGN_16 -class ndPlane: public ndVector -{ - public: - ndPlane (); - ndPlane (const ndVector& point); - ndPlane (ndFloat32 x, ndFloat32 y, ndFloat32 z, ndFloat32 w); - ndPlane (const ndVector &normal, ndFloat32 distance); - ndPlane (const ndVector &P0, const ndVector &P1, const ndVector &P2); - ndPlane Scale (ndFloat32 s) const; - ndFloat32 Evalue (const ndFloat32* const point) const; - ndFloat32 Evalue (const ndVector &point) const; -} D_GCC_NEWTON_ALIGN_32 ; - -#endif - -class ndBigPlane: public ndBigVector -{ - public: - ndBigPlane (); - ndBigPlane (const ndBigVector& point); - ndBigPlane (ndFloat64 x, ndFloat64 y, ndFloat64 z, ndFloat64 w); - ndBigPlane (const ndBigVector &normal, ndFloat64 distance); - ndBigPlane (const ndBigVector &P0, const ndBigVector &P1, const ndBigVector &P2); - ndBigPlane Scale (ndFloat64 s) const; - ndFloat64 Evalue (const ndFloat64* const point) const; - ndFloat64 Evalue (const ndBigVector &point) const; -}; - -#ifndef D_NEWTON_USE_DOUBLE - -inline ndPlane::ndPlane () - :ndVector () -{ -} - -inline ndPlane::ndPlane (const ndVector& point) - :ndVector (point) -{ -} - -inline ndPlane::ndPlane (ndFloat32 x, ndFloat32 y, ndFloat32 z, ndFloat32 w) - :ndVector (x, y, z, w) -{ -} - -inline ndPlane::ndPlane (const ndVector &normal, ndFloat32 distance) - :ndVector (normal) -{ - m_w = distance; -} - -inline ndPlane::ndPlane (const ndVector &P0, const ndVector &P1, const ndVector &P2) - :ndVector ((P1 - P0).CrossProduct(P2 - P0)) -{ - m_w = - DotProduct(P0 & ndVector::m_triplexMask).GetScalar(); -} - -inline ndPlane ndPlane::Scale (ndFloat32 s) const -{ - return ndPlane(*this * ndVector(s)); -} - -inline ndFloat32 ndPlane::Evalue (const ndFloat32* const point) const -{ - ndVector p (point); - return DotProduct ((p & m_triplexMask) | m_wOne).GetScalar(); -} - -inline ndFloat32 ndPlane::Evalue (const ndVector& point) const -{ - return DotProduct ((point & m_triplexMask) | m_wOne).GetScalar(); -} -#endif - - -inline ndBigPlane::ndBigPlane () - :ndBigVector () -{ -} - -inline ndBigPlane::ndBigPlane (const ndBigVector& point) - :ndBigVector (point) -{ -} - -inline ndBigPlane::ndBigPlane (ndFloat64 x, ndFloat64 y, ndFloat64 z, ndFloat64 w) - :ndBigVector (x, y, z, w) -{ -} - -inline ndBigPlane::ndBigPlane (const ndBigVector &normal, ndFloat64 distance) - :ndBigVector (normal) -{ - m_w = distance; -} - -inline ndBigPlane::ndBigPlane (const ndBigVector &P0, const ndBigVector &P1, const ndBigVector &P2) - :ndBigVector ((P1 - P0).CrossProduct(P2 - P0)) -{ - m_w = - DotProduct(P0 & ndBigVector::m_triplexMask).GetScalar(); -} - -inline ndBigPlane ndBigPlane::Scale (ndFloat64 s) const -{ - return ndBigPlane (m_x * s, m_y * s, m_z * s, m_w * s); -} - -inline ndFloat64 ndBigPlane::Evalue (const ndFloat64* const point) const -{ - return m_x * point[0] + m_y * point[1] + m_z * point[2] + m_w; -} - - -inline ndFloat64 ndBigPlane::Evalue (const ndBigVector &point) const -{ - return m_x * point.m_x + m_y * point.m_y + m_z * point.m_z + m_w; -} - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupBuilder.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupBuilder.cpp deleted file mode 100644 index b34212e812..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupBuilder.cpp +++ /dev/null @@ -1,1241 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -/**************************************************************************** -* -* Visual C++ 6.0 created by: Julio Jerez -* -****************************************************************************/ -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndList.h" -#include "ndTree.h" -#include "ndStack.h" -#include "ndPolyhedra.h" -#include "ndPolygonSoupBuilder.h" - -#define ND_POINTS_RUN (512 * 1024) - -class ndPolygonSoupBuilder::ndFaceInfo -{ - public: - ndInt32 indexCount; - ndInt32 indexStart; -}; - -class ndPolygonSoupBuilder::ndFaceBucket: public ndList -{ - public: - ndFaceBucket () - :ndList() - { - } -}; - -class ndPolygonSoupBuilder::ndFaceMap: public ndTree -{ - public: - ndFaceMap (ndPolygonSoupBuilder& builder) - :ndTree() - { - ndInt32 polygonIndex = 0; - ndInt32 faceCount = ndInt32(builder.m_faceVertexCount.GetCount()); - const ndInt32* const faceVertexCounts = &builder.m_faceVertexCount[0]; - const ndInt32* const faceVertexIndex = &builder.m_vertexIndex[0]; - for (ndInt32 i = 0; i < faceCount; ++i) - { - ndInt32 count = faceVertexCounts[i]; - ndInt32 attribute = faceVertexIndex[polygonIndex + count - 1]; - - ndNode* node = Find(attribute); - if (!node) - { - ndFaceBucket tmp; - node = Insert(tmp, attribute); - } - - ndFaceBucket& bucket = node->GetInfo(); - ndFaceInfo& face = bucket.Append()->GetInfo(); - face.indexCount = count; - face.indexStart = polygonIndex; - polygonIndex += count; - } - } -}; - -class ndPolygonSoupBuilder::ndPolySoupFilterAllocator: public ndPolyhedra -{ - public: - ndPolySoupFilterAllocator () - :ndPolyhedra () - { - } - - ~ndPolySoupFilterAllocator () - { - } - - ndInt32 AddFilterFace (ndUnsigned32 count, ndInt32* const pool) - { - BeginFace(); - ndAssert (count); - bool reduction = true; - while (reduction && !AddFace (ndInt32 (count), pool)) - { - reduction = false; - if (count >3) - { - for (ndUnsigned32 i = 0; i < count; ++i) - { - for (ndUnsigned32 j = i + 1; j < count; ++j) - { - if (pool[j] == pool[i]) - { - for (i = j; i < count - 1; ++i) - { - pool[i] = pool[i + 1]; - } - count --; - i = count; - reduction = true; - break; - } - } - } - } - } - EndFace(); - return reduction ? ndInt32 (count) : 0; - } -}; - -ndPolygonSoupBuilder::ndPolygonSoupBuilder () - :m_faceVertexCount() - ,m_vertexIndex() - ,m_normalIndex() - ,m_vertexPoints() - ,m_normalPoints() -{ - m_run = ND_POINTS_RUN; -} - -ndPolygonSoupBuilder::ndPolygonSoupBuilder (const ndPolygonSoupBuilder& source) - :m_faceVertexCount(ndInt32(source.m_faceVertexCount.GetCount())) - ,m_vertexIndex(ndInt32(source.m_vertexIndex.GetCount())) - ,m_normalIndex() - ,m_vertexPoints(ndInt32(source.m_vertexPoints.GetCount())) - ,m_normalPoints() -{ - m_run = ND_POINTS_RUN; - m_faceVertexCount.SetCount(source.m_faceVertexCount.GetCount()); - m_vertexIndex.SetCount(source.m_vertexIndex.GetCount()); - m_vertexPoints.SetCount(source.m_vertexPoints.GetCount()); - - ndMemCpy(&m_vertexIndex[0], &source.m_vertexIndex[0], source.m_vertexIndex.GetCount()); - ndMemCpy(&m_faceVertexCount[0], &source.m_faceVertexCount[0], source.m_faceVertexCount.GetCount()); - ndMemCpy(&m_vertexPoints[0], &source.m_vertexPoints[0], source.m_vertexPoints.GetCount()); - - if (m_normalPoints.GetCount()) - { - m_normalIndex.Resize(source.m_normalIndex.GetCount()); - m_normalPoints.Resize(source.m_normalPoints.GetCount()); - m_normalIndex.SetCount(source.m_normalIndex.GetCount()); - m_normalPoints.SetCount(source.m_normalPoints.GetCount()); - - ndMemCpy(&m_normalIndex[0], &source.m_normalIndex[0], source.m_normalIndex.GetCount()); - ndMemCpy(&m_normalPoints[0], &source.m_normalPoints[0], source.m_normalPoints.GetCount()); - } -} - -ndPolygonSoupBuilder::~ndPolygonSoupBuilder () -{ -} - -void ndPolygonSoupBuilder::Begin() -{ - m_run = ND_POINTS_RUN; - m_vertexIndex.SetCount(0); - m_normalIndex.SetCount(0); - m_vertexPoints.SetCount(0); - m_normalPoints.SetCount(0); - m_faceVertexCount.SetCount(0); -} - -void ndPolygonSoupBuilder::SavePLY(const char* const fileName) const -{ - FILE* const file = fopen(fileName, "wb"); - - fprintf(file, "ply\n"); - fprintf(file, "format ascii 1.0\n"); - - fprintf(file, "element vertex %d\n", ndInt32(m_vertexPoints.GetCount())); - fprintf(file, "property float x\n"); - fprintf(file, "property float y\n"); - fprintf(file, "property float z\n"); - fprintf(file, "element face %d\n", ndInt32(m_faceVertexCount.GetCount())); - fprintf(file, "property list uchar int vertex_index\n"); - fprintf(file, "end_header\n"); - - for (ndInt32 i = 0; i < m_vertexPoints.GetCount(); ++i) - { - const ndBigVector& point = m_vertexPoints[i]; - fprintf(file, "%f %f %f\n", point.m_x, point.m_y, point.m_z); - } - - ndInt32 index = 0; - for (ndInt32 i = 0; i < m_faceVertexCount.GetCount(); ++i) - { - ndInt32 count = m_faceVertexCount[i]; - fprintf(file, "%d", count - 1); - for (ndInt32 j = 0; j < count - 1; ++j) - { - fprintf(file, " %d", m_vertexIndex[index + j]); - } - index += count; - fprintf(file, "\n"); - } - fclose(file); -} - -void ndPolygonSoupBuilder::LoadPLY(const char* const fileName) -{ - FILE* const file = fopen(fileName, "rb"); - - char line[1024]; - char* ret0 = nullptr; - ndInt32 ret1 = 0; - ret0 = fgets(line, sizeof (line) - 1, file); - if (!strncmp(line, "ply", 3)) - { - ndInt32 faceCount; - ndInt32 vertexCount; - ret0 = fgets(line, sizeof(line) - 1, file); - ret1 = fscanf(file, "%s %s %d\n", line, line, &vertexCount); - ret0 = fgets(line, sizeof(line) - 1, file); - ret0 = fgets(line, sizeof(line) - 1, file); - ret0 = fgets(line, sizeof(line) - 1, file); - ret1 = fscanf(file, "%s %s %d\n", line, line, &faceCount); - ret0 = fgets(line, sizeof(line) - 1, file); - ret0 = fgets(line, sizeof(line) - 1, file); - - ndArray vertexArray; - vertexArray.SetCount(vertexCount); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - ndReal x; - ndReal y; - ndReal z; - ret1 = fscanf(file, "%f %f %f", &x, &y, &z); - vertexArray[i] = ndBigVector(ndFloat32(x), ndFloat32(y), ndFloat32(z), ndFloat32(0.0f)); - } - - Begin(); - ndVector face[64]; - for (ndInt32 i = 0; i < faceCount; ++i) - { - ndInt32 indexCount; - ret1 = fscanf(file, "%d", &indexCount); - for (ndInt32 j = 0; j < indexCount; ++j) - { - ndInt32 index; - ret1 = fscanf(file, "%d", &index); - face[j] = vertexArray[index]; - } - AddFace(&face[0].m_x, sizeof (ndVector), indexCount, 0); - } - } - fclose(file); -} - -void ndPolygonSoupBuilder::AddFaceIndirect(const ndFloat32* const vertex, ndInt32 strideInBytes, ndInt32 faceId, const ndInt32* const indexArray, ndInt32 indexCount) -{ - ndInt32 faces[32]; - ndInt32 pool[512]; - - const ndInt32 vertexCount = ndInt32(m_vertexPoints.GetCount()); - const ndInt32 stride = ndInt32 (strideInBytes / sizeof(ndFloat32)); - for (ndInt32 i = 0; i < indexCount; ++i) - { - pool[i] = i + vertexCount; - const ndInt32 j = indexArray[i] * stride; - ndBigVector point(vertex[j + 0], vertex[j + 1], vertex[j + 2], ndFloat32(0.0f)); - m_vertexPoints.PushBack (point); - } - - ndInt32 convexFaces = 0; - if (indexCount == 3) - { - convexFaces = 1; - ndBigVector p0(m_vertexPoints[pool[2]]); - for (ndInt32 j = 0; j < 3; ++j) - { - ndBigVector p1(m_vertexPoints[pool[j]]); - ndBigVector edge(p1 - p0); - ndFloat64 mag2 = edge.DotProduct(edge).GetScalar(); - if (mag2 < ndFloat32(1.0e-12f)) - { - ndAssert(0); - ndTrace(("rejecting degenerated face, edge too small\n")); - convexFaces = 0; - } - p0 = p1; - } - - if (convexFaces) - { - ndBigVector edge0(m_vertexPoints[pool[2]] - m_vertexPoints[pool[0]]); - ndBigVector edge1(m_vertexPoints[pool[1]] - m_vertexPoints[pool[0]]); - ndAssert(edge0.m_w == ndFloat32(0.0f)); - ndAssert(edge1.m_w == ndFloat32(0.0f)); - ndBigVector normal(edge0.CrossProduct(edge1)); - ndFloat64 mag2 = normal.DotProduct(normal).GetScalar(); - if (mag2 < ndFloat32(1.0e-12f)) - { - ndAssert(0); - ndTrace(("rejecting degenerated face, area too small\n")); - convexFaces = 0; - } - } - - if (convexFaces) - { - faces[0] = 3; - } - } - else - { - convexFaces = AddConvexFace(indexCount, pool, faces); - } - - ndInt32 indexAcc = 0; - for (ndInt32 j = 0; j < convexFaces; ++j) - { - ndInt32 count1 = faces[j]; - for (ndInt32 m = 0; m < count1; m++) - { - m_vertexIndex.PushBack(pool[indexAcc + m]); - } - m_vertexIndex.PushBack(faceId); - indexAcc += count1; - count1++; - m_faceVertexCount.PushBack(count1); - } - - m_run -= indexCount; - if (m_run <= 0) - { - PackArray(); - } -} - -void ndPolygonSoupBuilder::AddFace(const ndFloat32* const vertex, ndInt32 strideInBytes, ndInt32 vertexCount, const ndInt32 faceId) -{ - ndInt32 indexArray[1024]; - ndAssert(vertexCount < ndInt32 (sizeof(indexArray)/sizeof (indexArray[0]))); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - indexArray[i] = i; - } - AddFaceIndirect(vertex, strideInBytes, faceId, indexArray, vertexCount); -} - -void ndPolygonSoupBuilder::PackArray() -{ - ndStack indexMapPool (ndInt32(m_vertexPoints.GetCount())); - ndInt32* const indexMap = &indexMapPool[0]; - ndInt32 vertexCount = ndVertexListToIndexList(&m_vertexPoints[0].m_x, sizeof (ndBigVector), 3, ndInt32(m_vertexPoints.GetCount()), &indexMap[0], ndFloat32 (1.0e-6f)); - - ndInt32 k = 0; - for (ndInt32 i = 0; i < m_faceVertexCount.GetCount(); ++i) - { - ndInt32 count = m_faceVertexCount[i] - 1; - for (ndInt32 j = 0; j < count; ++j) - { - ndInt32 index = m_vertexIndex[k]; - index = indexMap[index]; - m_vertexIndex[k] = index; - k ++; - } - k ++; - } - - m_vertexPoints.Resize(vertexCount); - m_vertexPoints.SetCount(vertexCount); - m_run = ND_POINTS_RUN; -} - -void ndPolygonSoupBuilder::Finalize() -{ - const ndInt32 faceCount = ndInt32(m_faceVertexCount.GetCount()); - if (faceCount) - { - ndStack indexMapPool(ndInt32(m_vertexPoints.GetCount())); - - ndInt32* const indexMap = &indexMapPool[0]; - ndInt32 vertexCount = ndVertexListToIndexList(&m_vertexPoints[0].m_x, sizeof (ndBigVector), 3, ndInt32(m_vertexPoints.GetCount()), &indexMap[0], ndFloat32 (1.0e-4f)); - ndAssert(vertexCount <= m_vertexPoints.GetCount()); - m_vertexPoints.SetCount(vertexCount); - - ndInt32 k = 0; - for (ndInt32 i = 0; i < faceCount; ++i) - { - ndInt32 count = m_faceVertexCount[i] - 1; - for (ndInt32 j = 0; j < count; ++j) - { - ndInt32 index = m_vertexIndex[k]; - index = indexMap[index]; - m_vertexIndex[k] = index; - k ++; - } - k ++; - } - OptimizeByIndividualFaces(); - } -} - -void ndPolygonSoupBuilder::FinalizeAndOptimize(ndInt32 id) -{ - Finalize(); - ndPolyhedra polyhedra; - ndPolygonSoupBuilder source(*this); - ndPolygonSoupBuilder leftOver; - ndInt32 tmpIndexPool[1024]; - ndVector tmpVertexPool[1024]; - - Begin(); - leftOver.Begin(); - polyhedra.BeginFace (); - ndInt32 attribute = id; - ndInt32 faceIndexNumber = 0; - for (ndInt32 i = 0; i < source.m_faceVertexCount.GetCount(); ++i) - { - ndInt32 indexCount = source.m_faceVertexCount[i]; - ndAssert (indexCount < 1024); - - ndEdge* const face = polyhedra.AddFace(indexCount - 1, &source.m_vertexIndex[faceIndexNumber]); - if (!face) - { - for (ndInt32 j = 0; j < indexCount - 1; ++j) - { - ndInt32 index = source.m_vertexIndex[faceIndexNumber + j]; - tmpVertexPool[j] = source.m_vertexPoints[index]; - tmpIndexPool[j] = j; - } - leftOver.AddFaceIndirect(&tmpVertexPool[0].m_x, sizeof (ndVector), attribute, tmpIndexPool, indexCount - 1); - } - else - { - // set the attribute - ndEdge* ptr = face; - do - { - ptr->m_userData = ndUnsigned64 (attribute); - ptr = ptr->m_next; - } while (ptr != face); - } - faceIndexNumber += indexCount; - } - polyhedra.EndFace(); - - ndPolyhedra facesLeft; - facesLeft.BeginFace(); - polyhedra.ConvexPartition (&source.m_vertexPoints[0].m_x, sizeof (ndBigVector), &facesLeft); - facesLeft.EndFace(); - - ndInt32 mark = polyhedra.IncLRU(); - ndPolyhedra::Iterator iter (polyhedra); - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - if (edge->m_incidentFace < 0) - { - continue; - } - if (edge->m_mark == mark) - { - continue; - } - - ndEdge* ptr = edge; - ndInt32 indexCount = 0; - do - { - ptr->m_mark = mark; - tmpVertexPool[indexCount] = source.m_vertexPoints[ptr->m_incidentVertex]; - tmpIndexPool[indexCount] = indexCount; - indexCount ++; - ptr = ptr->m_next; - } while (ptr != edge); - - if (indexCount >= 3) - { - //AddMesh (&tmpVertexPool[0].m_x, indexCount, sizeof (tmpVertexPool[0]), 1, &indexCount, tmpIndexPool, &attribute, dGetIdentityMatrix()); - AddFaceIndirect(&tmpVertexPool[0].m_x, sizeof (ndVector), attribute, tmpIndexPool, indexCount); - } - } - - mark = facesLeft.IncLRU(); - ndPolyhedra::Iterator iter1 (facesLeft); - for (iter1.Begin(); iter1; iter1 ++) - { - ndEdge* const edge = &(*iter1); - if (edge->m_incidentFace < 0) - { - continue; - } - if (edge->m_mark == mark) - { - continue; - } - - ndEdge* ptr = edge; - ndInt32 indexCount = 0; - do - { - ptr->m_mark = mark; - tmpVertexPool[indexCount] = source.m_vertexPoints[ptr->m_incidentVertex]; - tmpIndexPool[indexCount] = indexCount; - indexCount ++; - ptr = ptr->m_next; - } while (ptr != edge); - if (indexCount >= 3) - { - //AddMesh (&tmpVertexPool[0].m_x, indexCount, sizeof (ndVector), 1, &indexCount, tmpIndexPool, &attribute, dGetIdentityMatrix()); - AddFaceIndirect(&tmpVertexPool[0].m_x, sizeof(ndVector), attribute, tmpIndexPool, indexCount); - } - } - - faceIndexNumber = 0; - for (ndInt32 i = 0; i < leftOver.m_faceVertexCount.GetCount(); ++i) - { - ndInt32 indexCount = leftOver.m_faceVertexCount[i] - 1; - for (ndInt32 j = 0; j < indexCount; ++j) - { - ndInt32 index = leftOver.m_vertexIndex[faceIndexNumber + j]; - tmpVertexPool[j] = leftOver.m_vertexPoints[index]; - tmpIndexPool[j] = j; - } - AddFaceIndirect(&tmpVertexPool[0].m_x, sizeof(ndVector), attribute, tmpIndexPool, indexCount); - - faceIndexNumber += (indexCount + 1); - } - - Finalize(); -} - -void ndPolygonSoupBuilder::OptimizeByIndividualFaces() -{ - ndInt32* const faceArray = &m_faceVertexCount[0]; - ndInt32* const indexArray = &m_vertexIndex[0]; - - ndInt32* const oldFaceArray = &m_faceVertexCount[0]; - ndInt32* const oldIndexArray = &m_vertexIndex[0]; - - ndInt32 polygonIndex = 0; - ndInt32 newFaceCount = 0; - ndInt32 newIndexCount = 0; - for (ndInt32 i = 0; i < m_faceVertexCount.GetCount(); ++i) - { - ndInt32 oldCount = oldFaceArray[i]; - ndInt32 count = FilterFace (oldCount - 1, &oldIndexArray[polygonIndex]); - if (count) - { - faceArray[newFaceCount] = count + 1; - for (ndInt32 j = 0; j < count; ++j) - { - indexArray[newIndexCount + j] = oldIndexArray[polygonIndex + j]; - } - indexArray[newIndexCount + count] = oldIndexArray[polygonIndex + oldCount - 1]; - newFaceCount ++; - newIndexCount += (count + 1); - } - polygonIndex += oldCount; - } - ndAssert (polygonIndex == m_vertexIndex.GetCount()); - - m_vertexIndex.Resize(newIndexCount); - m_faceVertexCount.Resize(newFaceCount); - m_vertexIndex.SetCount(newIndexCount); - m_faceVertexCount.SetCount(newFaceCount); -} - -void ndPolygonSoupBuilder::End(bool optimize) -{ - if (optimize) - { - ndPolygonSoupBuilder copy (*this); - ndFaceMap faceMap (copy); - - Begin(); - ndFaceMap::Iterator iter (faceMap); - for (iter.Begin(); iter; iter ++) - { - const ndFaceBucket& bucket = iter.GetNode()->GetInfo(); - Optimize(iter.GetNode()->GetKey(), bucket, copy); - } - } - Finalize(); - - // build the normal array and adjacency array - ndInt32 indexCount = 0; - const ndInt32 faceCount = ndInt32(m_faceVertexCount.GetCount()); - if (faceCount) - { - // calculate all face the normals - m_normalPoints.Resize(faceCount); - m_normalPoints.SetCount(faceCount); - for (ndInt32 i = 0; i < faceCount; ++i) - { - ndInt32 faceIndexCount = m_faceVertexCount[i]; - - const ndInt32* const ptr = &m_vertexIndex[indexCount]; - ndBigVector v0(&m_vertexPoints[ptr[0]].m_x); - ndBigVector v1(&m_vertexPoints[ptr[1]].m_x); - ndBigVector e0(v1 - v0); - ndBigVector normal0(ndBigVector::m_zero); - for (ndInt32 j = 2; j < faceIndexCount - 1; ++j) - { - ndBigVector v2(&m_vertexPoints[ptr[j]].m_x); - ndBigVector e1(v2 - v0); - normal0 += e0.CrossProduct(e1); - e0 = e1; - } - ndBigVector normal(normal0.Normalize()); - - m_normalPoints[i].m_x = normal.m_x; - m_normalPoints[i].m_y = normal.m_y; - m_normalPoints[i].m_z = normal.m_z; - m_normalPoints[i].m_w = ndFloat32(0.0f); - indexCount += faceIndexCount; - } - - m_normalIndex.Resize(faceCount);; - m_normalIndex.SetCount(faceCount); - ndInt32 normalCount = ndVertexListToIndexList(&m_normalPoints[0].m_x, sizeof(ndBigVector), 3, faceCount, &m_normalIndex[0], ndFloat32(1.0e-6f)); - ndAssert(normalCount <= m_normalPoints.GetCount()); - m_normalPoints.SetCount(normalCount); - } -} - -void ndPolygonSoupBuilder::Optimize(ndInt32 faceId, const ndFaceBucket& faceBucket, const ndPolygonSoupBuilder& source) -{ - #define DG_MESH_PARTITION_SIZE (1024 * 4) - - const ndInt32* const indexArray = &source.m_vertexIndex[0]; - const ndBigVector* const points = &source.m_vertexPoints[0]; - - ndVector face[256]; - ndInt32 faceIndex[256]; - if (faceBucket.GetCount() >= DG_MESH_PARTITION_SIZE) - { - ndStack array(faceBucket.GetCount()); - ndInt32 count = 0; - for (ndFaceBucket::ndNode* node = faceBucket.GetFirst(); node; node = node->GetNext()) - { - array[count] = node; - count ++; - } - - ndInt32 stack = 1; - ndInt32 segments[32][2]; - - segments[0][0] = 0; - segments[0][1] = count; - - while (stack) - { - stack --; - ndInt32 faceStart = segments[stack][0]; - ndInt32 faceCount = segments[stack][1]; - - if (faceCount <= DG_MESH_PARTITION_SIZE) - { - ndPolygonSoupBuilder tmpBuilder; - for (ndInt32 i = 0; i < faceCount; ++i) - { - const ndFaceInfo& faceInfo = array[faceStart + i]->GetInfo(); - - ndInt32 count1 = faceInfo.indexCount - 1; - ndInt32 start1 = faceInfo.indexStart; - ndAssert (faceId == indexArray[start1 + count1]); - for (ndInt32 j = 0; j < count1; ++j) - { - ndInt32 index = indexArray[start1 + j]; - face[j] = points[index]; - faceIndex[j] = j; - } - tmpBuilder.AddFaceIndirect(&face[0].m_x, sizeof(ndVector), faceId, faceIndex, count1); - } - tmpBuilder.FinalizeAndOptimize (faceId); - - ndInt32 faceIndexNumber = 0; - for (ndInt32 i = 0; i < ndInt32(tmpBuilder.m_faceVertexCount.GetCount()); ++i) - { - ndInt32 indexCount = tmpBuilder.m_faceVertexCount[i] - 1; - for (ndInt32 j = 0; j < indexCount; ++j) - { - ndInt32 index = tmpBuilder.m_vertexIndex[faceIndexNumber + j]; - face[j] = tmpBuilder.m_vertexPoints[index]; - faceIndex[j] = j; - } - AddFaceIndirect(&face[0].m_x, sizeof(ndVector), faceId, faceIndex, indexCount); - faceIndexNumber += (indexCount + 1); - } - } - else - { - ndBigVector median (ndBigVector::m_zero); - ndBigVector varian (ndBigVector::m_zero); - for (ndInt32 i = 0; i < faceCount; ++i) - { - const ndFaceInfo& faceInfo = array[faceStart + i]->GetInfo(); - ndInt32 count1 = faceInfo.indexCount - 1; - ndInt32 start1 = faceInfo.indexStart; - ndBigVector p0 (ndFloat32 ( 1.0e10f), ndFloat32 ( 1.0e10f), ndFloat32 ( 1.0e10f), ndFloat32 (0.0f)); - ndBigVector p1 (ndFloat32 (-1.0e10f), ndFloat32 (-1.0e10f), ndFloat32 (-1.0e10f), ndFloat32 (0.0f)); - for (ndInt32 j = 0; j < count1; ++j) - { - ndInt32 index = indexArray[start1 + j]; - const ndBigVector& p = points[index]; - ndAssert(p.m_w == ndFloat32(0.0f)); - p0 = p0.GetMin(p); - p1 = p1.GetMax(p); - } - ndBigVector p ((p0 + p1).Scale (0.5f)); - median += p; - varian += p * p; - } - - varian = varian.Scale (ndFloat32 (faceCount)) - median * median; - - ndInt32 axis = 0; - ndFloat32 maxVarian = ndFloat32 (-1.0e10f); - for (ndInt32 i = 0; i < 3; ++i) - { - if (varian[i] > maxVarian) - { - axis = i; - maxVarian = ndFloat32 (varian[i]); - } - } - ndBigVector center = median.Scale (ndFloat32 (1.0f) / ndFloat32 (faceCount)); - ndFloat64 axisVal = center[axis]; - - ndInt32 leftCount = 0; - ndInt32 lastFace = faceCount; - - for (ndInt32 i = 0; i < lastFace; ++i) - { - ndInt32 side = 0; - const ndFaceInfo& faceInfo = array[faceStart + i]->GetInfo(); - - ndInt32 start1 = faceInfo.indexStart; - ndInt32 count1 = faceInfo.indexCount - 1; - for (ndInt32 j = 0; j < count1; ++j) - { - ndInt32 index = indexArray[start1 + j]; - const ndBigVector& p = points[index]; - if (p[axis] > axisVal) - { - side = 1; - break; - } - } - - if (side) - { - ndSwap (array[faceStart + i], array[faceStart + lastFace - 1]); - lastFace --; - i --; - } - else - { - leftCount ++; - } - } - ndAssert (leftCount); - ndAssert (leftCount < faceCount); - - segments[stack][0] = faceStart; - segments[stack][1] = leftCount; - stack ++; - - segments[stack][0] = faceStart + leftCount; - segments[stack][1] = faceCount - leftCount; - stack ++; - } - } - } - else - { - ndPolygonSoupBuilder tmpBuilder; - for (ndFaceBucket::ndNode* node = faceBucket.GetFirst(); node; node = node->GetNext()) - { - const ndFaceInfo& faceInfo = node->GetInfo(); - - ndInt32 count = faceInfo.indexCount - 1; - ndInt32 start = faceInfo.indexStart; - ndAssert (faceId == indexArray[start + count]); - for (ndInt32 j = 0; j < count; ++j) - { - ndInt32 index = indexArray[start + j]; - face[j] = points[index]; - faceIndex[j] = j; - } - tmpBuilder.AddFaceIndirect(&face[0].m_x, sizeof(ndVector), faceId, faceIndex, count); - } - tmpBuilder.FinalizeAndOptimize (faceId); - - ndInt32 faceIndexNumber = 0; - for (ndInt32 i = 0; i < ndInt32(tmpBuilder.m_faceVertexCount.GetCount()); ++i) - { - ndInt32 indexCount = tmpBuilder.m_faceVertexCount[i] - 1; - for (ndInt32 j = 0; j < indexCount; ++j) - { - ndInt32 index = tmpBuilder.m_vertexIndex[faceIndexNumber + j]; - face[j] = tmpBuilder.m_vertexPoints[index]; - faceIndex[j] = j; - } - AddFaceIndirect(&face[0].m_x, sizeof(ndVector), faceId, faceIndex, indexCount); - - faceIndexNumber += (indexCount + 1); - } - } -} - -ndInt32 ndPolygonSoupBuilder::FilterFace (ndInt32 count, ndInt32* const pool) -{ - if (count == 3) - { - ndBigVector p0 (m_vertexPoints[pool[2]]); - for (ndInt32 i = 0; i < 3; ++i) - { - ndBigVector p1 (m_vertexPoints[pool[i]]); - ndBigVector edge (p1 - p0); - ndFloat64 mag2 = edge.DotProduct(edge).GetScalar(); - if (mag2 < ndFloat32 (1.0e-6f)) - { - count = 0; - } - p0 = p1; - } - - if (count == 3) - { - ndBigVector edge0 (m_vertexPoints[pool[2]] - m_vertexPoints[pool[0]]); - ndBigVector edge1 (m_vertexPoints[pool[1]] - m_vertexPoints[pool[0]]); - ndBigVector normal (edge0.CrossProduct(edge1)); - - ndAssert(edge0.m_w == ndFloat32(0.0f)); - ndAssert(edge1.m_w == ndFloat32(0.0f)); - ndAssert (normal.m_w == ndFloat32 (0.0f)); - ndFloat64 mag2 = normal.DotProduct(normal).GetScalar(); - if (mag2 < ndFloat32 (1.0e-8f)) - { - count = 0; - } - } - } - else - { - ndPolySoupFilterAllocator polyhedra; - count = polyhedra.AddFilterFace (ndUnsigned32 (count), pool); - - if (!count) - { - return 0; - } - - ndEdge* edge = &polyhedra.GetRoot()->GetInfo(); - if (edge->m_incidentFace < 0) - { - edge = edge->m_twin; - } - - bool flag = true; - while (flag) - { - flag = false; - if (count >= 3) - { - ndEdge* ptr = edge; - ndBigVector p0 (&m_vertexPoints[ptr->m_incidentVertex].m_x); - p0 = p0 & ndBigVector::m_triplexMask; - do - { - ndBigVector p1 (&m_vertexPoints[ptr->m_next->m_incidentVertex].m_x); - p1 = p1 & ndBigVector::m_triplexMask; - ndBigVector e0 (p1 - p0); - ndFloat64 mag2 = e0.DotProduct(e0).GetScalar(); - if (mag2 < ndFloat32 (1.0e-6f)) - { - count --; - flag = true; - edge = ptr->m_next; - ptr->m_prev->m_next = ptr->m_next; - ptr->m_next->m_prev = ptr->m_prev; - ptr->m_twin->m_next->m_prev = ptr->m_twin->m_prev; - ptr->m_twin->m_prev->m_next = ptr->m_twin->m_next; - break; - } - p0 = p1; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - if (count >= 3) - { - flag = true; - ndBigVector normal (polyhedra.FaceNormal (edge, &m_vertexPoints[0].m_x, sizeof (ndBigVector))); - ndAssert (normal.m_w == ndFloat32 (0.0f)); - - ndAssert (normal.DotProduct(normal).GetScalar() > ndFloat32 (1.0e-10f)); - normal = normal.Scale (ndFloat64 (1.0f) / sqrt (normal.DotProduct(normal).GetScalar() + ndFloat32 (1.0e-24f))); - - while (flag) - { - flag = false; - if (count >= 3) - { - ndEdge* ptr = edge; - - ndBigVector p0 (&m_vertexPoints[ptr->m_prev->m_incidentVertex].m_x); - ndBigVector p1 (&m_vertexPoints[ptr->m_incidentVertex].m_x); - - p0 = p0 & ndBigVector::m_triplexMask; - p1 = p1 & ndBigVector::m_triplexMask; - ndBigVector e0 (p1 - p0); - e0 = e0.Scale (ndFloat64 (1.0f) / sqrt (e0.DotProduct(e0).GetScalar() + ndFloat32(1.0e-24f))); - do - { - ndBigVector p2 (&m_vertexPoints[ptr->m_next->m_incidentVertex].m_x); - p2 = p2 & ndBigVector::m_triplexMask; - ndBigVector e1 (p2 - p1); - - e1 = e1.Scale (ndFloat64 (1.0f) / sqrt (e1.DotProduct(e1).GetScalar() + ndFloat32(1.0e-24f))); - ndFloat64 mag2 = e1.DotProduct(e0).GetScalar(); - if (mag2 > ndFloat32 (0.9999f)) - { - count --; - flag = true; - edge = ptr->m_next; - ptr->m_prev->m_next = ptr->m_next; - ptr->m_next->m_prev = ptr->m_prev; - ptr->m_twin->m_next->m_prev = ptr->m_twin->m_prev; - ptr->m_twin->m_prev->m_next = ptr->m_twin->m_next; - break; - } - - ndBigVector n (e0.CrossProduct(e1)); - ndAssert (n.m_w == ndFloat32 (0.0f)); - mag2 = n.DotProduct(normal).GetScalar(); - if (mag2 < ndFloat32 (1.0e-5f)) - { - count --; - flag = true; - edge = ptr->m_next; - ptr->m_prev->m_next = ptr->m_next; - ptr->m_next->m_prev = ptr->m_prev; - ptr->m_twin->m_next->m_prev = ptr->m_twin->m_prev; - ptr->m_twin->m_prev->m_next = ptr->m_twin->m_next; - break; - } - - e0 = e1; - p1 = p2; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - } - - ndEdge* first = edge; - if (count >= 3) - { - ndFloat64 best = ndFloat32 (2.0f); - ndEdge* ptr = edge; - - ndBigVector p0 (&m_vertexPoints[ptr->m_incidentVertex].m_x); - ndBigVector p1 (&m_vertexPoints[ptr->m_next->m_incidentVertex].m_x); - p0 = p0 & ndBigVector::m_triplexMask; - p1 = p1 & ndBigVector::m_triplexMask; - ndBigVector e0 (p1 - p0); - e0 = e0.Scale (ndFloat64 (1.0f) / sqrt (e0.DotProduct(e0).GetScalar() + ndFloat32(1.0e-24f))); - do - { - ndBigVector p2 (&m_vertexPoints[ptr->m_next->m_next->m_incidentVertex].m_x); - p2 = p2 & ndBigVector::m_triplexMask; - ndBigVector e1 (p2 - p1); - - e1 = e1.Scale (ndFloat64 (1.0f) / sqrt (e1.DotProduct(e1).GetScalar() + ndFloat32(1.0e-24f))); - ndFloat64 mag2 = fabs (e1.DotProduct(e0).GetScalar()); - if (mag2 < best) - { - best = mag2; - first = ptr; - } - - e0 = e1; - p1 = p2; - ptr = ptr->m_next; - } while (ptr != edge); - - count = 0; - ptr = first; - do - { - pool[count] = ptr->m_incidentVertex; - count ++; - ptr = ptr->m_next; - } while (ptr != first); - } - - #ifdef _DEBUG - if (count >= 3) - { - ndInt32 j0 = count - 2; - ndInt32 j1 = count - 1; - ndBigVector normal (polyhedra.FaceNormal (edge, &m_vertexPoints[0].m_x, sizeof (ndBigVector))); - ndAssert (normal.m_w == ndFloat32 (0.0f)); - for (ndInt32 j2 = 0; j2 < count; j2 ++) - { - ndBigVector p0 (&m_vertexPoints[pool[j0]].m_x); - ndBigVector p1 (&m_vertexPoints[pool[j1]].m_x); - ndBigVector p2 (&m_vertexPoints[pool[j2]].m_x); - p0 = p0 & ndBigVector::m_triplexMask; - p1 = p1 & ndBigVector::m_triplexMask; - p2 = p2 & ndBigVector::m_triplexMask; - - ndBigVector e0 ((p0 - p1)); - ndBigVector e1 ((p2 - p1)); - - ndBigVector n (e1.CrossProduct(e0)); - ndAssert (n.DotProduct(normal).GetScalar() > ndFloat32 (0.0f)); - j0 = j1; - j1 = j2; - } - } - #endif - } - - return (count >= 3) ? count : 0; -} - -ndInt32 ndPolygonSoupBuilder::AddConvexFace (ndInt32 count, ndInt32* const pool, ndInt32* const facesArray) -{ - ndPolySoupFilterAllocator polyhedra; - - count = polyhedra.AddFilterFace(ndUnsigned32 (count), pool); - - ndEdge* edge = &polyhedra.GetRoot()->GetInfo(); - if (edge->m_incidentFace < 0) - { - edge = edge->m_twin; - } - - ndInt32 isconvex = 1; - ndInt32 facesCount = 0; - - ndInt32 flag = 1; - while (flag) - { - flag = 0; - if (count >= 3) - { - ndEdge* ptr = edge; - - ndBigVector p0 (&m_vertexPoints[ptr->m_incidentVertex].m_x); - do - { - ndBigVector p1 (&m_vertexPoints[ptr->m_next->m_incidentVertex].m_x); - ndBigVector e0 (p1 - p0); - ndFloat64 mag2 = e0.DotProduct(e0).GetScalar(); - if (mag2 < ndFloat32 (1.0e-6f)) - { - count --; - flag = 1; - edge = ptr->m_next; - ptr->m_prev->m_next = ptr->m_next; - ptr->m_next->m_prev = ptr->m_prev; - ptr->m_twin->m_next->m_prev = ptr->m_twin->m_prev; - ptr->m_twin->m_prev->m_next = ptr->m_twin->m_next; - break; - } - p0 = p1; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - if (count >= 3) - { - flag = 1; - - while (flag) - { - flag = 0; - if (count >= 3) - { - ndEdge* ptr = edge; - - ndBigVector p0 (&m_vertexPoints[ptr->m_prev->m_incidentVertex].m_x); - ndBigVector p1 (&m_vertexPoints[ptr->m_incidentVertex].m_x); - ndBigVector e0 (p1 - p0); - e0 = e0.Scale (ndFloat64 (1.0f) / sqrt (e0.DotProduct(e0).GetScalar() + ndFloat32(1.0e-24f))); - do - { - ndBigVector p2 (&m_vertexPoints[ptr->m_next->m_incidentVertex].m_x); - ndBigVector e1 (p2 - p1); - - e1 = e1.Scale (ndFloat64 (1.0f) / sqrt (e1.DotProduct(e1).GetScalar() + ndFloat32(1.0e-24f))); - ndFloat64 mag2 = e1.DotProduct(e0).GetScalar(); - if (mag2 > ndFloat32 (0.9999f)) - { - count --; - flag = 1; - edge = ptr->m_next; - ptr->m_prev->m_next = ptr->m_next; - ptr->m_next->m_prev = ptr->m_prev; - ptr->m_twin->m_next->m_prev = ptr->m_twin->m_prev; - ptr->m_twin->m_prev->m_next = ptr->m_twin->m_next; - break; - } - - e0 = e1; - p1 = p2; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - - ndBigVector normal (polyhedra.FaceNormal (edge, &m_vertexPoints[0].m_x, sizeof (ndBigVector))); - ndFloat64 mag2 = normal.DotProduct(normal).GetScalar(); - if (mag2 < ndFloat32 (1.0e-8f)) - { - return 0; - } - normal = normal.Scale (ndFloat64 (1.0f) / sqrt (mag2)); - - if (count >= 3) - { - ndEdge* ptr = edge; - ndBigVector p0 (&m_vertexPoints[ptr->m_prev->m_incidentVertex].m_x); - ndBigVector p1 (&m_vertexPoints[ptr->m_incidentVertex].m_x); - ndBigVector e0 (p1 - p0); - e0 = e0.Scale (ndFloat64 (1.0f) / sqrt (e0.DotProduct(e0).GetScalar() + ndFloat32(1.0e-24f))); - do - { - ndBigVector p2 (&m_vertexPoints[ptr->m_next->m_incidentVertex].m_x); - ndBigVector e1 (p2 - p1); - - e1 = e1.Scale (ndFloat64 (1.0f) / sqrt (e1.DotProduct(e1).GetScalar() + ndFloat32(1.0e-24f))); - - ndBigVector n (e0.CrossProduct(e1)); - ndFloat64 magnitud2 = n.DotProduct(normal).GetScalar(); - if (magnitud2 < ndFloat32 (1.0e-5f)) - { - isconvex = 0; - break; - } - - e0 = e1; - p1 = p2; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - - if (isconvex) - { - ndEdge* const first = edge; - if (count >= 3) - { - count = 0; - ndEdge* ptr = first; - do - { - pool[count] = ptr->m_incidentVertex; - count ++; - ptr = ptr->m_next; - } while (ptr != first); - facesArray[facesCount] = count; - facesCount = 1; - } - } else { - ndPolyhedra leftOver; - ndPolyhedra polyhedra2; - ndEdge* ptr = edge; - count = 0; - do - { - pool[count] = ptr->m_incidentVertex; - count ++; - ptr = ptr->m_next; - } while (ptr != edge); - - - polyhedra2.BeginFace(); - polyhedra2.AddFace (count, pool); - polyhedra2.EndFace(); - leftOver.BeginFace(); - polyhedra2.ConvexPartition (&m_vertexPoints[0].m_x, sizeof (ndBigVector), &leftOver); - leftOver.EndFace(); - -#ifdef _DEBUG - if (leftOver.GetCount()) - { - ndTrace (("warning: %d faces with more that a one shared edge\n", leftOver.GetCount())); - ndTrace ((" this mesh is not a manifold and may lead to collision malfunctions\n")); - } -#endif - - ndInt32 mark = polyhedra2.IncLRU(); - ndInt32 index = 0; - ndPolyhedra::Iterator iter (polyhedra2); - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge1 = &(*iter); - if (edge1->m_incidentFace < 0) - { - continue; - } - if (edge1->m_mark == mark) - { - continue; - } - - ptr = edge1; - count = 0; - do - { - ptr->m_mark = mark; - pool[index] = ptr->m_incidentVertex; - index ++; - count ++; - ptr = ptr->m_next; - } while (ptr != edge1); - - facesArray[facesCount] = count; - facesCount ++; - } - } - - return facesCount; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupBuilder.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupBuilder.h deleted file mode 100644 index 46ee91876a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupBuilder.h +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -/**************************************************************************** -* -* Visual C++ 6.0 created by: Julio Jerez -* -****************************************************************************/ -#ifndef __ND_POLYGONSOUP_BUILDER_H__ -#define __ND_POLYGONSOUP_BUILDER_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndPlane.h" -#include "ndArray.h" -#include "ndVector.h" -#include "ndMatrix.h" - -/// Helper intermediate class for encoding a face adjacent face to an edge of a face. -class ndAdjacentFace -{ - public: - ndPlane m_normal; - ndInt32 m_count; - ndInt32 *m_index; - ndInt64 m_edgeMap[256]; -}; - -class ndPolygonSoupBuilder: public ndClassAlloc -{ - class ndFaceMap; - class ndFaceInfo; - class ndFaceBucket; - class ndPolySoupFilterAllocator; - - public: - D_CORE_API ndPolygonSoupBuilder (); - D_CORE_API ndPolygonSoupBuilder (const ndPolygonSoupBuilder& sopurce); - D_CORE_API virtual ~ndPolygonSoupBuilder (); - - D_CORE_API virtual void Begin(); - D_CORE_API virtual void End(bool optimize); - D_CORE_API virtual void AddFace(const ndFloat32* const vertex, ndInt32 strideInBytes, ndInt32 vertexCount, const ndInt32 faceId); - D_CORE_API virtual void AddFaceIndirect(const ndFloat32* const vertex, ndInt32 strideInBytes, ndInt32 faceId, const ndInt32* const indexArray, ndInt32 indexCount); - - D_CORE_API void LoadPLY(const char* const fileName); - D_CORE_API void SavePLY(const char* const fileName) const; - - private: - void Optimize(ndInt32 faceId, const ndFaceBucket& faceBucket, const ndPolygonSoupBuilder& source); - - void Finalize(); - void OptimizeByIndividualFaces(); - void FinalizeAndOptimize(ndInt32 id); - ndInt32 FilterFace (ndInt32 count, ndInt32* const indexArray); - ndInt32 AddConvexFace (ndInt32 count, ndInt32* const indexArray, ndInt32* const facesArray); - void PackArray(); - - public: - class ndVertexArray: public ndArray - { - public: - ndVertexArray() - :ndArray() - { - } - - ndVertexArray(ndInt32 count) - :ndArray(count) - { - } - }; - - class ndIndexArray: public ndArray - { - public: - ndIndexArray() - :ndArray() - { - } - - ndIndexArray(ndInt32 count) - :ndArray(count) - { - } - }; - - ndIndexArray m_faceVertexCount; - ndIndexArray m_vertexIndex; - ndIndexArray m_normalIndex; - ndVertexArray m_vertexPoints; - ndVertexArray m_normalPoints; - ndInt32 m_run; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.cpp deleted file mode 100644 index 75403f9a93..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -/**************************************************************************** -* -* Visual C++ 6.0 created by: Julio Jerez -* -****************************************************************************/ - -#include "ndCoreStdafx.h" -#include "ndMemory.h" -#include "ndPolygonSoupDatabase.h" - -ndPolygonSoupDatabase::ndPolygonSoupDatabase(const char* const) -{ - m_vertexCount = 0; - m_strideInBytes = 0; - m_localVertex = nullptr; -} - -ndPolygonSoupDatabase::~ndPolygonSoupDatabase () -{ - if (m_localVertex) - { - ndMemory::Free (m_localVertex); - } -} - -void ndPolygonSoupDatabase::SetTagId(const ndInt32* const facePtr, ndInt32 indexCount, ndUnsigned32 newID) const -{ - ndUnsigned32* const face = (ndUnsigned32*) facePtr; - face[indexCount] = newID; -} - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.h deleted file mode 100644 index fc2418432c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_POLYGONSOUP_DATABASE_H_ -#define __ND_POLYGONSOUP_DATABASE_H_ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndClassAlloc.h" - -class ndPolygonSoupDatabase: public ndClassAlloc -{ - public: - ndFloat32 GetRadius() const; - ndInt32 GetVertexCount() const; - ndInt32 GetStrideInBytes() const; - ndFloat32* GetLocalVertexPool() const; - - ndUnsigned32 GetTagId(const ndInt32* const face, ndInt32 indexCount) const; - void SetTagId(const ndInt32* const face, ndInt32 indexCount, ndUnsigned32 newID) const; - - protected: - ndPolygonSoupDatabase(const char* const name = nullptr); - virtual ~ndPolygonSoupDatabase (); - - ndInt32 m_vertexCount; - ndInt32 m_strideInBytes; - ndFloat32* m_localVertex; -}; - -inline ndInt32 ndPolygonSoupDatabase::GetVertexCount() const -{ - return m_vertexCount; -} - -inline ndFloat32* ndPolygonSoupDatabase::GetLocalVertexPool() const -{ - return m_localVertex; -} - -inline ndInt32 ndPolygonSoupDatabase::GetStrideInBytes() const -{ - return m_strideInBytes; -} - -inline ndFloat32 ndPolygonSoupDatabase::GetRadius() const -{ - return ndFloat32 (0.0f); -} - -inline ndUnsigned32 ndPolygonSoupDatabase::GetTagId(const ndInt32* const face, ndInt32 indexCount) const -{ - return ndUnsigned32(face[indexCount]); -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedra.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedra.cpp deleted file mode 100644 index 69d40af6dc..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedra.cpp +++ /dev/null @@ -1,3204 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndHeap.h" -#include "ndPlane.h" -#include "ndDebug.h" -#include "ndStack.h" -#include "ndVector.h" -#include "ndMatrix.h" -#include "ndPolyhedra.h" -#include "ndConvexHull3d.h" -#include "ndSmallDeterminant.h" - -#define D_LOCAL_BUFFER_SIZE 1024 - -#define ndPointerToInt(x) ((size_t)x) -#define ndIntToPointer(x) ((void*)(size_t(x))) - -class ndDiagonalEdge -{ - public: - ndDiagonalEdge (ndEdge* const edge) - :m_i0(edge->m_incidentVertex), m_i1(edge->m_twin->m_incidentVertex) - { - } - ndInt32 m_i0; - ndInt32 m_i1; -}; - -class ndEdgeCollapseEdgeHandle -{ - public: - ndEdgeCollapseEdgeHandle (ndEdge* const newEdge) - :m_edge(newEdge) - ,m_inList(0) - { - } - - ndEdgeCollapseEdgeHandle (const ndEdgeCollapseEdgeHandle &dataHandle) - :m_edge(dataHandle.m_edge) - ,m_inList(1) - { - ndEdgeCollapseEdgeHandle* const handle = (ndEdgeCollapseEdgeHandle *)ndIntToPointer (m_edge->m_userData); - if (handle) - { - ndAssert (handle != this); - handle->m_edge = nullptr; - } - m_edge->m_userData = ndUnsigned64 (ndPointerToInt(this)); - } - - ~ndEdgeCollapseEdgeHandle () - { - if (m_inList) - { - if (m_edge) - { - ndEdgeCollapseEdgeHandle* const handle = (ndEdgeCollapseEdgeHandle *)ndIntToPointer (m_edge->m_userData); - if (handle == this) - { - m_edge->m_userData = ndPointerToInt (nullptr); - } - } - } - m_edge = nullptr; - } - - ndEdge* m_edge; - ndUnsigned32 m_inList; -}; - -class ndVertexCollapseVertexMetric -{ - public: - ndVertexCollapseVertexMetric (const ndBigPlane &plane) - { - elem[0] = plane.m_x * plane.m_x; - elem[1] = plane.m_y * plane.m_y; - elem[2] = plane.m_z * plane.m_z; - elem[3] = plane.m_w * plane.m_w; - elem[4] = ndFloat64 (2.0) * plane.m_x * plane.m_y; - elem[5] = ndFloat64 (2.0) * plane.m_x * plane.m_z; - elem[6] = ndFloat64 (2.0) * plane.m_x * plane.m_w; - elem[7] = ndFloat64 (2.0) * plane.m_y * plane.m_z; - elem[8] = ndFloat64 (2.0) * plane.m_y * plane.m_w; - elem[9] = ndFloat64 (2.0) * plane.m_z * plane.m_w; - } - - void Clear () - { - memset (elem, 0, 10 * sizeof (ndFloat64)); - } - - void Accumulate (const ndVertexCollapseVertexMetric& p) - { - elem[0] += p.elem[0]; - elem[1] += p.elem[1]; - elem[2] += p.elem[2]; - elem[3] += p.elem[3]; - elem[4] += p.elem[4]; - elem[5] += p.elem[5]; - elem[6] += p.elem[6]; - elem[7] += p.elem[7]; - elem[8] += p.elem[8]; - elem[9] += p.elem[9]; - } - - void Accumulate (const ndBigPlane& plane) - { - elem[0] += plane.m_x * plane.m_x; - elem[1] += plane.m_y * plane.m_y; - elem[2] += plane.m_z * plane.m_z; - elem[3] += plane.m_w * plane.m_w; - - elem[4] += ndFloat64 (2.0f) * plane.m_x * plane.m_y; - elem[5] += ndFloat64 (2.0f) * plane.m_x * plane.m_z; - elem[7] += ndFloat64 (2.0f) * plane.m_y * plane.m_z; - - elem[6] += ndFloat64 (2.0f) * plane.m_x * plane.m_w; - elem[8] += ndFloat64 (2.0f) * plane.m_y * plane.m_w; - elem[9] += ndFloat64 (2.0f) * plane.m_z * plane.m_w; - } - - ndFloat64 Evalue (const ndBigVector &p) const - { - ndFloat64 acc = elem[0] * p.m_x * p.m_x + elem[1] * p.m_y * p.m_y + elem[2] * p.m_z * p.m_z + - elem[4] * p.m_x * p.m_y + elem[5] * p.m_x * p.m_z + elem[7] * p.m_y * p.m_z + - elem[6] * p.m_x + elem[8] * p.m_y + elem[9] * p.m_z + elem[3]; - return fabs (acc); - } - - ndFloat64 elem[10]; -}; - -ndPolyhedra::ndPolyhedra (const ndPolyhedra &polyhedra) - :ndTree () - ,m_baseMark(0) - ,m_edgeMark(0) - ,m_faceSecuence(0) -{ - ndStack indexPool (D_LOCAL_BUFFER_SIZE * 16); - ndStack userPool (D_LOCAL_BUFFER_SIZE * 16); - ndInt32* const index = &indexPool[0]; - ndUnsigned64* const user = &userPool[0]; - - BeginFace (); - Iterator iter(polyhedra); - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - if (edge->m_incidentFace < 0) - { - continue; - } - - if (!FindEdge(edge->m_incidentVertex, edge->m_twin->m_incidentVertex)) - { - ndInt32 indexCount = 0; - ndEdge* ptr = edge; - do - { - user[indexCount] = ptr->m_userData; - index[indexCount] = ptr->m_incidentVertex; - indexCount ++; - ptr = ptr->m_next; - } while (ptr != edge); - - ndEdge* const face = AddFace (indexCount, index, (ndInt64*) user); - if (face) - { - ptr = face; - do - { - ptr->m_incidentFace = edge->m_incidentFace; - ptr = ptr->m_next; - } while (ptr != face); - } - } - } - EndFace(); - - m_faceSecuence = polyhedra.m_faceSecuence; - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck()); -#endif -} - -ndPolyhedra::~ndPolyhedra () -{ -} - -void ndPolyhedra::SavePLY(const char* const fileName, const ndFloat64* const vertexArray, ndInt32 strideInBytes) const -{ - FILE* const file = fopen(fileName, "wb"); - - fprintf(file, "ply\n"); - fprintf(file, "format ascii 1.0\n"); - - ndPolyhedra copy(*this); - - ndInt32 faceCount = 0; - Iterator iter(copy); - ndInt32 mark = copy.IncLRU(); - for (iter.Begin(); iter; iter++) - { - ndEdge* const face = &iter.GetNode()->GetInfo(); - if ((face->m_mark < mark) && (face->m_incidentFace > 0)) - { - faceCount++; - ndEdge* edge = face; - do - { - edge->m_mark = mark; - edge = edge->m_next; - } while (edge != face); - } - } - - mark = copy.IncLRU(); - ndInt32 vertexCount = 0; - for (iter.Begin(); iter; iter++) - { - ndEdge* const vertex = &iter.GetNode()->GetInfo(); - if (vertex->m_mark < mark) - { - ndEdge* edge = vertex; - do - { - edge->m_userData = ndUnsigned64(vertexCount); - edge->m_mark = mark; - edge = edge->m_twin->m_next; - } while (edge != vertex); - vertexCount++; - } - } - - fprintf(file, "element vertex %d\n", vertexCount); - fprintf(file, "property float x\n"); - fprintf(file, "property float y\n"); - fprintf(file, "property float z\n"); - fprintf(file, "element face %d\n", faceCount); - fprintf(file, "property list uchar int vertex_index\n"); - fprintf(file, "end_header\n"); - - mark = copy.IncLRU(); - const ndInt8* const points = (ndInt8*)vertexArray; - for (iter.Begin(); iter; iter++) - { - ndEdge* const vertex = &iter.GetNode()->GetInfo(); - if (vertex->m_mark < mark) - { - ndEdge* edge = vertex; - do - { - edge->m_mark = mark; - edge = edge->m_twin->m_next; - } while (edge != vertex); - ndInt32 index = edge->m_incidentVertex * strideInBytes; - - const ndFloat64* const p = (ndFloat64*)&points[index]; - ndBigVector point(p[0], p[1], p[2], ndFloat64(0.0f)); - fprintf(file, "%f %f %f\n", point.m_x, point.m_y, point.m_z); - } - } - - mark = copy.IncLRU(); - for (iter.Begin(); iter; iter++) - { - ndInt32 indices[1024]; - ndInt32 count = 0; - ndEdge* const face = &iter.GetNode()->GetInfo(); - if ((face->m_mark < mark) && (face->m_incidentFace > 0)) - { - ndEdge* edge = face; - do - { - indices[count] = ndInt32 (edge->m_userData); - count++; - edge->m_mark = mark; - edge = edge->m_next; - } while (edge != face); - - fprintf(file, "%d", count); - for (ndInt32 j = 0; j < count; ++j) - { - fprintf(file, " %d", indices[j]); - } - fprintf(file, "\n"); - } - } - fclose(file); -} - -ndInt32 ndPolyhedra::GetFaceCount() const -{ - Iterator iter (*this); - ndInt32 count = 0; - ndInt32 mark = IncLRU(); - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - if (edge->m_mark == mark) - { - continue; - } - - if (edge->m_incidentFace < 0) - { - continue; - } - - count ++; - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - } - return count; -} - -ndEdge* ndPolyhedra::AddFace (ndInt32 count, const ndInt32* const index, const ndInt64* const userdata) -{ - class IntersectionFilter - { - public: - IntersectionFilter () - { - m_count = 0; - } - - bool Insert (ndInt64 value) - { - ndInt32 i = 0; - for (; i < m_count; ++i) - { - if (m_array[i] == value) - { - return false; - } - } - m_array[i] = value; - m_count ++; - return true; - } - - ndInt32 m_count; - ndInt64 m_array[2048]; - }; - - IntersectionFilter selfIntersectingFaceFilter; - - ndInt32 i0 = index[count-1]; - for (ndInt32 i = 0; i < count; ++i) - { - ndInt32 i1 = index[i]; - ndPairKey code0 (i0, i1); - if (!selfIntersectingFaceFilter.Insert (code0.GetVal())) - { - return nullptr; - } - - ndPairKey code1 (i1, i0); - if (!selfIntersectingFaceFilter.Insert (code1.GetVal())) - { - return nullptr; - } - - if (i0 == i1) - { - return nullptr; - } - if (FindEdge (i0, i1)) - { - return nullptr; - } - i0 = i1; - } - - m_faceSecuence ++; - - i0 = index[count-1]; - ndInt32 i1 = index[0]; - ndUnsigned64 udata0 = 0; - ndUnsigned64 udata1 = 0; - if (userdata) - { - udata0 = ndUnsigned64 (userdata[count-1]); - udata1 = ndUnsigned64 (userdata[0]); - } - - bool state; - ndPairKey code (i0, i1); - ndEdge tmpEdge (i0, m_faceSecuence, udata0); - ndNode* const node = Insert (tmpEdge, code.GetVal(), state); - ndAssert (!state); - ndEdge* edge0 = &node->GetInfo(); - ndEdge* const first = edge0; - - for (ndInt32 i = 1; i < count; ++i) - { - i0 = i1; - i1 = index[i]; - udata0 = udata1; - udata1 = ndUnsigned64 (userdata ? userdata[i] : 0); - - ndPairKey code1 (i0, i1); - ndEdge tmpEdge1 (i0, m_faceSecuence, udata0); - ndNode* const node1 = Insert (tmpEdge1, code1.GetVal(), state); - ndAssert (!state); - - ndEdge* const edge1 = &node1->GetInfo(); - edge0->m_next = edge1; - edge1->m_prev = edge0; - edge0 = edge1; - } - - first->m_prev = edge0; - edge0->m_next = first; - - return first->m_next; -} - -bool ndPolyhedra::EndFace () -{ - ndPolyhedra::Iterator iter (*this); - - // Connect all twin edge - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - if (!edge->m_twin) - { - edge->m_twin = FindEdge (edge->m_next->m_incidentVertex, edge->m_incidentVertex); - if (edge->m_twin) - { - edge->m_twin->m_twin = edge; - } - } - } - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck()); -#endif - ndStack edgeArrayPool(GetCount() * 2 + 256); - - ndInt32 edgeCount = 0; - ndEdge** const edgeArray = &edgeArrayPool[0]; - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - if (!edge->m_twin) - { - bool state; - ndPolyhedra::ndPairKey code (edge->m_next->m_incidentVertex, edge->m_incidentVertex); - ndEdge tmpEdge (edge->m_next->m_incidentVertex, -1); - tmpEdge.m_incidentFace = -1; - ndPolyhedra::ndNode* const node = Insert (tmpEdge, code.GetVal(), state); - ndAssert (!state); - edge->m_twin = &node->GetInfo(); - edge->m_twin->m_twin = edge; - edgeArray[edgeCount] = edge->m_twin; - edgeCount ++; - } - } - - for (ndInt32 i = 0; i < edgeCount; ++i) - { - ndEdge* const edge = edgeArray[i]; - ndAssert (!edge->m_prev); - ndEdge *ptr = edge->m_twin; - for (; ptr->m_next; ptr = ptr->m_next->m_twin){} - ptr->m_next = edge; - edge->m_prev = ptr; - } - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - - return true; -} - -void ndPolyhedra::DeleteFace(ndEdge* const face) -{ - ndEdge* edgeList[D_LOCAL_BUFFER_SIZE * 16]; - - if (face->m_incidentFace > 0) - { - ndInt32 count = 0; - ndEdge* ptr = face; - do - { - ptr->m_incidentFace = -1; - ndInt32 i = 0; - for (; i < count; ++i) - { - if ((edgeList[i] == ptr) || (edgeList[i]->m_twin == ptr)) - { - break; - } - } - if (i == count) - { - edgeList[count] = ptr; - count ++; - } - ptr = ptr->m_next; - } while (ptr != face); - - for (ndInt32 i = 0; i < count; ++i) - { - ndEdge* const ptr1 = edgeList[i]; - if (ptr1->m_twin->m_incidentFace < 0) - { - DeleteEdge (ptr1); - } - } - } -} - -ndBigVector ndPolyhedra::FaceNormal (const ndEdge* const face, const ndFloat64* const pool, ndInt32 strideInBytes) const -{ - ndInt32 stride = ndInt32 (strideInBytes / sizeof (ndFloat64)); - const ndEdge* edge = face; - ndBigVector p0 (ndBigVector::m_triplexMask & ndBigVector(&pool[edge->m_incidentVertex * stride])); - edge = edge->m_next; - ndBigVector p1 (ndBigVector::m_triplexMask & ndBigVector(&pool[edge->m_incidentVertex * stride])); - ndBigVector e1 (p1 - p0); - - ndBigVector normal (ndBigVector::m_zero); - for (edge = edge->m_next; edge != face; edge = edge->m_next) - { - ndBigVector p2 (ndBigVector::m_triplexMask & ndBigVector(&pool[edge->m_incidentVertex * stride])); - ndBigVector e2 (p2 - p0); - normal += e1.CrossProduct(e2); - e1 = e2; - } - ndAssert (normal.m_w == ndFloat32 (0.0f)); - return normal; -} - -ndEdge* ndPolyhedra::AddHalfEdge (ndInt32 v0, ndInt32 v1) -{ - if (v0 != v1) - { - ndPairKey pairKey (v0, v1); - ndEdge tmpEdge (v0, -1); - - ndNode* node = Insert (tmpEdge, pairKey.GetVal()); - return node ? &node->GetInfo() : nullptr; - } - else - { - return nullptr; - } -} - -void ndPolyhedra::DeleteEdge (ndEdge* const edge) -{ - ndEdge *const twin = edge->m_twin; - - edge->m_prev->m_next = twin->m_next; - twin->m_next->m_prev = edge->m_prev; - edge->m_next->m_prev = twin->m_prev; - twin->m_prev->m_next = edge->m_next; - - ndNode *const nodeA = GetNodeFromInfo (*edge); - ndNode *const nodeB = GetNodeFromInfo (*twin); - - ndAssert (&nodeA->GetInfo() == edge); - ndAssert (&nodeB->GetInfo() == twin); - - Remove (nodeA); - Remove (nodeB); -} - -ndEdge* ndPolyhedra::ConnectVertex (ndEdge* const e0, ndEdge* const e1) -{ - ndEdge* const edge = AddHalfEdge(e1->m_incidentVertex, e0->m_incidentVertex); - ndEdge* const twin = AddHalfEdge(e0->m_incidentVertex, e1->m_incidentVertex); - ndAssert ((edge && twin) || !(edge || twin)); - if (edge) - { - edge->m_twin = twin; - twin->m_twin = edge; - - edge->m_incidentFace = e0->m_incidentFace; - twin->m_incidentFace = e1->m_incidentFace; - - edge->m_userData = e1->m_userData; - twin->m_userData = e0->m_userData; - - edge->m_next = e0; - edge->m_prev = e1->m_prev; - - twin->m_next = e1; - twin->m_prev = e0->m_prev; - - e0->m_prev->m_next = twin; - e0->m_prev = edge; - - e1->m_prev->m_next = edge; - e1->m_prev = twin; - } - - return edge; -} - -ndEdge* ndPolyhedra::SpliteEdge (ndInt32 newIndex, ndEdge* const edge) -{ - ndEdge* const edge00 = edge->m_prev; - ndEdge* const edge01 = edge->m_next; - ndEdge* const twin00 = edge->m_twin->m_next; - ndEdge* const twin01 = edge->m_twin->m_prev; - - ndInt32 i0 = edge->m_incidentVertex; - ndInt32 i1 = edge->m_twin->m_incidentVertex; - - ndInt32 f0 = edge->m_incidentFace; - ndInt32 f1 = edge->m_twin->m_incidentFace; - - DeleteEdge (edge); - - ndEdge* const edge0 = AddHalfEdge (i0, newIndex); - ndEdge* const edge1 = AddHalfEdge (newIndex, i1); - - ndEdge* const twin0 = AddHalfEdge (newIndex, i0); - ndEdge* const twin1 = AddHalfEdge (i1, newIndex); - ndAssert (edge0); - ndAssert (edge1); - ndAssert (twin0); - ndAssert (twin1); - - edge0->m_twin = twin0; - twin0->m_twin = edge0; - - edge1->m_twin = twin1; - twin1->m_twin = edge1; - - edge0->m_next = edge1; - edge1->m_prev = edge0; - - twin1->m_next = twin0; - twin0->m_prev = twin1; - - edge0->m_prev = edge00; - edge00 ->m_next = edge0; - - edge1->m_next = edge01; - edge01->m_prev = edge1; - - twin0->m_next = twin00; - twin00->m_prev = twin0; - - twin1->m_prev = twin01; - twin01->m_next = twin1; - - edge0->m_incidentFace = f0; - edge1->m_incidentFace = f0; - - twin0->m_incidentFace = f1; - twin1->m_incidentFace = f1; - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - // ndAssert (SanityCheck ()); -#endif - - return edge0; -} - -bool ndPolyhedra::FlipEdge (ndEdge* const edge) -{ - if (edge->m_next->m_next->m_next != edge) - { - return false; - } - - if (edge->m_twin->m_next->m_next->m_next != edge->m_twin) - { - return false; - } - - if (FindEdge(edge->m_prev->m_incidentVertex, edge->m_twin->m_prev->m_incidentVertex)) - { - return false; - } - - ndEdge *const prevEdge = edge->m_prev; - ndEdge *const prevTwin = edge->m_twin->m_prev; - - ndPairKey edgeKey (prevTwin->m_incidentVertex, prevEdge->m_incidentVertex); - ndPairKey twinKey (prevEdge->m_incidentVertex, prevTwin->m_incidentVertex); - - ReplaceKey (GetNodeFromInfo (*edge), edgeKey.GetVal()); - ReplaceKey (GetNodeFromInfo (*edge->m_twin), twinKey.GetVal()); - - edge->m_incidentVertex = prevTwin->m_incidentVertex; - edge->m_twin->m_incidentVertex = prevEdge->m_incidentVertex; - - edge->m_userData = prevTwin->m_userData; - edge->m_twin->m_userData = prevEdge->m_userData; - - prevEdge->m_next = edge->m_twin->m_next; - prevTwin->m_prev->m_prev = edge->m_prev; - - prevTwin->m_next = edge->m_next; - prevEdge->m_prev->m_prev = edge->m_twin->m_prev; - - edge->m_prev = prevTwin->m_prev; - edge->m_next = prevEdge; - - edge->m_twin->m_prev = prevEdge->m_prev; - edge->m_twin->m_next = prevTwin; - - prevTwin->m_prev->m_next = edge; - prevTwin->m_prev = edge->m_twin; - - prevEdge->m_prev->m_next = edge->m_twin; - prevEdge->m_prev = edge; - - edge->m_next->m_incidentFace = edge->m_incidentFace; - edge->m_prev->m_incidentFace = edge->m_incidentFace; - - edge->m_twin->m_next->m_incidentFace = edge->m_twin->m_incidentFace; - edge->m_twin->m_prev->m_incidentFace = edge->m_twin->m_incidentFace; - - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - - return true; -} - -bool ndPolyhedra::GetConectedSurface (ndPolyhedra &polyhedra) const -{ - if (!GetCount()) - { - return false; - } - - ndEdge* edge = nullptr; - Iterator iter(*this); - for (iter.Begin (); iter; iter ++) - { - edge = &(*iter); - if ((edge->m_mark < m_baseMark) && (edge->m_incidentFace > 0)) - { - break; - } - } - - if (!iter) - { - return false; - } - - ndInt32 faceIndex[4096]; - ndInt64 faceDataIndex[4096]; - ndStack stackPool (GetCount()); - ndEdge** const stack = &stackPool[0]; - - ndInt32 mark = IncLRU(); - - polyhedra.BeginFace (); - stack[0] = edge; - ndInt32 index = 1; - while (index) - { - index --; - ndEdge* const edge1 = stack[index]; - ndAssert (edge1); - if (edge1->m_mark == mark) - { - continue; - } - - ndInt32 count = 0; - ndEdge* ptr = edge1; - do - { - ndAssert (ptr); - ptr->m_mark = mark; - faceIndex[count] = ptr->m_incidentVertex; - faceDataIndex[count] = ndInt64 (ptr->m_userData); - count ++; - ndAssert (count < ndInt32 ((sizeof (faceIndex)/sizeof(faceIndex[0])))); - - if ((ptr->m_twin->m_incidentFace > 0) && (ptr->m_twin->m_mark != mark)) - { - stack[index] = ptr->m_twin; - index ++; - ndAssert (index < GetCount()); - } - - ptr = ptr->m_next; - } while (ptr != edge1); - - polyhedra.AddFace (count, &faceIndex[0], &faceDataIndex[0]); - } - - polyhedra.EndFace (); - - return true; -} - -void ndPolyhedra::ChangeEdgeIncidentVertex (ndEdge* const edge, ndInt32 newIndex) -{ - ndEdge* ptr = edge; - do - { - ndNode* node = GetNodeFromInfo(*ptr); - ndPairKey Key0 (newIndex, ptr->m_twin->m_incidentVertex); - ReplaceKey (node, Key0.GetVal()); - - node = GetNodeFromInfo(*ptr->m_twin); - ndPairKey Key1 (ptr->m_twin->m_incidentVertex, newIndex); - ReplaceKey (node, Key1.GetVal()); - - ptr->m_incidentVertex = newIndex; - - ptr = ptr->m_twin->m_next; - } while (ptr != edge); -} - -void ndPolyhedra::DeleteDegenerateFaces (const ndFloat64* const pool, ndInt32 strideInBytes, ndFloat64 area) -{ - if (!GetCount()) - { - return; - } - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - ndStack faceArrayPool(GetCount() / 2 + 100); - - ndInt32 count = 0; - ndPolyhedra::ndNode** const faceArray = &faceArrayPool[0]; - ndInt32 mark = IncLRU(); - Iterator iter (*this); - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - - if ((edge->m_mark != mark) && (edge->m_incidentFace > 0)) - { - faceArray[count] = iter.GetNode(); - count ++; - ndEdge* ptr = edge; - do { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - } - } - - ndFloat64 area2 = area * area; - area2 *= ndFloat64 (4.0f); - - for (ndInt32 i = 0; i < count; ++i) - { - ndPolyhedra::ndNode* const faceNode = faceArray[i]; - ndEdge* const edge = &faceNode->GetInfo(); - - ndBigVector normal (FaceNormal (edge, pool, strideInBytes)); - - ndFloat64 faceArea = normal.DotProduct(normal).GetScalar(); - if (faceArea < area2) - { - DeleteFace (edge); - } - } - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - mark = IncLRU(); - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_mark != mark) && (edge->m_incidentFace > 0)) - { - //ndAssert (edge->m_next->m_next->m_next == edge); - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - - ndBigVector normal (FaceNormal (edge, pool, strideInBytes)); - - ndFloat64 faceArea = normal.DotProduct(normal).GetScalar(); - ndAssert (faceArea >= area2); - } - } - ndAssert (SanityCheck ()); -#endif -} - -ndBigPlane ndPolyhedra::UnboundedLoopPlane (ndInt32 i0, ndInt32 i1, ndInt32 i2, const ndBigVector* const pool) -{ - const ndBigVector p0 = pool[i0]; - const ndBigVector p1 = pool[i1]; - const ndBigVector p2 = pool[i2]; - ndBigVector E0 (p1 - p0); - ndBigVector E1 (p2 - p0); - - ndBigVector N ((E0.CrossProduct(E1)).CrossProduct(E0) & ndBigVector::m_triplexMask); - ndFloat64 dist = - N.DotProduct(p0).GetScalar(); - ndBigPlane plane (N, dist); - - ndFloat64 mag = sqrt (plane.DotProduct(plane & ndBigVector::m_triplexMask).GetScalar()); - if (mag < ndFloat64 (1.0e-12f)) - { - mag = ndFloat64 (1.0e-12f); - } - mag = ndFloat64 (10.0f) / mag; - - plane.m_x *= mag; - plane.m_y *= mag; - plane.m_z *= mag; - plane.m_w *= mag; - - return plane; -} - -ndEdge* ndPolyhedra::CollapseEdge(ndEdge* const edge) -{ - ndInt32 v0 = edge->m_incidentVertex; - ndInt32 v1 = edge->m_twin->m_incidentVertex; - - ndEdge* retEdge = edge->m_twin->m_prev->m_twin; - if (retEdge == edge->m_twin->m_next) - { - return nullptr; - } - if (retEdge == edge->m_twin) - { - return nullptr; - } - if (retEdge == edge->m_next) - { - retEdge = edge->m_prev->m_twin; - if (retEdge == edge->m_twin->m_next) { - return nullptr; - } - if (retEdge == edge->m_twin) - { - return nullptr; - } - } - - ndEdge* lastEdge = nullptr; - ndEdge* firstEdge = nullptr; - if ((edge->m_incidentFace >= 0) && (edge->m_twin->m_incidentFace >= 0)) - { - lastEdge = edge->m_prev->m_twin; - firstEdge = edge->m_twin->m_next->m_twin->m_next; - } - else if (edge->m_twin->m_incidentFace >= 0) - { - firstEdge = edge->m_twin->m_next->m_twin->m_next; - lastEdge = edge; - } - else - { - lastEdge = edge->m_prev->m_twin; - firstEdge = edge->m_twin->m_next; - } - - for (ndEdge* ptr = firstEdge; ptr != lastEdge; ptr = ptr->m_twin->m_next) - { - ndEdge* const badEdge = FindEdge (edge->m_twin->m_incidentVertex, ptr->m_twin->m_incidentVertex); - if (badEdge) - { - return nullptr; - } - } - - ndEdge* const twin = edge->m_twin; - if (twin->m_next == twin->m_prev->m_prev) - { - twin->m_prev->m_twin->m_twin = twin->m_next->m_twin; - twin->m_next->m_twin->m_twin = twin->m_prev->m_twin; - - Remove (GetNodeFromInfo(*twin->m_prev)); - Remove (GetNodeFromInfo(*twin->m_next)); - } - else - { - twin->m_next->m_userData = twin->m_userData; - twin->m_next->m_prev = twin->m_prev; - twin->m_prev->m_next = twin->m_next; - } - - if (edge->m_next == edge->m_prev->m_prev) - { - edge->m_next->m_twin->m_twin = edge->m_prev->m_twin; - edge->m_prev->m_twin->m_twin = edge->m_next->m_twin; - Remove (GetNodeFromInfo(*edge->m_next)); - Remove (GetNodeFromInfo(*edge->m_prev)); - } - else - { - edge->m_next->m_prev = edge->m_prev; - edge->m_prev->m_next = edge->m_next; - } - - ndAssert (twin->m_twin->m_incidentVertex == v0); - ndAssert (edge->m_twin->m_incidentVertex == v1); - Remove (GetNodeFromInfo(*twin)); - Remove (GetNodeFromInfo(*edge)); - - ndEdge* ptr = retEdge; - do - { - ndPolyhedra::ndPairKey pairKey (v0, ptr->m_twin->m_incidentVertex); - - ndPolyhedra::ndNode* node = Find (pairKey.GetVal()); - if (node) - { - if (&node->GetInfo() == ptr) - { - ndPolyhedra::ndPairKey key (v1, ptr->m_twin->m_incidentVertex); - ptr->m_incidentVertex = v1; - node = ReplaceKey (node, key.GetVal()); - ndAssert (node); - } - } - - ndPolyhedra::ndPairKey TwinKey (ptr->m_twin->m_incidentVertex, v0); - node = Find (TwinKey.GetVal()); - if (node) - { - if (&node->GetInfo() == ptr->m_twin) - { - ndPolyhedra::ndPairKey key (ptr->m_twin->m_incidentVertex, v1); - node = ReplaceKey (node, key.GetVal()); - ndAssert (node); - } - } - - ptr = ptr->m_twin->m_next; - } while (ptr != retEdge); - - return retEdge; -} - -void ndPolyhedra::RemoveHalfEdge (ndEdge* const edge) -{ - ndEdgeCollapseEdgeHandle* const handle = (ndEdgeCollapseEdgeHandle *) ndIntToPointer (edge->m_userData); - if (handle) - { - handle->m_edge = nullptr; - } - - ndPolyhedra::ndNode* const node = GetNodeFromInfo(*edge); - ndAssert (node); - Remove (node); -} - -ndEdge* ndPolyhedra::FindEarTip (ndEdge* const face, const ndFloat64* const pool, ndInt32 stride, ndDownHeap& heap, const ndBigVector &normal) const -{ - ndEdge* ptr = face; - ndBigVector p0 (ndBigVector::m_triplexMask & ndBigVector(&pool[ptr->m_prev->m_incidentVertex * stride])); - ndBigVector p1 (ndBigVector::m_triplexMask & ndBigVector(&pool[ptr->m_incidentVertex * stride])); - ndBigVector d0 (p1 - p0); - ndFloat64 val = sqrt (d0.DotProduct(d0 & ndBigVector::m_triplexMask).GetScalar()); - if (val < ndFloat64 (1.0e-10f)) { - val = ndFloat64 (1.0e-10f); - } - d0 = d0.Scale (ndFloat64 (1.0f) / val); - - ndFloat64 minAngle = ndFloat32 (10.0f); - do - { - ndBigVector p2 (ndBigVector::m_triplexMask & ndBigVector(&pool [ptr->m_next->m_incidentVertex * stride])); - ndBigVector d1 (p2 - p1); - ndFloat64 val1 = ndFloat64 (1.0f) / sqrt (d1.DotProduct(d1).GetScalar()); - if (val1 < ndFloat64 (1.0e-10f)) - { - val1 = ndFloat64 (1.0e-10f); - } - d1 = d1.Scale (ndFloat32 (1.0f) / val1); - ndBigVector n (d0.CrossProduct(d1)); - - ndFloat64 angle = normal.DotProduct(n & ndBigVector::m_triplexMask).GetScalar(); - if (angle >= ndFloat64 (0.0f)) - { - heap.Push (ptr, angle); - } - - if (angle < minAngle) - { - minAngle = angle; - } - - d0 = d1; - p1 = p2; - ptr = ptr->m_next; - } while (ptr != face); - - if (minAngle > ndFloat32 (0.1f)) - { - return heap[0]; - } - - ndEdge* ear = nullptr; - while (heap.GetCount()) - { - ear = heap[0]; - heap.Pop(); - - if (FindEdge (ear->m_prev->m_incidentVertex, ear->m_next->m_incidentVertex)) - { - continue; - } - - ndBigVector q0 (ndBigVector::m_triplexMask & ndBigVector(&pool [ear->m_prev->m_incidentVertex * stride])); - ndBigVector q1 (ndBigVector::m_triplexMask & ndBigVector(&pool [ear->m_incidentVertex * stride])); - ndBigVector q2 (ndBigVector::m_triplexMask & ndBigVector(&pool [ear->m_next->m_incidentVertex * stride])); - - ndBigVector p10 (q1 - q0); - ndBigVector p21 (q2 - q1); - ndBigVector p02 (q0 - q2); - ndAssert(normal.m_w == ndFloat32(0.0f)); - - for (ptr = ear->m_next->m_next; ptr != ear->m_prev; ptr = ptr->m_next) - { - if (!((ptr->m_incidentVertex == ear->m_incidentVertex) || (ptr->m_incidentVertex == ear->m_prev->m_incidentVertex) || (ptr->m_incidentVertex == ear->m_next->m_incidentVertex))) - { - ndBigVector p (ndBigVector::m_triplexMask & ndBigVector(&pool [ptr->m_incidentVertex * stride])); - - //ndFloat64 side = ((p - p0) * p10) % normal; - ndFloat64 side = normal.DotProduct((p - q0).CrossProduct(p10)).GetScalar(); - if (side < ndFloat64 (0.05f)) - { - //side = ((p - p1) * p21) % normal; - side = normal.DotProduct((p - q1).CrossProduct(p21)).GetScalar(); - if (side < ndFloat64 (0.05f)) - { - //side = ((p - p2) * p02) % normal; - side = normal.DotProduct((p - q2).CrossProduct(p02)).GetScalar(); - if (side < ndFloat32 (0.05f)) - { - break; - } - } - } - } - } - - if (ptr == ear->m_prev) - { - break; - } - } - - return ear; -} - -ndEdge* ndPolyhedra::TriangulateFace (ndEdge* const faceIn, const ndFloat64* const pool, ndInt32 stride, ndDownHeap& heap, ndBigVector* const faceNormalOut) -{ - ndEdge* face = faceIn; - ndBigVector normal (FaceNormal (face, pool, ndInt32 (stride * sizeof (ndFloat64)))); - ndAssert(normal.m_w == ndFloat32(0.0f)); - ndFloat64 dot = normal.DotProduct(normal).GetScalar(); - if (dot < ndFloat64 (1.0e-12f)) - { - if (faceNormalOut) - { - *faceNormalOut = ndBigVector (ndFloat32 (0.0f)); - } - return face; - } - normal = normal.Scale (ndFloat64 (1.0f) / sqrt (dot)); - if (faceNormalOut) - { - *faceNormalOut = normal; - } - - while (face->m_next->m_next->m_next != face) - { - ndEdge* const ear = FindEarTip (face, pool, stride, heap, normal); - if (!ear) - { - return face; - } - if ((face == ear) || (face == ear->m_prev)) - { - face = ear->m_prev->m_prev; - } - ndEdge* const edge = AddHalfEdge (ear->m_next->m_incidentVertex, ear->m_prev->m_incidentVertex); - if (!edge) - { - return face; - } - ndEdge* const twin = AddHalfEdge (ear->m_prev->m_incidentVertex, ear->m_next->m_incidentVertex); - if (!twin) - { - return face; - } - ndAssert (twin); - - edge->m_mark = ear->m_mark; - edge->m_userData = ear->m_next->m_userData; - edge->m_incidentFace = ear->m_incidentFace; - - twin->m_mark = ear->m_mark; - twin->m_userData = ear->m_prev->m_userData; - twin->m_incidentFace = ear->m_incidentFace; - - edge->m_twin = twin; - twin->m_twin = edge; - - twin->m_prev = ear->m_prev->m_prev; - twin->m_next = ear->m_next; - ear->m_prev->m_prev->m_next = twin; - ear->m_next->m_prev = twin; - - edge->m_next = ear->m_prev; - edge->m_prev = ear; - ear->m_prev->m_prev = edge; - ear->m_next = edge; - - heap.Flush (); - } - return nullptr; -} - -void ndPolyhedra::MarkAdjacentCoplanarFaces (ndPolyhedra& polyhedraOut, ndEdge* const face, const ndFloat64* const pool, ndInt32 strideInBytes) -{ - const ndFloat64 normalDeviation = ndFloat64 (0.9999f); - const ndFloat64 distanceFromPlane = ndFloat64 (1.0f / 128.0f); - - ndInt32 faceIndex[D_LOCAL_BUFFER_SIZE * 8]; - ndInt64 userIndex[D_LOCAL_BUFFER_SIZE * 8]; - ndEdge* stack[D_LOCAL_BUFFER_SIZE * 8]; - ndEdge* deleteEdge[D_LOCAL_BUFFER_SIZE * 32]; - - ndInt32 deleteCount = 1; - deleteEdge[0] = face; - ndInt32 stride = ndInt32 (strideInBytes / sizeof (ndFloat64)); - - ndAssert (face->m_incidentFace > 0); - - ndBigVector normalAverage (FaceNormal (face, pool, strideInBytes)); - ndAssert (normalAverage.m_w == ndFloat32 (0.0f)); - ndFloat64 dot = normalAverage.DotProduct(normalAverage).GetScalar(); - if (dot > ndFloat64 (1.0e-12f)) - { - ndInt32 testPointsCount = 1; - dot = ndFloat64 (1.0f) / sqrt (dot); - ndBigVector normal (normalAverage.Scale (dot)); - - ndBigVector averageTestPoint (ndBigVector::m_triplexMask & ndBigVector(&pool[face->m_incidentVertex * stride])); - ndBigPlane testPlane(normal, - normal.DotProduct(averageTestPoint & ndBigVector::m_triplexMask).GetScalar()); - - polyhedraOut.BeginFace(); - - IncLRU(); - ndInt32 faceMark = IncLRU(); - - ndInt32 faceIndexCount = 0; - ndEdge* ptr = face; - do - { - ptr->m_mark = faceMark; - faceIndex[faceIndexCount] = ptr->m_incidentVertex; - userIndex[faceIndexCount] = ndInt64 (ptr->m_userData); - faceIndexCount ++; - ndAssert (faceIndexCount < ndInt32 (sizeof (faceIndex) / sizeof (faceIndex[0]))); - ptr = ptr ->m_next; - } while (ptr != face); - polyhedraOut.AddFace(faceIndexCount, faceIndex, userIndex); - - ndInt32 index = 1; - deleteCount = 0; - stack[0] = face; - while (index) - { - index --; - ndEdge* const face1 = stack[index]; - deleteEdge[deleteCount] = face1; - deleteCount ++; - ndAssert (deleteCount < ndInt32 (sizeof (deleteEdge) / sizeof (deleteEdge[0]))); - ndAssert (face1->m_next->m_next->m_next == face1); - - ndEdge* edge = face1; - do - { - ndEdge* const ptr1 = edge->m_twin; - if (ptr1->m_incidentFace > 0) - { - if (ptr1->m_mark != faceMark) - { - ndEdge* ptr2 = ptr1; - faceIndexCount = 0; - do - { - ptr2->m_mark = faceMark; - faceIndex[faceIndexCount] = ptr2->m_incidentVertex; - userIndex[faceIndexCount] = ndInt64 (ptr2->m_userData); - ndAssert (faceIndexCount < ndInt32 (sizeof (faceIndex) / sizeof (faceIndex[0]))); - faceIndexCount ++; - ptr2 = ptr2 ->m_next; - } while (ptr2 != ptr1); - - ndBigVector normal1 (FaceNormal (ptr1, pool, strideInBytes)); - dot = normal1.DotProduct(normal1).GetScalar(); - if (dot < ndFloat64 (1.0e-12f)) - { - deleteEdge[deleteCount] = ptr1; - deleteCount ++; - ndAssert (deleteCount < ndInt32 (sizeof (deleteEdge) / sizeof (deleteEdge[0]))); - } - else - { - ndBigVector testNormal (normal1.Scale (ndFloat64 (1.0f) / sqrt (dot))); - ndAssert (testNormal.m_w == ndFloat32 (0.0f)); - dot = normal.DotProduct(testNormal).GetScalar(); - if (dot >= normalDeviation) - { - ndBigVector testPoint (ndBigVector::m_triplexMask & ndBigVector(&pool[ptr1->m_prev->m_incidentVertex * stride])); - ndFloat64 dist = fabs (testPlane.Evalue (testPoint)); - if (dist < distanceFromPlane) - { - testPointsCount ++; - - averageTestPoint += testPoint; - testPoint = averageTestPoint.Scale (ndFloat64 (1.0f) / ndFloat64(testPointsCount)); - - normalAverage += normal1; - ndAssert (normalAverage.m_w == ndFloat32 (0.0f)); - testNormal = normalAverage.Scale (ndFloat64 (1.0f) / sqrt (normalAverage.DotProduct(normalAverage).GetScalar())); - testPlane = ndBigPlane (testNormal, - testPoint.DotProduct (testNormal).GetScalar()); - - polyhedraOut.AddFace(faceIndexCount, faceIndex, userIndex); - stack[index] = ptr1; - index ++; - ndAssert (index < ndInt32 (sizeof (stack) / sizeof (stack[0]))); - } - } - } - } - } - - edge = edge->m_next; - } while (edge != face1); - } - polyhedraOut.EndFace(); - } - - for (ndInt32 index = 0; index < deleteCount; index ++) - { - DeleteFace (deleteEdge[index]); - } -} - -void ndPolyhedra::RefineTriangulation (const ndFloat64* const vertex, ndInt32 stride, const ndBigVector& normal, ndInt32 perimeterCount, ndEdge** const perimeter) -{ - ndList dignonals; - - for (ndInt32 i = 1; i <= perimeterCount; ++i) - { - ndEdge* const last = perimeter[i - 1]; - for (ndEdge* ptr = perimeter[i]->m_prev; ptr != last; ptr = ptr->m_twin->m_prev) - { - ndList::ndNode* node = dignonals.GetFirst(); - for (; node; node = node->GetNext()) - { - const ndDiagonalEdge& key = node->GetInfo(); - if (((key.m_i0 == ptr->m_incidentVertex) && (key.m_i1 == ptr->m_twin->m_incidentVertex)) || - ((key.m_i1 == ptr->m_incidentVertex) && (key.m_i0 == ptr->m_twin->m_incidentVertex))) - { - break; - } - } - if (!node) - { - ndDiagonalEdge key (ptr); - dignonals.Append(key); - } - } - } - - ndEdge* const face = perimeter[0]; - ndInt32 i0 = face->m_incidentVertex * stride; - ndInt32 i1 = face->m_next->m_incidentVertex * stride; - ndBigVector p0 (vertex[i0], vertex[i0 + 1], vertex[i0 + 2], ndFloat32 (0.0f)); - ndBigVector p1 (vertex[i1], vertex[i1 + 1], vertex[i1 + 2], ndFloat32 (0.0f)); - - ndBigVector p1p0 (p1 - p0); - ndFloat64 mag2 = p1p0.DotProduct(p1p0).GetScalar(); - for (ndEdge* ptr = face->m_next->m_next; mag2 < ndFloat32 (1.0e-12f); ptr = ptr->m_next) - { - ndInt32 i2 = ptr->m_incidentVertex * stride; - ndBigVector p2 (vertex[i2], vertex[i2 + 1], vertex[i2 + 2], ndFloat32 (0.0f)); - p1p0 = p2 - p0; - mag2 = p1p0.DotProduct(p1p0).GetScalar(); - } - - ndAssert (p1p0.m_w == ndFloat32 (0.0f)); - ndMatrix matrix (ndGetIdentityMatrix()); - matrix.m_posit = p0; - matrix.m_front = ndVector (p1p0.Scale (ndFloat64 (1.0f) / sqrt (mag2))); - matrix.m_right = ndVector (normal.Scale (ndFloat64 (1.0f) / sqrt (normal.DotProduct(normal).GetScalar()))); - matrix.m_up = matrix.m_right.CrossProduct(matrix.m_front); - matrix = matrix.OrthoInverse(); - ndAssert (matrix.m_posit.m_w == ndFloat32 (1.0f)); - - ndInt32 maxCount = dignonals.GetCount() * dignonals.GetCount(); - while (dignonals.GetCount() && maxCount) - { - maxCount --; - ndList::ndNode* const node = dignonals.GetFirst(); - ndDiagonalEdge key (node->GetInfo()); - dignonals.Remove(node); - ndEdge* const edge = FindEdge(key.m_i0, key.m_i1); - if (edge) - { - ndInt32 k0 = edge->m_incidentVertex * stride; - ndInt32 k1 = edge->m_next->m_incidentVertex * stride; - ndInt32 k2 = edge->m_next->m_next->m_incidentVertex * stride; - ndInt32 k3 = edge->m_twin->m_prev->m_incidentVertex * stride; - - ndBigVector q0 (vertex[k0], vertex[k0 + 1], vertex[k0 + 2], ndFloat64 (1.0f)); - ndBigVector q1 (vertex[k1], vertex[k1 + 1], vertex[k1 + 2], ndFloat64 (1.0f)); - ndBigVector q2 (vertex[k2], vertex[k2 + 1], vertex[k2 + 2], ndFloat64 (1.0f)); - ndBigVector q3 (vertex[k3], vertex[k3 + 1], vertex[k3 + 2], ndFloat64 (1.0f)); - - q0 = matrix.TransformVector(q0); - q1 = matrix.TransformVector(q1); - q2 = matrix.TransformVector(q2); - q3 = matrix.TransformVector(q3); - - ndFloat64 circleTest[3][3]; - circleTest[0][0] = q0[0] - q3[0]; - circleTest[0][1] = q0[1] - q3[1]; - circleTest[0][2] = circleTest[0][0] * circleTest[0][0] + circleTest[0][1] * circleTest[0][1]; - - circleTest[1][0] = q1[0] - q3[0]; - circleTest[1][1] = q1[1] - q3[1]; - circleTest[1][2] = circleTest[1][0] * circleTest[1][0] + circleTest[1][1] * circleTest[1][1]; - - circleTest[2][0] = q2[0] - q3[0]; - circleTest[2][1] = q2[1] - q3[1]; - circleTest[2][2] = circleTest[2][0] * circleTest[2][0] + circleTest[2][1] * circleTest[2][1]; - - ndFloat64 error; - ndFloat64 det = Determinant3x3 (circleTest, &error); - if (det < ndFloat32 (0.0f)) - { - ndEdge* frontFace0 = edge->m_prev; - ndEdge* backFace0 = edge->m_twin->m_prev; - - FlipEdge(edge); - - if (perimeterCount > 4) - { - ndEdge* backFace1 = backFace0->m_next; - ndEdge* frontFace1 = frontFace0->m_next; - for (ndInt32 i = 0; i < perimeterCount; ++i) - { - if (frontFace0 == perimeter[i]) - { - frontFace0 = nullptr; - } - if (frontFace1 == perimeter[i]) - { - frontFace1 = nullptr; - } - - if (backFace0 == perimeter[i]) - { - backFace0 = nullptr; - } - if (backFace1 == perimeter[i]) - { - backFace1 = nullptr; - } - } - - if (backFace0 && (backFace0->m_incidentFace > 0) && (backFace0->m_twin->m_incidentFace > 0)) - { - ndDiagonalEdge key0 (backFace0); - dignonals.Append(key0); - } - if (backFace1 && (backFace1->m_incidentFace > 0) && (backFace1->m_twin->m_incidentFace > 0)) - { - ndDiagonalEdge key1 (backFace1); - dignonals.Append(key1); - } - - if (frontFace0 && (frontFace0->m_incidentFace > 0) && (frontFace0->m_twin->m_incidentFace > 0)) - { - ndDiagonalEdge key0 (frontFace0); - dignonals.Append(key0); - } - - if (frontFace1 && (frontFace1->m_incidentFace > 0) && (frontFace1->m_twin->m_incidentFace > 0)) - { - ndDiagonalEdge key1 (frontFace1); - dignonals.Append(key1); - } - } - } - } - } -} - -void ndPolyhedra::RefineTriangulation (const ndFloat64* const vertex, ndInt32 stride) -{ - if (GetCount() <= 6) - { - return; - } - - ndInt32 mark = IncLRU(); - ndInt32 loopCount = 0; - - ndPolyhedra::Iterator iter (*this); - ndEdge* edgePerimeters[D_LOCAL_BUFFER_SIZE * 16]; - ndInt32 perimeterCount = 0; - ndTree filter; - for (iter.Begin(); iter && (loopCount <= 1) ; iter ++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_incidentFace < 0) && (edge->m_mark != mark)) - { - loopCount ++; - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - if (!filter.Insert(ptr, ptr->m_incidentVertex)) - { - loopCount = 2; - break; - } - edgePerimeters[perimeterCount] = ptr->m_twin; - perimeterCount ++; - ndAssert (perimeterCount < ndInt32 (sizeof (edgePerimeters) / sizeof (edgePerimeters[0]))); - ptr = ptr->m_prev; - } while (ptr != edge); - } - } - - if (loopCount == 1) - { - #ifdef _DEBUG - for (ndInt32 i = 0; i < perimeterCount; ++i) - { - for (ndInt32 j = i + 1; j < perimeterCount; ++j) - { - ndAssert (edgePerimeters[i]->m_incidentVertex != edgePerimeters[j]->m_incidentVertex); - } - } - #endif - - ndAssert (perimeterCount); - ndAssert (perimeterCount < ndInt32 (sizeof (edgePerimeters) / sizeof (edgePerimeters[0]))); - edgePerimeters[perimeterCount] = edgePerimeters[0]; - - ndBigVector normal (FaceNormal(edgePerimeters[0], vertex, ndInt32 (stride * sizeof (ndFloat64)))); - if (normal.DotProduct(normal).GetScalar() > ndFloat32 (1.0e-12f)) - { - RefineTriangulation (vertex, stride, normal, perimeterCount, edgePerimeters); - } - } -} - -void ndPolyhedra::OptimizeTriangulation (const ndFloat64* const vertex, ndInt32 strideInBytes) -{ - ndInt32 polygon[D_LOCAL_BUFFER_SIZE * 8]; - ndInt64 userData[D_LOCAL_BUFFER_SIZE * 8]; - ndInt32 stride = ndInt32 (strideInBytes / sizeof (ndFloat64)); - - ndPolyhedra leftOver; - ndPolyhedra buildConvex; - - buildConvex.BeginFace(); - ndPolyhedra::Iterator iter (*this); - - for (iter.Begin(); iter; ) - { - ndEdge* const edge = &(*iter); - iter++; - - if (edge->m_incidentFace > 0) - { - ndPolyhedra flatFace; - MarkAdjacentCoplanarFaces (flatFace, edge, vertex, strideInBytes); - //ndAssert (flatFace.GetCount()); - - if (flatFace.GetCount()) - { - flatFace.RefineTriangulation (vertex, stride); - - ndInt32 mark = flatFace.IncLRU(); - ndPolyhedra::Iterator iter1 (flatFace); - for (iter1.Begin(); iter1; iter1 ++) - { - ndEdge* const edge1 = &(*iter1); - if (edge1->m_mark != mark) - { - if (edge1->m_incidentFace > 0) - { - ndEdge* ptr = edge1; - ndInt32 vertexCount = 0; - do - { - polygon[vertexCount] = ptr->m_incidentVertex; - userData[vertexCount] = ndInt64 (ptr->m_userData); - vertexCount ++; - ndAssert (vertexCount < ndInt32 (sizeof (polygon) / sizeof (polygon[0]))); - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge1); - if (vertexCount >= 3) - { - buildConvex.AddFace (vertexCount, polygon, userData); - } - } - } - } - } - iter.Begin(); - } - } - buildConvex.EndFace(); - ndAssert (GetCount() == 0); - SwapInfo(buildConvex); -} - -void ndPolyhedra::Triangulate (const ndFloat64* const vertex, ndInt32 strideInBytes, ndPolyhedra* const leftOver) -{ - ndInt32 stride = ndInt32 (strideInBytes / sizeof (ndFloat64)); - - ndInt32 count = GetCount() / 2; - ndStack memPool (ndInt32 ((count + 512) * (2 * sizeof (ndFloat64)))); - ndDownHeap heap(&memPool[0], memPool.GetSizeInBytes()); - - ndInt32 mark = IncLRU(); - Iterator iter (*this); - for (iter.Begin(); iter; ) - { - ndEdge* const thisEdge = &(*iter); - iter ++; - - if (thisEdge->m_mark == mark) - { - continue; - } - if (thisEdge->m_incidentFace < 0) - { - continue; - } - - count = 0; - ndEdge* ptr = thisEdge; - do - { - count ++; - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != thisEdge); - - if (count > 3) - { - ndEdge* const edge = TriangulateFace (thisEdge, vertex, stride, heap, nullptr); - heap.Flush (); - - if (edge) - { - ndAssert (edge->m_incidentFace > 0); - - if (leftOver) - { - ndInt32* const index = (ndInt32 *) &heap[0]; - ndInt64* const data = (ndInt64 *)&index[count]; - ndInt32 i = 0; - ndEdge* ptr1 = edge; - do - { - index[i] = ptr1->m_incidentVertex; - data[i] = ndInt64 (ptr1->m_userData); - i ++; - ptr1 = ptr1->m_next; - } while (ptr1 != edge); - leftOver->AddFace(i, index, data); - - } - else - { - ndTrace (("Deleting face:")); - ptr = edge; - do - { - ndTrace (("%d ", ptr->m_incidentVertex)); - } while (ptr != edge); - ndTrace (("\n")); - } - - DeleteFace (edge); - iter.Begin(); - } - } - } - - OptimizeTriangulation (vertex, strideInBytes); - - mark = IncLRU(); - m_faceSecuence = 1; - for (iter.Begin(); iter; iter ++) - { - ndEdge* edge = &(*iter); - if (edge->m_mark == mark) - { - continue; - } - if (edge->m_incidentFace < 0) - { - continue; - } - ndAssert (edge == edge->m_next->m_next->m_next); - - for (ndInt32 i = 0; i < 3; ++i) - { - edge->m_incidentFace = m_faceSecuence; - edge->m_mark = mark; - edge = edge->m_next; - } - m_faceSecuence ++; - } -} - -bool ndPolyhedra::IsFaceConvex(ndEdge* const face, const ndFloat64* const vertex, ndInt32 strideInBytes) const -{ - if (face->m_next->m_next->m_next == face) - { - return true; - } - ndBigVector normal(FaceNormal(face, vertex, strideInBytes)); - ndAssert(normal.m_w == ndFloat32(0.0f)); - - ndInt32 stride = strideInBytes / ndInt32(sizeof(ndFloat64)); - ndEdge* ptr = face; - do - { - ndBigVector p0(ndBigVector::m_triplexMask & ndBigVector(&vertex[ptr->m_incidentVertex * stride])); - ndBigVector p1(ndBigVector::m_triplexMask & ndBigVector(&vertex[ptr->m_prev->m_incidentVertex * stride])); - ndBigVector p2(ndBigVector::m_triplexMask & ndBigVector(&vertex[ptr->m_next->m_incidentVertex * stride])); - - ndBigVector e0(p1 - p0); - ndBigVector e1(p2 - p1); - ndBigVector cornerNormal(e1.CrossProduct(e0)); - ndFloat64 project(normal.DotProduct(cornerNormal).GetScalar()); - if (project < ndFloat32(0.0f)) - { - return false; - } - - ptr = ptr->m_next; - } while (ptr != face); - - return true; -} - -void ndPolyhedra::RemoveOuterColinearEdges (ndPolyhedra& flatFace, const ndFloat64* const vertex, ndInt32 stride) -{ - ndEdge* edgePerimeters[D_LOCAL_BUFFER_SIZE]; - - ndInt32 perimeterCount = 0; - ndInt32 mark = flatFace.IncLRU(); - ndPolyhedra::Iterator iter (flatFace); - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_incidentFace < 0) && (edge->m_mark != mark)) - { - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge); - - edgePerimeters[perimeterCount] = edge; - perimeterCount++; - ndAssert(perimeterCount < ndInt32(sizeof(edgePerimeters) / sizeof(edgePerimeters[0]))); - } - } - - ndInt8 buffer[2048 * sizeof (ndFloat64)]; - ndDownHeap heap(&buffer[0], sizeof (buffer)); - for (ndInt32 i = 0; i < perimeterCount; ++i) - { - ndEdge* edge = edgePerimeters[i]; - ndEdge* ptr = edge; - ndBigVector p0 (ndBigVector::m_triplexMask & ndBigVector(&vertex[ptr->m_incidentVertex * stride]) ); - ndBigVector p1 (ndBigVector::m_triplexMask & ndBigVector(&vertex[ptr->m_next->m_incidentVertex * stride])); - ndBigVector e0 ((p1 - p0)); - e0 = e0.Scale (ndFloat32(1.0f) / sqrt (e0.DotProduct(e0).GetScalar() + ndFloat32 (1.0e-12f))); - ndInt32 ignoreTest = 1; - do - { - ignoreTest = 0; - ndBigVector p2 (ndBigVector::m_triplexMask & ndBigVector(&vertex[ptr->m_next->m_next->m_incidentVertex * stride])); - ndBigVector e1 (p2 - p1); - //e1 = e1.Scale (dRsqrt (e1.DotProduct3(e1) + ndFloat32 (1.0e-12f))); - e1 = e1.Scale(ndFloat32(1.0f) / sqrt(e1.DotProduct(e1).GetScalar() + ndFloat32(1.0e-12f))); - ndFloat64 dot = e1.DotProduct(e0).GetScalar(); - if (dot > ndFloat32 (ndFloat32 (0.9999f))) - { - for (ndEdge* interiorEdge = ptr->m_next->m_twin->m_next; interiorEdge != ptr->m_twin; interiorEdge = ptr->m_next->m_twin->m_next) - { - ndAssert((interiorEdge->m_incidentFace > 0) && (interiorEdge->m_twin->m_incidentFace > 0)); - if ((interiorEdge->m_incidentFace > 0) && (interiorEdge->m_twin->m_incidentFace > 0)) - { - flatFace.DeleteEdge(interiorEdge); - } - else - { - return; - } - } - - if (ptr->m_twin->m_next->m_next->m_next == ptr->m_twin) { - ndAssert (ptr->m_twin->m_next->m_incidentFace > 0); - flatFace.DeleteEdge (ptr->m_twin->m_next); - } - - ndAssert (ptr->m_next->m_twin->m_next->m_twin == ptr); - edge = ptr->m_next; - - if (!flatFace.FindEdge (ptr->m_incidentVertex, edge->m_twin->m_incidentVertex) && - !flatFace.FindEdge (edge->m_twin->m_incidentVertex, ptr->m_incidentVertex)) - { - ptr->m_twin->m_prev = edge->m_twin->m_prev; - edge->m_twin->m_prev->m_next = ptr->m_twin; - - edge->m_next->m_prev = ptr; - ptr->m_next = edge->m_next; - - edge->m_next = edge->m_twin; - edge->m_prev = edge->m_twin; - edge->m_twin->m_next = edge; - edge->m_twin->m_prev = edge; - flatFace.DeleteEdge (edge); - flatFace.ChangeEdgeIncidentVertex (ptr->m_twin, ptr->m_next->m_incidentVertex); - - if (!flatFace.IsFaceConvex(ptr->m_twin, vertex, stride * ndInt32 (sizeof(ndFloat64)))) - { - heap.Flush(); - flatFace.TriangulateFace(ptr->m_twin, vertex, stride, heap, nullptr); - } - - e1 = e0; - p1 = p2; - edge = ptr; - ignoreTest = 1; - continue; - } - } - - e0 = e1; - p1 = p2; - ptr = ptr->m_next; - } while ((ptr != edge) || ignoreTest); - } -} - -void ndPolyhedra::RemoveInteriorColinearEdges(ndPolyhedra& flatFace, const ndFloat64* const vertex, ndInt32 stride) -{ - bool foundEdge = true; - while (foundEdge) - { - foundEdge = false; - ndPolyhedra::Iterator iter(flatFace); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if ((edge->m_incidentFace > 0) && (edge->m_twin->m_incidentFace > 0)) - { - if (edge->m_twin->m_next->m_twin->m_next == edge) - { - ndBigVector p0(ndBigVector::m_triplexMask & ndBigVector(&vertex[edge->m_prev->m_incidentVertex * stride])); - ndBigVector p1(ndBigVector::m_triplexMask & ndBigVector(&vertex[edge->m_incidentVertex * stride])); - ndBigVector p2(ndBigVector::m_triplexMask & ndBigVector(&vertex[edge->m_next->m_incidentVertex * stride])); - - ndBigVector e0(p1 - p0); - ndBigVector e1(p2 - p1); - e0 = e0.Scale(ndFloat32 (1.0f) / sqrt(e0.DotProduct(e0).GetScalar() + ndFloat32(1.0e-12f))); - e1 = e1.Scale(ndFloat32 (1.0f) / sqrt(e1.DotProduct(e1).GetScalar() + ndFloat32(1.0e-12f))); - ndFloat64 dot = e1.DotProduct(e0).GetScalar(); - if (dot > ndFloat32(0.9999f)) - { - ndInt32 v = edge->m_twin->m_incidentVertex; - ndEdge* const nextEdge = edge->m_twin->m_next; - edge->m_next->m_prev = edge->m_prev; - edge->m_prev->m_next = edge->m_next; - edge->m_twin->m_next->m_prev = edge->m_twin->m_prev; - edge->m_twin->m_prev->m_next = edge->m_twin->m_next; - - edge->m_next = edge->m_twin; - edge->m_prev = edge->m_twin; - edge->m_twin->m_next = edge; - edge->m_twin->m_prev = edge; - flatFace.DeleteEdge(edge); - flatFace.ChangeEdgeIncidentVertex(nextEdge, v); - foundEdge = true; - break; - } - } - } - } - } -} - -ndInt32 ndPolyhedra::GetInteriorDiagonals (ndPolyhedra& polyhedra, ndEdge** const diagonals, ndInt32 maxCount) -{ - ndInt32 count = 0; - ndInt32 mark = polyhedra.IncLRU(); - ndPolyhedra::Iterator iter (polyhedra); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if (edge->m_mark != mark) - { - if (edge->m_incidentFace > 0) - { - if (edge->m_twin->m_incidentFace > 0) - { - edge->m_twin->m_mark = mark; - if (count < maxCount){ - diagonals[count] = edge; - count ++; - } - ndAssert (count <= maxCount); - } - } - } - edge->m_mark = mark; - } - - return count; -} - -bool ndPolyhedra::IsEssensialPointDiagonal (ndEdge* const diagonal, const ndBigVector& normal, const ndFloat64* const pool, ndInt32 stride) -{ - if (diagonal->m_twin->m_next->m_twin->m_next != diagonal) - { - ndBigVector p0 (ndBigVector::m_triplexMask & ndBigVector(&pool[diagonal->m_incidentVertex * stride])); - ndBigVector p1 (ndBigVector::m_triplexMask & ndBigVector(&pool[diagonal->m_twin->m_next->m_twin->m_incidentVertex * stride])); - ndBigVector p2 (ndBigVector::m_triplexMask & ndBigVector(&pool[diagonal->m_prev->m_incidentVertex * stride])); - - ndBigVector e1 (p1 - p0); - ndFloat64 dot = e1.DotProduct(e1).GetScalar(); - if (dot < ndFloat64 (1.0e-12f)) - { - return false; - } - e1 = e1.Scale (ndFloat64 (1.0f) / sqrt(dot)); - - ndBigVector e2 (p2 - p0); - dot = e2.DotProduct(e2).GetScalar(); - if (dot < ndFloat64 (1.0e-12f)) - { - return false; - } - e2 = e2.Scale (ndFloat64 (1.0f) / sqrt(dot)); - - ndBigVector n1 (e1.CrossProduct(e2)); - ndAssert(normal.m_w == ndFloat32(0.0f)); - dot = normal.DotProduct(n1).GetScalar(); - if (dot >= ndFloat64 (0.0f)) - { - return false; - } - } - return true; -} - -bool ndPolyhedra::IsEssensialDiagonal (ndEdge* const diagonal, const ndBigVector& normal, const ndFloat64* const pool, ndInt32 stride) -{ - return IsEssensialPointDiagonal (diagonal, normal, pool, stride) || IsEssensialPointDiagonal (diagonal->m_twin, normal, pool, stride); -} - -ndBigPlane ndPolyhedra::EdgePlane (ndInt32 i0, ndInt32 i1, ndInt32 i2, const ndBigVector* const pool) const -{ - const ndBigVector& p0 = pool[i0]; - const ndBigVector& p1 = pool[i1]; - const ndBigVector& p2 = pool[i2]; - - ndBigPlane plane (p0, p1, p2); - ndFloat64 mag = sqrt (plane.DotProduct(plane & ndBigPlane::m_triplexMask).GetScalar()); - if (mag < ndFloat64 (1.0e-12f)) { - mag = ndFloat64 (1.0e-12f); - } - mag = ndFloat64 (1.0f) / mag; - - plane.m_x *= mag; - plane.m_y *= mag; - plane.m_z *= mag; - plane.m_w *= mag; - - return plane; -} - -void ndPolyhedra::CalculateVertexMetrics (ndVertexCollapseVertexMetric* const table, const ndBigVector* const pool, ndEdge* const edge) const -{ - ndInt32 i0 = edge->m_incidentVertex; - - table[i0].Clear (); - ndEdge* ptr = edge; - do - { - if (ptr->m_incidentFace > 0) - { - ndInt32 i1 = ptr->m_next->m_incidentVertex; - ndInt32 i2 = ptr->m_prev->m_incidentVertex; - ndBigPlane constrainPlane (EdgePlane (i0, i1, i2, pool)); - table[i0].Accumulate (constrainPlane); - - } - else - { - ndInt32 i1 = ptr->m_twin->m_incidentVertex; - ndInt32 i2 = ptr->m_twin->m_prev->m_incidentVertex; - ndBigPlane constrainPlane (UnboundedLoopPlane (i0, i1, i2, pool)); - table[i0].Accumulate (constrainPlane); - - i1 = ptr->m_prev->m_incidentVertex; - i2 = ptr->m_prev->m_twin->m_prev->m_incidentVertex; - constrainPlane = UnboundedLoopPlane (i0, i1, i2, pool); - table[i0].Accumulate (constrainPlane); - } - - ptr = ptr->m_twin->m_next; - } while (ptr != edge); -} - -void ndPolyhedra::CalculateAllMetrics (ndVertexCollapseVertexMetric* const table, const ndBigVector* const pool) const -{ - ndInt32 edgeMark = IncLRU(); - ndPolyhedra::Iterator iter (*this); - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - - ndAssert (edge); - if (edge->m_mark != edgeMark) - { - if (edge->m_incidentFace > 0) - { - ndInt32 i0 = edge->m_incidentVertex; - ndInt32 i1 = edge->m_next->m_incidentVertex; - ndInt32 i2 = edge->m_prev->m_incidentVertex; - - ndBigPlane constrainPlane (EdgePlane (i0, i1, i2, pool)); - ndVertexCollapseVertexMetric tmp (constrainPlane); - - ndEdge* ptr = edge; - do - { - ptr->m_mark = edgeMark; - i0 = ptr->m_incidentVertex; - table[i0].Accumulate(tmp); - - ptr = ptr->m_next; - } while (ptr != edge); - } - else - { - ndAssert (edge->m_twin->m_incidentFace > 0); - ndInt32 i0 = edge->m_twin->m_incidentVertex; - ndInt32 i1 = edge->m_twin->m_next->m_incidentVertex; - ndInt32 i2 = edge->m_twin->m_prev->m_incidentVertex; - - edge->m_mark = edgeMark; - ndBigPlane constrainPlane (UnboundedLoopPlane (i0, i1, i2, pool)); - ndVertexCollapseVertexMetric tmp (constrainPlane); - - i0 = edge->m_incidentVertex; - table[i0].Accumulate(tmp); - - i0 = edge->m_twin->m_incidentVertex; - table[i0].Accumulate(tmp); - } - } - } -} - -bool ndPolyhedra::IsOkToCollapse (const ndBigVector* const pool, ndEdge* const edge) const -{ - const ndBigVector& q = pool[edge->m_incidentVertex]; - const ndBigVector& p = pool[edge->m_twin->m_incidentVertex]; - for (ndEdge* triangle = edge->m_prev->m_twin; triangle != edge->m_twin->m_next; triangle = triangle->m_prev->m_twin) - { - if (triangle->m_incidentFace > 0) - { - ndAssert ((edge->m_incidentFace < 0) || (edge->m_incidentVertex == edge->m_next->m_next->m_next->m_incidentVertex)); - - ndBigVector originalArea (ndBigVector::m_triplexMask & (pool[triangle->m_next->m_incidentVertex] - q).CrossProduct(pool[triangle->m_prev->m_incidentVertex] - q)); - ndBigVector newArea (ndBigVector::m_triplexMask & (pool[triangle->m_next->m_incidentVertex] - p).CrossProduct(pool[triangle->m_prev->m_incidentVertex] - p)); - - ndFloat64 projectedArea = newArea.DotProduct(originalArea).GetScalar(); - if (projectedArea <= ndFloat64 (0.0f)) - { - return false; - } - - ndFloat64 mag20 = newArea.DotProduct(newArea).GetScalar(); - ndFloat64 mag21 = originalArea.DotProduct(originalArea).GetScalar();; - if ((projectedArea * projectedArea) < (mag20 * mag21 * ndFloat64 (1.0e-10f))) - { - return false; - } - } - } - - return true; -} - -ndEdge* ndPolyhedra::OptimizeCollapseEdge (ndEdge* const edge) -{ - ndInt32 v0 = edge->m_incidentVertex; - ndInt32 v1 = edge->m_twin->m_incidentVertex; - -#ifdef _DEBUG - ndPolyhedra::ndPairKey TwinKey (v1, v0); - ndPolyhedra::ndNode* const node = Find (TwinKey.GetVal()); - ndEdge* const twin1 = node ? &node->GetInfo() : nullptr; - ndAssert (twin1); - ndAssert (edge->m_twin == twin1); - ndAssert (twin1->m_twin == edge); - ndAssert (edge->m_incidentFace != 0); - ndAssert (twin1->m_incidentFace != 0); - ndAssert ((edge->m_incidentFace < 0) || (edge->m_incidentVertex == edge->m_next->m_next->m_next->m_incidentVertex)); - ndAssert ((edge->m_twin->m_incidentFace < 0) || (edge->m_twin->m_incidentVertex == edge->m_twin->m_next->m_next->m_next->m_incidentVertex)); -#endif - - ndEdge* retEdge = edge->m_twin->m_prev->m_twin; - if (retEdge == edge->m_twin->m_next) - { - return nullptr; - } - if (retEdge == edge->m_twin) - { - return nullptr; - } - if (retEdge == edge->m_next) - { - retEdge = edge->m_prev->m_twin; - if (retEdge == edge->m_twin->m_next) - { - return nullptr; - } - if (retEdge == edge->m_twin) - { - return nullptr; - } - } - - ndEdge* lastEdge = nullptr; - ndEdge* firstEdge = nullptr; - if ((edge->m_incidentFace >= 0) && (edge->m_twin->m_incidentFace >= 0)) - { - lastEdge = edge->m_prev->m_twin; - firstEdge = edge->m_twin->m_next->m_twin->m_next; - } - else if (edge->m_twin->m_incidentFace >= 0) - { - firstEdge = edge->m_twin->m_next->m_twin->m_next; - lastEdge = edge; - } - else - { - lastEdge = edge->m_prev->m_twin; - firstEdge = edge->m_twin->m_next; - } - - for (ndEdge* ptr = firstEdge; ptr != lastEdge; ptr = ptr->m_twin->m_next) - { - ndEdge* badEdge = FindEdge (edge->m_twin->m_incidentVertex, ptr->m_twin->m_incidentVertex); - if (badEdge) - { - return nullptr; - } - } - - ndEdge* const twin = edge->m_twin; - if (twin->m_next == twin->m_prev->m_prev) - { - twin->m_prev->m_twin->m_twin = twin->m_next->m_twin; - twin->m_next->m_twin->m_twin = twin->m_prev->m_twin; - - RemoveHalfEdge (twin->m_prev); - RemoveHalfEdge (twin->m_next); - } - else - { - twin->m_next->m_prev = twin->m_prev; - twin->m_prev->m_next = twin->m_next; - } - - if (edge->m_next == edge->m_prev->m_prev) - { - edge->m_next->m_twin->m_twin = edge->m_prev->m_twin; - edge->m_prev->m_twin->m_twin = edge->m_next->m_twin; - RemoveHalfEdge (edge->m_next); - RemoveHalfEdge (edge->m_prev); - } - else - { - edge->m_next->m_prev = edge->m_prev; - edge->m_prev->m_next = edge->m_next; - } - - ndAssert (twin->m_twin->m_incidentVertex == v0); - ndAssert (edge->m_twin->m_incidentVertex == v1); - RemoveHalfEdge (twin); - RemoveHalfEdge (edge); - - ndEdge* remapPtr = retEdge; - do - { - ndPolyhedra::ndPairKey pairKey (v0, remapPtr->m_twin->m_incidentVertex); - ndPolyhedra::ndNode* const pairEdgeNode = Find (pairKey.GetVal()); - if (pairEdgeNode) - { - if (&pairEdgeNode->GetInfo() == remapPtr) - { - ndPolyhedra::ndPairKey key (v1, remapPtr->m_twin->m_incidentVertex); - remapPtr->m_incidentVertex = v1; - ReplaceKey (pairEdgeNode, key.GetVal()); - } - } - - ndPolyhedra::ndPairKey twinKey1 (remapPtr->m_twin->m_incidentVertex, v0); - ndPolyhedra::ndNode* const pairTwinNode = Find (twinKey1.GetVal()); - if (pairTwinNode) - { - if (&pairTwinNode->GetInfo() == remapPtr->m_twin) - { - ndPolyhedra::ndPairKey key (remapPtr->m_twin->m_incidentVertex, v1); - ReplaceKey (pairTwinNode, key.GetVal()); - } - } - - remapPtr = remapPtr->m_twin->m_next; - } while (remapPtr != retEdge); - - return retEdge; -} - -ndFloat64 ndPolyhedra::EdgePenalty (const ndBigVector* const pool, ndEdge* const edge, ndFloat64 dist) const -{ - ndInt32 i0 = edge->m_incidentVertex; - ndInt32 i1 = edge->m_next->m_incidentVertex; - - ndFloat32 maxPenalty = ndFloat32 (1.0e14f); - - const ndBigVector& p0 = pool[i0]; - const ndBigVector& p1 = pool[i1]; - ndBigVector dp (p1 - p0); - - ndAssert(dp.m_w == ndFloat32(0.0f)); - ndFloat64 dot = dp.DotProduct(dp).GetScalar();; - if (dot < ndFloat64(1.0e-6f)) - { - return dist * maxPenalty; - } - - if ((edge->m_incidentFace > 0) && (edge->m_twin->m_incidentFace > 0)) - { - ndBigVector edgeNormal (FaceNormal (edge, &pool[0].m_x, sizeof (ndBigVector))); - ndBigVector twinNormal (FaceNormal (edge->m_twin, &pool[0].m_x, sizeof (ndBigVector))); - - ndFloat64 mag0 = edgeNormal.DotProduct(edgeNormal).GetScalar(); - ndFloat64 mag1 = twinNormal.DotProduct(twinNormal).GetScalar(); - if ((mag0 < ndFloat64 (1.0e-24f)) || (mag1 < ndFloat64 (1.0e-24f))) - { - return dist * maxPenalty; - } - - edgeNormal = edgeNormal.Scale (ndFloat64 (1.0f) / sqrt(mag0)); - twinNormal = twinNormal.Scale (ndFloat64 (1.0f) / sqrt(mag1)); - - dot = edgeNormal.DotProduct(twinNormal).GetScalar();; - if (dot < ndFloat64 (-0.9f)) - { - return dist * maxPenalty; - } - - ndEdge* ptr = edge; - do - { - if ((ptr->m_incidentFace <= 0) || (ptr->m_twin->m_incidentFace <= 0)) - { - ndEdge* const adj = edge->m_twin; - ptr = edge; - do - { - if ((ptr->m_incidentFace <= 0) || (ptr->m_twin->m_incidentFace <= 0)) - { - return dist * maxPenalty; - } - ptr = ptr->m_twin->m_next; - } while (ptr != adj); - } - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - } - - ndInt32 faceA = edge->m_incidentFace; - ndInt32 faceB = edge->m_twin->m_incidentFace; - - i0 = edge->m_twin->m_incidentVertex; - ndBigVector p (pool[i0].m_x, pool[i0].m_y, pool[i0].m_z, ndFloat32 (0.0f)); - - bool penalty = false; - ndEdge* ptr = edge; - do - { - ndEdge* const adj = ptr->m_twin; - - ndInt32 face = adj->m_incidentFace; - if ((face != faceB) && (face != faceA) && (face >= 0) && (adj->m_next->m_incidentFace == face) && (adj->m_prev->m_incidentFace == face)) - { - ndInt32 k0 = adj->m_next->m_incidentVertex; - const ndBigVector& q0 = pool[k0]; - - ndInt32 k1 = adj->m_incidentVertex; - const ndBigVector& q1 = pool[k1]; - - ndInt32 k2 = adj->m_prev->m_incidentVertex; - const ndBigVector& q2 = pool[k2]; - - ndBigVector n0 (ndBigVector::m_triplexMask & (q1 - q0).CrossProduct(q2 - q0)); - ndBigVector n1 (ndBigVector::m_triplexMask & (q1 - p).CrossProduct(q2 - p)); - ndFloat64 project = n0.DotProduct(n1).GetScalar(); - if (project < ndFloat64 (0.0f)) - { - penalty = true; - break; - } - } - - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - - ndFloat64 aspect = ndFloat32 (0.0f); - if (!penalty) - { - ndInt32 k0 = edge->m_twin->m_incidentVertex; - ndBigVector q0 (pool[k0]); - - aspect = ndFloat32 (1.0f); - for (ndEdge* ptr1 = edge->m_twin->m_next->m_twin->m_next; ptr1 != edge; ptr1 = ptr1->m_twin->m_next) - { - if (ptr1->m_incidentFace > 0) - { - ndInt32 k1 = ptr1->m_next->m_incidentVertex; - const ndBigVector& q1 = pool[k1]; - - ndInt32 k2 = ptr1->m_prev->m_incidentVertex; - const ndBigVector& q2 = pool[k2]; - - ndBigVector e0 (q1 - q0); - ndBigVector e1 (q2 - q1); - ndBigVector e2 (q0 - q2); - ndAssert(e0.m_w == ndFloat32(0.0f)); - ndAssert(e1.m_w == ndFloat32(0.0f)); - ndAssert(e2.m_w == ndFloat32(0.0f)); - - ndFloat64 mag0 = e0.DotProduct(e0).GetScalar(); - ndFloat64 mag1 = e1.DotProduct(e1).GetScalar(); - ndFloat64 mag2 = e2.DotProduct(e2).GetScalar(); - ndFloat64 maxMag = ndMax(ndMax (mag0, mag1), mag2); - ndFloat64 minMag = ndMin(ndMin (mag0, mag1), mag2); - ndFloat64 ratio = minMag / maxMag; - - if (ratio < aspect) - { - aspect = ratio; - } - } - } - aspect = ndFloat32 (1.0f) - aspect; - } - return aspect * aspect * dist; -} - -bool ndPolyhedra::Optimize (const ndFloat64* const array, ndInt32 strideInBytes, ndFloat64 tol, ndInt32 maxFaceCount) -{ - ndInt32 stride = ndInt32 (strideInBytes / sizeof (ndFloat64)); - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - - ndFloat32 progressDen = ndFloat32 (1.0f) / (ndFloat32)GetEdgeCount(); - ndInt32 edgeCount = GetEdgeCount() * 4 + D_LOCAL_BUFFER_SIZE * 16; - ndInt32 maxVertexIndex = GetLastVertexIndex(); - - ndStack vertexPool (maxVertexIndex); - ndStack vertexMetrics (maxVertexIndex + 512); - - ndList edgeHandleList; - ndStack heapPool (2 * edgeCount * ndInt32 (sizeof (ndFloat64) + sizeof (ndEdgeCollapseEdgeHandle*) + sizeof (ndInt32))); - ndUpHeap::ndNode* , ndFloat64> bigHeapArray(&heapPool[0], heapPool.GetSizeInBytes()); - - for (ndInt32 i = 0; i < maxVertexIndex; ++i) - { - vertexPool[i].m_x = array[i * stride + 0]; - vertexPool[i].m_y = array[i * stride + 1]; - vertexPool[i].m_z = array[i * stride + 2]; - vertexPool[i].m_w= ndFloat64 (0.0f); - } - - memset (&vertexMetrics[0], 0, maxVertexIndex * sizeof (ndVertexCollapseVertexMetric)); - CalculateAllMetrics (&vertexMetrics[0], &vertexPool[0]); - - const ndFloat64 maxCost = ndFloat32 (1.0e-3f); - ndFloat64 tol2 = tol * tol; - ndFloat64 distTol = ndMax (tol2, ndFloat64 (1.0e-12f)); - Iterator iter (*this); - for (iter.Begin(); iter; iter ++) - { - ndEdge* const edge = &(*iter); - - edge->m_userData = 0; - ndInt32 index0 = edge->m_incidentVertex; - ndInt32 index1 = edge->m_twin->m_incidentVertex; - - ndVertexCollapseVertexMetric &metric = vertexMetrics[index0]; - const ndBigVector& p = vertexPool[index1]; - ndFloat64 faceCost = metric.Evalue (p); - ndFloat64 edgePenalty = EdgePenalty (&vertexPool[0], edge, distTol); - ndAssert (edgePenalty >= ndFloat32 (0.0f)); - ndEdgeCollapseEdgeHandle handle (edge); - ndList::ndNode* handleNodePtr = edgeHandleList.Addtop (handle); - bigHeapArray.Push (handleNodePtr, faceCost + edgePenalty); - } - - bool progress = true; - ndInt32 interPasses = 0; - ndInt32 faceCount = GetFaceCount(); - while (bigHeapArray.GetCount() && (bigHeapArray.Value() < maxCost) && ((bigHeapArray.Value() < tol2) || (faceCount > maxFaceCount)) && progress ) - { - ndList::ndNode* const handleNodePtr = bigHeapArray[0]; - - ndEdge* edge = handleNodePtr->GetInfo().m_edge; - bigHeapArray.Pop(); - edgeHandleList.Remove (handleNodePtr); - - if (edge) - { - if (IsOkToCollapse (&vertexPool[0], edge)) - { - interPasses++; - faceCount -= 2; - if (interPasses >= 400) - { - interPasses = 0; - faceCount = GetFaceCount(); - progress = ReportProgress(ndFloat32(1.0f) - (ndFloat32)GetEdgeCount() * progressDen); - } - - if (bigHeapArray.GetCount() > (bigHeapArray.GetMaxCount() - 100)) - { - for(ndInt32 i = bigHeapArray.GetCount() - 1; i >= 0; i --) - { - ndList::ndNode* const emptyHandle = bigHeapArray[i]; - if (!emptyHandle->GetInfo().m_edge) - { - bigHeapArray.Remove(i); - edgeHandleList.Remove (emptyHandle); - } - } - } - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - - edge = OptimizeCollapseEdge(edge); - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - ndAssert (SanityCheck ()); -#endif - if (edge) - { - // Update vertex metrics - CalculateVertexMetrics (&vertexMetrics[0], &vertexPool[0], edge); - - // Update metrics for all surrounding vertex - ndEdge* ptr = edge; - do - { - CalculateVertexMetrics (&vertexMetrics[0], &vertexPool[0], ptr->m_twin); - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - - // calculate edge cost of all incident edges - ndInt32 mark = IncLRU(); - ptr = edge; - do - { - ndAssert (ptr->m_mark != mark); - ptr->m_mark = mark; - - ndInt32 index0 = ptr->m_incidentVertex; - ndInt32 index1 = ptr->m_twin->m_incidentVertex; - - ndVertexCollapseVertexMetric &metric = vertexMetrics[index0]; - const ndBigVector& p = vertexPool[index1]; - - ndFloat64 faceCost = metric.Evalue (p); - ndFloat64 edgePenalty = EdgePenalty (&vertexPool[0], ptr, distTol); - ndAssert (edgePenalty >= ndFloat32 (0.0f)); - ndEdgeCollapseEdgeHandle handle (ptr); - ndList ::ndNode* handleNodePtr1 = edgeHandleList.Addtop (handle); - bigHeapArray.Push (handleNodePtr1, faceCost + edgePenalty); - - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - - // calculate edge cost of all incident edges to a surrounding vertex - ptr = edge; - do - { - ndEdge* const incidentEdge = ptr->m_twin; - - ndEdge* ptr1 = incidentEdge; - do - { - ndInt32 index0 = ptr1->m_incidentVertex; - ndInt32 index1 = ptr1->m_twin->m_incidentVertex; - - if (ptr1->m_mark != mark) - { - ptr1->m_mark = mark; - ndVertexCollapseVertexMetric &metric = vertexMetrics[index0]; - const ndBigVector& p = vertexPool[index1]; - - ndFloat64 faceCost = metric.Evalue (p); - ndFloat64 edgePenalty = EdgePenalty (&vertexPool[0], ptr1, distTol); - ndAssert (edgePenalty >= ndFloat32 (0.0f)); - ndEdgeCollapseEdgeHandle handle (ptr1); - ndList ::ndNode* handleNodePtr1 = edgeHandleList.Addtop (handle); - bigHeapArray.Push (handleNodePtr1, faceCost + edgePenalty); - } - - if (ptr1->m_twin->m_mark != mark) - { - ptr1->m_twin->m_mark = mark; - ndVertexCollapseVertexMetric &metric = vertexMetrics[index1]; - const ndBigVector& p = vertexPool[index0]; - ndFloat64 faceCost = metric.Evalue (p); - ndFloat64 edgePenalty = EdgePenalty (&vertexPool[0], ptr1->m_twin, distTol); - ndAssert (edgePenalty >= ndFloat32 (0.0f)); - ndEdgeCollapseEdgeHandle handle (ptr1->m_twin); - ndList ::ndNode* handleNodePtr1 = edgeHandleList.Addtop (handle); - bigHeapArray.Push (handleNodePtr1, faceCost + edgePenalty); - } - - ptr1 = ptr1->m_twin->m_next; - } while (ptr1 != incidentEdge); - - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - } - } - } - } - - progress = ReportProgress(ndFloat32 (1.0f)); - return progress; -} - -bool ndPolyhedra::TriangulateFace(ndEdge* const face, const ndFloat64* const pool, ndInt32 strideInBytes) -{ - if (face->m_next->m_next->m_next != face) - { - ndInt32 mark = IncLRU(); - ndEdge* ptr = face; - do - { - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != face); - char memPool[D_LOCAL_BUFFER_SIZE * (sizeof (ndEdge*)+sizeof (ndFloat64))]; - ndDownHeap heap(&memPool[0], sizeof (memPool)); - - ndInt32 stride = ndInt32(strideInBytes / sizeof (ndFloat64)); - ndEdge* const edge = TriangulateFace(face, pool, stride, heap, nullptr); - ndAssert(!edge); - return !edge; - } - return true; -} - -ndEdge* ndPolyhedra::BestEdgePolygonizeFace(const ndBigVector& normal, ndEdge* const edge, const ndFloat64* const pool, ndInt32 stride, const ndBigVector& point) const -{ - ndBigVector p0(ndBigVector::m_triplexMask & ndBigVector(&pool[edge->m_incidentVertex * stride])); - ndBigVector r(point - p0); - ndEdge* e0 = edge; - do - { - ndBigVector p1(ndBigVector::m_triplexMask & ndBigVector(&pool[e0->m_twin->m_incidentVertex * stride])); - ndBigVector p2(ndBigVector::m_triplexMask & ndBigVector(&pool[e0->m_prev->m_incidentVertex * stride])); - ndFloat64 test0 = r.DotProduct(normal.CrossProduct(p1 - p0)).GetScalar(); - ndFloat64 test1 = r.DotProduct((p2 - p0).CrossProduct(normal)).GetScalar(); - - if ((test0 > 0.0f) && (test1 > 0.0f)) - { - break; - } - e0 = e0->m_prev->m_twin; - } while (e0 != edge); - return e0; -} - -bool ndPolyhedra::PolygonizeFace(ndEdge* const face, const ndFloat64* const pool, ndInt32 strideInBytes) -{ - ndPolyhedra flatFace; - ndEdge* array[D_LOCAL_BUFFER_SIZE]; - - ndInt32 count = 0; - ndEdge* edge = face; - do - { - ndEdge* const perimeter = flatFace.AddHalfEdge (edge->m_incidentVertex, edge->m_twin->m_incidentVertex); - ndAssert (perimeter); - perimeter->m_userData = edge->m_userData; - perimeter->m_incidentFace = 1; - perimeter->m_twin = nullptr; - perimeter->m_prev = nullptr; - perimeter->m_next = nullptr; - - array[count] = perimeter; - count++; - ndAssert(count <= D_LOCAL_BUFFER_SIZE); - edge = edge->m_next; - } while (edge != face); - - ndInt32 i0 = count - 1; - for(ndInt32 i = 0; i < count; ++i) - { - ndEdge* const edge1 = array[i]; - ndEdge* const prev1 = array[i0]; - - edge1->m_prev = prev1; - prev1->m_next = edge1; - i0 = i; - } - - for(ndInt32 i = 0; i < count; ++i) - { - ndEdge* const edge1 = array[i]; - ndEdge* const twin1 = flatFace.FindEdge (edge1->m_next->m_incidentVertex, edge1->m_incidentVertex); - if (twin1) - { - twin1->m_twin = edge1; - edge1->m_twin = twin1; - } - else - { - ndEdge* const perimeter = flatFace.AddHalfEdge (edge1->m_next->m_incidentVertex, edge1->m_incidentVertex); - perimeter->m_twin = edge1; - edge1->m_twin = perimeter; - perimeter->m_incidentFace = -1; - perimeter->m_prev = nullptr; - perimeter->m_next = nullptr; - } - } - - for (ndInt32 i = 0; i < count; ++i) - { - ndEdge* const edge1 = array[i]; - ndEdge* const twin1 = edge1->m_twin; - if (!twin1->m_next) - { - ndEdge* next = edge1->m_prev->m_twin; - while (next->m_prev) - { - next = next->m_prev->m_twin; - } - twin1->m_next = next; - next->m_prev = next; - } - } - - ndBigVector normal (flatFace.FaceNormal(array[0], pool, strideInBytes)); - if (flatFace.TriangulateFace(array[0], pool, strideInBytes)) - { - ndInt32 stride = ndInt32(strideInBytes / sizeof (ndFloat64)); - flatFace.RefineTriangulation(pool, stride); - - //RemoveOuterColinearEdges(*this, vertex, stride); - ndInt32 polygon[D_LOCAL_BUFFER_SIZE]; - ndEdge* diagonalsPool[D_LOCAL_BUFFER_SIZE]; - - ndInt32 diagonalCount = GetInteriorDiagonals(flatFace, diagonalsPool, sizeof (diagonalsPool) / sizeof (diagonalsPool[0])); - - if (diagonalCount) - { - ndEdge* edge1 = &flatFace.GetRoot()->GetInfo(); - if (edge1->m_incidentFace < 0) - { - edge1 = edge1->m_twin; - } - - ndAssert(edge1->m_incidentFace > 0); - - ndBigVector normal1(flatFace.FaceNormal(edge1, pool, strideInBytes)); - normal1 = normal1.Scale(ndFloat64(1.0f) / sqrt(normal1.DotProduct(normal1).GetScalar())); - - edge1 = nullptr; - ndPolyhedra::Iterator iter0(flatFace); - for (iter0.Begin(); iter0; iter0++) - { - edge1 = &(*iter0); - if (edge1->m_incidentFace < 0) - { - break; - } - } - ndAssert(edge1); - - ndInt32 isConvex = 1; - ndEdge* ptr = edge1; - ndInt32 mark = flatFace.IncLRU(); - - ndBigVector normal2(normal1); - ndBigVector p0(ndBigVector::m_triplexMask & ndBigVector(&pool[ptr->m_prev->m_incidentVertex * stride])); - ndBigVector p1(ndBigVector::m_triplexMask & ndBigVector(&pool[ptr->m_incidentVertex * stride])); - ndBigVector e0(p1 - p0); - - ndAssert(normal2.m_w == ndFloat32(0.0f)); - e0 = e0.Scale(ndFloat64(1.0f) / sqrt(e0.DotProduct(e0).GetScalar() + ndFloat64(1.0e-24f))); - do - { - ndBigVector p2(ndBigVector::m_triplexMask & ndBigVector(&pool[ptr->m_next->m_incidentVertex * stride])); - ndBigVector e1(p2 - p1); - e1 = e1.Scale(ndFloat64(1.0f) / sqrt(e1.DotProduct(e1).GetScalar() + ndFloat32(1.0e-24f))); - ndFloat64 dot = normal2.DotProduct(e0.CrossProduct(e1)).GetScalar(); - - if (dot > ndFloat32(5.0e-3f)) - { - isConvex = 0; - break; - } - ptr->m_mark = mark; - e0 = e1; - p1 = p2; - ptr = ptr->m_next; - } while (ptr != edge1); - - if (isConvex) - { - ndPolyhedra::Iterator iter(flatFace); - for (iter.Begin(); iter; iter++) - { - ptr = &(*iter); - if (ptr->m_incidentFace < 0) - { - if (ptr->m_mark < mark) - { - isConvex = 0; - break; - } - } - } - } - - if (isConvex) - { - if (diagonalCount > 2) - { - ndInt32 count1 = 0; - ptr = edge1; - do - { - polygon[count1] = ptr->m_incidentVertex; - count1++; - ndAssert(count1 < ndInt32(sizeof (polygon) / sizeof (polygon[0]))); - ptr = ptr->m_next; - } while (ptr != edge1); - - for (ndInt32 i = 0; i < count1 - 1; ++i) - { - for (ndInt32 j = i + 1; j < count1; ++j) - { - if (polygon[i] == polygon[j]) - { - i = count1; - isConvex = 0; - break; - } - } - } - } - } - - if (isConvex) - { - for (ndInt32 j = 0; j < diagonalCount; ++j) - { - ndEdge* const diagonal = diagonalsPool[j]; - flatFace.DeleteEdge(diagonal); - } - } - else - { - for (ndInt32 j = 0; j < diagonalCount; ++j) - { - ndEdge* const diagonal = diagonalsPool[j]; - if (!IsEssensialDiagonal(diagonal, normal1, pool, stride)) - { - flatFace.DeleteEdge(diagonal); - } - } - } - } - - ndInt32 mark = flatFace.IncLRU(); - ndPolyhedra::Iterator iter0(flatFace); - for (iter0.Begin(); iter0; iter0++) - { - ndEdge* const edge1 = &(*iter0); - if ((edge1->m_mark != mark) && (edge1->m_incidentFace > 0)) - { - edge1->m_mark = mark; - edge1->m_twin->m_mark = mark; - if (!FindEdge(edge1->m_incidentVertex, edge1->m_twin->m_incidentVertex)) - { - ndPairKey key0 (edge1->m_incidentVertex, 0); - ndPairKey key1 (edge1->m_twin->m_incidentVertex, 0); - ndNode* const node0 = FindGreater (key0.GetVal()); - ndNode* const node1 = FindGreater (key1.GetVal()); - ndAssert (node0); - ndAssert (node1); - ndEdge* e0 = &node0->GetInfo(); - ndEdge* e1 = &node1->GetInfo(); - - ndBigVector p0 (ndBigVector::m_triplexMask & ndBigVector(&pool[e0->m_incidentVertex * stride])); - ndBigVector p1 (ndBigVector::m_triplexMask & ndBigVector(&pool[e1->m_incidentVertex * stride])); - e0 = BestEdgePolygonizeFace (normal, e0, pool, stride, p1); - e1 = BestEdgePolygonizeFace (normal, e1, pool, stride, p0); - ConnectVertex (e0, e1); - } - } - } - } - - return true; -} - -void ndPolyhedra::RemoveInteriorEdges (ndPolyhedra& buildConvex, const ndFloat64* const vertex, ndInt32 strideInBytes) -{ - ndInt32 polygon[D_LOCAL_BUFFER_SIZE * 8]; - ndEdge* diagonalsPool[D_LOCAL_BUFFER_SIZE * 8]; - - ndInt32 stride = ndInt32 (strideInBytes / sizeof (ndFloat64)); - - buildConvex.BeginFace(); - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter;) - { - ndEdge* edge = &(*iter); - iter++; - if (edge->m_incidentFace > 0) - { - - ndPolyhedra flatFace; - MarkAdjacentCoplanarFaces(flatFace, edge, vertex, strideInBytes); - if (flatFace.GetCount()) - { - //flatFace.RefineTriangulation(vertex, stride); - RemoveOuterColinearEdges(flatFace, vertex, stride); - RemoveInteriorColinearEdges(flatFace, vertex, stride); - flatFace.RefineTriangulation(vertex, stride); - - ndInt32 diagonalCount = GetInteriorDiagonals(flatFace, diagonalsPool, sizeof(diagonalsPool) / sizeof(diagonalsPool[0])); - if (diagonalCount) - { - edge = &flatFace.GetRoot()->GetInfo(); - if (edge->m_incidentFace < 0) - { - edge = edge->m_twin; - } - ndAssert(edge->m_incidentFace > 0); - - ndBigVector normal(FaceNormal(edge, vertex, strideInBytes)); - normal = normal.Scale(ndFloat64(1.0f) / sqrt(normal.DotProduct(normal).GetScalar())); - - edge = nullptr; - ndPolyhedra::Iterator iter1(flatFace); - for (iter1.Begin(); iter1; iter1++) - { - edge = &(*iter1); - if (edge->m_incidentFace < 0) - { - break; - } - } - ndAssert(edge); - - ndInt32 isConvex = 1; - ndEdge* ptr = edge; - ndInt32 mark = flatFace.IncLRU(); - - ndBigVector normal2(normal); - ndBigVector p0(ndBigVector::m_triplexMask & ndBigVector(&vertex[ptr->m_prev->m_incidentVertex * stride])); - ndBigVector p1(ndBigVector::m_triplexMask & ndBigVector(&vertex[ptr->m_incidentVertex * stride])); - ndBigVector e0(p1 - p0); - e0 = e0.Scale(ndFloat64(1.0f) / sqrt(e0.DotProduct(e0).GetScalar() + ndFloat64(1.0e-24f))); - do - { - ndBigVector p2(ndBigVector::m_triplexMask & ndBigVector(&vertex[ptr->m_next->m_incidentVertex * stride])); - ndBigVector e1(p2 - p1); - e1 = e1.Scale(ndFloat64(1.0f) / sqrt(e1.DotProduct(e1).GetScalar() + ndFloat32(1.0e-24f))); - ndFloat64 dot = normal2.DotProduct(e0.CrossProduct(e1)).GetScalar(); - - if (dot > ndFloat32(5.0e-3f)) - { - isConvex = 0; - break; - } - ptr->m_mark = mark; - e0 = e1; - p1 = p2; - ptr = ptr->m_next; - } while (ptr != edge); - - if (isConvex) - { - ndPolyhedra::Iterator iter2(flatFace); - for (iter2.Begin(); iter2; iter2++) - { - ptr = &(*iter2); - if (ptr->m_incidentFace < 0) - { - if (ptr->m_mark < mark) - { - isConvex = 0; - break; - } - } - } - } - - if (isConvex) - { - if (diagonalCount > 2) - { - ndInt32 count = 0; - ptr = edge; - do - { - polygon[count] = ptr->m_incidentVertex; - count++; - ndAssert(count < ndInt32(sizeof(polygon) / sizeof(polygon[0]))); - ptr = ptr->m_next; - } while (ptr != edge); - - for (ndInt32 i = 0; i < count - 1; ++i) - { - for (ndInt32 j = i + 1; j < count; ++j) - { - if (polygon[i] == polygon[j]) - { - i = count; - isConvex = 0; - break; - } - } - } - } - } - - if (isConvex) - { - for (ndInt32 j = 0; j < diagonalCount; ++j) - { - ndEdge* const diagonal = diagonalsPool[j]; - flatFace.DeleteEdge(diagonal); - } - } - else - { - for (ndInt32 j = 0; j < diagonalCount; ++j) - { - ndEdge* const diagonal = diagonalsPool[j]; - if (!IsEssensialDiagonal(diagonal, normal, vertex, stride)) - { - flatFace.DeleteEdge(diagonal); - } - } - } - } - - ndInt32 mark = flatFace.IncLRU(); - ndPolyhedra::Iterator iter1(flatFace); - for (iter1.Begin(); iter1; iter1++) - { - ndEdge* const edge1 = &(*iter1); - if (edge1->m_mark != mark) - { - if (edge1->m_incidentFace > 0) - { - ndEdge* ptr = edge1; - ndInt32 diagonalCount1 = 0; - do - { - polygon[diagonalCount1] = ptr->m_incidentVertex; - diagonalCount1++; - ndAssert(diagonalCount1 < ndInt32(sizeof(polygon) / sizeof(polygon[0]))); - ptr->m_mark = mark; - ptr = ptr->m_next; - } while (ptr != edge1); - if (diagonalCount1 >= 3) - { - buildConvex.AddFace(diagonalCount1, polygon); - } - } - } - } - } - - iter.Begin(); - } - } - - buildConvex.EndFace(); - ndAssert(GetCount() == 0); -} - -void ndPolyhedra::ConvexPartition (const ndFloat64* const vertex, ndInt32 strideInBytes, ndPolyhedra* const leftOversOut) -{ - if (GetCount()) - { - Triangulate (vertex, strideInBytes, leftOversOut); - DeleteDegenerateFaces (vertex, strideInBytes, ndFloat32 (1.0e-5f)); - Optimize (vertex, strideInBytes, ndFloat32 (1.0e-3f)); - DeleteDegenerateFaces (vertex, strideInBytes, ndFloat32 (1.0e-5f)); - - if (GetCount()) - { - ndPolyhedra buildConvex; - RemoveInteriorEdges (buildConvex, vertex, strideInBytes); - SwapInfo(buildConvex); - } - } -} - -ndMatrix ndPolyhedra::CalculateSphere(ndBigVector& size, const ndFloat64* const vertex, ndInt32 strideInBytes) const -{ - ndInt32 stride = ndInt32(strideInBytes / sizeof(ndFloat64)); - - ndInt32 vertexCount = 0; - ndInt32 mark = IncLRU(); - ndPolyhedra::Iterator iter(*this); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if (edge->m_mark != mark) - { - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - vertexCount++; - } - } - ndAssert(vertexCount); - - mark = IncLRU(); - ndInt32 vertexCountIndex = 0; - ndStack pool(vertexCount); - for (iter.Begin(); iter; iter++) - { - ndEdge* const edge = &(*iter); - if (edge->m_mark != mark) - { - ndEdge* ptr = edge; - do - { - ptr->m_mark = mark; - ptr = ptr->m_twin->m_next; - } while (ptr != edge); - ndInt32 incidentVertex = edge->m_incidentVertex * stride; - pool[vertexCountIndex] = ndBigVector(vertex[incidentVertex + 0], vertex[incidentVertex + 1], vertex[incidentVertex + 2], ndFloat32(0.0f)); - vertexCountIndex++; - } - } - ndAssert(vertexCountIndex <= vertexCount); - - //ndMatrix axis(dGetIdentityMatrix()); - //dgObb sphere(axis); - ndConvexHull3d convexHull(&pool[0].m_x, sizeof(ndBigVector), vertexCountIndex, 0.0f); - - size = ndBigVector::m_zero; - ndMatrix sphere(ndGetIdentityMatrix()); - if (convexHull.GetCount()) - { - ndStack triangleList(convexHull.GetCount() * 3); - ndInt32 trianglesCount = 0; - for (ndConvexHull3d::ndNode* node = convexHull.GetFirst(); node; node = node->GetNext()) - { - ndConvexHull3dFace* const face = &node->GetInfo(); - triangleList[trianglesCount * 3 + 0] = face->m_index[0]; - triangleList[trianglesCount * 3 + 1] = face->m_index[1]; - triangleList[trianglesCount * 3 + 2] = face->m_index[2]; - trianglesCount++; - ndAssert((trianglesCount * 3) <= triangleList.GetElementsCount()); - } - - //ndVector* const dst = (ndVector*)&pool[0].m_x; - //ndInt32 vertexCount = convexHull->GetVertexPool().GetCount(); - const ndArray& hullVertexArray = convexHull.GetVertexPool(); - for (ndInt32 i = 0; i < hullVertexArray.GetCount(); ++i) - { - pool[i] = hullVertexArray[i]; - } - - ndVector eigen; - ndBigVector var(ndBigVector::m_zero); - ndBigVector cov(ndBigVector::m_zero); - ndBigVector origin(ndBigVector::m_zero); - - for (ndInt32 i = 0; i < vertexCount; ++i) - { - const ndBigVector p(pool[i] & ndBigVector::m_triplexMask); - const ndBigVector q(p.ShiftTripleLeft()); - origin += p; - var += p * p; - cov += p * q; - } - ndSwap(cov.m_y, cov.m_z); - - ndFloat64 k = ndFloat64(1.0) / vertexCount; - var = var.Scale(k); - cov = cov.Scale(k); - origin = origin.Scale(k); - - ndFloat64 Ixx = var.m_x - origin.m_x * origin.m_x; - ndFloat64 Iyy = var.m_y - origin.m_y * origin.m_y; - ndFloat64 Izz = var.m_z - origin.m_z * origin.m_z; - - ndFloat64 Ixy = cov.m_x - origin.m_x * origin.m_y; - ndFloat64 Ixz = cov.m_y - origin.m_x * origin.m_z; - ndFloat64 Iyz = cov.m_z - origin.m_y * origin.m_z; - - sphere.m_front = ndVector(ndFloat32(Ixx), ndFloat32(Ixy), ndFloat32(Ixz), ndFloat32(0.0f)); - sphere.m_up = ndVector(ndFloat32(Ixy), ndFloat32(Iyy), ndFloat32(Iyz), ndFloat32(0.0f)); - sphere.m_right = ndVector(ndFloat32(Ixz), ndFloat32(Iyz), ndFloat32(Izz), ndFloat32(0.0f)); - //ndVector eigenValues(sphere.EigenVectors()); - - ndVector minVal(ndFloat32(1e15f)); - ndVector maxVal(ndFloat32(-1e15f)); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - ndVector tmp(sphere.UnrotateVector(pool[i])); - minVal = minVal.GetMin(tmp); - maxVal = maxVal.GetMax(tmp); - } - - ndVector massCenter((maxVal + minVal) * ndVector::m_half); - massCenter.m_w = ndFloat32(1.0f); - sphere.m_posit = sphere.TransformVector(massCenter); - size = ndVector ((maxVal - minVal) * ndVector::m_half); - } - return sphere; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedra.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedra.h deleted file mode 100644 index f7ddb60010..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedra.h +++ /dev/null @@ -1,333 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_POLYHEDRA_H__ -#define __ND_POLYHEDRA_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndList.h" -#include "ndTree.h" -#include "ndHeap.h" -#include "ndHeap.h" -#include "ndDebug.h" -#include "ndClassAlloc.h" - -class ndEdge; -class ndMatrix; -class ndBigPlane; -class ndBigVector; -class ndPolyhedra; -class ndVertexCollapseVertexMetric; - -typedef ndInt64 ndEdgeKey; - -class ndEdge -{ - public: - ndEdge (); - ndEdge (ndInt32 vertex, ndInt32 face, ndUnsigned64 userdata = 0); - //~ndEdge (); - - ndInt32 m_incidentVertex; - ndInt32 m_incidentFace; - ndUnsigned64 m_userData; - ndEdge* m_next; - ndEdge* m_prev; - ndEdge* m_twin; - ndInt32 m_mark; -} D_GCC_NEWTON_ALIGN_32 ; - -class ndPolyhedra: public ndTree -{ - public: - class ndPairKey - { - public: - ndPairKey() - { - } - - ndPairKey(ndInt64 key) - :m_key(ndUnsigned64(key)) - { - } - - ndPairKey(ndInt32 keyHigh, ndInt32 keyLow) - :m_keyLow(ndUnsigned32 (keyLow)) - ,m_keyHigh(ndUnsigned32 (keyHigh)) - { - } - - ndInt64 GetVal() const - { - return ndInt64(m_key); - } - - ndInt32 GetLowKey() const - { - return ndInt32(m_keyLow); - } - - ndInt32 GetHighKey() const - { - return ndInt32(m_keyHigh); - } - - bool operator<(const ndPairKey& key) const - { - return m_key < key.m_key; - } - - bool operator>(const ndPairKey& key) const - { - return m_key > key.m_key; - } - - - private: - union - { - ndUnsigned64 m_key; - struct - { - ndUnsigned32 m_keyLow; - ndUnsigned32 m_keyHigh; - }; - }; - }; - - ndPolyhedra (); - D_CORE_API ndPolyhedra (const ndPolyhedra &polyhedra); - D_CORE_API virtual ~ndPolyhedra(); - - virtual bool ReportProgress(ndFloat32) const { return true;} - - virtual void BeginFace(); - ndEdge* AddFace (ndInt32 v0, ndInt32 v1, ndInt32 v2); - ndEdge* AddFace (ndInt32 count, const ndInt32* const index); - D_CORE_API ndEdge* AddFace (ndInt32 count, const ndInt32* const index, const ndInt64* const userdata); - D_CORE_API virtual bool EndFace (); - D_CORE_API virtual void DeleteFace(ndEdge* const edge); - - D_CORE_API ndInt32 GetFaceCount() const; - ndInt32 GetEdgeCount() const; - ndInt32 GetLastVertexIndex() const; - - ndInt32 IncLRU() const; - ndInt32 GetLRU() const; - void SetLRU(ndInt32 lru) const; - - ndEdge* FindEdge (ndInt32 v0, ndInt32 v1) const; - ndNode* FindEdgeNode (ndInt32 v0, ndInt32 v1) const; - - D_CORE_API ndEdge* AddHalfEdge (ndInt32 v0, ndInt32 v1); - D_CORE_API void DeleteEdge (ndEdge* const edge); - void DeleteEdge (ndInt32 v0, ndInt32 v1); - - D_CORE_API ndEdge* ConnectVertex (ndEdge* const e0, ndEdge* const e1); - - D_CORE_API bool FlipEdge (ndEdge* const edge); - D_CORE_API ndEdge* SpliteEdge (ndInt32 newIndex, ndEdge* const edge); - D_CORE_API ndBigVector FaceNormal (const ndEdge* const face, const ndFloat64* const vertex, ndInt32 strideInBytes) const; - - D_CORE_API void SavePLY(const char* const fileName, const ndFloat64* const vertex, ndInt32 strideInBytes) const; - - void BeginConectedSurface() const; - D_CORE_API bool GetConectedSurface (ndPolyhedra &polyhedra) const; - void EndConectedSurface() const; - - D_CORE_API ndMatrix CalculateSphere(ndBigVector& size, const ndFloat64* const vertex, ndInt32 strideInBytes) const; - - D_CORE_API void ChangeEdgeIncidentVertex (ndEdge* const edge, ndInt32 newIndex); - D_CORE_API void DeleteDegenerateFaces (const ndFloat64* const pool, ndInt32 dstStrideInBytes, ndFloat64 minArea); - - D_CORE_API bool Optimize (const ndFloat64* const pool, ndInt32 strideInBytes, ndFloat64 tol, ndInt32 maxFaceCount = 1<<28); - D_CORE_API void Triangulate (const ndFloat64* const vertex, ndInt32 strideInBytes, ndPolyhedra* const leftOversOut); - D_CORE_API void ConvexPartition (const ndFloat64* const vertex, ndInt32 strideInBytes, ndPolyhedra* const leftOversOut); - D_CORE_API bool IsFaceConvex(ndEdge* const face, const ndFloat64* const pool, ndInt32 strideInBytes) const; - - protected: - D_CORE_API ndEdge* CollapseEdge(ndEdge* const edge); - D_CORE_API bool PolygonizeFace(ndEdge* const face, const ndFloat64* const pool, ndInt32 stride); - D_CORE_API bool TriangulateFace(ndEdge* const face, const ndFloat64* const pool, ndInt32 stride); - - private: - void RefineTriangulation (const ndFloat64* const vertex, ndInt32 stride); - void RefineTriangulation (const ndFloat64* const vertex, ndInt32 stride, const ndBigVector& normal, ndInt32 perimeterCount, ndEdge** const perimeter); - void OptimizeTriangulation (const ndFloat64* const vertex, ndInt32 strideInBytes); - void RemoveInteriorEdges (ndPolyhedra& polyhedraOut, const ndFloat64* const vertex, ndInt32 strideInBytes); - void MarkAdjacentCoplanarFaces (ndPolyhedra& polyhedraOut, ndEdge* const face, const ndFloat64* const pool, ndInt32 strideInBytes); - ndEdge* FindEarTip (ndEdge* const face, const ndFloat64* const pool, ndInt32 stride, ndDownHeap& heap, const ndBigVector &normal) const; - ndEdge* TriangulateFace (ndEdge* const face, const ndFloat64* const pool, ndInt32 stride, ndDownHeap& heap, ndBigVector* const faceNormalOut); - - void RemoveHalfEdge (ndEdge* const edge); - ndEdge* OptimizeCollapseEdge (ndEdge* const edge); - bool IsOkToCollapse (const ndBigVector* const pool, ndEdge* const edge) const; - ndFloat64 EdgePenalty (const ndBigVector* const pool, ndEdge* const edge, ndFloat64 dist) const; - ndBigPlane EdgePlane (ndInt32 i0, ndInt32 i1, ndInt32 i2, const ndBigVector* const pool) const; - void CalculateAllMetrics (ndVertexCollapseVertexMetric* const table, const ndBigVector* const pool) const; - void CalculateVertexMetrics (ndVertexCollapseVertexMetric* const table, const ndBigVector* const pool, ndEdge* const edge) const; - ndEdge* BestEdgePolygonizeFace(const ndBigVector& normal, ndEdge* const edge, const ndFloat64* const pool, ndInt32 stride, const ndBigVector& point) const; - - static ndInt32 GetInteriorDiagonals (ndPolyhedra& polyhedra, ndEdge** const diagonals, ndInt32 maxCount); - static ndBigPlane UnboundedLoopPlane (ndInt32 i0, ndInt32 i1, ndInt32 i2, const ndBigVector* const pool); - static void RemoveOuterColinearEdges(ndPolyhedra& flatFace, const ndFloat64* const vertex, ndInt32 stride); - static void RemoveInteriorColinearEdges(ndPolyhedra& flatFace, const ndFloat64* const vertex, ndInt32 stride); - static bool IsEssensialDiagonal (ndEdge* const diagonal, const ndBigVector& normal, const ndFloat64* const pool, ndInt32 stride); - static bool IsEssensialPointDiagonal (ndEdge* const diagonal, const ndBigVector& normal, const ndFloat64* const pool, ndInt32 stride); - - mutable ndInt32 m_baseMark; - mutable ndInt32 m_edgeMark; - mutable ndInt32 m_faceSecuence; - friend class dPolyhedraDescriptor; -}; - -inline ndEdge::ndEdge () -{ -} - -inline ndEdge::ndEdge (ndInt32 vertex, ndInt32 face, ndUnsigned64 userdata) - :m_incidentVertex(vertex) - ,m_incidentFace(face) - ,m_userData(userdata) - ,m_next(nullptr) - ,m_prev(nullptr) - ,m_twin(nullptr) - ,m_mark(0) -{ -} - -//inline ndEdge::~ndEdge () -//{ -//} - -inline void ndPolyhedra::BeginFace () -{ -} - -inline ndEdge* ndPolyhedra::AddFace (ndInt32 count, const ndInt32* const index) -{ - return AddFace (count, index, nullptr); -} - -inline ndEdge* ndPolyhedra::AddFace (ndInt32 v0, ndInt32 v1, ndInt32 v2) -{ - ndInt32 vertex[3]; - - vertex [0] = v0; - vertex [1] = v1; - vertex [2] = v2; - return AddFace (3, vertex, nullptr); -} - -inline ndInt32 ndPolyhedra::GetEdgeCount() const -{ -#ifdef _DEBUG - ndInt32 edgeCount = 0; - Iterator iter(*this); - for (iter.Begin(); iter; iter ++) - { - edgeCount ++; - } - ndAssert (edgeCount == GetCount());; -#endif - return GetCount(); -} - -inline ndPolyhedra::ndPolyhedra() - :ndTree () - ,m_baseMark(0) - ,m_edgeMark(0) - ,m_faceSecuence(0) -{ -} - -inline ndInt32 ndPolyhedra::GetLastVertexIndex() const -{ - ndInt32 maxVertexIndex = -1; - Iterator iter(*this); - for (iter.Begin(); iter; iter ++) - { - const ndEdge* const edge = &(*iter); - if (edge->m_incidentVertex > maxVertexIndex) - { - maxVertexIndex = edge->m_incidentVertex; - } - } - return maxVertexIndex + 1; -} - -inline ndInt32 ndPolyhedra::IncLRU() const -{ - m_edgeMark ++; - ndAssert (m_edgeMark < 0x7fffffff); - return m_edgeMark; -} - -inline ndInt32 ndPolyhedra::GetLRU() const -{ - return m_edgeMark; -} - -inline void ndPolyhedra::SetLRU(ndInt32 lru) const -{ - if (lru > m_edgeMark) - { - m_edgeMark = lru; - } -} - -inline void ndPolyhedra::BeginConectedSurface() const -{ - m_baseMark = IncLRU(); -} - -inline void ndPolyhedra::EndConectedSurface() const -{ -} - -inline ndPolyhedra::ndNode* ndPolyhedra::FindEdgeNode (ndInt32 i0, ndInt32 i1) const -{ - ndPairKey key (i0, i1); - return Find (key.GetVal()); -} - -inline ndEdge *ndPolyhedra::FindEdge (ndInt32 i0, ndInt32 i1) const -{ - ndNode* const node = FindEdgeNode (i0, i1); - return node ? &node->GetInfo() : nullptr; -} - -inline void ndPolyhedra::DeleteEdge (ndInt32 v0, ndInt32 v1) -{ - ndPairKey pairKey (v0, v1); - ndNode* const node = Find(pairKey.GetVal()); - ndEdge* const edge = node ? &node->GetInfo() : nullptr; - if (!edge) - { - return; - } - DeleteEdge (edge); -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedraMassProperties.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedraMassProperties.cpp deleted file mode 100644 index 8d0a9b34db..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedraMassProperties.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndVector.h" -#include "ndPolyhedraMassProperties.h" - -ndPolyhedraMassProperties::ndPolyhedraMassProperties() - :ndClassAlloc() -{ - memset (this, 0, sizeof (ndPolyhedraMassProperties)); - mult[0] = ndFloat32 (1.0f/6.0f); - mult[1] = ndFloat32 (1.0f/24.0f); - mult[2] = ndFloat32 (1.0f/24.0f); - mult[3] = ndFloat32 (1.0f/24.0f); - mult[4] = ndFloat32 (1.0f/60.0f); - mult[5] = ndFloat32 (1.0f/60.0f); - mult[6] = ndFloat32 (1.0f/60.0f); - mult[7] = ndFloat32 (1.0f/120.0f); - mult[8] = ndFloat32 (1.0f/120.0f); - mult[9] = ndFloat32 (1.0f/120.0f); -} - -void ndPolyhedraMassProperties::AddCGFace (ndInt32 indexCount, const ndVector* const faceVertex) -{ - #define CDSubexpressions(w0,w1,w2,f1,f2) \ - { \ - ndFloat32 temp0 = w0 + w1; \ - f1 = temp0 + w2; \ - f2 = w0 * w0 + w1 * temp0 + w2 * f1; \ - } - - ndVector p0 (faceVertex[0]); - ndVector p1 (faceVertex[1]); - - for (ndInt32 i = 2; i < indexCount; ++i) - { - ndVector p2 (faceVertex[i]); - - ndVector e01 (p1 - p0); - ndVector e02 (p2 - p0); - ndVector d (e01.CrossProduct(e02)); - - ndVector f1; - ndVector f2; - CDSubexpressions (p0.m_x, p1.m_x, p2.m_x, f1.m_x, f2.m_x); - CDSubexpressions (p0.m_y, p1.m_y, p2.m_y, f1.m_y, f2.m_y); - CDSubexpressions (p0.m_z, p1.m_z, p2.m_z, f1.m_z, f2.m_z); - - // update integrals - intg[0] += d[0] * f1.m_x; - - intg[1] += d[0] * f2.m_x; - intg[2] += d[1] * f2.m_y; - intg[3] += d[2] * f2.m_z; - - p1 = p2; - } -} - -void ndPolyhedraMassProperties::AddInertiaFace (ndInt32 indexCount, const ndVector* const faceVertex) -{ - #define InertiaSubexpression(w0,w1,w2,f1,f2,f3) \ - { \ - ndFloat32 temp0 = w0 + w1; \ - ndFloat32 temp1 = w0 * w0; \ - ndFloat32 temp2 = temp1 + w1 * temp0; \ - f1 = temp0 + w2; \ - f2 = temp2 + w2 * f1; \ - f3 = w0 * temp1 + w1 * temp2 + w2 * f2; \ - } - - ndVector p0 (faceVertex[0]); - ndVector p1 (faceVertex[1]); - - for (ndInt32 i = 2; i < indexCount; ++i) - { - ndVector p2 (faceVertex[i]); - - ndVector e01 (p1 - p0); - ndVector e02 (p2 - p0); - ndVector d (e01.CrossProduct(e02)); - - ndVector f1; - ndVector f2; - ndVector f3; - InertiaSubexpression (p0.m_x, p1.m_x, p2.m_x, f1.m_x, f2.m_x, f3.m_x); - InertiaSubexpression (p0.m_y, p1.m_y, p2.m_y, f1.m_y, f2.m_y, f3.m_y); - InertiaSubexpression (p0.m_z, p1.m_z, p2.m_z, f1.m_z, f2.m_z, f3.m_z); - - // update integrals - intg[0] += d[0] * f1.m_x; - - intg[1] += d[0] * f2.m_x; - intg[2] += d[1] * f2.m_y; - intg[3] += d[2] * f2.m_z; - - intg[4] += d[0] * f3.m_x; - intg[5] += d[1] * f3.m_y; - intg[6] += d[2] * f3.m_z; - - p1 = p2; - } -} - -void ndPolyhedraMassProperties::AddInertiaAndCrossFace (ndInt32 indexCount, const ndVector* const faceVertex) -{ - #define Subexpressions(w0,w1,w2,f1,f2,f3,g0,g1,g2) \ - { \ - ndFloat32 temp0 = w0 + w1; \ - ndFloat32 temp1 = w0 * w0; \ - ndFloat32 temp2 = temp1 + w1 * temp0; \ - f1 = temp0 + w2; \ - f2 = temp2 + w2 * f1; \ - f3 = w0 * temp1 + w1 * temp2 + w2 * f2; \ - g0 = f2 + w0 * (f1 + w0); \ - g1 = f2 + w1 * (f1 + w1); \ - g2 = f2 + w2 * (f1 + w2); \ - } - - ndVector p0 (faceVertex[0]); - ndVector p1 (faceVertex[1]); - for (ndInt32 i = 2; i < indexCount; ++i) - { - ndVector p2 (faceVertex[i]); - - ndVector e01 (p1 - p0); - ndVector e02 (p2 - p0); - ndVector d (e01.CrossProduct(e02)); - - ndVector f1; - ndVector f2; - ndVector f3; - ndVector g0; - ndVector g1; - ndVector g2; - Subexpressions (p0.m_x, p1.m_x, p2.m_x, f1.m_x, f2.m_x, f3.m_x, g0.m_x, g1.m_x, g2.m_x); - Subexpressions (p0.m_y, p1.m_y, p2.m_y, f1.m_y, f2.m_y, f3.m_y, g0.m_y, g1.m_y, g2.m_y); - Subexpressions (p0.m_z, p1.m_z, p2.m_z, f1.m_z, f2.m_z, f3.m_z, g0.m_z, g1.m_z, g2.m_z); - - // update integrals - intg[0] += d[0] * f1.m_x; - - intg[1] += d[0] * f2.m_x; - intg[2] += d[1] * f2.m_y; - intg[3] += d[2] * f2.m_z; - - intg[4] += d[0] * f3.m_x; - intg[5] += d[1] * f3.m_y; - intg[6] += d[2] * f3.m_z; - - intg[7] += d[0] * (p0.m_y * g0.m_x + p1.m_y * g1.m_x + p2.m_y * g2.m_x); - intg[8] += d[1] * (p0.m_z * g0.m_y + p1.m_z * g1.m_y + p2.m_z * g2.m_y); - intg[9] += d[2] * (p0.m_x * g0.m_z + p1.m_x * g1.m_z + p2.m_x * g2.m_z); - - p1 = p2; - } -} - -ndFloat32 ndPolyhedraMassProperties::MassProperties (ndVector& cg, ndVector& inertia, ndVector& crossInertia) -{ - for (ndInt32 i = 0; i < 10; ++i) - { - intg[i] *= mult[i]; - } - - cg.m_x = intg[1]; - cg.m_y = intg[2]; - cg.m_z = intg[3]; - cg.m_w = ndFloat32 (0.0f); - inertia.m_x = intg[5] + intg[6]; - inertia.m_y = intg[4] + intg[6]; - inertia.m_z = intg[4] + intg[5]; - inertia.m_w = ndFloat32 (0.0f); - crossInertia.m_x = -intg[8]; - crossInertia.m_y = -intg[9]; - crossInertia.m_z = -intg[7]; - crossInertia.m_w = ndFloat32 (0.0f); - return intg[0]; -} - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedraMassProperties.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedraMassProperties.h deleted file mode 100644 index 03c7adb54e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolyhedraMassProperties.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_POLYHEDRA_MASS_PROPERTIES_H__ -#define __ND_POLYHEDRA_MASS_PROPERTIES_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndClassAlloc.h" - -class ndPolyhedraMassProperties: public ndClassAlloc -{ - public: - D_CORE_API ndPolyhedraMassProperties(); - - D_CORE_API void AddCGFace (ndInt32 indexCount, const ndVector* const faceVertex); - D_CORE_API void AddInertiaFace (ndInt32 indexCount, const ndVector* const faceVertex); - D_CORE_API void AddInertiaAndCrossFace (ndInt32 indexCount, const ndVector* const faceVertex); - - D_CORE_API ndFloat32 MassProperties (ndVector& cg, ndVector& inertia, ndVector& crossInertia); - - private: - ndFloat32 intg[10]; - ndFloat32 mult[10]; -}; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProbability.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProbability.cpp deleted file mode 100644 index ee4b45b81c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProbability.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndProbability.h" -#include "ndThreadSyncUtils.h" - -static std::mt19937& GetRandomGenerator() -{ - // for debugging this is better than a hardware generator. - //static std::mt19937 generator; - - // using hardware non deterministic random generator if found - static std::mt19937 generator(std::random_device{}()); - - return generator; -} - -static ndSpinLock& GetLock() -{ - static ndSpinLock lock; - return lock; -} - -void ndSetRandSeed(ndUnsigned32 seed) -{ - GetRandomGenerator().seed(seed); -} - -ndUnsigned32 ndRandInt() -{ - ndScopeSpinLock lock(GetLock()); - static std::uniform_int_distribution uniform; - return uniform(GetRandomGenerator()); -} - -ndFloat32 ndRand() -{ - ndScopeSpinLock lock(GetLock()); - static std::uniform_real_distribution uniform(ndFloat32 (0.0f), ndFloat32(1.0f)); - return uniform(GetRandomGenerator()); -} - -ndFloat32 ndGaussianRandom(ndFloat32 mean, ndFloat32 sigma) -{ - // It seems the standard library normal random is based of the Box–Muller transform - // https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform - // this is probably more accurate than Abramowitz and Stegun which is based on the - // inverse cumulative, however Box–Muller is quite problematic, since it uses memory, - // and more calls to rand and transcendental functions, - // therefore, I am sticking with inverse cumulative method. - // beside, all my test show that inverse cumulative seems in fact more accurate. - // - //std::normal_distribution gaussian(mean, sigma); - //static ndSpinLock __lock__; - //ndScopeSpinLock lock(__lock__); - //return gaussian(GetRandomGenerator()); - - - // from Abramowitz and Stegun formula 26.2.23. - // calculate a normal value with 0.0 mean and 1.0 deviation - // the absolute value of the error should be less than 4.5e-4. - auto NormalCumulativeDistibutionInverse = [](ndFloat32 r) - { - auto RationalApproximation = [](ndFloat32 t) - { - ndFloat32 c[] = { ndFloat32(2.515517f), ndFloat32(0.802853f), ndFloat32(0.010328f) }; - ndFloat32 d[] = { ndFloat32(1.432788f), ndFloat32(0.189269f), ndFloat32(0.001308f) }; - ndFloat32 numerator = c[0] + (c[2] * t + c[1]) * t; - ndFloat32 denominator = ndFloat32(1.0f) + ((d[2] * t + d[1]) * t + d[0]) * t; - return t - numerator / denominator; - }; - - //auto TailorExpansion = [](ndFloat32 t) - //{ - // ndFloat32 sum = ndFloat32(1.0f); - // - // ndFloat32 t2 = t * t; - // ndFloat32 t2Acc = t2; - // ndFloat32 exp0 = ndFloat32(3.0f); - // ndFloat32 exp1 = ndFloat32(5.0f); - // ndFloat32 oddFactorial = ndFloat32(1.0f); - // ndFloat32 evenFactorial = ndFloat32(2.0f); - // for (ndInt32 i = 0; i < 4; ++i) - // { - // sum -= t2Acc / (exp0 * oddFactorial); - // t2Acc *= t2; - // - // sum += t2Acc / (exp1 * evenFactorial); - // t2Acc *= t2; - // - // exp0 += ndFloat32(4.0f); - // exp1 += ndFloat32(4.0f); - // oddFactorial = evenFactorial * ndFloat32(2 * i + 3); - // evenFactorial = oddFactorial * ndFloat32(2 * i + 4); - // } - // const ndFloat32 scaleFactor = ndFloat32(0.3989422804f); - // return sum * t * scaleFactor; - //}; - - ndFloat32 value = ndFloat32(0.0f); - if (r < ndFloat32(0.5f)) - { - // F^-1(p) = - G^-1(p) - value = -RationalApproximation(ndSqrt(ndFloat32(-2.0f) * ndLog(r))); - } - else - { - // F^-1(p) = G^-1(1-p) - value = RationalApproximation(ndSqrt(ndFloat32(-2.0f) * ndLog(ndFloat32(1.0f) - r))); - } - - // Taylor expansion does not produces good approximation for value far from the center. - // not sure how the Abramowitz and Stegun formula is derived but is far better than Taylor - // in both accuracy and performance - // ndFloat32 value1 = (r >= ndFloat32(0.5f)) ? TailorExpansion(r - ndFloat32(0.5f)) : -TailorExpansion(ndFloat32(0.5f) - r); - return value; - }; - - ndFloat32 r = ndClamp(ndRand(), ndFloat32(1.0e-6f), ndFloat32(1.0f - 1.0e-6f)); - ndFloat32 normal = NormalCumulativeDistibutionInverse(r); - return mean + normal * sigma; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProbability.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProbability.h deleted file mode 100644 index 11002ef800..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProbability.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_PROBABILITY_H__ -#define __ND_PROBABILITY_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" - -/// Returns the time in micro seconds since application started -D_CORE_API ndUnsigned64 ndGetTimeInMicroseconds(); - -/// Returns a float random value between 0.0 top 1.0 -D_CORE_API ndFloat32 ndRand(); - -/// Returns a unsigned integer random value between 0 top 0xffffffff -D_CORE_API ndUnsigned32 ndRandInt(); - -/// Returns sets a new random seed -D_CORE_API void ndSetRandSeed(ndUnsigned32 seed); - -/// Returns a guardian distributed random value with center at mean and standard deviation sigma -D_CORE_API ndFloat32 ndGaussianRandom(ndFloat32 mean, ndFloat32 sigma); - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProfiler.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProfiler.cpp deleted file mode 100644 index 2f6c8d23f8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProfiler.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProfiler.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProfiler.h deleted file mode 100644 index 9720490a82..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndProfiler.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_PROFILER_H__ -#define __ND_PROFILER_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" - -// to make a profile build use Use CMAKE to create a profile configuration -// or make a configuration that define macro D_PROFILER - -#ifdef D_PROFILER - #include - #define D_TRACKTIME() dProfilerZoneScoped(__FUNCTION__) - #define D_TRACKTIME_NAMED(name) dProfilerZoneScoped(#name) - #define D_SET_TRACK_NAME(trackName) dProfilerSetTrackName(trackName) -#else - #define D_TRACKTIME() - #define D_TRACKTIME_NAMED(name) - #define D_SET_TRACK_NAME(trackName) -#endif - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndQuaternion.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndQuaternion.cpp deleted file mode 100644 index 367195713b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndQuaternion.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndMatrix.h" -#include "ndQuaternion.h" - -enum QUAT_INDEX -{ - X_INDEX = 0, - Y_INDEX = 1, - Z_INDEX = 2 -}; -static QUAT_INDEX QIndex[] = { Y_INDEX, Z_INDEX, X_INDEX }; - -ndQuaternion::ndQuaternion(const ndMatrix& matrix) -{ - ndFloat32 trace = matrix[0][0] + matrix[1][1] + matrix[2][2]; - if (trace > ndFloat32(0.0f)) - { - trace = ndSqrt(trace + ndFloat32(1.0f)); - m_w = ndFloat32(0.5f) * trace; - trace = ndFloat32(0.5f) / trace; - m_x = (matrix[1][2] - matrix[2][1]) * trace; - m_y = (matrix[2][0] - matrix[0][2]) * trace; - m_z = (matrix[0][1] - matrix[1][0]) * trace; - } - else - { - QUAT_INDEX i = X_INDEX; - if (matrix[Y_INDEX][Y_INDEX] > matrix[X_INDEX][X_INDEX]) - { - i = Y_INDEX; - } - if (matrix[Z_INDEX][Z_INDEX] > matrix[i][i]) - { - i = Z_INDEX; - } - QUAT_INDEX j = QIndex[i]; - QUAT_INDEX k = QIndex[j]; - - trace = ndFloat32(1.0f) + matrix[i][i] - matrix[j][j] - matrix[k][k]; - trace = ndSqrt(trace); - - ndFloat32* const ptr = &m_x; - ptr[i] = ndFloat32(0.5f) * trace; - trace = ndFloat32(0.5f) / trace; - m_w = (matrix[j][k] - matrix[k][j]) * trace; - ptr[j] = (matrix[i][j] + matrix[j][i]) * trace; - ptr[k] = (matrix[i][k] + matrix[k][i]) * trace; - } - -#ifdef _DEBUG - - ndMatrix tmp (ndCalculateMatrix(*this, matrix.m_posit)); - ndMatrix unitMatrix (tmp * matrix.OrthoInverse()); - for (ndInt32 i = 0; i < 4; ++i) - { - ndFloat32 err = ndAbs (unitMatrix[i][i] - ndFloat32(1.0f)); - ndAssert (err < ndFloat32 (1.0e-2f)); - } - - ndFloat32 err = ndAbs (DotProduct(*this).GetScalar() - ndFloat32(1.0f)); - ndAssert (err < ndFloat32(ndEpsilon * 100.0f)); -#endif -} - -ndQuaternion::ndQuaternion (const ndVector &unitAxis, ndFloat32 angle) -{ - angle *= ndFloat32 (0.5f); - m_w = ndCos (angle); - ndFloat32 sinAng = ndSin (angle); - -#ifdef _DEBUG - if (ndAbs (angle) > ndFloat32(ndEpsilon / 10.0f)) { - ndAssert (ndAbs (ndFloat32(1.0f) - unitAxis.DotProduct(unitAxis & ndVector::m_triplexMask).GetScalar()) < ndFloat32(ndEpsilon * 10.0f)); - } -#endif - m_x = unitAxis.m_x * sinAng; - m_y = unitAxis.m_y * sinAng; - m_z = unitAxis.m_z * sinAng; -} - -ndQuaternion ndQuaternion::operator* (const ndQuaternion &q) const -{ - //return ndQuaternion( - // q.m_x * m_w + q.m_w * m_x - q.m_z * m_y + q.m_y * m_z, - // q.m_y * m_w + q.m_z * m_x + q.m_w * m_y - q.m_x * m_z, - // q.m_z * m_w - q.m_y * m_x + q.m_x * m_y + q.m_w * m_z, - // q.m_w * m_w - q.m_x * m_x - q.m_y * m_y - q.m_z * m_z); - - const ndVector w(q); - const ndVector x( q.m_w, q.m_z, -q.m_y, -q.m_x); - const ndVector y(-q.m_z, q.m_w, q.m_x, -q.m_y); - const ndVector z( q.m_y, -q.m_x, q.m_w, -q.m_z); - return x * ndVector(m_x) + y * ndVector(m_y) + z * ndVector(m_z) + w * ndVector(m_w); -} - -ndVector ndQuaternion::CalcAverageOmega (const ndQuaternion &q1, ndFloat32 invdt) const -{ - ndQuaternion q0 (*this); - if (q0.DotProduct (q1).GetScalar() < ndFloat32 (0.0f)) - { - q0 = q0 * ndVector::m_negOne; - } - ndQuaternion dq (q0.Inverse() * q1); - ndVector omegaDir (dq.m_x, dq.m_y, dq.m_z, ndFloat32 (0.0f)); - - ndFloat32 dirMag2 = omegaDir.DotProduct(omegaDir).GetScalar(); - if (dirMag2 < ndFloat32(ndFloat32 (1.0e-5f) * ndFloat32 (1.0e-5f))) - { - return ndVector::m_zero; - } - - ndFloat32 dirMagInv = ndRsqrt (dirMag2); - ndFloat32 dirMag = dirMag2 * dirMagInv; - - ndFloat32 omegaMag = ndFloat32(2.0f) * ndAtan2 (dirMag, dq.m_w) * invdt; - return omegaDir.Scale (dirMagInv * omegaMag); -} - -ndQuaternion ndQuaternion::IntegrateOmega(const ndVector& omega, ndFloat32 timestep) const -{ - const ndFloat32 tol = (ndFloat32(0.0125f) * ndDegreeToRad); - const ndFloat32 tol2 = tol * tol; - - ndQuaternion result(*this); - ndFloat32 omegaMag2 = omega.DotProduct(omega & ndVector::m_triplexMask).GetScalar(); - if (omegaMag2 > tol2) - { - const ndFloat32 omegaAngle = ndSqrt(omegaMag2); - const ndVector omegaAxis(omega.Scale(ndFloat32(1.0f) / omegaAngle)); - const ndQuaternion rotationStep(omegaAxis, omegaAngle * timestep); - result = result * rotationStep; - result = result.Normalize(); - ndAssert((result.DotProduct(result).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-5f)); - } - return result; -} - -ndQuaternion ndQuaternion::Slerp (const ndQuaternion &q1, ndFloat32 t) const -{ - ndQuaternion q0; - - ndFloat32 dot = DotProduct(q1).GetScalar(); - if ((dot + ndFloat32(1.0f)) > ndEpsilon) - { - ndFloat32 Sclp; - ndFloat32 Sclq; - if (dot < (ndFloat32(1.0f) - ndEpsilon) ) - { - ndFloat32 ang = ndAcos (dot); - - ndFloat32 sinAng = ndSin (ang); - ndFloat32 den = ndFloat32(1.0f) / sinAng; - - Sclp = ndSin ((ndFloat32(1.0f) - t ) * ang) * den; - Sclq = ndSin (t * ang) * den; - } - else - { - Sclp = ndFloat32(1.0f) - t; - Sclq = t; - } - - q0.m_w = m_w * Sclp + q1.m_w * Sclq; - q0.m_x = m_x * Sclp + q1.m_x * Sclq; - q0.m_y = m_y * Sclp + q1.m_y * Sclq; - q0.m_z = m_z * Sclp + q1.m_z * Sclq; - } - else - { - q0.m_w = m_z; - q0.m_x = -m_y; - q0.m_y = m_x; - q0.m_z = m_w; - - ndFloat32 Sclp = ndSin ((ndFloat32(1.0f) - t) * ndPi * ndFloat32 (0.5f)); - ndFloat32 Sclq = ndSin (t * ndPi * ndFloat32 (0.5f)); - - q0.m_w = m_w * Sclp + q0.m_w * Sclq; - q0.m_x = m_x * Sclp + q0.m_x * Sclq; - q0.m_y = m_y * Sclp + q0.m_y * Sclq; - q0.m_z = m_z * Sclp + q0.m_z * Sclq; - } - - dot = q0.DotProduct (q0).GetScalar(); - if (ndAbs (dot - ndFloat32(1.0f)) > ndEpsilon) - { - dot = ndRsqrt (dot); - q0 = q0.Scale(dot); - } - return q0; -} - -ndVector ndQuaternion::GetEulerAngles(ndVector& euler) const -{ - const ndMatrix matrix (ndCalculateMatrix(*this)); - return matrix.CalcPitchYawRoll(euler); -} - -ndVector ndQuaternion::RotateVector(const ndVector& point) const -{ - ndMatrix matrix(ndCalculateMatrix(*this)); - return matrix.RotateVector(point); -} - -ndVector ndQuaternion::UnrotateVector(const ndVector& point) const -{ - ndMatrix matrix(ndCalculateMatrix(*this)); - return matrix.UnrotateVector(point); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndQuaternion.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndQuaternion.h deleted file mode 100644 index 9079ac59bd..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndQuaternion.h +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_QUATERNION_H__ -#define __ND_QUATERNION_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndVector.h" - -class ndMatrix; - -class ndQuaternion: public ndVector -{ - public: - ndQuaternion(); - ndQuaternion(const ndVector& quat); - //ndQuaternion(const ndQuaternion& quat); - D_CORE_API ndQuaternion (const ndMatrix& matrix); - ndQuaternion (ndFloat32 q0, ndFloat32 q1, ndFloat32 q2, ndFloat32 q3); - D_CORE_API ndQuaternion (const ndVector &unit_Axis, ndFloat32 angle); - - ndQuaternion Normalize() const; - ndQuaternion Scale(ndFloat32 scale) const; - ndQuaternion Inverse () const; - ndQuaternion operator+ (const ndQuaternion &B) const; - ndQuaternion operator- (const ndQuaternion &B) const; - - D_CORE_API ndQuaternion operator* (const ndQuaternion &B) const; - - D_CORE_API ndVector GetEulerAngles(ndVector& euler) const; - D_CORE_API ndVector RotateVector(const ndVector& point) const; - D_CORE_API ndVector UnrotateVector(const ndVector& point) const; - D_CORE_API ndQuaternion Slerp(const ndQuaternion &q1, ndFloat32 t) const; - D_CORE_API ndVector CalcAverageOmega(const ndQuaternion &q1, ndFloat32 invdt) const; - D_CORE_API ndQuaternion IntegrateOmega(const ndVector& omega, ndFloat32 timestep) const; -}; - -inline ndQuaternion::ndQuaternion() - //:ndVector(ndVector::m_wOne) - :ndVector(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f)) -{ -} - -inline ndQuaternion::ndQuaternion(const ndVector& quat) - :ndVector(quat) -{ -} - -//inline ndQuaternion::ndQuaternion(const ndQuaternion& quat) -// :ndVector(quat) -//{ -//} - -inline ndQuaternion::ndQuaternion(ndFloat32 q0, ndFloat32 q1, ndFloat32 q2, ndFloat32 q3) - :ndVector(q0, q1, q2, q3) -{ - *this = Normalize(); -} - -inline ndQuaternion ndQuaternion::Inverse () const -{ - return ndQuaternion (-m_x, -m_y, -m_z, m_w); -} - -inline ndQuaternion ndQuaternion::operator+ (const ndQuaternion &q) const -{ - //return ndQuaternion (m_x + q.m_x, m_y + q.m_y, m_z + q.m_z, m_w + q.m_w); - return ndVector::operator+(q); -} - -inline ndQuaternion ndQuaternion::operator- (const ndQuaternion &q) const -{ - //return ndQuaternion (m_x - q.m_x, m_y - q.m_y, m_z - q.m_z, m_w - q.m_w); - return ndVector::operator-(q); -} - -inline ndQuaternion ndQuaternion::Normalize() const -{ - return ndVector::Normalize(); -} - -inline ndQuaternion ndQuaternion::Scale(ndFloat32 scale) const -{ - return ndVector::Scale(scale); -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSemaphore.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSemaphore.cpp deleted file mode 100644 index 34e0b4a1ff..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSemaphore.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndSemaphore.h" - -ndSemaphore::ndSemaphore() -#ifndef D_USE_THREAD_EMULATION - :m_mutex() - ,m_condition() - ,m_count(0) - ,m_terminate(false) -#endif -{ -} - -ndSemaphore::~ndSemaphore() -{ -} - -ndInt32 ndSemaphore::GetCount() -{ -#ifdef D_USE_THREAD_EMULATION - return 0; -#else - std::unique_lock lock(m_mutex); - return m_count; -#endif -} - -bool ndSemaphore::Wait() -{ -#ifdef D_USE_THREAD_EMULATION - return false; -#else - std::unique_lock lock(m_mutex); - while (m_count == 0) - { - m_condition.wait(lock); - } - - m_count--; - return m_terminate; -#endif -} - -void ndSemaphore::Signal() -{ -#ifndef D_USE_THREAD_EMULATION - std::unique_lock lock(m_mutex); - m_count++; - m_condition.notify_one(); -#endif -} - -void ndSemaphore::Terminate() -{ -#ifndef D_USE_THREAD_EMULATION - std::unique_lock lock(m_mutex); - m_count++; - m_terminate = true; - m_condition.notify_one(); -#endif -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSemaphore.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSemaphore.h deleted file mode 100644 index 4bf993ec2b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSemaphore.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SEMAPHORE_H_ -#define __ND_SEMAPHORE_H_ - -#include "ndCoreStdafx.h" - -/// Generic counting semaphore for thread synchronization -class ndSemaphore -{ - public: - /// Create and initialize counter to zero - D_CORE_API ndSemaphore(); - - /// Destroy semaphore - D_CORE_API ~ndSemaphore(); - - /// Returns counter counter value - D_CORE_API ndInt32 GetCount(); - - /// Synchronize with another threads. - /// \return returns false if member function Terminate has not been called. - /// \brief When internal variable m_counter is zero, this function blocks - /// the calling thread until another thread call Signal function incrementing - /// m_count by one. - /// \brief when counter is hight that zero, this function return immediately - /// decrementing the m_count by one. - D_CORE_API bool Wait(); - - /// Notify a thread blocked by member function Wait to wake and test m_counter again. - /// Increment internal variable m_count by one and signal the thread to wakeup. - D_CORE_API void Signal(); - - /// Notify a waiting thread on member function Wait that is time to exit the thread loop. - D_CORE_API void Terminate(); - -#ifndef D_USE_THREAD_EMULATION - private: - std::mutex m_mutex; - std::condition_variable m_condition; - ndInt32 m_count; - bool m_terminate; -#endif -}; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSharedPtr.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSharedPtr.h deleted file mode 100644 index 3a37895810..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSharedPtr.h +++ /dev/null @@ -1,171 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef _ND_SHARED_PTR_H_ -#define _ND_SHARED_PTR_H_ - -template -class ndSharedPtr -{ - public: - ndSharedPtr(); - ndSharedPtr(T* const ptr); - ndSharedPtr(const ndSharedPtr& sp); - ~ndSharedPtr(); - ndSharedPtr& operator = (const ndSharedPtr& sp); - - void Swap(ndSharedPtr& src); - - T* operator->(); - T* operator->() const; - - T* operator* (); - const T* operator* () const; - - operator bool() const; - ndInt32 GetRefCount() const; - - private: - class ndRefCounter : public ndAtomic, public ndContainersFreeListAlloc - { - public: - ndRefCounter(); - void AddRef(); - ndInt32 Release(); - }; - - T* m_ptr; - ndRefCounter* m_references; -}; - -template -ndSharedPtr::ndRefCounter::ndRefCounter() - :ndAtomic(0) - ,ndContainersFreeListAlloc() -{ -} - -template -void ndSharedPtr::ndRefCounter::AddRef() -{ - fetch_add(1); -} - -template -ndInt32 ndSharedPtr::ndRefCounter::Release() -{ - ndInt32 ref = fetch_add(-1); - return ref - 1; -} - -template -ndSharedPtr::ndSharedPtr() - :m_ptr(nullptr) - ,m_references(new ndRefCounter) -{ - m_references->AddRef(); -} - -template -ndSharedPtr::ndSharedPtr(T* const ptr) - :m_ptr(ptr) - ,m_references(new ndRefCounter) -{ - m_references->AddRef(); -} - -template -ndSharedPtr::ndSharedPtr(const ndSharedPtr& sp) - :m_ptr(sp.m_ptr) - ,m_references(sp.m_references) -{ - m_references->AddRef(); -} - -template -ndSharedPtr::~ndSharedPtr() -{ - int ref = m_references->Release(); - if (ref == 0) - { - if (m_ptr) - { - delete m_ptr; - } - delete m_references; - } -} - -template -ndSharedPtr& ndSharedPtr::operator = (const ndSharedPtr& src) -{ - if (this != &src) - { - if (m_references->Release() == 0) - { - if (m_ptr) - { - delete m_ptr; - } - delete m_references; - } - - m_ptr = src.m_ptr; - m_references = src.m_references; - m_references->AddRef(); - } - return *this; -} - -template -void ndSharedPtr::Swap(ndSharedPtr& src) -{ - ndSwap(m_ptr, src.m_ptr); - ndSwap(m_references, src.m_references); -} - -template -T* ndSharedPtr::operator* () -{ - return m_ptr; -} - -template -const T* ndSharedPtr::operator* () const -{ - return m_ptr; -} - -template -T* ndSharedPtr::operator-> () -{ - return m_ptr; -} - -template -T* ndSharedPtr::operator-> () const -{ - return m_ptr; -} - -template -ndSharedPtr::operator bool() const -{ - return m_ptr != nullptr; -} - -template -ndInt32 ndSharedPtr::GetRefCount() const -{ - return m_references->load(); -} -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSmallDeterminant.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSmallDeterminant.cpp deleted file mode 100644 index 4956e22736..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSmallDeterminant.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndGoogol.h" -#include "ndSmallDeterminant.h" - -#define Absolute(a) ((a) >= 0.0 ? (a) : -(a)) - -ndFloat64 Determinant2x2 (const ndFloat64 matrix[2][2], ndFloat64* const error) -{ - ndFloat64 a00xa11 = matrix[0][0] * matrix[1][1]; - ndFloat64 a01xa10 = matrix[0][1] * matrix[1][0]; - *error = Absolute(a00xa11) + Absolute(a01xa10); - return a00xa11 - a01xa10; -} - -ndGoogol Determinant2x2 (const ndGoogol matrix[2][2]) -{ - ndGoogol a00xa11 (matrix[0][0] * matrix[1][1]); - ndGoogol a01xa10 (matrix[0][1] * matrix[1][0]); - return a00xa11 - a01xa10; -} - -ndFloat64 Determinant3x3 (const ndFloat64 matrix[3][3], ndFloat64* const error) -{ - ndFloat64 sign = ndFloat64 (-1.0f); - ndFloat64 det = ndFloat64 (0.0f); - ndFloat64 accError = ndFloat64 (0.0f); - for (ndInt32 i = 0; i < 3; ++i) - { - ndFloat64 cofactor[2][2]; - for (ndInt32 j = 0; j < 2; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 3; ++k) - { - if (k != i) - { - cofactor[j][k0] = matrix[j][k]; - k0 ++; - } - } - } - - ndFloat64 parcialError; - ndFloat64 minorDet = Determinant2x2 (cofactor, &parcialError); - accError += parcialError * Absolute (matrix[2][i]); - det += sign * minorDet * matrix[2][i]; - sign *= ndFloat64 (-1.0f); - } - - *error = accError; - return det; -} - -ndGoogol Determinant3x3 (const ndGoogol matrix[3][3]) -{ - ndGoogol negOne (ndFloat64 (-1.0f)); - ndGoogol sign (ndFloat64 (-1.0f)); - ndGoogol det = ndFloat64 (0.0f); - for (ndInt32 i = 0; i < 3; ++i) - { - ndGoogol cofactor[2][2]; - for (ndInt32 j = 0; j < 2; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 3; ++k) - { - if (k != i) - { - cofactor[j][k0] = matrix[j][k]; - k0 ++; - } - } - } - - ndGoogol minorDet (Determinant2x2 (cofactor)); - det = det + sign * minorDet * matrix[2][i]; - sign = sign * negOne; - } - return det; -} - -ndFloat64 Determinant4x4 (const ndFloat64 matrix[4][4], ndFloat64* const error) -{ - ndFloat64 sign = ndFloat64 (1.0f); - ndFloat64 det = ndFloat64 (0.0f); - ndFloat64 accError = ndFloat64 (0.0f); - for (ndInt32 i = 0; i < 4; ++i) - { - ndFloat64 cofactor[3][3]; - for (ndInt32 j = 0; j < 3; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 4; ++k) - { - if (k != i) { - cofactor[j][k0] = matrix[j][k]; - k0 ++; - } - } - } - - ndFloat64 parcialError; - ndFloat64 minorDet = Determinant3x3 (cofactor, &parcialError); - accError += parcialError * Absolute (matrix[3][i]); - det += sign * minorDet * matrix[3][i]; - sign *= ndFloat64 (-1.0f); - } - - *error = accError; - return det; -} - -ndGoogol Determinant4x4 (const ndGoogol matrix[4][4]) -{ - ndGoogol sign = ndFloat64 (1.0f); - ndGoogol det = ndFloat64 (0.0f); - ndGoogol negOne (ndFloat64 (-1.0f)); - //dGoogol accError = ndFloat64 (0.0f); - for (ndInt32 i = 0; i < 4; ++i) - { - ndGoogol cofactor[3][3]; - for (ndInt32 j = 0; j < 3; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 4; ++k) - { - if (k != i) - { - cofactor[j][k0] = matrix[j][k]; - k0 ++; - } - } - } - - ndGoogol minorDet = Determinant3x3 (cofactor); - det = det + sign * minorDet * matrix[3][i]; - sign = sign * negOne; - } - return det; -} - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSmallDeterminant.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSmallDeterminant.h deleted file mode 100644 index 9ba3f2846a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSmallDeterminant.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SMALL_DETERMINANT_H__ -#define __ND_SMALL_DETERMINANT_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" - -class ndGoogol; -ndFloat64 Determinant2x2 (const ndFloat64 matrix[2][2], ndFloat64* const error); -ndFloat64 Determinant3x3 (const ndFloat64 matrix[3][3], ndFloat64* const error); -ndFloat64 Determinant4x4 (const ndFloat64 matrix[4][4], ndFloat64* const error); - -ndGoogol Determinant2x2 (const ndGoogol matrix[2][2]); -ndGoogol Determinant3x3 (const ndGoogol matrix[3][3]); -ndGoogol Determinant4x4 (const ndGoogol matrix[4][4]); - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSort.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSort.h deleted file mode 100644 index ce35b3244f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSort.h +++ /dev/null @@ -1,491 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SORT_H__ -#define __ND_SORT_H__ - -#include "ndCoreStdafx.h" -#include "ndArray.h" -#include "ndProfiler.h" -#include "ndThreadPool.h" - -template -void ndSort(T* const array, ndInt32 elements, void* const context); - -template -void ndCountingSort(const T* const srcArray, T* const dstArray, ndInt32 size, ndUnsigned32* const prefixScanOut, void* const context); - -template -void ndCountingSort(ndThreadPool& threadPool, const T* const srcArray, T* const dstArray, ndInt32 size, ndUnsigned32* const prefixScanOut, void* const context); - -template -void ndCountingSort(ndArray& array, ndArray& scratchBuffer, ndUnsigned32* const prefixScanOut, void* const context); - -template -void ndCountingSort(ndThreadPool& threadPool, ndArray& array, ndArray& scratchBuffer, ndUnsigned32* const prefixScanOut, void* const context); - -template -void ndCountingSortInPlace(T* const array, T* const scratchBuffer, ndInt32 size, ndUnsigned32* const prefixScanOut, void* const context); - -template -void ndCountingSortInPlace(ndThreadPool& threadPool, T* const array, T* const scratchBuffer, ndInt32 size, ndUnsigned32* const prefixScanOut, void* const context); - - -// ***************************************************** -// Implementation -// ***************************************************** -template -void ndSort(T* const array, ndInt32 elements, void* const context) -{ - //D_TRACKTIME(); - const ndInt32 batchSize = 8; - ndInt32 stack[128][2]; - - stack[0][0] = 0; - stack[0][1] = elements - 1; - ndInt32 stackIndex = 1; - const dCompareKey comparator(context); - while (stackIndex) - { - stackIndex--; - ndInt32 lo = stack[stackIndex][0]; - ndInt32 hi = stack[stackIndex][1]; - if ((hi - lo) > batchSize) - { - ndInt32 mid = (lo + hi) >> 1; - if (comparator.Compare(array[lo], array[mid]) > 0) - { - ndSwap(array[lo], array[mid]); - } - if (comparator.Compare(array[mid], array[hi]) > 0) - { - ndSwap(array[mid], array[hi]); - } - if (comparator.Compare(array[lo], array[mid]) > 0) - { - ndSwap(array[lo], array[mid]); - } - ndInt32 i = lo + 1; - ndInt32 j = hi - 1; - const T pivot(array[mid]); - do - { - while (comparator.Compare(array[i], pivot) < 0) - { - i++; - } - while (comparator.Compare(array[j], pivot) > 0) - { - j--; - } - - if (i <= j) - { - ndSwap(array[i], array[j]); - i++; - j--; - } - } while (i <= j); - - if (i < hi) - { - stack[stackIndex][0] = i; - stack[stackIndex][1] = hi; - stackIndex++; - } - if (lo < j) - { - stack[stackIndex][0] = lo; - stack[stackIndex][1] = j; - stackIndex++; - } - ndAssert(stackIndex < ndInt32(sizeof(stack) / (2 * sizeof(stack[0][0])))); - } - } - - ndInt32 stride = batchSize + 1; - if (elements < stride) - { - stride = elements; - } - for (ndInt32 i = 1; i < stride; ++i) - { - if (comparator.Compare(array[0], array[i]) > 0) - { - ndSwap(array[0], array[i]); - } - } - - for (ndInt32 i = 1; i < elements; ++i) - { - ndInt32 j = i; - const T tmp(array[i]); - for (; comparator.Compare(array[j - 1], tmp) > 0; --j) - { - ndAssert(j > 0); - array[j] = array[j - 1]; - } - array[j] = tmp; - } - -//#ifdef _DEBUG -#if 0 - for (ndInt32 i = 0; i < (elements - 1); ++i) - { - ndAssert(comparator.Compare(array[i], array[i + 1]) <= 0); - } -#endif -} - -template -void ndCountingSortInPlace(T* const array, T* const scratchBuffer, ndInt32 size, ndUnsigned32* const prefixScanOut, void* const context) -{ - //D_TRACKTIME(); - ndAssert(keyBitSize > 0); - ndUnsigned32 scans[(1 << keyBitSize) + 1]; - ndEvaluateKey evaluator(context); - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - scans[i] = 0; - } - for (ndInt32 i = 0; i < size; ++i) - { - const T& entry = array[i]; - scratchBuffer[i] = entry; - const ndInt32 key = evaluator.GetKey(entry); - ndAssert(key >= 0); - ndAssert(key < (1 << keyBitSize)); - scans[key] ++; - } - - ndUnsigned32 sum = 0; - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - ndUnsigned32 partialSum = scans[i]; - scans[i] = sum; - sum += partialSum; - } - - if (prefixScanOut) - { - for (ndInt32 i = 0; i < ((1 << keyBitSize) + 1); ++i) - { - prefixScanOut[i] = scans[i]; - } - } - - for (ndInt32 i = 0; i < size; ++i) - { - const T& entry = scratchBuffer[i]; - const ndInt32 key = evaluator.GetKey(entry); - ndAssert(key >= 0); - ndAssert(key < (1 << keyBitSize)); - const ndUnsigned32 index = scans[key]; - array[index] = entry; - scans[key] = index + 1; - } - - //#ifdef _DEBUG -#if 0 - for (ndInt32 i = size - 2; i >= 0; --i) - { - ndAssert(evaluator.GetKey(scratchBuffer[i]) <= evaluator.GetKey(scratchBuffer[i + 1])); - } -#endif -} - -template -void ndCountingSortInPlace(ndThreadPool& threadPool, T* const array, T* const scratchBuffer, ndInt32 size, ndUnsigned32* const prefixScanOut, void* const context) -{ - D_TRACKTIME(); - ndEvaluateKey evaluator(context); - const ndInt32 threadCount = threadPool.GetThreadCount(); - - ndUnsigned32* const sum = ndAlloca(ndUnsigned32, 1 << keyBitSize); - ndUnsigned32* const scans = ndAlloca(ndUnsigned32, threadCount * (1 << keyBitSize)); - - auto ndBuildHistogram = ndMakeObject::ndFunction([&array, &scratchBuffer, size, &evaluator, &scans](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(ndBuildHistogram); - ndUnsigned32* const scan = &scans[threadIndex * (1 << keyBitSize)]; - - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - scan[i] = 0; - } - - ndStartEnd startEnd(size, threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const T& entry = array[i]; - const ndInt32 key = evaluator.GetKey(entry); - ndAssert(key >= 0); - ndAssert(key < (1 << keyBitSize)); - scan[key] ++; - scratchBuffer[i] = entry; - } - }); - - auto ndShuffleArray = ndMakeObject::ndFunction([&array, &scratchBuffer, size, &evaluator, &scans, &sum](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(ndShuffleArray); - ndUnsigned32* const scan = &scans[threadIndex * (1 << keyBitSize)]; - - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - scan[i] += sum[i]; - } - ndStartEnd startEnd(size, threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const T& entry = scratchBuffer[i]; - const ndInt32 key = evaluator.GetKey(entry); - ndAssert(key >= 0); - ndAssert(key < (1 << keyBitSize)); - const ndUnsigned32 index = scan[key]; - array[index] = entry; - scan[key] = index + 1; - } - }); - - threadPool.ParallelExecute(ndBuildHistogram); - - ndAssert(keyBitSize < 11); - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - sum[i] = 0; - } - for (ndInt32 j = 0; j < threadCount; ++j) - { - ndUnsigned32* const scan = &scans[j * (1 << keyBitSize)]; - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - ndUnsigned32 partialSum = scan[i]; - scan[i] = sum[i]; - sum[i] += partialSum; - } - } - - ndUnsigned32 accSum = 0; - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - ndUnsigned32 partialSum = sum[i]; - sum[i] = accSum; - accSum += partialSum; - } - - if (prefixScanOut) - { - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - prefixScanOut[i] = sum[i]; - } - prefixScanOut[1 << keyBitSize] = ndUnsigned32(size); - } - - threadPool.ParallelExecute(ndShuffleArray); - -//#ifdef _DEBUG -#if 0 - for (ndInt32 i = 1; i < size; ++i) - { - ndInt32 key0 = evaluator.GetKey(array[i - 1]); - ndInt32 key1 = evaluator.GetKey(array[i + 0]); - ndAssert(key0 <= key1); - } -#endif -} - -template -void ndCountingSort(const T* const srcArray, T* const dstArray, ndInt32 size, ndUnsigned32* const prefixScanOut, void* const context) -{ - //D_TRACKTIME(); - ndAssert(keyBitSize > 0); - ndUnsigned32 scans[(1 << keyBitSize) + 1]; - ndEvaluateKey evaluator(context); - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - scans[i] = 0; - } - for (ndInt32 i = 0; i < size; ++i) - { - const T& entry = srcArray[i]; - const ndInt32 key = evaluator.GetKey(entry); - ndAssert(key >= 0); - ndAssert(key < (1 << keyBitSize)); - scans[key] ++; - } - - ndUnsigned32 sum = 0; - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - ndUnsigned32 partialSum = scans[i]; - scans[i] = sum; - sum += partialSum; - } - - if (prefixScanOut) - { - for (ndInt32 i = 0; i < ((1 << keyBitSize) + 1); ++i) - { - prefixScanOut[i] = scans[i]; - } - } - - for (ndInt32 i = 0; i < size; ++i) - { - const T& entry = srcArray[i]; - const ndInt32 key = evaluator.GetKey(entry); - ndAssert(key >= 0); - ndAssert(key < (1 << keyBitSize)); - const ndUnsigned32 index = scans[key]; - dstArray[index] = entry; - scans[key] = index + 1; - } - -//#ifdef _DEBUG -#if 0 - for (ndInt32 i = size - 2; i >= 0; --i) - { - ndAssert(evaluator.GetKey(scratchBuffer[i]) <= evaluator.GetKey(scratchBuffer[i + 1])); - } -#endif -} - -template -void ndCountingSort(ndThreadPool& threadPool, const T* const srcArray, T* const dstArray, ndInt32 size, ndUnsigned32* const prefixScanOut, void* const context) -{ - D_TRACKTIME(); - ndEvaluateKey evaluator(context); - const ndInt32 threadCount = threadPool.GetThreadCount(); - - ndUnsigned32* const sum = ndAlloca(ndUnsigned32, 1 << keyBitSize); - ndUnsigned32* const scans = ndAlloca(ndUnsigned32, threadCount * (1 << keyBitSize)); - - auto ndBuildHistogram = ndMakeObject::ndFunction([&srcArray, size, &evaluator, &scans](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(ndBuildHistogram); - ndUnsigned32* const scan = &scans[threadIndex * (1 << keyBitSize)]; - - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - scan[i] = 0; - } - - ndStartEnd startEnd(size, threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const T& entry = srcArray[i]; - const ndInt32 key = evaluator.GetKey(entry); - ndAssert(key >= 0); - ndAssert(key < (1 << keyBitSize)); - scan[key] ++; - } - }); - - auto ndShuffleArray = ndMakeObject::ndFunction([&srcArray, &dstArray, size, &evaluator, &scans, &sum](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(ndShuffleArray); - ndUnsigned32* const scan = &scans[threadIndex * (1 << keyBitSize)]; - - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - scan[i] += sum[i]; - } - - ndStartEnd startEnd(size, threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const T& entry = srcArray[i]; - const ndInt32 key = evaluator.GetKey(entry); - ndAssert(key >= 0); - ndAssert(key < (1 << keyBitSize)); - const ndUnsigned32 index = scan[key]; - dstArray[index] = entry; - scan[key] = index + 1; - } - }); - - threadPool.ParallelExecute(ndBuildHistogram); - - ndAssert(keyBitSize < 11); - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - sum[i] = 0; - } - for (ndInt32 j = 0; j < threadCount; ++j) - { - ndUnsigned32* const scan = &scans[j * (1 << keyBitSize)]; - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - ndUnsigned32 partialSum = scan[i]; - scan[i] = sum[i]; - sum[i] += partialSum; - } - } - - ndUnsigned32 accSum = 0; - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - ndUnsigned32 partialSum = sum[i]; - sum[i] = accSum; - accSum += partialSum; - } - - if (prefixScanOut) - { - for (ndInt32 i = 0; i < (1 << keyBitSize); ++i) - { - prefixScanOut[i] = sum[i]; - } - prefixScanOut[1 << keyBitSize] = ndUnsigned32(size); - } - - threadPool.ParallelExecute(ndShuffleArray); - -//#ifdef _DEBUG -#if 0 - for (ndInt32 i = 1; i < size; ++i) - { - ndInt32 key0 = evaluator.GetKey(scratchBuffer[i - 1]); - ndInt32 key1 = evaluator.GetKey(scratchBuffer[i + 0]); - ndAssert(key0 <= key1); - } -#endif -} - -template -void ndCountingSort(ndThreadPool& threadPool, ndArray& array, ndArray& scratchBuffer, ndUnsigned32* const prefixScanOut, void* const context) -{ - scratchBuffer.SetCount(array.GetCount()); - ndCountingSort(threadPool, &array[0], &scratchBuffer[0], ndInt32(array.GetCount()), prefixScanOut, context); - array.Swap(scratchBuffer); -} - -template -void ndCountingSort(ndArray& array, ndArray& scratchBuffer, ndUnsigned32* const prefixScanOut, void* const context) -{ - scratchBuffer.SetCount(array.GetCount()); - ndCountingSort(&array[0], &scratchBuffer[0], ndInt32(array.GetCount()), prefixScanOut, context); - array.Swap(scratchBuffer); -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSpatialMatrix.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSpatialMatrix.cpp deleted file mode 100644 index 7539ee0ea4..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSpatialMatrix.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndGeneralMatrix.h" -#include "ndSpatialMatrix.h" - -ndSpatialMatrix ndSpatialMatrix::Inverse(ndInt32 rows) const -{ - ndSpatialMatrix tmp; - ndSpatialMatrix inv; - for (ndInt32 i = 0; i < rows; ++i) - { - tmp[i] = (*this)[i]; - inv[i] = ndSpatialVector::m_zero; - inv[i][i] = ndFloat32(1.0f); - } - - for (ndInt32 i = 0; i < rows; ++i) - { - ndFloat64 pivot = ndAbs(tmp[i][i]); - if (pivot < ndFloat64(0.01f)) - { - ndInt32 permute = i; - for (ndInt32 j = i + 1; j < rows; ++j) - { - ndFloat64 pivot1 = ndAbs(tmp[j][i]); - if (pivot1 > pivot) { - permute = j; - pivot = pivot1; - } - } - ndAssert(pivot > ndFloat32(0.0f)); - ndAssert((pivot > ndFloat32(1.0e-6f)) || (ndConditionNumber(rows, 6, (ndFloat64*)&m_rows[0]) < ndFloat32(1.0e5f))); - //if (!((pivot > ndFloat32(1.0e-6f)) || (ndConditionNumber(rows, 6, (dFloat64*)&m_rows[0]) < ndFloat32(1.0e5f)))) - //{ - // for (ndInt32 m = 0; m < rows; m++) { - // for (ndInt32 n = 0; n < rows; n++) { - // dTrace(("%f ", m_rows[m][n])); - // } - // dTrace(("\n")); - // } - // ndAssert(0); - //} - - if (permute != i) - { - for (ndInt32 j = 0; j < rows; ++j) - { - ndSwap(tmp[i][j], tmp[permute][j]); - ndSwap(tmp[i][j], tmp[permute][j]); - } - } - } - - for (ndInt32 j = i + 1; j < rows; ++j) - { - ndFloat64 scale = tmp[j][i] / tmp[i][i]; - tmp[j][i] = ndFloat64(0.0f); - for (ndInt32 k = i + 1; k < rows; ++k) - { - tmp[j][k] -= scale * tmp[i][k]; - } - for (ndInt32 k = 0; k <= i; ++k) - { - inv[j][k] -= scale * inv[i][k]; - } - } - } - - for (ndInt32 i = rows - 1; i >= 0; i--) - { - ndSpatialVector acc(ndFloat64(0.0f)); - for (ndInt32 j = i + 1; j < rows; ++j) - { - ndFloat64 pivot = tmp[i][j]; - for (ndInt32 k = 0; k < rows; ++k) - { - acc[k] += pivot * inv[j][k]; - } - } - ndFloat64 den = ndFloat64(1.0f) / tmp[i][i]; - for (ndInt32 k = 0; k < rows; ++k) - { - inv[i][k] = den * (inv[i][k] - acc[k]); - } - } - - -#ifdef _DEBUG - for (ndInt32 i = 0; i < rows; ++i) - { - for (ndInt32 j = 0; j < rows; ++j) - { - tmp[i][j] = m_rows[j][i]; - } - } - - for (ndInt32 i = 0; i < rows; ++i) - { - ndSpatialVector v(inv.VectorTimeMatrix(tmp[i], rows)); - ndAssert(ndAbs(v[i] - ndFloat64(1.0f)) < ndFloat64(1.0e-6f)); - for (ndInt32 j = 0; j < rows; ++j) - { - if (j != i) - { - ndAssert(ndAbs(v[j]) < ndFloat64(1.0e-6f)); - } - } - } -#endif - - return inv; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSpatialMatrix.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSpatialMatrix.h deleted file mode 100644 index 35af7552a2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSpatialMatrix.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SPATIAL_MATRIX_H__ -#define __ND_SPATIAL_MATRIX_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndVector.h" -#include "ndSpatialVector.h" - -class ndSpatialMatrix -{ - public: - D_OPERATOR_NEW_AND_DELETE - - inline ndSpatialMatrix() - { - } - - inline ndSpatialMatrix(ndFloat32 val) - { - const ndSpatialVector row (val); - for (ndInt32 i = 0; i < 6; ++i) - { - m_rows[i] = row; - } - } - - //inline ~ndSpatialMatrix() - //{ - //} - - inline ndSpatialVector& operator[] (ndInt32 i) - { - ndAssert(i < 6); - ndAssert(i >= 0); - return m_rows[i]; - } - - inline const ndSpatialVector& operator[] (ndInt32 i) const - { - ndAssert(i < 6); - ndAssert(i >= 0); - return m_rows[i]; - } - - D_CORE_API ndSpatialMatrix Inverse(ndInt32 rows) const; - - inline ndSpatialVector VectorTimeMatrix(const ndSpatialVector& jacobian) const - { - ndSpatialVector tmp(m_rows[0].Scale (jacobian[0])); - for (ndInt32 i = 1; i < 6; ++i) - { - tmp = tmp + m_rows[i].Scale(jacobian[i]); - } - return tmp; - } - - inline ndSpatialVector VectorTimeMatrix(const ndSpatialVector& jacobian, ndInt32 dof) const - { - ndSpatialVector tmp(ndFloat32 (0.0f)); - for (ndInt32 i = 0; i < dof; ++i) - { - tmp = tmp + m_rows[i].Scale(jacobian[i]); - } - return tmp; - } - - ndSpatialVector m_rows[6]; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSpatialVector.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSpatialVector.h deleted file mode 100644 index 3fae83407e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSpatialVector.h +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SPATIAL_VECTOR_H__ -#define __ND_SPATIAL_VECTOR_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndVector.h" - -D_MSV_NEWTON_ALIGN_32 -class ndSpatialVector -{ - public: - D_OPERATOR_NEW_AND_DELETE - - inline ndSpatialVector() - { - } - - inline ndSpatialVector(const ndFloat64 a) - :m_data(a) - { - } - - inline ndSpatialVector(const ndSpatialVector& copy) - :m_data(copy.m_data) - { - } - - inline ndSpatialVector(const ndBigVector& low, const ndBigVector& high) - :m_data(low, high) - { - } - - inline ~ndSpatialVector() - { - } - - inline ndFloat64& operator[] (ndInt32 i) - { - ndAssert(i >= 0); - ndAssert(i < ndInt32(sizeof(m_f) / sizeof(m_f[0]))); - return ((ndFloat64*)&m_f)[i]; - } - - inline const ndFloat64& operator[] (ndInt32 i) const - { - ndAssert(i >= 0); - ndAssert(i < ndInt32 (sizeof(m_f) / sizeof(m_f[0]))); - return ((ndFloat64*)&m_f)[i]; - } - - inline ndSpatialVector& operator= (const ndSpatialVector& A) - { - m_data.m_low = A.m_data.m_low; - m_data.m_high = A.m_data.m_high; - return *this; - } - - inline ndSpatialVector operator+ (const ndSpatialVector& A) const - { - return ndSpatialVector(m_data.m_low + A.m_data.m_low, m_data.m_high + A.m_data.m_high); - } - - inline ndSpatialVector operator*(const ndSpatialVector& A) const - { - return ndSpatialVector(m_data.m_low * A.m_data.m_low, m_data.m_high * A.m_data.m_high); - } - - inline ndFloat64 DotProduct(const ndSpatialVector& v) const - { - ndAssert(m_f[6] == ndFloat32(0.0f)); - ndAssert(m_f[7] == ndFloat32(0.0f)); - ndBigVector tmp(m_data.m_low * v.m_data.m_low + m_data.m_high * v.m_data.m_high); - return tmp.AddHorizontal().GetScalar(); - } - - inline ndSpatialVector Scale(ndFloat64 s) const - { - ndBigVector tmp(s); - return ndSpatialVector(m_data.m_low * tmp, m_data.m_high * tmp); - } - - struct ndData - { - inline ndData(const ndFloat64 a) - :m_low(a) - ,m_high(a) - { - } - - inline ndData(const ndData& data) - :m_low(data.m_low) - ,m_high(data.m_high) - { - } - - inline ndData(const ndBigVector& low, const ndBigVector& high) - :m_low(low) - ,m_high(high) - { - } - - ndBigVector m_low; - ndBigVector m_high; - }; - - union - { - ndFloat64 m_f[8]; - ndData m_data; - }; - - D_CORE_API static ndSpatialVector m_zero; -} D_GCC_NEWTON_ALIGN_32; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndStack.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndStack.h deleted file mode 100644 index 03b718701d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndStack.h +++ /dev/null @@ -1,112 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ndStack__ -#define __ndStack__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndDebug.h" -#include "ndMemory.h" -#include "ndClassAlloc.h" - -class ndStackBase : public ndClassAlloc -{ - protected: - ndStackBase (ndInt32 size); - ~ndStackBase (); - - const void* m_ptr; -}; - -inline ndStackBase::ndStackBase (ndInt32 size) - :ndClassAlloc() - ,m_ptr (ndMemory::Malloc (size_t (size))) -{ -} - -inline ndStackBase::~ndStackBase () -{ - ndMemory::Free ((void*)m_ptr); -} - -template -class ndStack: public ndStackBase -{ - public: - ndStack (ndInt32 size); - ~ndStack (); - ndInt32 GetSizeInBytes() const; - ndInt32 GetElementsCount() const; - - inline T& operator[] (ndInt32 entry); - inline const T& operator[] (ndInt32 entry) const; - - private: - ndInt32 m_size; -}; - -template -ndStack::ndStack (ndInt32 size) - :ndStackBase (size * ndInt32(sizeof(T))) - ,m_size(size) -{ -} - -template -ndStack::~ndStack () -{ -} - -template -ndInt32 ndStack::GetElementsCount() const -{ - return m_size; -} - -template -ndInt32 ndStack::GetSizeInBytes() const -{ - return ndInt32 (m_size * sizeof(T)); -} - -template -inline T& ndStack::operator[] (ndInt32 entry) -{ - ndAssert (entry >= 0); - ndAssert ((entry < m_size) || ((m_size == 0) && (entry == 0))); - - T* const mem = (T*) m_ptr; - return mem[entry]; -} - -template -inline const T& ndStack::operator[] (ndInt32 entry) const -{ - ndAssert (entry >= 0); - ndAssert ((entry < m_size) || ((m_size == 0) && (entry == 0))); - - const T* const mem = (T*) m_ptr; - return mem[entry]; -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndString.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndString.cpp deleted file mode 100644 index 2e9a39b67f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndString.cpp +++ /dev/null @@ -1,643 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndString.h" -#include "ndMemory.h" - -//#define D_USE_POOL_BUKECT_ALLOCATOR -#define D_STRING_MEM_GRANULARITY 16 -#define D_STRING_MEM_MAX_BUCKET_SIZE 256 -#define D_STRING_MEM_BUCKETS (D_STRING_MEM_MAX_BUCKET_SIZE / D_STRING_MEM_GRANULARITY) -#define D_DSTRING_ENTRIES_IN_FREELIST 32 - -class ndString::ndStringAllocator -{ - public: - #ifdef D_USE_POOL_BUKECT_ALLOCATOR - class dMemBucket - { - public: - - class dDataChunk - { - public: - ndInt32 m_size; - ndInt32 m_count; - dDataChunk* m_next; - - }; - - dMemBucket() - :m_freeListDataChunk(nullptr) - { - } - - ~dMemBucket() - { - } - - void Prefetch (ndInt32 chunckSize) - { - for (ndInt32 i = 0; i < D_DSTRING_ENTRIES_IN_FREELIST; ++i) - { - dDataChunk* const data = (dDataChunk*) ndMemory::Malloc(chunckSize + sizeof (ndInt32)); - data->m_count = i + 1; - data->m_size = chunckSize; - data->m_next = m_freeListDataChunk; - m_freeListDataChunk = data; - } - } - - void Flush () - { - for (ndInt32 i = 0; m_freeListDataChunk && (i < D_DSTRING_ENTRIES_IN_FREELIST); ++i) - { - dDataChunk* const ptr = m_freeListDataChunk; - m_freeListDataChunk = m_freeListDataChunk->m_next; - ndMemory::Free (ptr); - } - } - - char* Alloc(ndInt32 size) - { - ndAssert (size < 1024 * 4); - if (!m_freeListDataChunk) - { - Prefetch (size); - } - dDataChunk* const data = m_freeListDataChunk; - ndAssert (size == data->m_size); - m_freeListDataChunk = m_freeListDataChunk->m_next; - return ((char*)data) + sizeof (ndInt32); - } - - void Free(char * const ptr) - { - char* const realPtr = ptr - sizeof (ndInt32); - dMemBucket::dDataChunk* const dataChunck = (dMemBucket::dDataChunk*) (realPtr); - - dataChunck->m_count = m_freeListDataChunk ? m_freeListDataChunk->m_count + 1 : 1; - dataChunck->m_next = m_freeListDataChunk; - m_freeListDataChunk = dataChunck; - if (dataChunck->m_count >= 2 * D_DSTRING_ENTRIES_IN_FREELIST) - { - Flush(); - } - } - - dDataChunk* m_freeListDataChunk; - }; - - ndStringAllocator() - { - for (ndInt32 i = 0; i < ndInt32 (sizeof (m_buckects) / sizeof (m_buckects[0])); ++i) - { - m_buckects[i].Prefetch ((i + 1)* D_STRING_MEM_GRANULARITY); - } - } - - ~ndStringAllocator() - { - for (ndInt32 i = 0; i < ndInt32 (sizeof (m_buckects) / sizeof (m_buckects[0])); ++i) - { - m_buckects[i].Flush(); - } - } - - char* Alloc(ndInt32 size) - { - ndAssert (size >= 1); - if (size <= D_STRING_MEM_MAX_BUCKET_SIZE) - { - ndInt32 buckectEntry = (size - 1) / D_STRING_MEM_GRANULARITY; - ndInt32 buckectSize = (buckectEntry + 1) * D_STRING_MEM_GRANULARITY; - return m_buckects[buckectEntry].Alloc(buckectSize); - } - dMemBucket::dDataChunk* const ptr = (dMemBucket::dDataChunk*) ndMemory::Malloc (size + sizeof (ndInt32)); - ptr->m_size = size; - return ((char*)ptr) + sizeof (ndInt32); - } - - void Free(char* const ptr) - { - char* const realPtr = ptr-sizeof (ndInt32); - dMemBucket::dDataChunk* const dataChunck = (dMemBucket::dDataChunk*) (realPtr); - if (dataChunck->m_size <= D_STRING_MEM_MAX_BUCKET_SIZE) - { - ndInt32 buckectEntry = dataChunck->m_size / D_STRING_MEM_GRANULARITY - 1; - m_buckects[buckectEntry].Free(ptr); - } - else - { - void* const ptr1 = ((char*)ptr) - sizeof (ndInt32); - ndMemory::Free (ptr1); - } - } - - dMemBucket m_buckects [D_STRING_MEM_BUCKETS]; - - #else - char* Alloc(ndInt32 size) - { - return (char*) ndMemory::Malloc (size_t(size)); - } - - void Free(char* const ptr) - { - ndMemory::Free (ptr); - } - #endif -}; - -ndString::ndString () - :m_string(nullptr) - ,m_size(0) - ,m_capacity(0) -{ -} - -ndString::ndString (const ndString& src) - :m_string(nullptr) - ,m_size(0) - ,m_capacity(0) -{ - if (src.m_string) - { - m_size = src.m_size; - m_capacity = m_size + 1; - - m_string = AllocMem (src.m_size + 1); - CopyData (m_string, src.m_string, src.m_size + 1); - m_string[m_size] = 0; - } -} - -ndString::ndString (const char* const data) - :m_string(nullptr) - ,m_size(0) - ,m_capacity(0) -{ - if (data) - { - m_size = CalculateSize (data); - m_capacity = m_size + 1; - - m_string = AllocMem (m_size + 1); - CopyData (m_string, data, m_size + 1); - m_string[m_size] = 0; - } -} - -ndString::ndString (const char* const data, ndInt32 maxSize) - :m_string(nullptr) - ,m_size(0) - ,m_capacity(0) -{ - if (data) - { - m_size = ndMin (CalculateSize (data), maxSize); - m_capacity = m_size + 1; - m_string = AllocMem (m_size + 1); - CopyData (m_string, data, m_size + 1); - m_string[m_size] = 0; - } -} - -ndString::ndString (const ndString& src, const char* const concatenate, ndInt32 concatenateSize) - :m_string(nullptr) - ,m_size(0) - ,m_capacity(0) -{ - m_string = AllocMem (src.m_size + concatenateSize + 1); - memcpy (m_string, src.m_string, size_t(src.m_size)); - memcpy (&m_string[src.m_size], concatenate, size_t(concatenateSize)); - m_size = src.m_size + concatenateSize; - m_string[m_size] = 0; - m_capacity = m_size + 1; -} - -ndString::ndString (char chr) - :m_string(nullptr) - ,m_size(0) - ,m_capacity(0) -{ - m_string = AllocMem (2); - m_string[0] = chr; - m_string[1] = 0; - m_size = 1; - m_capacity = m_size + 1; -} - -ndString::ndString (ndInt32 val) - :m_string(nullptr) - ,m_size(0) - ,m_capacity(0) -{ - char tmp[256]; - - ndInt32 count = 0; - //unsigned mag = abs (val); - ndUnsigned32 mag = ndUnsigned32(ndAbs(val)); - do - { - ndUnsigned32 digit = mag % 10; - mag /= 10; - tmp[count] = '0' + char(digit); - count ++; - } while (mag > 0); - - ndInt32 offset = (val >= 0) ? 0: 1; - m_string = AllocMem (count + offset + 1); - if (offset) - { - m_string[0] = '-'; - } - for (ndInt32 i = 0; i < count; ++i) - { - m_string[i + offset] = tmp[count - i - 1]; - } - - m_string[count + offset] = 0; - m_size = count + offset; - m_capacity = m_size + 1; -} - -ndString::ndString (ndUnsigned64 input) - :m_string(nullptr) - ,m_size(0) - ,m_capacity(0) -{ - char tmp[256]; - - ndInt32 count = 0; - ndInt64 val = ndInt64(input); - ndUnsigned64 mag = ndUnsigned64((val > 0ll) ? val : -val); - do - { - ndUnsigned64 digit = mag % 10ll; - mag /= 10ll; - tmp[count] = '0' + char(digit); - count ++; - } while (mag > 0); - - ndInt32 offset = (val >= 0ll) ? 0: 1; - m_string = AllocMem (count + offset + 1); - if (offset) - { - m_string[0] = '-'; - } - for (ndInt32 i = 0; i < count; ++i) - { - m_string[i + offset] = tmp[count - i - 1]; - } - - m_string[count + offset] = 0; - m_size = count + offset; - m_capacity = m_size + 1; -} - -ndString::~ndString () -{ - Clear(); -} - -void ndString::Clear() -{ - if (m_capacity && m_string) - { - FreeMem(m_string); - } - m_size = 0; - m_capacity = 0; - m_string = nullptr; -} - -void ndString::Empty() -{ - m_size = 0; - m_string[0] = 0; -} - -void ndString::LoadFile (FILE* const file) -{ - Clear(); - ndInt32 size = 0; - fseek (file, 0, SEEK_SET); - for (;!feof(file); size ++) - { - fgetc (file); - } - fseek (file, 0, SEEK_SET); - Expand (size); - size_t ret = fread (m_string, 1, size_t(size), file); - ret++; - m_string[size-1] = 0; - m_size = size-1; - m_capacity = m_size + 1; -} - -void ndString::operator+= (const char* const src) -{ - char* const oldData = m_string; - ndInt32 size = CalculateSize (src); - if ((m_size + size + 1) > m_capacity) - { - ndInt32 newCapacity = ndMax (m_capacity - 1, 1); - while (newCapacity < (m_size + size)) - { - newCapacity *= 2; - } - m_string = AllocMem (newCapacity + 1); - memcpy (m_string, oldData, size_t(m_size)); - memcpy (&m_string[m_size], src, size_t(size)); - m_size = m_size + size; - m_string[m_size] = 0; - m_capacity = newCapacity + 1; - FreeMem(oldData); - } - else - { - memcpy (&m_string[m_size], src, size_t(size)); - m_size = m_size + size; - m_string[m_size] = 0; - } -} - -ndInt32 ndString::ToInteger() const -{ - ndInt32 value = 0; - if (m_size) - { - ndInt32 base = (m_string[0] == '-') ? 1 : 0; - for (ndInt32 i = base; i < m_size; ++i) - { - char ch = m_string[i]; - if ((ch >= '0') && (ch <= '9')) - { - value = value * 10 + ch - '0'; - } - else - { - break; - } - } - value *= base ? -1 : 1; - } - return value; -} - - -ndUnsigned64 ndString::ToInteger64() const -{ - ndUnsigned64 value = 0; - if (m_size) - { - ndInt32 base = (m_string[0] == '-') ? 1 : 0; - for (ndInt32 i = base; i < m_size; ++i) - { - char ch = m_string[i]; - if ((ch >= '0') && (ch <= '9')) - { - value = value * 10ll + ch - '0'; - } - else - { - break; - } - } - value *= base ? -1 : 1; - } - return value; -} - -ndFloat64 ndString::ToFloat() const -{ - ndFloat64 value = 0.0; - ndFloat64 power = 1.0; - ndFloat64 decimalBase = 1.0; - if (m_size) - { - ndInt32 base = (m_string[0] == '-') ? 1 : 0; - for (ndInt32 i = base; i < m_size; ++i) - { - char ch = m_string[i]; - if ((ch >= '0') && (ch <= '9')) - { - value = value * 10ll + ch - '0'; - power *= decimalBase; - } - else if (ch == '.') - { - decimalBase = 10.0; - } - else - { - break; - } - } - value *= base ? -1 : 1; - } - value /= power; - - return value; -} - -ndString& ndString::operator= (const ndString& src) -{ - if (m_capacity && m_string) - { - FreeMem (m_string); - } - m_string = nullptr; - m_capacity = 0; - m_size = src.m_size; - if (src.m_string) - { - m_capacity = src.m_size + 1; - m_string = AllocMem (src.m_size + 1); - CopyData (m_string, src.m_string, src.m_size + 1); - } - return *this; -} - -ndInt32 ndString::CalculateSize (const char* const data) const -{ - ndInt32 size = 0; - if (data) - { - for (ndInt32 i = 0; data[i]; ++i) - { - size ++; - } - } - return size; -} - -void ndString::ToUpper() -{ - if (m_string) - { - for (char * cp = m_string; *cp; ++cp) - { - if ((*cp >= 'a') && (*cp <= 'z')) - { - *cp += 'A' - 'a'; - } - } - } -} - -void ndString::ToLower() -{ - if (m_string) - { - for (char * cp = m_string; *cp; ++cp) - { - if ((*cp >= 'A') && (*cp <= 'Z')) - { - *cp += 'a' - 'A'; - } - } - } -} - -ndInt32 ndString::Find (char ch, ndInt32 from) const -{ - for (ndInt32 i = from; i < m_size; ++i) - { - if (m_string[i] == ch) - { - return i; - } - } - return -1; -} - -//dInt32 ndString::Find (const ndString& subStream, dInt32 from) const -ndInt32 ndString::Find (const char* const subString, ndInt32 subStringLength, ndInt32 from, ndInt32 lenght) const -{ - ndAssert (from >= 0); - //ndAssert (subStream.m_size >= 0); - ndAssert (subStringLength >= 1); - - ndInt32 location = -1; - if (m_size) - { - const ndInt32 str2Size = ndMin (subStringLength, lenght); - if (str2Size == 1) - { - char ch = subString[0]; - const char* const ptr1 = m_string; - for (ndInt32 i = 0; i < m_size; ++i) - { - if (ch == ptr1[i]) - { - return i; - } - } - } - else if ((str2Size < 4) || (m_size < 64)) - { - const ndInt32 size = m_size - str2Size; - for (ndInt32 j = from; j <= size; ++j) - { - const char* const ptr1 = &m_string[j]; - ndInt32 i = 0; - while (subString[i] && (ptr1[i] == subString[i])) - { - i ++; - } - if (!subString[i]) - { - return j; - } - } - } - else - { - // for large strings smart search - ndInt16 frequency[256]; - memset (frequency, -1, sizeof (frequency)); - for (ndInt32 i = 0; i < str2Size; ++i) - { - frequency[ndInt32 (subString[i])] = ndInt16(i); - } - - ndInt32 j = from; - const ndInt32 size = m_size - str2Size; - while (j <= size) - { - const char* const ptr1 = &m_string[j]; - ndInt32 i = str2Size - 1; - while ((i >= 0) && (ptr1[i] == subString[i])) - { - i --; - } - if (i < 0) - { - return j; - } - j += ndMax(i - frequency[ndInt32 (ptr1[i])], 1); - } - } - } - return location; -} - - -void ndString::Replace (ndInt32 start, ndInt32 size, const char* const str, ndInt32 strSize) -{ - char* const oldData = m_string; - m_string = AllocMem (m_size - size + strSize + 1); - memcpy (m_string, oldData, size_t(start)); - memcpy (&m_string[start], str, size_t(strSize)); - memcpy (&m_string[start + strSize], &oldData[start + size], size_t(m_size - (start + size))); - m_size = m_size - size + strSize; - m_capacity = m_size + 1; - m_string[m_size] = 0; - FreeMem(oldData); -} - -void ndString::Expand (ndInt32 size) -{ - char* const oldData = m_string; - m_string = AllocMem (m_size + size + 1); - - if (m_capacity) - { - memcpy (m_string, oldData, size_t(m_size)); - FreeMem(oldData); - } - m_string[m_size] = 0; - m_capacity = m_size + size + 1; -} - -ndString::ndStringAllocator& ndString::GetAllocator() const -{ - static ndStringAllocator allocator; - return allocator; -} - -char* ndString::AllocMem(ndInt32 size) -{ - return GetAllocator().Alloc(size); -} - -void ndString::FreeMem (char* const ptr) -{ - if (ptr) - { - GetAllocator().Free(ptr); - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndString.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndString.h deleted file mode 100644 index a71cade2d0..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndString.h +++ /dev/null @@ -1,211 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - - -#ifndef __NDSTRING_H_ -#define __NDSTRING_H_ - -#include "ndCoreStdafx.h" -#include "ndClassAlloc.h" - -class ndString: public ndClassAlloc -{ - class ndStringAllocator; - public: - D_CORE_API ndString (); - D_CORE_API ndString (char chr); - D_CORE_API ndString (const ndString& src); - D_CORE_API ndString (const char* const data); - D_CORE_API ndString (const char* const data, ndInt32 maxSize); - D_CORE_API ndString (ndInt32 val); - D_CORE_API ndString (ndUnsigned64 val); - D_CORE_API ~ndString (); - - char& operator[] (ndInt32 index); - char operator[] (ndInt32 index) const; - - D_CORE_API ndString& operator= (const ndString& src); - bool operator== (const ndString& src) const; - bool operator!= (const ndString& src) const; - bool operator< (const ndString& src) const; - bool operator> (const ndString& src) const; - bool operator<= (const ndString& src) const; - bool operator>= (const ndString& src) const; - - D_CORE_API void operator+= (const char* const src); - void operator+= (const ndString& src); - - ndString operator+ (const char* const src) const; - ndString operator+ (const ndString& src) const; - - D_CORE_API ndInt32 Find (char ch, ndInt32 from = 0) const; - ndInt32 Find (const ndString& subString, ndInt32 from = 0) const; - D_CORE_API ndInt32 Find (const char* const subString, ndInt32 from = 0, ndInt32 lenght = 0x7ffffff) const; - - D_CORE_API void Replace (ndInt32 start, ndInt32 size, const char* const str, ndInt32 strSize); - void Replace (ndInt32 start, ndInt32 size, const ndString& str); - - void Clear(); - void Empty(); - - D_CORE_API void ToUpper(); - D_CORE_API void ToLower(); - D_CORE_API ndInt32 ToInteger() const; - D_CORE_API ndFloat64 ToFloat() const; - D_CORE_API ndUnsigned64 ToInteger64() const; - - ndInt32 Size() const; - ndInt32 Capacity() const; - D_CORE_API void Expand (ndInt32 size); - - D_CORE_API void LoadFile (FILE* const file); - ndString SubString(ndInt32 start = 0, ndInt32 size = 0x7fffffff) const; - - const char* GetStr () const; - - private: - D_CORE_API ndInt32 CalculateSize (const char* const data) const; - ndInt32 Compare (const char* const str0, const char* const str1) const; - void CopyData (char* const dst, const char* const src, ndInt32 size) const; - - D_CORE_API ndInt32 Find (const char* const subString, ndInt32 stringSize, ndInt32 from, ndInt32 lenght) const; - - protected: - char* AllocMem(ndInt32 size); - void FreeMem (char* const ptr); - D_CORE_API ndString (const ndString& src, const char* const concatenate, ndInt32 maxSize); - - char* m_string; - ndInt32 m_size; - ndInt32 m_capacity; - - private: - ndStringAllocator& GetAllocator() const; -}; - -inline char& ndString::operator[] (ndInt32 index) -{ - ndAssert (m_string); - ndAssert (index >= 0); - ndAssert (index < m_size); - return m_string[index]; -} - -inline char ndString::operator[] (ndInt32 index) const -{ - ndAssert (m_string); - ndAssert (index >= 0); - ndAssert (index < m_size); - return m_string[index]; -} - -inline const char* ndString::GetStr () const -{ - return m_string; -} - -inline ndInt32 ndString::Size() const -{ - return m_size; -} - -inline ndInt32 ndString::Find (const char* const subString, ndInt32 from, ndInt32 lenght) const -{ - return Find (subString, CalculateSize(subString), from, lenght); -} - -inline ndInt32 ndString::Find (const ndString& subStream, ndInt32 from) const -{ - ndAssert (subStream.m_string); - return Find (subStream.m_string, subStream.m_size, from, subStream.m_size); -} - -inline void ndString::Replace (ndInt32 start, ndInt32 size, const ndString& str) -{ - Replace(start, size, str.m_string, str.m_size); -} - -inline void ndString::operator+= (const ndString& src) -{ - *this += src.m_string; -} - -inline ndString ndString::operator+ (const ndString& src) const -{ - return ndString (*this, src.m_string, src.m_size); -} - -inline ndString ndString::operator+ (const char* const copy) const -{ - return ndString (*this, copy, CalculateSize (copy)); -} - -inline ndInt32 ndString::Capacity() const -{ - return m_capacity; -} - -inline void ndString::CopyData (char* const dst, const char* const src, ndInt32 size) const -{ - ndAssert (dst); - ndAssert (src); - memcpy (dst, src, size_t(size)); -} - -inline ndInt32 ndString::Compare (const char* const str0, const char* const str1) const -{ - ndAssert (str0); - ndAssert (str1); - return strcmp (str0, str1); -} - -inline bool ndString::operator== (const ndString& src) const -{ - return Compare (m_string, src.m_string) == 0; -} - -inline bool ndString::operator!= (const ndString& src) const -{ - return Compare (m_string, src.m_string) != 0; -} - - -inline bool ndString::operator< (const ndString& src) const -{ - return Compare (m_string, src.m_string) < 0; -} - -inline bool ndString::operator> (const ndString& src) const -{ - return Compare (m_string, src.m_string) > 0; -} - -inline bool ndString::operator<= (const ndString& src) const -{ - return Compare (m_string, src.m_string) <= 0; -} - -inline bool ndString::operator>= (const ndString& src) const -{ - return Compare (m_string, src.m_string) >= 0; -} - -inline ndString ndString::SubString(ndInt32 start, ndInt32 size) const -{ - ndAssert (m_string); - return ndString (&m_string[start], size); -} - - -#endif - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSyncMutex.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSyncMutex.cpp deleted file mode 100644 index 509fc04e93..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSyncMutex.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndSyncMutex.h" - -ndSyncMutex::ndSyncMutex() -#ifndef D_USE_THREAD_EMULATION - :m_mutex() - ,m_condition() - ,m_count(0) -#endif -{ -} - -ndSyncMutex::~ndSyncMutex() -{ -} - -void ndSyncMutex::Sync() -{ -#ifndef D_USE_THREAD_EMULATION - std::unique_lock lock(m_mutex); - while (m_count > 0) - { - m_condition.wait(lock); - } -#endif -} - -void ndSyncMutex::Release() -{ -#ifndef D_USE_THREAD_EMULATION - std::unique_lock lock(m_mutex); - m_count = (m_count >= 0) ? m_count - 1 : 0; - m_condition.notify_one(); -#endif -} - -void ndSyncMutex::Tick() -{ -#ifndef D_USE_THREAD_EMULATION - std::unique_lock lock(m_mutex); - m_count++; -#endif -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSyncMutex.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSyncMutex.h deleted file mode 100644 index ab02d21450..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndSyncMutex.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SYNC_MUTEX_H_ -#define __ND_SYNC_MUTEX_H_ - -#include "ndCoreStdafx.h" - -/// Generic counting mutex for synchronization of thread jobs -class ndSyncMutex -{ - public: - /// Create and initialize counter to zero - D_CORE_API ndSyncMutex(); - - /// Destroy mutex - D_CORE_API ~ndSyncMutex(); - - /// Synchronize with another worker threads. - /// \brief When internal variable m_counter larger than zero, this function blocks - /// the calling thread until another thread call member function Release. - /// \brief When counter is zero, this function return immediately. - D_CORE_API void Sync(); - - /// Increment internal variable m_count by one. - D_CORE_API void Tick(); - - /// Decrement internal variable m_count by one and signal the thread to wakeup. - D_CORE_API void Release(); - -#ifndef D_USE_THREAD_EMULATION - private: - std::mutex m_mutex; - std::condition_variable m_condition; - ndInt32 m_count; -#endif -}; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTemplateVector.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTemplateVector.h deleted file mode 100644 index 6ae0b9b083..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTemplateVector.h +++ /dev/null @@ -1,210 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_TEMPLATE_VECTOR_H__ -#define __ND_TEMPLATE_VECTOR_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndClassAlloc.h" - -template -class ndTemplateVector: public ndClassAlloc -{ - public: - ndTemplateVector () - { - } - - ndTemplateVector (const T* const ptr) - :m_x(ptr[0]), m_y(ptr[1]), m_z(ptr[2]), m_w (ptr[3]) - { - //ndAssert (dCheckVector ((*this))); - } - - ndTemplateVector (const ndTemplateVector& copy) - :m_x(copy.m_x), m_y(copy.m_y), m_z(copy.m_z), m_w (copy.m_w) - { - // ndAssert (dCheckVector ((*this))); - } - - ndTemplateVector (T x, T y, T z, T w) - :m_x(x), m_y(y), m_z(z), m_w (w) - { - } - - T& operator[] (ndInt32 i) - { - ndAssert (i < 4); - ndAssert (i >= 0); - return (&m_x)[i]; - } - - const T& operator[] (ndInt32 i) const - { - ndAssert (i < 4); - ndAssert (i >= 0); - return (&m_x)[i]; - } - - T GetScalar() const - { - return m_x; - } - - ndTemplateVector Scale (T scale) const - { - return ndTemplateVector (m_x * scale, m_y * scale, m_z * scale, m_w * scale); - } - - ndTemplateVector operator+ (const ndTemplateVector& B) const - { - return ndTemplateVector (m_x + B.m_x, m_y + B.m_y, m_z + B.m_z, m_w + B.m_w); - } - - ndTemplateVector& operator+= (const ndTemplateVector& A) - { - return (*this = ndTemplateVector (m_x + A.m_x, m_y + A.m_y, m_z + A.m_z, m_w + A.m_w)); - } - - ndTemplateVector operator- (const ndTemplateVector& A) const - { - return ndTemplateVector (m_x - A.m_x, m_y - A.m_y, m_z - A.m_z, m_w - A.m_w); - } - - ndTemplateVector& operator-= (const ndTemplateVector& A) - { - return (*this = ndTemplateVector (m_x - A.m_x, m_y - A.m_y, m_z - A.m_z, m_w - A.m_w)); - } - - ndTemplateVector operator* (const ndTemplateVector& B) const - { - return ndTemplateVector(m_x * B.m_x, m_y * B.m_y, m_z * B.m_z, m_w * B.m_w); - } - - ndTemplateVector operator*= (const ndTemplateVector& B) const - { - return (*this = ndTemplateVector(m_x * B.m_x, m_y * B.m_y, m_z * B.m_z, m_w * B.m_w)); - } - - ndTemplateVector AddHorizontal() const - { - T val(m_x + m_y + m_z + m_w); - return ndTemplateVector(val, val, val, val); - } - - ndTemplateVector MulAdd(const ndTemplateVector& A, const ndTemplateVector& B) const - { - return *this + A * B; - } - - ndTemplateVector MulSub(const ndTemplateVector& A, const ndTemplateVector& B) const - { - return *this - A * B; - } - - // return cross product - ndTemplateVector CrossProduct (const ndTemplateVector& B) const - { - return ndTemplateVector (m_y * B.m_z - m_z * B.m_y, - m_z * B.m_x - m_x * B.m_z, - m_x * B.m_y - m_y * B.m_x, m_w); - } - - ndTemplateVector CrossProduct(const ndTemplateVector &A, const ndTemplateVector &B) const - { - T cofactor[3][3]; - T array[4][4]; - - const ndTemplateVector& me = *this; - for (ndInt32 i = 0; i < 4; ++i) { - array[0][i] = me[i]; - array[1][i] = A[i]; - array[2][i] = B[i]; - array[3][i] = T(1.0f); - } - - ndTemplateVector normal; - T sign = T(-1.0f); - for (ndInt32 i = 0; i < 4; ++i) - { - for (ndInt32 j = 0; j < 3; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 4; ++k) - { - if (k != i) - { - cofactor[j][k0] = array[j][k]; - k0++; - } - } - } - T x = cofactor[0][0] * (cofactor[1][1] * cofactor[2][2] - cofactor[1][2] * cofactor[2][1]); - T y = cofactor[0][1] * (cofactor[1][2] * cofactor[2][0] - cofactor[1][0] * cofactor[2][2]); - T z = cofactor[0][2] * (cofactor[1][0] * cofactor[2][1] - cofactor[1][1] * cofactor[2][0]); - T det = x + y + z; - - normal[i] = sign * det; - sign *= T(-1.0f); - } - - return normal; - } - - // return dot 4d dot product - ndTemplateVector DotProduct (const ndTemplateVector &A) const - { - T val (m_x * A.m_x + m_y * A.m_y + m_z * A.m_z + m_w * A.m_w); - return ndTemplateVector (val, val, val, val); - } - - - T GetMax () const - { - return ndMax(ndMax(m_x, m_y), ndMax(m_z, m_w)); - } - - ndTemplateVector GetMax(const ndTemplateVector& data) const - { - return ndTemplateVector((m_x > data.m_x) ? m_x : data.m_x, (m_y > data.m_y) ? m_y : data.m_y, (m_z > data.m_z) ? m_z : data.m_z, (m_w > data.m_w) ? m_w : data.m_w); - } - - ndTemplateVector GetMin(const ndTemplateVector& data) const - { - return ndTemplateVector((m_x < data.m_x) ? m_x : data.m_x, (m_y < data.m_y) ? m_y : data.m_y, (m_z < data.m_z) ? m_z : data.m_z, (m_w < data.m_w) ? m_w : data.m_w); - } - - // check validity of floats -#ifdef _DEBUG - void Trace (char* const name) const - { - ndTrace (("%s %f %f %f %f\n", name, m_x, m_y, m_z, m_w)); - } -#endif - - T m_x; - T m_y; - T m_z; - T m_w; -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThread.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThread.cpp deleted file mode 100644 index 90ed728d01..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThread.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndThread.h" -#include "ndProfiler.h" -#include "ndThreadSyncUtils.h" - -#ifdef _MSC_VER -#pragma warning( push ) -#pragma warning( disable : 4355) -#endif - -ndThread::ndThread() - :ndClassAlloc() - ,ndThreadName() - ,ndSemaphore() -#ifndef D_USE_THREAD_EMULATION - ,ndAtomic(true) - ,std::condition_variable() - ,std::thread(&ndThread::ThreadFunctionCallback, this) -#endif -{ - strcpy (m_name, "newtonWorker"); -#ifndef D_USE_THREAD_EMULATION - store(false); -#endif -} - -#ifdef _MSC_VER -#pragma warning( pop ) -#endif - -ndThread::~ndThread() -{ -} - -void ndThread::SetName(const char* const name) -{ - strncpy(m_name, name, sizeof(m_name) - 1); -#if defined(_MSC_VER) && !defined (D_USE_THREAD_EMULATION) - // a hideous way to set the thread name, bu this is how Microsoft does it - const DWORD MS_VC_EXCEPTION = 0x406D1388; - #pragma pack(push,8) - struct THREADNAME_INFO - { - DWORD dwType; // Must be 0x1000. - LPCSTR szName; // Pointer to name (in user addr space). - DWORD dwThreadID; // Thread ID (-1=caller thread). - DWORD dwFlags; // Reserved for future use, must be zero. - }; - #pragma pack(pop) - - THREADNAME_INFO info; - info.dwType = 0x1000; - info.szName = name; - info.dwThreadID = GetThreadId(std::thread::native_handle()); - info.dwFlags = 0; - __try - { - RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info); - } - __except (EXCEPTION_EXECUTE_HANDLER) - { - } -#endif - - D_SET_TRACK_NAME(m_name); -} - -void ndThread::Finish() -{ -#ifndef D_USE_THREAD_EMULATION - Terminate(); - join(); -#endif -} - -void ndThread::Signal() -{ -#ifndef D_USE_THREAD_EMULATION - ndSemaphore::Signal(); -#endif -} - -void ndThread::ThreadFunctionCallback() -{ -#ifndef D_USE_THREAD_EMULATION - // wait until constructor was fully initialized. - while (load()) - { - ndThreadYield(); - } - - D_SET_TRACK_NAME(m_name); - ndFloatExceptions exception; - - while (!Wait()) - { - ThreadFunction(); - Release(); - } -#endif -} - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThread.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThread.h deleted file mode 100644 index 61c1fc463e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThread.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_THREAD_H_ -#define __ND_THREAD_H_ - -#include "ndCoreStdafx.h" -#include "ndSemaphore.h" -#include "ndClassAlloc.h" - -class ndThreadName -{ - public: - ndThreadName() - { - strcpy_s(m_name, sizeof(m_name), "newtonWorker"); - } - char m_name[32]; -}; - -/// Base class for for all multi thread functionality. -class ndThread - :public ndClassAlloc - ,public ndThreadName - ,public ndSemaphore -#ifndef D_USE_THREAD_EMULATION - ,public ndAtomic - ,public std::condition_variable - ,public std::thread -#endif -{ - public: - /// Empty default constructor - /// after creation all threads go to a wait state - D_CORE_API ndThread(); - - /// Empty, does not terminate the thread loop. - /// The thread loop is only terminated after calling Finish. - D_CORE_API virtual ~ndThread(); - - /// Set thread name. - /// Useful for when debugging or profiler and application. - D_CORE_API void SetName(const char* const name); - - /// Set the thread, to execute one call to and go back to a wait state - D_CORE_API void Signal(); - - /// Force the thread loop to terminate. - /// This function must be call explicitly when the application - /// wants to terminate the thread because the destructor does not do it. - D_CORE_API void Finish(); - - /// Thread function to execute in a perpetual loop until the thread is terminated. - /// Each time the thread owner calls function Signal, the loop execute one call to - /// this function and upon return, the thread goes back to wait for another signal - /// or to exit the loop. - virtual void ThreadFunction() = 0; - - protected: - virtual void Release(){} - - private: - void ThreadFunctionCallback(); -}; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadBackgroundWorker.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadBackgroundWorker.cpp deleted file mode 100644 index 6474f3e0b2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadBackgroundWorker.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndProfiler.h" -#include "ndThreadBackgroundWorker.h" - -//#define D_EXECUTE_IMMEDIATE - -ndThreadBackgroundWorker::ndThreadBackgroundWorker() - :ndThreadPool("backgroundWorkers") - ,ndList>() - ,m_lock() - ,m_inLoop(false) - ,m_teminate(false) - ,m_queueSemaphore() -{ - Signal(); -} - -ndThreadBackgroundWorker::~ndThreadBackgroundWorker() -{ - m_queueSemaphore.Terminate(); - Finish(); -} - -void ndThreadBackgroundWorker::Terminate() -{ - if (m_inLoop) - { - m_teminate = true; - m_queueSemaphore.Terminate(); - while (m_inLoop) - { - ndThreadYield(); - } - } -} - -void ndBackgroundTask::Sync() const -{ - while (m_taskState == m_taskInProccess) - { - ndThreadYield(); - } -} - -void ndThreadBackgroundWorker::SendTask(ndBackgroundTask* const task) -{ - #if defined (D_EXECUTE_IMMEDIATE) || defined (D_USE_THREAD_EMULATION) - { - task->m_taskState = ndBackgroundTask::m_taskInProccess; - task->Execute(this); - task->m_taskState = ndBackgroundTask::m_taskCompleted; - } - #else - { - ndScopeSpinLock lock(m_lock); - task->m_taskState.store(ndBackgroundTask::m_taskInProccess); - Append(task); - } - m_queueSemaphore.Signal(); - #endif -} - -void ndThreadBackgroundWorker::ThreadFunction() -{ - m_inLoop.store(true); - while (!m_queueSemaphore.Wait() && !m_teminate) - { - ndBackgroundTask* task; - { - ndScopeSpinLock lock(m_lock); - ndNode* const node = GetFirst(); - task = node->GetInfo(); - Remove(node); - } - Begin(); - task->Execute(this); - End(); - task->m_taskState.store(ndBackgroundTask::m_taskCompleted); - } - m_inLoop.store(false); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadBackgroundWorker.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadBackgroundWorker.h deleted file mode 100644 index d71eed0310..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadBackgroundWorker.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_THREAD_BACKGROUNG_WORKER_H_ -#define __ND_THREAD_BACKGROUNG_WORKER_H_ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndList.h" -#include "ndSemaphore.h" -#include "ndClassAlloc.h" -#include "ndThreadPool.h" -#include "ndThreadSyncUtils.h" - -class ndThreadBackgroundWorker; - -class ndBackgroundTask -{ - public: - enum ndTaskState - { - m_taskInProccess, - m_taskCompleted, - }; - - ndBackgroundTask() - :m_taskState(m_taskCompleted) - { - } - - virtual ~ndBackgroundTask() {} - - ndTaskState TaskState() const - { - return m_taskState.load(); - } - - D_CORE_API void Sync() const; - - protected: - virtual void Execute(ndThreadPool* const threadPool) = 0; - - private: - ndAtomic m_taskState; - friend class ndThreadBackgroundWorker; -}; - -class ndThreadBackgroundWorker: public ndThreadPool, public ndList> -{ - public: - D_CORE_API ndThreadBackgroundWorker(); - D_CORE_API ~ndThreadBackgroundWorker(); - - D_CORE_API void Terminate(); - D_CORE_API void SendTask(ndBackgroundTask* const job); - - private: - virtual void ThreadFunction(); - - ndSpinLock m_lock; - ndAtomic m_inLoop; - ndAtomic m_teminate; - ndSemaphore m_queueSemaphore; -}; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadPool.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadPool.cpp deleted file mode 100644 index 0473e38c00..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadPool.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndProfiler.h" -#include "ndThreadPool.h" -#include "ndThreadSyncUtils.h" - -ndThreadPool::ndWorker::ndWorker() - :ndThread() - ,m_owner(nullptr) - ,m_task(nullptr) - ,m_threadIndex(0) -#ifdef D_USE_SYNC_SEMAPHORE - ,m_taskReady() -#else - ,m_taskReady(0) -#endif - ,m_begin(0) - ,m_stillLooping(0) -{ -} - -ndThreadPool::ndWorker::~ndWorker() -{ - Finish(); -} - -ndUnsigned8 ndThreadPool::ndWorker::IsTaskInProgress() const -{ - #ifdef D_USE_SYNC_SEMAPHORE - return ndUnsigned8 (m_task ? 1 : 0); - #else - return m_taskReady; - #endif -} - -void ndThreadPool::ndWorker::ExecuteTask(ndTask* const task) -{ - m_task = task; -#ifdef D_USE_SYNC_SEMAPHORE - m_taskReady.Signal(); -#else - m_taskReady = 1; -#endif -} - -void ndThreadPool::ndWorker::ThreadFunction() -{ -#ifndef D_USE_THREAD_EMULATION - m_stillLooping = 1; - -#ifdef D_USE_SYNC_SEMAPHORE - while (!m_taskReady.Wait() && m_task) - { - //D_TRACKTIME(); - m_task->Execute(); - m_task = nullptr; - } -#else - m_begin = 1; - ndInt32 iterations = 0; - while (m_begin) - { - if (m_taskReady) - { - //D_TRACKTIME(); - if (m_task) - { - m_task->Execute(); - } - iterations = 0; - m_taskReady = 0; - } - else - { - if (iterations == 32) - { - ndThreadYield(); - } - else - { - ndThreadPause(); - } - iterations++; - } - } -#endif - m_stillLooping = 0; -#endif -} - -ndThreadPool::ndThreadPool(const char* const baseName) - :ndSyncMutex() - ,ndThread() - ,m_workers(nullptr) - ,m_count(0) -{ - char name[256]; - strncpy(m_baseName, baseName, sizeof (m_baseName)); - snprintf(name, sizeof (name), "%s_%d", m_baseName, 0); - SetName(name); -} - -ndThreadPool::~ndThreadPool() -{ - SetThreadCount(0); -} - -ndInt32 ndThreadPool::GetMaxThreads() -{ - #ifdef D_USE_THREAD_EMULATION - return D_MAX_THREADS_COUNT; - #else - return ndClamp(ndInt32(std::thread::hardware_concurrency() + 1) / 2, 1, D_MAX_THREADS_COUNT); - #endif -} - -void ndThreadPool::SetThreadCount(ndInt32 count) -{ -#ifdef D_USE_THREAD_EMULATION - m_count = ndClamp(count, 1, D_MAX_THREADS_COUNT) - 1; -#else - ndInt32 maxThread = GetMaxThreads(); - count = ndClamp(count, 1, maxThread) - 1; - if (count != m_count) - { - if (m_workers) - { - m_count = 0; - delete[] m_workers; - m_workers = nullptr; - } - if (count) - { - m_count = count; - m_workers = new ndWorker[size_t(count)]; - for (ndInt32 i = 0; i < count; ++i) - { - char name[256]; - m_workers[i].m_owner = this; - m_workers[i].m_threadIndex = i; - snprintf(name, sizeof(name), "%s_%d", m_baseName, i + 1); - m_workers[i].SetName(name); - } - } - } -#endif -} - -void ndThreadPool::Begin() -{ - D_TRACKTIME(); - for (ndInt32 i = 0; i < m_count; ++i) - { - m_workers[i].Signal(); - } - - auto BeginJobs = ndMakeObject::ndFunction([this](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(BeginJobs); - }); - ParallelExecute(BeginJobs); -} - -void ndThreadPool::End() -{ - #ifndef D_USE_THREAD_EMULATION - for (ndInt32 i = 0; i < m_count; ++i) - { - m_workers[i].ExecuteTask(nullptr); - #if !defined(D_USE_SYNC_SEMAPHORE) - m_workers[i].m_begin = 0; - #endif - } - - ndUnsigned8 stillLooping = 1; - do - { - ndUnsigned8 looping = 0; - for (ndInt32 i = 0; i < m_count; ++i) - { - looping = ndUnsigned8(looping | m_workers[i].m_stillLooping); - } - stillLooping = ndUnsigned8(stillLooping & looping); - if (m_count) - { - ndThreadYield(); - } - } while (stillLooping); - #endif -} - -void ndThreadPool::Release() -{ - ndSyncMutex::Release(); -} - -void ndThreadPool::TickOne() -{ - ndSyncMutex::Tick(); - ndSemaphore::Signal(); -#ifdef D_USE_THREAD_EMULATION - ThreadFunction(); -#endif -} - -void ndThreadPool::WaitForWorkers() -{ - ndInt32 iterations = 0; - ndUnsigned8 jobsInProgress = 1; - do - { - ndUnsigned8 inProgess = 0; - for (ndInt32 i = 0; i < m_count; ++i) - { - inProgess = ndUnsigned8(inProgess | (m_workers[i].IsTaskInProgress())); - } - jobsInProgress = ndUnsigned8 (jobsInProgress & inProgess); - if (jobsInProgress) - { - if ((iterations & -32) == -32) - { - ndThreadYield(); - } - else - { - ndThreadPause(); - } - iterations++; - } - } while (jobsInProgress); - //if (iterations > 10000) - //{ - // ndExpandTraceMessage("xxx %d\n", iterations); - //} -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadPool.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadPool.h deleted file mode 100644 index 1578e765e8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadPool.h +++ /dev/null @@ -1,224 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_THREAD_POOL_H_ -#define __ND_THREAD_POOL_H_ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndArray.h" -#include "ndThread.h" -#include "ndSyncMutex.h" -#include "ndSemaphore.h" -#include "ndClassAlloc.h" - -//#define D_USE_SYNC_SEMAPHORE - -//#define D_MAX_THREADS_COUNT 16 -#define D_MAX_THREADS_COUNT 32 -#define D_WORKER_BATCH_SIZE 32 - -class ndThreadPool; - -class ndStartEnd -{ - public: - ndStartEnd(ndInt32 count, ndInt32 threadIndex, ndInt32 threads) - { - ndInt32 stride = count / threads; - ndInt32 residual = count - stride * threads; - m_start = stride * threadIndex; - stride += (threadIndex < residual) ? 1 : 0; - m_start += (threadIndex < residual) ? threadIndex : residual; - m_end = m_start + stride; - } - - ndInt32 m_start; - ndInt32 m_end; -}; - -class ndTask -{ - public: - ndTask(){} - virtual ~ndTask(){} - virtual void Execute() const = 0; -}; - -class ndThreadPool: public ndSyncMutex, public ndThread -{ - class ndWorker: public ndThread - { - public: - D_CORE_API ndWorker(); - D_CORE_API virtual ~ndWorker(); - - D_CORE_API ndUnsigned8 IsTaskInProgress() const; - D_CORE_API void ExecuteTask(ndTask* const task); - - private: - virtual void ThreadFunction(); - - ndThreadPool* m_owner; - ndTask* m_task; - ndInt32 m_threadIndex; - #ifdef D_USE_SYNC_SEMAPHORE - ndSemaphore m_taskReady; - //std::binary_semaphore m_taskReady; - #else - ndUnsigned8 m_taskReady; - #endif - ndUnsigned8 m_begin; - ndUnsigned8 m_stillLooping; - friend class ndThreadPool; - }; - - public: - D_CORE_API ndThreadPool(const char* const baseName); - D_CORE_API virtual ~ndThreadPool(); - - ndInt32 GetThreadCount() const; - D_CORE_API static ndInt32 GetMaxThreads(); - D_CORE_API void SetThreadCount(ndInt32 count); - - D_CORE_API void TickOne(); - D_CORE_API void Begin(); - D_CORE_API void End(); - - template - void ParallelExecute(const Function& ndFunction); - - private: - D_CORE_API virtual void Release(); - D_CORE_API virtual void WaitForWorkers(); - - ndWorker* m_workers; - ndInt32 m_count; - char m_baseName[32]; -}; - -inline ndInt32 ndThreadPool::GetThreadCount() const -{ - return m_count + 1; -} - -template -class ndFunction - :public ndFunction -{ -}; - -template -class ndFunction -{ - public: - ndFunction(const Type& obj) - :m_object(obj) - { - } - - void operator()(ndInt32 threadIndex, ndInt32 threadCount) const - { - m_object.operator()(threadIndex, threadCount); - } - - private: - Type m_object; -}; - -namespace ndMakeObject -{ - template auto ndFunction(const Type & obj) -> decltype (::ndFunction(obj)) - { - return ::ndFunction(obj); - } -} - -template -class ndTaskImplement : public ndTask -{ - public: - ndTaskImplement(ndInt32 threadIndex, ndThreadPool* const threadPool, const Function& ndFunction) - :ndTask() - ,m_function(ndFunction) - ,m_threadPool(threadPool) - ,m_threadIndex(threadIndex) - ,m_threadCount(threadPool->GetThreadCount()) - { - } - - ~ndTaskImplement() - { - } - - private: - void Execute() const - { - m_function(m_threadIndex, m_threadCount); - } - - Function m_function; - ndThreadPool* m_threadPool; - const ndInt32 m_threadIndex; - const ndInt32 m_threadCount; - friend class ndThreadPool; -}; - -template -void ndThreadPool::ParallelExecute(const Function& callback) -{ - const ndInt32 threadCount = GetThreadCount(); - ndTaskImplement* const jobsArray = ndAlloca(ndTaskImplement, threadCount); - - for (ndInt32 i = 0; i < threadCount; ++i) - { - ndTaskImplement* const job = &jobsArray[i]; - new (job) ndTaskImplement(i, this, callback); - } - - if (m_count > 0) - { - #ifdef D_USE_THREAD_EMULATION - for (ndInt32 i = 0; i < threadCount; ++i) - { - ndTaskImplement* const job = &jobsArray[i]; - callback(job->m_threadIndex, job->m_threadCount); - } - #else - for (ndInt32 i = 0; i < m_count; ++i) - { - ndTaskImplement* const job = &jobsArray[i + 1]; - m_workers[i].ExecuteTask(job); - } - - ndTaskImplement* const job = &jobsArray[0]; - callback(job->m_threadIndex, job->m_threadCount); - WaitForWorkers(); - #endif - } - else - { - ndTaskImplement* const job = &jobsArray[0]; - callback(job->m_threadIndex, job->m_threadCount); - } -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadSyncUtils.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadSyncUtils.cpp deleted file mode 100644 index 5d1ffa01dd..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadSyncUtils.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndThreadSyncUtils.h" - -#ifndef D_USE_THREAD_EMULATION -void ndSpinLock::Delay(ndInt32& exp) -{ - #if defined (__x86_64) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) - // adding exponential pause delay - for (ndInt32 i = 0; i < exp; ++i) - { - _mm_pause(); - _mm_pause(); - _mm_pause(); - _mm_pause(); - } - #else - ndInt32 x = 0; - volatile ndInt32 count = 1; - for (ndInt32 i = 0; i < exp * 2; ++i) - { - x += count; - } - #endif - exp = ndMin(exp * 2, 64); -} -#endif - -void ndThreadYield() -{ - std::this_thread::yield(); -} - -void ndThreadPause() -{ - //#if 0 - #if defined (__x86_64) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) - for (ndInt32 i = 0; i < 4; ++i) - { - _mm_pause(); - _mm_pause(); - _mm_pause(); - _mm_pause(); - } - #else - std::this_thread::yield(); - #endif -} - -ndFloatExceptions::ndFloatExceptions(ndUnsigned32 mask) -{ - #if defined (_MSC_VER) - _clearfp(); - m_floatMask = _controlfp(0, 0); - _controlfp(m_floatMask & ~mask, _MCW_EM); - #endif - - #if (defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)) - m_simdMask = _mm_getcsr(); - _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); - _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); - #endif - - #if defined (__APPLE__) - //#pragma message ("warning!!! apple flush to zero not defined for x86 platforms") - #endif - - //ndFloat32 a = ndFloat32(1.0f); - //ndFloat32 b = ndFloat32(0.1f); - //ndFloat32 c = ndFloat32(0.0f); - //ndInt32 count = 0; - //while (a != 0.0f) - //{ - // a = a * b; - // count++; - //} - //count++; -} - -ndFloatExceptions::~ndFloatExceptions() -{ - #if (defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)) - _mm_setcsr(m_simdMask); - #endif - - //#if (defined (WIN32) || defined(_WIN32)) - #if defined (_MSC_VER) - _clearfp(); - _controlfp(m_floatMask, _MCW_EM); - #endif -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadSyncUtils.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadSyncUtils.h deleted file mode 100644 index 85b59ae130..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndThreadSyncUtils.h +++ /dev/null @@ -1,292 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_TRHEAD_SYNC_UTILS_H__ -#define __ND_TRHEAD_SYNC_UTILS_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" - -/// tell the operating system the library is done with this job, -/// the OS is free to switch to another task if it needs to. -D_CORE_API void ndThreadYield(); - -/// in some systems, thread yield could be too expensive -/// since it could task switch to another thread. -D_CORE_API void ndThreadPause(); - -/// Set cpu floating point exceptions, the original exception state is restored when the destructor is called. -class ndFloatExceptions -{ - public: - //#if defined (WIN32) || defined(_WIN32) - #if defined (_MSC_VER) - #define D_FLOAT_EXCEPTIONS_MASK (_EM_ZERODIVIDE | _EM_INVALID | _EM_DENORMAL) - #else - #define D_FLOAT_EXCEPTIONS_MASK (FE_DIVBYZERO | FE_INVALID | FE_INEXACT) - #endif - - D_CORE_API ndFloatExceptions(ndUnsigned32 mask = D_FLOAT_EXCEPTIONS_MASK); - D_CORE_API ~ndFloatExceptions(); - - private: - ndUnsigned32 m_floatMask; - ndUnsigned32 m_simdMask; -}; - -#ifdef D_USE_THREAD_EMULATION - /// wrapper over standard atomic operations - template - class ndAtomic - { - public: - ndAtomic() - :m_val(T(0)) - { - } - - ndAtomic(T val) - :m_val(val) - { - } - - operator T() const - { - return m_val; - } - - T operator++(int) - { - return fetch_add(1); - } - - T load() const - { - return m_val; - } - - void store(T val) - { - m_val = val; - } - - T exchange(T val) - { - ndSwap(val, m_val); - return val; - } - - T fetch_add(T val) - { - T ret = m_val; - m_val += val; - return ret; - } - - T fetch_sub(T val) - { - T ret = m_val; - m_val -= val; - return ret; - } - - bool compare_exchange_weak(T oldValue, T newValue) - { - if (m_val == oldValue) - { - m_val = newValue; - return true; - } - return false; - } - - private: - T m_val; - }; -#else - /// wrapper over standard atomic operations - template - class ndAtomic : public std::atomic - { - public: - using std::atomic::atomic; - using std::atomic::operator=; - }; -#endif - -/// Simple spin lock for synchronizing threads for very short period of time. -class ndSpinLock -{ - public: - ndSpinLock() - #ifndef D_USE_THREAD_EMULATION - :m_lock(0) - #endif - { - } - - #ifndef D_USE_THREAD_EMULATION - ndSpinLock(ndSpinLock const& other) - :m_lock(other.m_lock.load()) - #else - ndSpinLock(ndSpinLock const&) - #endif - { - } - - void Lock() - { - #ifndef D_USE_THREAD_EMULATION - ndInt32 exp = 1; - for (ndUnsigned32 test = 0; !m_lock.compare_exchange_weak(test, 1); test = 0) - { - Delay(exp); - } - #endif - } - - void Unlock() - { - #ifndef D_USE_THREAD_EMULATION - m_lock.store(0); - #endif - } - - #ifndef D_USE_THREAD_EMULATION - private: - D_CORE_API void Delay(ndInt32& exp); - ndAtomic m_lock; - #endif -}; - -/// Simple scope based spin lock. -class ndScopeSpinLock -{ - public: - ndScopeSpinLock(ndSpinLock& spinLock) - :m_spinLock(spinLock) - { - m_spinLock.Lock(); - } - - ~ndScopeSpinLock() - { - m_spinLock.Unlock(); - } - private: - ndSpinLock& m_spinLock; -}; - -class ndReadWriteSpinLock -{ - public: - ndReadWriteSpinLock() - :m_readLock() - ,m_writeLock() - ,m_writeActive(0) - { - } - - ndReadWriteSpinLock(const ndReadWriteSpinLock& other) - :m_readLock(other.m_readLock) - ,m_writeLock(other.m_writeLock) - ,m_writeActive(other.m_writeActive) - { - } - - void ReadLock() - { - m_readLock.Lock(); - ndAssert(m_writeActive >= 0); - m_writeActive++; - if (m_writeActive == 1) - { - m_writeLock.Lock(); - } - m_readLock.Unlock(); - } - - void ReadUnlock() - { - m_readLock.Lock(); - m_writeActive--; - ndAssert(m_writeActive >= 0); - if (m_writeActive == 0) - { - m_writeLock.Unlock(); - } - m_readLock.Unlock(); - } - - void WriteLock() - { - m_writeLock.Lock(); - } - - void WriteUnlock() - { - m_writeLock.Unlock(); - } - - private: - ndSpinLock m_readLock; - ndSpinLock m_writeLock; - ndInt32 m_writeActive; -}; - -/// Simple scope based spin lock. -class ndScopeReadSpinLock -{ - public: - ndScopeReadSpinLock(ndReadWriteSpinLock& spinLock) - :m_spinLock(spinLock) - { - m_spinLock.ReadLock(); - } - - ~ndScopeReadSpinLock() - { - m_spinLock.ReadUnlock(); - } - private: - ndReadWriteSpinLock& m_spinLock; -}; - -/// Simple scope based spin lock. -class ndScopeWriteSpinLock -{ - public: - ndScopeWriteSpinLock(ndReadWriteSpinLock& spinLock) - :m_spinLock(spinLock) - { - m_spinLock.WriteLock(); - } - - ~ndScopeWriteSpinLock() - { - m_spinLock.WriteUnlock(); - } - private: - ndReadWriteSpinLock& m_spinLock; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTree.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTree.cpp deleted file mode 100644 index 4694aaf642..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTree.cpp +++ /dev/null @@ -1,483 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTree.h" -#include "ndTypes.h" - -ndRedBackNode *ndRedBackNode::Minimum () const -{ - ndRedBackNode* ptr = (ndRedBackNode *)this; - for (; ptr->m_left; ptr = ptr->m_left) - { - } - return ptr; -} - -ndRedBackNode *ndRedBackNode::Maximum () const -{ - ndRedBackNode* ptr = (ndRedBackNode *)this; - for (; ptr->m_right; ptr = ptr->m_right) - { - } - return ptr; -} - -ndRedBackNode *ndRedBackNode::Prev () const -{ - if (m_left) - { - return m_left->Maximum (); - } - - ndRedBackNode* node = (ndRedBackNode *)this; - ndRedBackNode* ptr = m_parent; - for (; ptr && node == ptr->m_left; ptr = ptr->m_parent) - { - node = ptr; - } - return ptr; -} - -ndRedBackNode *ndRedBackNode::Next () const -{ - if (m_right) - { - return m_right->Minimum (); - } - - ndRedBackNode* node = (ndRedBackNode *)this; - ndRedBackNode* ptr = m_parent; - for (; ptr && node == ptr->m_right; ptr = ptr->m_parent) - { - node = ptr; - } - return ptr; -} - -// rotate node me to left -void ndRedBackNode::RotateLeft(ndRedBackNode** const head) -{ - ndRedBackNode* const me = this; - ndRedBackNode* const child = me->m_right; - - //establish me->m_right link - me->m_right = child->m_left; - if (child->m_left != nullptr) - { - child->m_left->m_parent = me; - } - - // establish child->m_parent link - if (child != nullptr) - { - child->m_parent = me->m_parent; - } - if (me->m_parent) - { - if (me == me->m_parent->m_left) - { - me->m_parent->m_left = child; - } - else - { - me->m_parent->m_right = child; - } - } - else - { - *head = child; - } - - // link child and me - ndAssert (child); - child->m_left = me; - if (me != nullptr) - { - me->m_parent = child; - } -} - -// rotate node me to right * -void ndRedBackNode::RotateRight(ndRedBackNode ** const head) -{ - ndRedBackNode* const me = this; - ndRedBackNode* const child = me->m_left; - - // establish me->m_left link - me->m_left = child->m_right; - if (child->m_right != nullptr) - { - child->m_right->m_parent = me; - } - - // establish child->m_parent link - if (child != nullptr) - { - child->m_parent = me->m_parent; - } - if (me->m_parent) - { - if (me == me->m_parent->m_right) - { - me->m_parent->m_right = child; - } - else - { - me->m_parent->m_left = child; - } - } - else - { - *head = child; - } - - // link me and child - ndAssert (child); - child->m_right = me; - if (me != nullptr) - { - me->m_parent = child; - } -} - -// maintain Red-Black tree balance after inserting node ptr -void ndRedBackNode::InsertFixup(ndRedBackNode ** const head) -{ - ndRedBackNode* ptr = this; - // check Red-Black properties - while ((ptr != *head) && (ptr->m_parent->GetColor() == RED)) - { - // we have a violation - ndAssert (ptr->m_parent); - ndAssert (ptr->m_parent->m_parent); - if (ptr->m_parent == ptr->m_parent->m_parent->m_left) - { - ndRedBackNode* const tmp = ptr->m_parent->m_parent->m_right; - if (tmp && (tmp->GetColor() == RED)) - { - // uncle is RED - ptr->m_parent->SetColor(BLACK); - tmp->SetColor(BLACK) ; - ptr->m_parent->m_parent->SetColor(RED) ; - ptr = ptr->m_parent->m_parent; - } - else - { - // uncle is BLACK - if (ptr == ptr->m_parent->m_right) - { - // make ptr a left child - ptr = ptr->m_parent; - ptr->RotateLeft(head); - } - - ptr->m_parent->SetColor(BLACK); - if (ptr->m_parent->m_parent) - { - ptr->m_parent->m_parent->SetColor(RED); - ptr->m_parent->m_parent->RotateRight(head); - } - } - } - else - { - ndAssert (ptr->m_parent == ptr->m_parent->m_parent->m_right); - // mirror image of above code - ndRedBackNode* const tmp = ptr->m_parent->m_parent->m_left; - if (tmp && (tmp->GetColor() == RED)) - { - //uncle is RED - ptr->m_parent->SetColor(BLACK); - tmp->SetColor(BLACK) ; - ptr->m_parent->m_parent->SetColor(RED) ; - ptr = ptr->m_parent->m_parent; - } - else - { - // uncle is BLACK - if (ptr == ptr->m_parent->m_left) - { - ptr = ptr->m_parent; - ptr->RotateRight(head); - } - ptr->m_parent->SetColor(BLACK); - if (ptr->m_parent->m_parent->GetColor() == BLACK) - { - ptr->m_parent->m_parent->SetColor(RED) ; - ptr->m_parent->m_parent->RotateLeft (head); - } - } - } - } - (*head)->SetColor(BLACK); -} - -//maintain Red-Black tree balance after deleting node x -void ndRedBackNode::RemoveFixup (ndRedBackNode* const thisNode, ndRedBackNode ** const head) -{ - ndRedBackNode* ptr = this; - ndRedBackNode* node = thisNode; - while ((node != *head) && (!node || node->GetColor() == BLACK)) - { - if (node == ptr->m_left) - { - if (!ptr) - { - return; - } - ndRedBackNode* tmp = ptr->m_right; - if (!tmp) - { - return; - } - if (tmp->GetColor() == RED) - { - tmp->SetColor(BLACK) ; - ptr->SetColor(RED) ; - ptr->RotateLeft (head); - tmp = ptr->m_right; - if (!tmp) - { - return; - } - } - if ((!tmp->m_left || (tmp->m_left->GetColor() == BLACK)) && - (!tmp->m_right || (tmp->m_right->GetColor() == BLACK))) - { - tmp->SetColor(RED); - node = ptr; - ptr = ptr->m_parent; - continue; - } - else if (!tmp->m_right || (tmp->m_right->GetColor() == BLACK)) - { - tmp->m_left->SetColor(BLACK); - tmp->SetColor(RED); - tmp->RotateRight (head); - tmp = ptr->m_right; - if (!tmp) - { - return; - } - } - tmp->SetColor (ptr->GetColor()); - if (tmp->m_right) - { - tmp->m_right->SetColor(BLACK) ; - } - if (ptr) - { - ptr->SetColor(BLACK) ; - ptr->RotateLeft (head); - } - node = *head; - } - else - { - if (!ptr) - { - return; - } - ndRedBackNode* tmp = ptr->m_left; - if (!tmp) - { - return; - } - if (tmp->GetColor() == RED) - { - tmp->SetColor(BLACK) ; - ptr->SetColor(RED) ; - ptr->RotateRight (head); - tmp = ptr->m_left; - if (!tmp) - { - return; - } - } - - if ((!tmp->m_right || (tmp->m_right->GetColor() == BLACK)) && - (!tmp->m_left || (tmp->m_left->GetColor() == BLACK))) - { - tmp->SetColor(RED) ; - node = ptr; - ptr = ptr->m_parent; - continue; - } - else if (!tmp->m_left || (tmp->m_left->GetColor() == BLACK)) - { - tmp->m_right->SetColor(BLACK) ; - tmp->SetColor(RED) ; - tmp->RotateLeft (head); - tmp = ptr->m_left; - if (!tmp) - { - return; - } - } - tmp->SetColor (ptr->GetColor()); - if (tmp->m_left) - { - tmp->m_left->SetColor(BLACK); - } - if (ptr) - { - ptr->SetColor(BLACK) ; - ptr->RotateRight (head); - } - node = *head; - } - } - if (node) - { - node->SetColor(BLACK); - } -} - -void ndRedBackNode::Unlink (ndRedBackNode ** const head) -{ - ndRedBackNode* const node = this; - node->SetInTreeFlag(false); - - if (!node->m_left || !node->m_right) - { - // y has a nullptr node as a child - ndRedBackNode* const endNode = node; - - // x is y's only child - ndRedBackNode* child = endNode->m_right; - if (endNode->m_left) - { - child = endNode->m_left; - } - - // remove y from the parent chain - if (child) - { - child->m_parent = endNode->m_parent; - } - - if (endNode->m_parent) - { - if (endNode == endNode->m_parent->m_left) - { - endNode->m_parent->m_left = child; - } - else - { - endNode->m_parent->m_right = child; - } - } - else - { - *head = child; - } - - if (endNode->GetColor() == BLACK) - { - endNode->m_parent->RemoveFixup (child, head); - } - } - else - { - // find tree successor with a nullptr node as a child - ndRedBackNode* endNode = node->m_right; - while (endNode->m_left != nullptr) - { - endNode = endNode->m_left; - } - - ndAssert (endNode); - ndAssert (endNode->m_parent); - ndAssert (!endNode->m_left); - - // x is y's only child - ndRedBackNode* const child = endNode->m_right; - - ndAssert ((endNode != node->m_right) || !child || (child->m_parent == endNode)); - - endNode->m_left = node->m_left; - node->m_left->m_parent = endNode; - - ndRedBackNode* endNodeParent = endNode; - if (endNode != node->m_right) - { - if (child) - { - child->m_parent = endNode->m_parent; - } - endNode->m_parent->m_left = child; - endNode->m_right = node->m_right; - node->m_right->m_parent = endNode; - endNodeParent = endNode->m_parent; - } - - if (node == *head) - { - *head = endNode; - } - else if (node == node->m_parent->m_left) - { - node->m_parent->m_left = endNode; - } - else - { - node->m_parent->m_right = endNode; - } - endNode->m_parent = node->m_parent; - - ndRedBackNode::REDBLACK_COLOR oldColor = endNode->GetColor(); - endNode->SetColor (node->GetColor()); - node->SetColor (oldColor); - - if (oldColor == BLACK) - { - endNodeParent->RemoveFixup (child, head); - } - } -} - -void ndRedBackNode::Remove (ndRedBackNode ** const head) -{ - Unlink (head); - delete this; -} - -void ndRedBackNode::RemoveAllLow () -{ - if (m_left) - { - m_left->RemoveAllLow(); - } - if (m_right) - { - m_right->RemoveAllLow (); - } - SetInTreeFlag(false); - delete this; -} - -void ndRedBackNode::RemoveAll () -{ - ndRedBackNode* root = this; - for (; root->m_parent; root = root->m_parent); - root->RemoveAllLow(); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTree.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTree.h deleted file mode 100644 index b5713b2c7b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTree.h +++ /dev/null @@ -1,943 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_TREE_H__ -#define __ND_TREE_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndMemory.h" -#include "ndClassAlloc.h" -#include "ndContainersAlloc.h" - -// Note: this is a low level class for ndTree use only -// unpredictable result will happen if you attempt to manipulate -// any member of this class -class ndRedBackNode -{ - public: - enum REDBLACK_COLOR - { - RED = true, - BLACK = false - }; - - ndRedBackNode() - { - } - - virtual ~ndRedBackNode () - { - } - - D_CORE_API void RemoveAllLow (); - D_CORE_API void RotateLeft(ndRedBackNode** const head); - D_CORE_API void RotateRight(ndRedBackNode** const head); - D_CORE_API void RemoveFixup (ndRedBackNode* const node, ndRedBackNode* * const head); - - D_CORE_API ndRedBackNode (ndRedBackNode* const parent); - D_CORE_API inline void Initdata (ndRedBackNode* const parent); - D_CORE_API inline void SetColor (REDBLACK_COLOR color); - D_CORE_API REDBLACK_COLOR GetColor () const; - D_CORE_API ndUnsigned32 IsInTree () const; - D_CORE_API inline void SetInTreeFlag (ndUnsigned32 flag); - - D_CORE_API void RemoveAll (); - D_CORE_API ndRedBackNode* Prev() const; - D_CORE_API ndRedBackNode* Next() const; - D_CORE_API ndRedBackNode* Minimum() const; - D_CORE_API ndRedBackNode* Maximum() const; - D_CORE_API void Remove (ndRedBackNode** const head); - D_CORE_API void Unlink (ndRedBackNode** const head); - D_CORE_API void InsertFixup(ndRedBackNode** const head); - - ndRedBackNode* m_left; - ndRedBackNode* m_right; - ndRedBackNode* m_parent; - ndUnsigned32 m_color : 1; - ndUnsigned32 m_inTree : 1; -}; - -template > -class ndTree: public ndClassAlloc -{ - public: - class ndNode: public allocator, public ndRedBackNode - { - ndNode(const KEY &key, ndNode* parentNode) - :allocator() - ,ndRedBackNode(parentNode), m_info(), m_key(key) - { - } - - ndNode (const OBJECT &info, const KEY &key, ndNode* parentNode) - :allocator() - ,ndRedBackNode(parentNode), m_info (info), m_key (key) - { - } - - ~ndNode () - { - } - - ndNode* GetLeft () const - { - return (ndNode* )ndRedBackNode::m_left; - } - - ndNode* GetRight () const - { - return (ndNode* )ndRedBackNode::m_right; - } - - ndNode* GetParent () - { - return (ndNode* )ndRedBackNode::m_parent; - } - - void SetLeft (ndNode* const node) - { - ndRedBackNode::m_left = node; - } - - void SetRight (ndNode* const node) - { - ndRedBackNode::m_right = node; - } - - void SetParent (ndNode* const node) - { - ndRedBackNode::m_parent = node; - } - - public: - const KEY& GetKey() const - { - return m_key; - } - - OBJECT& GetInfo() - { - return m_info; - } - - const OBJECT& GetInfo() const - { - return m_info; - } - - private: - OBJECT m_info; - KEY m_key; - friend class ndTree; - }; - - class Iterator - { - public: - Iterator(const ndTree &me) - { - m_ptr = nullptr; - m_tree = &me; - } - - ~Iterator() - { - } - - void Begin() - { - m_ptr = m_tree->Minimum(); - } - - void End() - { - m_ptr = m_tree->Maximum(); - } - - void Set (ndNode* const node) - { - m_ptr = node; - } - - operator ndInt32() const - { - return m_ptr != nullptr; - } - - void operator++ () - { - ndAssert (m_ptr); - m_ptr = m_ptr->Next(); - } - - void operator++ (ndInt32) - { - ndAssert (m_ptr); - m_ptr = m_ptr->Next(); - } - - void operator-- () - { - ndAssert (m_ptr); - m_ptr = m_ptr->Prev(); - } - - void operator-- (ndInt32) - { - ndAssert (m_ptr); - m_ptr = m_ptr->Prev(); - } - - OBJECT &operator* () const - { - return ((ndNode*)m_ptr)->GetInfo(); - } - - ndNode* GetNode() const - { - return (ndNode*)m_ptr; - } - - KEY GetKey () const - { - ndNode* const tmp = (ndNode*)m_ptr; - //return tmp ? tmp->GetKey() : KEY(0); - return tmp ? tmp->GetKey() : KEY(); - } - - private: - ndRedBackNode* m_ptr; - const ndTree* m_tree; - - }; - - // *********************************************************** - // member functions - // *********************************************************** - public: - ndTree (); - ~ndTree (); - - operator ndInt32() const; - ndInt32 GetCount() const; - - ndNode* GetRoot () const; - ndNode* Minimum () const; - ndNode* Maximum () const; - - ndNode* Find (const KEY& key) const; - ndNode* FindGreater (const KEY& key) const; - ndNode* FindLessEqual(const KEY& key) const; - ndNode* FindGreaterEqual (const KEY& key) const; - ndNode* FindCreate(const KEY& key, bool& wasFound); - - ndNode* GetNodeFromInfo (OBJECT &info) const; - - ndNode* Insert(const KEY& key); - ndNode* Insert(ndNode* const node, const KEY& key); - ndNode* Insert(const OBJECT &element, const KEY& key); - ndNode* Insert (const OBJECT &element, const KEY& key, bool& wasFound); - - ndNode* Replace (OBJECT &element, const KEY& key); - ndNode* ReplaceKey (const KEY& oldKey, const KEY& newKey); - ndNode* ReplaceKey (ndNode* const node, const KEY& key); - - void RemoveAll(); - void Remove (const KEY& key); - void Remove (ndNode* const node); - - void Unlink (ndNode* const node); - void SwapInfo (ndTree& tree); - - bool SanityCheck () const; - - static void FlushFreeList() - { - allocator::FlushFreeList(sizeof(ndNode)); - } - - // *********************************************************** - // member variables - // *********************************************************** - private: - ndNode* m_head; - ndInt32 m_count; - - ndInt32 CompareKeys (const KEY &key0, const KEY &key1) const; - bool SanityCheck (ndNode* const ptr, ndInt32 height) const; - - friend class ndNode; -}; - -inline ndRedBackNode::ndRedBackNode (ndRedBackNode* const parent) -{ - Initdata (parent); -} - -inline void ndRedBackNode::Initdata (ndRedBackNode* const parent) -{ - SetColor (RED); - SetInTreeFlag (true); - m_left = nullptr; - m_right = nullptr; - m_parent = parent; -} - -inline void ndRedBackNode::SetColor (ndRedBackNode::REDBLACK_COLOR color) -{ - m_color = color; -} - -inline ndRedBackNode::REDBLACK_COLOR ndRedBackNode::GetColor () const -{ - return REDBLACK_COLOR (m_color); -} - -inline void ndRedBackNode::SetInTreeFlag (ndUnsigned32 flag) -{ - m_inTree = flag; -} - -inline ndUnsigned32 ndRedBackNode::IsInTree () const -{ - return m_inTree; -} - -template -ndTree::ndTree () - :ndClassAlloc() - ,m_head(nullptr) - ,m_count(0) -{ -} - -template -ndTree::~ndTree () -{ - RemoveAll(); -} - -template -ndTree::operator ndInt32() const -{ - return m_head != nullptr; -} - -template -ndInt32 ndTree::GetCount() const -{ - return m_count; -} - -template -typename ndTree::ndNode* ndTree::Minimum () const -{ - return m_head ? (ndNode* )m_head->Minimum() : nullptr; -} - -template -typename ndTree::ndNode* ndTree::Maximum () const -{ - return m_head ? (ndNode* )m_head->Maximum() : nullptr; -} - -template -typename ndTree::ndNode* ndTree::GetRoot () const -{ - return m_head; -} - -template -typename ndTree::ndNode* ndTree::Find (const KEY& key) const -{ - if (m_head == nullptr) - { - return nullptr; - } - - ndNode* ptr = m_head; - while (ptr != nullptr) - { - if (key < ptr->m_key) - { - ndAssert (CompareKeys (ptr->m_key, key) == -1) ; - ptr = ptr->GetLeft(); - } - else if (key > ptr->m_key) - { - ndAssert (CompareKeys (ptr->m_key, key) == 1) ; - ptr = ptr->GetRight(); - } - else - { - ndAssert (CompareKeys (ptr->m_key, key) == 0) ; - break; - } - } - return ptr; -} - -template -typename ndTree::ndNode* ndTree::GetNodeFromInfo (OBJECT &info) const -{ - ndNode* const node = (ndNode* ) &info; - ndInt64 offset = ((char*) &node->m_info) - ((char *) node); - ndNode* const retnode = (ndNode* ) (((char *) node) - offset); - - ndAssert (retnode->IsInTree ()); - ndAssert (&retnode->GetInfo () == &info); - return (retnode->IsInTree ()) ? retnode : nullptr; -} - -template -typename ndTree::ndNode* ndTree::FindGreater (const KEY& key) const -{ - if (m_head == nullptr) - { - return nullptr; - } - - ndNode* prev = nullptr; - ndNode* ptr = m_head; - - while (ptr != nullptr) - { - if (key < ptr->m_key) - { - prev = ptr; - ptr = ptr->GetLeft(); - } - else - { - ptr = ptr->GetRight(); - } - } - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - if (prev) - { - Iterator iter (*this); - for (iter.Begin(); iter.GetNode() != prev; iter ++) - { - KEY key1 = iter.GetKey(); - ndAssert (key1 <= key); - } - for (; iter.GetNode(); iter ++) - { - KEY key1 = iter.GetKey(); - ndAssert (key1 > key); - } - } -#endif - - return (ndNode* )prev; -} - -template -typename ndTree::ndNode* ndTree::FindGreaterEqual (const KEY& key) const -{ - if (m_head == nullptr) - { - return nullptr; - } - - ndNode* prev = nullptr; - ndNode* ptr = m_head; - - while (ptr != nullptr) - { - if (key == ptr->m_key) - { - return ptr; - } - if (key < ptr->m_key) - { - prev = ptr; - ptr = ptr->GetLeft(); - } - else - { - ptr = ptr->GetRight(); - } - } - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - if (prev) - { - Iterator iter (*this); - for (iter.Begin(); iter.GetNode() != prev; iter ++) - { - KEY key1 = iter.GetKey(); - ndAssert (key1 <= key); - } - for (; iter.GetNode(); iter ++) - { - KEY key1 = iter.GetKey(); - ndAssert (key1 >= key); - } - } -#endif - - return (ndNode* )prev; -} - -template -typename ndTree::ndNode* ndTree::FindLessEqual (const KEY& key) const -{ - if (m_head == nullptr) - { - return nullptr; - } - - ndNode* prev = nullptr; - ndNode* ptr = m_head; - - while (ptr != nullptr) - { - if (key == ptr->m_key) - { - return ptr; - } - - if (key < ptr->m_key) - { - ptr = ptr->GetLeft(); - } - else - { - prev = ptr; - ptr = ptr->GetRight(); - } - - } - -#ifdef __ENABLE_DG_CONTAINERS_SANITY_CHECK - if (prev) - { - Iterator iter (*this); - for (iter.End(); iter.GetNode() != prev; iter --) - { - KEY key1 = iter.GetKey(); - ndAssert (key1 >= key); - } - for (; iter.GetNode(); iter --) - { - KEY key1 = iter.GetKey(); - ndAssert (key1 < key); - } - } -#endif - - return (ndNode* )prev; -} - -template -typename ndTree::ndNode* ndTree::Insert (const OBJECT &element, const KEY& key, bool& wasFound) -{ - ndNode* parent = nullptr; - ndNode* ptr = m_head; - ndInt32 val = 0; - while (ptr != nullptr) - { - parent = ptr; - - if (key < ptr->m_key) - { - ndAssert (CompareKeys (ptr->m_key, key) == -1) ; - val = -1; - ptr = ptr->GetLeft(); - } - else if (key > ptr->m_key) - { - ndAssert (CompareKeys (ptr->m_key, key) == 1) ; - val = 1; - ptr = ptr->GetRight(); - } - else - { - ndAssert (CompareKeys (ptr->m_key, key) == 0) ; - wasFound = true; - return ptr; - } - } - - m_count ++; - wasFound = false; - ptr = new ndNode (element, key, parent); - if (!parent) - { - m_head = ptr; - } - else - { - if (val < 0) - { - parent->m_left = ptr; - } - else - { - parent->m_right = ptr; - } - } - - ndNode** const headPtr = (ndNode**) &m_head; - ptr->InsertFixup ((ndRedBackNode**)headPtr); - return ptr; -} - -template -typename ndTree::ndNode* ndTree::FindCreate(const KEY& key, bool& wasFound) -{ - ndNode* parent = nullptr; - ndNode* ptr = m_head; - ndInt32 val = 0; - while (ptr != nullptr) - { - parent = ptr; - if (key < ptr->m_key) - { - ndAssert(CompareKeys(ptr->m_key, key) == -1); - val = -1; - ptr = ptr->GetLeft(); - } - else if (key > ptr->m_key) - { - ndAssert(CompareKeys(ptr->m_key, key) == 1); - val = 1; - ptr = ptr->GetRight(); - } - else - { - ndAssert(CompareKeys(ptr->m_key, key) == 0); - wasFound = true; - return ptr; - } - } - - m_count++; - wasFound = false; - ptr = new ndNode(key, parent); - if (!parent) - { - m_head = ptr; - } - else - { - if (val < 0) - { - parent->m_left = ptr; - } - else - { - parent->m_right = ptr; - } - } - - ndNode** const headPtr = (ndNode**)&m_head; - ptr->InsertFixup((ndRedBackNode**)headPtr); - return ptr; -} - -template -typename ndTree::ndNode* ndTree::Insert (const OBJECT &element, const KEY& key) -{ - bool foundState; - - ndNode* const node = Insert (element, key, foundState); - if (foundState) - { - return nullptr; - } - return node; -} - -template -typename ndTree::ndNode* ndTree::Insert(const KEY& key) -{ - OBJECT element; - return Insert(element, key); -} - -template -typename ndTree::ndNode* ndTree::Insert (typename ndTree::ndNode* const node, const KEY& key) -{ - ndInt32 val = 0; - ndNode* ptr = m_head; - ndNode* parent = nullptr; - while (ptr != nullptr) - { - parent = ptr; - - if (key < ptr->m_key) - { - ndAssert (CompareKeys (ptr->m_key, key) == -1) ; - val = -1; - ptr = ptr->GetLeft(); - } - else if (key > ptr->m_key) - { - ndAssert (CompareKeys (ptr->m_key, key) == 1) ; - val = 1; - ptr = ptr->GetRight(); - } - else - { - ndAssert (CompareKeys (ptr->m_key, key) == 0) ; - return nullptr; - } - } - - m_count ++; - - ptr = node; - ptr->m_key = key; - ptr->Initdata (parent); - - if (!parent) - { - m_head = ptr; - } - else - { - if (val < 0) - { - parent->m_left = ptr; - } - else - { - parent->m_right = ptr; - } - } - - ndNode** const headPtr = (ndNode**) &m_head; - ptr->InsertFixup ((ndRedBackNode**)headPtr); - return ptr; -} - -template -typename ndTree::ndNode* ndTree::Replace (OBJECT &element, const KEY& key) -{ - ndNode* parent = nullptr; - ndNode* ptr = m_head; - ndInt32 val = 0; - - while (ptr != nullptr) - { - parent = ptr; - - ndAssert (0); - val = CompareKeys (ptr->m_key, key); - if (val == 0) - { - ptr->m_info = element; - return ptr; - } - if (val < 0) - { - ptr = ptr->GetLeft(); - } - else - { - ptr = ptr->GetRight(); - } - } - - ptr = new ndNode (element, key, parent); - if (!parent) - { - m_head = ptr; - } - else - { - if (val < 0) - { - parent->m_left = ptr; - } - else - { - parent->m_right = ptr; - } - } - - ndNode** const headPtr = (ndNode**) &m_head; - ptr->InsertFixup ((ndRedBackNode**)headPtr ); - return ptr; -} - -template -typename ndTree::ndNode* ndTree::ReplaceKey (typename ndTree::ndNode* const node, const KEY& key) -{ - Unlink (node); - ndNode* const ptr = Insert (node, key); - ndAssert (ptr); - return ptr; -} - -template -typename ndTree::ndNode* ndTree::ReplaceKey (const KEY& oldKey, const KEY& newKey) -{ - ndNode* const node = Find (oldKey); - return node ? ReplaceKey (node, newKey) : nullptr; -} - -template -void ndTree::Unlink (typename ndTree::ndNode* const node) -{ - m_count --; - - ndNode** const headPtr = (ndNode**) &m_head; - node->Unlink ((ndRedBackNode**)headPtr); - ndAssert (!Find (node->GetKey())); -} - -template -void ndTree::Remove (typename ndTree::ndNode* const node) -{ - m_count --; - ndNode** const headPtr = (ndNode**) &m_head; - node->Remove ((ndRedBackNode**)headPtr); -} - -template -void ndTree::Remove (const KEY& key) -{ - // find node in tree - ndNode* const node = Find (key); - if (node) - { - Remove(node); - } -} - -template -void ndTree::RemoveAll () -{ - if (m_head) - { - m_count = 0; - m_head->RemoveAll (); - m_head = nullptr; - } -} - -template -bool ndTree::SanityCheck () const -{ - return SanityCheck (m_head, 0); -} - -template -bool ndTree::SanityCheck (typename ndTree::ndNode* const ptr, ndInt32 height) const -{ - if (!ptr) - { - return true; - } - - if (!ptr->IsInTree()) - { - return false; - } - - if (ptr->m_left) - { - if (CompareKeys (ptr->m_key, ptr->GetLeft()->m_key) > 0) - { - return false; - } - } - - if (ptr->m_right) - { - if (CompareKeys (ptr->m_key, ptr->GetRight()->m_key) < 0) - { - return false; - } - } - - if (ptr->GetColor() == ndNode::BLACK) - { - height ++; - } - else if (!((!ptr->m_left || (ptr->m_left->GetColor() == ndNode::BLACK)) && - (!ptr->m_right || (ptr->m_right->GetColor() == ndNode::BLACK)))) - { - return false; - } - - if (!ptr->m_left && !ptr->m_right) - { - ndInt32 bh = 0; - for (ndNode* x = ptr; x; x = x->GetParent()) - { - if (x->GetColor() == ndNode::BLACK) - { - bh ++; - } - } - if (bh != height) - { - return false; - } - } - - if (ptr->m_left && !SanityCheck (ptr->GetLeft(), height)) - { - return false; - } - - if (ptr->m_right && !SanityCheck (ptr->GetRight(), height)) - { - return false; - } - return true; -} - -template -ndInt32 ndTree::CompareKeys (const KEY &key0, const KEY &key1) const -{ - if (key1 < key0) - { - return - 1; - } - if (key1 > key0) - { - return 1; - } - return 0; -} - -template -void ndTree::SwapInfo (ndTree& tree) -{ - ndSwap (m_head, tree.m_head); - ndSwap (m_count, tree.m_count); -} - -//template ndInt32 ndTree::m_size = 0; -//template dgMemoryAllocator* ndTree::m_staticAllocator = nullptr; - - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTypes.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTypes.cpp deleted file mode 100644 index 2f6c8d23f8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTypes.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTypes.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTypes.h deleted file mode 100644 index cfb17fc3a2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTypes.h +++ /dev/null @@ -1,349 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_TYPES_H__ -#define __ND_TYPES_H__ - -#ifdef _MSC_VER - #if _MSC_VER >= 1400 - #define HAVE_STRUCT_TIMESPEC - #endif -#endif - -#define ND_NEWTON_VERSION 403 - -#if (defined (WIN32) || defined(_WIN32) || defined (_M_ARM) || defined (_M_ARM64)) - #define NOMINMAX - #include - #include - #include - #include - #include - #include - #include - #include -#else - #include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include only in cpp 20 or later -#include - -// weird workaround but i am not sure how a global compiler flag would affect the rest of the code -// probably useless since this functionality will not be used/implemented but avoid compiler errors -#if defined(__STRICT_ANSI__) && (defined (__MINGW32__) || defined (__MINGW64__)) - #pragma push_macro("__STRICT_ANSI__") - #undef __STRICT_ANSI__ -#endif - -#include -#if (defined (__MINGW32__) || defined (__MINGW64__)) - #pragma pop_macro("__STRICT_ANSI__") -#endif - -#if (defined (__MINGW32__) || defined (__MINGW64__)) - #include - #include - #include - #include - #include -#endif - -#if (defined (__linux__ ) || defined (__MINGW32__) || defined (__MINGW64__)) - //CMake defines NDEBUG for _not_ debug builds. Therefore, set - //Newton's _DEBUG flag only when NDEBUG is not defined. - - #ifndef NDEBUG - #define _DEBUG 1 - #endif - - #include - #include - #include - // it was __ARMCC_VERSION before, it should be __ARM__ or aarch64, otherwise cross compiling in gcc fails. - #if (!defined(__arm__) && !defined(__aarch64__)) - extern "C" - { - // for SSE3 and up - #include - #include - #include - #include - } - #endif -#endif - -#if defined (__x86_64) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) - #include -#endif - -#if defined(__arm__) && defined(__aarch64__) - #include -#endif - -#if defined (__APPLE__) - #include - #include - #include - #if (defined __i386__ || defined __x86_64__) - #include - #include - #include //sse3 - #include - #endif -#endif - -// uncomment out D_FORCE_PROFILE_PHYSICS to enable profiler frame capture profiler traces -// alternatively the end application can use a command line option to enable this define -//#define D_FORCE_PROFILE_PHYSICS - -#ifdef D_FORCE_PROFILE_PHYSICS - #ifndef D_PROFILER - #define D_PROFILER - #endif -#endif - -// uncomment this for Scalar floating point -// alternatively the end application can use a command line option to enable this define -//#define D_SCALAR_VECTOR_CLASS - -// uncomment this for Scalar floating point -// alternatively the end application can use a command line option to enable this define -//#define __ANDROID__ - -// by default newton run on a separate thread and -// optionally concurrent with the calling thread, -// it also uses a thread job pool for multi core systems. -// define D_USE_THREAD_EMULATION on the command line for -// platform that do not support hardware multi threading or -// if the and application want to control threading at the application level -//#define D_USE_FORCE_THREAD_EMULATION - -#ifdef D_USE_FORCE_THREAD_EMULATION - #ifndef D_USE_THREAD_EMULATION - #define D_USE_THREAD_EMULATION - #endif -#endif - -//************************************************************ -#ifdef D_DISABLE_ASSERT - #define ndAssert(x) -#else - #ifdef _DEBUG - #if (defined (WIN32) || defined(_WIN32) || defined (_M_ARM) || defined (_M_ARM64)) - #define ndAssert(x) _ASSERTE(x) - #else - #define ndAssert(x) assert(x) - #endif - #else - #define ndAssert(x) - #endif -#endif - -#if defined(_MSC_VER) - #define D_GCC_NEWTON_ALIGN_16 - #define D_MSV_NEWTON_ALIGN_16 __declspec(align(16)) - - #define D_GCC_NEWTON_ALIGN_32 - #define D_MSV_NEWTON_ALIGN_32 __declspec(align(32)) -#else - #define D_GCC_NEWTON_ALIGN_16 __attribute__((aligned (16))) - #define D_MSV_NEWTON_ALIGN_16 - - #define D_GCC_NEWTON_ALIGN_32 __attribute__((aligned (32))) - #define D_MSV_NEWTON_ALIGN_32 -#endif - -#if defined(_MSC_VER) - #define D_LIBRARY_EXPORT __declspec(dllexport) - #define D_LIBRARY_IMPORT __declspec(dllimport) -#else - #define D_LIBRARY_EXPORT __attribute__((visibility("default"))) - #define D_LIBRARY_IMPORT __attribute__((visibility("default"))) -#endif - -#ifdef _D_CORE_DLL - #ifdef _D_CORE_EXPORT_DLL - #define D_CORE_API D_LIBRARY_EXPORT - #else - #define D_CORE_API D_LIBRARY_IMPORT - #endif -#else - #define D_CORE_API -#endif - -typedef float ndReal; -typedef int8_t ndInt8; -typedef uint8_t ndUnsigned8; -typedef int16_t ndInt16; -typedef uint16_t ndUnsigned16; -typedef int32_t ndInt32; -typedef uint32_t ndUnsigned32; -typedef int64_t ndInt64; -typedef uint64_t ndUnsigned64; - -typedef double ndFloat64; -#ifdef D_NEWTON_USE_DOUBLE - typedef double ndFloat32; -#else - typedef float ndFloat32; -#endif - -#define ndPi ndFloat32 (3.141592f) -//#define ndEXP ndFloat32 (2.7182818f) -#define ndEpsilon ndFloat32 (1.0e-5f) -#define ndDegreeToRad ndFloat32 (ndPi / 180.0f) -#define ndRadToDegree ndFloat32 (180.0f / ndPi) - -#define ndSqrt(x) ndFloat32 (sqrt(x)) -#define ndSin(x) ndFloat32 (sin(x)) -#define ndCos(x) ndFloat32 (cos(x)) -#define ndAsin(x) ndFloat32 (asin(x)) -#define ndAcos(x) ndFloat32 (acos(x)) -#define ndLog(x) ndFloat32 (log(x)) -#define ndCeil(x) ndFloat32 (ceil(x)) -#define ndFloor(x) ndFloat32 (floor(x)) -#define ndExp(x) ndFloat32 (exp(x)) -#define ndPow(x,y) ndFloat32 (pow(x,y)) -#define ndFmod(x,y) ndFloat32 (fmod(x,y)) -#define ndTan(x) ndFloat32 (tan(x)) -#define ndTanh(x) ndFloat32 (tanh(x)) -#define ndAtan(x) ndFloat32 (atan(x)) -#define ndAtan2(x,y) ndFloat32 (atan2(x,y)) -#define ndRsqrt(x) (ndFloat32 (1.0f) / ndSqrt(x)) - -#if (defined (WIN32) || defined(_WIN32) || defined (_M_ARM) || defined (_M_ARM64)) - #define ndCheckFloat(x) (1) - //#define ndCheckFloat(x) (_finite(x) && !_isnan(x)) -#else - //#define ndCheckFloat(x) (isfinite(x) && !isnan(x)) - #define ndCheckFloat(x) (1) -#endif - -#ifdef D_NEWTON_USE_DOUBLE - union ndFloatSign - { - ndInt64 m_iVal; - ndFloat64 m_fVal; - }; -#else - union ndFloatSign - { - ndInt32 m_iVal; - ndFloat32 m_fVal; - }; -#endif - -union ndIntPtr -{ - ndIntPtr() - :m_int(0) - { - } - void* m_ptr; - ndInt64 m_int; -}; - -union ndDoubleInt -{ - struct - { - ndInt32 m_intL; - ndInt32 m_intH; - }; - void* m_ptr; - ndInt64 m_int; - ndFloat64 m_float; -}; - -class ndTriplex -{ - public: - ndFloat32 m_x; - ndFloat32 m_y; - ndFloat32 m_z; -}; - -#define D_BASE_CLASS_REFLECTION(Class) \ - virtual const char* ClassName() const \ - { \ - return #Class; \ - } \ - static const char* StaticClassName() \ - { \ - return #Class; \ - } \ - virtual const char* SuperClassName() const \ - { \ - return #Class; \ - } - -#define D_CLASS_REFLECTION(Class,SuperClass) \ - virtual const char* ClassName() const \ - { \ - return #Class; \ - } \ - static const char* StaticClassName() \ - { \ - return #Class; \ - } \ - virtual const char* SuperClassName() const \ - { \ - return #SuperClass; \ - } - -#define D_OPERATOR_NEW_AND_DELETE \ -inline void *operator new (size_t size) \ -{ \ - return ndMemory::Malloc(size); \ -} \ - \ -inline void *operator new[](size_t size) \ -{ \ - return ndMemory::Malloc(size); \ -} \ - \ -inline void operator delete (void* ptr) \ -{ \ - ndMemory::Free(ptr); \ -} \ - \ -inline void operator delete[](void* ptr) \ -{ \ - ndMemory::Free(ptr); \ -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTypes.natvis b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTypes.natvis deleted file mode 100644 index f6ee102953..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTypes.natvis +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {{ size={m_size} }} - - - m_size - m_array - - - - - - {{ count={m_count} }} - - - m_count - m_array - - - - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndUtils.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndUtils.cpp deleted file mode 100644 index a90f616d61..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndUtils.cpp +++ /dev/null @@ -1,387 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndSort.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndVector.h" -#include "ndMatrix.h" - -#define D_USE_YZ_VARIANCE - -#ifdef D_USE_YZ_VARIANCE -#define D_VERTEXLIST_INDEX_LIST_BASH (1024 * 8) -#else -#define D_VERTEXLIST_INDEX_LIST_BASH (1024) -#endif - -ndFloat64 ndRoundToFloat(ndFloat64 val) -{ - ndInt32 exp; - ndFloat64 mantissa = frexp(val, &exp); - - const ndFloat64 power = 1 << 23; - const ndFloat64 invPower = ndFloat64(1.0f) / power; - mantissa = floor(mantissa * power) * invPower; - - ndFloat64 val1 = ldexp(mantissa, exp); - return val1; -} - -ndUnsigned64 ndGetTimeInMicroseconds() -{ - static std::chrono::high_resolution_clock::time_point timeStampBase = std::chrono::high_resolution_clock::now(); - std::chrono::high_resolution_clock::time_point currentTimeStamp = std::chrono::high_resolution_clock::now(); - ndUnsigned64 timeStamp = ndUnsigned64(std::chrono::duration_cast(currentTimeStamp - timeStampBase).count()); - return timeStamp; -} - -class ndSortCluster -{ -public: - ndBigVector m_sum; - ndBigVector m_sum2; - ndInt32 m_start; - ndInt32 m_count; -}; - -class ndSortKey -{ -public: - ndInt32 m_mask; - ndInt32 m_ordinal; - ndInt32 m_vertexIndex; -}; - -static ndInt32 SortVertices( - ndFloat64* const vertListOut, ndInt32* const indexList, - const ndFloat64* const vertexList, ndInt32 stride, - ndInt32 compareCount, ndFloat64 tol, - ndSortKey* const remapIndex, - const ndSortCluster& cluster, ndInt32 baseCount, ndInt32 firstSortAxis) -{ -#ifndef D_USE_YZ_VARIANCE - firstSortAxis = 0; - const ndBigVector origin(cluster.m_sum.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count)); - const ndBigVector variance(ndBigVector::m_zero.GetMax(cluster.m_sum2.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count) - origin * origin).Sqrt()); - - if ((variance.m_y >= variance.m_x) && (variance.m_y >= variance.m_z)) - { - firstSortAxis = 1; - } - else if ((variance.m_z >= variance.m_x) && (variance.m_z >= variance.m_y)) - { - firstSortAxis = 2; - } -#endif - - class dVertexSortData - { - public: - ndInt32 m_stride; - ndInt32 m_vertexSortIndex; - const ndFloat64* m_vertex; - }; - - dVertexSortData sortContext; - sortContext.m_vertex = vertexList; - sortContext.m_stride = stride; - sortContext.m_vertexSortIndex = firstSortAxis; - class ndCompareKey - { - public: - ndCompareKey(void* const context) - :m_sortContext((dVertexSortData*)context) - { - } - - ndInt32 Compare(const ndSortKey& elementA, const ndSortKey& elementB) const - { - ndInt32 index0 = elementA.m_vertexIndex * m_sortContext->m_stride + m_sortContext->m_vertexSortIndex; - ndInt32 index1 = elementB.m_vertexIndex * m_sortContext->m_stride + m_sortContext->m_vertexSortIndex; - - if (m_sortContext->m_vertex[index0] < m_sortContext->m_vertex[index1]) - { - return -1; - } - if (m_sortContext->m_vertex[index0] > m_sortContext->m_vertex[index1]) - { - return 1; - } - return 0; - } - - dVertexSortData* m_sortContext; - }; - ndSort(remapIndex, cluster.m_count, &sortContext); - -#ifdef D_USE_YZ_VARIANCE - const ndFloat64 tolerance = ndMax(ndFloat64(tol), ndFloat64(1.0e-8f)); -#else - const ndFloat64 minDist = ndMin(ndMin(variance.m_x, variance.m_y), variance.m_z); - const ndFloat64 tolerance = ndMax(ndMin(minDist, ndFloat64(tol)), ndFloat64(1.0e-8f)); -#endif - const ndFloat64 sweptWindow = ndFloat64(2.0f) * tolerance; - - ndInt32 newCount = 0; - for (ndInt32 i = 0; i < cluster.m_count; ++i) - { - const ndInt32 ii = remapIndex[i].m_mask; - if (ii == -1) - { - const ndInt32 iii = remapIndex[i].m_vertexIndex; - const ndFloat64 swept = vertexList[iii * stride + firstSortAxis] + sweptWindow;; - for (ndInt32 j = i + 1; j < cluster.m_count; ++j) - { - const ndInt32 jj = remapIndex[j].m_mask; - if (jj == -1) - { - const ndInt32 jjj = remapIndex[j].m_vertexIndex; - ndFloat64 val = vertexList[jjj * stride + firstSortAxis]; - if (val >= swept) - { - break; - } - - bool test = true; - for (ndInt32 t = 0; test && (t < compareCount); t++) - { - val = fabs(vertexList[iii * stride + t] - vertexList[jjj * stride + t]); - test = test && (val <= tol); - } - - if (test) - { - remapIndex[j].m_mask = newCount + baseCount; - } - } - } - - remapIndex[newCount].m_vertexIndex = remapIndex[i].m_vertexIndex; - remapIndex[i].m_mask = newCount + baseCount; - newCount++; - } - } - - for (ndInt32 i = 0; i < newCount; ++i) - { - ndInt32 dst = (baseCount + i) * stride; - ndInt32 src = remapIndex[i].m_vertexIndex * stride; - ndMemCpy(&vertListOut[dst], &vertexList[src], stride); - } - - for (ndInt32 i = 0; i < cluster.m_count; ++i) - { - ndInt32 i1 = remapIndex[i].m_ordinal; - ndInt32 index = remapIndex[i].m_mask; - indexList[i1] = index; - } - - return newCount; -} - -static ndInt32 QuickSortVertices(ndFloat64* const vertListOut, ndInt32 stride, ndInt32 compareCount, ndInt32 vertexCount, ndInt32* const indexListOut, ndFloat64 tolerance) -{ - ndSortCluster cluster; - cluster.m_start = 0; - cluster.m_count = vertexCount; - cluster.m_sum = ndBigVector::m_zero; - cluster.m_sum2 = ndBigVector::m_zero; - - ndStackpool(stride * cluster.m_count); - ndStack indirectListBuffer(cluster.m_count); - ndSortKey* const indirectList = &indirectListBuffer[0]; - - ndFloat64* const vertList = &pool[0]; - ndMemCpy(&vertList[0], &vertListOut[0], cluster.m_count * stride); - - for (ndInt32 i = 0; i < cluster.m_count; ++i) - { - indirectList[i].m_mask = -1; - indirectList[i].m_ordinal = i; - indirectList[i].m_vertexIndex = i; - - const ndBigVector x(vertList[i * stride + 0], vertList[i * stride + 1], vertList[i * stride + 2], ndFloat64(0.0f)); - cluster.m_sum += x; - cluster.m_sum2 += x * x; - } - - ndInt32 sortIndex = 0; -#ifdef D_USE_YZ_VARIANCE - const ndBigVector originScale(cluster.m_sum.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count)); - const ndBigVector varianceScale2((cluster.m_sum2.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count) - originScale * originScale).GetMax(ndBigVector(1.0e-6f))); - ndFloat64 maxValue = varianceScale2.m_x; - for (ndInt32 i = 1; i < 3; ++i) - { - if (varianceScale2[i] > maxValue) - { - sortIndex = i; - maxValue = varianceScale2[i]; - } - } - ndInt32 varianceIndex0 = (sortIndex + 1) % 3; - ndInt32 varianceIndex1 = (varianceIndex0 + 1) % 3; - const ndBigVector stdScale(ndFloat64(1.0f) / varianceScale2.m_x, ndFloat64(1.0f) / varianceScale2.m_y, ndFloat64(1.0f) / varianceScale2.m_z, ndFloat64(0.0f)); -#endif - - ndInt32 baseCount = 0; - if (cluster.m_count > D_VERTEXLIST_INDEX_LIST_BASH) - { - ndFixSizeArray spliteStack; - spliteStack.PushBack(cluster); - - while (spliteStack.GetCount()) - { - cluster = spliteStack.Pop(); - - const ndBigVector origin(cluster.m_sum.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count)); - const ndBigVector variance2(cluster.m_sum2.Scale(ndFloat32(1.0f) / (ndFloat32)cluster.m_count) - origin * origin); - ndSortKey* const remapIndex = &indirectList[cluster.m_start]; - -#ifdef D_USE_YZ_VARIANCE - ndFloat64 clusterVariance2_0 = stdScale[varianceIndex0] * ndMax(variance2[varianceIndex0], ndFloat64(0.0f)); - ndFloat64 clusterVariance2_1 = stdScale[varianceIndex1] * ndMax(variance2[varianceIndex1], ndFloat64(0.0f)); - ndFloat64 maxNormalizedVariance = ndMax(clusterVariance2_0, clusterVariance2_1); - bool doSort = (maxNormalizedVariance < ndFloat32(1.0f / 8.0f)) || (spliteStack.GetCount() > (spliteStack.GetCapacity() - 4)); -#else - ndFloat64 maxVariance2 = ndMax(ndMax(variance2.m_x, variance2.m_y), variance2.m_z); - bool doSort = (cluster.m_count <= D_VERTEXLIST_INDEX_LIST_BASH) || (spliteStack.GetCount() > (spliteStack.GetCapacity() - 4)) || (maxVariance2 < ndFloat32(4.0f)); -#endif - if (doSort) - { - ndInt32 newCount = SortVertices(vertListOut, indexListOut, vertList, stride, compareCount, tolerance, remapIndex, cluster, baseCount, sortIndex); - baseCount += newCount; - } - else - { -#ifdef D_USE_YZ_VARIANCE - //ndInt32 firstSortAxis = (variance2.m_y >= variance2.m_z) ? 1 : 2; - ndInt32 firstSortAxis = (clusterVariance2_0 > clusterVariance2_1) ? varianceIndex0 : varianceIndex1; -#else - ndInt32 firstSortAxis = 0; - if ((variance2.m_y >= variance2.m_x) && (variance2.m_y >= variance2.m_z)) - { - firstSortAxis = 1; - } - else if ((variance2.m_z >= variance2.m_x) && (variance2.m_z >= variance2.m_y)) - { - firstSortAxis = 2; - } -#endif - ndFloat64 axisVal = origin[firstSortAxis]; - - ndInt32 i0 = 0; - ndInt32 i1 = cluster.m_count - 1; - while (i0 < i1) - { - ndInt32 index0 = remapIndex[i0].m_vertexIndex; - while ((vertList[index0 * stride + firstSortAxis] <= axisVal) && (i0 < i1)) - { - ++i0; - index0 = remapIndex[i0].m_vertexIndex; - }; - - ndInt32 index1 = remapIndex[i1].m_vertexIndex; - while ((vertList[index1 * stride + firstSortAxis] > axisVal) && (i0 < i1)) - { - --i1; - index1 = remapIndex[i1].m_vertexIndex; - } - - ndAssert(i0 <= i1); - if (i0 < i1) - { - ndSwap(remapIndex[i0], remapIndex[i1]); - ++i0; - --i1; - } - } - - ndInt32 index0 = remapIndex[i0].m_vertexIndex; - while ((vertList[index0 * stride + firstSortAxis] <= axisVal) && (i0 < cluster.m_count)) - { - ++i0; - index0 = remapIndex[i0].m_vertexIndex; - }; - -#ifdef _DEBUG - for (ndInt32 i = 0; i < i0; ++i) - { - index0 = remapIndex[i].m_vertexIndex; - ndAssert(vertList[index0 * stride + firstSortAxis] <= axisVal); - } - - for (ndInt32 i = i0; i < cluster.m_count; ++i) - { - index0 = remapIndex[i].m_vertexIndex; - ndAssert(vertList[index0 * stride + firstSortAxis] > axisVal); - } -#endif - - ndBigVector xc(ndBigVector::m_zero); - ndBigVector x2c(ndBigVector::m_zero); - for (ndInt32 i = 0; i < i0; ++i) - { - ndInt32 j = remapIndex[i].m_vertexIndex; - const ndBigVector x(vertList[j * stride + 0], vertList[j * stride + 1], vertList[j * stride + 2], ndFloat64(0.0f)); - xc += x; - x2c += x * x; - } - - ndSortCluster cluster_i1(cluster); - cluster_i1.m_start = cluster.m_start + i0; - cluster_i1.m_count = cluster.m_count - i0; - cluster_i1.m_sum -= xc; - cluster_i1.m_sum2 -= x2c; - spliteStack.PushBack(cluster_i1); - - ndSortCluster cluster_i0(cluster); - cluster_i0.m_start = cluster.m_start; - cluster_i0.m_count = i0; - cluster_i0.m_sum = xc; - cluster_i0.m_sum2 = x2c; - spliteStack.PushBack(cluster_i0); - } - } - } - else - { - baseCount = SortVertices(vertListOut, indexListOut, vertList, stride, compareCount, tolerance, indirectList, cluster, 0, sortIndex); - } - return baseCount; -} - -ndInt32 ndVertexListToIndexList(ndFloat64* const vertList, ndInt32 strideInBytes, ndInt32 compareCount, ndInt32 vertexCount, ndInt32* const indexListOut, ndFloat64 tolerance) -{ - if (strideInBytes < 3 * ndInt32(sizeof(ndFloat64))) - { - return 0; - } - if (compareCount < 3) - { - return 0; - } - - ndInt32 stride = strideInBytes / ndInt32(sizeof(ndFloat64)); - ndInt32 count = QuickSortVertices(vertList, stride, compareCount, vertexCount, indexListOut, tolerance); - return count; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndUtils.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndUtils.h deleted file mode 100644 index 53738e6929..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndUtils.h +++ /dev/null @@ -1,296 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_UTILS_H__ -#define __ND_UTILS_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndStack.h" -#include "ndMemory.h" -#include "ndFixSizeArray.h" - -// assume this function returns memory aligned to 16 bytes -#define ndAlloca(type, count) (type*) alloca (sizeof (type) * size_t(count)) - -inline ndInt32 ndExp2 (ndInt32 x) -{ - ndInt32 exp = -1; - for (; x; x >>= 1) - { - exp ++; - } - return exp; -} - -inline ndInt32 ndBitReversal(ndInt32 v, ndInt32 base) -{ - ndInt32 x = 0; - ndInt32 power = ndExp2 (base) - 1; - do - { - x += (v & 1) << power; - v >>= 1; - power--; - } while (v); - ndAssert(x < base); - return x; -} - -template -inline T ndMod(T val, T mod) -{ - return T(fmod(T(val), T(mod))); -} - -template -inline T ndMin(T A, T B) -{ - return (A < B) ? A : B; -} - -template -inline T ndMax(T A, T B) -{ - return (A > B) ? A : B; -} - -template -inline T ndClamp(T val, T min, T max) -{ - return ndMax (min, ndMin (max, val)); -} - -template -inline T ndFlushToZero(T val) -{ - return (val > T(1.0e-16f)) ? val : ((val < T(-1.0e-16f)) ? val : T(0.0f)); -} - -template -inline void ndSwap(T& A, T& B) -{ - T tmp (A); - A = B; - B = tmp; -} - -template -inline T ndAbs(T A) -{ - // according to Intel this is better because is does not read after write - return (A >= T(0)) ? A : -A; -} - -template -inline T ndSign(T A) -{ - return (A >= T(0)) ? T(1) : T(-1); -} - -template -inline bool ndAreEqual(T A, T B, T tol) -{ - // deal with too small and de normal values. - if ((ndAbs(A) < tol) && (ndAbs(B) < tol)) - { - return true; - } - - ndInt32 exp0; - ndFloat64 mantissa0 = frexp(ndFloat64 (A), &exp0); - - ndInt32 exp1; - ndFloat64 mantissa1 = frexp(ndFloat64(B), &exp1); - if (ndAbs(exp0 - exp1) > 1) - { - return false; - } - if (exp0 != exp1) - { - if (exp0 > exp1) - { - mantissa0 *= ndFloat32(2.0f); - } - else - { - mantissa1 *= ndFloat32(2.0f); - } - } - return ndAbs(mantissa0 - mantissa1) < tol; -} - -/// add two angles in a periodic way -template -inline T ndAnglesAdd (T angleInRadiand1, T angleInRadiand0) -{ - T s1 = T(ndSin(angleInRadiand1)); - T c1 = T(ndCos(angleInRadiand1)); - T s0 = T(ndSin(angleInRadiand0)); - T c0 = T(ndCos(angleInRadiand0)); - - T s = s1 * c0 + s0 * c1; - T c = c1 * c0 - s0 * s1; - return T(ndAtan2(s, c)); -} - -template -inline T ndAnglesSub(T angleInRadiand1, T angleInRadiand0) -{ - T s1 = T(ndSin(angleInRadiand1)); - T c1 = T(ndCos(angleInRadiand1)); - T s0 = T(ndSin(angleInRadiand0)); - T c0 = T(ndCos(angleInRadiand0)); - - T s = s1 * c0 - s0 * c1; - T c = c1 * c0 + s0 * s1; - return T(ndAtan2(s, c)); -} - -template -inline void ndMemSet(T* const dst, const T& val, ndInt64 elements) -{ - T value(val); - const ndInt64 stride = 8; - const ndInt64 n = elements & (-stride); - for (ndInt64 i = 0; i < n; i += stride) - { - for (ndInt64 j = 0; j < stride; ++j) - { - dst[i + j] = value; - } - } - for (ndInt64 i = n; i < elements; ++i) - { - dst[i] = value; - } -} - -template -inline void ndMemCpy(T* const dst, const T* const src, ndInt64 elements) -{ - memcpy(dst, src, sizeof(T) * elements); -} - -#ifndef _MSC_VER - #define _stricmp(x,y) strcasecmp(x,y) - #define strcpy_s(x,n,y) strncpy(x,y,n) -#endif - -inline void strtolwr(char* const string) -{ - for (char * cp = string; *cp; ++cp) - { - if ((*cp >= 'A') && (*cp <= 'Z')) - { - *cp += 'a' - 'A'; - } - } -} - -/// Returns the time in micro seconds since application started -D_CORE_API ndUnsigned64 ndGetTimeInMicroseconds(); - -/// Round a 64 bit float to a 32 bit float by truncating the mantissa to 24 bits -/// \param ndFloat64 val: 64 bit float -/// \return a 64 bit double precision with a 32 bit mantissa -D_CORE_API ndFloat64 ndRoundToFloat(ndFloat64 val); - -/// removed all duplicate points from an array and place the location in the index array -D_CORE_API ndInt32 ndVertexListToIndexList(ndFloat64* const vertexList, ndInt32 strideInBytes, ndInt32 compareCount, ndInt32 vertexCount, ndInt32* const indexListOut, ndFloat64 tolerance = ndEpsilon); - -/// removed all duplicate points from an array and place the location in the index array -template -ndInt32 ndVertexListToIndexList(T* const vertexList, ndInt32 strideInBytes, ndInt32 compareCount, ndInt32 vertexCount, ndInt32* const indexListOut, T tolerance = ndEpsilon) -{ - ndInt32 stride = ndInt32(strideInBytes / sizeof(T)); - ndStack pool(vertexCount * stride); - - ndFloat64* const data = &pool[0]; - for (ndInt32 i = 0; i < vertexCount; ++i) - { - ndFloat64* const dst = &data[i * stride]; - const T* const src = &vertexList[i * stride]; - for (ndInt32 j = 0; j < stride; ++j) - { - dst[j] = src[j]; - } - } - - ndInt32 count = ndVertexListToIndexList(data, ndInt32(stride * sizeof(ndFloat64)), compareCount, vertexCount, indexListOut, ndFloat64(tolerance)); - for (ndInt32 i = 0; i < count; ++i) - { - const ndFloat64* const src = &data[i * stride]; - T* const dst = &vertexList[i * stride]; - for (ndInt32 j = 0; j < stride; ++j) - { - dst[j] = T(src[j]); - } - } - - return count; -} - -/// Simple moving average class, useful for stuff like frame rate smoothing -template -class ndMovingAverage: public ndFixSizeArray -{ - public: - ndMovingAverage() - :ndFixSizeArray() - ,m_average(ndReal(0.0f)) - ,m_index(0) - { - Clear(); - } - - ndReal GetAverage() const - { - return m_average; - } - - void Clear() - { - m_index = 0; - m_average = ndReal(0.0f); - ndFixSizeArray::SetCount(0); - for (ndInt32 i = 0; i < size; ++i) - { - ndFixSizeArray::PushBack(ndReal(0.0f)); - } - } - - ndReal Update(ndReal value1) - { - ndReal value0 = (*this)[m_index]; - m_average += (value1 - value0) / size; - (*this)[m_index] = value1; - m_index = (m_index + 1) % size; - return GetAverage(); - } - - private: - ndReal m_average; - ndInt32 m_index; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVector.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVector.cpp deleted file mode 100644 index 14a000b198..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVector.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndVector.h" -#include "ndMatrix.h" -#include "ndSpatialVector.h" - -#ifndef D_NEWTON_USE_DOUBLE - - ndVector ndVector::m_xMask(ndInt32(-1), ndInt32(0), ndInt32(0), ndInt32(0)); - ndVector ndVector::m_yMask(ndInt32(0), ndInt32(-1), ndInt32(0), ndInt32(0)); - ndVector ndVector::m_zMask(ndInt32(0), ndInt32(0), ndInt32(-1), ndInt32(0)); - ndVector ndVector::m_wMask(ndInt32(0), ndInt32(0), ndInt32(0), ndInt32(-1)); - ndVector ndVector::m_xyzwMask(ndInt32(-1), ndInt32(-1), ndInt32(-1), ndInt32(-1)); - ndVector ndVector::m_triplexMask(ndInt32(-1), ndInt32(-1), ndInt32(-1), ndInt32(0)); - ndVector ndVector::m_signMask(ndVector(ndInt32(-1), ndInt32(-1), ndInt32(-1), ndInt32(-1)).ShiftRightLogical(1)); - - ndVector ndVector::m_zero(ndFloat32(0.0f)); - ndVector ndVector::m_one(ndFloat32(1.0f)); - ndVector ndVector::m_two(ndFloat32(2.0f)); - ndVector ndVector::m_half(ndFloat32(0.5f)); - ndVector ndVector::m_three(ndFloat32(3.0f)); - ndVector ndVector::m_negOne(ndFloat32(-1.0f)); - ndVector ndVector::m_epsilon(ndFloat32(1.0e-20f)); - ndVector ndVector::m_wOne(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f)); -#endif - -ndBigVector ndBigVector::m_zero (ndFloat64 (0.0f)); -ndBigVector ndBigVector::m_one (ndFloat64 (1.0f)); -ndBigVector ndBigVector::m_two (ndFloat64 (2.0f)); -ndBigVector ndBigVector::m_half (ndFloat32 (0.5f)); -ndBigVector ndBigVector::m_three (ndFloat32 (3.0f)); -ndBigVector ndBigVector::m_negOne (ndFloat32 (-1.0f)); -ndBigVector ndBigVector::m_epsilon(ndFloat32(1.0e-20f)); -ndBigVector ndBigVector::m_wOne (ndFloat32 (0.0f), ndFloat32 (0.0f), ndFloat32 (0.0f), ndFloat32 (1.0f)); -ndBigVector ndBigVector::m_triplexMask (ndInt32 (-1), ndInt32 (-1), ndInt32 (-1), ndInt32 (0)); -ndBigVector ndBigVector::m_signMask (ndBigVector(ndInt32 (-1), ndInt32 (-1), ndInt32 (-1), ndInt32 (-1)).ShiftRightLogical(1)); - -ndBigVector ndBigVector::m_xMask (ndInt32 (-1), ndInt32 ( 0), ndInt32 ( 0), ndInt32 ( 0)); -ndBigVector ndBigVector::m_yMask (ndInt32 ( 0), ndInt32 (-1), ndInt32 ( 0), ndInt32 ( 0)); -ndBigVector ndBigVector::m_zMask (ndInt32 ( 0), ndInt32 ( 0), ndInt32 (-1), ndInt32 ( 0)); -ndBigVector ndBigVector::m_wMask (ndInt32 ( 0), ndInt32 ( 0), ndInt32 ( 0), ndInt32 (-1)); -ndBigVector ndBigVector::m_xyzwMask (ndInt32(-1), ndInt32(-1), ndInt32(-1), ndInt32(-1)); - -ndSpatialVector ndSpatialVector::m_zero (ndFloat32 (0.0f)); - -//dMatrix dMatrix::m_zeroMatrix( -// ndVector(ndFloat32(0.0f)), -// ndVector(ndFloat32(0.0f)), -// ndVector(ndFloat32(0.0f)), -// ndVector(ndFloat32(0.0f))); -// -//dMatrix dMatrix::m_identityMatrix( -// ndVector(ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)), -// ndVector(ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f), ndFloat32(0.0f)), -// ndVector(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f), ndFloat32(0.0f)), -// ndVector(ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(1.0f))); diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVector.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVector.h deleted file mode 100644 index 08226a52ae..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVector.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_VECTOR_H__ -#define __ND_VECTOR_H__ - -#include "ndCoreStdafx.h" -#include "ndTypes.h" -#include "ndUtils.h" -#include "ndClassAlloc.h" - -#define ndCheckVector(x) (ndCheckFloat(x[0]) && ndCheckFloat(x[1]) && ndCheckFloat(x[2]) && ndCheckFloat(x[3])) - -#ifdef D_SCALAR_VECTOR_CLASS - #include "ndVectorScalar.h" -#elif (defined (__x86_64) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)) - #include "ndVectorSimd.h" -#elif (defined(__arm__) || defined(__aarch64__) || defined(__ARM_ARCH_ISA_A64) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_7A__)) - #include "ndVectorArmNeon.h" -#else - // unknown cpu assume scaler instruction set until otherwise - #include "ndVectorScalar.h" -#endif - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVectorArmNeon.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVectorArmNeon.h deleted file mode 100644 index b419da6f63..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVectorArmNeon.h +++ /dev/null @@ -1,1016 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_VECTOR_ARM_NEON_H__ -#define __ND_VECTOR_ARM_NEON_H__ - -#include - -#ifndef D_SCALAR_VECTOR_CLASS - -#ifdef D_NEWTON_USE_DOUBLE - #define ndVector ndBigVector -#else - -class ndBigVector; -// ***************************************************************************************** -// -// 4 x 1 single precision vector class declaration -// -// ***************************************************************************************** -D_MSV_NEWTON_ALIGN_16 -class ndVector -{ - public: - D_OPERATOR_NEW_AND_DELETE - - inline ndVector() - { - } - - inline ndVector(ndFloat32 val) - :m_type(vmovq_n_f32(val)) - { - } - - inline ndVector(const ndVector& v) - :m_type(v.m_type) - { - } - - inline ndVector(const float32x4_t type) - :m_type(type) - { - } - - inline ndVector(const ndFloat32* const ptr) - :m_type(vld1q_f32 (ptr)) - { - ndAssert(ndCheckVector((*this))); - } - - inline ndVector(const ndFloat32* const baseAddr, const ndInt32* const index) - :m_x(baseAddr[index[0]]) - ,m_y(baseAddr[index[1]]) - ,m_z(baseAddr[index[2]]) - ,m_w(baseAddr[index[3]]) - { - } - - -#ifndef D_NEWTON_USE_DOUBLE - inline ndVector(const ndFloat64* const ptr) - :m_x(ndFloat32(ptr[0])) - ,m_y(ndFloat32(ptr[1])) - ,m_z(ndFloat32(ptr[2])) - ,m_w(ndFloat32(ptr[3])) - { - } - - inline ndVector(ndFloat64 x, ndFloat64 y, ndFloat64 z, ndFloat64 w) - :m_x(ndFloat32(x)) - ,m_y(ndFloat32(y)) - ,m_z(ndFloat32(z)) - ,m_w(ndFloat32(w)) - { - } - - inline ndVector(const ndBigVector& copy) - :m_x(ndFloat32(((ndFloat64*)©)[0])) - ,m_y(ndFloat32(((ndFloat64*)©)[1])) - ,m_z(ndFloat32(((ndFloat64*)©)[2])) - ,m_w(ndFloat32(((ndFloat64*)©)[3])) - { - ndAssert(ndCheckVector((*this))); - } -#endif - - inline ndVector(ndFloat32 x, ndFloat32 y, ndFloat32 z, ndFloat32 w) - :m_x(x), m_y(y), m_z(z), m_w(w) - { - ndAssert(ndCheckVector((*this))); - } - - inline ndVector(ndInt32 ix, ndInt32 iy, ndInt32 iz, ndInt32 iw) - :m_ix(ix), m_iy(iy), m_iz(iz), m_iw(iw) - { - } - - inline ndFloat32 GetX() const - { - return m_x; - } - - inline ndFloat32 GetY() const - { - return m_y; - } - - inline ndFloat32 GetZ() const - { - return m_z; - } - - inline ndFloat32 GetW() const - { - return m_w; - } - - inline void SetX(ndFloat32 x) - { - m_x = x; - } - - inline void SetY(ndFloat32 x) - { - m_y = x; - } - - inline void SetZ(ndFloat32 x) - { - m_z = x; - } - - inline void SetW(ndFloat32 x) - { - m_w = x; - } - - inline ndFloat32 GetScalar() const - { - return m_x; - } - - inline void Store(ndFloat32* const dst) const - { - vst1q_f32(dst, m_type); - } - - inline ndVector BroadcastX() const - { - return ndVector(m_x); - } - - inline ndVector BroadcastY() const - { - return ndVector(m_y); - } - - inline ndVector BroadcastZ() const - { - return ndVector(m_z); - } - - inline ndVector BroadcastW() const - { - return ndVector(m_w); - } - - inline ndFloat32& operator[] (ndInt32 i) - { - ndAssert(i < 4); - ndAssert(i >= 0); - return (&m_x)[i]; - } - - inline const ndFloat32& operator[] (ndInt32 i) const - { - ndAssert(i < 4); - ndAssert(i >= 0); - return (&m_x)[i]; - } - - inline ndVector operator+ (const ndVector& A) const - { - return vaddq_f32(m_type, A.m_type); - } - - inline ndVector operator- (const ndVector& A) const - { - return vsubq_f32(m_type, A.m_type); - } - - inline ndVector operator* (const ndVector& A) const - { - return vmulq_f32(m_type, A.m_type); - } - - inline ndVector& operator+= (const ndVector& A) - { - return (*this = vaddq_f32(m_type, A.m_type)); - } - - inline ndVector& operator-= (const ndVector& A) - { - return (*this = vsubq_f32(m_type, A.m_type)); - } - - inline ndVector& operator*= (const ndVector& A) - { - return (*this = vmulq_f32(m_type, A.m_type)); - } - - inline ndVector MulAdd(const ndVector& A, const ndVector& B) const - { - //return *this + A * B; - return vmlaq_f32(m_type, A.m_type, B.m_type); - } - - inline ndVector MulSub(const ndVector& A, const ndVector& B) const - { - //return *this - A * B; - return vmlsq_f32(m_type, A.m_type, B.m_type); - } - - inline ndVector AddHorizontal() const - { - return ndVector(m_x + m_y + m_z + m_w); - } - - inline ndVector Scale(ndFloat32 scale) const - { - return ndVector(m_x * scale, m_y * scale, m_z * scale, m_w * scale); - } - - // return cross product - inline ndVector CrossProduct(const ndVector& B) const - { - return ndVector( - m_y * B.m_z - m_z * B.m_y, - m_z * B.m_x - m_x * B.m_z, - m_x * B.m_y - m_y * B.m_x, m_w); - } - - inline ndVector CrossProduct(const ndVector& A, const ndVector& B) const - { - ndFloat32 cofactor[3][3]; - ndFloat32 array[4][4]; - - const ndVector& me = *this; - for (ndInt32 i = 0; i < 4; ++i) - { - array[0][i] = me[i]; - array[1][i] = A[i]; - array[2][i] = B[i]; - array[3][i] = ndFloat32(1.0f); - } - - ndVector normal; - ndFloat32 sign = ndFloat32(-1.0f); - for (ndInt32 i = 0; i < 4; ++i) - { - for (ndInt32 j = 0; j < 3; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 4; ++k) - { - if (k != i) - { - cofactor[j][k0] = array[j][k]; - k0++; - } - } - } - ndFloat32 x = cofactor[0][0] * (cofactor[1][1] * cofactor[2][2] - cofactor[1][2] * cofactor[2][1]); - ndFloat32 y = cofactor[0][1] * (cofactor[1][2] * cofactor[2][0] - cofactor[1][0] * cofactor[2][2]); - ndFloat32 z = cofactor[0][2] * (cofactor[1][0] * cofactor[2][1] - cofactor[1][1] * cofactor[2][0]); - ndFloat32 det = x + y + z; - - normal[i] = sign * det; - sign *= ndFloat32(-1.0f); - } - - return normal; - } - - inline ndVector GetInt() const - { - return ndVector(ndInt32(ndFloor(m_x)), ndInt32(ndFloor(m_y)), ndInt32(ndFloor(m_z)), ndInt32(ndFloor(m_w))); - } - - inline ndVector TestZero() const - { - const ndInt32* const a = (ndInt32*)&m_x; - return ndVector( - (a[0] == 0) ? ndFloat32(-1.0f) : ndFloat32(0.0f), - (a[1] == 0) ? ndFloat32(-1.0f) : ndFloat32(0.0f), - (a[2] == 0) ? ndFloat32(-1.0f) : ndFloat32(0.0f), - (a[3] == 0) ? ndFloat32(-1.0f) : ndFloat32(0.0f)); - } - - inline ndVector Floor() const - { - return ndVector(ndFloor(m_x), ndFloor(m_y), ndFloor(m_z), ndFloor(m_w)); - } - - inline ndVector DotProduct(const ndVector &A) const - { - //return ndVector(m_x * A.m_x + m_y * A.m_y + m_z * A.m_z + m_w * A.m_w); - return (*this * A).AddHorizontal(); - } - - inline ndVector Divide(const ndVector& denominator) const - { - return ndVector(m_x / denominator.m_x, m_y / denominator.m_y, m_z / denominator.m_z, m_w / denominator.m_w); - } - - inline ndVector Reciproc() const - { - return ndVector(ndFloat32(1.0f) / m_x, ndFloat32(1.0f) / m_y, ndFloat32(1.0f) / m_z, ndFloat32(1.0f) / m_w); - } - - inline ndVector Sqrt() const - { - return ndVector(ndSqrt(m_x), ndSqrt(m_y), ndSqrt(m_z), ndSqrt(m_w)); - } - - inline ndVector InvSqrt() const - { - return ndVector(ndRsqrt(m_x), ndRsqrt(m_y), ndRsqrt(m_z), ndRsqrt(m_w)); - } - - inline ndVector InvMagSqrt() const - { - return ndVector(ndRsqrt(DotProduct(*this).m_x)); - } - - inline ndVector Normalize() const - { - const ndVector& me = *this; - return me * InvMagSqrt(); - } - - inline ndVector Abs() const - { - return vabsq_f32(m_type); - } - - inline ndVector GetMax() const - { - return ndVector(ndMax(ndMax(m_x, m_y), ndMax(m_z, m_w))); - } - - inline ndVector GetMax(const ndVector& data) const - { - return vmaxq_f32(m_type, data.m_type); - } - - inline ndVector GetMin(const ndVector& data) const - { - return vminq_f32(m_type, data.m_type); - } - - // relational operators - inline ndVector operator== (const ndVector& data) const - { - return vceqq_f32(m_typeInt, data.m_typeInt); - } - - inline ndVector operator> (const ndVector& data) const - { - return vcgtq_f32(m_typeInt, data.m_typeInt); - } - - inline ndVector operator< (const ndVector& data) const - { - return vcltq_f32(m_typeInt, data.m_typeInt); - } - - inline ndVector operator>= (const ndVector& data) const - { - return vcgeq_f32(m_typeInt, data.m_typeInt); - } - - inline ndVector operator<= (const ndVector& data) const - { - return vcleq_f32(m_typeInt, data.m_typeInt); - } - - // logical operations - inline ndVector operator& (const ndVector& data) const - { - return vandq_u32(m_typeInt, data.m_typeInt); - } - - inline ndVector operator| (const ndVector& data) const - { - return vorrq_u32(m_typeInt, data.m_typeInt); - } - - inline ndVector operator^ (const ndVector& data) const - { - return veorq_u32(m_typeInt, data.m_typeInt); - } - - inline ndVector AndNot(const ndVector& data) const - { - return vbicq_u32(m_typeInt, data.m_typeInt); - } - - inline ndVector Select(const ndVector& data, const ndVector& mask) const - { - // (((b ^ a) & mask)^a) - return (*this) ^ (mask & (data ^ (*this))); - } - - inline ndInt32 GetSignMask() const - { - const ndInt32* const a = (ndInt32*)&m_x; - return (((a[0] & 0x80000000) ? 1 : 0) | ((a[1] & 0x80000000) ? 2 : 0) | ((a[2] & 0x80000000) ? 4 : 0) | ((a[3] & 0x80000000) ? 8 : 0)); - } - - inline ndVector ShiftRight() const - { - return ndVector(m_w, m_x, m_y, m_z); - } - - inline ndVector ShiftTripleRight() const - { - return ndVector(m_z, m_x, m_y, m_w); - } - - inline ndVector ShiftTripleLeft() const - { - return ndVector(m_y, m_z, m_x, m_w); - } - - inline ndVector ShiftRightLogical(ndInt32 bits) const - { - return ndVector(ndInt32(ndUnsigned32(m_ix) >> bits), ndInt32(ndUnsigned32(m_iy) >> bits), ndInt32(ndUnsigned32(m_iz) >> bits), ndInt32(ndUnsigned32(m_iw) >> bits)); - } - - inline ndVector OptimizedVectorUnrotate(const ndVector& front, const ndVector& up, const ndVector& right) const - { - // for now since I can't test arm on PC - return ndVector( - m_x * front.m_x + m_y * front.m_y + m_z * front.m_z, - m_x * up.m_x + m_y * up.m_y + m_z * up.m_z, - m_x * right.m_x + m_y * right.m_y + m_z * right.m_z, - ndFloat32(0.0f)); - } - - inline static void Transpose4x4(ndVector& dst0, ndVector& dst1, ndVector& dst2, ndVector& dst3, const ndVector& src0, const ndVector& src1, const ndVector& src2, const ndVector& src3) - { - float32x4x2_t vtrn1 = vzipq_f32(src0.m_type, src2.m_type); - float32x4x2_t vtrn2 = vzipq_f32(src1.m_type, src3.m_type); - float32x4x2_t res1 = vzipq_f32(vtrn1.val[0], vtrn2.val[0]); - float32x4x2_t res2 = vzipq_f32(vtrn1.val[1], vtrn2.val[1]); - dst0.m_type = res1.val[0]; - dst1.m_type = res1.val[1]; - dst2.m_type = res2.val[0]; - dst3.m_type = res2.val[1]; - } - - union - { - ndFloat32 m_f[4]; - ndInt32 m_i[4]; - float32x4_t m_type; - uint32x4_t m_typeInt; - struct - { - ndFloat32 m_x; - ndFloat32 m_y; - ndFloat32 m_z; - ndFloat32 m_w; - }; - struct - { - ndInt32 m_ix; - ndInt32 m_iy; - ndInt32 m_iz; - ndInt32 m_iw; - }; - }; - - D_CORE_API static ndVector m_zero; - D_CORE_API static ndVector m_one; - D_CORE_API static ndVector m_wOne; - D_CORE_API static ndVector m_half; - D_CORE_API static ndVector m_two; - D_CORE_API static ndVector m_three; - D_CORE_API static ndVector m_negOne; - D_CORE_API static ndVector m_xMask; - D_CORE_API static ndVector m_yMask; - D_CORE_API static ndVector m_zMask; - D_CORE_API static ndVector m_wMask; - D_CORE_API static ndVector m_xyzwMask; - D_CORE_API static ndVector m_epsilon; - D_CORE_API static ndVector m_signMask; - D_CORE_API static ndVector m_triplexMask; -} D_GCC_NEWTON_ALIGN_16; -#endif - -D_MSV_NEWTON_ALIGN_32 -class ndBigVector -{ - public: - D_OPERATOR_NEW_AND_DELETE - - inline ndBigVector() - { - } - - inline ndBigVector(ndFloat64 val) - :m_x(val), m_y(val), m_z(val), m_w(val) - { - } - - inline ndBigVector(const ndBigVector& v) - : m_x(v.m_x), m_y(v.m_y), m_z(v.m_z), m_w(v.m_w) - { - } - -#ifndef D_NEWTON_USE_DOUBLE - inline ndBigVector(const ndVector& v) - : m_x(v.m_x), m_y(v.m_y), m_z(v.m_z), m_w(v.m_w) - { - } - - inline ndBigVector(const ndFloat32* const ptr) - : m_x(ptr[0]), m_y(ptr[1]), m_z(ptr[2]), m_w(ndFloat32(0.0f)) - { - ndAssert(ndCheckVector((*this))); - } -#endif - - inline ndBigVector(const ndFloat64* const ptr) - :m_x(ptr[0]), m_y(ptr[1]), m_z(ptr[2]), m_w(ptr[3]) - { - ndAssert(ndCheckVector((*this))); - } - - inline ndBigVector(ndFloat64 x, ndFloat64 y, ndFloat64 z, ndFloat64 w) - : m_x(x), m_y(y), m_z(z), m_w(w) - { - ndAssert(ndCheckVector((*this))); - } - - inline ndBigVector(ndInt32 ix, ndInt32 iy, ndInt32 iz, ndInt32 iw) - : m_ix(ix), m_iy(iy), m_iz(iz), m_iw(iw) - { - } - - inline ndBigVector(ndInt64 ix, ndInt64 iy, ndInt64 iz, ndInt64 iw) - : m_ix(ix), m_iy(iy), m_iz(iz), m_iw(iw) - { - } - - inline ndFloat64 GetX() const - { - return m_x; - } - - inline ndFloat64 GetY() const - { - return m_y; - } - - inline ndFloat64 GetZ() const - { - return m_z; - } - - inline ndFloat64 GetW() const - { - return m_w; - } - - inline void SetX(ndFloat64 x) - { - m_x = x; - } - - inline void SetY(ndFloat64 x) - { - m_y = x; - } - - inline void SetZ(ndFloat64 x) - { - m_z = x; - } - - inline void SetW(ndFloat64 x) - { - m_w = x; - } - - inline ndFloat64 GetScalar() const - { - return m_x; - } - - inline void Store(ndFloat64* const dst) const - { - dst[0] = m_x; - dst[1] = m_y; - dst[2] = m_z; - dst[3] = m_w; - } - - inline ndBigVector BroadcastX() const - { - return ndBigVector(m_x); - } - - inline ndBigVector BroadcastY() const - { - return ndBigVector(m_y); - } - - inline ndBigVector BroadcastZ() const - { - return ndBigVector(m_z); - } - - inline ndBigVector BroadcastW() const - { - return ndBigVector(m_w); - } - - inline ndFloat64& operator[] (ndInt32 i) - { - ndAssert(i < 4); - ndAssert(i >= 0); - return (&m_x)[i]; - } - - inline const ndFloat64& operator[] (ndInt32 i) const - { - ndAssert(i < 4); - ndAssert(i >= 0); - return (&m_x)[i]; - } - - inline ndBigVector operator+ (const ndBigVector& A) const - { - return ndBigVector(m_x + A.m_x, m_y + A.m_y, m_z + A.m_z, m_w + A.m_w); - } - - inline ndBigVector operator- (const ndBigVector& A) const - { - return ndBigVector(m_x - A.m_x, m_y - A.m_y, m_z - A.m_z, m_w - A.m_w); - } - - inline ndBigVector operator* (const ndBigVector& A) const - { - return ndBigVector(m_x * A.m_x, m_y * A.m_y, m_z * A.m_z, m_w * A.m_w); - } - - inline ndBigVector& operator+= (const ndBigVector& A) - { - return (*this = ndBigVector(m_x + A.m_x, m_y + A.m_y, m_z + A.m_z, m_w + A.m_w)); - } - - inline ndBigVector& operator-= (const ndBigVector& A) - { - return (*this = ndBigVector(m_x - A.m_x, m_y - A.m_y, m_z - A.m_z, m_w - A.m_w)); - } - - inline ndBigVector& operator*= (const ndBigVector& A) - { - return (*this = ndBigVector(m_x * A.m_x, m_y * A.m_y, m_z * A.m_z, m_w * A.m_w)); - } - - inline ndBigVector MulAdd(const ndBigVector& A, const ndBigVector& B) const - { - return *this + A * B; - } - - inline ndBigVector MulSub(const ndVector& A, const ndBigVector& B) const - { - return *this - A * B; - } - - - inline ndBigVector AddHorizontal() const - { - return ndBigVector(m_x + m_y + m_z + m_w); - } - - inline ndBigVector Scale(ndFloat64 scale) const - { - return ndBigVector(m_x * scale, m_y * scale, m_z * scale, m_w * scale); - } - - // return cross product - inline ndBigVector CrossProduct(const ndBigVector& B) const - { - return ndBigVector(m_y * B.m_z - m_z * B.m_y, m_z * B.m_x - m_x * B.m_z, m_x * B.m_y - m_y * B.m_x, m_w); - } - - inline ndBigVector CrossProduct(const ndBigVector& A, const ndBigVector& B) const - { - ndFloat64 cofactor[3][3]; - ndFloat64 array[4][4]; - - const ndBigVector& me = *this; - for (ndInt32 i = 0; i < 4; ++i) { - array[0][i] = me[i]; - array[1][i] = A[i]; - array[2][i] = B[i]; - array[3][i] = ndFloat32(1.0f); - } - - ndBigVector normal; - ndFloat64 sign = ndFloat64(-1.0f); - for (ndInt32 i = 0; i < 4; ++i) - { - for (ndInt32 j = 0; j < 3; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 4; ++k) - { - if (k != i) - { - cofactor[j][k0] = array[j][k]; - k0++; - } - } - } - ndFloat64 x = cofactor[0][0] * (cofactor[1][1] * cofactor[2][2] - cofactor[1][2] * cofactor[2][1]); - ndFloat64 y = cofactor[0][1] * (cofactor[1][2] * cofactor[2][0] - cofactor[1][0] * cofactor[2][2]); - ndFloat64 z = cofactor[0][2] * (cofactor[1][0] * cofactor[2][1] - cofactor[1][1] * cofactor[2][0]); - ndFloat64 det = x + y + z; - - normal[i] = sign * det; - sign *= ndFloat64(-1.0f); - } - - return normal; - } - - inline ndBigVector GetInt() const - { - return ndBigVector(ndInt64(floor(m_x)), ndInt64(floor(m_y)), ndInt64(floor(m_z)), ndInt64(floor(m_w))); - } - - inline ndBigVector TestZero() const - { - const ndInt64* const a = (ndInt64*)&m_x; - return ndBigVector((a[0] == 0) ? ndFloat64(-1.0f) : ndFloat64(1.0f), - (a[1] == 0) ? ndFloat64(-1.0f) : ndFloat64(1.0f), - (a[2] == 0) ? ndFloat64(-1.0f) : ndFloat64(1.0f), - (a[3] == 0) ? ndFloat64(-1.0f) : ndFloat64(1.0f)); - } - - - inline ndBigVector Floor() const - { - return ndBigVector(floor(m_x), floor(m_y), floor(m_z), floor(m_w)); - } - - inline ndBigVector DotProduct(const ndBigVector &A) const - { - //return ndBigVector(m_x * A.m_x + m_y * A.m_y + m_z * A.m_z + m_w * A.m_w); - return (*this * A).AddHorizontal(); - } - - inline ndBigVector Divide(const ndBigVector& denominator) const - { - return ndVector(m_x / denominator.m_x, m_y / denominator.m_y, m_z / denominator.m_z, m_w / denominator.m_w); - } - - inline ndBigVector Reciproc() const - { - return ndBigVector(ndFloat64(1.0f) / m_x, ndFloat64(1.0f) / m_y, ndFloat64(1.0f) / m_z, ndFloat64(1.0f) / m_w); - } - - inline ndBigVector Sqrt() const - { - return ndBigVector(sqrt(m_x), sqrt(m_y), sqrt(m_z), sqrt(m_w)); - } - - inline ndBigVector InvSqrt() const - { - return ndBigVector(ndFloat64(1.0f) / sqrt(m_x), ndFloat64(1.0f) / sqrt(m_y), ndFloat64(1.0f) / sqrt(m_z), ndFloat64(1.0f) / sqrt(m_w)); - } - - inline ndBigVector InvMagSqrt() const - { - return ndBigVector(ndFloat64(1.0f) / sqrt(DotProduct(*this).m_x)); - } - - inline ndBigVector Normalize() const - { - return *this * InvMagSqrt(); - } - - inline ndBigVector Abs() const - { - return ndBigVector( - (m_x > ndFloat64(0.0f)) ? m_x : -m_x, - (m_y > ndFloat64(0.0f)) ? m_y : -m_y, - (m_z > ndFloat64(0.0f)) ? m_z : -m_z, - (m_w > ndFloat64(0.0f)) ? m_w : -m_w); - } - - inline ndBigVector GetMax() const - { - return ndBigVector(ndMax(ndMax(m_x, m_y), ndMax(m_z, m_w))); - } - - inline ndBigVector GetMax(const ndBigVector& data) const - { - return ndBigVector( - (m_x > data.m_x) ? m_x : data.m_x, - (m_y > data.m_y) ? m_y : data.m_y, - (m_z > data.m_z) ? m_z : data.m_z, - (m_w > data.m_w) ? m_w : data.m_w); - } - - inline ndBigVector GetMin(const ndBigVector& data) const - { - return ndBigVector( - (m_x < data.m_x) ? m_x : data.m_x, - (m_y < data.m_y) ? m_y : data.m_y, - (m_z < data.m_z) ? m_z : data.m_z, - (m_w < data.m_w) ? m_w : data.m_w); - } - - // relational operators - inline ndBigVector operator== (const ndBigVector& data) const - { - return ndBigVector( - (m_x == data.m_x) ? ndInt64(-1) : ndInt64(0), - (m_y == data.m_y) ? ndInt64(-1) : ndInt64(0), - (m_z == data.m_z) ? ndInt64(-1) : ndInt64(0), - (m_w == data.m_w) ? ndInt64(-1) : ndInt64(0)); - } - - inline ndBigVector operator> (const ndBigVector& data) const - { - return ndBigVector( - (m_x > data.m_x) ? ndInt64(-1) : ndInt64(0), - (m_y > data.m_y) ? ndInt64(-1) : ndInt64(0), - (m_z > data.m_z) ? ndInt64(-1) : ndInt64(0), - (m_w > data.m_w) ? ndInt64(-1) : ndInt64(0)); - } - - inline ndBigVector operator< (const ndBigVector& data) const - { - return ndBigVector( - (m_x < data.m_x) ? ndInt64(-1) : ndInt64(0), - (m_y < data.m_y) ? ndInt64(-1) : ndInt64(0), - (m_z < data.m_z) ? ndInt64(-1) : ndInt64(0), - (m_w < data.m_w) ? ndInt64(-1) : ndInt64(0)); - } - - inline ndBigVector operator>= (const ndBigVector& data) const - { - return ndBigVector( - (m_x >= data.m_x) ? ndInt64(-1) : ndInt64(0), - (m_y >= data.m_y) ? ndInt64(-1) : ndInt64(0), - (m_z >= data.m_z) ? ndInt64(-1) : ndInt64(0), - (m_w >= data.m_w) ? ndInt64(-1) : ndInt64(0)); - } - - inline ndBigVector operator<= (const ndBigVector& data) const - { - return ndBigVector( - (m_x <= data.m_x) ? ndInt64(-1) : ndInt64(0), - (m_y <= data.m_y) ? ndInt64(-1) : ndInt64(0), - (m_z <= data.m_z) ? ndInt64(-1) : ndInt64(0), - (m_w <= data.m_w) ? ndInt64(-1) : ndInt64(0)); - } - - // logical operations - inline ndBigVector operator& (const ndBigVector& data) const - { - const ndInt64* const a = (ndInt64*)&m_x; - const ndInt64* const b = (ndInt64*)&data.m_x; - return ndBigVector(a[0] & b[0], a[1] & b[1], a[2] & b[2], a[3] & b[3]); - } - - inline ndBigVector operator| (const ndBigVector& data) const - { - const ndInt64* const a = (ndInt64*)&m_x; - const ndInt64* const b = (ndInt64*)&data.m_x; - return ndBigVector(a[0] | b[0], a[1] | b[1], a[2] | b[2], a[3] | b[3]); - } - - inline ndBigVector operator^ (const ndBigVector& data) const - { - const ndInt64* const a = (ndInt64*)&m_x; - const ndInt64* const b = (ndInt64*)&data.m_x; - return ndBigVector(a[0] ^ b[0], a[1] ^ b[1], a[2] ^ b[2], a[3] ^ b[3]); - } - - inline ndBigVector AndNot(const ndBigVector& data) const - { - const ndInt64* const a = (ndInt64*)&m_x; - const ndInt64* const b = (ndInt64*)&data.m_x; - return ndBigVector(a[0] & ~b[0], a[1] & ~b[1], a[2] & ~b[2], a[3] & ~b[3]); - } - - inline ndBigVector Select(const ndBigVector& data, const ndBigVector& mask) const - { - // (((b ^ a) & mask)^a) - return (*this) ^ (mask & (data ^ (*this))); - } - - inline ndInt32 GetSignMask() const - { - const ndInt64* const a = (ndInt64*)&m_x; - return (((a[0] >> 63) ? 1 : 0) | ((a[1] >> 63) ? 2 : 0) | ((a[2] >> 63) ? 4 : 0) | ((a[3] >> 63) ? 8 : 0)); - } - - inline ndVector ShiftRight() const - { - return ndBigVector(m_w, m_x, m_y, m_z); - } - - inline ndBigVector ShiftTripleRight() const - { - return ndBigVector(m_z, m_x, m_y, m_w); - } - - inline ndBigVector ShiftTripleLeft() const - { - return ndBigVector(m_y, m_z, m_x, m_w); - } - - inline ndBigVector ShiftRightLogical(ndInt32 bits) const - { - return ndBigVector(ndInt64(ndUnsigned64(m_ix) >> bits), ndInt64(ndUnsigned64(m_iy) >> bits), ndInt64(ndUnsigned64(m_iz) >> bits), ndInt64(ndUnsigned64(m_iw) >> bits)); - } - - inline ndBigVector OptimizedVectorUnrotate(const ndBigVector& front, const ndBigVector& up, const ndBigVector& right) const - { - return ndBigVector( - m_x * front.m_x + m_y * front.m_y + m_z * front.m_z, - m_x * up.m_x + m_y * up.m_y + m_z * up.m_z, - m_x * right.m_x + m_y * right.m_y + m_z * right.m_z, - ndFloat64(0.0f)); - } - - inline static void Transpose4x4(ndBigVector& dst0, ndBigVector& dst1, ndBigVector& dst2, ndBigVector& dst3, const ndBigVector& src0, const ndBigVector& src1, const ndBigVector& src2, const ndBigVector& src3) - { - ndBigVector tmp0(src0); - ndBigVector tmp1(src1); - ndBigVector tmp2(src2); - ndBigVector tmp3(src3); - - dst0 = ndBigVector(tmp0.m_x, tmp1.m_x, tmp2.m_x, tmp3.m_x); - dst1 = ndBigVector(tmp0.m_y, tmp1.m_y, tmp2.m_y, tmp3.m_y); - dst2 = ndBigVector(tmp0.m_z, tmp1.m_z, tmp2.m_z, tmp3.m_z); - dst3 = ndBigVector(tmp0.m_w, tmp1.m_w, tmp2.m_w, tmp3.m_w); - } - - union - { - struct - { - ndFloat64 m_x; - ndFloat64 m_y; - ndFloat64 m_z; - ndFloat64 m_w; - }; - struct - { - ndInt64 m_ix; - ndInt64 m_iy; - ndInt64 m_iz; - ndInt64 m_iw; - }; - ndInt64 m_i[4]; - }; - - D_CORE_API static ndBigVector m_zero; - D_CORE_API static ndBigVector m_one; - D_CORE_API static ndBigVector m_wOne; - D_CORE_API static ndBigVector m_half; - D_CORE_API static ndBigVector m_two; - D_CORE_API static ndBigVector m_three; - D_CORE_API static ndBigVector m_negOne; - D_CORE_API static ndBigVector m_xMask; - D_CORE_API static ndBigVector m_yMask; - D_CORE_API static ndBigVector m_zMask; - D_CORE_API static ndBigVector m_wMask; - D_CORE_API static ndBigVector m_xyzwMask; - D_CORE_API static ndBigVector m_epsilon; - D_CORE_API static ndBigVector m_signMask; - D_CORE_API static ndBigVector m_triplexMask; -} D_GCC_NEWTON_ALIGN_32; - -#endif -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVectorScalar.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVectorScalar.h deleted file mode 100644 index 0350bc3b3f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVectorScalar.h +++ /dev/null @@ -1,1076 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_VECTOR_SCALAR_H__ -#define __ND_VECTOR_SCALAR_H__ - -// ***************************************************************************************** -// -// 4 x 1 single precision vector class declaration -// -// ***************************************************************************************** -#ifdef D_NEWTON_USE_DOUBLE - #define ndVector ndBigVector -#else - -class ndBigVector; -// ***************************************************************************************** -// -// 4 x 1 single precision SSE vector class declaration -// -// ***************************************************************************************** -D_MSV_NEWTON_ALIGN_16 -class ndVector -{ - public: - D_OPERATOR_NEW_AND_DELETE - - inline ndVector() - { - } - - inline ndVector(ndFloat32 val) - :m_x(val), m_y(val), m_z(val), m_w(val) - { - } - - inline ndVector (const ndVector& v) - :m_x(v.m_x), m_y(v.m_y), m_z(v.m_z), m_w(v.m_w) - { - } - - inline ndVector (const ndFloat32* const ptr) - :m_x(ptr[0]) - ,m_y(ptr[1]) - ,m_z(ptr[2]) - ,m_w(ptr[3]) - { - ndAssert (ndCheckVector ((*this))); - } - - // emulate gather instruction - inline ndVector(const ndFloat32* const baseAddr, const ndInt32* const index) - :m_x(baseAddr[index[0]]) - ,m_y(baseAddr[index[1]]) - ,m_z(baseAddr[index[2]]) - ,m_w(baseAddr[index[3]]) - { - } - -#ifndef D_NEWTON_USE_DOUBLE - inline ndVector(const ndFloat64* const ptr) - :m_x(ndFloat32(ptr[0])) - ,m_y(ndFloat32(ptr[1])) - ,m_z(ndFloat32(ptr[2])) - ,m_w(ndFloat32(ptr[3])) - { - } - - inline ndVector(ndFloat64 x, ndFloat64 y, ndFloat64 z, ndFloat64 w) - :m_x(ndFloat32(x)) - ,m_y(ndFloat32(y)) - ,m_z(ndFloat32(z)) - ,m_w(ndFloat32(w)) - { - } - - inline ndVector(const ndBigVector& copy) - :m_x(ndFloat32(((ndFloat64*)©)[0])) - ,m_y(ndFloat32(((ndFloat64*)©)[1])) - ,m_z(ndFloat32(((ndFloat64*)©)[2])) - ,m_w(ndFloat32(((ndFloat64*)©)[3])) - { - ndAssert(ndCheckVector((*this))); - } -#endif - - inline ndVector (ndFloat32 x, ndFloat32 y, ndFloat32 z, ndFloat32 w) - :m_x(x), m_y(y), m_z(z), m_w(w) - { - ndAssert (ndCheckVector ((*this))); - } - - inline ndVector (ndInt32 ix, ndInt32 iy, ndInt32 iz, ndInt32 iw) - :m_ix(ix), m_iy(iy), m_iz(iz), m_iw(iw) - { - } - - inline ndFloat32 GetScalar () const - { - return m_x; - } - - inline void Store (ndFloat32* const dst) const - { - dst[0] = m_x; - dst[1] = m_y; - dst[2] = m_z; - dst[3] = m_w; - } - - inline ndFloat32 GetX() const - { - return m_x; - } - - inline ndFloat32 GetY() const - { - return m_y; - } - - inline ndFloat32 GetZ() const - { - return m_z; - } - - inline ndFloat32 GetW() const - { - return m_w; - } - - inline void SetX(ndFloat32 x) - { - m_x = x; - } - - inline void SetY(ndFloat32 x) - { - m_y = x; - } - - inline void SetZ(ndFloat32 x) - { - m_z = x; - } - - inline void SetW(ndFloat32 x) - { - m_w = x; - } - - inline ndVector BroadcastX () const - { - return ndVector (m_x); - } - - inline ndVector BroadcastY () const - { - return ndVector (m_y); - } - - inline ndVector BroadcastZ () const - { - return ndVector (m_z); - } - - inline ndVector BroadcastW () const - { - return ndVector (m_w); - } - - inline ndFloat32& operator[] (ndInt32 i) - { - ndAssert (i < 4); - ndAssert (i >= 0); - return (&m_x)[i]; - } - - inline const ndFloat32& operator[] (ndInt32 i) const - { - ndAssert (i < 4); - ndAssert (i >= 0); - return (&m_x)[i]; - } - - inline ndVector& operator= (const ndVector& A) - { - m_x = A.m_x; - m_y = A.m_y; - m_z = A.m_z; - m_w = A.m_w; - return *this; - } - - inline ndVector operator+ (const ndVector& A) const - { - return ndVector (m_x + A.m_x, m_y + A.m_y, m_z + A.m_z, m_w + A.m_w); - } - - inline ndVector operator- (const ndVector& A) const - { - return ndVector (m_x - A.m_x, m_y - A.m_y, m_z - A.m_z, m_w - A.m_w); - } - - inline ndVector operator* (const ndVector& A) const - { - return ndVector(m_x * A.m_x, m_y * A.m_y, m_z * A.m_z, m_w * A.m_w); - } - - inline ndVector& operator+= (const ndVector& A) - { - return (*this = ndVector (m_x + A.m_x, m_y + A.m_y, m_z + A.m_z, m_w + A.m_w)); - } - - inline ndVector& operator-= (const ndVector& A) - { - return (*this = ndVector (m_x - A.m_x, m_y - A.m_y, m_z - A.m_z, m_w - A.m_w)); - } - - inline ndVector& operator*= (const ndVector& A) - { - return (*this = ndVector(m_x * A.m_x, m_y * A.m_y, m_z * A.m_z, m_w * A.m_w)); - } - - inline ndVector MulAdd(const ndVector& A, const ndVector& B) const - { - return *this + A * B; - } - - inline ndVector MulSub(const ndVector& A, const ndVector& B) const - { - return *this - A * B; - } - - inline ndVector AddHorizontal () const - { - return ndVector (m_x + m_y + m_z + m_w); - } - - inline ndVector Scale (ndFloat32 scale) const - { - return ndVector (m_x * scale, m_y * scale, m_z * scale, m_w * scale); - } - - // return cross product - inline ndVector CrossProduct (const ndVector& B) const - { - return ndVector (m_y * B.m_z - m_z * B.m_y, - m_z * B.m_x - m_x * B.m_z, - m_x * B.m_y - m_y * B.m_x, m_w); - } - - inline ndVector CrossProduct (const ndVector& A, const ndVector& B) const - { - ndFloat32 cofactor[3][3]; - ndFloat32 array[4][4]; - - const ndVector& me = *this; - for (ndInt32 i = 0; i < 4; ++i) - { - array[0][i] = me[i]; - array[1][i] = A[i]; - array[2][i] = B[i]; - array[3][i] = ndFloat32 (1.0f); - } - - ndVector normal; - ndFloat32 sign = ndFloat32 (-1.0f); - for (ndInt32 i = 0; i < 4; ++i) - { - for (ndInt32 j = 0; j < 3; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 4; ++k) - { - if (k != i) - { - cofactor[j][k0] = array[j][k]; - k0 ++; - } - } - } - ndFloat32 x = cofactor[0][0] * (cofactor[1][1] * cofactor[2][2] - cofactor[1][2] * cofactor[2][1]); - ndFloat32 y = cofactor[0][1] * (cofactor[1][2] * cofactor[2][0] - cofactor[1][0] * cofactor[2][2]); - ndFloat32 z = cofactor[0][2] * (cofactor[1][0] * cofactor[2][1] - cofactor[1][1] * cofactor[2][0]); - ndFloat32 det = x + y + z; - - normal[i] = sign * det; - sign *= ndFloat32 (-1.0f); - } - - return normal; - } - - inline ndVector GetInt () const - { - return ndVector (ndInt32 (ndFloor (m_x)), ndInt32(ndFloor (m_y)), ndInt32(ndFloor (m_z)), ndInt32 (ndFloor (m_w))); - } - - inline ndVector TestZero() const - { - const ndInt32* const a = (ndInt32*)&m_x; - return ndVector ( - (a[0] == 0) ? ndFloat32 (-1.0f) : ndFloat32 (0.0f), - (a[1] == 0) ? ndFloat32 (-1.0f) : ndFloat32 (0.0f), - (a[2] == 0) ? ndFloat32 (-1.0f) : ndFloat32 (0.0f), - (a[3] == 0) ? ndFloat32 (-1.0f) : ndFloat32 (0.0f)); - } - - inline ndVector Floor () const - { - return ndVector (ndFloor (m_x), ndFloor (m_y), ndFloor (m_z), ndFloor (m_w)); - } - - inline ndVector DotProduct (const ndVector &A) const - { - return ndVector (m_x * A.m_x + m_y * A.m_y + m_z * A.m_z + m_w * A.m_w); - } - - inline ndVector Divide(const ndVector& denominator) const - { - return ndVector(m_x / denominator.m_x, m_y / denominator.m_y, m_z / denominator.m_z, m_w / denominator.m_w); - } - - inline ndVector Reciproc () const - { - return ndVector (ndFloat32 (1.0f) / m_x, ndFloat32 (1.0f) / m_y, ndFloat32 (1.0f) / m_z, ndFloat32 (1.0f) / m_w); - } - - inline ndVector Sqrt () const - { - return ndVector (ndSqrt (m_x), ndSqrt (m_y), ndSqrt (m_z), ndSqrt (m_w)); - } - - inline ndVector InvSqrt () const - { - return ndVector (ndRsqrt (m_x), ndRsqrt (m_y), ndRsqrt (m_z), ndRsqrt (m_w)); - } - - inline ndVector InvMagSqrt () const - { - return ndVector (ndRsqrt (DotProduct(*this).m_x)); - } - - inline ndVector Normalize () const - { - const ndVector& me = *this; - return me * InvMagSqrt(); - } - - inline ndVector Abs () const - { - return ndVector ( - (m_x > ndFloat32 (0.0f)) ? m_x : -m_x, - (m_y > ndFloat32 (0.0f)) ? m_y : -m_y, - (m_z > ndFloat32 (0.0f)) ? m_z : -m_z, - (m_w > ndFloat32 (0.0f)) ? m_w : -m_w); - } - - inline ndVector GetMax () const - { - return ndVector (ndMax(ndMax(m_x, m_y), ndMax(m_z, m_w))); - } - - inline ndVector GetMax (const ndVector& data) const - { - return ndVector ( - (m_x > data.m_x) ? m_x : data.m_x, - (m_y > data.m_y) ? m_y : data.m_y, - (m_z > data.m_z) ? m_z : data.m_z, - (m_w > data.m_w) ? m_w : data.m_w); - } - - inline ndVector GetMin (const ndVector& data) const - { - return ndVector ( - (m_x < data.m_x) ? m_x : data.m_x, - (m_y < data.m_y) ? m_y : data.m_y, - (m_z < data.m_z) ? m_z : data.m_z, - (m_w < data.m_w) ? m_w : data.m_w); - } - - - // relational operators - inline ndVector operator== (const ndVector& data) const - { - return ndVector ( - (m_x == data.m_x) ? ndInt32 (0xffffffff) : 0, - (m_y == data.m_y) ? ndInt32 (0xffffffff) : 0, - (m_z == data.m_z) ? ndInt32 (0xffffffff) : 0, - (m_w == data.m_w) ? ndInt32 (0xffffffff) : 0); - } - - inline ndVector operator> (const ndVector& data) const - { - return ndVector ( - (m_x > data.m_x) ? ndInt32 (0xffffffff) : 0, - (m_y > data.m_y) ? ndInt32 (0xffffffff) : 0, - (m_z > data.m_z) ? ndInt32 (0xffffffff) : 0, - (m_w > data.m_w) ? ndInt32 (0xffffffff) : 0); - } - - inline ndVector operator< (const ndVector& data) const - { - return ndVector ( - (m_x < data.m_x) ? ndInt32 (0xffffffff) : 0, - (m_y < data.m_y) ? ndInt32 (0xffffffff) : 0, - (m_z < data.m_z) ? ndInt32 (0xffffffff) : 0, - (m_w < data.m_w) ? ndInt32 (0xffffffff) : 0); - } - - inline ndVector operator>= (const ndVector& data) const - { - return ndVector ( - (m_x >= data.m_x) ? ndInt32 (0xffffffff) : 0, - (m_y >= data.m_y) ? ndInt32 (0xffffffff) : 0, - (m_z >= data.m_z) ? ndInt32 (0xffffffff) : 0, - (m_w >= data.m_w) ? ndInt32 (0xffffffff) : 0); - } - - inline ndVector operator<= (const ndVector& data) const - { - return ndVector ( - (m_x <= data.m_x) ? ndInt32 (0xffffffff) : 0, - (m_y <= data.m_y) ? ndInt32 (0xffffffff) : 0, - (m_z <= data.m_z) ? ndInt32 (0xffffffff) : 0, - (m_w <= data.m_w) ? ndInt32 (0xffffffff) : 0); - } - - // logical operations - inline ndVector operator& (const ndVector& data) const - { - const ndInt32* const a = (ndInt32*)&m_x; - const ndInt32* const b = (ndInt32*)&data.m_x; - return ndVector (a[0] & b[0], a[1] & b[1], a[2] & b[2], a[3] & b[3]); - } - - inline ndVector operator| (const ndVector& data) const - { - const ndInt32* const a = (ndInt32*)&m_x; - const ndInt32* const b = (ndInt32*)&data.m_x; - return ndVector (a[0] | b[0], a[1] | b[1], a[2] | b[2], a[3] | b[3]); - } - - inline ndVector operator^ (const ndVector& data) const - { - const ndInt32* const a = (ndInt32*)&m_x; - const ndInt32* const b = (ndInt32*)&data.m_x; - return ndVector (a[0] ^ b[0], a[1] ^ b[1], a[2] ^ b[2], a[3] ^ b[3]); - } - - inline ndVector AndNot (const ndVector& data) const - { - const ndInt32* const a = (ndInt32*)&m_x; - const ndInt32* const b = (ndInt32*)&data.m_x; - return ndVector (a[0] & ~b[0], a[1] & ~b[1], a[2] & ~b[2], a[3] & ~b[3]); - } - - inline ndVector Select (const ndVector& data, const ndVector& mask) const - { - // (((b ^ a) & mask)^a) - return (*this) ^ (mask & (data ^ (*this))); - } - - inline ndInt32 GetSignMask() const - { - const ndInt32* const a = (ndInt32*)&m_x; - return (((a[0] & 0x80000000) ? 1 : 0) | ((a[1] & 0x80000000) ? 2 : 0) | ((a[2] & 0x80000000) ? 4 : 0) | ((a[3] & 0x80000000) ? 8 : 0)); - } - - inline ndVector ShiftRight() const - { - return ndVector (m_w, m_x, m_y, m_z); - } - - inline ndVector ShiftTripleRight () const - { - return ndVector (m_z, m_x, m_y, m_w); - } - - inline ndVector ShiftTripleLeft () const - { - return ndVector (m_y, m_z, m_x, m_w); - } - - inline ndVector ShiftRightLogical (ndInt32 bits) const - { - return ndVector (ndInt32 (ndUnsigned32 (m_ix) >> bits), ndInt32 (ndUnsigned32 (m_iy) >> bits), ndInt32 (ndUnsigned32 (m_iz) >> bits), ndInt32 (ndUnsigned32 (m_iw) >> bits)); - } - - inline ndVector OptimizedVectorUnrotate(const ndVector& front, const ndVector& up, const ndVector& right) const - { - return ndVector( - m_x * front.m_x + m_y * front.m_y + m_z * front.m_z, - m_x * up.m_x + m_y * up.m_y + m_z * up.m_z, - m_x * right.m_x + m_y * right.m_y + m_z * right.m_z, - ndFloat32(0.0f)); - } - - inline static void Transpose4x4 (ndVector& dst0, ndVector& dst1, ndVector& dst2, ndVector& dst3, const ndVector& src0, const ndVector& src1, const ndVector& src2, const ndVector& src3) - { - ndVector tmp0 (src0); - ndVector tmp1 (src1); - ndVector tmp2 (src2); - ndVector tmp3 (src3); - - dst0 = ndVector (tmp0.m_x, tmp1.m_x, tmp2.m_x, tmp3.m_x); - dst1 = ndVector (tmp0.m_y, tmp1.m_y, tmp2.m_y, tmp3.m_y); - dst2 = ndVector (tmp0.m_z, tmp1.m_z, tmp2.m_z, tmp3.m_z); - dst3 = ndVector (tmp0.m_w, tmp1.m_w, tmp2.m_w, tmp3.m_w); - } - - union - { - struct - { - ndFloat32 m_x; - ndFloat32 m_y; - ndFloat32 m_z; - ndFloat32 m_w; - }; - struct - { - ndInt32 m_ix; - ndInt32 m_iy; - ndInt32 m_iz; - ndInt32 m_iw; - }; - ndInt32 m_i[4]; - }; - - D_CORE_API static ndVector m_zero; - D_CORE_API static ndVector m_one; - D_CORE_API static ndVector m_wOne; - D_CORE_API static ndVector m_half; - D_CORE_API static ndVector m_two; - D_CORE_API static ndVector m_three; - D_CORE_API static ndVector m_negOne; - D_CORE_API static ndVector m_xMask; - D_CORE_API static ndVector m_yMask; - D_CORE_API static ndVector m_zMask; - D_CORE_API static ndVector m_wMask; - D_CORE_API static ndVector m_xyzwMask; - D_CORE_API static ndVector m_epsilon; - D_CORE_API static ndVector m_signMask; - D_CORE_API static ndVector m_triplexMask; -} D_GCC_NEWTON_ALIGN_16; - -#endif -// ***************************************************************************************** -// -// 4 x 1 double precision SSE2 vector class declaration -// -// ***************************************************************************************** -D_MSV_NEWTON_ALIGN_32 -class ndBigVector -{ - public: - D_OPERATOR_NEW_AND_DELETE - - inline ndBigVector() - { - } - - inline ndBigVector(ndFloat64 val) - :m_x(val), m_y(val), m_z(val), m_w(val) - { - } - - inline ndBigVector (const ndBigVector& v) - :m_x(v.m_x), m_y(v.m_y), m_z(v.m_z), m_w(v.m_w) - { - } - -#ifndef D_NEWTON_USE_DOUBLE - inline ndBigVector (const ndVector& v) - :m_x(v.m_x), m_y(v.m_y), m_z(v.m_z), m_w(v.m_w) - { - } - - inline ndBigVector (const ndFloat32* const ptr) - :m_x(ptr[0]), m_y(ptr[1]), m_z(ptr[2]), m_w (ndFloat32 (0.0f)) - { - ndAssert (ndCheckVector ((*this))); - } -#endif - - inline ndBigVector (const ndFloat64* const ptr) - :m_x(ptr[0]), m_y(ptr[1]), m_z(ptr[2]), m_w (ptr[3]) - { - ndAssert (ndCheckVector ((*this))); - } - - inline ndBigVector (ndFloat64 x, ndFloat64 y, ndFloat64 z, ndFloat64 w) - :m_x(x), m_y(y), m_z(z), m_w(w) - { - ndAssert (ndCheckVector ((*this))); - } - - inline ndBigVector (ndInt32 ix, ndInt32 iy, ndInt32 iz, ndInt32 iw) - :m_ix(ix), m_iy(iy), m_iz(iz), m_iw(iw) - { - } - - inline ndBigVector (ndInt64 ix, ndInt64 iy, ndInt64 iz, ndInt64 iw) - :m_ix(ix), m_iy(iy), m_iz(iz), m_iw(iw) - { - } - - // emulate gather instruction - inline ndBigVector(const ndFloat64* const baseAddr, const ndInt64* const index) - :m_x(baseAddr[index[0]]) - ,m_y(baseAddr[index[1]]) - ,m_z(baseAddr[index[2]]) - ,m_w(baseAddr[index[3]]) - { - } - - inline ndFloat64 GetX() const - { - return m_x; - } - - inline ndFloat64 GetY() const - { - return m_y; - } - - inline ndFloat64 GetZ() const - { - return m_z; - } - - inline ndFloat64 GetW() const - { - return m_w; - } - - inline void SetX(ndFloat64 x) - { - m_x = x; - } - - inline void SetY(ndFloat64 x) - { - m_y = x; - } - - inline void SetZ(ndFloat64 x) - { - m_z = x; - } - - inline void SetW(ndFloat64 x) - { - m_w = x; - } - - inline ndFloat64 GetScalar () const - { - return m_x; - } - - inline void Store (ndFloat64* const dst) const - { - dst[0] = m_x; - dst[1] = m_y; - dst[2] = m_z; - dst[3] = m_w; - } - - inline ndBigVector BroadcastX () const - { - return ndBigVector (m_x); - } - - inline ndBigVector BroadcastY () const - { - return ndBigVector (m_y); - } - - inline ndBigVector BroadcastZ () const - { - return ndBigVector (m_z); - } - - inline ndBigVector BroadcastW () const - { - return ndBigVector (m_w); - } - - - inline ndFloat64& operator[] (ndInt32 i) - { - ndAssert (i < 4); - ndAssert (i >= 0); - return (&m_x)[i]; - } - - inline const ndFloat64& operator[] (ndInt32 i) const - { - ndAssert (i < 4); - ndAssert (i >= 0); - return (&m_x)[i]; - } - - inline ndBigVector& operator= (const ndBigVector& A) - { - m_x = A.m_x; - m_y = A.m_y; - m_z = A.m_z; - m_w = A.m_w; - return *this; - } - - inline ndBigVector operator+ (const ndBigVector& A) const - { - return ndBigVector (m_x + A.m_x, m_y + A.m_y, m_z + A.m_z, m_w + A.m_w); - } - - inline ndBigVector operator- (const ndBigVector& A) const - { - return ndBigVector (m_x - A.m_x, m_y - A.m_y, m_z - A.m_z, m_w - A.m_w); - } - - inline ndBigVector operator* (const ndBigVector& A) const - { - return ndBigVector(m_x * A.m_x, m_y * A.m_y, m_z * A.m_z, m_w * A.m_w); - } - - inline ndBigVector& operator+= (const ndBigVector& A) - { - return (*this = ndBigVector (m_x + A.m_x, m_y + A.m_y, m_z + A.m_z, m_w + A.m_w)); - } - - inline ndBigVector& operator-= (const ndBigVector& A) - { - return (*this = ndBigVector (m_x - A.m_x, m_y - A.m_y, m_z - A.m_z, m_w - A.m_w)); - } - - inline ndBigVector& operator*= (const ndBigVector& A) - { - return (*this = ndBigVector(m_x * A.m_x, m_y * A.m_y, m_z * A.m_z, m_w * A.m_w)); - } - - inline ndBigVector MulAdd(const ndBigVector& A, const ndBigVector& B) const - { - return *this + A * B; - } - - inline ndBigVector MulSub(const ndVector& A, const ndBigVector& B) const - { - return *this - A * B; - } - - - inline ndBigVector AddHorizontal () const - { - return ndBigVector (m_x + m_y + m_z + m_w); - } - - inline ndBigVector Scale (ndFloat64 scale) const - { - return ndBigVector (m_x * scale, m_y * scale, m_z * scale, m_w * scale); - } - - // return cross product - inline ndBigVector CrossProduct (const ndBigVector& B) const - { - return ndBigVector (m_y * B.m_z - m_z * B.m_y, m_z * B.m_x - m_x * B.m_z, m_x * B.m_y - m_y * B.m_x, m_w); - } - - inline ndBigVector CrossProduct (const ndBigVector& A, const ndBigVector& B) const - { - ndFloat64 cofactor[3][3]; - ndFloat64 array[4][4]; - - const ndBigVector& me = *this; - for (ndInt32 i = 0; i < 4; ++i) - { - array[0][i] = me[i]; - array[1][i] = A[i]; - array[2][i] = B[i]; - array[3][i] = ndFloat32 (1.0f); - } - - ndBigVector normal; - ndFloat64 sign = ndFloat64 (-1.0f); - for (ndInt32 i = 0; i < 4; ++i) - { - for (ndInt32 j = 0; j < 3; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 4; ++k) - { - if (k != i) - { - cofactor[j][k0] = array[j][k]; - k0 ++; - } - } - } - ndFloat64 x = cofactor[0][0] * (cofactor[1][1] * cofactor[2][2] - cofactor[1][2] * cofactor[2][1]); - ndFloat64 y = cofactor[0][1] * (cofactor[1][2] * cofactor[2][0] - cofactor[1][0] * cofactor[2][2]); - ndFloat64 z = cofactor[0][2] * (cofactor[1][0] * cofactor[2][1] - cofactor[1][1] * cofactor[2][0]); - ndFloat64 det = x + y + z; - - normal[i] = sign * det; - sign *= ndFloat64 (-1.0f); - } - - return normal; - } - - inline ndBigVector GetInt () const - { - return ndBigVector (ndInt64 (floor (m_x)), ndInt64(floor (m_y)), ndInt64(floor (m_z)), ndInt64 (floor (m_w))); - } - - inline ndBigVector TestZero() const - { - const ndInt64* const a = (ndInt64*)&m_x; - return ndBigVector ((a[0] == 0) ? ndFloat64 (-1.0f) : ndFloat64 (1.0f), - (a[1] == 0) ? ndFloat64 (-1.0f) : ndFloat64 (1.0f), - (a[2] == 0) ? ndFloat64 (-1.0f) : ndFloat64 (1.0f), - (a[3] == 0) ? ndFloat64 (-1.0f) : ndFloat64 (1.0f)); - } - - - inline ndBigVector Floor () const - { - return ndBigVector (floor (m_x), floor (m_y), floor (m_z), floor (m_w)); - } - - inline ndBigVector DotProduct (const ndBigVector &A) const - { - return ndBigVector (m_x * A.m_x + m_y * A.m_y + m_z * A.m_z + m_w * A.m_w); - } - - inline ndBigVector Divide(const ndBigVector& denominator) const - { - return ndVector(m_x / denominator.m_x, m_y / denominator.m_y, m_z / denominator.m_z, m_w / denominator.m_w); - } - - inline ndBigVector Reciproc () const - { - return ndBigVector (ndFloat64 (1.0f) / m_x, ndFloat64 (1.0f) / m_y, ndFloat64 (1.0f) / m_z, ndFloat64 (1.0f) / m_w); - } - - inline ndBigVector Sqrt () const - { - return ndBigVector (sqrt (m_x), sqrt (m_y), sqrt (m_z), sqrt (m_w)); - } - - inline ndBigVector InvSqrt () const - { - return ndBigVector (ndFloat64 (1.0f) / sqrt (m_x), ndFloat64 (1.0f) / sqrt (m_y), ndFloat64 (1.0f) / sqrt (m_z), ndFloat64 (1.0f) / sqrt (m_w)); - } - - inline ndBigVector InvMagSqrt () const - { - return ndBigVector (ndFloat64 (1.0f) / sqrt (DotProduct(*this).m_x)); - } - - inline ndBigVector Normalize() const - { - return *this * InvMagSqrt(); - } - - inline ndBigVector Abs () const - { - return ndBigVector ((m_x > ndFloat64 (0.0f)) ? m_x : -m_x, - (m_y > ndFloat64 (0.0f)) ? m_y : -m_y, - (m_z > ndFloat64 (0.0f)) ? m_z : -m_z, - (m_w > ndFloat64 (0.0f)) ? m_w : -m_w); - } - - inline ndBigVector GetMax () const - { - return ndBigVector (ndMax(ndMax(m_x, m_y), ndMax(m_z, m_w))); - } - - inline ndBigVector GetMax (const ndBigVector& data) const - { - return ndBigVector ((m_x > data.m_x) ? m_x : data.m_x, - (m_y > data.m_y) ? m_y : data.m_y, - (m_z > data.m_z) ? m_z : data.m_z, - (m_w > data.m_w) ? m_w : data.m_w); - } - - inline ndBigVector GetMin (const ndBigVector& data) const - { - return ndBigVector ((m_x < data.m_x) ? m_x : data.m_x, - (m_y < data.m_y) ? m_y : data.m_y, - (m_z < data.m_z) ? m_z : data.m_z, - (m_w < data.m_w) ? m_w : data.m_w); - } - - // relational operators - inline ndBigVector operator== (const ndBigVector& data) const - { - return ndBigVector ((m_x == data.m_x) ? ndInt64 (-1) : ndInt64 (0), - (m_y == data.m_y) ? ndInt64 (-1) : ndInt64 (0), - (m_z == data.m_z) ? ndInt64 (-1) : ndInt64 (0), - (m_w == data.m_w) ? ndInt64 (-1) : ndInt64 (0)); - } - - inline ndBigVector operator> (const ndBigVector& data) const - { - return ndBigVector ((m_x > data.m_x) ? ndInt64 (-1) : ndInt64 (0), - (m_y > data.m_y) ? ndInt64 (-1) : ndInt64 (0), - (m_z > data.m_z) ? ndInt64 (-1) : ndInt64 (0), - (m_w > data.m_w) ? ndInt64 (-1) : ndInt64 (0)); - } - - inline ndBigVector operator< (const ndBigVector& data) const - { - return ndBigVector ((m_x < data.m_x) ? ndInt64 (-1) : ndInt64 (0), - (m_y < data.m_y) ? ndInt64 (-1) : ndInt64 (0), - (m_z < data.m_z) ? ndInt64 (-1) : ndInt64 (0), - (m_w < data.m_w) ? ndInt64 (-1) : ndInt64 (0)); - } - - inline ndBigVector operator>= (const ndBigVector& data) const - { - return ndBigVector ((m_x >= data.m_x) ? ndInt64 (-1) : ndInt64 (0), - (m_y >= data.m_y) ? ndInt64 (-1) : ndInt64 (0), - (m_z >= data.m_z) ? ndInt64 (-1) : ndInt64 (0), - (m_w >= data.m_w) ? ndInt64 (-1) : ndInt64 (0)); - } - - inline ndBigVector operator<= (const ndBigVector& data) const - { - return ndBigVector ((m_x <= data.m_x) ? ndInt64 (-1) : ndInt64 (0), - (m_y <= data.m_y) ? ndInt64 (-1) : ndInt64 (0), - (m_z <= data.m_z) ? ndInt64 (-1) : ndInt64 (0), - (m_w <= data.m_w) ? ndInt64 (-1) : ndInt64 (0)); - } - - // logical operations - inline ndBigVector operator& (const ndBigVector& data) const - { - const ndInt64* const a = (ndInt64*)&m_x; - const ndInt64* const b = (ndInt64*)&data.m_x; - return ndBigVector (a[0] & b[0], a[1] & b[1], a[2] & b[2], a[3] & b[3]); - } - - inline ndBigVector operator| (const ndBigVector& data) const - { - const ndInt64* const a = (ndInt64*)&m_x; - const ndInt64* const b = (ndInt64*)&data.m_x; - return ndBigVector (a[0] | b[0], a[1] | b[1], a[2] | b[2], a[3] | b[3]); - } - - inline ndBigVector operator^ (const ndBigVector& data) const - { - const ndInt64* const a = (ndInt64*)&m_x; - const ndInt64* const b = (ndInt64*)&data.m_x; - return ndBigVector (a[0] ^ b[0], a[1] ^ b[1], a[2] ^ b[2], a[3] ^ b[3]); - } - - inline ndBigVector AndNot (const ndBigVector& data) const - { - const ndInt64* const a = (ndInt64*)&m_x; - const ndInt64* const b = (ndInt64*)&data.m_x; - return ndBigVector (a[0] & ~b[0], a[1] & ~b[1], a[2] & ~b[2], a[3] & ~b[3]); - } - - inline ndBigVector Select(const ndBigVector& data, const ndBigVector& mask) const - { - // (((b ^ a) & mask)^a) - return (*this) ^ (mask & (data ^ (*this))); - } - - inline ndInt32 GetSignMask() const - { - const ndInt64* const a = (ndInt64*)&m_x; - return (((a[0]>>63) ? 1 : 0) | ((a[1]>>63) ? 2 : 0) | ((a[2]>>63) ? 4 : 0) | ((a[3]>>63) ? 8 : 0)); - } - - inline ndVector ShiftRight() const - { - return ndBigVector (m_w, m_x, m_y, m_z); - } - - inline ndBigVector ShiftTripleRight () const - { - return ndBigVector (m_z, m_x, m_y, m_w); - } - - inline ndBigVector ShiftTripleLeft () const - { - return ndBigVector (m_y, m_z, m_x, m_w); - } - - inline ndBigVector ShiftRightLogical (ndInt32 bits) const - { - return ndBigVector (ndInt64 (ndUnsigned64 (m_ix) >> bits), ndInt64 (ndUnsigned64 (m_iy) >> bits), ndInt64 (ndUnsigned64 (m_iz) >> bits), ndInt64 (ndUnsigned64 (m_iw) >> bits)); - } - - inline ndBigVector OptimizedVectorUnrotate(const ndBigVector& front, const ndBigVector& up, const ndBigVector& right) const - { - return ndBigVector( - m_x * front.m_x + m_y * front.m_y + m_z * front.m_z, - m_x * up.m_x + m_y * up.m_y + m_z * up.m_z, - m_x * right.m_x + m_y * right.m_y + m_z * right.m_z, - ndFloat64(0.0f)); - } - - inline static void Transpose4x4 (ndBigVector& dst0, ndBigVector& dst1, ndBigVector& dst2, ndBigVector& dst3, const ndBigVector& src0, const ndBigVector& src1, const ndBigVector& src2, const ndBigVector& src3) - { - ndBigVector tmp0 (src0); - ndBigVector tmp1 (src1); - ndBigVector tmp2 (src2); - ndBigVector tmp3 (src3); - - dst0 = ndBigVector (tmp0.m_x, tmp1.m_x, tmp2.m_x, tmp3.m_x); - dst1 = ndBigVector (tmp0.m_y, tmp1.m_y, tmp2.m_y, tmp3.m_y); - dst2 = ndBigVector (tmp0.m_z, tmp1.m_z, tmp2.m_z, tmp3.m_z); - dst3 = ndBigVector (tmp0.m_w, tmp1.m_w, tmp2.m_w, tmp3.m_w); - } - - union - { - struct - { - ndFloat64 m_x; - ndFloat64 m_y; - ndFloat64 m_z; - ndFloat64 m_w; - }; - struct - { - ndInt64 m_ix; - ndInt64 m_iy; - ndInt64 m_iz; - ndInt64 m_iw; - }; - ndInt64 m_i[4]; - }; - - D_CORE_API static ndBigVector m_zero; - D_CORE_API static ndBigVector m_one; - D_CORE_API static ndBigVector m_wOne; - D_CORE_API static ndBigVector m_half; - D_CORE_API static ndBigVector m_two; - D_CORE_API static ndBigVector m_three; - D_CORE_API static ndBigVector m_negOne; - D_CORE_API static ndBigVector m_xMask; - D_CORE_API static ndBigVector m_yMask; - D_CORE_API static ndBigVector m_zMask; - D_CORE_API static ndBigVector m_wMask; - D_CORE_API static ndBigVector m_xyzwMask; - D_CORE_API static ndBigVector m_epsilon; - D_CORE_API static ndBigVector m_signMask; - D_CORE_API static ndBigVector m_triplexMask; -} D_GCC_NEWTON_ALIGN_32; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVectorSimd.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVectorSimd.h deleted file mode 100644 index a0b75558e0..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndVectorSimd.h +++ /dev/null @@ -1,1633 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_VECTOR_X86_SIMD_H__ -#define __ND_VECTOR_X86_SIMD_H__ - -#ifndef D_SCALAR_VECTOR_CLASS - -#ifdef D_NEWTON_USE_DOUBLE - #define ndVector ndBigVector -#else - -class ndBigVector; -// ***************************************************************************************** -// -// 4 x 1 single precision SSE vector class declaration -// -// ***************************************************************************************** -D_MSV_NEWTON_ALIGN_16 -class ndVector -{ - #define PERMUTE_MASK(w, z, y, x) _MM_SHUFFLE (w, z, y, x) - public: - D_OPERATOR_NEW_AND_DELETE - - inline ndVector() - { - } - - inline ndVector(const __m128i type) - :m_typeInt (type) - { - } - - inline ndVector(const __m128 type) - :m_type(type) - { - } - - inline ndVector (const ndFloat32 a) - :m_type(_mm_set1_ps( a)) - { - } - - inline ndVector (const ndFloat32* const ptr) - :m_type(_mm_loadu_ps (ptr)) - { - } - - #ifdef D_NEWTON_USE_AVX2_OPTION - inline ndVector(const ndFloat32* const baseAddr, const ndInt32* const index) - :m_type(_mm_i32gather_ps(baseAddr, (__m128i&)* index, 4)) - { - ndAssert(baseAddr[index[0]] == m_x); - ndAssert(baseAddr[index[1]] == m_y); - ndAssert(baseAddr[index[2]] == m_z); - ndAssert(baseAddr[index[3]] == m_w); - } - #else - // emulate gather instruction for non avx2 abi - inline ndVector(const ndFloat32* const baseAddr, const ndInt32* const index) - :m_x(baseAddr[index[0]]) - ,m_y(baseAddr[index[1]]) - ,m_z(baseAddr[index[2]]) - ,m_w(baseAddr[index[3]]) - { - } - #endif -#ifndef D_NEWTON_USE_DOUBLE - inline ndVector(const ndFloat64* const ptr) - :m_x(ndFloat32(ptr[0])) - ,m_y(ndFloat32(ptr[1])) - ,m_z(ndFloat32(ptr[2])) - ,m_w(ndFloat32(ptr[3])) - { - } - - inline ndVector(ndFloat64 x, ndFloat64 y, ndFloat64 z, ndFloat64 w) - :m_type(_mm_set_ps(ndFloat32(w), ndFloat32(z), ndFloat32(y), ndFloat32(x))) - { - } -#endif - - inline ndVector (const ndVector& copy) - :m_type(copy.m_type) - { - } - - inline ndVector (const ndBigVector& copy) - :m_type(_mm_shuffle_ps (_mm_cvtpd_ps (((__m128d*)©)[0]), _mm_cvtpd_ps (((__m128d*)©)[1]), PERMUTE_MASK(1, 0, 1, 0))) - { - ndAssert (ndCheckVector ((*this))); - } - - inline ndVector (ndFloat32 x, ndFloat32 y, ndFloat32 z, ndFloat32 w) - :m_type(_mm_set_ps(w, z, y, x)) - { - } - - inline ndVector (ndInt32 x, ndInt32 y, ndInt32 z, ndInt32 w) - :m_typeInt(_mm_set_epi32(w, z, y, x)) - { - } - - inline ndFloat32 GetX() const - { - return m_x; - } - - inline ndFloat32 GetY() const - { - return m_y; - } - - inline ndFloat32 GetZ() const - { - return m_z; - } - - inline ndFloat32 GetW() const - { - return m_w; - } - - inline void SetX(ndFloat32 x) - { - m_x = x; - } - - inline void SetY(ndFloat32 x) - { - m_y = x; - } - - inline void SetZ(ndFloat32 x) - { - m_z = x; - } - - inline void SetW(ndFloat32 x) - { - m_w = x; - } - - //return the x component - inline ndFloat32 GetScalar () const - { - return _mm_cvtss_f32 (m_type); - } - - inline void Store (ndFloat32* const dst) const - { - _mm_storeu_ps(dst, m_type); - } - - inline ndVector BroadcastX () const - { - return _mm_shuffle_ps (m_type, m_type, PERMUTE_MASK(0, 0, 0, 0)); - } - - inline ndVector BroadcastY () const - { - return _mm_shuffle_ps (m_type, m_type, PERMUTE_MASK(1, 1, 1, 1)); - } - - inline ndVector BroadcastZ () const - { - return _mm_shuffle_ps (m_type, m_type, PERMUTE_MASK(2, 2, 2, 2)); - } - - inline ndVector BroadcastW () const - { - return _mm_shuffle_ps (m_type, m_type, PERMUTE_MASK(3, 3, 3, 3)); - } - - inline ndVector Scale (ndFloat32 s) const - { - return _mm_mul_ps (m_type, _mm_set_ps1(s)); - } - - inline ndVector& operator= (const ndVector& A) - { - m_type = A.m_type; - return *this; - } - - inline ndFloat32& operator[] (ndInt32 i) - { - ndAssert (i < 4); - ndAssert (i >= 0); - return m_f[i]; - } - - inline const ndFloat32& operator[] (ndInt32 i) const - { - ndAssert (i < 4); - ndAssert (i >= 0); - return m_f[i]; - } - - inline ndVector operator+ (const ndVector& A) const - { - return _mm_add_ps (m_type, A.m_type); - } - - inline ndVector operator- (const ndVector& A) const - { - return _mm_sub_ps (m_type, A.m_type); - } - - inline ndVector operator* (const ndVector& A) const - { - return _mm_mul_ps(m_type, A.m_type); - } - - inline ndVector& operator+= (const ndVector& A) - { - return (*this = _mm_add_ps (m_type, A.m_type)); - } - - inline ndVector& operator-= (const ndVector& A) - { - return (*this = _mm_sub_ps (m_type, A.m_type)); - } - - inline ndVector& operator*= (const ndVector& A) - { - return (*this = _mm_mul_ps(m_type, A.m_type)); - } - - // return 4d dot product - inline ndVector DotProduct(const ndVector& A) const - { - #ifdef D_NEWTON_USE_AVX2_OPTION - return _mm_dp_ps(m_type, A.m_type, 0xff); - #else - return (*this * A).AddHorizontal(); - #endif - } - - // return 3d cross product - inline ndVector CrossProduct (const ndVector& B) const - { - __m128 tmp0 = _mm_shuffle_ps( m_type, m_type, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 tmp1 = _mm_shuffle_ps(B.m_type, B.m_type, _MM_SHUFFLE(3, 1, 0, 2)); - __m128 tmp2 = _mm_mul_ps(tmp0, B.m_type); - __m128 tmp3 = _mm_mul_ps(tmp0, tmp1); - __m128 tmp4 = _mm_shuffle_ps(tmp2, tmp2, _MM_SHUFFLE(3, 0, 2, 1)); - return _mm_sub_ps(tmp3, tmp4); - } - - // return 4d cross product - inline ndVector CrossProduct (const ndVector& A, const ndVector& B) const - { - ndFloat32 array[4][4]; - ndFloat32 cofactor[3][3]; - - const ndVector& me = *this; - for (ndInt32 i = 0; i < 4; ++i) - { - array[0][i] = me[i]; - array[1][i] = A[i]; - array[2][i] = B[i]; - array[3][i] = ndFloat32 (1.0f); - } - - ndVector normal; - ndFloat32 sign = ndFloat32 (-1.0f); - for (ndInt32 i = 0; i < 4; ++i) - { - for (ndInt32 j = 0; j < 3; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 4; ++k) - { - if (k != i) - { - cofactor[j][k0] = array[j][k]; - k0 ++; - } - } - } - ndFloat32 x = cofactor[0][0] * (cofactor[1][1] * cofactor[2][2] - cofactor[1][2] * cofactor[2][1]); - ndFloat32 y = cofactor[0][1] * (cofactor[1][2] * cofactor[2][0] - cofactor[1][0] * cofactor[2][2]); - ndFloat32 z = cofactor[0][2] * (cofactor[1][0] * cofactor[2][1] - cofactor[1][1] * cofactor[2][0]); - ndFloat32 det = x + y + z; - - normal[i] = sign * det; - sign *= ndFloat32 (-1.0f); - } - - return normal; - } - - inline ndVector Divide(const ndVector& denominator) const - { - return _mm_div_ps(m_type, denominator.m_type); - } - - inline ndVector Reciproc () const - { - return _mm_div_ps (m_one.m_type, m_type); - } - - inline ndVector MulAdd(const ndVector& A, const ndVector& B) const - { - return _mm_add_ps(m_type, _mm_mul_ps(A.m_type, B.m_type)); - } - - inline ndVector MulSub(const ndVector& A, const ndVector& B) const - { - return _mm_sub_ps(m_type, _mm_mul_ps(A.m_type, B.m_type)); - } - - inline ndVector AddHorizontal () const - { - __m128 tmp (_mm_hadd_ps (m_type, m_type)); - return _mm_hadd_ps (tmp, tmp); - } - - inline ndVector Abs () const - { - return _mm_and_ps (m_type, m_signMask.m_type); - } - - inline ndVector GetMax() const - { - __m128 tmp(_mm_max_ps(m_type, _mm_shuffle_ps(m_type, m_type, PERMUTE_MASK(1, 0, 3, 2)))); - return _mm_max_ps(tmp, _mm_shuffle_ps(tmp, tmp, PERMUTE_MASK(2, 3, 0, 1))); - } - - inline ndVector GetMax (const ndVector& data) const - { - return _mm_max_ps (m_type, data.m_type); - } - - inline ndVector GetMin (const ndVector& data) const - { - return _mm_min_ps (m_type, data.m_type); - } - - inline ndVector TestZero() const - { - return m_negOne & (*this == m_zero); - } - - inline ndVector Floor () const - { - #ifdef D_NEWTON_USE_AVX2_OPTION - return _mm_floor_ps(m_type); - #else - ndVector truncated(_mm_cvtepi32_ps(_mm_cvttps_epi32(m_type))); - ndVector ret(truncated - (ndVector::m_one & (*this < truncated))); - ndAssert(ret.m_f[0] == ndFloor(m_f[0])); - ndAssert(ret.m_f[1] == ndFloor(m_f[1])); - ndAssert(ret.m_f[2] == ndFloor(m_f[2])); - ndAssert(ret.m_f[3] == ndFloor(m_f[3])); - return ret; - #endif - } - - inline ndVector GetInt() const - { - return ndVector(_mm_cvtps_epi32(Floor().m_type)); - } - - inline ndVector Sqrt () const - { - return _mm_sqrt_ps(m_type); - } - - inline ndVector InvSqrt () const - { - ndVector tmp0 (_mm_rsqrt_ps(m_type)); - return m_half * tmp0 * (m_three - *this * tmp0 * tmp0); - } - - inline ndVector InvMagSqrt () const - { - return DotProduct(*this).InvSqrt(); - } - - inline ndVector Normalize () const - { - return Scale(ndFloat32(1.0f) / ndSqrt(DotProduct(*this).GetScalar())); - } - - // relational operators - inline ndVector operator> (const ndVector& data) const - { - return _mm_cmpgt_ps (m_type, data.m_type); - } - - inline ndVector operator== (const ndVector& data) const - { - return _mm_cmpeq_ps (m_type, data.m_type); - } - - inline ndVector operator< (const ndVector& data) const - { - return _mm_cmplt_ps (m_type, data.m_type); - } - - inline ndVector operator>= (const ndVector& data) const - { - return _mm_cmpge_ps (m_type, data.m_type); - } - - inline ndVector operator<= (const ndVector& data) const - { - return _mm_cmple_ps (m_type, data.m_type); - } - - // logical operations - inline ndVector operator& (const ndVector& data) const - { - return _mm_and_ps (m_type, data.m_type); - } - - inline ndVector operator| (const ndVector& data) const - { - return _mm_or_ps (m_type, data.m_type); - } - - inline ndVector operator^ (const ndVector& data) const - { - return _mm_xor_ps (m_type, data.m_type); - } - - inline ndVector AndNot(const ndVector& data) const - { - return _mm_andnot_ps(data.m_type, m_type); - } - - inline ndVector Select(const ndVector& data, const ndVector& mask) const - { - // (((b ^ a) & mask)^a) - //return _mm_or_ps (_mm_and_ps (mask.m_type, data.m_type), _mm_andnot_ps(mask.m_type, m_type)); - return _mm_xor_ps(m_type, _mm_and_ps (mask.m_type, _mm_xor_ps(m_type, data.m_type))); - } - - inline ndInt32 GetSignMask() const - { - return _mm_movemask_ps(m_type); - } - - inline ndVector ShiftRight() const - { - return _mm_shuffle_ps(m_type, m_type, PERMUTE_MASK(2, 1, 0, 3)); - } - - inline ndVector ShiftTripleRight () const - { - return _mm_shuffle_ps(m_type, m_type, PERMUTE_MASK(3, 1, 0, 2)); - } - - inline ndVector ShiftTripleLeft () const - { - return _mm_shuffle_ps (m_type, m_type, PERMUTE_MASK(3, 0, 2, 1)); - } - - inline ndVector ShiftRightLogical (ndInt32 bits) const - { - return ndVector (_mm_srli_epi32(m_typeInt, bits)); - } - - inline ndVector OptimizedVectorUnrotate(const ndVector& front, const ndVector& up, const ndVector& right) const - { -#if 0 - return ndVector( - m_x * front.m_x + m_y * front.m_y + m_z * front.m_z, - m_x * up.m_x + m_y * up.m_y + m_z * up.m_z, - m_x * right.m_x + m_y * right.m_y + m_z * right.m_z, - ndFloat32(0.0f)); -#else - __m128 tmp0(_mm_mul_ps(m_type, front.m_type)); - __m128 tmp1(_mm_mul_ps(m_type, up.m_type)); - __m128 tmp2(_mm_unpacklo_ps(tmp0, tmp1)); - __m128 tmp3(_mm_unpackhi_ps(tmp0, tmp1)); - __m128 tmp4(_mm_add_ps(tmp2, tmp3)); - - __m128 tmp5(_mm_mul_ps(m_type, right.m_type)); - __m128 tmp6(_mm_shuffle_ps(tmp5, tmp5, PERMUTE_MASK(3, 2, 3, 0))); - __m128 tmp7(_mm_shuffle_ps(tmp5, tmp5, PERMUTE_MASK(3, 3, 3, 1))); - __m128 tmp8(_mm_add_ps(tmp6, tmp7)); - - __m128 tmp9(_mm_movelh_ps(tmp4, tmp8)); - __m128 tmp10(_mm_movehl_ps(tmp8, tmp4)); - return _mm_add_ps(tmp9, tmp10); -#endif - } - - inline static void Transpose4x4 (ndVector& dst0, ndVector& dst1, ndVector& dst2, ndVector& dst3, const ndVector& src0, const ndVector& src1, const ndVector& src2, const ndVector& src3) - { - __m128 tmp0 (_mm_unpacklo_ps (src0.m_type, src1.m_type)); - __m128 tmp1 (_mm_unpacklo_ps (src2.m_type, src3.m_type)); - __m128 tmp2 (_mm_unpackhi_ps (src0.m_type, src1.m_type)); - __m128 tmp3 (_mm_unpackhi_ps (src2.m_type, src3.m_type)); - - dst0 = ndVector (_mm_movelh_ps (tmp0, tmp1)); - dst1 = ndVector (_mm_movehl_ps (tmp1, tmp0)); - dst2 = ndVector (_mm_movelh_ps (tmp2, tmp3)); - dst3 = ndVector (_mm_movehl_ps (tmp3, tmp2)); - } - - union - { - ndFloat32 m_f[4]; - ndInt32 m_i[4]; - __m128 m_type; - __m128i m_typeInt; - struct - { - ndFloat32 m_x; - ndFloat32 m_y; - ndFloat32 m_z; - ndFloat32 m_w; - }; - struct - { - ndInt32 m_ix; - ndInt32 m_iy; - ndInt32 m_iz; - ndInt32 m_iw; - }; - }; - - D_CORE_API static ndVector m_zero; - D_CORE_API static ndVector m_one; - D_CORE_API static ndVector m_wOne; - D_CORE_API static ndVector m_two; - D_CORE_API static ndVector m_half; - D_CORE_API static ndVector m_three; - D_CORE_API static ndVector m_negOne; - D_CORE_API static ndVector m_xMask; - D_CORE_API static ndVector m_yMask; - D_CORE_API static ndVector m_zMask; - D_CORE_API static ndVector m_wMask; - D_CORE_API static ndVector m_xyzwMask; - D_CORE_API static ndVector m_epsilon; - D_CORE_API static ndVector m_signMask; - D_CORE_API static ndVector m_triplexMask; -} D_GCC_NEWTON_ALIGN_16 ; -#endif - -// ***************************************************************************************** -// -// 4 x 1 double precision SSE2 vector class declaration -// -// ***************************************************************************************** -#ifdef D_NEWTON_USE_AVX2_OPTION -D_MSV_NEWTON_ALIGN_32 -class ndBigVector -{ - #define PERMUT_MASK_DOUBLE(y, x) _MM_SHUFFLE2 (y, x) - - public: - D_OPERATOR_NEW_AND_DELETE - - inline ndBigVector() - { - } - - inline ndBigVector(const ndBigVector& copy) - :m_type(copy.m_type) - { - } - - inline ndBigVector(const __m256d type) - :m_type(type) - { - } - - inline ndBigVector(const __m256i type) - :m_typeInt(type) - { - } - - inline ndBigVector(const ndFloat64 a) - :m_type (_mm256_set1_pd(a)) - { - } - - inline ndBigVector(const ndFloat64* const baseAddr, const ndInt64* const index) - :m_type (_mm256_i64gather_pd(baseAddr, (__m256i&) * index, 8)) - { - ndAssert(baseAddr[index[0]] == m_x); - ndAssert(baseAddr[index[1]] == m_y); - ndAssert(baseAddr[index[2]] == m_z); - ndAssert(baseAddr[index[3]] == m_w); - } - -#ifdef D_NEWTON_USE_DOUBLE - inline ndBigVector (const ndFloat32* const ptr) - :m_type(_mm256_loadu_pd(ptr)) - { - } -#else - - inline ndBigVector(const ndVector& v) - :m_type(_mm256_cvtps_pd (v.m_type)) - { - ndAssert(ndCheckVector((*this))); - } - - inline ndBigVector(const ndFloat64* const ptr) - :m_type(_mm256_loadu_pd(ptr)) - { - } -#endif - - inline ndBigVector(ndFloat64 x, ndFloat64 y, ndFloat64 z, ndFloat64 w) - :m_type(_mm256_set_pd(w, z, y, x)) - { - } - - inline ndBigVector(ndInt32 x, ndInt32 y, ndInt32 z, ndInt32 w) - :m_typeInt(_mm256_set_epi64x(ndInt64(w), ndInt64(z), ndInt64(y), ndInt64(x))) - { - } - - inline ndBigVector(ndInt64 x, ndInt64 y, ndInt64 z, ndInt64 w) - :m_typeInt(_mm256_set_epi64x(w, z, y, x)) - { - } - - inline ndFloat64 GetX() const - { - return m_x; - } - - inline ndFloat64 GetY() const - { - return m_y; - } - - inline ndFloat64 GetZ() const - { - return m_z; - } - - inline ndFloat64 GetW() const - { - return m_w; - } - - inline void SetX(ndFloat64 x) - { - m_x = x; - } - - inline void SetY(ndFloat64 x) - { - m_y = x; - } - - inline void SetZ(ndFloat64 x) - { - m_z = x; - } - - inline void SetW(ndFloat64 x) - { - m_w = x; - } - - inline ndFloat64 GetScalar() const - { - return _mm256_cvtsd_f64(m_type); - } - - inline ndFloat64& operator[] (ndInt32 i) - { - ndAssert(i < 4); - ndAssert(i >= 0); - return m_f[i]; - } - - inline const ndFloat64& operator[] (ndInt32 i) const - { - ndAssert(i < 4); - ndAssert(i >= 0); - return m_f[i]; - } - - inline ndBigVector& operator= (const ndBigVector& A) - { - m_type = A.m_type; - return *this; - } - - inline ndBigVector operator+ (const ndBigVector& A) const - { - return ndBigVector(_mm256_add_pd(m_type, A.m_type)); - } - - inline ndBigVector operator- (const ndBigVector& A) const - { - return ndBigVector(_mm256_sub_pd(m_type, A.m_type)); - } - - inline ndBigVector operator* (const ndBigVector& A) const - { - return ndBigVector(_mm256_mul_pd(m_type, A.m_type)); - } - - inline ndBigVector& operator+= (const ndBigVector& A) - { - m_type = _mm256_add_pd(m_type, A.m_type); - return *this; - } - - inline ndBigVector& operator-= (const ndBigVector& A) - { - m_type = _mm256_sub_pd(m_type, A.m_type); - return *this; - } - - inline ndBigVector& operator*= (const ndBigVector& A) - { - m_type = _mm256_mul_pd(m_type, A.m_type); - return *this; - } - - inline ndBigVector MulAdd(const ndBigVector& A, const ndBigVector& B) const - { - return ndBigVector (_mm256_fmadd_pd(A.m_type, B.m_type, m_type)); - } - - inline ndBigVector MulSub(const ndBigVector& A, const ndBigVector& B) const - { - return ndBigVector(_mm256_fnmadd_pd(A.m_type, B.m_type, m_type)); - } - - inline ndBigVector BroadcastX() const - { - return ndBigVector(m_x); - } - - inline ndBigVector BroadcastY() const - { - return ndBigVector(m_y); - } - - inline ndBigVector BroadcastZ() const - { - return ndBigVector(m_z); - } - - inline ndBigVector BroadcastW() const - { - return ndBigVector(m_w); - } - - inline ndBigVector Scale(ndFloat64 s) const - { - return ndBigVector(_mm256_mul_pd(m_type, _mm256_set1_pd(s))); - } - - inline ndBigVector Abs() const - { - return ndBigVector(_mm256_and_pd(m_type, m_signMask.m_type)); - } - - inline ndBigVector Divide(const ndBigVector& denominator) const - { - return ndBigVector(_mm256_div_pd(m_type, denominator.m_type)); - } - - inline ndBigVector Reciproc() const - { - return ndBigVector(_mm256_div_pd(m_one.m_type, m_type)); - } - - inline ndBigVector Sqrt() const - { - return ndBigVector(_mm256_sqrt_pd(m_type)); - } - - inline ndBigVector InvSqrt() const - { - return Sqrt().Reciproc(); - } - - inline ndBigVector InvMagSqrt() const - { - return DotProduct(*this).InvSqrt(); - } - - inline ndBigVector Normalize() const - { - ndFloat64 mag2 = DotProduct(*this).GetScalar(); - return Scale(ndFloat64 (1.0f) / sqrt (mag2)); - } - - inline ndBigVector GetMax() const - { - __m256d tmp1(_mm256_max_pd(m_type, _mm256_permute2f128_pd(m_type, m_type, 1))); - __m256d tmp2(_mm256_max_pd(tmp1, _mm256_shuffle_pd(tmp1, tmp1, 0x05))); - return ndBigVector(tmp2); - } - - inline ndBigVector AddHorizontal() const - { - __m256d tmp0(_mm256_add_pd(m_type, _mm256_shuffle_pd(m_type, m_type, 0x05))); - __m256d tmp1(_mm256_add_pd(tmp0, _mm256_permute2f128_pd(tmp0, tmp0, 1))); - return ndBigVector(tmp1); - } - - inline ndBigVector GetMax(const ndBigVector& data) const - { - return ndBigVector(_mm256_max_pd(m_type, data.m_type)); - } - - inline ndBigVector GetMin(const ndBigVector& data) const - { - return ndBigVector(_mm256_min_pd(m_type, data.m_type)); - } - - inline ndBigVector Floor() const - { - return ndBigVector(_mm256_floor_pd(m_type)); - } - - inline ndBigVector GetInt() const - { - __m256d tmp0(_mm256_floor_pd(m_type)); - __m128i tmp1(_mm256_cvtpd_epi32(tmp0)); - __m256i tmp2(_mm256_cvtepi32_epi64(tmp1)); - return ndBigVector(tmp2); - } - - // relational operators - inline ndBigVector operator== (const ndBigVector& data) const - { - //return ndBigVector(_mm_cmpeq_pd(m_typeLow, data.m_typeLow), _mm_cmpeq_pd(m_typeHigh, data.m_typeHigh)); - return ndBigVector(_mm256_cmp_pd(m_type, data.m_type, _CMP_EQ_OQ)); - } - - inline ndBigVector operator> (const ndBigVector& data) const - { - //return ndBigVector(_mm_cmpgt_pd(m_typeLow, data.m_typeLow), _mm_cmpgt_pd(m_typeHigh, data.m_typeHigh)); - return ndBigVector(_mm256_cmp_pd(m_type, data.m_type, _CMP_GT_OS)); - } - - inline ndBigVector operator< (const ndBigVector& data) const - { - //return ndBigVector(_mm256_cmplt_pd(m_type, data.m_type)); - return ndBigVector(_mm256_cmp_pd(m_type, data.m_type, _CMP_LT_OQ)); - } - - inline ndBigVector operator>= (const ndBigVector& data) const - { - //return ndBigVector(_mm_cmpge_pd(m_typeLow, data.m_typeLow), _mm_cmpge_pd(m_typeHigh, data.m_typeHigh)); - return ndBigVector(_mm256_cmp_pd(m_type, data.m_type, _CMP_GE_OS)); - } - - inline ndBigVector operator<= (const ndBigVector& data) const - { - //return ndBigVector(_mm_cmple_pd(m_typeLow, data.m_typeLow), _mm_cmple_pd(m_typeHigh, data.m_typeHigh)); - return ndBigVector(_mm256_cmp_pd(m_type, data.m_type, _CMP_LE_OQ)); - } - - // logical operations - inline ndBigVector operator& (const ndBigVector& data) const - { - return ndBigVector(_mm256_and_pd(m_type, data.m_type)); - } - - inline ndBigVector operator| (const ndBigVector& data) const - { - return ndBigVector(_mm256_or_pd(m_type, data.m_type)); - } - - inline ndBigVector operator^ (const ndBigVector& data) const - { - return ndBigVector(_mm256_xor_pd(m_type, data.m_type)); - } - - inline ndBigVector AndNot(const ndBigVector& data) const - { - return ndBigVector(_mm256_andnot_pd(data.m_type, m_type)); - } - - inline ndBigVector Select(const ndBigVector& data, const ndBigVector& mask) const - { - // (((b ^ a) & mask)^a) - return ndBigVector(_mm256_xor_pd(m_type, _mm256_and_pd(mask.m_type, _mm256_xor_pd(m_type, data.m_type)))); - } - - inline ndBigVector ShiftRight() const - { - //return ndBigVector (m_w, m_x, m_y, m_z); - return ndBigVector (_mm256_permute4x64_pd(m_type, (3 << 0) + (0 << 2) + (1 << 4) + (2 << 6))); - } - - inline ndBigVector ShiftTripleRight() const - { - //return ndBigVector(_mm256_shuffle_pd(_mm256_permute2f128_pd(m_type, m_type, 1), m_type, 0x0c)); - return ndBigVector(_mm256_permute4x64_pd(m_type, (2 << 0) + (0 << 2) + (1 << 4) + (3 << 6))); - } - - inline ndBigVector ShiftTripleLeft() const - { - //return ndBigVector(m_y, m_z, m_x, m_w); - return ndBigVector(_mm256_permute4x64_pd(m_type, (1 << 0) + (2 << 2) + (0 << 4) + (3 << 6))); - } - - inline ndBigVector ShiftRightLogical(ndInt32 bits) const - { - return ndBigVector(_mm256_srli_epi64(m_typeInt, bits)); - } - - inline ndInt32 GetSignMask() const - { - return _mm256_movemask_pd(m_type); - } - - inline ndBigVector TestZero() const - { - return m_negOne & (*this == m_zero); - } - - inline ndBigVector OptimizedVectorUnrotate(const ndBigVector& front, const ndBigVector& up, const ndBigVector& right) const - { - //return ndBigVector( - // m_x * front.m_x + m_y * front.m_y + m_z * front.m_z, - // m_x * up.m_x + m_y * up.m_y + m_z * up.m_z, - // m_x * right.m_x + m_y * right.m_y + m_z * right.m_z, - // ndFloat64(0.0f)); - - //__m128d tmp0__(_mm_add_pd(_mm_mul_pd(m_typeLow, front.m_typeLow), _mm_mul_pd(m_typeHigh, front.m_typeHigh))); - //__m128d tmp1__(_mm_add_pd(_mm_mul_pd(m_typeLow, up.m_typeLow), _mm_mul_pd(m_typeHigh, up.m_typeHigh))); - //__m128d tmp2__(_mm_add_pd(_mm_mul_pd(m_typeLow, right.m_typeLow), _mm_mul_pd(m_typeHigh, right.m_typeHigh))); - // - //__m128d tmp3__(_mm_add_pd(_mm_unpacklo_pd(tmp0__, tmp1__), _mm_unpackhi_pd(tmp0__, tmp1__))); - //__m128d tmp4__(_mm_unpackhi_pd(_mm_add_pd(tmp2__, _mm_unpacklo_pd(tmp2__, tmp2__)), right.m_typeHigh)); - //return ndBigVector(tmp3__, tmp4__); - - __m256d tmp0(_mm256_mul_pd(m_type, front.m_type)); - __m256d tmp1(_mm256_mul_pd(m_type, up.m_type)); - __m256d tmp01L(_mm256_unpacklo_pd(tmp0, tmp1)); - __m256d tmp01H(_mm256_unpackhi_pd(tmp0, tmp1)); - __m256d tmp2(_mm256_add_pd(tmp01L, tmp01H)); - - __m256d tmp3(_mm256_mul_pd(m_type, right.m_type)); - __m256d tmp3H(_mm256_unpackhi_pd(tmp3, tmp3)); - __m256d tmp4(_mm256_add_pd(tmp3, tmp3H)); - - __m256d tmp5(_mm256_permute2f128_pd(tmp2, tmp4, 0x20)); - __m256d tmp6(_mm256_permute2f128_pd(tmp2, tmp4, 0x31)); - - __m256d tmp7(_mm256_add_pd(tmp5, tmp6)); - return ndBigVector(_mm256_and_pd(tmp7, ndBigVector::m_triplexMask.m_type)); - } - - inline static void Transpose4x4(ndBigVector& dst0, ndBigVector& dst1, ndBigVector& dst2, ndBigVector& dst3, - const ndBigVector& src0, const ndBigVector& src1, const ndBigVector& src2, const ndBigVector& src3) - { - __m256d tmp[4]; - tmp[0] = _mm256_permute2f128_pd(src0.m_type, src2.m_type, 0x20); - tmp[1] = _mm256_permute2f128_pd(src1.m_type, src3.m_type, 0x20); - tmp[2] = _mm256_permute2f128_pd(src0.m_type, src2.m_type, 0x31); - tmp[3] = _mm256_permute2f128_pd(src1.m_type, src3.m_type, 0x31); - - dst0 = _mm256_unpacklo_pd(tmp[0], tmp[1]); - dst1 = _mm256_unpackhi_pd(tmp[0], tmp[1]); - dst2 = _mm256_unpacklo_pd(tmp[2], tmp[3]); - dst3 = _mm256_unpackhi_pd(tmp[2], tmp[3]); - } - - // return dot 4d dot product - inline ndBigVector DotProduct(const ndBigVector &A) const - { - return (*this * A).AddHorizontal(); - } - - // return 3d cross product - inline ndBigVector CrossProduct(const ndBigVector& B) const - { - return ndBigVector(m_y * B.m_z - m_z * B.m_y, m_z * B.m_x - m_x * B.m_z, m_x * B.m_y - m_y * B.m_x, m_w); - } - - // return 4d cross product - inline ndBigVector CrossProduct(const ndBigVector& A, const ndBigVector& B) const - { - ndFloat64 array[4][4]; - ndFloat64 cofactor[3][3]; - - const ndBigVector& me = *this; - for (ndInt32 i = 0; i < 4; ++i) - { - array[0][i] = me[i]; - array[1][i] = A[i]; - array[2][i] = B[i]; - array[3][i] = ndFloat64(1.0f); - } - - ndBigVector normal; - ndFloat64 sign = ndFloat64(-1.0f); - for (ndInt32 i = 0; i < 4; ++i) - { - for (ndInt32 j = 0; j < 3; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 4; ++k) - { - if (k != i) - { - cofactor[j][k0] = array[j][k]; - k0++; - } - } - } - ndFloat64 x = cofactor[0][0] * (cofactor[1][1] * cofactor[2][2] - cofactor[1][2] * cofactor[2][1]); - ndFloat64 y = cofactor[0][1] * (cofactor[1][2] * cofactor[2][0] - cofactor[1][0] * cofactor[2][2]); - ndFloat64 z = cofactor[0][2] * (cofactor[1][0] * cofactor[2][1] - cofactor[1][1] * cofactor[2][0]); - ndFloat64 det = x + y + z; - - normal[i] = sign * det; - sign *= ndFloat64(-1.0f); - } - - return normal; - } - - union - { - ndFloat64 m_f[4]; - ndInt64 m_i[4]; - - __m256d m_type; - __m256i m_typeInt; - struct - { - ndFloat64 m_x; - ndFloat64 m_y; - ndFloat64 m_z; - ndFloat64 m_w; - }; - struct - { - ndInt64 m_ix; - ndInt64 m_iy; - ndInt64 m_iz; - ndInt64 m_iw; - }; - struct - { - __m128d m_typeLow; - __m128d m_typeHigh; - }; - }; - - D_CORE_API static ndBigVector m_zero; - D_CORE_API static ndBigVector m_one; - D_CORE_API static ndBigVector m_wOne; - D_CORE_API static ndBigVector m_two; - D_CORE_API static ndBigVector m_half; - D_CORE_API static ndBigVector m_three; - D_CORE_API static ndBigVector m_negOne; - D_CORE_API static ndBigVector m_xMask; - D_CORE_API static ndBigVector m_yMask; - D_CORE_API static ndBigVector m_zMask; - D_CORE_API static ndBigVector m_wMask; - D_CORE_API static ndBigVector m_xyzwMask; - D_CORE_API static ndBigVector m_epsilon; - D_CORE_API static ndBigVector m_signMask; - D_CORE_API static ndBigVector m_triplexMask; -} D_GCC_NEWTON_ALIGN_32; - -#else - -D_MSV_NEWTON_ALIGN_32 -class ndBigVector -{ - #define PERMUT_MASK_DOUBLE(y, x) _MM_SHUFFLE2 (y, x) - - public: - D_OPERATOR_NEW_AND_DELETE - - inline ndBigVector() - { - } - - inline ndBigVector(const ndBigVector& copy) - :m_typeLow(copy.m_typeLow) - ,m_typeHigh(copy.m_typeHigh) - { - } - - inline ndBigVector(const __m128d typeLow, const __m128d typeHigh) - :m_typeLow(typeLow) - ,m_typeHigh(typeHigh) - { - } - - inline ndBigVector(const __m128i typeLow, const __m128i typeHigh) - :m_typeIntLow(typeLow) - ,m_typeIntHigh(typeHigh) - { - } - - inline ndBigVector(const ndFloat64 a) - :m_typeLow(_mm_set1_pd(a)) - ,m_typeHigh(_mm_set1_pd(a)) - { - } - - inline ndBigVector(const ndFloat64* const baseAddr, const ndInt64* const index) - :m_x(baseAddr[index[0]]) - ,m_y(baseAddr[index[1]]) - ,m_z(baseAddr[index[2]]) - ,m_w(baseAddr[index[3]]) - { - } - -#ifdef D_NEWTON_USE_DOUBLE - inline ndBigVector(const ndFloat32* const ptr) - :m_typeLow(_mm_loadu_pd(ptr)) - ,m_typeHigh(_mm_loadu_pd(&ptr[2])) - { - } -#else - - inline ndBigVector(const ndVector& v) - :m_typeLow(_mm_cvtps_pd(v.m_type)) - ,m_typeHigh(_mm_cvtps_pd(_mm_shuffle_ps(v.m_type, v.m_type, PERMUTE_MASK(3, 2, 3, 2)))) - { - ndAssert(ndCheckVector((*this))); - } - - inline ndBigVector(const ndFloat64* const ptr) - :m_typeLow(_mm_loadu_pd(ptr)) - ,m_typeHigh(_mm_loadu_pd(&ptr[2])) - { - } -#endif - - inline ndBigVector(ndFloat64 x, ndFloat64 y, ndFloat64 z, ndFloat64 w) - :m_typeLow(_mm_set_pd(y, x)) - ,m_typeHigh(_mm_set_pd(w, z)) - { - } - - inline ndBigVector(ndInt32 x, ndInt32 y, ndInt32 z, ndInt32 w) - //:m_ix(ndInt64(x)), m_iy(ndInt64(y)), m_iz(ndInt64(z)), m_iw(ndInt64(w)) - :m_typeIntLow(_mm_set_epi64x(ndInt64(y), ndInt64(x))) - ,m_typeIntHigh(_mm_set_epi64x(ndInt64(w), ndInt64(z))) - { - } - - inline ndBigVector(ndInt64 x, ndInt64 y, ndInt64 z, ndInt64 w) - //:m_ix(x), m_iy(y), m_iz(z), m_iw(w) - :m_typeIntLow(_mm_set_epi64x(y, x)) - ,m_typeIntHigh(_mm_set_epi64x(w, z)) - { - } - - inline ndFloat64 GetX() const - { - return m_x; - } - - inline ndFloat64 GetY() const - { - return m_y; - } - - inline ndFloat64 GetZ() const - { - return m_z; - } - - inline ndFloat64 GetW() const - { - return m_w; - } - - inline void SetX(ndFloat64 x) - { - m_x = x; - } - - inline void SetY(ndFloat64 x) - { - m_y = x; - } - - inline void SetZ(ndFloat64 x) - { - m_z = x; - } - - inline void SetW(ndFloat64 x) - { - m_w = x; - } - - inline ndFloat64 GetScalar() const - { - return _mm_cvtsd_f64(m_typeLow); - } - - inline ndFloat64& operator[] (ndInt32 i) - { - ndAssert(i < 4); - ndAssert(i >= 0); - return m_f[i]; - } - - inline const ndFloat64& operator[] (ndInt32 i) const - { - ndAssert(i < 4); - ndAssert(i >= 0); - return m_f[i]; - } - - inline ndBigVector& operator= (const ndBigVector& A) - { - m_typeLow = A.m_typeLow; - m_typeHigh = A.m_typeHigh; - return *this; - } - - inline ndBigVector operator+ (const ndBigVector& A) const - { - return ndBigVector(_mm_add_pd(m_typeLow, A.m_typeLow), _mm_add_pd(m_typeHigh, A.m_typeHigh)); - } - - inline ndBigVector operator- (const ndBigVector& A) const - { - return ndBigVector(_mm_sub_pd(m_typeLow, A.m_typeLow), _mm_sub_pd(m_typeHigh, A.m_typeHigh)); - } - - inline ndBigVector operator* (const ndBigVector& A) const - { - return ndBigVector(_mm_mul_pd(m_typeLow, A.m_typeLow), _mm_mul_pd(m_typeHigh, A.m_typeHigh)); - } - - inline ndBigVector& operator+= (const ndBigVector& A) - { - m_typeLow = _mm_add_pd(m_typeLow, A.m_typeLow); - m_typeHigh = _mm_add_pd(m_typeHigh, A.m_typeHigh); - return *this; - } - - inline ndBigVector& operator-= (const ndBigVector& A) - { - m_typeLow = _mm_sub_pd(m_typeLow, A.m_typeLow); - m_typeHigh = _mm_sub_pd(m_typeHigh, A.m_typeHigh); - return *this; - } - - inline ndBigVector& operator*= (const ndBigVector& A) - { - m_typeLow = _mm_mul_pd(m_typeLow, A.m_typeLow); - m_typeHigh = _mm_mul_pd(m_typeHigh, A.m_typeHigh); - return *this; - } - - inline ndBigVector MulAdd(const ndBigVector& A, const ndBigVector& B) const - { - return *this + A * B; - } - - inline ndBigVector MulSub(const ndBigVector& A, const ndBigVector& B) const - { - return *this - A * B; - } - - inline ndBigVector AddHorizontal() const - { - __m128d tmp0(_mm_add_pd(m_typeHigh, m_typeLow)); - __m128d tmp1(_mm_hadd_pd(tmp0, tmp0)); - return ndBigVector(tmp1, tmp1); - } - - inline ndBigVector BroadcastX() const - { - return ndBigVector(m_x); - } - - inline ndBigVector BroadcastY() const - { - return ndBigVector(m_y); - } - - inline ndBigVector BroadcastZ() const - { - return ndBigVector(m_z); - } - - inline ndBigVector BroadcastW() const - { - return ndBigVector(m_w); - } - - inline ndBigVector Scale(ndFloat64 s) const - { - __m128d tmp0(_mm_set1_pd(s)); - return ndBigVector(_mm_mul_pd(m_typeLow, tmp0), _mm_mul_pd(m_typeHigh, tmp0)); - } - - inline ndBigVector Abs() const - { - return ndBigVector(_mm_and_pd(m_typeLow, m_signMask.m_typeLow), _mm_and_pd(m_typeHigh, m_signMask.m_typeLow)); - } - - inline ndBigVector Divide(const ndBigVector& denominator) const - { - return ndBigVector(_mm_div_pd(m_typeLow, denominator.m_typeLow), _mm_div_pd(m_typeHigh, denominator.m_typeHigh)); - } - - inline ndBigVector Reciproc() const - { - return ndBigVector(_mm_div_pd(m_one.m_typeLow, m_typeLow), _mm_div_pd(m_one.m_typeHigh, m_typeHigh)); - } - - inline ndBigVector Sqrt() const - { - return ndBigVector(_mm_sqrt_pd(m_typeLow), _mm_sqrt_pd(m_typeHigh)); - } - - inline ndBigVector InvSqrt() const - { - return Sqrt().Reciproc(); - } - - inline ndBigVector InvMagSqrt() const - { - return DotProduct(*this).InvSqrt(); - } - - inline ndBigVector Normalize() const - { - ndFloat64 mag2 = DotProduct(*this).GetScalar(); - return Scale(ndFloat64(1.0f) / sqrt(mag2)); - } - - inline ndBigVector GetMax() const - { - __m128d tmp(_mm_max_pd(m_typeLow, m_typeHigh)); - tmp = _mm_max_pd(tmp, _mm_shuffle_pd(tmp, tmp, PERMUT_MASK_DOUBLE(0, 1))); - return ndBigVector(tmp, tmp); - } - - inline ndBigVector GetMax(const ndBigVector& data) const - { - return ndBigVector(_mm_max_pd(m_typeLow, data.m_typeLow), _mm_max_pd(m_typeHigh, data.m_typeHigh)); - } - - inline ndBigVector GetMin(const ndBigVector& data) const - { - return ndBigVector(_mm_min_pd(m_typeLow, data.m_typeLow), _mm_min_pd(m_typeHigh, data.m_typeHigh)); - } - - inline ndBigVector Floor() const - { - ndInt64 x = _mm_cvtsd_si64(m_typeLow); - ndInt64 y = _mm_cvtsd_si64(_mm_unpackhi_pd(m_typeLow, m_typeLow)); - ndInt64 z = _mm_cvtsd_si64(m_typeHigh); - ndInt64 w = _mm_cvtsd_si64(_mm_unpackhi_pd(m_typeHigh, m_typeHigh)); - - __m128d one(ndBigVector::m_one.m_typeLow); - __m128d xy(_mm_unpacklo_pd(_mm_cvtsi64_sd(m_typeHigh, x), _mm_cvtsi64_sd(m_typeHigh, y))); - __m128d zw(_mm_unpacklo_pd(_mm_cvtsi64_sd(m_typeHigh, z), _mm_cvtsi64_sd(m_typeHigh, w))); - - __m128d xy_round(_mm_and_pd(one, _mm_cmplt_pd(m_typeLow, xy))); - __m128d zw_round(_mm_and_pd(one, _mm_cmplt_pd(m_typeHigh, zw))); - return ndBigVector(_mm_sub_pd(xy, xy_round), _mm_sub_pd(zw, zw_round)); - } - - inline ndBigVector GetInt() const - { - ndInt64 x = _mm_cvtsd_si64(m_typeLow); - ndInt64 y = _mm_cvtsd_si64(_mm_unpackhi_pd(m_typeLow, m_typeLow)); - ndInt64 z = _mm_cvtsd_si64(m_typeHigh); - ndInt64 w = _mm_cvtsd_si64(_mm_unpackhi_pd(m_typeHigh, m_typeHigh)); - - __m128i xy_int(_mm_set_epi64x(y, x)); - __m128i zw_int(_mm_set_epi64x(w, z)); - - __m128d xy_float(_mm_unpacklo_pd(_mm_cvtsi64_sd(m_typeHigh, x), _mm_cvtsi64_sd(m_typeHigh, y))); - __m128d zw_float(_mm_unpacklo_pd(_mm_cvtsi64_sd(m_typeHigh, z), _mm_cvtsi64_sd(m_typeHigh, w))); - - __m128i xy_round(_mm_castpd_si128(_mm_cmplt_pd(m_typeLow, xy_float))); - __m128i zw_round(_mm_castpd_si128(_mm_cmplt_pd(m_typeHigh, zw_float))); - return ndBigVector(_mm_add_epi64(xy_int, xy_round), _mm_add_epi64(zw_int, zw_round)); - } - - // relational operators - inline ndBigVector operator> (const ndBigVector& data) const - { - return ndBigVector(_mm_cmpgt_pd(m_typeLow, data.m_typeLow), _mm_cmpgt_pd(m_typeHigh, data.m_typeHigh)); - } - - inline ndBigVector operator== (const ndBigVector& data) const - { - return ndBigVector(_mm_cmpeq_pd(m_typeLow, data.m_typeLow), _mm_cmpeq_pd(m_typeHigh, data.m_typeHigh)); - } - - inline ndBigVector operator< (const ndBigVector& data) const - { - return ndBigVector(_mm_cmplt_pd(m_typeLow, data.m_typeLow), _mm_cmplt_pd(m_typeHigh, data.m_typeHigh)); - } - - inline ndBigVector operator>= (const ndBigVector& data) const - { - return ndBigVector(_mm_cmpge_pd(m_typeLow, data.m_typeLow), _mm_cmpge_pd(m_typeHigh, data.m_typeHigh)); - } - - inline ndBigVector operator<= (const ndBigVector& data) const - { - return ndBigVector(_mm_cmple_pd(m_typeLow, data.m_typeLow), _mm_cmple_pd(m_typeHigh, data.m_typeHigh)); - } - - // logical operations - inline ndBigVector operator& (const ndBigVector& data) const - { - return ndBigVector(_mm_and_pd(m_typeLow, data.m_typeLow), _mm_and_pd(m_typeHigh, data.m_typeHigh)); - } - - inline ndBigVector operator| (const ndBigVector& data) const - { - return ndBigVector(_mm_or_pd(m_typeLow, data.m_typeLow), _mm_or_pd(m_typeHigh, data.m_typeHigh)); - } - - inline ndBigVector operator^ (const ndBigVector& data) const - { - return ndBigVector(_mm_xor_pd(m_typeLow, data.m_typeLow), _mm_xor_pd(m_typeHigh, data.m_typeHigh)); - } - - inline ndBigVector AndNot(const ndBigVector& data) const - { - return ndBigVector(_mm_andnot_pd(data.m_typeLow, m_typeLow), _mm_andnot_pd(data.m_typeHigh, m_typeHigh)); - } - - inline ndBigVector Select(const ndBigVector& data, const ndBigVector& mask) const - { - // (((b ^ a) & mask)^a) - return ndBigVector(_mm_xor_pd(m_typeLow, _mm_and_pd(mask.m_typeLow, _mm_xor_pd(m_typeLow, data.m_typeLow))), - _mm_xor_pd(m_typeHigh, _mm_and_pd(mask.m_typeHigh, _mm_xor_pd(m_typeHigh, data.m_typeHigh)))); - } - - inline ndBigVector ShiftRight() const - { - //return ndBigVector (m_w, m_x, m_y, m_z); - return ndBigVector(_mm_shuffle_pd(m_typeHigh, m_typeLow, PERMUT_MASK_DOUBLE(0, 1)), _mm_shuffle_pd(m_typeLow, m_typeHigh, PERMUT_MASK_DOUBLE(0, 1))); - } - - inline ndBigVector ShiftTripleRight() const - { - return ndBigVector(_mm_shuffle_pd(m_typeHigh, m_typeLow, PERMUT_MASK_DOUBLE(0, 0)), _mm_shuffle_pd(m_typeLow, m_typeHigh, PERMUT_MASK_DOUBLE(1, 1))); - } - - inline ndBigVector ShiftTripleLeft() const - { - return ndBigVector(_mm_shuffle_pd(m_typeLow, m_typeHigh, PERMUT_MASK_DOUBLE(0, 1)), _mm_shuffle_pd(m_typeLow, m_typeHigh, PERMUT_MASK_DOUBLE(1, 0))); - } - - inline ndBigVector ShiftRightLogical(ndInt32 bits) const - { - return ndBigVector(_mm_srli_epi64(m_typeIntLow, bits), _mm_srli_epi64(m_typeIntHigh, bits)); - } - - inline ndInt32 GetSignMask() const - { - return _mm_movemask_pd(m_typeLow) | (_mm_movemask_pd(m_typeHigh) << 2); - } - - inline ndBigVector TestZero() const - { - return m_negOne & (*this == m_zero); - } - - inline ndBigVector OptimizedVectorUnrotate(const ndBigVector& front, const ndBigVector& up, const ndBigVector& right) const - { -#if 0 - return ndBigVector( - m_x * front.m_x + m_y * front.m_y + m_z * front.m_z, - m_x * up.m_x + m_y * up.m_y + m_z * up.m_z, - m_x * right.m_x + m_y * right.m_y + m_z * right.m_z, - ndFloat64(0.0f)); -#else - __m128d tmp0(_mm_add_pd(_mm_mul_pd(m_typeLow, front.m_typeLow), _mm_mul_pd(m_typeHigh, front.m_typeHigh))); - __m128d tmp1(_mm_add_pd(_mm_mul_pd(m_typeLow, up.m_typeLow), _mm_mul_pd(m_typeHigh, up.m_typeHigh))); - __m128d tmp2(_mm_add_pd(_mm_mul_pd(m_typeLow, right.m_typeLow), _mm_mul_pd(m_typeHigh, right.m_typeHigh))); - - __m128d tmp3(_mm_add_pd(_mm_unpacklo_pd(tmp0, tmp1), _mm_unpackhi_pd(tmp0, tmp1))); - __m128d tmp4(_mm_unpackhi_pd(_mm_add_pd(tmp2, _mm_unpacklo_pd(tmp2, tmp2)), right.m_typeHigh)); - return ndBigVector(tmp3, tmp4); -#endif - } - - inline static void Transpose4x4(ndBigVector& dst0, ndBigVector& dst1, ndBigVector& dst2, ndBigVector& dst3, - const ndBigVector& src0, const ndBigVector& src1, const ndBigVector& src2, const ndBigVector& src3) - { - ndBigVector tmp0(src0); - ndBigVector tmp1(src1); - ndBigVector tmp2(src2); - ndBigVector tmp3(src3); - - dst0 = ndBigVector(tmp0.m_x, tmp1.m_x, tmp2.m_x, tmp3.m_x); - dst1 = ndBigVector(tmp0.m_y, tmp1.m_y, tmp2.m_y, tmp3.m_y); - dst2 = ndBigVector(tmp0.m_z, tmp1.m_z, tmp2.m_z, tmp3.m_z); - dst3 = ndBigVector(tmp0.m_w, tmp1.m_w, tmp2.m_w, tmp3.m_w); - } - - // return dot 4d dot product - inline ndBigVector DotProduct(const ndBigVector& A) const - { - return (*this * A).AddHorizontal(); - } - - // return 3d cross product - inline ndBigVector CrossProduct(const ndBigVector& B) const - { - return ndBigVector(m_y * B.m_z - m_z * B.m_y, m_z * B.m_x - m_x * B.m_z, m_x * B.m_y - m_y * B.m_x, m_w); - } - - // return 4d cross product - inline ndBigVector CrossProduct(const ndBigVector& A, const ndBigVector& B) const - { - ndFloat64 cofactor[3][3]; - ndFloat64 array[4][4]; - - const ndBigVector& me = *this; - for (ndInt32 i = 0; i < 4; ++i) - { - array[0][i] = me[i]; - array[1][i] = A[i]; - array[2][i] = B[i]; - array[3][i] = ndFloat64(1.0f); - } - - ndBigVector normal; - ndFloat64 sign = ndFloat64(-1.0f); - for (ndInt32 i = 0; i < 4; ++i) - { - for (ndInt32 j = 0; j < 3; ++j) - { - ndInt32 k0 = 0; - for (ndInt32 k = 0; k < 4; ++k) - { - if (k != i) - { - cofactor[j][k0] = array[j][k]; - k0++; - } - } - } - ndFloat64 x = cofactor[0][0] * (cofactor[1][1] * cofactor[2][2] - cofactor[1][2] * cofactor[2][1]); - ndFloat64 y = cofactor[0][1] * (cofactor[1][2] * cofactor[2][0] - cofactor[1][0] * cofactor[2][2]); - ndFloat64 z = cofactor[0][2] * (cofactor[1][0] * cofactor[2][1] - cofactor[1][1] * cofactor[2][0]); - ndFloat64 det = x + y + z; - - normal[i] = sign * det; - sign *= ndFloat64(-1.0f); - } - - return normal; - } - - union - { - ndFloat64 m_f[4]; - ndInt64 m_i[4]; - struct - { - ndFloat64 m_x; - ndFloat64 m_y; - ndFloat64 m_z; - ndFloat64 m_w; - }; - struct - { - ndInt64 m_ix; - ndInt64 m_iy; - ndInt64 m_iz; - ndInt64 m_iw; - }; - struct - { - __m128d m_typeLow; - __m128d m_typeHigh; - }; - struct - { - __m128i m_typeIntLow; - __m128i m_typeIntHigh; - }; - }; - - D_CORE_API static ndBigVector m_zero; - D_CORE_API static ndBigVector m_one; - D_CORE_API static ndBigVector m_wOne; - D_CORE_API static ndBigVector m_two; - D_CORE_API static ndBigVector m_half; - D_CORE_API static ndBigVector m_three; - D_CORE_API static ndBigVector m_negOne; - D_CORE_API static ndBigVector m_xMask; - D_CORE_API static ndBigVector m_yMask; - D_CORE_API static ndBigVector m_zMask; - D_CORE_API static ndBigVector m_wMask; - D_CORE_API static ndBigVector m_xyzwMask; - D_CORE_API static ndBigVector m_epsilon; - D_CORE_API static ndBigVector m_signMask; - D_CORE_API static ndBigVector m_triplexMask; -} D_GCC_NEWTON_ALIGN_32; - -#endif - -#endif -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/annotated.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/annotated.html deleted file mode 100644 index 795347834b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/annotated.html +++ /dev/null @@ -1,39 +0,0 @@ - - -TinyXml: Class List - - - - - - -

TinyXml Class List

Here are the classes, structs, unions and interfaces with brief descriptions: - - - - - - - - - - - - -
TiXmlAttributeAn attribute is a name-value pair
TiXmlBaseTiXmlBase is a base class for every class in TinyXml
TiXmlCommentAn XML comment
TiXmlDeclarationIn correct XML the declaration is the first entry in the file
TiXmlDocumentAlways the top level node
TiXmlElementThe element is a container class
TiXmlHandleA TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thing
TiXmlNodeThe parent class for everything in the Document Object Model
TiXmlPrinterPrint to memory functionality
TiXmlTextXML text
TiXmlUnknownAny tag that tinyXml doesn't recognize is saved as an unknown
TiXmlVisitorIf you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks
-
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlAttribute-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlAttribute-members.html deleted file mode 100644 index b3c0fc67b2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlAttribute-members.html +++ /dev/null @@ -1,54 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlAttribute Member List

This is the complete list of members for TiXmlAttribute, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Column() const TiXmlBase [inline]
DoubleValue() const TiXmlAttribute
EncodeString(const TIXML_STRING &str, TIXML_STRING *out)TiXmlBase [static]
GetUserData()TiXmlBase [inline]
GetUserData() const TiXmlBase [inline]
IntValue() const TiXmlAttribute
IsWhiteSpaceCondensed()TiXmlBase [inline, static]
Name() const TiXmlAttribute [inline]
Next() const TiXmlAttribute
Previous() const TiXmlAttribute
Print(FILE *cfile, int depth) const TiXmlAttribute [inline, virtual]
QueryDoubleValue(double *_value) const TiXmlAttribute
QueryIntValue(int *_value) const TiXmlAttribute
Row() const TiXmlBase [inline]
SetCondenseWhiteSpace(bool condense)TiXmlBase [inline, static]
SetDoubleValue(double _value)TiXmlAttribute
SetIntValue(int _value)TiXmlAttribute
SetName(const char *_name)TiXmlAttribute [inline]
SetName(const std::string &_name)TiXmlAttribute [inline]
SetUserData(void *user)TiXmlBase [inline]
SetValue(const char *_value)TiXmlAttribute [inline]
SetValue(const std::string &_value)TiXmlAttribute [inline]
TiXmlAttribute()TiXmlAttribute [inline]
TiXmlAttribute(const std::string &_name, const std::string &_value)TiXmlAttribute [inline]
TiXmlAttribute(const char *_name, const char *_value)TiXmlAttribute [inline]
userDataTiXmlBase [protected]
Value() const TiXmlAttribute [inline]
ValueStr() const TiXmlAttribute [inline]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlAttribute.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlAttribute.html deleted file mode 100644 index 9cdc9a9ba1..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlAttribute.html +++ /dev/null @@ -1,181 +0,0 @@ - - -TinyXml: TiXmlAttribute Class Reference - - - - - - -

TiXmlAttribute Class Reference

An attribute is a name-value pair. -More... -

-#include <tinyxml.h> -

-

Inheritance diagram for TiXmlAttribute: -

- -TiXmlBase - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

TiXmlAttribute ()
 Construct an empty attribute.
TiXmlAttribute (const std::string &_name, const std::string &_value)
 std::string constructor.
TiXmlAttribute (const char *_name, const char *_value)
 Construct an attribute with a name and value.
-const char * Name () const
 Return the name of this attribute.
-const char * Value () const
 Return the value of this attribute.
-const std::string & ValueStr () const
 Return the value of this attribute.
-int IntValue () const
 Return the value of this attribute, converted to an integer.
-double DoubleValue () const
 Return the value of this attribute, converted to a double.
int QueryIntValue (int *_value) const
 QueryIntValue examines the value string.
-int QueryDoubleValue (double *_value) const
 QueryDoubleValue examines the value string. See QueryIntValue().
-void SetName (const char *_name)
 Set the name of this attribute.
-void SetValue (const char *_value)
 Set the value.
-void SetIntValue (int _value)
 Set the value from an integer.
-void SetDoubleValue (double _value)
 Set the value from a double.
-void SetName (const std::string &_name)
 STL std::string form.
-void SetValue (const std::string &_value)
 STL std::string form.
-const TiXmlAttributeNext () const
 Get the next sibling attribute in the DOM. Returns null at end.
-const TiXmlAttributePrevious () const
 Get the previous sibling attribute in the DOM. Returns null at beginning.
virtual void Print (FILE *cfile, int depth) const
 All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
-

Detailed Description

-An attribute is a name-value pair. -

-Elements have an arbitrary number of attributes, each with a unique name.

-

Note:
The attributes are not TiXmlNodes, since they are not part of the tinyXML document object model. There are other suggested ways to look at this problem.
- -

-


Member Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - -
virtual void TiXmlAttribute::Print (FILE *  cfile,
int  depth 
) const [inline, virtual]
-
-
- -

-All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. -

-) Either or both cfile and str can be null.

-This is a formatted print, and will insert tabs and newlines.

-(For an unformatted stream, use the << operator.) -

-Implements TiXmlBase. -

-

- -

-
- - - - - - - - - -
int TiXmlAttribute::QueryIntValue (int *  _value  )  const
-
-
- -

-QueryIntValue examines the value string. -

-It is an alternative to the IntValue() method with richer error checking. If the value is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE.

-A specialized but useful call. Note that for success it returns 0, which is the opposite of almost all other TinyXml calls. -

-

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlAttribute.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlAttribute.png deleted file mode 100644 index ebac5ca9f9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlAttribute.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlBase-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlBase-members.html deleted file mode 100644 index 352900e8c8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlBase-members.html +++ /dev/null @@ -1,36 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlBase Member List

This is the complete list of members for TiXmlBase, including all inherited members.

- - - - - - - - - - -
Column() const TiXmlBase [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out)TiXmlBase [static]
GetUserData()TiXmlBase [inline]
GetUserData() const TiXmlBase [inline]
IsWhiteSpaceCondensed()TiXmlBase [inline, static]
Print(FILE *cfile, int depth) const =0TiXmlBase [pure virtual]
Row() const TiXmlBase [inline]
SetCondenseWhiteSpace(bool condense)TiXmlBase [inline, static]
SetUserData(void *user)TiXmlBase [inline]
userDataTiXmlBase [protected]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlBase.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlBase.html deleted file mode 100644 index bdb638931b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlBase.html +++ /dev/null @@ -1,230 +0,0 @@ - - -TinyXml: TiXmlBase Class Reference - - - - - - -

TiXmlBase Class Reference

TiXmlBase is a base class for every class in TinyXml. -More... -

-#include <tinyxml.h> -

-

Inheritance diagram for TiXmlBase: -

- -TiXmlAttribute -TiXmlNode -TiXmlComment -TiXmlDeclaration -TiXmlDocument -TiXmlElement -TiXmlText -TiXmlUnknown - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

virtual void Print (FILE *cfile, int depth) const =0
 All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
int Row () const
 Return the position, in the original source file, of this node or attribute.
-int Column () const
 See Row().
-void SetUserData (void *user)
 Set a pointer to arbitrary user data.
-void * GetUserData ()
 Get a pointer to arbitrary user data.
-const void * GetUserData () const
 Get a pointer to arbitrary user data.

Static Public Member Functions

static void SetCondenseWhiteSpace (bool condense)
 The world does not agree on whether white space should be kept or not.
-static bool IsWhiteSpaceCondensed ()
 Return the current white space setting.
static void EncodeString (const TIXML_STRING &str, TIXML_STRING *out)
 Expands entities in a string.

Protected Attributes

-void * userData
 Field containing a generic user pointer.

Friends

-class TiXmlNode
-class TiXmlElement
-class TiXmlDocument
-

Detailed Description

-TiXmlBase is a base class for every class in TinyXml. -

-It does little except to establish that TinyXml classes can be printed and provide some utility functions.

-In XML, the document and elements can contain other elements and other types of nodes.

-

	A Document can contain:	Element	(container or leaf)
-							Comment (leaf)
-							Unknown (leaf)
-							Declaration( leaf )
-
-	An Element can contain:	Element (container or leaf)
-							Text	(leaf)
-							Attributes (not on tree)
-							Comment (leaf)
-							Unknown (leaf)
-
-	A Decleration contains: Attributes (not on tree)
-	
-

-


Member Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - -
static void TiXmlBase::EncodeString (const TIXML_STRING &  str,
TIXML_STRING *  out 
) [static]
-
-
- -

-Expands entities in a string. -

-Note this should not contian the tag's '<', '>', etc, or they will be transformed into entities! -

-

- -

-
- - - - - - - - - - - - - - - - - - -
virtual void TiXmlBase::Print (FILE *  cfile,
int  depth 
) const [pure virtual]
-
-
- -

-All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. -

-) Either or both cfile and str can be null.

-This is a formatted print, and will insert tabs and newlines.

-(For an unformatted stream, use the << operator.) -

-Implemented in TiXmlAttribute, TiXmlElement, TiXmlComment, TiXmlText, TiXmlDeclaration, TiXmlUnknown, and TiXmlDocument. -

-

- -

-
- - - - - - - - -
int TiXmlBase::Row (  )  const [inline]
-
-
- -

-Return the position, in the original source file, of this node or attribute. -

-The row and column are 1-based. (That is the first row and first column is 1,1). If the returns values are 0 or less, then the parser does not have a row and column value.

-Generally, the row and column value will be set when the TiXmlDocument::Load(), TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set when the DOM was created from operator>>.

-The values reflect the initial load. Once the DOM is modified programmatically (by adding or changing nodes and attributes) the new values will NOT update to reflect changes in the document.

-There is a minor performance cost to computing the row and column. Computation can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value.

-

See also:
TiXmlDocument::SetTabSize()
- -
-

- -

-
- - - - - - - - - -
static void TiXmlBase::SetCondenseWhiteSpace (bool  condense  )  [inline, static]
-
-
- -

-The world does not agree on whether white space should be kept or not. -

-In order to make everyone happy, these global, static functions are provided to set whether or not TinyXml will condense all white space into a single space or not. The default is to condense. Note changing this value is not thread safe. -

-

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlBase.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlBase.png deleted file mode 100644 index 085db6e503..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlBase.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlComment-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlComment-members.html deleted file mode 100644 index 9b2c4ec066..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlComment-members.html +++ /dev/null @@ -1,100 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlComment Member List

This is the complete list of members for TiXmlComment, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Accept(TiXmlVisitor *visitor) const TiXmlComment [virtual]
Clear()TiXmlNode
Clone() const TiXmlComment [virtual]
Column() const TiXmlBase [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out)TiXmlBase [static]
FirstChild() const TiXmlNode [inline]
FirstChild(const char *value) const TiXmlNode
FirstChild(const char *_value)TiXmlNode [inline]
FirstChild(const std::string &_value) const TiXmlNode [inline]
FirstChild(const std::string &_value)TiXmlNode [inline]
FirstChildElement() const TiXmlNode
FirstChildElement(const char *_value) const TiXmlNode
FirstChildElement(const std::string &_value) const TiXmlNode [inline]
FirstChildElement(const std::string &_value)TiXmlNode [inline]
GetDocument() const TiXmlNode
GetUserData()TiXmlBase [inline]
GetUserData() const TiXmlBase [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis)TiXmlNode
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis)TiXmlNode
InsertEndChild(const TiXmlNode &addThis)TiXmlNode
IsWhiteSpaceCondensed()TiXmlBase [inline, static]
IterateChildren(const TiXmlNode *previous) const TiXmlNode
IterateChildren(const char *value, const TiXmlNode *previous) const TiXmlNode
IterateChildren(const std::string &_value, const TiXmlNode *previous) const TiXmlNode [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous)TiXmlNode [inline]
LastChild()TiXmlNode [inline]
LastChild(const char *_value)TiXmlNode [inline]
LastChild(const std::string &_value) const TiXmlNode [inline]
LastChild(const std::string &_value)TiXmlNode [inline]
LinkEndChild(TiXmlNode *addThis)TiXmlNode
NextSibling(const std::string &_value) const TiXmlNode [inline]
NextSibling(const std::string &_value)TiXmlNode [inline]
NextSibling() const TiXmlNode [inline]
NextSibling(const char *) const TiXmlNode
NextSiblingElement() const TiXmlNode
NextSiblingElement(const char *) const TiXmlNode
NextSiblingElement(const std::string &_value) const TiXmlNode [inline]
NextSiblingElement(const std::string &_value)TiXmlNode [inline]
NoChildren() const TiXmlNode [inline]
NodeType enum nameTiXmlNode
operator<<(std::ostream &out, const TiXmlNode &base)TiXmlNode [friend]
operator<<(std::string &out, const TiXmlNode &base)TiXmlNode [friend]
operator>>(std::istream &in, TiXmlNode &base)TiXmlNode [friend]
Parent()TiXmlNode [inline]
PreviousSibling() const TiXmlNode [inline]
PreviousSibling(const char *) const TiXmlNode
PreviousSibling(const std::string &_value) const TiXmlNode [inline]
PreviousSibling(const std::string &_value)TiXmlNode [inline]
Print(FILE *cfile, int depth) const TiXmlComment [virtual]
RemoveChild(TiXmlNode *removeThis)TiXmlNode
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis)TiXmlNode
Row() const TiXmlBase [inline]
SetCondenseWhiteSpace(bool condense)TiXmlBase [inline, static]
SetUserData(void *user)TiXmlBase [inline]
SetValue(const char *_value)TiXmlNode [inline]
SetValue(const std::string &_value)TiXmlNode [inline]
TiXmlComment()TiXmlComment [inline]
TiXmlComment(const char *_value)TiXmlComment [inline]
ToComment() const TiXmlComment [inline, virtual]
ToComment()TiXmlComment [inline, virtual]
ToDeclaration() const TiXmlNode [inline, virtual]
ToDeclaration()TiXmlNode [inline, virtual]
ToDocument() const TiXmlNode [inline, virtual]
ToDocument()TiXmlNode [inline, virtual]
ToElement() const TiXmlNode [inline, virtual]
ToElement()TiXmlNode [inline, virtual]
ToText() const TiXmlNode [inline, virtual]
ToText()TiXmlNode [inline, virtual]
ToUnknown() const TiXmlNode [inline, virtual]
ToUnknown()TiXmlNode [inline, virtual]
Type() const TiXmlNode [inline]
userDataTiXmlBase [protected]
Value() const TiXmlNode [inline]
ValueStr() const TiXmlNode [inline]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlComment.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlComment.html deleted file mode 100644 index 65ea27097e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlComment.html +++ /dev/null @@ -1,108 +0,0 @@ - - -TinyXml: TiXmlComment Class Reference - - - - - - -

TiXmlComment Class Reference

An XML comment. -More... -

-#include <tinyxml.h> -

-

Inheritance diagram for TiXmlComment: -

- -TiXmlNode -TiXmlBase - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

TiXmlComment ()
 Constructs an empty comment.
TiXmlComment (const char *_value)
 Construct a comment from text.
-virtual TiXmlNodeClone () const
 Returns a copy of this Comment.
virtual void Print (FILE *cfile, int depth) const
 All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
-virtual const TiXmlCommentToComment () const
 Cast to a more defined type. Will return null not of the requested type.
-virtual TiXmlCommentToComment ()
 Cast to a more defined type. Will return null not of the requested type.
-virtual bool Accept (TiXmlVisitor *visitor) const
 Walk the XML tree visiting this node and all of its children.
-

Detailed Description

-An XML comment. -

-


Member Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - -
virtual void TiXmlComment::Print (FILE *  cfile,
int  depth 
) const [virtual]
-
-
- -

-All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. -

-) Either or both cfile and str can be null.

-This is a formatted print, and will insert tabs and newlines.

-(For an unformatted stream, use the << operator.) -

-Implements TiXmlBase. -

-

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlComment.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlComment.png deleted file mode 100644 index e33d742588..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlComment.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDeclaration-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDeclaration-members.html deleted file mode 100644 index 147bb9661e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDeclaration-members.html +++ /dev/null @@ -1,104 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlDeclaration Member List

This is the complete list of members for TiXmlDeclaration, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Accept(TiXmlVisitor *visitor) const TiXmlDeclaration [virtual]
Clear()TiXmlNode
Clone() const TiXmlDeclaration [virtual]
Column() const TiXmlBase [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out)TiXmlBase [static]
Encoding() const TiXmlDeclaration [inline]
FirstChild() const TiXmlNode [inline]
FirstChild(const char *value) const TiXmlNode
FirstChild(const char *_value)TiXmlNode [inline]
FirstChild(const std::string &_value) const TiXmlNode [inline]
FirstChild(const std::string &_value)TiXmlNode [inline]
FirstChildElement() const TiXmlNode
FirstChildElement(const char *_value) const TiXmlNode
FirstChildElement(const std::string &_value) const TiXmlNode [inline]
FirstChildElement(const std::string &_value)TiXmlNode [inline]
GetDocument() const TiXmlNode
GetUserData()TiXmlBase [inline]
GetUserData() const TiXmlBase [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis)TiXmlNode
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis)TiXmlNode
InsertEndChild(const TiXmlNode &addThis)TiXmlNode
IsWhiteSpaceCondensed()TiXmlBase [inline, static]
IterateChildren(const TiXmlNode *previous) const TiXmlNode
IterateChildren(const char *value, const TiXmlNode *previous) const TiXmlNode
IterateChildren(const std::string &_value, const TiXmlNode *previous) const TiXmlNode [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous)TiXmlNode [inline]
LastChild()TiXmlNode [inline]
LastChild(const char *_value)TiXmlNode [inline]
LastChild(const std::string &_value) const TiXmlNode [inline]
LastChild(const std::string &_value)TiXmlNode [inline]
LinkEndChild(TiXmlNode *addThis)TiXmlNode
NextSibling(const std::string &_value) const TiXmlNode [inline]
NextSibling(const std::string &_value)TiXmlNode [inline]
NextSibling() const TiXmlNode [inline]
NextSibling(const char *) const TiXmlNode
NextSiblingElement() const TiXmlNode
NextSiblingElement(const char *) const TiXmlNode
NextSiblingElement(const std::string &_value) const TiXmlNode [inline]
NextSiblingElement(const std::string &_value)TiXmlNode [inline]
NoChildren() const TiXmlNode [inline]
NodeType enum nameTiXmlNode
operator<<(std::ostream &out, const TiXmlNode &base)TiXmlNode [friend]
operator<<(std::string &out, const TiXmlNode &base)TiXmlNode [friend]
operator>>(std::istream &in, TiXmlNode &base)TiXmlNode [friend]
Parent()TiXmlNode [inline]
PreviousSibling() const TiXmlNode [inline]
PreviousSibling(const char *) const TiXmlNode
PreviousSibling(const std::string &_value) const TiXmlNode [inline]
PreviousSibling(const std::string &_value)TiXmlNode [inline]
Print(FILE *cfile, int depth) const TiXmlDeclaration [inline, virtual]
RemoveChild(TiXmlNode *removeThis)TiXmlNode
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis)TiXmlNode
Row() const TiXmlBase [inline]
SetCondenseWhiteSpace(bool condense)TiXmlBase [inline, static]
SetUserData(void *user)TiXmlBase [inline]
SetValue(const char *_value)TiXmlNode [inline]
SetValue(const std::string &_value)TiXmlNode [inline]
Standalone() const TiXmlDeclaration [inline]
TiXmlDeclaration()TiXmlDeclaration [inline]
TiXmlDeclaration(const std::string &_version, const std::string &_encoding, const std::string &_standalone)TiXmlDeclaration
TiXmlDeclaration(const char *_version, const char *_encoding, const char *_standalone)TiXmlDeclaration
ToComment() const TiXmlNode [inline, virtual]
ToComment()TiXmlNode [inline, virtual]
ToDeclaration() const TiXmlDeclaration [inline, virtual]
ToDeclaration()TiXmlDeclaration [inline, virtual]
ToDocument() const TiXmlNode [inline, virtual]
ToDocument()TiXmlNode [inline, virtual]
ToElement() const TiXmlNode [inline, virtual]
ToElement()TiXmlNode [inline, virtual]
ToText() const TiXmlNode [inline, virtual]
ToText()TiXmlNode [inline, virtual]
ToUnknown() const TiXmlNode [inline, virtual]
ToUnknown()TiXmlNode [inline, virtual]
Type() const TiXmlNode [inline]
userDataTiXmlBase [protected]
Value() const TiXmlNode [inline]
ValueStr() const TiXmlNode [inline]
Version() const TiXmlDeclaration [inline]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDeclaration.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDeclaration.html deleted file mode 100644 index 5ae9a0f3ec..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDeclaration.html +++ /dev/null @@ -1,129 +0,0 @@ - - -TinyXml: TiXmlDeclaration Class Reference - - - - - - -

TiXmlDeclaration Class Reference

In correct XML the declaration is the first entry in the file. -More... -

-#include <tinyxml.h> -

-

Inheritance diagram for TiXmlDeclaration: -

- -TiXmlNode -TiXmlBase - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

TiXmlDeclaration ()
 Construct an empty declaration.
TiXmlDeclaration (const std::string &_version, const std::string &_encoding, const std::string &_standalone)
 Constructor.
TiXmlDeclaration (const char *_version, const char *_encoding, const char *_standalone)
 Construct.
-const char * Version () const
 Version. Will return an empty string if none was found.
-const char * Encoding () const
 Encoding. Will return an empty string if none was found.
-const char * Standalone () const
 Is this a standalone document?
-virtual TiXmlNodeClone () const
 Creates a copy of this Declaration and returns it.
virtual void Print (FILE *cfile, int depth) const
 All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
-virtual const TiXmlDeclarationToDeclaration () const
 Cast to a more defined type. Will return null not of the requested type.
-virtual TiXmlDeclarationToDeclaration ()
 Cast to a more defined type. Will return null not of the requested type.
-virtual bool Accept (TiXmlVisitor *visitor) const
 Walk the XML tree visiting this node and all of its children.
-

Detailed Description

-In correct XML the declaration is the first entry in the file. -

-

		<?xml version="1.0" standalone="yes"?>
-	

-TinyXml will happily read or write files without a declaration, however. There are 3 possible attributes to the declaration: version, encoding, and standalone.

-Note: In this version of the code, the attributes are handled as special cases, not generic attributes, simply because there can only be at most 3 and they are always the same. -

-


Member Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - -
virtual void TiXmlDeclaration::Print (FILE *  cfile,
int  depth 
) const [inline, virtual]
-
-
- -

-All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. -

-) Either or both cfile and str can be null.

-This is a formatted print, and will insert tabs and newlines.

-(For an unformatted stream, use the << operator.) -

-Implements TiXmlBase. -

-

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDeclaration.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDeclaration.png deleted file mode 100644 index c10912b703..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDeclaration.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDocument-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDocument-members.html deleted file mode 100644 index df6132a03d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDocument-members.html +++ /dev/null @@ -1,119 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlDocument Member List

This is the complete list of members for TiXmlDocument, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Accept(TiXmlVisitor *content) const TiXmlDocument [virtual]
Clear()TiXmlNode
ClearError()TiXmlDocument [inline]
Clone() const TiXmlDocument [protected, virtual]
Column() const TiXmlBase [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out)TiXmlBase [static]
Error() const TiXmlDocument [inline]
ErrorCol() const TiXmlDocument [inline]
ErrorDesc() const TiXmlDocument [inline]
ErrorId() const TiXmlDocument [inline]
ErrorRow() const TiXmlDocument [inline]
FirstChild() const TiXmlNode [inline]
FirstChild(const char *value) const TiXmlNode
FirstChild(const char *_value)TiXmlNode [inline]
FirstChild(const std::string &_value) const TiXmlNode [inline]
FirstChild(const std::string &_value)TiXmlNode [inline]
FirstChildElement() const TiXmlNode
FirstChildElement(const char *_value) const TiXmlNode
FirstChildElement(const std::string &_value) const TiXmlNode [inline]
FirstChildElement(const std::string &_value)TiXmlNode [inline]
GetDocument() const TiXmlNode
GetUserData()TiXmlBase [inline]
GetUserData() const TiXmlBase [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis)TiXmlNode
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis)TiXmlNode
InsertEndChild(const TiXmlNode &addThis)TiXmlNode
IsWhiteSpaceCondensed()TiXmlBase [inline, static]
IterateChildren(const TiXmlNode *previous) const TiXmlNode
IterateChildren(const char *value, const TiXmlNode *previous) const TiXmlNode
IterateChildren(const std::string &_value, const TiXmlNode *previous) const TiXmlNode [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous)TiXmlNode [inline]
LastChild()TiXmlNode [inline]
LastChild(const char *_value)TiXmlNode [inline]
LastChild(const std::string &_value) const TiXmlNode [inline]
LastChild(const std::string &_value)TiXmlNode [inline]
LinkEndChild(TiXmlNode *addThis)TiXmlNode
LoadFile(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)TiXmlDocument
LoadFile(const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)TiXmlDocument
LoadFile(FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)TiXmlDocument
LoadFile(const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)TiXmlDocument [inline]
NextSibling(const std::string &_value) const TiXmlNode [inline]
NextSibling(const std::string &_value)TiXmlNode [inline]
NextSibling() const TiXmlNode [inline]
NextSibling(const char *) const TiXmlNode
NextSiblingElement() const TiXmlNode
NextSiblingElement(const char *) const TiXmlNode
NextSiblingElement(const std::string &_value) const TiXmlNode [inline]
NextSiblingElement(const std::string &_value)TiXmlNode [inline]
NoChildren() const TiXmlNode [inline]
NodeType enum nameTiXmlNode
operator<<(std::ostream &out, const TiXmlNode &base)TiXmlNode [friend]
operator<<(std::string &out, const TiXmlNode &base)TiXmlNode [friend]
operator>>(std::istream &in, TiXmlNode &base)TiXmlNode [friend]
Parent()TiXmlNode [inline]
Parse(const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)TiXmlDocument [virtual]
PreviousSibling() const TiXmlNode [inline]
PreviousSibling(const char *) const TiXmlNode
PreviousSibling(const std::string &_value) const TiXmlNode [inline]
PreviousSibling(const std::string &_value)TiXmlNode [inline]
Print() const TiXmlDocument [inline]
Print(FILE *cfile, int depth=0) const TiXmlDocument [virtual]
RemoveChild(TiXmlNode *removeThis)TiXmlNode
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis)TiXmlNode
RootElement() const TiXmlDocument [inline]
Row() const TiXmlBase [inline]
SaveFile() const TiXmlDocument
SaveFile(const char *filename) const TiXmlDocument
SaveFile(FILE *) const TiXmlDocument
SaveFile(const std::string &filename) const TiXmlDocument [inline]
SetCondenseWhiteSpace(bool condense)TiXmlBase [inline, static]
SetTabSize(int _tabsize)TiXmlDocument [inline]
SetUserData(void *user)TiXmlBase [inline]
SetValue(const char *_value)TiXmlNode [inline]
SetValue(const std::string &_value)TiXmlNode [inline]
TiXmlDocument()TiXmlDocument
TiXmlDocument(const char *documentName)TiXmlDocument
TiXmlDocument(const std::string &documentName)TiXmlDocument
ToComment() const TiXmlNode [inline, virtual]
ToComment()TiXmlNode [inline, virtual]
ToDeclaration() const TiXmlNode [inline, virtual]
ToDeclaration()TiXmlNode [inline, virtual]
ToDocument() const TiXmlDocument [inline, virtual]
ToDocument()TiXmlDocument [inline, virtual]
ToElement() const TiXmlNode [inline, virtual]
ToElement()TiXmlNode [inline, virtual]
ToText() const TiXmlNode [inline, virtual]
ToText()TiXmlNode [inline, virtual]
ToUnknown() const TiXmlNode [inline, virtual]
ToUnknown()TiXmlNode [inline, virtual]
Type() const TiXmlNode [inline]
userDataTiXmlBase [protected]
Value() const TiXmlNode [inline]
ValueStr() const TiXmlNode [inline]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDocument.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDocument.html deleted file mode 100644 index 9779d3cc6f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDocument.html +++ /dev/null @@ -1,430 +0,0 @@ - - -TinyXml: TiXmlDocument Class Reference - - - - - - -

TiXmlDocument Class Reference

Always the top level node. -More... -

-#include <tinyxml.h> -

-

Inheritance diagram for TiXmlDocument: -

- -TiXmlNode -TiXmlBase - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

TiXmlDocument ()
 Create an empty document, that has no name.
TiXmlDocument (const char *documentName)
 Create a document with a name. The name of the document is also the filename of the xml.
TiXmlDocument (const std::string &documentName)
 Constructor.
bool LoadFile (TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
 Load a file using the current document value.
-bool SaveFile () const
 Save a file using the current document value. Returns true if successful.
-bool LoadFile (const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
 Load a file using the given filename. Returns true if successful.
-bool SaveFile (const char *filename) const
 Save a file using the given filename. Returns true if successful.
bool LoadFile (FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
 Load a file using the given FILE*.
-bool SaveFile (FILE *) const
 Save a file using the given FILE*. Returns true if successful.
bool LoadFile (const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
-bool SaveFile (const std::string &filename) const
 < STL std::string version.
virtual const char * Parse (const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
 Parse the given null terminated block of xml data.
const TiXmlElementRootElement () const
 Get the root element -- the only top level element -- of the document.
bool Error () const
 If an error occurs, Error will be set to true.
-const char * ErrorDesc () const
 Contains a textual (english) description of the error if one occurs.
int ErrorId () const
 Generally, you probably want the error string ( ErrorDesc() ).
int ErrorRow () const
 Returns the location (if known) of the error.
-int ErrorCol () const
 The column where the error occured. See ErrorRow().
void SetTabSize (int _tabsize)
 SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to report the correct values for row and column.
void ClearError ()
 If you have handled the error, it can be reset with this call.
-void Print () const
 Write the document to standard out using formatted printing ("pretty print").
-virtual void Print (FILE *cfile, int depth=0) const
 Print this Document to a FILE stream.
-virtual const TiXmlDocumentToDocument () const
 Cast to a more defined type. Will return null not of the requested type.
-virtual TiXmlDocumentToDocument ()
 Cast to a more defined type. Will return null not of the requested type.
-virtual bool Accept (TiXmlVisitor *content) const
 Walk the XML tree visiting this node and all of its children.

Protected Member Functions

virtual TiXmlNodeClone () const
 Create an exact duplicate of this node and return it.
-

Detailed Description

-Always the top level node. -

-A document binds together all the XML pieces. It can be saved, loaded, and printed to the screen. The 'value' of a document node is the xml file name. -

-


Member Function Documentation

- -
-
- - - - - - - - -
void TiXmlDocument::ClearError (  )  [inline]
-
-
- -

-If you have handled the error, it can be reset with this call. -

-The error state is automatically cleared if you Parse a new XML block. -

-

- -

-
- - - - - - - - -
virtual TiXmlNode* TiXmlDocument::Clone (  )  const [protected, virtual]
-
-
- -

-Create an exact duplicate of this node and return it. -

-The memory must be deleted by the caller. -

-Implements TiXmlNode. -

-

- -

-
- - - - - - - - -
bool TiXmlDocument::Error (  )  const [inline]
-
-
- -

-If an error occurs, Error will be set to true. -

-Also,

    -
  • The ErrorId() will contain the integer identifier of the error (not generally useful)
  • The ErrorDesc() method will return the name of the error. (very useful)
  • The ErrorRow() and ErrorCol() will return the location of the error (if known)
- -
-

- -

-
- - - - - - - - -
int TiXmlDocument::ErrorId (  )  const [inline]
-
-
- -

-Generally, you probably want the error string ( ErrorDesc() ). -

-But if you prefer the ErrorId, this function will fetch it. -

-

- -

-
- - - - - - - - -
int TiXmlDocument::ErrorRow (  )  const [inline]
-
-
- -

-Returns the location (if known) of the error. -

-The first column is column 1, and the first row is row 1. A value of 0 means the row and column wasn't applicable (memory errors, for example, have no row/column) or the parser lost the error. (An error in the error reporting, in that case.)

-

See also:
SetTabSize, Row, Column
- -
-

- -

-
- - - - - - - - - - - - - - - - - - -
bool TiXmlDocument::LoadFile (const std::string &  filename,
TiXmlEncoding  encoding = TIXML_DEFAULT_ENCODING 
) [inline]
-
-
- -

-

Parameters:
- - -
encoding  -STL std::string version.
-
-
-

- -

-
- - - - - - - - - - - - - - - - - - -
bool TiXmlDocument::LoadFile (FILE * ,
TiXmlEncoding  encoding = TIXML_DEFAULT_ENCODING 
)
-
-
- -

-Load a file using the given FILE*. -

-Returns true if successful. Note that this method doesn't stream - the entire object pointed at by the FILE* will be interpreted as an XML file. TinyXML doesn't stream in XML from the current file location. Streaming may be added in the future. -

-

- -

-
- - - - - - - - - -
bool TiXmlDocument::LoadFile (TiXmlEncoding  encoding = TIXML_DEFAULT_ENCODING  ) 
-
-
- -

-Load a file using the current document value. -

-Returns true if successful. Will delete any existing document data before loading. -

-

- -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
virtual const char* TiXmlDocument::Parse (const char *  p,
TiXmlParsingData *  data = 0,
TiXmlEncoding  encoding = TIXML_DEFAULT_ENCODING 
) [virtual]
-
-
- -

-Parse the given null terminated block of xml data. -

-Passing in an encoding to this method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml to use that encoding, regardless of what TinyXml might otherwise try to detect. -

-Implements TiXmlBase. -

-

- -

-
- - - - - - - - -
const TiXmlElement* TiXmlDocument::RootElement (  )  const [inline]
-
-
- -

-Get the root element -- the only top level element -- of the document. -

-In well formed XML, there should only be one. TinyXml is tolerant of multiple elements at the document level. -

-

- -

-
- - - - - - - - - -
void TiXmlDocument::SetTabSize (int  _tabsize  )  [inline]
-
-
- -

-SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to report the correct values for row and column. -

-It does not change the output or input in any way.

-By calling this method, with a tab size greater than 0, the row and column of each node and attribute is stored when the file is loaded. Very useful for tracking the DOM back in to the source file.

-The tab size is required for calculating the location of nodes. If not set, the default of 4 is used. The tabsize is set per document. Setting the tabsize to 0 disables row/column tracking.

-Note that row and column tracking is not supported when using operator>>.

-The tab size needs to be enabled before the parse or load. Correct usage:

		TiXmlDocument doc;
-		doc.SetTabSize( 8 );
-		doc.Load( "myfile.xml" );
-		

-

See also:
Row, Column
- -
-

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDocument.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDocument.png deleted file mode 100644 index 32fd267e47..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlDocument.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlElement-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlElement-members.html deleted file mode 100644 index ece5255d5c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlElement-members.html +++ /dev/null @@ -1,116 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlElement Member List

This is the complete list of members for TiXmlElement, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Accept(TiXmlVisitor *visitor) const TiXmlElement [virtual]
Attribute(const char *name) const TiXmlElement
Attribute(const char *name, int *i) const TiXmlElement
Attribute(const char *name, double *d) const TiXmlElement
Clear()TiXmlNode
Clone() const TiXmlElement [virtual]
Column() const TiXmlBase [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out)TiXmlBase [static]
FirstAttribute() const TiXmlElement [inline]
FirstChild() const TiXmlNode [inline]
FirstChild(const char *value) const TiXmlNode
FirstChild(const char *_value)TiXmlNode [inline]
FirstChild(const std::string &_value) const TiXmlNode [inline]
FirstChild(const std::string &_value)TiXmlNode [inline]
FirstChildElement() const TiXmlNode
FirstChildElement(const char *_value) const TiXmlNode
FirstChildElement(const std::string &_value) const TiXmlNode [inline]
FirstChildElement(const std::string &_value)TiXmlNode [inline]
GetDocument() const TiXmlNode
GetText() const TiXmlElement
GetUserData()TiXmlBase [inline]
GetUserData() const TiXmlBase [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis)TiXmlNode
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis)TiXmlNode
InsertEndChild(const TiXmlNode &addThis)TiXmlNode
IsWhiteSpaceCondensed()TiXmlBase [inline, static]
IterateChildren(const TiXmlNode *previous) const TiXmlNode
IterateChildren(const char *value, const TiXmlNode *previous) const TiXmlNode
IterateChildren(const std::string &_value, const TiXmlNode *previous) const TiXmlNode [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous)TiXmlNode [inline]
LastAttribute() const TiXmlElement [inline]
LastChild()TiXmlNode [inline]
LastChild(const char *_value)TiXmlNode [inline]
LastChild(const std::string &_value) const TiXmlNode [inline]
LastChild(const std::string &_value)TiXmlNode [inline]
LinkEndChild(TiXmlNode *addThis)TiXmlNode
NextSibling(const std::string &_value) const TiXmlNode [inline]
NextSibling(const std::string &_value)TiXmlNode [inline]
NextSibling() const TiXmlNode [inline]
NextSibling(const char *) const TiXmlNode
NextSiblingElement() const TiXmlNode
NextSiblingElement(const char *) const TiXmlNode
NextSiblingElement(const std::string &_value) const TiXmlNode [inline]
NextSiblingElement(const std::string &_value)TiXmlNode [inline]
NoChildren() const TiXmlNode [inline]
NodeType enum nameTiXmlNode
operator<<(std::ostream &out, const TiXmlNode &base)TiXmlNode [friend]
operator<<(std::string &out, const TiXmlNode &base)TiXmlNode [friend]
operator>>(std::istream &in, TiXmlNode &base)TiXmlNode [friend]
Parent()TiXmlNode [inline]
PreviousSibling() const TiXmlNode [inline]
PreviousSibling(const char *) const TiXmlNode
PreviousSibling(const std::string &_value) const TiXmlNode [inline]
PreviousSibling(const std::string &_value)TiXmlNode [inline]
Print(FILE *cfile, int depth) const TiXmlElement [virtual]
QueryDoubleAttribute(const char *name, double *_value) const TiXmlElement
QueryFloatAttribute(const char *name, float *_value) const TiXmlElement [inline]
QueryIntAttribute(const char *name, int *_value) const TiXmlElement
QueryValueAttribute(const std::string &name, T *outValue) const TiXmlElement [inline]
RemoveAttribute(const char *name)TiXmlElement
RemoveAttribute(const std::string &name)TiXmlElement [inline]
RemoveChild(TiXmlNode *removeThis)TiXmlNode
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis)TiXmlNode
Row() const TiXmlBase [inline]
SetAttribute(const char *name, const char *_value)TiXmlElement
SetAttribute(const std::string &name, const std::string &_value)TiXmlElement
SetAttribute(const char *name, int value)TiXmlElement
SetCondenseWhiteSpace(bool condense)TiXmlBase [inline, static]
SetDoubleAttribute(const char *name, double value)TiXmlElement
SetUserData(void *user)TiXmlBase [inline]
SetValue(const char *_value)TiXmlNode [inline]
SetValue(const std::string &_value)TiXmlNode [inline]
TiXmlElement(const char *in_value)TiXmlElement
TiXmlElement(const std::string &_value)TiXmlElement
ToComment() const TiXmlNode [inline, virtual]
ToComment()TiXmlNode [inline, virtual]
ToDeclaration() const TiXmlNode [inline, virtual]
ToDeclaration()TiXmlNode [inline, virtual]
ToDocument() const TiXmlNode [inline, virtual]
ToDocument()TiXmlNode [inline, virtual]
ToElement() const TiXmlElement [inline, virtual]
ToElement()TiXmlElement [inline, virtual]
ToText() const TiXmlNode [inline, virtual]
ToText()TiXmlNode [inline, virtual]
ToUnknown() const TiXmlNode [inline, virtual]
ToUnknown()TiXmlNode [inline, virtual]
Type() const TiXmlNode [inline]
userDataTiXmlBase [protected]
Value() const TiXmlNode [inline]
ValueStr() const TiXmlNode [inline]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlElement.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlElement.html deleted file mode 100644 index dcbd251571..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlElement.html +++ /dev/null @@ -1,420 +0,0 @@ - - -TinyXml: TiXmlElement Class Reference - - - - - - -

TiXmlElement Class Reference

The element is a container class. -More... -

-#include <tinyxml.h> -

-

Inheritance diagram for TiXmlElement: -

- -TiXmlNode -TiXmlBase - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

TiXmlElement (const char *in_value)
 Construct an element.
TiXmlElement (const std::string &_value)
 std::string constructor.
-const char * Attribute (const char *name) const
 Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
const char * Attribute (const char *name, int *i) const
 Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
const char * Attribute (const char *name, double *d) const
 Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
int QueryIntAttribute (const char *name, int *_value) const
 QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer error checking.
-int QueryDoubleAttribute (const char *name, double *_value) const
 QueryDoubleAttribute examines the attribute - see QueryIntAttribute().
-int QueryFloatAttribute (const char *name, float *_value) const
 QueryFloatAttribute examines the attribute - see QueryIntAttribute().
template<typename T>
int QueryValueAttribute (const std::string &name, T *outValue) const
 Template form of the attribute query which will try to read the attribute into the specified type.
void SetAttribute (const char *name, const char *_value)
 Sets an attribute of name to a given value.
-void SetAttribute (const std::string &name, const std::string &_value)
 STL std::string form. STL std::string form.
void SetAttribute (const char *name, int value)
 Sets an attribute of name to a given value.
void SetDoubleAttribute (const char *name, double value)
 Sets an attribute of name to a given value.
-void RemoveAttribute (const char *name)
 Deletes an attribute with the given name.
-void RemoveAttribute (const std::string &name)
 STL std::string form.
-const TiXmlAttributeFirstAttribute () const
 Access the first attribute in this element.
-const TiXmlAttributeLastAttribute () const
 Access the last attribute in this element.
const char * GetText () const
 Convenience function for easy access to the text inside an element.
-virtual TiXmlNodeClone () const
 Creates a new Element and returns it - the returned element is a copy.
virtual void Print (FILE *cfile, int depth) const
 All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
-virtual const TiXmlElementToElement () const
 Cast to a more defined type. Will return null not of the requested type.
-virtual TiXmlElementToElement ()
 Cast to a more defined type. Will return null not of the requested type.
-virtual bool Accept (TiXmlVisitor *visitor) const
 Walk the XML tree visiting this node and all of its children.
-

Detailed Description

-The element is a container class. -

-It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes. -

-


Member Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - -
const char* TiXmlElement::Attribute (const char *  name,
double *  d 
) const
-
-
- -

-Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. -

-If the attribute exists and can be converted to an double, the double value will be put in the return 'd', if 'd' is non-null. -

-

- -

-
- - - - - - - - - - - - - - - - - - -
const char* TiXmlElement::Attribute (const char *  name,
int *  i 
) const
-
-
- -

-Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. -

-If the attribute exists and can be converted to an integer, the integer value will be put in the return 'i', if 'i' is non-null. -

-

- -

-
- - - - - - - - -
const char* TiXmlElement::GetText (  )  const
-
-
- -

-Convenience function for easy access to the text inside an element. -

-Although easy and concise, GetText() is limited compared to getting the TiXmlText child and accessing it directly.

-If the first child of 'this' is a TiXmlText, the GetText() returns the character string of the Text node, else null is returned.

-This is a convenient method for getting the text of simple contained text:

		<foo>This is text</foo>
-		const char* str = fooElement->GetText();
-		

-'str' will be a pointer to "This is text".

-Note that this function can be misleading. If the element foo was created from this XML:

		<foo><b>This is text</b></foo> 
-		

-then the value of str would be null. The first child node isn't a text node, it is another element. From this XML:

		<foo>This is <b>text</b></foo> 
-		
GetText() will return "This is ".

-WARNING: GetText() accesses a child node - don't become confused with the similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are safe type casts on the referenced node. -

-

- -

-
- - - - - - - - - - - - - - - - - - -
virtual void TiXmlElement::Print (FILE *  cfile,
int  depth 
) const [virtual]
-
-
- -

-All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. -

-) Either or both cfile and str can be null.

-This is a formatted print, and will insert tabs and newlines.

-(For an unformatted stream, use the << operator.) -

-Implements TiXmlBase. -

-

- -

-
- - - - - - - - - - - - - - - - - - -
int TiXmlElement::QueryIntAttribute (const char *  name,
int *  _value 
) const
-
-
- -

-QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer error checking. -

-If the attribute is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE. If the attribute does not exist, then TIXML_NO_ATTRIBUTE is returned. -

-

- -

-
-
-template<typename T>
- - - - - - - - - - - - - - - - - - -
int TiXmlElement::QueryValueAttribute (const std::string &  name,
T *  outValue 
) const [inline]
-
-
- -

-Template form of the attribute query which will try to read the attribute into the specified type. -

-Very easy, very powerful, but be careful to make sure to call this with the correct type.

-NOTE: This method doesn't work correctly for 'string' types.

-

Returns:
TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE
- -
-

- -

-
- - - - - - - - - - - - - - - - - - -
void TiXmlElement::SetAttribute (const char *  name,
int  value 
)
-
-
- -

-Sets an attribute of name to a given value. -

-The attribute will be created if it does not exist, or changed if it does. -

-

- -

-
- - - - - - - - - - - - - - - - - - -
void TiXmlElement::SetAttribute (const char *  name,
const char *  _value 
)
-
-
- -

-Sets an attribute of name to a given value. -

-The attribute will be created if it does not exist, or changed if it does. -

-

- -

-
- - - - - - - - - - - - - - - - - - -
void TiXmlElement::SetDoubleAttribute (const char *  name,
double  value 
)
-
-
- -

-Sets an attribute of name to a given value. -

-The attribute will be created if it does not exist, or changed if it does. -

-

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlElement.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlElement.png deleted file mode 100644 index 5acc21bd0e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlElement.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlHandle-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlHandle-members.html deleted file mode 100644 index 77ed5babad..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlHandle-members.html +++ /dev/null @@ -1,44 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlHandle Member List

This is the complete list of members for TiXmlHandle, including all inherited members.

- - - - - - - - - - - - - - - - - - -
Child(const char *value, int index) const TiXmlHandle
Child(int index) const TiXmlHandle
ChildElement(const char *value, int index) const TiXmlHandle
ChildElement(int index) const TiXmlHandle
Element() const TiXmlHandle [inline]
FirstChild() const TiXmlHandle
FirstChild(const char *value) const TiXmlHandle
FirstChildElement() const TiXmlHandle
FirstChildElement(const char *value) const TiXmlHandle
Node() const TiXmlHandle [inline]
Text() const TiXmlHandle [inline]
TiXmlHandle(TiXmlNode *_node)TiXmlHandle [inline]
TiXmlHandle(const TiXmlHandle &ref)TiXmlHandle [inline]
ToElement() const TiXmlHandle [inline]
ToNode() const TiXmlHandle [inline]
ToText() const TiXmlHandle [inline]
ToUnknown() const TiXmlHandle [inline]
Unknown() const TiXmlHandle [inline]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlHandle.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlHandle.html deleted file mode 100644 index 3808e66f65..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlHandle.html +++ /dev/null @@ -1,419 +0,0 @@ - - -TinyXml: TiXmlHandle Class Reference - - - - - - -

TiXmlHandle Class Reference

A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thing. -More... -

-#include <tinyxml.h> -

-List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

TiXmlHandle (TiXmlNode *_node)
 Create a handle from any node (at any depth of the tree.) This can be a null pointer.
TiXmlHandle (const TiXmlHandle &ref)
 Copy constructor.
-TiXmlHandle FirstChild () const
 Return a handle to the first child node.
-TiXmlHandle FirstChild (const char *value) const
 Return a handle to the first child node with the given name.
-TiXmlHandle FirstChildElement () const
 Return a handle to the first child element.
-TiXmlHandle FirstChildElement (const char *value) const
 Return a handle to the first child element with the given name.
TiXmlHandle Child (const char *value, int index) const
 Return a handle to the "index" child with the given name.
TiXmlHandle Child (int index) const
 Return a handle to the "index" child.
TiXmlHandle ChildElement (const char *value, int index) const
 Return a handle to the "index" child element with the given name.
TiXmlHandle ChildElement (int index) const
 Return a handle to the "index" child element.
TiXmlNodeToNode () const
 Return the handle as a TiXmlNode.
TiXmlElementToElement () const
 Return the handle as a TiXmlElement.
TiXmlTextToText () const
 Return the handle as a TiXmlText.
TiXmlUnknownToUnknown () const
 Return the handle as a TiXmlUnknown.
TiXmlNodeNode () const
TiXmlElementElement () const
TiXmlTextText () const
TiXmlUnknownUnknown () const
-


Detailed Description

-A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thing. -

-Note that TiXmlHandle is not part of the TinyXml DOM structure. It is a separate utility class.

-Take an example:

	<Document>
-		<Element attributeA = "valueA">
-			<Child attributeB = "value1" />
-			<Child attributeB = "value2" />
-		</Element>
-	<Document>
-	

-Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very easy to write a *lot* of code that looks like:

-

	TiXmlElement* root = document.FirstChildElement( "Document" );
-	if ( root )
-	{
-		TiXmlElement* element = root->FirstChildElement( "Element" );
-		if ( element )
-		{
-			TiXmlElement* child = element->FirstChildElement( "Child" );
-			if ( child )
-			{
-				TiXmlElement* child2 = child->NextSiblingElement( "Child" );
-				if ( child2 )
-				{
-					// Finally do something useful.
-	

-And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity of such code. A TiXmlHandle checks for null pointers so it is perfectly safe and correct to use:

-

	TiXmlHandle docHandle( &document );
-	TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement();
-	if ( child2 )
-	{
-		// do something useful
-	

-Which is MUCH more concise and useful.

-It is also safe to copy handles - internally they are nothing more than node pointers.

	TiXmlHandle handleCopy = handle;
-	

-What they should not be used for is iteration:

-

	int i=0; 
-	while ( true )
-	{
-		TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement();
-		if ( !child )
-			break;
-		// do something
-		++i;
-	}
-	

-It seems reasonable, but it is in fact two embedded while loops. The Child method is a linear walk to find the element, so this code would iterate much more than it needs to. Instead, prefer:

-

	TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement();
-
-	for( child; child; child=child->NextSiblingElement() )
-	{
-		// do something
-	}
-	
-

-


Member Function Documentation

- -
-
- - - - - - - - - -
TiXmlHandle TiXmlHandle::Child (int  index  )  const
-
-
- -

-Return a handle to the "index" child. -

-The first child is 0, the second 1, etc. -

-

- -

-
- - - - - - - - - - - - - - - - - - -
TiXmlHandle TiXmlHandle::Child (const char *  value,
int  index 
) const
-
-
- -

-Return a handle to the "index" child with the given name. -

-The first child is 0, the second 1, etc. -

-

- -

-
- - - - - - - - - -
TiXmlHandle TiXmlHandle::ChildElement (int  index  )  const
-
-
- -

-Return a handle to the "index" child element. -

-The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. -

-

- -

-
- - - - - - - - - - - - - - - - - - -
TiXmlHandle TiXmlHandle::ChildElement (const char *  value,
int  index 
) const
-
-
- -

-Return a handle to the "index" child element with the given name. -

-The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. -

-

- -

-
- - - - - - - - -
TiXmlElement* TiXmlHandle::Element (  )  const [inline]
-
-
- -

-

Deprecated:
use ToElement. Return the handle as a TiXmlElement. This may return null.
- -
-

- -

-
- - - - - - - - -
TiXmlNode* TiXmlHandle::Node (  )  const [inline]
-
-
- -

-

Deprecated:
use ToNode. Return the handle as a TiXmlNode. This may return null.
- -
-

- -

-
- - - - - - - - -
TiXmlText* TiXmlHandle::Text (  )  const [inline]
-
-
- -

-

Deprecated:
use ToText() Return the handle as a TiXmlText. This may return null.
- -
-

- -

-
- - - - - - - - -
TiXmlElement* TiXmlHandle::ToElement (  )  const [inline]
-
-
- -

-Return the handle as a TiXmlElement. -

-This may return null. -

-

- -

-
- - - - - - - - -
TiXmlNode* TiXmlHandle::ToNode (  )  const [inline]
-
-
- -

-Return the handle as a TiXmlNode. -

-This may return null. -

-

- -

-
- - - - - - - - -
TiXmlText* TiXmlHandle::ToText (  )  const [inline]
-
-
- -

-Return the handle as a TiXmlText. -

-This may return null. -

-

- -

-
- - - - - - - - -
TiXmlUnknown* TiXmlHandle::ToUnknown (  )  const [inline]
-
-
- -

-Return the handle as a TiXmlUnknown. -

-This may return null. -

-

- -

-
- - - - - - - - -
TiXmlUnknown* TiXmlHandle::Unknown (  )  const [inline]
-
-
- -

-

Deprecated:
use ToUnknown() Return the handle as a TiXmlUnknown. This may return null.
- -
-

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlNode-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlNode-members.html deleted file mode 100644 index b7c9ecf57f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlNode-members.html +++ /dev/null @@ -1,98 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlNode Member List

This is the complete list of members for TiXmlNode, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Accept(TiXmlVisitor *visitor) const =0TiXmlNode [pure virtual]
Clear()TiXmlNode
Clone() const =0TiXmlNode [pure virtual]
Column() const TiXmlBase [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out)TiXmlBase [static]
FirstChild() const TiXmlNode [inline]
FirstChild(const char *value) const TiXmlNode
FirstChild(const char *_value)TiXmlNode [inline]
FirstChild(const std::string &_value) const TiXmlNode [inline]
FirstChild(const std::string &_value)TiXmlNode [inline]
FirstChildElement() const TiXmlNode
FirstChildElement(const char *_value) const TiXmlNode
FirstChildElement(const std::string &_value) const TiXmlNode [inline]
FirstChildElement(const std::string &_value)TiXmlNode [inline]
GetDocument() const TiXmlNode
GetUserData()TiXmlBase [inline]
GetUserData() const TiXmlBase [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis)TiXmlNode
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis)TiXmlNode
InsertEndChild(const TiXmlNode &addThis)TiXmlNode
IsWhiteSpaceCondensed()TiXmlBase [inline, static]
IterateChildren(const TiXmlNode *previous) const TiXmlNode
IterateChildren(const char *value, const TiXmlNode *previous) const TiXmlNode
IterateChildren(const std::string &_value, const TiXmlNode *previous) const TiXmlNode [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous)TiXmlNode [inline]
LastChild()TiXmlNode [inline]
LastChild(const char *_value)TiXmlNode [inline]
LastChild(const std::string &_value) const TiXmlNode [inline]
LastChild(const std::string &_value)TiXmlNode [inline]
LinkEndChild(TiXmlNode *addThis)TiXmlNode
NextSibling(const std::string &_value) const TiXmlNode [inline]
NextSibling(const std::string &_value)TiXmlNode [inline]
NextSibling() const TiXmlNode [inline]
NextSibling(const char *) const TiXmlNode
NextSiblingElement() const TiXmlNode
NextSiblingElement(const char *) const TiXmlNode
NextSiblingElement(const std::string &_value) const TiXmlNode [inline]
NextSiblingElement(const std::string &_value)TiXmlNode [inline]
NoChildren() const TiXmlNode [inline]
NodeType enum nameTiXmlNode
operator<<(std::ostream &out, const TiXmlNode &base)TiXmlNode [friend]
operator<<(std::string &out, const TiXmlNode &base)TiXmlNode [friend]
operator>>(std::istream &in, TiXmlNode &base)TiXmlNode [friend]
Parent()TiXmlNode [inline]
PreviousSibling() const TiXmlNode [inline]
PreviousSibling(const char *) const TiXmlNode
PreviousSibling(const std::string &_value) const TiXmlNode [inline]
PreviousSibling(const std::string &_value)TiXmlNode [inline]
Print(FILE *cfile, int depth) const =0TiXmlBase [pure virtual]
RemoveChild(TiXmlNode *removeThis)TiXmlNode
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis)TiXmlNode
Row() const TiXmlBase [inline]
SetCondenseWhiteSpace(bool condense)TiXmlBase [inline, static]
SetUserData(void *user)TiXmlBase [inline]
SetValue(const char *_value)TiXmlNode [inline]
SetValue(const std::string &_value)TiXmlNode [inline]
ToComment() const TiXmlNode [inline, virtual]
ToComment()TiXmlNode [inline, virtual]
ToDeclaration() const TiXmlNode [inline, virtual]
ToDeclaration()TiXmlNode [inline, virtual]
ToDocument() const TiXmlNode [inline, virtual]
ToDocument()TiXmlNode [inline, virtual]
ToElement() const TiXmlNode [inline, virtual]
ToElement()TiXmlNode [inline, virtual]
ToText() const TiXmlNode [inline, virtual]
ToText()TiXmlNode [inline, virtual]
ToUnknown() const TiXmlNode [inline, virtual]
ToUnknown()TiXmlNode [inline, virtual]
Type() const TiXmlNode [inline]
userDataTiXmlBase [protected]
Value() const TiXmlNode [inline]
ValueStr() const TiXmlNode [inline]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlNode.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlNode.html deleted file mode 100644 index b64a0d60fa..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlNode.html +++ /dev/null @@ -1,780 +0,0 @@ - - -TinyXml: TiXmlNode Class Reference - - - - - - -

TiXmlNode Class Reference

The parent class for everything in the Document Object Model. -More... -

-#include <tinyxml.h> -

-

Inheritance diagram for TiXmlNode: -

- -TiXmlBase -TiXmlComment -TiXmlDeclaration -TiXmlDocument -TiXmlElement -TiXmlText -TiXmlUnknown - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Types

enum  NodeType
 The types of XML nodes supported by TinyXml. More...

Public Member Functions

const char * Value () const
 The meaning of 'value' changes for the specific type of TiXmlNode.
const std::string & ValueStr () const
 Return Value() as a std::string.
void SetValue (const char *_value)
 Changes the value of the node.
-void SetValue (const std::string &_value)
 STL std::string form.
-void Clear ()
 Delete all the children of this node. Does not affect 'this'.
-TiXmlNodeParent ()
 One step up the DOM.
-const TiXmlNodeFirstChild () const
 The first child of this node. Will be null if there are no children.
const TiXmlNodeFirstChild (const char *value) const
 The first child of this node with the matching 'value'.
-TiXmlNodeFirstChild (const char *_value)
 The first child of this node with the matching 'value'. Will be null if none found.
-TiXmlNodeLastChild ()
 The last child of this node. Will be null if there are no children.
-TiXmlNodeLastChild (const char *_value)
 The last child of this node matching 'value'. Will be null if there are no children.
-const TiXmlNodeFirstChild (const std::string &_value) const
 STL std::string form.
-TiXmlNodeFirstChild (const std::string &_value)
 STL std::string form.
-const TiXmlNodeLastChild (const std::string &_value) const
 STL std::string form.
-TiXmlNodeLastChild (const std::string &_value)
 STL std::string form.
const TiXmlNodeIterateChildren (const TiXmlNode *previous) const
 An alternate way to walk the children of a node.
-const TiXmlNodeIterateChildren (const char *value, const TiXmlNode *previous) const
 This flavor of IterateChildren searches for children with a particular 'value'.
-const TiXmlNodeIterateChildren (const std::string &_value, const TiXmlNode *previous) const
 STL std::string form.
-TiXmlNodeIterateChildren (const std::string &_value, const TiXmlNode *previous)
 STL std::string form.
TiXmlNodeInsertEndChild (const TiXmlNode &addThis)
 Add a new node related to this.
TiXmlNodeLinkEndChild (TiXmlNode *addThis)
 Add a new node related to this.
TiXmlNodeInsertBeforeChild (TiXmlNode *beforeThis, const TiXmlNode &addThis)
 Add a new node related to this.
TiXmlNodeInsertAfterChild (TiXmlNode *afterThis, const TiXmlNode &addThis)
 Add a new node related to this.
TiXmlNodeReplaceChild (TiXmlNode *replaceThis, const TiXmlNode &withThis)
 Replace a child of this node.
-bool RemoveChild (TiXmlNode *removeThis)
 Delete a child of this node.
-const TiXmlNodePreviousSibling () const
 Navigate to a sibling node.
-const TiXmlNodePreviousSibling (const char *) const
 Navigate to a sibling node.
-const TiXmlNodePreviousSibling (const std::string &_value) const
 STL std::string form.
-TiXmlNodePreviousSibling (const std::string &_value)
 STL std::string form.
-const TiXmlNodeNextSibling (const std::string &_value) const
 STL std::string form.
-TiXmlNodeNextSibling (const std::string &_value)
 STL std::string form.
-const TiXmlNodeNextSibling () const
 Navigate to a sibling node.
-const TiXmlNodeNextSibling (const char *) const
 Navigate to a sibling node with the given 'value'.
const TiXmlElementNextSiblingElement () const
 Convenience function to get through elements.
const TiXmlElementNextSiblingElement (const char *) const
 Convenience function to get through elements.
-const TiXmlElementNextSiblingElement (const std::string &_value) const
 STL std::string form.
-TiXmlElementNextSiblingElement (const std::string &_value)
 STL std::string form.
-const TiXmlElementFirstChildElement () const
 Convenience function to get through elements.
-const TiXmlElementFirstChildElement (const char *_value) const
 Convenience function to get through elements.
-const TiXmlElementFirstChildElement (const std::string &_value) const
 STL std::string form.
-TiXmlElementFirstChildElement (const std::string &_value)
 STL std::string form.
int Type () const
 Query the type (as an enumerated value, above) of this node.
const TiXmlDocumentGetDocument () const
 Return a pointer to the Document this node lives in.
-bool NoChildren () const
 Returns true if this node has no children.
-virtual const TiXmlDocumentToDocument () const
 Cast to a more defined type. Will return null if not of the requested type.
-virtual const TiXmlElementToElement () const
 Cast to a more defined type. Will return null if not of the requested type.
-virtual const TiXmlCommentToComment () const
 Cast to a more defined type. Will return null if not of the requested type.
-virtual const TiXmlUnknownToUnknown () const
 Cast to a more defined type. Will return null if not of the requested type.
-virtual const TiXmlTextToText () const
 Cast to a more defined type. Will return null if not of the requested type.
-virtual const TiXmlDeclarationToDeclaration () const
 Cast to a more defined type. Will return null if not of the requested type.
-virtual TiXmlDocumentToDocument ()
 Cast to a more defined type. Will return null if not of the requested type.
-virtual TiXmlElementToElement ()
 Cast to a more defined type. Will return null if not of the requested type.
-virtual TiXmlCommentToComment ()
 Cast to a more defined type. Will return null if not of the requested type.
-virtual TiXmlUnknownToUnknown ()
 Cast to a more defined type. Will return null if not of the requested type.
-virtual TiXmlTextToText ()
 Cast to a more defined type. Will return null if not of the requested type.
-virtual TiXmlDeclarationToDeclaration ()
 Cast to a more defined type. Will return null if not of the requested type.
virtual TiXmlNodeClone () const =0
 Create an exact duplicate of this node and return it.
virtual bool Accept (TiXmlVisitor *visitor) const =0
 Accept a hierchical visit the nodes in the TinyXML DOM.

Friends

-class TiXmlDocument
-class TiXmlElement
std::istream & operator>> (std::istream &in, TiXmlNode &base)
 An input stream operator, for every class.
std::ostream & operator<< (std::ostream &out, const TiXmlNode &base)
 An output stream operator, for every class.
-std::string & operator<< (std::string &out, const TiXmlNode &base)
 Appends the XML node or attribute to a std::string.
-

Detailed Description

-The parent class for everything in the Document Object Model. -

-(Except for attributes). Nodes have siblings, a parent, and children. A node can be in a document, or stand on its own. The type of a TiXmlNode can be queried, and it can be cast to its more defined type. -

-


Member Enumeration Documentation

- -
-
- - - - -
enum TiXmlNode::NodeType
-
-
- -

-The types of XML nodes supported by TinyXml. -

-(All the unsupported types are picked up by UNKNOWN.) -

-

-


Member Function Documentation

- -
-
- - - - - - - - - -
virtual bool TiXmlNode::Accept (TiXmlVisitor visitor  )  const [pure virtual]
-
-
- -

-Accept a hierchical visit the nodes in the TinyXML DOM. -

-Every node in the XML tree will be conditionally visited and the host will be called back via the TiXmlVisitor interface.

-This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML is unchanged by using this interface versus any other.)

-The interface has been based on ideas from:

-

-

-Which are both good references for "visiting".

-An example of using Accept():

		TiXmlPrinter printer;
-		tinyxmlDoc.Accept( &printer );
-		const char* xmlcstr = printer.CStr();
-		
-

-Implemented in TiXmlElement, TiXmlComment, TiXmlText, TiXmlDeclaration, TiXmlUnknown, and TiXmlDocument. -

-

- -

-
- - - - - - - - -
virtual TiXmlNode* TiXmlNode::Clone (  )  const [pure virtual]
-
-
- -

-Create an exact duplicate of this node and return it. -

-The memory must be deleted by the caller. -

-Implemented in TiXmlElement, TiXmlComment, TiXmlText, TiXmlDeclaration, TiXmlUnknown, and TiXmlDocument. -

-

- -

-
- - - - - - - - - -
const TiXmlNode* TiXmlNode::FirstChild (const char *  value  )  const
-
-
- -

-The first child of this node with the matching 'value'. -

-Will be null if none found. -

-

- -

-
- - - - - - - - -
const TiXmlDocument* TiXmlNode::GetDocument (  )  const
-
-
- -

-Return a pointer to the Document this node lives in. -

-Returns null if not in a document. -

-

- -

-
- - - - - - - - - - - - - - - - - - -
TiXmlNode* TiXmlNode::InsertAfterChild (TiXmlNode afterThis,
const TiXmlNode addThis 
)
-
-
- -

-Add a new node related to this. -

-Adds a child after the specified child. Returns a pointer to the new object or NULL if an error occured. -

-

- -

-
- - - - - - - - - - - - - - - - - - -
TiXmlNode* TiXmlNode::InsertBeforeChild (TiXmlNode beforeThis,
const TiXmlNode addThis 
)
-
-
- -

-Add a new node related to this. -

-Adds a child before the specified child. Returns a pointer to the new object or NULL if an error occured. -

-

- -

-
- - - - - - - - - -
TiXmlNode* TiXmlNode::InsertEndChild (const TiXmlNode addThis  ) 
-
-
- -

-Add a new node related to this. -

-Adds a child past the LastChild. Returns a pointer to the new object or NULL if an error occured. -

-

- -

-
- - - - - - - - - -
const TiXmlNode* TiXmlNode::IterateChildren (const TiXmlNode previous  )  const
-
-
- -

-An alternate way to walk the children of a node. -

-One way to iterate over nodes is:

			for( child = parent->FirstChild(); child; child = child->NextSibling() )
-		

-IterateChildren does the same thing with the syntax:

			child = 0;
-			while( child = parent->IterateChildren( child ) )
-		

-IterateChildren takes the previous child as input and finds the next one. If the previous child is null, it returns the first. IterateChildren will return null when done. -

-

- -

-
- - - - - - - - - -
TiXmlNode* TiXmlNode::LinkEndChild (TiXmlNode addThis  ) 
-
-
- -

-Add a new node related to this. -

-Adds a child past the LastChild.

-NOTE: the node to be added is passed by pointer, and will be henceforth owned (and deleted) by tinyXml. This method is efficient and avoids an extra copy, but should be used with care as it uses a different memory model than the other insert functions.

-

See also:
InsertEndChild
- -
-

- -

-
- - - - - - - - - -
const TiXmlElement* TiXmlNode::NextSiblingElement (const char *   )  const
-
-
- -

-Convenience function to get through elements. -

-Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element. -

-

- -

-
- - - - - - - - -
const TiXmlElement* TiXmlNode::NextSiblingElement (  )  const
-
-
- -

-Convenience function to get through elements. -

-Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element. -

-

- -

-
- - - - - - - - - - - - - - - - - - -
TiXmlNode* TiXmlNode::ReplaceChild (TiXmlNode replaceThis,
const TiXmlNode withThis 
)
-
-
- -

-Replace a child of this node. -

-Returns a pointer to the new object or NULL if an error occured. -

-

- -

-
- - - - - - - - - -
void TiXmlNode::SetValue (const char *  _value  )  [inline]
-
-
- -

-Changes the value of the node. -

-Defined as:

		Document:	filename of the xml file
-		Element:	name of the element
-		Comment:	the comment text
-		Unknown:	the tag contents
-		Text:		the text string
-		
-
-

- -

-
- - - - - - - - -
int TiXmlNode::Type (  )  const [inline]
-
-
- -

-Query the type (as an enumerated value, above) of this node. -

-The possible types are: DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, and DECLARATION. -

-

- -

-
- - - - - - - - -
const char* TiXmlNode::Value (  )  const [inline]
-
-
- -

-The meaning of 'value' changes for the specific type of TiXmlNode. -

-

		Document:	filename of the xml file
-		Element:	name of the element
-		Comment:	the comment text
-		Unknown:	the tag contents
-		Text:		the text string
-		

-The subclasses will wrap this function. -

-

- -

-
- - - - - - - - -
const std::string& TiXmlNode::ValueStr (  )  const [inline]
-
-
- -

-Return Value() as a std::string. -

-If you only use STL, this is more efficient than calling Value(). Only available in STL mode. -

-

-


Friends And Related Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - -
std::ostream& operator<< (std::ostream &  out,
const TiXmlNode base 
) [friend]
-
-
- -

-An output stream operator, for every class. -

-Note that this outputs without any newlines or formatting, as opposed to Print(), which includes tabs and new lines.

-The operator<< and operator>> are not completely symmetric. Writing a node to a stream is very well defined. You'll get a nice stream of output, without any extra whitespace or newlines.

-But reading is not as well defined. (As it always is.) If you create a TiXmlElement (for example) and read that from an input stream, the text needs to define an element or junk will result. This is true of all input streams, but it's worth keeping in mind.

-A TiXmlDocument will read nodes until it reads a root element, and all the children of that root element. -

-

- -

-
- - - - - - - - - - - - - - - - - - -
std::istream& operator>> (std::istream &  in,
TiXmlNode base 
) [friend]
-
-
- -

-An input stream operator, for every class. -

-Tolerant of newlines and formatting, but doesn't expect them. -

-

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlNode.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlNode.png deleted file mode 100644 index 6a663cf676..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlNode.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlPrinter-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlPrinter-members.html deleted file mode 100644 index bd011fe3ca..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlPrinter-members.html +++ /dev/null @@ -1,42 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlPrinter Member List

This is the complete list of members for TiXmlPrinter, including all inherited members.

- - - - - - - - - - - - - - - - -
CStr()TiXmlPrinter [inline]
Indent()TiXmlPrinter [inline]
LineBreak()TiXmlPrinter [inline]
SetIndent(const char *_indent)TiXmlPrinter [inline]
SetLineBreak(const char *_lineBreak)TiXmlPrinter [inline]
SetStreamPrinting()TiXmlPrinter [inline]
Size()TiXmlPrinter [inline]
Str()TiXmlPrinter [inline]
Visit(const TiXmlDeclaration &declaration)TiXmlPrinter [virtual]
Visit(const TiXmlText &text)TiXmlPrinter [virtual]
Visit(const TiXmlComment &comment)TiXmlPrinter [virtual]
Visit(const TiXmlUnknown &unknown)TiXmlPrinter [virtual]
VisitEnter(const TiXmlDocument &doc)TiXmlPrinter [virtual]
VisitEnter(const TiXmlElement &element, const TiXmlAttribute *firstAttribute)TiXmlPrinter [virtual]
VisitExit(const TiXmlDocument &doc)TiXmlPrinter [virtual]
VisitExit(const TiXmlElement &element)TiXmlPrinter [virtual]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlPrinter.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlPrinter.html deleted file mode 100644 index c33fdfb3ef..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlPrinter.html +++ /dev/null @@ -1,184 +0,0 @@ - - -TinyXml: TiXmlPrinter Class Reference - - - - - - -

TiXmlPrinter Class Reference

Print to memory functionality. -More... -

-#include <tinyxml.h> -

-

Inheritance diagram for TiXmlPrinter: -

- -TiXmlVisitor - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

-virtual bool VisitEnter (const TiXmlDocument &doc)
 Visit a document.
-virtual bool VisitExit (const TiXmlDocument &doc)
 Visit a document.
-virtual bool VisitEnter (const TiXmlElement &element, const TiXmlAttribute *firstAttribute)
 Visit an element.
-virtual bool VisitExit (const TiXmlElement &element)
 Visit an element.
-virtual bool Visit (const TiXmlDeclaration &declaration)
 Visit a declaration.
-virtual bool Visit (const TiXmlText &text)
 Visit a text node.
-virtual bool Visit (const TiXmlComment &comment)
 Visit a comment node.
-virtual bool Visit (const TiXmlUnknown &unknown)
 Visit an unknow node.
void SetIndent (const char *_indent)
 Set the indent characters for printing.
-const char * Indent ()
 Query the indention string.
void SetLineBreak (const char *_lineBreak)
 Set the line breaking string.
-const char * LineBreak ()
 Query the current line breaking string.
void SetStreamPrinting ()
 Switch over to "stream printing" which is the most dense formatting without linebreaks.
-const char * CStr ()
 Return the result.
-size_t Size ()
 Return the length of the result string.
-const std::string & Str ()
 Return the result.
-

Detailed Description

-Print to memory functionality. -

-The TiXmlPrinter is useful when you need to:

-

    -
  1. Print to memory (especially in non-STL mode)
  2. Control formatting (line endings, etc.)
-

-When constructed, the TiXmlPrinter is in its default "pretty printing" mode. Before calling Accept() you can call methods to control the printing of the XML document. After TiXmlNode::Accept() is called, the printed document can be accessed via the CStr(), Str(), and Size() methods.

-TiXmlPrinter uses the Visitor API.

	TiXmlPrinter printer;
-	printer.SetIndent( "\t" );
-
-	doc.Accept( &printer );
-	fprintf( stdout, "%s", printer.CStr() );
-	
-

-


Member Function Documentation

- -
-
- - - - - - - - - -
void TiXmlPrinter::SetIndent (const char *  _indent  )  [inline]
-
-
- -

-Set the indent characters for printing. -

-By default 4 spaces but tab () is also useful, or null/empty string for no indentation. -

-

- -

-
- - - - - - - - - -
void TiXmlPrinter::SetLineBreak (const char *  _lineBreak  )  [inline]
-
-
- -

-Set the line breaking string. -

-By default set to newline (
-). Some operating systems prefer other characters, or can be set to the null/empty string for no indenation. -

-

- -

-
- - - - - - - - -
void TiXmlPrinter::SetStreamPrinting (  )  [inline]
-
-
- -

-Switch over to "stream printing" which is the most dense formatting without linebreaks. -

-Common when the XML is needed for network transmission. -

-

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlPrinter.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlPrinter.png deleted file mode 100644 index 2088782698..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlPrinter.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlText-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlText-members.html deleted file mode 100644 index 93a3b98f91..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlText-members.html +++ /dev/null @@ -1,102 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlText Member List

This is the complete list of members for TiXmlText, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Accept(TiXmlVisitor *content) const TiXmlText [virtual]
CDATA() const TiXmlText [inline]
Clear()TiXmlNode
Clone() const TiXmlText [protected, virtual]
Column() const TiXmlBase [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out)TiXmlBase [static]
FirstChild() const TiXmlNode [inline]
FirstChild(const char *value) const TiXmlNode
FirstChild(const char *_value)TiXmlNode [inline]
FirstChild(const std::string &_value) const TiXmlNode [inline]
FirstChild(const std::string &_value)TiXmlNode [inline]
FirstChildElement() const TiXmlNode
FirstChildElement(const char *_value) const TiXmlNode
FirstChildElement(const std::string &_value) const TiXmlNode [inline]
FirstChildElement(const std::string &_value)TiXmlNode [inline]
GetDocument() const TiXmlNode
GetUserData()TiXmlBase [inline]
GetUserData() const TiXmlBase [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis)TiXmlNode
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis)TiXmlNode
InsertEndChild(const TiXmlNode &addThis)TiXmlNode
IsWhiteSpaceCondensed()TiXmlBase [inline, static]
IterateChildren(const TiXmlNode *previous) const TiXmlNode
IterateChildren(const char *value, const TiXmlNode *previous) const TiXmlNode
IterateChildren(const std::string &_value, const TiXmlNode *previous) const TiXmlNode [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous)TiXmlNode [inline]
LastChild()TiXmlNode [inline]
LastChild(const char *_value)TiXmlNode [inline]
LastChild(const std::string &_value) const TiXmlNode [inline]
LastChild(const std::string &_value)TiXmlNode [inline]
LinkEndChild(TiXmlNode *addThis)TiXmlNode
NextSibling(const std::string &_value) const TiXmlNode [inline]
NextSibling(const std::string &_value)TiXmlNode [inline]
NextSibling() const TiXmlNode [inline]
NextSibling(const char *) const TiXmlNode
NextSiblingElement() const TiXmlNode
NextSiblingElement(const char *) const TiXmlNode
NextSiblingElement(const std::string &_value) const TiXmlNode [inline]
NextSiblingElement(const std::string &_value)TiXmlNode [inline]
NoChildren() const TiXmlNode [inline]
NodeType enum nameTiXmlNode
operator<<(std::ostream &out, const TiXmlNode &base)TiXmlNode [friend]
operator<<(std::string &out, const TiXmlNode &base)TiXmlNode [friend]
operator>>(std::istream &in, TiXmlNode &base)TiXmlNode [friend]
Parent()TiXmlNode [inline]
PreviousSibling() const TiXmlNode [inline]
PreviousSibling(const char *) const TiXmlNode
PreviousSibling(const std::string &_value) const TiXmlNode [inline]
PreviousSibling(const std::string &_value)TiXmlNode [inline]
Print(FILE *cfile, int depth) const TiXmlText [virtual]
RemoveChild(TiXmlNode *removeThis)TiXmlNode
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis)TiXmlNode
Row() const TiXmlBase [inline]
SetCDATA(bool _cdata)TiXmlText [inline]
SetCondenseWhiteSpace(bool condense)TiXmlBase [inline, static]
SetUserData(void *user)TiXmlBase [inline]
SetValue(const char *_value)TiXmlNode [inline]
SetValue(const std::string &_value)TiXmlNode [inline]
TiXmlText(const char *initValue)TiXmlText [inline]
TiXmlText(const std::string &initValue)TiXmlText [inline]
ToComment() const TiXmlNode [inline, virtual]
ToComment()TiXmlNode [inline, virtual]
ToDeclaration() const TiXmlNode [inline, virtual]
ToDeclaration()TiXmlNode [inline, virtual]
ToDocument() const TiXmlNode [inline, virtual]
ToDocument()TiXmlNode [inline, virtual]
ToElement() const TiXmlNode [inline, virtual]
ToElement()TiXmlNode [inline, virtual]
ToText() const TiXmlText [inline, virtual]
ToText()TiXmlText [inline, virtual]
ToUnknown() const TiXmlNode [inline, virtual]
ToUnknown()TiXmlNode [inline, virtual]
Type() const TiXmlNode [inline]
userDataTiXmlBase [protected]
Value() const TiXmlNode [inline]
ValueStr() const TiXmlNode [inline]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlText.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlText.html deleted file mode 100644 index 0dadfa95c0..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlText.html +++ /dev/null @@ -1,145 +0,0 @@ - - -TinyXml: TiXmlText Class Reference - - - - - - -

TiXmlText Class Reference

XML text. -More... -

-#include <tinyxml.h> -

-

Inheritance diagram for TiXmlText: -

- -TiXmlNode -TiXmlBase - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

 TiXmlText (const char *initValue)
 Constructor for text element.
TiXmlText (const std::string &initValue)
 Constructor.
virtual void Print (FILE *cfile, int depth) const
 All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
-bool CDATA () const
 Queries whether this represents text using a CDATA section.
-void SetCDATA (bool _cdata)
 Turns on or off a CDATA representation of text.
-virtual const TiXmlTextToText () const
 Cast to a more defined type. Will return null not of the requested type.
-virtual TiXmlTextToText ()
 Cast to a more defined type. Will return null not of the requested type.
-virtual bool Accept (TiXmlVisitor *content) const
 Walk the XML tree visiting this node and all of its children.

Protected Member Functions

-virtual TiXmlNodeClone () const
 [internal use] Creates a new Element and returns it.

Friends

-class TiXmlElement
-

Detailed Description

-XML text. -

-A text node can have 2 ways to output the next. "normal" output and CDATA. It will default to the mode it was parsed from the XML file and you generally want to leave it alone, but you can change the output mode with SetCDATA() and query it with CDATA(). -

-


Constructor & Destructor Documentation

- -
-
- - - - - - - - - -
TiXmlText::TiXmlText (const char *  initValue  )  [inline]
-
-
- -

-Constructor for text element. -

-By default, it is treated as normal, encoded text. If you want it be output as a CDATA text element, set the parameter _cdata to 'true' -

-

-


Member Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - -
virtual void TiXmlText::Print (FILE *  cfile,
int  depth 
) const [virtual]
-
-
- -

-All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. -

-) Either or both cfile and str can be null.

-This is a formatted print, and will insert tabs and newlines.

-(For an unformatted stream, use the << operator.) -

-Implements TiXmlBase. -

-

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlText.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlText.png deleted file mode 100644 index c9e71d430f..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlText.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlUnknown-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlUnknown-members.html deleted file mode 100644 index 31e24973c6..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlUnknown-members.html +++ /dev/null @@ -1,98 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlUnknown Member List

This is the complete list of members for TiXmlUnknown, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Accept(TiXmlVisitor *content) const TiXmlUnknown [virtual]
Clear()TiXmlNode
Clone() const TiXmlUnknown [virtual]
Column() const TiXmlBase [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out)TiXmlBase [static]
FirstChild() const TiXmlNode [inline]
FirstChild(const char *value) const TiXmlNode
FirstChild(const char *_value)TiXmlNode [inline]
FirstChild(const std::string &_value) const TiXmlNode [inline]
FirstChild(const std::string &_value)TiXmlNode [inline]
FirstChildElement() const TiXmlNode
FirstChildElement(const char *_value) const TiXmlNode
FirstChildElement(const std::string &_value) const TiXmlNode [inline]
FirstChildElement(const std::string &_value)TiXmlNode [inline]
GetDocument() const TiXmlNode
GetUserData()TiXmlBase [inline]
GetUserData() const TiXmlBase [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis)TiXmlNode
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis)TiXmlNode
InsertEndChild(const TiXmlNode &addThis)TiXmlNode
IsWhiteSpaceCondensed()TiXmlBase [inline, static]
IterateChildren(const TiXmlNode *previous) const TiXmlNode
IterateChildren(const char *value, const TiXmlNode *previous) const TiXmlNode
IterateChildren(const std::string &_value, const TiXmlNode *previous) const TiXmlNode [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous)TiXmlNode [inline]
LastChild()TiXmlNode [inline]
LastChild(const char *_value)TiXmlNode [inline]
LastChild(const std::string &_value) const TiXmlNode [inline]
LastChild(const std::string &_value)TiXmlNode [inline]
LinkEndChild(TiXmlNode *addThis)TiXmlNode
NextSibling(const std::string &_value) const TiXmlNode [inline]
NextSibling(const std::string &_value)TiXmlNode [inline]
NextSibling() const TiXmlNode [inline]
NextSibling(const char *) const TiXmlNode
NextSiblingElement() const TiXmlNode
NextSiblingElement(const char *) const TiXmlNode
NextSiblingElement(const std::string &_value) const TiXmlNode [inline]
NextSiblingElement(const std::string &_value)TiXmlNode [inline]
NoChildren() const TiXmlNode [inline]
NodeType enum nameTiXmlNode
operator<<(std::ostream &out, const TiXmlNode &base)TiXmlNode [friend]
operator<<(std::string &out, const TiXmlNode &base)TiXmlNode [friend]
operator>>(std::istream &in, TiXmlNode &base)TiXmlNode [friend]
Parent()TiXmlNode [inline]
PreviousSibling() const TiXmlNode [inline]
PreviousSibling(const char *) const TiXmlNode
PreviousSibling(const std::string &_value) const TiXmlNode [inline]
PreviousSibling(const std::string &_value)TiXmlNode [inline]
Print(FILE *cfile, int depth) const TiXmlUnknown [virtual]
RemoveChild(TiXmlNode *removeThis)TiXmlNode
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis)TiXmlNode
Row() const TiXmlBase [inline]
SetCondenseWhiteSpace(bool condense)TiXmlBase [inline, static]
SetUserData(void *user)TiXmlBase [inline]
SetValue(const char *_value)TiXmlNode [inline]
SetValue(const std::string &_value)TiXmlNode [inline]
ToComment() const TiXmlNode [inline, virtual]
ToComment()TiXmlNode [inline, virtual]
ToDeclaration() const TiXmlNode [inline, virtual]
ToDeclaration()TiXmlNode [inline, virtual]
ToDocument() const TiXmlNode [inline, virtual]
ToDocument()TiXmlNode [inline, virtual]
ToElement() const TiXmlNode [inline, virtual]
ToElement()TiXmlNode [inline, virtual]
ToText() const TiXmlNode [inline, virtual]
ToText()TiXmlNode [inline, virtual]
ToUnknown() const TiXmlUnknown [inline, virtual]
ToUnknown()TiXmlUnknown [inline, virtual]
Type() const TiXmlNode [inline]
userDataTiXmlBase [protected]
Value() const TiXmlNode [inline]
ValueStr() const TiXmlNode [inline]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlUnknown.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlUnknown.html deleted file mode 100644 index b1fa218795..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlUnknown.html +++ /dev/null @@ -1,103 +0,0 @@ - - -TinyXml: TiXmlUnknown Class Reference - - - - - - -

TiXmlUnknown Class Reference

Any tag that tinyXml doesn't recognize is saved as an unknown. -More... -

-#include <tinyxml.h> -

-

Inheritance diagram for TiXmlUnknown: -

- -TiXmlNode -TiXmlBase - -List of all members. - - - - - - - - - - - - - - - - - -

Public Member Functions

-virtual TiXmlNodeClone () const
 Creates a copy of this Unknown and returns it.
virtual void Print (FILE *cfile, int depth) const
 All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
-virtual const TiXmlUnknownToUnknown () const
 Cast to a more defined type. Will return null not of the requested type.
-virtual TiXmlUnknownToUnknown ()
 Cast to a more defined type. Will return null not of the requested type.
-virtual bool Accept (TiXmlVisitor *content) const
 Walk the XML tree visiting this node and all of its children.
-

Detailed Description

-Any tag that tinyXml doesn't recognize is saved as an unknown. -

-It is a tag of text, but should not be modified. It will be written back to the XML, unchanged, when the file is saved.

-DTD tags get thrown into TiXmlUnknowns. -

-


Member Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - -
virtual void TiXmlUnknown::Print (FILE *  cfile,
int  depth 
) const [virtual]
-
-
- -

-All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. -

-) Either or both cfile and str can be null.

-This is a formatted print, and will insert tabs and newlines.

-(For an unformatted stream, use the << operator.) -

-Implements TiXmlBase. -

-

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlUnknown.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlUnknown.png deleted file mode 100644 index 338bfab71e..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlUnknown.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlVisitor-members.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlVisitor-members.html deleted file mode 100644 index f6cf17491c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlVisitor-members.html +++ /dev/null @@ -1,34 +0,0 @@ - - -TinyXml: Member List - - - - - - -

TiXmlVisitor Member List

This is the complete list of members for TiXmlVisitor, including all inherited members.

- - - - - - - - -
Visit(const TiXmlDeclaration &)TiXmlVisitor [inline, virtual]
Visit(const TiXmlText &)TiXmlVisitor [inline, virtual]
Visit(const TiXmlComment &)TiXmlVisitor [inline, virtual]
Visit(const TiXmlUnknown &)TiXmlVisitor [inline, virtual]
VisitEnter(const TiXmlDocument &)TiXmlVisitor [inline, virtual]
VisitEnter(const TiXmlElement &, const TiXmlAttribute *)TiXmlVisitor [inline, virtual]
VisitExit(const TiXmlDocument &)TiXmlVisitor [inline, virtual]
VisitExit(const TiXmlElement &)TiXmlVisitor [inline, virtual]


Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlVisitor.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlVisitor.html deleted file mode 100644 index 4698b85ad1..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlVisitor.html +++ /dev/null @@ -1,84 +0,0 @@ - - -TinyXml: TiXmlVisitor Class Reference - - - - - - -

TiXmlVisitor Class Reference

If you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks. -More... -

-#include <tinyxml.h> -

-

Inheritance diagram for TiXmlVisitor: -

- -TiXmlPrinter - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

-virtual bool VisitEnter (const TiXmlDocument &)
 Visit a document.
-virtual bool VisitExit (const TiXmlDocument &)
 Visit a document.
-virtual bool VisitEnter (const TiXmlElement &, const TiXmlAttribute *)
 Visit an element.
-virtual bool VisitExit (const TiXmlElement &)
 Visit an element.
-virtual bool Visit (const TiXmlDeclaration &)
 Visit a declaration.
-virtual bool Visit (const TiXmlText &)
 Visit a text node.
-virtual bool Visit (const TiXmlComment &)
 Visit a comment node.
-virtual bool Visit (const TiXmlUnknown &)
 Visit an unknow node.
-

Detailed Description

-If you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks. -

-For nodes that contain other nodes (Document, Element) you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves are simple called with Visit().

-If you return 'true' from a Visit method, recursive parsing will continue. If you return false, no children of this node or its sibilings will be Visited.

-All flavors of Visit methods have a default implementation that returns 'true' (continue visiting). You need to only override methods that are interesting to you.

-Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting.

-You should never change the document from a callback.

-

See also:
TiXmlNode::Accept()
- -

-


The documentation for this class was generated from the following file: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlVisitor.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlVisitor.png deleted file mode 100644 index 3e7daece43..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/classTiXmlVisitor.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/deprecated.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/deprecated.html deleted file mode 100644 index ccfb3f6998..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/deprecated.html +++ /dev/null @@ -1,38 +0,0 @@ - - -TinyXml: Deprecated List - - - - - -

Deprecated List

-
Member TiXmlHandle::Element () const
-
use ToElement. Return the handle as a TiXmlElement. This may return null.
-
-

-

-
Member TiXmlHandle::Node () const
-
use ToNode. Return the handle as a TiXmlNode. This may return null.
-
-

-

-
Member TiXmlHandle::Text () const
-
use ToText() Return the handle as a TiXmlText. This may return null.
-
-

-

-
Member TiXmlHandle::Unknown () const
-
use ToUnknown() Return the handle as a TiXmlUnknown. This may return null.
-
-
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/doxygen.css b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/doxygen.css deleted file mode 100644 index 5d583694ed..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/doxygen.css +++ /dev/null @@ -1,358 +0,0 @@ -BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { - font-family: Geneva, Arial, Helvetica, sans-serif; -} -BODY,TD { - font-size: 90%; -} -H1 { - text-align: center; - font-size: 160%; -} -H2 { - font-size: 120%; -} -H3 { - font-size: 100%; -} -CAPTION { font-weight: bold } -DIV.qindex { - width: 100%; - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - padding: 2px; - line-height: 140%; -} -DIV.nav { - width: 100%; - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - padding: 2px; - line-height: 140%; -} -DIV.navtab { - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} -TD.navtab { - font-size: 70%; -} -A.qindex { - text-decoration: none; - font-weight: bold; - color: #1A419D; -} -A.qindex:visited { - text-decoration: none; - font-weight: bold; - color: #1A419D -} -A.qindex:hover { - text-decoration: none; - background-color: #ddddff; -} -A.qindexHL { - text-decoration: none; - font-weight: bold; - background-color: #6666cc; - color: #ffffff; - border: 1px double #9295C2; -} -A.qindexHL:hover { - text-decoration: none; - background-color: #6666cc; - color: #ffffff; -} -A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } -A.el { text-decoration: none; font-weight: bold } -A.elRef { font-weight: bold } -A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} -A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} -A.codeRef:link { font-weight: normal; color: #0000FF} -A.codeRef:visited { font-weight: normal; color: #0000FF} -A:hover { text-decoration: none; background-color: #f2f2ff } -DL.el { margin-left: -1cm } -.fragment { - font-family: monospace, fixed; - font-size: 95%; -} -PRE.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - margin-top: 4px; - margin-bottom: 4px; - margin-left: 2px; - margin-right: 8px; - padding-left: 6px; - padding-right: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } - -DIV.groupHeader { - margin-left: 16px; - margin-top: 12px; - margin-bottom: 6px; - font-weight: bold; -} -DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } -BODY { - background: white; - color: black; - margin-right: 20px; - margin-left: 20px; -} -TD.indexkey { - background-color: #e8eef2; - font-weight: bold; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TD.indexvalue { - background-color: #e8eef2; - font-style: italic; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TR.memlist { - background-color: #f0f0f0; -} -P.formulaDsp { text-align: center; } -IMG.formulaDsp { } -IMG.formulaInl { vertical-align: middle; } -SPAN.keyword { color: #008000 } -SPAN.keywordtype { color: #604020 } -SPAN.keywordflow { color: #e08000 } -SPAN.comment { color: #800000 } -SPAN.preprocessor { color: #806020 } -SPAN.stringliteral { color: #002080 } -SPAN.charliteral { color: #008080 } -.mdescLeft { - padding: 0px 8px 4px 8px; - font-size: 80%; - font-style: italic; - background-color: #FAFAFA; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -.mdescRight { - padding: 0px 8px 4px 8px; - font-size: 80%; - font-style: italic; - background-color: #FAFAFA; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -.memItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memItemRight { - padding: 1px 8px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplItemRight { - padding: 1px 8px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplParams { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - color: #606060; - background-color: #FAFAFA; - font-size: 80%; -} -.search { color: #003399; - font-weight: bold; -} -FORM.search { - margin-bottom: 0px; - margin-top: 0px; -} -INPUT.search { font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #e8eef2; -} -TD.tiny { font-size: 75%; -} -a { - color: #1A41A8; -} -a:visited { - color: #2A3798; -} -.dirtab { padding: 4px; - border-collapse: collapse; - border: 1px solid #84b0c7; -} -TH.dirtab { background: #e8eef2; - font-weight: bold; -} -HR { height: 1px; - border: none; - border-top: 1px solid black; -} - -/* Style for detailed member documentation */ -.memtemplate { - font-size: 80%; - color: #606060; - font-weight: normal; -} -.memnav { - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} -.memitem { - padding: 4px; - background-color: #eef3f5; - border-width: 1px; - border-style: solid; - border-color: #dedeee; - -moz-border-radius: 8px 8px 8px 8px; -} -.memname { - white-space: nowrap; - font-weight: bold; -} -.memdoc{ - padding-left: 10px; -} -.memproto { - background-color: #d5e1e8; - width: 100%; - border-width: 1px; - border-style: solid; - border-color: #84b0c7; - font-weight: bold; - -moz-border-radius: 8px 8px 8px 8px; -} -.paramkey { - text-align: right; -} -.paramtype { - white-space: nowrap; -} -.paramname { - color: #602020; - font-style: italic; -} -/* End Styling for detailed member documentation */ - -/* for the tree view */ -.ftvtree { - font-family: sans-serif; - margin:0.5em; -} -.directory { font-size: 9pt; font-weight: bold; } -.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } -.directory > h3 { margin-top: 0; } -.directory p { margin: 0px; white-space: nowrap; } -.directory div { display: none; margin: 0px; } -.directory img { vertical-align: -30%; } - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/doxygen.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/doxygen.png deleted file mode 100644 index f0a274bbaf..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/doxygen.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/files.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/files.html deleted file mode 100644 index 23a447d201..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/files.html +++ /dev/null @@ -1,23 +0,0 @@ - - -TinyXml: File Index - - - - - -

TinyXml File List

Here is a list of all documented files with brief descriptions: - - -
tinystr.h [code]
tinyxml.h [code]
-
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions.html deleted file mode 100644 index e124322619..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions.html +++ /dev/null @@ -1,196 +0,0 @@ - - -TinyXml: Class Members - - - - - - - -
- -
- -

-Here is a list of all documented class members with links to the class documentation for each member: -

-

- a -

-

- c -

-

- d -

-

- e -

-

- f -

-

- g -

-

- i -

-

- l -

-

- n -

-

- o -

-

- p -

-

- q -

-

- r -

-

- s -

-

- t -

-

- u -

-

- v -

-
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_enum.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_enum.html deleted file mode 100644 index 563709ba78..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_enum.html +++ /dev/null @@ -1,39 +0,0 @@ - - -TinyXml: Class Members - Enumerations - - - - - - - -  -

-

-
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_func.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_func.html deleted file mode 100644 index 99bdfbd3c2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_func.html +++ /dev/null @@ -1,189 +0,0 @@ - - -TinyXml: Class Members - Functions - - - - - - - -
- -
- -

-  -

-

- a -

-

- c -

-

- d -

-

- e -

-

- f -

-

- g -

-

- i -

-

- l -

-

- n -

-

- p -

-

- q -

-

- r -

-

- s -

-

- t -

-

- u -

-

- v -

-
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_rela.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_rela.html deleted file mode 100644 index fddd433873..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_rela.html +++ /dev/null @@ -1,40 +0,0 @@ - - -TinyXml: Class Members - Related Functions - - - - - - - -  -

-

-
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_vars.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_vars.html deleted file mode 100644 index 52e814cb31..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/functions_vars.html +++ /dev/null @@ -1,39 +0,0 @@ - - -TinyXml: Class Members - Variables - - - - - - - -  -

-

-
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/hierarchy.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/hierarchy.html deleted file mode 100644 index 0eb50b46f9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/hierarchy.html +++ /dev/null @@ -1,45 +0,0 @@ - - -TinyXml: Hierarchical Index - - - - - - -

TinyXml Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/index.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/index.html deleted file mode 100644 index 01d51e784c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/index.html +++ /dev/null @@ -1,275 +0,0 @@ - - -TinyXml: Main Page - - - - - -

TinyXml Documentation

-

-

2.5.3

TinyXML

-

-TinyXML is a simple, small, C++ XML parser that can be easily integrated into other programs.

-

What it does.

-

-In brief, TinyXML parses an XML document, and builds from that a Document Object Model (DOM) that can be read, modified, and saved.

-XML stands for "eXtensible Markup Language." It allows you to create your own document markups. Where HTML does a very good job of marking documents for browsers, XML allows you to define any kind of document markup, for example a document that describes a "to do" list for an organizer application. XML is a very structured and convenient format. All those random file formats created to store application data can all be replaced with XML. One parser for everything.

-The best place for the complete, correct, and quite frankly hard to read spec is at http://www.w3.org/TR/2004/REC-xml-20040204/. An intro to XML (that I really like) can be found at http://skew.org/xml/tutorial.

-There are different ways to access and interact with XML data. TinyXML uses a Document Object Model (DOM), meaning the XML data is parsed into a C++ objects that can be browsed and manipulated, and then written to disk or another output stream. You can also construct an XML document from scratch with C++ objects and write this to disk or another output stream.

-TinyXML is designed to be easy and fast to learn. It is two headers and four cpp files. Simply add these to your project and off you go. There is an example file - xmltest.cpp - to get you started.

-TinyXML is released under the ZLib license, so you can use it in open source or commercial code. The details of the license are at the top of every source file.

-TinyXML attempts to be a flexible parser, but with truly correct and compliant XML output. TinyXML should compile on any reasonably C++ compliant system. It does not rely on exceptions or RTTI. It can be compiled with or without STL support. TinyXML fully supports the UTF-8 encoding, and the first 64k character entities.

-

What it doesn't do.

-

-TinyXML doesn't parse or use DTDs (Document Type Definitions) or XSLs (eXtensible Stylesheet Language.) There are other parsers out there (check out www.sourceforge.org, search for XML) that are much more fully featured. But they are also much bigger, take longer to set up in your project, have a higher learning curve, and often have a more restrictive license. If you are working with browsers or have more complete XML needs, TinyXML is not the parser for you.

-The following DTD syntax will not parse at this time in TinyXML:

-

	<!DOCTYPE Archiv [
-	 <!ELEMENT Comment (#PCDATA)>
-	]>
-

-because TinyXML sees this as a !DOCTYPE node with an illegally embedded !ELEMENT node. This may be addressed in the future.

-

Tutorials.

-

-For the impatient, here is a tutorial to get you going. A great way to get started, but it is worth your time to read this (very short) manual completely.

-

-

-

Code Status.

-

-TinyXML is mature, tested code. It is very stable. If you find bugs, please file a bug report on the sourceforge web site (www.sourceforge.net/projects/tinyxml). We'll get them straightened out as soon as possible.

-There are some areas of improvement; please check sourceforge if you are interested in working on TinyXML.

-

Related Projects

-

-TinyXML projects you may find useful! (Descriptions provided by the projects.)

-

-

-

Features

-

-

Using STL

-

-TinyXML can be compiled to use or not use STL. When using STL, TinyXML uses the std::string class, and fully supports std::istream, std::ostream, operator<<, and operator>>. Many API methods have both 'const char*' and 'const std::string&' forms.

-When STL support is compiled out, no STL files are included whatsoever. All the string classes are implemented by TinyXML itself. API methods all use the 'const char*' form for input.

-Use the compile time define:

-TIXML_USE_STL

-to compile one version or the other. This can be passed by the compiler, or set as the first line of "tinyxml.h".

-Note: If compiling the test code in Linux, setting the environment variable TINYXML_USE_STL=YES/NO will control STL compilation. In the Windows project file, STL and non STL targets are provided. In your project, It's probably easiest to add the line "#define TIXML_USE_STL" as the first line of tinyxml.h.

-

UTF-8

-

-TinyXML supports UTF-8 allowing to manipulate XML files in any language. TinyXML also supports "legacy mode" - the encoding used before UTF-8 support and probably best described as "extended ascii".

-Normally, TinyXML will try to detect the correct encoding and use it. However, by setting the value of TIXML_DEFAULT_ENCODING in the header file, TinyXML can be forced to always use one encoding.

-TinyXML will assume Legacy Mode until one of the following occurs:

    -
  1. -If the non-standard but common "UTF-8 lead bytes" (0xef 0xbb 0xbf) begin the file or data stream, TinyXML will read it as UTF-8.
  2. -
  3. -If the declaration tag is read, and it has an encoding="UTF-8", then TinyXML will read it as UTF-8.
  4. -
  5. -If the declaration tag is read, and it has no encoding specified, then TinyXML will read it as UTF-8.
  6. -
  7. -If the declaration tag is read, and it has an encoding="something else", then TinyXML will read it as Legacy Mode. In legacy mode, TinyXML will work as it did before. It's not clear what that mode does exactly, but old content should keep working.
  8. -
  9. -Until one of the above criteria is met, TinyXML runs in Legacy Mode.
  10. -
-

-What happens if the encoding is incorrectly set or detected? TinyXML will try to read and pass through text seen as improperly encoded. You may get some strange results or mangled characters. You may want to force TinyXML to the correct mode.

-You may force TinyXML to Legacy Mode by using LoadFile( TIXML_ENCODING_LEGACY ) or LoadFile( filename, TIXML_ENCODING_LEGACY ). You may force it to use legacy mode all the time by setting TIXML_DEFAULT_ENCODING = TIXML_ENCODING_LEGACY. Likewise, you may force it to TIXML_ENCODING_UTF8 with the same technique.

-For English users, using English XML, UTF-8 is the same as low-ASCII. You don't need to be aware of UTF-8 or change your code in any way. You can think of UTF-8 as a "superset" of ASCII.

-UTF-8 is not a double byte format - but it is a standard encoding of Unicode! TinyXML does not use or directly support wchar, TCHAR, or Microsoft's _UNICODE at this time. It is common to see the term "Unicode" improperly refer to UTF-16, a wide byte encoding of unicode. This is a source of confusion.

-For "high-ascii" languages - everything not English, pretty much - TinyXML can handle all languages, at the same time, as long as the XML is encoded in UTF-8. That can be a little tricky, older programs and operating systems tend to use the "default" or "traditional" code page. Many apps (and almost all modern ones) can output UTF-8, but older or stubborn (or just broken) ones still output text in the default code page.

-For example, Japanese systems traditionally use SHIFT-JIS encoding. Text encoded as SHIFT-JIS can not be read by TinyXML. A good text editor can import SHIFT-JIS and then save as UTF-8.

-The Skew.org link does a great job covering the encoding issue.

-The test file "utf8test.xml" is an XML containing English, Spanish, Russian, and Simplified Chinese. (Hopefully they are translated correctly). The file "utf8test.gif" is a screen capture of the XML file, rendered in IE. Note that if you don't have the correct fonts (Simplified Chinese or Russian) on your system, you won't see output that matches the GIF file even if you can parse it correctly. Also note that (at least on my Windows machine) console output is in a Western code page, so that Print() or printf() cannot correctly display the file. This is not a bug in TinyXML - just an OS issue. No data is lost or destroyed by TinyXML. The console just doesn't render UTF-8.

-

Entities

-

-TinyXML recognizes the pre-defined "character entities", meaning special characters. Namely:

-

	&amp;	&
-	&lt;	<
-	&gt;	>
-	&quot;	"
-	&apos;	'
-

-These are recognized when the XML document is read, and translated to there UTF-8 equivalents. For instance, text with the XML of:

-

	Far &amp; Away
-

-will have the Value() of "Far & Away" when queried from the TiXmlText object, and will be written back to the XML stream/file as an ampersand. Older versions of TinyXML "preserved" character entities, but the newer versions will translate them into characters.

-Additionally, any character can be specified by its Unicode code point: The syntax "&#xA0;" or "&#160;" are both to the non-breaking space characher.

-

Printing

-

-TinyXML can print output in several different ways that all have strengths and limitations.

-

    -
  • Print( FILE* ). Output to a std-C stream, which includes all C files as well as stdout.
      -
    • "Pretty prints", but you don't have control over printing options.
    • The output is streamed directly to the FILE object, so there is no memory overhead in the TinyXML code.
    • used by Print() and SaveFile()
    -
-

-

    -
  • operator<<. Output to a c++ stream.
      -
    • Integrates with standart C++ iostreams.
    • Outputs in "network printing" mode without line breaks. Good for network transmission and moving XML between C++ objects, but hard for a human to read.
    -
-

-

    -
  • TiXmlPrinter. Output to a std::string or memory buffer.
      -
    • API is less concise
    • Future printing options will be put here.
    • Printing may change slightly in future versions as it is refined and expanded.
    -
-

-

Streams

-

-With TIXML_USE_STL on TinyXML supports C++ streams (operator <<,>>) streams as well as C (FILE*) streams. There are some differences that you may need to be aware of.

-C style output:

    -
  • based on FILE*
  • the Print() and SaveFile() methods
-

-Generates formatted output, with plenty of white space, intended to be as human-readable as possible. They are very fast, and tolerant of ill formed XML documents. For example, an XML document that contains 2 root elements and 2 declarations, will still print.

-C style input:

    -
  • based on FILE*
  • the Parse() and LoadFile() methods
-

-A fast, tolerant read. Use whenever you don't need the C++ streams.

-C++ style output:

    -
  • based on std::ostream
  • operator<<
-

-Generates condensed output, intended for network transmission rather than readability. Depending on your system's implementation of the ostream class, these may be somewhat slower. (Or may not.) Not tolerant of ill formed XML: a document should contain the correct one root element. Additional root level elements will not be streamed out.

-C++ style input:

    -
  • based on std::istream
  • operator>>
-

-Reads XML from a stream, making it useful for network transmission. The tricky part is knowing when the XML document is complete, since there will almost certainly be other data in the stream. TinyXML will assume the XML data is complete after it reads the root element. Put another way, documents that are ill-constructed with more than one root element will not read correctly. Also note that operator>> is somewhat slower than Parse, due to both implementation of the STL and limitations of TinyXML.

-

White space

-

-The world simply does not agree on whether white space should be kept, or condensed. For example, pretend the '_' is a space, and look at "Hello____world". HTML, and at least some XML parsers, will interpret this as "Hello_world". They condense white space. Some XML parsers do not, and will leave it as "Hello____world". (Remember to keep pretending the _ is a space.) Others suggest that __Hello___world__ should become Hello___world.

-It's an issue that hasn't been resolved to my satisfaction. TinyXML supports the first 2 approaches. Call TiXmlBase::SetCondenseWhiteSpace( bool ) to set the desired behavior. The default is to condense white space.

-If you change the default, you should call TiXmlBase::SetCondenseWhiteSpace( bool ) before making any calls to Parse XML data, and I don't recommend changing it after it has been set.

-

Handles

-

-Where browsing an XML document in a robust way, it is important to check for null returns from method calls. An error safe implementation can generate a lot of code like:

-

TiXmlElement* root = document.FirstChildElement( "Document" );
-if ( root )
-{
-	TiXmlElement* element = root->FirstChildElement( "Element" );
-	if ( element )
-	{
-		TiXmlElement* child = element->FirstChildElement( "Child" );
-		if ( child )
-		{
-			TiXmlElement* child2 = child->NextSiblingElement( "Child" );
-			if ( child2 )
-			{
-				// Finally do something useful.
-

-Handles have been introduced to clean this up. Using the TiXmlHandle class, the previous code reduces to:

-

TiXmlHandle docHandle( &document );
-TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement();
-if ( child2 )
-{
-	// do something useful
-

-Which is much easier to deal with. See TiXmlHandle for more information.

-

Row and Column tracking

-

-Being able to track nodes and attributes back to their origin location in source files can be very important for some applications. Additionally, knowing where parsing errors occured in the original source can be very time saving.

-TinyXML can tracks the row and column origin of all nodes and attributes in a text file. The TiXmlBase::Row() and TiXmlBase::Column() methods return the origin of the node in the source text. The correct tabs can be configured in TiXmlDocument::SetTabSize().

-

Using and Installing

-

-To Compile and Run xmltest:

-A Linux Makefile and a Windows Visual C++ .dsw file is provided. Simply compile and run. It will write the file demotest.xml to your disk and generate output on the screen. It also tests walking the DOM by printing out the number of nodes found using different techniques.

-The Linux makefile is very generic and runs on many systems - it is currently tested on mingw and MacOSX. You do not need to run 'make depend'. The dependecies have been hard coded.

-

Windows project file for VC6

-

-

    -
  • -tinyxml: tinyxml library, non-STL
  • -
  • -tinyxmlSTL: tinyxml library, STL
  • -
  • -tinyXmlTest: test app, non-STL
  • -
  • -tinyXmlTestSTL: test app, STL
  • -
-

-

Makefile

-

-At the top of the makefile you can set:

-PROFILE, DEBUG, and TINYXML_USE_STL. Details (such that they are) are in the makefile.

-In the tinyxml directory, type "make clean" then "make". The executable file 'xmltest' will be created.

-

To Use in an Application:

-

-Add tinyxml.cpp, tinyxml.h, tinyxmlerror.cpp, tinyxmlparser.cpp, tinystr.cpp, and tinystr.h to your project or make file. That's it! It should compile on any reasonably compliant C++ system. You do not need to enable exceptions or RTTI for TinyXML.

-

How TinyXML works.

-

-An example is probably the best way to go. Take:

	<?xml version="1.0" standalone=no>
-	<!-- Our to do list data -->
-	<ToDo>
-		<Item priority="1"> Go to the <bold>Toy store!</bold></Item>
-		<Item priority="2"> Do bills</Item>
-	</ToDo>
-

-Its not much of a To Do list, but it will do. To read this file (say "demo.xml") you would create a document, and parse it in:

	TiXmlDocument doc( "demo.xml" );
-	doc.LoadFile();
-

-And its ready to go. Now lets look at some lines and how they relate to the DOM.

-

<?xml version="1.0" standalone=no>
-

-The first line is a declaration, and gets turned into the TiXmlDeclaration class. It will be the first child of the document node.

-This is the only directive/special tag parsed by by TinyXML. Generally directive tags are stored in TiXmlUnknown so the commands wont be lost when it is saved back to disk.

-

<!-- Our to do list data -->
-

-A comment. Will become a TiXmlComment object.

-

<ToDo>
-

-The "ToDo" tag defines a TiXmlElement object. This one does not have any attributes, but does contain 2 other elements.

-

<Item priority="1"> 
-

-Creates another TiXmlElement which is a child of the "ToDo" element. This element has 1 attribute, with the name "priority" and the value "1".

-

Go to the
-

-A TiXmlText. This is a leaf node and cannot contain other nodes. It is a child of the "Item" TiXmlElement.

-

<bold>
-

-Another TiXmlElement, this one a child of the "Item" element.

-Etc.

-Looking at the entire object tree, you end up with:

TiXmlDocument					"demo.xml"
-	TiXmlDeclaration			"version='1.0'" "standalone=no"
-	TiXmlComment				" Our to do list data"
-	TiXmlElement				"ToDo"
-		TiXmlElement			"Item" Attribtutes: priority = 1
-			TiXmlText			"Go to the "
-			TiXmlElement		"bold"
-				TiXmlText		"Toy store!"
-		TiXmlElement			"Item" Attributes: priority=2
-			TiXmlText			"Do bills"
-

-

Documentation

-

-The documentation is build with Doxygen, using the 'dox' configuration file.

-

License

-

-TinyXML is released under the zlib license:

-This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-

References

-

-The World Wide Web Consortium is the definitive standard body for XML, and there web pages contain huge amounts of information.

-The definitive spec: http://www.w3.org/TR/2004/REC-xml-20040204/

-I also recommend "XML Pocket Reference" by Robert Eckstein and published by OReilly...the book that got the whole thing started.

-

Contributors, Contacts, and a Brief History

-

-Thanks very much to everyone who sends suggestions, bugs, ideas, and encouragement. It all helps, and makes this project fun. A special thanks to the contributors on the web pages that keep it lively.

-So many people have sent in bugs and ideas, that rather than list here we try to give credit due in the "changes.txt" file.

-TinyXML was originally written by Lee Thomason. (Often the "I" still in the documentation.) Lee reviews changes and releases new versions, with the help of Yves Berquin, Andrew Ellerton, and the tinyXml community.

-We appreciate your suggestions, and would love to know if you use TinyXML. Hopefully you will enjoy it and find it useful. Please post questions, comments, file bugs, or contact us at:

-www.sourceforge.net/projects/tinyxml

-Lee Thomason, Yves Berquin, Andrew Ellerton


Generated on Sun May 6 15:41:22 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/pages.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/pages.html deleted file mode 100644 index b23a328b53..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/pages.html +++ /dev/null @@ -1,23 +0,0 @@ - - -TinyXml: Page Index - - - - - -

TinyXml Related Pages

Here is a list of all related documentation pages: -
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tab_b.gif b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tab_b.gif deleted file mode 100644 index 0d623483ff..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tab_b.gif and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tab_l.gif b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tab_l.gif deleted file mode 100644 index 9b1e6337c9..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tab_l.gif and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tab_r.gif b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tab_r.gif deleted file mode 100644 index ce9dd9f533..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tab_r.gif and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tabs.css b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tabs.css deleted file mode 100644 index a61552a67a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tabs.css +++ /dev/null @@ -1,102 +0,0 @@ -/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ - -DIV.tabs -{ - float : left; - width : 100%; - background : url("tab_b.gif") repeat-x bottom; - margin-bottom : 4px; -} - -DIV.tabs UL -{ - margin : 0px; - padding-left : 10px; - list-style : none; -} - -DIV.tabs LI, DIV.tabs FORM -{ - display : inline; - margin : 0px; - padding : 0px; -} - -DIV.tabs FORM -{ - float : right; -} - -DIV.tabs A -{ - float : left; - background : url("tab_r.gif") no-repeat right top; - border-bottom : 1px solid #84B0C7; - font-size : x-small; - font-weight : bold; - text-decoration : none; -} - -DIV.tabs A:hover -{ - background-position: 100% -150px; -} - -DIV.tabs A:link, DIV.tabs A:visited, -DIV.tabs A:active, DIV.tabs A:hover -{ - color: #1A419D; -} - -DIV.tabs SPAN -{ - float : left; - display : block; - background : url("tab_l.gif") no-repeat left top; - padding : 5px 9px; - white-space : nowrap; -} - -DIV.tabs INPUT -{ - float : right; - display : inline; - font-size : 1em; -} - -DIV.tabs TD -{ - font-size : x-small; - font-weight : bold; - text-decoration : none; -} - - - -/* Commented Backslash Hack hides rule from IE5-Mac \*/ -DIV.tabs SPAN {float : none;} -/* End IE5-Mac hack */ - -DIV.tabs A:hover SPAN -{ - background-position: 0% -150px; -} - -DIV.tabs LI#current A -{ - background-position: 100% -150px; - border-width : 0px; -} - -DIV.tabs LI#current SPAN -{ - background-position: 0% -150px; - padding-bottom : 6px; -} - -DIV.nav -{ - background : none; - border : none; - border-bottom : 1px solid #84B0C7; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tinystr_8h-source.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tinystr_8h-source.html deleted file mode 100644 index 71408eed9a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tinystr_8h-source.html +++ /dev/null @@ -1,338 +0,0 @@ - - -TinyXml: tinystr.h Source File - - - - - -

tinystr.h

00001 /*
-00002 www.sourceforge.net/projects/tinyxml
-00003 Original file by Yves Berquin.
-00004 
-00005 This software is provided 'as-is', without any express or implied
-00006 warranty. In no event will the authors be held liable for any
-00007 damages arising from the use of this software.
-00008 
-00009 Permission is granted to anyone to use this software for any
-00010 purpose, including commercial applications, and to alter it and
-00011 redistribute it freely, subject to the following restrictions:
-00012 
-00013 1. The origin of this software must not be misrepresented; you must
-00014 not claim that you wrote the original software. If you use this
-00015 software in a product, an acknowledgment in the product documentation
-00016 would be appreciated but is not required.
-00017 
-00018 2. Altered source versions must be plainly marked as such, and
-00019 must not be misrepresented as being the original software.
-00020 
-00021 3. This notice may not be removed or altered from any source
-00022 distribution.
-00023 */
-00024 
-00025 /*
-00026  * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005.
-00027  *
-00028  * - completely rewritten. compact, clean, and fast implementation.
-00029  * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems)
-00030  * - fixed reserve() to work as per specification.
-00031  * - fixed buggy compares operator==(), operator<(), and operator>()
-00032  * - fixed operator+=() to take a const ref argument, following spec.
-00033  * - added "copy" constructor with length, and most compare operators.
-00034  * - added swap(), clear(), size(), capacity(), operator+().
-00035  */
-00036 
-00037 #ifndef TIXML_USE_STL
-00038 
-00039 #ifndef TIXML_STRING_INCLUDED
-00040 #define TIXML_STRING_INCLUDED
-00041 
-00042 #include <assert.h>
-00043 #include <string.h>
-00044 
-00045 /*  The support for explicit isn't that universal, and it isn't really
-00046     required - it is used to check that the TiXmlString class isn't incorrectly
-00047     used. Be nice to old compilers and macro it here:
-00048 */
-00049 #if defined(_MSC_VER) && (_MSC_VER >= 1200 )
-00050     // Microsoft visual studio, version 6 and higher.
-00051     #define TIXML_EXPLICIT explicit
-00052 #elif defined(__GNUC__) && (__GNUC__ >= 3 )
-00053     // GCC version 3 and higher.s
-00054     #define TIXML_EXPLICIT explicit
-00055 #else
-00056     #define TIXML_EXPLICIT
-00057 #endif
-00058 
-00059 
-00060 /*
-00061    TiXmlString is an emulation of a subset of the std::string template.
-00062    Its purpose is to allow compiling TinyXML on compilers with no or poor STL support.
-00063    Only the member functions relevant to the TinyXML project have been implemented.
-00064    The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase
-00065    a string and there's no more room, we allocate a buffer twice as big as we need.
-00066 */
-00067 class TiXmlString
-00068 {
-00069   public :
-00070     // The size type used
-00071     typedef size_t size_type;
-00072 
-00073     // Error value for find primitive
-00074     static const size_type npos; // = -1;
-00075 
-00076 
-00077     // TiXmlString empty constructor
-00078     TiXmlString () : rep_(&nullrep_)
-00079     {
-00080     }
-00081 
-00082     // TiXmlString copy constructor
-00083     TiXmlString ( const TiXmlString & copy) : rep_(0)
-00084     {
-00085         init(copy.length());
-00086         memcpy(start(), copy.data(), length());
-00087     }
-00088 
-00089     // TiXmlString constructor, based on a string
-00090     TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0)
-00091     {
-00092         init( static_cast<size_type>( strlen(copy) ));
-00093         memcpy(start(), copy, length());
-00094     }
-00095 
-00096     // TiXmlString constructor, based on a string
-00097     TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0)
-00098     {
-00099         init(len);
-00100         memcpy(start(), str, len);
-00101     }
-00102 
-00103     // TiXmlString destructor
-00104     ~TiXmlString ()
-00105     {
-00106         quit();
-00107     }
-00108 
-00109     // = operator
-00110     TiXmlString& operator = (const char * copy)
-00111     {
-00112         return assign( copy, (size_type)strlen(copy));
-00113     }
-00114 
-00115     // = operator
-00116     TiXmlString& operator = (const TiXmlString & copy)
-00117     {
-00118         return assign(copy.start(), copy.length());
-00119     }
-00120 
-00121 
-00122     // += operator. Maps to append
-00123     TiXmlString& operator += (const char * suffix)
-00124     {
-00125         return append(suffix, static_cast<size_type>( strlen(suffix) ));
-00126     }
-00127 
-00128     // += operator. Maps to append
-00129     TiXmlString& operator += (char single)
-00130     {
-00131         return append(&single, 1);
-00132     }
-00133 
-00134     // += operator. Maps to append
-00135     TiXmlString& operator += (const TiXmlString & suffix)
-00136     {
-00137         return append(suffix.data(), suffix.length());
-00138     }
-00139 
-00140 
-00141     // Convert a TiXmlString into a null-terminated char *
-00142     const char * c_str () const { return rep_->str; }
-00143 
-00144     // Convert a TiXmlString into a char * (need not be null terminated).
-00145     const char * data () const { return rep_->str; }
-00146 
-00147     // Return the length of a TiXmlString
-00148     size_type length () const { return rep_->size; }
-00149 
-00150     // Alias for length()
-00151     size_type size () const { return rep_->size; }
-00152 
-00153     // Checks if a TiXmlString is empty
-00154     bool empty () const { return rep_->size == 0; }
-00155 
-00156     // Return capacity of string
-00157     size_type capacity () const { return rep_->capacity; }
-00158 
-00159 
-00160     // single char extraction
-00161     const char& at (size_type index) const
-00162     {
-00163         assert( index < length() );
-00164         return rep_->str[ index ];
-00165     }
-00166 
-00167     // [] operator
-00168     char& operator [] (size_type index) const
-00169     {
-00170         assert( index < length() );
-00171         return rep_->str[ index ];
-00172     }
-00173 
-00174     // find a char in a string. Return TiXmlString::npos if not found
-00175     size_type find (char lookup) const
-00176     {
-00177         return find(lookup, 0);
-00178     }
-00179 
-00180     // find a char in a string from an offset. Return TiXmlString::npos if not found
-00181     size_type find (char tofind, size_type offset) const
-00182     {
-00183         if (offset >= length()) return npos;
-00184 
-00185         for (const char* p = c_str() + offset; *p != '\0'; ++p)
-00186         {
-00187            if (*p == tofind) return static_cast< size_type >( p - c_str() );
-00188         }
-00189         return npos;
-00190     }
-00191 
-00192     void clear ()
-00193     {
-00194         //Lee:
-00195         //The original was just too strange, though correct:
-00196         //  TiXmlString().swap(*this);
-00197         //Instead use the quit & re-init:
-00198         quit();
-00199         init(0,0);
-00200     }
-00201 
-00202     /*  Function to reserve a big amount of data when we know we'll need it. Be aware that this
-00203         function DOES NOT clear the content of the TiXmlString if any exists.
-00204     */
-00205     void reserve (size_type cap);
-00206 
-00207     TiXmlString& assign (const char* str, size_type len);
-00208 
-00209     TiXmlString& append (const char* str, size_type len);
-00210 
-00211     void swap (TiXmlString& other)
-00212     {
-00213         Rep* r = rep_;
-00214         rep_ = other.rep_;
-00215         other.rep_ = r;
-00216     }
-00217 
-00218   private:
-00219 
-00220     void init(size_type sz) { init(sz, sz); }
-00221     void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; }
-00222     char* start() const { return rep_->str; }
-00223     char* finish() const { return rep_->str + rep_->size; }
-00224 
-00225     struct Rep
-00226     {
-00227         size_type size, capacity;
-00228         char str[1];
-00229     };
-00230 
-00231     void init(size_type sz, size_type cap)
-00232     {
-00233         if (cap)
-00234         {
-00235             // Lee: the original form:
-00236             //  rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap));
-00237             // doesn't work in some cases of new being overloaded. Switching
-00238             // to the normal allocation, although use an 'int' for systems
-00239             // that are overly picky about structure alignment.
-00240             const size_type bytesNeeded = sizeof(Rep) + cap;
-00241             const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int ); 
-00242             rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] );
-00243 
-00244             rep_->str[ rep_->size = sz ] = '\0';
-00245             rep_->capacity = cap;
-00246         }
-00247         else
-00248         {
-00249             rep_ = &nullrep_;
-00250         }
-00251     }
-00252 
-00253     void quit()
-00254     {
-00255         if (rep_ != &nullrep_)
-00256         {
-00257             // The rep_ is really an array of ints. (see the allocator, above).
-00258             // Cast it back before delete, so the compiler won't incorrectly call destructors.
-00259             delete [] ( reinterpret_cast<int*>( rep_ ) );
-00260         }
-00261     }
-00262 
-00263     Rep * rep_;
-00264     static Rep nullrep_;
-00265 
-00266 } ;
-00267 
-00268 
-00269 inline bool operator == (const TiXmlString & a, const TiXmlString & b)
-00270 {
-00271     return    ( a.length() == b.length() )              // optimization on some platforms
-00272            && ( strcmp(a.c_str(), b.c_str()) == 0 );    // actual compare
-00273 }
-00274 inline bool operator < (const TiXmlString & a, const TiXmlString & b)
-00275 {
-00276     return strcmp(a.c_str(), b.c_str()) < 0;
-00277 }
-00278 
-00279 inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); }
-00280 inline bool operator >  (const TiXmlString & a, const TiXmlString & b) { return b < a; }
-00281 inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); }
-00282 inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); }
-00283 
-00284 inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; }
-00285 inline bool operator == (const char* a, const TiXmlString & b) { return b == a; }
-00286 inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); }
-00287 inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); }
-00288 
-00289 TiXmlString operator + (const TiXmlString & a, const TiXmlString & b);
-00290 TiXmlString operator + (const TiXmlString & a, const char* b);
-00291 TiXmlString operator + (const char* a, const TiXmlString & b);
-00292 
-00293 
-00294 /*
-00295    TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString.
-00296    Only the operators that we need for TinyXML have been developped.
-00297 */
-00298 class TiXmlOutStream : public TiXmlString
-00299 {
-00300 public :
-00301 
-00302     // TiXmlOutStream << operator.
-00303     TiXmlOutStream & operator << (const TiXmlString & in)
-00304     {
-00305         *this += in;
-00306         return *this;
-00307     }
-00308 
-00309     // TiXmlOutStream << operator.
-00310     TiXmlOutStream & operator << (const char * in)
-00311     {
-00312         *this += in;
-00313         return *this;
-00314     }
-00315 
-00316 } ;
-00317 
-00318 #endif  // TIXML_STRING_INCLUDED
-00319 #endif  // TIXML_USE_STL
-

Generated on Sun May 6 15:41:22 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tinyxml_8h-source.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tinyxml_8h-source.html deleted file mode 100644 index 135da9ce64..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tinyxml_8h-source.html +++ /dev/null @@ -1,1201 +0,0 @@ - - -TinyXml: tinyxml.h Source File - - - - - -

tinyxml.h

00001 /*
-00002 www.sourceforge.net/projects/tinyxml
-00003 Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
-00004 
-00005 This software is provided 'as-is', without any express or implied
-00006 warranty. In no event will the authors be held liable for any
-00007 damages arising from the use of this software.
-00008 
-00009 Permission is granted to anyone to use this software for any
-00010 purpose, including commercial applications, and to alter it and
-00011 redistribute it freely, subject to the following restrictions:
-00012 
-00013 1. The origin of this software must not be misrepresented; you must
-00014 not claim that you wrote the original software. If you use this
-00015 software in a product, an acknowledgment in the product documentation
-00016 would be appreciated but is not required.
-00017 
-00018 2. Altered source versions must be plainly marked as such, and
-00019 must not be misrepresented as being the original software.
-00020 
-00021 3. This notice may not be removed or altered from any source
-00022 distribution.
-00023 */
-00024 
-00025 
-00026 #ifndef TINYXML_INCLUDED
-00027 #define TINYXML_INCLUDED
-00028 
-00029 #ifdef _MSC_VER
-00030 #pragma warning( push )
-00031 #pragma warning( disable : 4530 )
-00032 #pragma warning( disable : 4786 )
-00033 #endif
-00034 
-00035 #include <ctype.h>
-00036 #include <stdio.h>
-00037 #include <stdlib.h>
-00038 #include <string.h>
-00039 #include <assert.h>
-00040 
-00041 // Help out windows:
-00042 #if defined( _DEBUG ) && !defined( DEBUG )
-00043 #define DEBUG
-00044 #endif
-00045 
-00046 #ifdef TIXML_USE_STL
-00047     #include <string>
-00048     #include <iostream>
-00049     #include <sstream>
-00050     #define TIXML_STRING        std::string
-00051 #else
-00052     #include "tinystr.h"
-00053     #define TIXML_STRING        TiXmlString
-00054 #endif
-00055 
-00056 // Deprecated library function hell. Compilers want to use the
-00057 // new safe versions. This probably doesn't fully address the problem,
-00058 // but it gets closer. There are too many compilers for me to fully
-00059 // test. If you get compilation troubles, undefine TIXML_SAFE
-00060 #define TIXML_SAFE
-00061 
-00062 #ifdef TIXML_SAFE
-00063     #if defined(_MSC_VER) && (_MSC_VER >= 1400 )
-00064         // Microsoft visual studio, version 2005 and higher.
-00065         #define TIXML_SNPRINTF _snprintf_s
-00066         #define TIXML_SNSCANF  _snscanf_s
-00067         #define TIXML_SSCANF   sscanf_s
-00068     #elif defined(_MSC_VER) && (_MSC_VER >= 1200 )
-00069         // Microsoft visual studio, version 6 and higher.
-00070         //#pragma message( "Using _sn* functions." )
-00071         #define TIXML_SNPRINTF _snprintf
-00072         #define TIXML_SNSCANF  _snscanf
-00073         #define TIXML_SSCANF   sscanf
-00074     #elif defined(__GNUC__) && (__GNUC__ >= 3 )
-00075         // GCC version 3 and higher.s
-00076         //#warning( "Using sn* functions." )
-00077         #define TIXML_SNPRINTF snprintf
-00078         #define TIXML_SNSCANF  snscanf
-00079         #define TIXML_SSCANF   sscanf
-00080     #else
-00081         #define TIXML_SSCANF   sscanf
-00082     #endif
-00083 #endif  
-00084 
-00085 class TiXmlDocument;
-00086 class TiXmlElement;
-00087 class TiXmlComment;
-00088 class TiXmlUnknown;
-00089 class TiXmlAttribute;
-00090 class TiXmlText;
-00091 class TiXmlDeclaration;
-00092 class TiXmlParsingData;
-00093 
-00094 const int TIXML_MAJOR_VERSION = 2;
-00095 const int TIXML_MINOR_VERSION = 5;
-00096 const int TIXML_PATCH_VERSION = 3;
-00097 
-00098 /*  Internal structure for tracking location of items 
-00099     in the XML file.
-00100 */
-00101 struct TiXmlCursor
-00102 {
-00103     TiXmlCursor()       { Clear(); }
-00104     void Clear()        { row = col = -1; }
-00105 
-00106     int row;    // 0 based.
-00107     int col;    // 0 based.
-00108 };
-00109 
-00110 
-00129 class TiXmlVisitor
-00130 {
-00131 public:
-00132     virtual ~TiXmlVisitor() {}
-00133 
-00135     virtual bool VisitEnter( const TiXmlDocument& /*doc*/ )         { return true; }
-00137     virtual bool VisitExit( const TiXmlDocument& /*doc*/ )          { return true; }
-00138 
-00140     virtual bool VisitEnter( const TiXmlElement& /*element*/, const TiXmlAttribute* /*firstAttribute*/ )    { return true; }
-00142     virtual bool VisitExit( const TiXmlElement& /*element*/ )       { return true; }
-00143 
-00145     virtual bool Visit( const TiXmlDeclaration& /*declaration*/ )   { return true; }
-00147     virtual bool Visit( const TiXmlText& /*text*/ )                 { return true; }
-00149     virtual bool Visit( const TiXmlComment& /*comment*/ )           { return true; }
-00151     virtual bool Visit( const TiXmlUnknown& /*unknown*/ )           { return true; }
-00152 };
-00153 
-00154 // Only used by Attribute::Query functions
-00155 enum 
-00156 { 
-00157     TIXML_SUCCESS,
-00158     TIXML_NO_ATTRIBUTE,
-00159     TIXML_WRONG_TYPE
-00160 };
-00161 
-00162 
-00163 // Used by the parsing routines.
-00164 enum TiXmlEncoding
-00165 {
-00166     TIXML_ENCODING_UNKNOWN,
-00167     TIXML_ENCODING_UTF8,
-00168     TIXML_ENCODING_LEGACY
-00169 };
-00170 
-00171 const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN;
-00172 
-00195 class TiXmlBase
-00196 {
-00197     friend class TiXmlNode;
-00198     friend class TiXmlElement;
-00199     friend class TiXmlDocument;
-00200 
-00201 public:
-00202     TiXmlBase() :   userData(0)     {}
-00203     virtual ~TiXmlBase()            {}
-00204 
-00214     virtual void Print( FILE* cfile, int depth ) const = 0;
-00215 
-00222     static void SetCondenseWhiteSpace( bool condense )      { condenseWhiteSpace = condense; }
-00223 
-00225     static bool IsWhiteSpaceCondensed()                     { return condenseWhiteSpace; }
-00226 
-00245     int Row() const         { return location.row + 1; }
-00246     int Column() const      { return location.col + 1; }    
-00247 
-00248     void  SetUserData( void* user )         { userData = user; }    
-00249     void* GetUserData()                     { return userData; }    
-00250     const void* GetUserData() const         { return userData; }    
-00251 
-00252     // Table that returs, for a given lead byte, the total number of bytes
-00253     // in the UTF-8 sequence.
-00254     static const int utf8ByteTable[256];
-00255 
-00256     virtual const char* Parse(  const char* p, 
-00257                                 TiXmlParsingData* data, 
-00258                                 TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0;
-00259 
-00263     static void EncodeString( const TIXML_STRING& str, TIXML_STRING* out );
-00264 
-00265     enum
-00266     {
-00267         TIXML_NO_ERROR = 0,
-00268         TIXML_ERROR,
-00269         TIXML_ERROR_OPENING_FILE,
-00270         TIXML_ERROR_OUT_OF_MEMORY,
-00271         TIXML_ERROR_PARSING_ELEMENT,
-00272         TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME,
-00273         TIXML_ERROR_READING_ELEMENT_VALUE,
-00274         TIXML_ERROR_READING_ATTRIBUTES,
-00275         TIXML_ERROR_PARSING_EMPTY,
-00276         TIXML_ERROR_READING_END_TAG,
-00277         TIXML_ERROR_PARSING_UNKNOWN,
-00278         TIXML_ERROR_PARSING_COMMENT,
-00279         TIXML_ERROR_PARSING_DECLARATION,
-00280         TIXML_ERROR_DOCUMENT_EMPTY,
-00281         TIXML_ERROR_EMBEDDED_NULL,
-00282         TIXML_ERROR_PARSING_CDATA,
-00283         TIXML_ERROR_DOCUMENT_TOP_ONLY,
-00284 
-00285         TIXML_ERROR_STRING_COUNT
-00286     };
-00287 
-00288 protected:
-00289 
-00290     static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding );
-00291     inline static bool IsWhiteSpace( char c )       
-00292     { 
-00293         return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); 
-00294     }
-00295     inline static bool IsWhiteSpace( int c )
-00296     {
-00297         if ( c < 256 )
-00298             return IsWhiteSpace( (char) c );
-00299         return false;   // Again, only truly correct for English/Latin...but usually works.
-00300     }
-00301 
-00302     #ifdef TIXML_USE_STL
-00303     static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag );
-00304     static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag );
-00305     #endif
-00306 
-00307     /*  Reads an XML name into the string provided. Returns
-00308         a pointer just past the last character of the name,
-00309         or 0 if the function has an error.
-00310     */
-00311     static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding );
-00312 
-00313     /*  Reads text. Returns a pointer past the given end tag.
-00314         Wickedly complex options, but it keeps the (sensitive) code in one place.
-00315     */
-00316     static const char* ReadText(    const char* in,             // where to start
-00317                                     TIXML_STRING* text,         // the string read
-00318                                     bool ignoreWhiteSpace,      // whether to keep the white space
-00319                                     const char* endTag,         // what ends this text
-00320                                     bool ignoreCase,            // whether to ignore case in the end tag
-00321                                     TiXmlEncoding encoding );   // the current encoding
-00322 
-00323     // If an entity has been found, transform it into a character.
-00324     static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding );
-00325 
-00326     // Get a character, while interpreting entities.
-00327     // The length can be from 0 to 4 bytes.
-00328     inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding )
-00329     {
-00330         assert( p );
-00331         if ( encoding == TIXML_ENCODING_UTF8 )
-00332         {
-00333             *length = utf8ByteTable[ *((const unsigned char*)p) ];
-00334             assert( *length >= 0 && *length < 5 );
-00335         }
-00336         else
-00337         {
-00338             *length = 1;
-00339         }
-00340 
-00341         if ( *length == 1 )
-00342         {
-00343             if ( *p == '&' )
-00344                 return GetEntity( p, _value, length, encoding );
-00345             *_value = *p;
-00346             return p+1;
-00347         }
-00348         else if ( *length )
-00349         {
-00350             //strncpy( _value, p, *length );    // lots of compilers don't like this function (unsafe),
-00351                                                 // and the null terminator isn't needed
-00352             for( int i=0; p[i] && i<*length; ++i ) {
-00353                 _value[i] = p[i];
-00354             }
-00355             return p + (*length);
-00356         }
-00357         else
-00358         {
-00359             // Not valid text.
-00360             return 0;
-00361         }
-00362     }
-00363 
-00364     // Return true if the next characters in the stream are any of the endTag sequences.
-00365     // Ignore case only works for english, and should only be relied on when comparing
-00366     // to English words: StringEqual( p, "version", true ) is fine.
-00367     static bool StringEqual(    const char* p,
-00368                                 const char* endTag,
-00369                                 bool ignoreCase,
-00370                                 TiXmlEncoding encoding );
-00371 
-00372     static const char* errorString[ TIXML_ERROR_STRING_COUNT ];
-00373 
-00374     TiXmlCursor location;
-00375 
-00377     void*           userData;
-00378     
-00379     // None of these methods are reliable for any language except English.
-00380     // Good for approximation, not great for accuracy.
-00381     static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding );
-00382     static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding );
-00383     inline static int ToLower( int v, TiXmlEncoding encoding )
-00384     {
-00385         if ( encoding == TIXML_ENCODING_UTF8 )
-00386         {
-00387             if ( v < 128 ) return tolower( v );
-00388             return v;
-00389         }
-00390         else
-00391         {
-00392             return tolower( v );
-00393         }
-00394     }
-00395     static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );
-00396 
-00397 private:
-00398     TiXmlBase( const TiXmlBase& );              // not implemented.
-00399     void operator=( const TiXmlBase& base );    // not allowed.
-00400 
-00401     struct Entity
-00402     {
-00403         const char*     str;
-00404         unsigned int    strLength;
-00405         char            chr;
-00406     };
-00407     enum
-00408     {
-00409         NUM_ENTITY = 5,
-00410         MAX_ENTITY_LENGTH = 6
-00411 
-00412     };
-00413     static Entity entity[ NUM_ENTITY ];
-00414     static bool condenseWhiteSpace;
-00415 };
-00416 
-00417 
-00424 class TiXmlNode : public TiXmlBase
-00425 {
-00426     friend class TiXmlDocument;
-00427     friend class TiXmlElement;
-00428 
-00429 public:
-00430     #ifdef TIXML_USE_STL    
-00431 
-00435         friend std::istream& operator >> (std::istream& in, TiXmlNode& base);
-00436 
-00453         friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base);
-00454 
-00456         friend std::string& operator<< (std::string& out, const TiXmlNode& base );
-00457 
-00458     #endif
-00459 
-00463     enum NodeType
-00464     {
-00465         DOCUMENT,
-00466         ELEMENT,
-00467         COMMENT,
-00468         UNKNOWN,
-00469         TEXT,
-00470         DECLARATION,
-00471         TYPECOUNT
-00472     };
-00473 
-00474     virtual ~TiXmlNode();
-00475 
-00488     const char *Value() const { return value.c_str (); }
-00489 
-00490     #ifdef TIXML_USE_STL
-00491 
-00495     const std::string& ValueStr() const { return value; }
-00496     #endif
-00497 
-00498     const TIXML_STRING& ValueTStr() const { return value; }
-00499 
-00509     void SetValue(const char * _value) { value = _value;}
-00510 
-00511     #ifdef TIXML_USE_STL
-00513     void SetValue( const std::string& _value )  { value = _value; }
-00514     #endif
-00515 
-00517     void Clear();
-00518 
-00520     TiXmlNode* Parent()                         { return parent; }
-00521     const TiXmlNode* Parent() const             { return parent; }
-00522 
-00523     const TiXmlNode* FirstChild()   const       { return firstChild; }  
-00524     TiXmlNode* FirstChild()                     { return firstChild; }
-00525     const TiXmlNode* FirstChild( const char * value ) const;            
-00526 
-00527     TiXmlNode* FirstChild( const char * _value ) {
-00528         // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe)
-00529         // call the method, cast the return back to non-const.
-00530         return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value ));
-00531     }
-00532     const TiXmlNode* LastChild() const  { return lastChild; }       
-00533     TiXmlNode* LastChild()  { return lastChild; }
-00534     
-00535     const TiXmlNode* LastChild( const char * value ) const;         
-00536     TiXmlNode* LastChild( const char * _value ) {
-00537         return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value ));
-00538     }
-00539 
-00540     #ifdef TIXML_USE_STL
-00541     const TiXmlNode* FirstChild( const std::string& _value ) const  {   return FirstChild (_value.c_str ());    }   
-00542     TiXmlNode* FirstChild( const std::string& _value )              {   return FirstChild (_value.c_str ());    }   
-00543     const TiXmlNode* LastChild( const std::string& _value ) const   {   return LastChild (_value.c_str ()); }   
-00544     TiXmlNode* LastChild( const std::string& _value )               {   return LastChild (_value.c_str ()); }   
-00545     #endif
-00546 
-00563     const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const;
-00564     TiXmlNode* IterateChildren( const TiXmlNode* previous ) {
-00565         return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) );
-00566     }
-00567 
-00569     const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const;
-00570     TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) {
-00571         return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) );
-00572     }
-00573 
-00574     #ifdef TIXML_USE_STL
-00575     const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const  {   return IterateChildren (_value.c_str (), previous); }   
-00576     TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) {    return IterateChildren (_value.c_str (), previous); }   
-00577     #endif
-00578 
-00582     TiXmlNode* InsertEndChild( const TiXmlNode& addThis );
-00583 
-00584 
-00594     TiXmlNode* LinkEndChild( TiXmlNode* addThis );
-00595 
-00599     TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis );
-00600 
-00604     TiXmlNode* InsertAfterChild(  TiXmlNode* afterThis, const TiXmlNode& addThis );
-00605 
-00609     TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis );
-00610 
-00612     bool RemoveChild( TiXmlNode* removeThis );
-00613 
-00615     const TiXmlNode* PreviousSibling() const            { return prev; }
-00616     TiXmlNode* PreviousSibling()                        { return prev; }
-00617 
-00619     const TiXmlNode* PreviousSibling( const char * ) const;
-00620     TiXmlNode* PreviousSibling( const char *_prev ) {
-00621         return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) );
-00622     }
-00623 
-00624     #ifdef TIXML_USE_STL
-00625     const TiXmlNode* PreviousSibling( const std::string& _value ) const {   return PreviousSibling (_value.c_str ());   }   
-00626     TiXmlNode* PreviousSibling( const std::string& _value )             {   return PreviousSibling (_value.c_str ());   }   
-00627     const TiXmlNode* NextSibling( const std::string& _value) const      {   return NextSibling (_value.c_str ());   }   
-00628     TiXmlNode* NextSibling( const std::string& _value)                  {   return NextSibling (_value.c_str ());   }   
-00629     #endif
-00630 
-00632     const TiXmlNode* NextSibling() const                { return next; }
-00633     TiXmlNode* NextSibling()                            { return next; }
-00634 
-00636     const TiXmlNode* NextSibling( const char * ) const;
-00637     TiXmlNode* NextSibling( const char* _next ) {
-00638         return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) );
-00639     }
-00640 
-00645     const TiXmlElement* NextSiblingElement() const;
-00646     TiXmlElement* NextSiblingElement() {
-00647         return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() );
-00648     }
-00649 
-00654     const TiXmlElement* NextSiblingElement( const char * ) const;
-00655     TiXmlElement* NextSiblingElement( const char *_next ) {
-00656         return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) );
-00657     }
-00658 
-00659     #ifdef TIXML_USE_STL
-00660     const TiXmlElement* NextSiblingElement( const std::string& _value) const    {   return NextSiblingElement (_value.c_str ());    }   
-00661     TiXmlElement* NextSiblingElement( const std::string& _value)                {   return NextSiblingElement (_value.c_str ());    }   
-00662     #endif
-00663 
-00665     const TiXmlElement* FirstChildElement() const;
-00666     TiXmlElement* FirstChildElement() {
-00667         return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() );
-00668     }
-00669 
-00671     const TiXmlElement* FirstChildElement( const char * _value ) const;
-00672     TiXmlElement* FirstChildElement( const char * _value ) {
-00673         return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) );
-00674     }
-00675 
-00676     #ifdef TIXML_USE_STL
-00677     const TiXmlElement* FirstChildElement( const std::string& _value ) const    {   return FirstChildElement (_value.c_str ()); }   
-00678     TiXmlElement* FirstChildElement( const std::string& _value )                {   return FirstChildElement (_value.c_str ()); }   
-00679     #endif
-00680 
-00685     int Type() const    { return type; }
-00686 
-00690     const TiXmlDocument* GetDocument() const;
-00691     TiXmlDocument* GetDocument() {
-00692         return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() );
-00693     }
-00694 
-00696     bool NoChildren() const                     { return !firstChild; }
-00697 
-00698     virtual const TiXmlDocument*    ToDocument()    const { return 0; } 
-00699     virtual const TiXmlElement*     ToElement()     const { return 0; } 
-00700     virtual const TiXmlComment*     ToComment()     const { return 0; } 
-00701     virtual const TiXmlUnknown*     ToUnknown()     const { return 0; } 
-00702     virtual const TiXmlText*        ToText()        const { return 0; } 
-00703     virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } 
-00704 
-00705     virtual TiXmlDocument*          ToDocument()    { return 0; } 
-00706     virtual TiXmlElement*           ToElement()     { return 0; } 
-00707     virtual TiXmlComment*           ToComment()     { return 0; } 
-00708     virtual TiXmlUnknown*           ToUnknown()     { return 0; } 
-00709     virtual TiXmlText*              ToText()        { return 0; } 
-00710     virtual TiXmlDeclaration*       ToDeclaration() { return 0; } 
-00711 
-00715     virtual TiXmlNode* Clone() const = 0;
-00716 
-00739     virtual bool Accept( TiXmlVisitor* visitor ) const = 0;
-00740 
-00741 protected:
-00742     TiXmlNode( NodeType _type );
-00743 
-00744     // Copy to the allocated object. Shared functionality between Clone, Copy constructor,
-00745     // and the assignment operator.
-00746     void CopyTo( TiXmlNode* target ) const;
-00747 
-00748     #ifdef TIXML_USE_STL
-00749         // The real work of the input operator.
-00750     virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0;
-00751     #endif
-00752 
-00753     // Figure out what is at *p, and parse it. Returns null if it is not an xml node.
-00754     TiXmlNode* Identify( const char* start, TiXmlEncoding encoding );
-00755 
-00756     TiXmlNode*      parent;
-00757     NodeType        type;
-00758 
-00759     TiXmlNode*      firstChild;
-00760     TiXmlNode*      lastChild;
-00761 
-00762     TIXML_STRING    value;
-00763 
-00764     TiXmlNode*      prev;
-00765     TiXmlNode*      next;
-00766 
-00767 private:
-00768     TiXmlNode( const TiXmlNode& );              // not implemented.
-00769     void operator=( const TiXmlNode& base );    // not allowed.
-00770 };
-00771 
-00772 
-00780 class TiXmlAttribute : public TiXmlBase
-00781 {
-00782     friend class TiXmlAttributeSet;
-00783 
-00784 public:
-00786     TiXmlAttribute() : TiXmlBase()
-00787     {
-00788         document = 0;
-00789         prev = next = 0;
-00790     }
-00791 
-00792     #ifdef TIXML_USE_STL
-00794     TiXmlAttribute( const std::string& _name, const std::string& _value )
-00795     {
-00796         name = _name;
-00797         value = _value;
-00798         document = 0;
-00799         prev = next = 0;
-00800     }
-00801     #endif
-00802 
-00804     TiXmlAttribute( const char * _name, const char * _value )
-00805     {
-00806         name = _name;
-00807         value = _value;
-00808         document = 0;
-00809         prev = next = 0;
-00810     }
-00811 
-00812     const char*     Name()  const       { return name.c_str(); }        
-00813     const char*     Value() const       { return value.c_str(); }       
-00814     #ifdef TIXML_USE_STL
-00815     const std::string& ValueStr() const { return value; }               
-00816     #endif
-00817     int             IntValue() const;                                   
-00818     double          DoubleValue() const;                                
-00819 
-00820     // Get the tinyxml string representation
-00821     const TIXML_STRING& NameTStr() const { return name; }
-00822 
-00832     int QueryIntValue( int* _value ) const;
-00834     int QueryDoubleValue( double* _value ) const;
-00835 
-00836     void SetName( const char* _name )   { name = _name; }               
-00837     void SetValue( const char* _value ) { value = _value; }             
-00838 
-00839     void SetIntValue( int _value );                                     
-00840     void SetDoubleValue( double _value );                               
-00841 
-00842     #ifdef TIXML_USE_STL
-00844     void SetName( const std::string& _name )    { name = _name; }   
-00846     void SetValue( const std::string& _value )  { value = _value; }
-00847     #endif
-00848 
-00850     const TiXmlAttribute* Next() const;
-00851     TiXmlAttribute* Next() {
-00852         return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() ); 
-00853     }
-00854 
-00856     const TiXmlAttribute* Previous() const;
-00857     TiXmlAttribute* Previous() {
-00858         return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() ); 
-00859     }
-00860 
-00861     bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; }
-00862     bool operator<( const TiXmlAttribute& rhs )  const { return name < rhs.name; }
-00863     bool operator>( const TiXmlAttribute& rhs )  const { return name > rhs.name; }
-00864 
-00865     /*  Attribute parsing starts: first letter of the name
-00866                          returns: the next char after the value end quote
-00867     */
-00868     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
-00869 
-00870     // Prints this Attribute to a FILE stream.
-00871     virtual void Print( FILE* cfile, int depth ) const {
-00872         Print( cfile, depth, 0 );
-00873     }
-00874     void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
-00875 
-00876     // [internal use]
-00877     // Set the document pointer so the attribute can report errors.
-00878     void SetDocument( TiXmlDocument* doc )  { document = doc; }
-00879 
-00880 private:
-00881     TiXmlAttribute( const TiXmlAttribute& );                // not implemented.
-00882     void operator=( const TiXmlAttribute& base );   // not allowed.
-00883 
-00884     TiXmlDocument*  document;   // A pointer back to a document, for error reporting.
-00885     TIXML_STRING name;
-00886     TIXML_STRING value;
-00887     TiXmlAttribute* prev;
-00888     TiXmlAttribute* next;
-00889 };
-00890 
-00891 
-00892 /*  A class used to manage a group of attributes.
-00893     It is only used internally, both by the ELEMENT and the DECLARATION.
-00894     
-00895     The set can be changed transparent to the Element and Declaration
-00896     classes that use it, but NOT transparent to the Attribute
-00897     which has to implement a next() and previous() method. Which makes
-00898     it a bit problematic and prevents the use of STL.
-00899 
-00900     This version is implemented with circular lists because:
-00901         - I like circular lists
-00902         - it demonstrates some independence from the (typical) doubly linked list.
-00903 */
-00904 class TiXmlAttributeSet
-00905 {
-00906 public:
-00907     TiXmlAttributeSet();
-00908     ~TiXmlAttributeSet();
-00909 
-00910     void Add( TiXmlAttribute* attribute );
-00911     void Remove( TiXmlAttribute* attribute );
-00912 
-00913     const TiXmlAttribute* First()   const   { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
-00914     TiXmlAttribute* First()                 { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
-00915     const TiXmlAttribute* Last() const      { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
-00916     TiXmlAttribute* Last()                  { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
-00917 
-00918     const TiXmlAttribute*   Find( const char* _name ) const;
-00919     TiXmlAttribute* Find( const char* _name ) {
-00920         return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
-00921     }
-00922     #ifdef TIXML_USE_STL
-00923     const TiXmlAttribute*   Find( const std::string& _name ) const;
-00924     TiXmlAttribute* Find( const std::string& _name ) {
-00925         return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
-00926     }
-00927 
-00928     #endif
-00929 
-00930 private:
-00931     //*ME:  Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element),
-00932     //*ME:  this class must be also use a hidden/disabled copy-constructor !!!
-00933     TiXmlAttributeSet( const TiXmlAttributeSet& );  // not allowed
-00934     void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute)
-00935 
-00936     TiXmlAttribute sentinel;
-00937 };
-00938 
-00939 
-00944 class TiXmlElement : public TiXmlNode
-00945 {
-00946 public:
-00948     TiXmlElement (const char * in_value);
-00949 
-00950     #ifdef TIXML_USE_STL
-00952     TiXmlElement( const std::string& _value );
-00953     #endif
-00954 
-00955     TiXmlElement( const TiXmlElement& );
-00956 
-00957     void operator=( const TiXmlElement& base );
-00958 
-00959     virtual ~TiXmlElement();
-00960 
-00964     const char* Attribute( const char* name ) const;
-00965 
-00972     const char* Attribute( const char* name, int* i ) const;
-00973 
-00980     const char* Attribute( const char* name, double* d ) const;
-00981 
-00989     int QueryIntAttribute( const char* name, int* _value ) const;
-00991     int QueryDoubleAttribute( const char* name, double* _value ) const;
-00993     int QueryFloatAttribute( const char* name, float* _value ) const {
-00994         double d;
-00995         int result = QueryDoubleAttribute( name, &d );
-00996         if ( result == TIXML_SUCCESS ) {
-00997             *_value = (float)d;
-00998         }
-00999         return result;
-01000     }
-01001 
-01002     #ifdef TIXML_USE_STL
-01003 
-01011     template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const
-01012     {
-01013         const TiXmlAttribute* node = attributeSet.Find( name );
-01014         if ( !node )
-01015             return TIXML_NO_ATTRIBUTE;
-01016 
-01017         std::stringstream sstream( node->ValueStr() );
-01018         sstream >> *outValue;
-01019         if ( !sstream.fail() )
-01020             return TIXML_SUCCESS;
-01021         return TIXML_WRONG_TYPE;
-01022     }
-01023     /*
-01024      This is - in theory - a bug fix for "QueryValueAtribute returns truncated std::string"
-01025      but template specialization is hard to get working cross-compiler. Leaving the bug for now.
-01026      
-01027     // The above will fail for std::string because the space character is used as a seperator.
-01028     // Specialize for strings. Bug [ 1695429 ] QueryValueAtribute returns truncated std::string
-01029     template<> int QueryValueAttribute( const std::string& name, std::string* outValue ) const
-01030     {
-01031         const TiXmlAttribute* node = attributeSet.Find( name );
-01032         if ( !node )
-01033             return TIXML_NO_ATTRIBUTE;
-01034         *outValue = node->ValueStr();
-01035         return TIXML_SUCCESS;
-01036     }
-01037     */
-01038     #endif
-01039 
-01043     void SetAttribute( const char* name, const char * _value );
-01044 
-01045     #ifdef TIXML_USE_STL
-01046     const std::string* Attribute( const std::string& name ) const;
-01047     const std::string* Attribute( const std::string& name, int* i ) const;
-01048     const std::string* Attribute( const std::string& name, double* d ) const;
-01049     int QueryIntAttribute( const std::string& name, int* _value ) const;
-01050     int QueryDoubleAttribute( const std::string& name, double* _value ) const;
-01051 
-01053     void SetAttribute( const std::string& name, const std::string& _value );
-01055     void SetAttribute( const std::string& name, int _value );
-01056     #endif
-01057 
-01061     void SetAttribute( const char * name, int value );
-01062 
-01066     void SetDoubleAttribute( const char * name, double value );
-01067 
-01070     void RemoveAttribute( const char * name );
-01071     #ifdef TIXML_USE_STL
-01072     void RemoveAttribute( const std::string& name ) {   RemoveAttribute (name.c_str ());    }   
-01073     #endif
-01074 
-01075     const TiXmlAttribute* FirstAttribute() const    { return attributeSet.First(); }        
-01076     TiXmlAttribute* FirstAttribute()                { return attributeSet.First(); }
-01077     const TiXmlAttribute* LastAttribute()   const   { return attributeSet.Last(); }     
-01078     TiXmlAttribute* LastAttribute()                 { return attributeSet.Last(); }
-01079 
-01112     const char* GetText() const;
-01113 
-01115     virtual TiXmlNode* Clone() const;
-01116     // Print the Element to a FILE stream.
-01117     virtual void Print( FILE* cfile, int depth ) const;
-01118 
-01119     /*  Attribtue parsing starts: next char past '<'
-01120                          returns: next char past '>'
-01121     */
-01122     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
-01123 
-01124     virtual const TiXmlElement*     ToElement()     const { return this; } 
-01125     virtual TiXmlElement*           ToElement()           { return this; } 
-01126 
-01129     virtual bool Accept( TiXmlVisitor* visitor ) const;
-01130 
-01131 protected:
-01132 
-01133     void CopyTo( TiXmlElement* target ) const;
-01134     void ClearThis();   // like clear, but initializes 'this' object as well
-01135 
-01136     // Used to be public [internal use]
-01137     #ifdef TIXML_USE_STL
-01138     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
-01139     #endif
-01140     /*  [internal use]
-01141         Reads the "value" of the element -- another element, or text.
-01142         This should terminate with the current end tag.
-01143     */
-01144     const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding );
-01145 
-01146 private:
-01147 
-01148     TiXmlAttributeSet attributeSet;
-01149 };
-01150 
-01151 
-01154 class TiXmlComment : public TiXmlNode
-01155 {
-01156 public:
-01158     TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {}
-01160     TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::COMMENT ) {
-01161         SetValue( _value );
-01162     }
-01163     TiXmlComment( const TiXmlComment& );
-01164     void operator=( const TiXmlComment& base );
-01165 
-01166     virtual ~TiXmlComment() {}
-01167 
-01169     virtual TiXmlNode* Clone() const;
-01170     // Write this Comment to a FILE stream.
-01171     virtual void Print( FILE* cfile, int depth ) const;
-01172 
-01173     /*  Attribtue parsing starts: at the ! of the !--
-01174                          returns: next char past '>'
-01175     */
-01176     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
-01177 
-01178     virtual const TiXmlComment*  ToComment() const { return this; } 
-01179     virtual TiXmlComment*  ToComment() { return this; } 
-01180 
-01183     virtual bool Accept( TiXmlVisitor* visitor ) const;
-01184 
-01185 protected:
-01186     void CopyTo( TiXmlComment* target ) const;
-01187 
-01188     // used to be public
-01189     #ifdef TIXML_USE_STL
-01190     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
-01191     #endif
-01192 //  virtual void StreamOut( TIXML_OSTREAM * out ) const;
-01193 
-01194 private:
-01195 
-01196 };
-01197 
-01198 
-01204 class TiXmlText : public TiXmlNode
-01205 {
-01206     friend class TiXmlElement;
-01207 public:
-01212     TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT)
-01213     {
-01214         SetValue( initValue );
-01215         cdata = false;
-01216     }
-01217     virtual ~TiXmlText() {}
-01218 
-01219     #ifdef TIXML_USE_STL
-01221     TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT)
-01222     {
-01223         SetValue( initValue );
-01224         cdata = false;
-01225     }
-01226     #endif
-01227 
-01228     TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT )   { copy.CopyTo( this ); }
-01229     void operator=( const TiXmlText& base )                             { base.CopyTo( this ); }
-01230 
-01231     // Write this text object to a FILE stream.
-01232     virtual void Print( FILE* cfile, int depth ) const;
-01233 
-01235     bool CDATA() const              { return cdata; }
-01237     void SetCDATA( bool _cdata )    { cdata = _cdata; }
-01238 
-01239     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
-01240 
-01241     virtual const TiXmlText* ToText() const { return this; } 
-01242     virtual TiXmlText*       ToText()       { return this; } 
-01243 
-01246     virtual bool Accept( TiXmlVisitor* content ) const;
-01247 
-01248 protected :
-01250     virtual TiXmlNode* Clone() const;
-01251     void CopyTo( TiXmlText* target ) const;
-01252 
-01253     bool Blank() const; // returns true if all white space and new lines
-01254     // [internal use]
-01255     #ifdef TIXML_USE_STL
-01256     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
-01257     #endif
-01258 
-01259 private:
-01260     bool cdata;         // true if this should be input and output as a CDATA style text element
-01261 };
-01262 
-01263 
-01277 class TiXmlDeclaration : public TiXmlNode
-01278 {
-01279 public:
-01281     TiXmlDeclaration()   : TiXmlNode( TiXmlNode::DECLARATION ) {}
-01282 
-01283 #ifdef TIXML_USE_STL
-01285     TiXmlDeclaration(   const std::string& _version,
-01286                         const std::string& _encoding,
-01287                         const std::string& _standalone );
-01288 #endif
-01289 
-01291     TiXmlDeclaration(   const char* _version,
-01292                         const char* _encoding,
-01293                         const char* _standalone );
-01294 
-01295     TiXmlDeclaration( const TiXmlDeclaration& copy );
-01296     void operator=( const TiXmlDeclaration& copy );
-01297 
-01298     virtual ~TiXmlDeclaration() {}
-01299 
-01301     const char *Version() const         { return version.c_str (); }
-01303     const char *Encoding() const        { return encoding.c_str (); }
-01305     const char *Standalone() const      { return standalone.c_str (); }
-01306 
-01308     virtual TiXmlNode* Clone() const;
-01309     // Print this declaration to a FILE stream.
-01310     virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
-01311     virtual void Print( FILE* cfile, int depth ) const {
-01312         Print( cfile, depth, 0 );
-01313     }
-01314 
-01315     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
-01316 
-01317     virtual const TiXmlDeclaration* ToDeclaration() const { return this; } 
-01318     virtual TiXmlDeclaration*       ToDeclaration()       { return this; } 
-01319 
-01322     virtual bool Accept( TiXmlVisitor* visitor ) const;
-01323 
-01324 protected:
-01325     void CopyTo( TiXmlDeclaration* target ) const;
-01326     // used to be public
-01327     #ifdef TIXML_USE_STL
-01328     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
-01329     #endif
-01330 
-01331 private:
-01332 
-01333     TIXML_STRING version;
-01334     TIXML_STRING encoding;
-01335     TIXML_STRING standalone;
-01336 };
-01337 
-01338 
-01346 class TiXmlUnknown : public TiXmlNode
-01347 {
-01348 public:
-01349     TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN )    {}
-01350     virtual ~TiXmlUnknown() {}
-01351 
-01352     TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN )      { copy.CopyTo( this ); }
-01353     void operator=( const TiXmlUnknown& copy )                                      { copy.CopyTo( this ); }
-01354 
-01356     virtual TiXmlNode* Clone() const;
-01357     // Print this Unknown to a FILE stream.
-01358     virtual void Print( FILE* cfile, int depth ) const;
-01359 
-01360     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
-01361 
-01362     virtual const TiXmlUnknown*     ToUnknown()     const { return this; } 
-01363     virtual TiXmlUnknown*           ToUnknown()     { return this; } 
-01364 
-01367     virtual bool Accept( TiXmlVisitor* content ) const;
-01368 
-01369 protected:
-01370     void CopyTo( TiXmlUnknown* target ) const;
-01371 
-01372     #ifdef TIXML_USE_STL
-01373     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
-01374     #endif
-01375 
-01376 private:
-01377 
-01378 };
-01379 
-01380 
-01385 class TiXmlDocument : public TiXmlNode
-01386 {
-01387 public:
-01389     TiXmlDocument();
-01391     TiXmlDocument( const char * documentName );
-01392 
-01393     #ifdef TIXML_USE_STL
-01395     TiXmlDocument( const std::string& documentName );
-01396     #endif
-01397 
-01398     TiXmlDocument( const TiXmlDocument& copy );
-01399     void operator=( const TiXmlDocument& copy );
-01400 
-01401     virtual ~TiXmlDocument() {}
-01402 
-01407     bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
-01409     bool SaveFile() const;
-01411     bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
-01413     bool SaveFile( const char * filename ) const;
-01419     bool LoadFile( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
-01421     bool SaveFile( FILE* ) const;
-01422 
-01423     #ifdef TIXML_USE_STL
-01424     bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING )           
-01425     {
-01426 //      StringToBuffer f( filename );
-01427 //      return ( f.buffer && LoadFile( f.buffer, encoding ));
-01428         return LoadFile( filename.c_str(), encoding );
-01429     }
-01430     bool SaveFile( const std::string& filename ) const      
-01431     {
-01432 //      StringToBuffer f( filename );
-01433 //      return ( f.buffer && SaveFile( f.buffer ));
-01434         return SaveFile( filename.c_str() );
-01435     }
-01436     #endif
-01437 
-01442     virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
-01443 
-01448     const TiXmlElement* RootElement() const     { return FirstChildElement(); }
-01449     TiXmlElement* RootElement()                 { return FirstChildElement(); }
-01450 
-01456     bool Error() const                      { return error; }
-01457 
-01459     const char * ErrorDesc() const  { return errorDesc.c_str (); }
-01460 
-01464     int ErrorId()   const               { return errorId; }
-01465 
-01473     int ErrorRow() const    { return errorLocation.row+1; }
-01474     int ErrorCol() const    { return errorLocation.col+1; } 
-01475 
-01500     void SetTabSize( int _tabsize )     { tabsize = _tabsize; }
-01501 
-01502     int TabSize() const { return tabsize; }
-01503 
-01507     void ClearError()                       {   error = false; 
-01508                                                 errorId = 0; 
-01509                                                 errorDesc = ""; 
-01510                                                 errorLocation.row = errorLocation.col = 0; 
-01511                                                 //errorLocation.last = 0; 
-01512                                             }
-01513 
-01515     void Print() const                      { Print( stdout, 0 ); }
-01516 
-01517     /* Write the document to a string using formatted printing ("pretty print"). This
-01518         will allocate a character array (new char[]) and return it as a pointer. The
-01519         calling code pust call delete[] on the return char* to avoid a memory leak.
-01520     */
-01521     //char* PrintToMemory() const; 
-01522 
-01524     virtual void Print( FILE* cfile, int depth = 0 ) const;
-01525     // [internal use]
-01526     void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding );
-01527 
-01528     virtual const TiXmlDocument*    ToDocument()    const { return this; } 
-01529     virtual TiXmlDocument*          ToDocument()          { return this; } 
-01530 
-01533     virtual bool Accept( TiXmlVisitor* content ) const;
-01534 
-01535 protected :
-01536     // [internal use]
-01537     virtual TiXmlNode* Clone() const;
-01538     #ifdef TIXML_USE_STL
-01539     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
-01540     #endif
-01541 
-01542 private:
-01543     void CopyTo( TiXmlDocument* target ) const;
-01544 
-01545     bool error;
-01546     int  errorId;
-01547     TIXML_STRING errorDesc;
-01548     int tabsize;
-01549     TiXmlCursor errorLocation;
-01550     bool useMicrosoftBOM;       // the UTF-8 BOM were found when read. Note this, and try to write.
-01551 };
-01552 
-01553 
-01634 class TiXmlHandle
-01635 {
-01636 public:
-01638     TiXmlHandle( TiXmlNode* _node )                 { this->node = _node; }
-01640     TiXmlHandle( const TiXmlHandle& ref )           { this->node = ref.node; }
-01641     TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; }
-01642 
-01644     TiXmlHandle FirstChild() const;
-01646     TiXmlHandle FirstChild( const char * value ) const;
-01648     TiXmlHandle FirstChildElement() const;
-01650     TiXmlHandle FirstChildElement( const char * value ) const;
-01651 
-01655     TiXmlHandle Child( const char* value, int index ) const;
-01659     TiXmlHandle Child( int index ) const;
-01664     TiXmlHandle ChildElement( const char* value, int index ) const;
-01669     TiXmlHandle ChildElement( int index ) const;
-01670 
-01671     #ifdef TIXML_USE_STL
-01672     TiXmlHandle FirstChild( const std::string& _value ) const               { return FirstChild( _value.c_str() ); }
-01673     TiXmlHandle FirstChildElement( const std::string& _value ) const        { return FirstChildElement( _value.c_str() ); }
-01674 
-01675     TiXmlHandle Child( const std::string& _value, int index ) const         { return Child( _value.c_str(), index ); }
-01676     TiXmlHandle ChildElement( const std::string& _value, int index ) const  { return ChildElement( _value.c_str(), index ); }
-01677     #endif
-01678 
-01681     TiXmlNode* ToNode() const           { return node; } 
-01684     TiXmlElement* ToElement() const     { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); }
-01687     TiXmlText* ToText() const           { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); }
-01690     TiXmlUnknown* ToUnknown() const     { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); }
-01691 
-01695     TiXmlNode* Node() const         { return ToNode(); } 
-01699     TiXmlElement* Element() const   { return ToElement(); }
-01703     TiXmlText* Text() const         { return ToText(); }
-01707     TiXmlUnknown* Unknown() const   { return ToUnknown(); }
-01708 
-01709 private:
-01710     TiXmlNode* node;
-01711 };
-01712 
-01713 
-01733 class TiXmlPrinter : public TiXmlVisitor
-01734 {
-01735 public:
-01736     TiXmlPrinter() : depth( 0 ), simpleTextPrint( false ),
-01737                      buffer(), indent( "    " ), lineBreak( "\n" ) {}
-01738 
-01739     virtual bool VisitEnter( const TiXmlDocument& doc );
-01740     virtual bool VisitExit( const TiXmlDocument& doc );
-01741 
-01742     virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute );
-01743     virtual bool VisitExit( const TiXmlElement& element );
-01744 
-01745     virtual bool Visit( const TiXmlDeclaration& declaration );
-01746     virtual bool Visit( const TiXmlText& text );
-01747     virtual bool Visit( const TiXmlComment& comment );
-01748     virtual bool Visit( const TiXmlUnknown& unknown );
-01749 
-01753     void SetIndent( const char* _indent )           { indent = _indent ? _indent : "" ; }
-01755     const char* Indent()                            { return indent.c_str(); }
-01760     void SetLineBreak( const char* _lineBreak )     { lineBreak = _lineBreak ? _lineBreak : ""; }
-01762     const char* LineBreak()                         { return lineBreak.c_str(); }
-01763 
-01767     void SetStreamPrinting()                        { indent = "";
-01768                                                       lineBreak = "";
-01769                                                     }   
-01771     const char* CStr()                              { return buffer.c_str(); }
-01773     size_t Size()                                   { return buffer.size(); }
-01774 
-01775     #ifdef TIXML_USE_STL
-01777     const std::string& Str()                        { return buffer; }
-01778     #endif
-01779 
-01780 private:
-01781     void DoIndent() {
-01782         for( int i=0; i<depth; ++i )
-01783             buffer += indent;
-01784     }
-01785     void DoLineBreak() {
-01786         buffer += lineBreak;
-01787     }
-01788 
-01789     int depth;
-01790     bool simpleTextPrint;
-01791     TIXML_STRING buffer;
-01792     TIXML_STRING indent;
-01793     TIXML_STRING lineBreak;
-01794 };
-01795 
-01796 
-01797 #ifdef _MSC_VER
-01798 #pragma warning( pop )
-01799 #endif
-01800 
-01801 #endif
-01802 
-

Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tutorial0.html b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tutorial0.html deleted file mode 100644 index d5d19cab1f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/docs/tutorial0.html +++ /dev/null @@ -1,721 +0,0 @@ - - -TinyXml: TinyXML Tutorial - - - - - - -

TinyXML Tutorial

What is this?

-

-This tutorial has a few tips and suggestions on how to use TinyXML effectively.

-I've also tried to include some C++ tips like how to convert strings to integers and vice versa. This isn't anything to do with TinyXML itself, but it may helpful for your project so I've put it in anyway.

-If you don't know basic C++ concepts this tutorial won't be useful. Likewise if you don't know what a DOM is, look elsewhere first.

-

Before we start

-

-Some example XML datasets/files will be used.

-example1.xml:

-

<?xml version="1.0" ?>
-<Hello>World</Hello>
-

-example2.xml:

-

<?xml version="1.0" ?>
-<poetry>
-	<verse>
-		Alas
-		  Great World
-			Alas (again)
-	</verse>
-</poetry>
-

-example3.xml:

-

<?xml version="1.0" ?>
-<shapes>
-	<circle name="int-based" x="20" y="30" r="50" />
-	<point name="float-based" x="3.5" y="52.1" />
-</shapes>
-

-example4.xml

-

<?xml version="1.0" ?>
-<MyApp>
-    <!-- Settings for MyApp -->
-    <Messages>
-        <Welcome>Welcome to MyApp</Welcome>
-        <Farewell>Thank you for using MyApp</Farewell>
-    </Messages>
-    <Windows>
-        <Window name="MainFrame" x="5" y="15" w="400" h="250" />
-    </Windows>
-    <Connection ip="192.168.0.1" timeout="123.456000" />
-</MyApp>
-

-

Getting Started

-

-

Load XML from a file

-

-The simplest way to load a file into a TinyXML DOM is:

-

TiXmlDocument doc( "demo.xml" );
-doc.LoadFile();
-

-A more real-world usage is shown below. This will load the file and display the contents to STDOUT:

-

// load the named file and dump its structure to STDOUT
-void dump_to_stdout(const char* pFilename)
-{
-	TiXmlDocument doc(pFilename);
-	bool loadOkay = doc.LoadFile();
-	if (loadOkay)
-	{
-		printf("\n%s:\n", pFilename);
-		dump_to_stdout( &doc ); // defined later in the tutorial
-	}
-	else
-	{
-		printf("Failed to load file \"%s\"\n", pFilename);
-	}
-}
-

-A simple demonstration of this function is to use a main like this:

-

int main(void)
-{
-	dump_to_stdout("example1.xml");
-	return 0;
-}
-

-Recall that Example 1 XML is:

-

<?xml version="1.0" ?>
-<Hello>World</Hello>
-

-Running the program with this XML will display this in the console/DOS window:

-

DOCUMENT
-+ DECLARATION
-+ ELEMENT Hello
-  + TEXT[World]
-

-The ``dump_to_stdout`` function is defined later in this tutorial and is useful if you want to understand recursive traversal of a DOM.

-

Building Documents Programatically

-

-This is how to build Example 1 pragmatically:

-

void build_simple_doc( )
-{
-	// Make xml: <?xml ..><Hello>World</Hello>
-	TiXmlDocument doc;
-	TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" );
-	TiXmlElement * element = new TiXmlElement( "Hello" );
-	TiXmlText * text = new TiXmlText( "World" );
-	element->LinkEndChild( text );
-	doc.LinkEndChild( decl );
-	doc.LinkEndChild( element );
-	doc.SaveFile( "madeByHand.xml" );
-}
-

-This can be loaded and displayed on the console with:

-

dump_to_stdout("madeByHand.xml"); // this func defined later in the tutorial
-

-and you'll see it is identical to Example 1:

-

madeByHand.xml:
-Document
-+ Declaration
-+ Element [Hello]
-  + Text: [World]
-

-This code produces exactly the same XML DOM but it shows a different ordering to node creation and linking:

-

void write_simple_doc2( )
-{
-	// same as write_simple_doc1 but add each node
-	// as early as possible into the tree.
-
-	TiXmlDocument doc;
-	TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" );
-	doc.LinkEndChild( decl );
-	
-	TiXmlElement * element = new TiXmlElement( "Hello" );
-	doc.LinkEndChild( element );
-	
-	TiXmlText * text = new TiXmlText( "World" );
-	element->LinkEndChild( text );
-	
-	doc.SaveFile( "madeByHand2.xml" );
-}
-

-Both of these produce the same XML, namely:

-

<?xml version="1.0" ?>
-<Hello>World</Hello>
-

-Or in structure form:

-

DOCUMENT
-+ DECLARATION
-+ ELEMENT Hello
-  + TEXT[World]
-

-

Attributes

-

-Given an existing node, settings attributes is easy:

-

window = new TiXmlElement( "Demo" );  
-window->SetAttribute("name", "Circle");
-window->SetAttribute("x", 5);
-window->SetAttribute("y", 15);
-window->SetDoubleAttribute("radius", 3.14159);
-

-You can it also work with the TiXmlAttribute objects if you want.

-The following code shows one way (not the only way) to get all attributes of an element, print the name and string value, and if the value can be converted to an integer or double, print that value too:

-

// print all attributes of pElement.
-// returns the number of attributes printed
-int dump_attribs_to_stdout(TiXmlElement* pElement, unsigned int indent)
-{
-	if ( !pElement ) return 0;
-
-	TiXmlAttribute* pAttrib=pElement->FirstAttribute();
-	int i=0;
-	int ival;
-	double dval;
-	const char* pIndent=getIndent(indent);
-	printf("\n");
-	while (pAttrib)
-	{
-		printf( "%s%s: value=[%s]", pIndent, pAttrib->Name(), pAttrib->Value());
-
-		if (pAttrib->QueryIntValue(&ival)==TIXML_SUCCESS)    printf( " int=%d", ival);
-		if (pAttrib->QueryDoubleValue(&dval)==TIXML_SUCCESS) printf( " d=%1.1f", dval);
-		printf( "\n" );
-		i++;
-		pAttrib=pAttrib->Next();
-	}
-	return i;
-}
-

-

Writing a document to a file

-

-Writing a pre-built DOM to a file is trivial:

-

doc.SaveFile( saveFilename );  
-

-Recall, for example, example 4:

-

<?xml version="1.0" ?>
-<MyApp>
-    <!-- Settings for MyApp -->
-    <Messages>
-        <Welcome>Welcome to MyApp</Welcome>
-        <Farewell>Thank you for using MyApp</Farewell>
-    </Messages>
-    <Windows>
-        <Window name="MainFrame" x="5" y="15" w="400" h="250" />
-    </Windows>
-    <Connection ip="192.168.0.1" timeout="123.456000" />
-</MyApp>
-

-The following function builds this DOM and writes the file "appsettings.xml":

-

void write_app_settings_doc( )  
-{  
-	TiXmlDocument doc;  
-	TiXmlElement* msg;
- 	TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" );  
-	doc.LinkEndChild( decl );  
- 
-	TiXmlElement * root = new TiXmlElement( "MyApp" );  
-	doc.LinkEndChild( root );  
-
-	TiXmlComment * comment = new TiXmlComment();
-	comment->SetValue(" Settings for MyApp " );  
-	root->LinkEndChild( comment );  
- 
-	TiXmlElement * msgs = new TiXmlElement( "Messages" );  
-	root->LinkEndChild( msgs );  
- 
-	msg = new TiXmlElement( "Welcome" );  
-	msg->LinkEndChild( new TiXmlText( "Welcome to MyApp" ));  
-	msgs->LinkEndChild( msg );  
- 
-	msg = new TiXmlElement( "Farewell" );  
-	msg->LinkEndChild( new TiXmlText( "Thank you for using MyApp" ));  
-	msgs->LinkEndChild( msg );  
- 
-	TiXmlElement * windows = new TiXmlElement( "Windows" );  
-	root->LinkEndChild( windows );  
-
-	TiXmlElement * window;
-	window = new TiXmlElement( "Window" );  
-	windows->LinkEndChild( window );  
-	window->SetAttribute("name", "MainFrame");
-	window->SetAttribute("x", 5);
-	window->SetAttribute("y", 15);
-	window->SetAttribute("w", 400);
-	window->SetAttribute("h", 250);
-
-	TiXmlElement * cxn = new TiXmlElement( "Connection" );  
-	root->LinkEndChild( cxn );  
-	cxn->SetAttribute("ip", "192.168.0.1");
-	cxn->SetDoubleAttribute("timeout", 123.456); // floating point attrib
-	
-	dump_to_stdout( &doc );
-	doc.SaveFile( "appsettings.xml" );  
-} 
-

-The dump_to_stdout function will show this structure:

-

Document
-+ Declaration
-+ Element [MyApp]
- (No attributes)
-  + Comment: [ Settings for MyApp ]
-  + Element [Messages]
- (No attributes)
-    + Element [Welcome]
- (No attributes)
-      + Text: [Welcome to MyApp]
-    + Element [Farewell]
- (No attributes)
-      + Text: [Thank you for using MyApp]
-  + Element [Windows]
- (No attributes)
-    + Element [Window]
-      + name: value=[MainFrame]
-      + x: value=[5] int=5 d=5.0
-      + y: value=[15] int=15 d=15.0
-      + w: value=[400] int=400 d=400.0
-      + h: value=[250] int=250 d=250.0
-      5 attributes
-  + Element [Connection]
-    + ip: value=[192.168.0.1] int=192 d=192.2
-    + timeout: value=[123.456000] int=123 d=123.5
-    2 attributes
-

-I was surprised that TinyXml, by default, writes the XML in what other APIs call a "pretty" format - it modifies the whitespace of text of elements that contain other nodes so that writing the tree includes an indication of nesting level.

-I haven't looked yet to see if there is a way to turn off indenting when writing a file - its bound to be easy.

-[Lee: It's easy in STL mode, just use cout << myDoc. Non-STL mode is always in "pretty" format. Adding a switch would be a nice feature and has been requested.]

-

XML to/from C++ objects

-

-

Intro

-

-This example assumes you're loading and saving your app settings in an XML file, e.g. something like example4.xml.

-There are a number of ways to do this. For example, look into the TinyBind project at http://sourceforge.net/projects/tinybind

-This section shows a plain-old approach to loading and saving a basic object structure using XML.

-

Set up your object classes

-

-Start off with some basic classes like these:

-

#include <string>
-#include <map>
-using namespace std;
-
-typedef std::map<std::string,std::string> MessageMap;
-
-// a basic window abstraction - demo purposes only
-class WindowSettings
-{
-public:
-	int x,y,w,h;
-	string name;
-
-	WindowSettings()
-		: x(0), y(0), w(100), h(100), name("Untitled")
-	{
-	}
-
-	WindowSettings(int x, int y, int w, int h, const string& name)
-	{
-		this->x=x;
-		this->y=y;
-		this->w=w;
-		this->h=h;
-		this->name=name;
-	}
-};
-
-class ConnectionSettings
-{
-public:
-	string ip;
-	double timeout;
-};
-
-class AppSettings
-{
-public:
-	string m_name;
-	MessageMap m_messages;
-	list<WindowSettings> m_windows;
-	ConnectionSettings m_connection;
-
-	AppSettings() {}
-
-	void save(const char* pFilename);
-	void load(const char* pFilename);
-	
-	// just to show how to do it
-	void setDemoValues()
-	{
-		m_name="MyApp";
-		m_messages.clear();
-		m_messages["Welcome"]="Welcome to "+m_name;
-		m_messages["Farewell"]="Thank you for using "+m_name;
-		m_windows.clear();
-		m_windows.push_back(WindowSettings(15,15,400,250,"Main"));
-		m_connection.ip="Unknown";
-		m_connection.timeout=123.456;
-	}
-};
-

-This is a basic main() that shows how to create a default settings object tree, save it and load it again:

-

int main(void)
-{
-	AppSettings settings;
-	
-	settings.save("appsettings2.xml");
-	settings.load("appsettings2.xml");
-	return 0;
-}
-

-The following main() shows creation, modification, saving and then loading of a settings structure:

-

int main(void)
-{
-	// block: customise and save settings
-	{
-		AppSettings settings;
-		settings.m_name="HitchHikerApp";
-		settings.m_messages["Welcome"]="Don't Panic";
-		settings.m_messages["Farewell"]="Thanks for all the fish";
-		settings.m_windows.push_back(WindowSettings(15,25,300,250,"BookFrame"));
-		settings.m_connection.ip="192.168.0.77";
-		settings.m_connection.timeout=42.0;
-
-		settings.save("appsettings2.xml");
-	}
-	
-	// block: load settings
-	{
-		AppSettings settings;
-		settings.load("appsettings2.xml");
-		printf("%s: %s\n", settings.m_name.c_str(), 
-			settings.m_messages["Welcome"].c_str());
-		WindowSettings & w=settings.m_windows.front();
-		printf("%s: Show window '%s' at %d,%d (%d x %d)\n", 
-			settings.m_name.c_str(), w.name.c_str(), w.x, w.y, w.w, w.h);
-		printf("%s: %s\n", settings.m_name.c_str(), settings.m_messages["Farewell"].c_str());
-	}
-	return 0;
-}
-

-When the save() and load() are completed (see below), running this main() displays on the console:

-

HitchHikerApp: Don't Panic
-HitchHikerApp: Show window 'BookFrame' at 15,25 (300 x 100)
-HitchHikerApp: Thanks for all the fish
-

-

Encode C++ state as XML

-

-There are lots of different ways to approach saving this to a file. Here's one:

-

void AppSettings::save(const char* pFilename)
-{
-	TiXmlDocument doc;  
-	TiXmlElement* msg;
-	TiXmlComment * comment;
-	string s;
- 	TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" );  
-	doc.LinkEndChild( decl ); 
- 
-	TiXmlElement * root = new TiXmlElement(m_name.c_str());  
-	doc.LinkEndChild( root );  
-
-	comment = new TiXmlComment();
-	s=" Settings for "+m_name+" ";
-	comment->SetValue(s.c_str());  
-	root->LinkEndChild( comment );  
-
-	// block: messages
-	{
-		MessageMap::iterator iter;
-
-		TiXmlElement * msgs = new TiXmlElement( "Messages" );  
-		root->LinkEndChild( msgs );  
- 
-		for (iter=m_messages.begin(); iter != m_messages.end(); iter++)
-		{
-			const string & key=(*iter).first;
-			const string & value=(*iter).second;
-			msg = new TiXmlElement(key.c_str());  
-			msg->LinkEndChild( new TiXmlText(value.c_str()));  
-			msgs->LinkEndChild( msg );  
-		}
-	}
-
-	// block: windows
-	{
-		TiXmlElement * windowsNode = new TiXmlElement( "Windows" );  
-		root->LinkEndChild( windowsNode );  
-
-		list<WindowSettings>::iterator iter;
-
-		for (iter=m_windows.begin(); iter != m_windows.end(); iter++)
-		{
-			const WindowSettings& w=*iter;
-
-			TiXmlElement * window;
-			window = new TiXmlElement( "Window" );  
-			windowsNode->LinkEndChild( window );  
-			window->SetAttribute("name", w.name.c_str());
-			window->SetAttribute("x", w.x);
-			window->SetAttribute("y", w.y);
-			window->SetAttribute("w", w.w);
-			window->SetAttribute("h", w.h);
-		}
-	}
-
-	// block: connection
-	{
-		TiXmlElement * cxn = new TiXmlElement( "Connection" );  
-		root->LinkEndChild( cxn );  
-		cxn->SetAttribute("ip", m_connection.ip.c_str());
-		cxn->SetDoubleAttribute("timeout", m_connection.timeout); 
-	}
-
-	doc.SaveFile(pFilename);  
-}
-

-Running this with the modified main produces this file:

-

<?xml version="1.0" ?>
-<HitchHikerApp>
-    <!-- Settings for HitchHikerApp -->
-    <Messages>
-        <Farewell>Thanks for all the fish</Farewell>
-        <Welcome>Don&apos;t Panic</Welcome>
-    </Messages>
-    <Windows>
-        <Window name="BookFrame" x="15" y="25" w="300" h="250" />
-    </Windows>
-    <Connection ip="192.168.0.77" timeout="42.000000" />
-</HitchHikerApp>
-

-

Decoding state from XML

-

-As with encoding objects, there are a number of approaches to decoding XML into your own C++ object structure. The following approach uses TiXmlHandles.

-

void AppSettings::load(const char* pFilename)
-{
-	TiXmlDocument doc(pFilename);
-	if (!doc.LoadFile()) return;
-
-	TiXmlHandle hDoc(&doc);
-	TiXmlElement* pElem;
-	TiXmlHandle hRoot(0);
-
-	// block: name
-	{
-		pElem=hDoc.FirstChildElement().Element();
-		// should always have a valid root but handle gracefully if it does
-		if (!pElem) return;
-		m_name=pElem->Value();
-
-		// save this for later
-		hRoot=TiXmlHandle(pElem);
-	}
-
-	// block: string table
-	{
-		m_messages.clear(); // trash existing table
-
-		pElem=hRoot.FirstChild( "Messages" ).FirstChild().Element();
-		for( pElem; pElem; pElem=pElem->NextSiblingElement())
-		{
-			const char *pKey=pElem->Value();
-			const char *pText=pElem->GetText();
-			if (pKey && pText) 
-			{
-				m_messages[pKey]=pText;
-			}
-		}
-	}
-
-	// block: windows
-	{
-		m_windows.clear(); // trash existing list
-
-		TiXmlElement* pWindowNode=hRoot.FirstChild( "Windows" ).FirstChild().Element();
-		for( pWindowNode; pWindowNode; pWindowNode=pWindowNode->NextSiblingElement())
-		{
-			WindowSettings w;
-			const char *pName=pWindowNode->Attribute("name");
-			if (pName) w.name=pName;
-			
-			pWindowNode->QueryIntAttribute("x", &w.x); // If this fails, original value is left as-is
-			pWindowNode->QueryIntAttribute("y", &w.y);
-			pWindowNode->QueryIntAttribute("w", &w.w);
-			pWindowNode->QueryIntAttribute("hh", &w.h);
-
-			m_windows.push_back(w);
-		}
-	}
-
-	// block: connection
-	{
-		pElem=hRoot.FirstChild("Connection").Element();
-		if (pElem)
-		{
-			m_connection.ip=pElem->Attribute("ip");
-			pElem->QueryDoubleAttribute("timeout",&m_connection.timeout);
-		}
-	}
-}
-

-

Full listing for dump_to_stdout

-

-Below is a copy-and-paste demo program for loading arbitrary XML files and dumping the structure to STDOUT using the recursive traversal listed above.

-

// tutorial demo program
-#include "stdafx.h"
-#include "tinyxml.h"
-
-// ----------------------------------------------------------------------
-// STDOUT dump and indenting utility functions
-// ----------------------------------------------------------------------
-const unsigned int NUM_INDENTS_PER_SPACE=2;
-
-const char * getIndent( unsigned int numIndents )
-{
-	static const char * pINDENT="                                      + ";
-	static const unsigned int LENGTH=strlen( pINDENT );
-	unsigned int n=numIndents*NUM_INDENTS_PER_SPACE;
-	if ( n > LENGTH ) n = LENGTH;
-
-	return &pINDENT[ LENGTH-n ];
-}
-
-// same as getIndent but no "+" at the end
-const char * getIndentAlt( unsigned int numIndents )
-{
-	static const char * pINDENT="                                        ";
-	static const unsigned int LENGTH=strlen( pINDENT );
-	unsigned int n=numIndents*NUM_INDENTS_PER_SPACE;
-	if ( n > LENGTH ) n = LENGTH;
-
-	return &pINDENT[ LENGTH-n ];
-}
-
-int dump_attribs_to_stdout(TiXmlElement* pElement, unsigned int indent)
-{
-	if ( !pElement ) return 0;
-
-	TiXmlAttribute* pAttrib=pElement->FirstAttribute();
-	int i=0;
-	int ival;
-	double dval;
-	const char* pIndent=getIndent(indent);
-	printf("\n");
-	while (pAttrib)
-	{
-		printf( "%s%s: value=[%s]", pIndent, pAttrib->Name(), pAttrib->Value());
-
-		if (pAttrib->QueryIntValue(&ival)==TIXML_SUCCESS)    printf( " int=%d", ival);
-		if (pAttrib->QueryDoubleValue(&dval)==TIXML_SUCCESS) printf( " d=%1.1f", dval);
-		printf( "\n" );
-		i++;
-		pAttrib=pAttrib->Next();
-	}
-	return i;	
-}
-
-void dump_to_stdout( TiXmlNode* pParent, unsigned int indent = 0 )
-{
-	if ( !pParent ) return;
-
-	TiXmlNode* pChild;
-	TiXmlText* pText;
-	int t = pParent->Type();
-	printf( "%s", getIndent(indent));
-	int num;
-
-	switch ( t )
-	{
-	case TiXmlNode::DOCUMENT:
-		printf( "Document" );
-		break;
-
-	case TiXmlNode::ELEMENT:
-		printf( "Element [%s]", pParent->Value() );
-		num=dump_attribs_to_stdout(pParent->ToElement(), indent+1);
-		switch(num)
-		{
-			case 0:  printf( " (No attributes)"); break;
-			case 1:  printf( "%s1 attribute", getIndentAlt(indent)); break;
-			default: printf( "%s%d attributes", getIndentAlt(indent), num); break;
-		}
-		break;
-
-	case TiXmlNode::COMMENT:
-		printf( "Comment: [%s]", pParent->Value());
-		break;
-
-	case TiXmlNode::UNKNOWN:
-		printf( "Unknown" );
-		break;
-
-	case TiXmlNode::TEXT:
-		pText = pParent->ToText();
-		printf( "Text: [%s]", pText->Value() );
-		break;
-
-	case TiXmlNode::DECLARATION:
-		printf( "Declaration" );
-		break;
-	default:
-		break;
-	}
-	printf( "\n" );
-	for ( pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling()) 
-	{
-		dump_to_stdout( pChild, indent+1 );
-	}
-}
-
-// load the named file and dump its structure to STDOUT
-void dump_to_stdout(const char* pFilename)
-{
-	TiXmlDocument doc(pFilename);
-	bool loadOkay = doc.LoadFile();
-	if (loadOkay)
-	{
-		printf("\n%s:\n", pFilename);
-		dump_to_stdout( &doc ); // defined later in the tutorial
-	}
-	else
-	{
-		printf("Failed to load file \"%s\"\n", pFilename);
-	}
-}
-
-// ----------------------------------------------------------------------
-// main() for printing files named on the command line
-// ----------------------------------------------------------------------
-int main(int argc, char* argv[])
-{
-	for (int i=1; i<argc; i++)
-	{
-		dump_to_stdout(argv[i]);
-	}
-	return 0;
-}
-

-Run this from the command line or a DOS window, e.g.:

-

C:\dev\tinyxml> Debug\tinyxml_1.exe example1.xml
-
-example1.xml:
-Document
-+ Declaration
-+ Element [Hello]
- (No attributes)
-  + Text: [World]
-

- Authors and Changes

    -
  • -Written by Ellers, April, May, June 2005
  • -
  • -Minor edits and integration into doc system, Lee Thomason September 2005
  • -
  • -Updated by Ellers, October 2005
  • -
-
Generated on Sun May 6 15:41:23 2007 for TinyXml by  - -doxygen 1.4.7
- - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/ndTinyXmlGlue.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/ndTinyXmlGlue.cpp deleted file mode 100644 index d13289f562..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/ndTinyXmlGlue.cpp +++ /dev/null @@ -1,434 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndTinyXmlGlue.h" - -static char* FloatToString(char* const buffer, ndInt32 size, ndFloat32 value) -{ - snprintf(buffer, size_t(size), "%g", value); - char* ptr = buffer + strlen(buffer); - *ptr = ' '; - ptr++; - *ptr = 0; - return ptr; -} - -static void CleanWhiteSpace(const char* const value) -{ - size_t size = strlen(value) - 1; - if (value[size] == ' ') - { - char* ptr = (char*)value; - ptr[size] = 0; - } -} - -#if 0 - -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const char* const value) -{ - xmlSaveParam(rootNode, name, "string", value); -} - -//void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, ndInt32 count, const ndVector* const array) - -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndArray& array) -{ - char* const buffer = ndAlloca(char, array.GetCount() * 12 + 256); - char* ptr = buffer; - for (ndInt32 i = 0; i < array.GetCount(); ++i) - { - ptr = FloatToString(ptr, array[i]); - } - CleanWhiteSpace(buffer); - - nd::TiXmlElement* const node = new nd::TiXmlElement(name); - rootNode->LinkEndChild(node); - - node->SetAttribute("count", array.GetCount()); - node->SetAttribute("floatArray", buffer); -} - -#ifdef D_NEWTON_USE_DOUBLE -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndArray& array) -{ - char* const buffer = ndAlloca(char, array.GetCount() * 12 + 256); - char* ptr = buffer; - for (ndInt32 i = 0; i < array.GetCount(); ++i) - { - ptr = FloatToString(ptr, array[i]); - } - CleanWhiteSpace(buffer); - - nd::TiXmlElement* const node = new nd::TiXmlElement(name); - rootNode->LinkEndChild(node); - - node->SetAttribute("count", array.GetCount()); - node->SetAttribute("realArray", buffer); -} -#endif - - - -#ifdef D_NEWTON_USE_DOUBLE -void xmlGetFloatArray(const nd::TiXmlNode* const rootNode, const char* const name, ndArray& array) -{ - const nd::TiXmlElement* const element = (nd::TiXmlElement*) rootNode->FirstChild(name); - ndAssert(element); - ndInt32 count; - element->Attribute("count", &count); - array.Resize(count); - array.SetCount(count); - - const char* const data = element->Attribute("floatArray"); - - size_t start = 0; - for (ndInt32 i = 0; i < count; ++i) - { - char x[64]; - sscanf(&data[start], "%[^ ]", x); - start += strlen(x) + 1; - - ndFloat64 fx; - sscanf(x, "%lf", &fx); - array[i] = ndReal(fx); - } -} -#endif - -void xmlGetFloatArray(const nd::TiXmlNode* const rootNode, const char* const name, ndArray& array) -{ - const nd::TiXmlElement* const element = (nd::TiXmlElement*)rootNode->FirstChild(name); - ndAssert(element); - ndInt32 count; - element->Attribute("count", &count); - array.Resize(count); - array.SetCount(count); - - const char* const data = element->Attribute("floatArray"); - - size_t start = 0; - for (ndInt32 i = 0; i < count; ++i) - { - char x[64]; - sscanf(&data[start], "%[^ ]", x); - start += strlen(x) + 1; - - ndFloat64 fx; - sscanf(x, "%lf", &fx); - array[i] = ndFloat32(fx); - } -} - -const nd::TiXmlNode* xmlFind(const nd::TiXmlNode* const rootNode, const char* const name) -{ - //for (const nd::TiXmlElement* node = (nd::TiXmlElement*) rootNode->FirstChild(name); node; node = (nd::TiXmlElement*) node->NextSibling()) - //{ - // const char* const text = node->GetText(); - // if (!strcmp(text, name)) - // { - // return node; - // } - //} - return rootNode->FirstChild(name); -} - -#endif - - -static ndInt32 g_classId = 0; -void xmlResetClassId() -{ - g_classId = 0; -} - -nd::TiXmlElement* xmlCreateClassNode(nd::TiXmlElement* const parent, const char* const className, const char* const name) -{ - nd::TiXmlElement* const node = new nd::TiXmlElement(className); - parent->LinkEndChild(node); - node->SetAttribute("className", name); - node->SetAttribute("nodeId", g_classId); - g_classId++; - return node; -} - -static void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const char* const type, const char* const value) -{ - nd::TiXmlElement* const node = new nd::TiXmlElement(name); - rootNode->LinkEndChild(node); - CleanWhiteSpace(value); - node->SetAttribute(type, value); -} - -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const char* const value) -{ - xmlSaveParam(rootNode, name, "string", value); -} - -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndMatrix& value) -{ - nd::TiXmlElement* const node = new nd::TiXmlElement(name); - rootNode->LinkEndChild(node); - - ndVector euler1; - ndVector euler0 (value.CalcPitchYawRoll(euler1)); - euler0 = euler0.Scale(ndRadToDegree); - - xmlSaveParam(node, "posit", value.m_posit); - xmlSaveParam(node, "angles", euler0); -} - -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, ndInt32 value) -{ - char buffer[1024]; - snprintf(buffer, sizeof (buffer), "%d", value); - xmlSaveParam(rootNode, name, "int32", buffer); -} - -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, ndInt64 value) -{ - char buffer[1024]; - long long x = value; - snprintf(buffer, sizeof (buffer), "%llu", x); - xmlSaveParam(rootNode, name, "int64", buffer); -} - -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, ndFloat32 value) -{ - char buffer[1024]; - FloatToString(buffer, sizeof (buffer), value); - xmlSaveParam(rootNode, name, "float", buffer); -} - -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndVector& value) -{ - char buffer[1024]; - char* ptr0 = FloatToString(buffer, sizeof (buffer), value.m_x); - char* ptr1 = FloatToString(ptr0, sizeof (buffer) - 256, value.m_y); - FloatToString(ptr1, sizeof(buffer) - 256, value.m_z); - xmlSaveParam(rootNode, name, "float3", buffer); -} - -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndArray& array) -{ - char* const buffer = ndAlloca(char, array.GetCount() * 24 + 256); - char* ptr = buffer; - for (ndInt32 i = 0; i < array.GetCount(); ++i) - { - snprintf(ptr, 256, "%d ", array[i]); - ptr += strlen(ptr); - } - CleanWhiteSpace(buffer); - - nd::TiXmlElement* const node = new nd::TiXmlElement(name); - rootNode->LinkEndChild(node); - - node->SetAttribute("count", ndInt32(array.GetCount())); - node->SetAttribute("intArray", buffer); -} - -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndArray& array) -{ - char* const buffer = ndAlloca(char, array.GetCount() * 24 + 256); - char* ptr = buffer; - for (ndInt32 i = 0; i < array.GetCount(); ++i) - { - long long int value = array[i]; - snprintf(ptr, 256, "%lld ", value); - ptr += strlen(ptr); - } - CleanWhiteSpace(buffer); - - nd::TiXmlElement* const node = new nd::TiXmlElement(name); - rootNode->LinkEndChild(node); - - node->SetAttribute("count", ndInt32(array.GetCount())); - node->SetAttribute("int64Array", buffer); -} - -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndArray& array) -{ - char* const buffer = ndAlloca(char, array.GetCount() * 4 * 12 + 256); - char* ptr = buffer; - for (ndInt32 i = 0; i < array.GetCount(); ++i) - { - for (ndInt32 j = 0; j < 3; ++j) - { - ptr = FloatToString(ptr, 256, array[i][j]); - } - } - CleanWhiteSpace(buffer); - - nd::TiXmlElement* const node = new nd::TiXmlElement(name); - rootNode->LinkEndChild(node); - - node->SetAttribute("count", ndInt32(array.GetCount())); - node->SetAttribute("float3Array", buffer); -} - -ndInt32 xmlGetNodeId(const nd::TiXmlNode* const rootNode) -{ - ndInt32 id; - const nd::TiXmlElement* const element = (nd::TiXmlElement*)rootNode; - element->Attribute("nodeId", &id); - return id; -} - -ndInt32 xmlGetInt(const nd::TiXmlNode* const rootNode, const char* const name) -{ - const nd::TiXmlElement* const element = (nd::TiXmlElement*)rootNode->FirstChild(name); - ndAssert(element); - ndInt32 value; - element->Attribute("int32", &value); - return value; -} - -ndInt64 xmlGetInt64(const nd::TiXmlNode* const rootNode, const char* const name) -{ - const nd::TiXmlElement* const element = (nd::TiXmlElement*)rootNode->FirstChild(name); - ndAssert(element); - const char* const data = element->Attribute("int64"); - - long long int value; - sscanf(data, "%lld", &value); - return ndInt64(value); -} - -const char* xmlGetString(const nd::TiXmlNode* const rootNode, const char* const name) -{ - const nd::TiXmlElement* const element = (nd::TiXmlElement*)rootNode->FirstChild(name); - ndAssert(element); - return element->Attribute("string"); -} - -ndFloat32 xmlGetFloat(const nd::TiXmlNode* const rootNode, const char* const name) -{ - const nd::TiXmlElement* const element = (nd::TiXmlElement*)rootNode->FirstChild(name); - ndAssert(element); - ndFloat64 value; - element->Attribute("float", &value); - return ndFloat32(value); -} - -ndVector xmlGetVector3(const nd::TiXmlNode* const rootNode, const char* const name) -{ - const nd::TiXmlElement* const element = (nd::TiXmlElement*)rootNode->FirstChild(name); - ndAssert(element); - - const char* const positData = element->Attribute("float3"); - - ndFloat64 fx; - ndFloat64 fy; - ndFloat64 fz; - sscanf(positData, "%lf %lf %lf", &fx, &fy, &fz); - - ndVector posit(ndVector::m_zero); - posit.m_x = ndFloat32(fx); - posit.m_y = ndFloat32(fy); - posit.m_z = ndFloat32(fz); - return posit; -} - -ndMatrix xmlGetMatrix(const nd::TiXmlNode* const rootNode, const char* const name) -{ - const nd::TiXmlElement* const element = (nd::TiXmlElement*)rootNode->FirstChild(name); - ndAssert(element); - - ndVector posit(xmlGetVector3(element, "posit")); - ndVector euler(xmlGetVector3(element, "angles")); - ndMatrix matrix(ndPitchMatrix(euler.m_x * ndDegreeToRad) * ndYawMatrix(euler.m_y * ndDegreeToRad) * ndRollMatrix(euler.m_z * ndDegreeToRad)); - - matrix.m_posit = posit; - matrix.m_posit.m_w = ndFloat32(1.0f); - return matrix; -} - -void xmlGetInt64(const nd::TiXmlNode* const rootNode, const char* const name, ndArray& array) -{ - const nd::TiXmlElement* const element = (nd::TiXmlElement*)rootNode->FirstChild(name); - ndAssert(element); - ndInt32 count; - element->Attribute("count", &count); - array.Resize(count); - array.SetCount(count); - - const char* const data = element->Attribute("int64Array"); - - size_t start = 0; - ndVector point(ndVector::m_zero); - for (ndInt32 i = 0; i < count; ++i) - { - char x[64]; - sscanf(&data[start], "%[^ ]", x); - start += strlen(x) + 1; - - long long int fx; - sscanf(x, "%lld", &fx); - array[i] = ndInt64 (fx); - } -} - -void xmlGetFloatArray3(const nd::TiXmlNode* const rootNode, const char* const name, ndArray& array) -{ - const nd::TiXmlElement* const element = (nd::TiXmlElement*)rootNode->FirstChild(name); - ndAssert(element); - ndInt32 count; - element->Attribute("count", &count); - array.Resize(count); - array.SetCount(count); - - //const char* const data = element->Attribute("float4Array"); - const char* const data = element->Attribute("float3Array"); - - size_t start = 0; - ndVector point(ndVector::m_zero); - for (ndInt32 i = 0; i < count; ++i) - { - char x[64]; - char y[64]; - char z[64]; - //char w[64]; - //sscanf(&data[start], "%[^ ] %[^ ] %[^ ] %[^ ]", x, y, z, w); - //start += strlen(x) + strlen(y) + strlen(z) + strlen(w) + 4; - - sscanf(&data[start], "%[^ ] %[^ ] %[^ ]", x, y, z); - start += strlen(x) + strlen(y) + strlen(z) + 3; - - ndFloat64 fx; - ndFloat64 fy; - ndFloat64 fz; - //ndFloat64 fw; - - sscanf(x, "%lf", &fx); - sscanf(y, "%lf", &fy); - sscanf(z, "%lf", &fz); - //sscanf(w, "%lf", &fw); - - point.m_x = ndFloat32(fx); - point.m_y = ndFloat32(fy); - point.m_z = ndFloat32(fz); - //point.m_w = ndFloat32(fw); - point.m_w = ndFloat32(0.0f); - - array[i] = point; - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/ndTinyXmlGlue.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/ndTinyXmlGlue.h deleted file mode 100644 index eb25243bd0..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/ndTinyXmlGlue.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_TINYXML_GLUE_H__ -#define __ND_TINYXML_GLUE_H__ - -#include "ndArray.h" -#include "ndVector.h" -#include "ndMatrix.h" - -#include "tinyxml.h" - - -#if 0 -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const char* const value); -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndArray& array); - - - - -ndFloat32 xmlGetFloat(const nd::TiXmlNode* const rootNode, const char* const name); -ndVector xmlGetVector3(const nd::TiXmlNode* const rootNode, const char* const name); -ndMatrix xmlGetMatrix(const nd::TiXmlNode* const rootNode, const char* const name); -const char* xmlGetString(const nd::TiXmlNode* const rootNode, const char* const name); -void xmlGetFloatArray(const nd::TiXmlNode* const rootNode, const char* const name, ndArray& array); -void xmlGetFloatArray3(const nd::TiXmlNode* const rootNode, const char* const name, ndArray& array); - - -#ifdef D_NEWTON_USE_DOUBLE -void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndArray& array); -void xmlGetFloatArray(const nd::TiXmlNode* const rootNode, const char* const name, ndArray& array); -#endif - -const nd::TiXmlNode* xmlFind(const nd::TiXmlNode* const rootNode, const char* const name); - -#endif - -D_TINY_API void xmlResetClassId(); -D_TINY_API nd::TiXmlElement* xmlCreateClassNode(nd::TiXmlElement* const parent, const char* const className, const char* const name); - -D_TINY_API void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, ndInt32 value); -D_TINY_API void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, ndInt64 value); -D_TINY_API void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, ndFloat32 value); -D_TINY_API void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndVector& value); -D_TINY_API void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndMatrix& value); -D_TINY_API void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndArray& array); -D_TINY_API void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndArray& array); -D_TINY_API void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const ndArray& array); -//D_TINY_API void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const char* const type, const char* const value); -D_TINY_API void xmlSaveParam(nd::TiXmlElement* const rootNode, const char* const name, const char* const value); - -D_TINY_API ndInt32 xmlGetNodeId(const nd::TiXmlNode* const rootNode); -D_TINY_API ndInt32 xmlGetInt(const nd::TiXmlNode* const rootNode, const char* const name); -D_TINY_API ndInt64 xmlGetInt64(const nd::TiXmlNode* const rootNode, const char* const name); -D_TINY_API ndMatrix xmlGetMatrix(const nd::TiXmlNode* const rootNode, const char* const name); -D_TINY_API ndFloat32 xmlGetFloat(const nd::TiXmlNode* const rootNode, const char* const name); -D_TINY_API ndVector xmlGetVector3(const nd::TiXmlNode* const rootNode, const char* const name); -D_TINY_API const char* xmlGetString(const nd::TiXmlNode* const rootNode, const char* const name); - -D_TINY_API void xmlGetInt64(const nd::TiXmlNode* const rootNode, const char* const name, ndArray& array); -D_TINY_API void xmlGetFloatArray3(const nd::TiXmlNode* const rootNode, const char* const name, ndArray& array); - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinystr.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinystr.cpp deleted file mode 100644 index 3a2c3834e8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinystr.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original file by Yves Berquin. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -/* - * THIS FILE WAS ALTERED BY Tyge Løvset, 7. April 2005. - */ - -#include "ndCoreStdafx.h" -#include "ndMemory.h" - -#ifndef TIXML_USE_STL - -#include "tinystr.h" -#include - - -namespace nd -{ - //xmlFree __free__ = free; - //xmlAlloc __alloc__ = malloc; - - // Error value for find primitive - const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1); - - - // Null rep. - TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } }; - - static void* __alloc__(size_t size) - { - return ndMemory::Malloc(size); - } - - static void __free__(void* const ptr) - { - return ndMemory::Free(ptr); - } - - void *TiXmlString::operator new (size_t size) - { - return __alloc__(size); - } - - void *TiXmlString::operator new[](size_t size) - { - return __alloc__(size); - } - - void TiXmlString::operator delete (void* ptr) - { - __free__(ptr); - } - - void TiXmlString::operator delete[](void* ptr) - { - __free__(ptr); - } - - void* TiXmlString::Malloc(size_type size) - { - return __alloc__(size); - } - - void TiXmlString::Free(void* ptr) - { - __free__(ptr); - } - - void TiXmlString::reserve (size_type cap) - { - if (cap > capacity()) - { - TiXmlString tmp; - tmp.init(length(), cap); - memcpy(tmp.start(), data(), length()); - swap(tmp); - } - } - - - TiXmlString& TiXmlString::assign(const char* str, size_type len) - { - size_type cap = capacity(); - if (len > cap || cap > 3*(len + 8)) - { - TiXmlString tmp; - tmp.init(len); - memcpy(tmp.start(), str, len); - swap(tmp); - } - else - { - memmove(start(), str, len); - set_size(len); - } - return *this; - } - - - TiXmlString& TiXmlString::append(const char* str, size_type len) - { - size_type newsize = length() + len; - if (newsize > capacity()) - { - reserve (newsize + capacity()); - } - memmove(finish(), str, len); - set_size(newsize); - return *this; - } - - - TiXmlString operator + (const TiXmlString & a, const TiXmlString & b) - { - TiXmlString tmp; - tmp.reserve(a.length() + b.length()); - tmp += a; - tmp += b; - return tmp; - } - - TiXmlString operator + (const TiXmlString & a, const char* b) - { - TiXmlString tmp; - TiXmlString::size_type b_len = static_cast( strlen(b) ); - tmp.reserve(a.length() + b_len); - tmp += a; - tmp.append(b, b_len); - return tmp; - } - - TiXmlString operator + (const char* a, const TiXmlString & b) - { - TiXmlString tmp; - TiXmlString::size_type a_len = static_cast( strlen(a) ); - tmp.reserve(a_len + b.length()); - tmp.append(a, a_len); - tmp += b; - return tmp; - } -} // end nd namespace -#endif // TIXML_USE_STL diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinystr.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinystr.h deleted file mode 100644 index 30048f669d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinystr.h +++ /dev/null @@ -1,357 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original file by Yves Berquin. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -/* - * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005. - * - * - completely rewritten. compact, clean, and fast implementation. - * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems) - * - fixed reserve() to work as per specification. - * - fixed buggy compares operator==(), operator<(), and operator>() - * - fixed operator+=() to take a const ref argument, following spec. - * - added "copy" constructor with length, and most compare operators. - * - added swap(), clear(), size(), capacity(), operator+(). - */ - -#ifndef TIXML_USE_STL - -#ifndef TIXML_STRING_INCLUDED -#define TIXML_STRING_INCLUDED - -#include -#include - -typedef void (*xmlFree) (void*); -typedef void* (*xmlAlloc) (size_t size); - -#if defined(_MSC_VER) - #define _D_TINYXML_EXPORT __declspec(dllexport) - #define _D_TINYXML_IMPORT __declspec(dllimport) -#else - #define _D_TINYXML_EXPORT __attribute__((visibility("default"))) - #define _D_TINYXML_IMPORT __attribute__((visibility("default"))) -#endif - -#ifdef _D_TINY_DLL - #ifdef _D_TINYXML_EXPORT_DLL - #define D_TINY_API _D_TINYXML_EXPORT - #else - #define D_TINY_API _D_TINYXML_IMPORT - #endif -#else - #define D_TINY_API -#endif - -/* The support for explicit isn't that universal, and it isn't really - required - it is used to check that the TiXmlString class isn't incorrectly - used. Be nice to old compilers and macro it here: -*/ -//#if defined(_MSC_VER) && (_MSC_VER >= 1200 ) -// // Microsoft visual studio, version 6 and higher. -// #define TIXML_EXPLICIT explicit -//#elif defined(__GNUC__) && (__GNUC__ >= 3 ) -// // GCC version 3 and higher.s -// #define TIXML_EXPLICIT explicit -//#else -// #define TIXML_EXPLICIT -//#endif -#define TIXML_EXPLICIT - -namespace nd -{ - //extern D_TINY_API xmlFree __free__; - //extern D_TINY_API xmlAlloc __alloc__; - -/* - TiXmlString is an emulation of a subset of the std::string template. - Its purpose is to allow compiling TinyXML on compilers with no or poor STL support. - Only the member functions relevant to the TinyXML project have been implemented. - The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase - a string and there's no more room, we allocate a buffer twice as big as we need. -*/ -class D_TINY_API TiXmlString -{ - public : - // The size type used - typedef size_t size_type; - - // Error value for find primitive - static const size_type npos; // = -1; - - - // TiXmlString empty constructor - TiXmlString () : rep_(&nullrep_) - { - } - - // TiXmlString copy constructor - TiXmlString ( const TiXmlString & copy) : rep_(0) - { - init(copy.length()); - memcpy(start(), copy.data(), length()); - } - - // TiXmlString constructor, based on a string - TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0) - { - init( static_cast( strlen(copy) )); - memcpy(start(), copy, length()); - } - - // TiXmlString constructor, based on a string - TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0) - { - init(len); - memcpy(start(), str, len); - } - - // TiXmlString destructor - ~TiXmlString () - { - quit(); - } - - void *operator new (size_t size); - void *operator new[](size_t size); - void operator delete (void* ptr); - void operator delete[](void* ptr); - - // = operator - TiXmlString& operator = (const char * copy) - { - return assign( copy, (size_type)strlen(copy)); - } - - // = operator - TiXmlString& operator = (const TiXmlString & copy) - { - return assign(copy.start(), copy.length()); - } - - - // += operator. Maps to append - TiXmlString& operator += (const char * suffix) - { - return append(suffix, static_cast( strlen(suffix) )); - } - - // += operator. Maps to append - TiXmlString& operator += (char single) - { - return append(&single, 1); - } - - // += operator. Maps to append - TiXmlString& operator += (const TiXmlString & suffix) - { - return append(suffix.data(), suffix.length()); - } - - - // Convert a TiXmlString into a null-terminated char * - const char * c_str () const { return rep_->str; } - - // Convert a TiXmlString into a char * (need not be null terminated). - const char * data () const { return rep_->str; } - - // Return the length of a TiXmlString - size_type length () const { return rep_->size; } - - // Alias for length() - size_type size () const { return rep_->size; } - - // Checks if a TiXmlString is empty - bool empty () const { return rep_->size == 0; } - - // Return capacity of string - size_type capacity () const { return rep_->capacity; } - - - // single char extraction - const char& at (size_type index) const - { - assert( index < length() ); - return rep_->str[ index ]; - } - - // [] operator - char& operator [] (size_type index) const - { - assert( index < length() ); - return rep_->str[ index ]; - } - - // find a char in a string. Return TiXmlString::npos if not found - size_type find (char lookup) const - { - return find(lookup, 0); - } - - // find a char in a string from an offset. Return TiXmlString::npos if not found - size_type find (char tofind, size_type offset) const - { - if (offset >= length()) return npos; - - for (const char* p = c_str() + offset; *p != '\0'; ++p) - { - if (*p == tofind) return static_cast< size_type >( p - c_str() ); - } - return npos; - } - - void clear () - { - //Lee: - //The original was just too strange, though correct: - // TiXmlString().swap(*this); - //Instead use the quit & re-init: - quit(); - init(0,0); - } - - /* Function to reserve a big amount of data when we know we'll need it. Be aware that this - function DOES NOT clear the content of the TiXmlString if any exists. - */ - void reserve (size_type cap); - - TiXmlString& assign (const char* str, size_type len); - - TiXmlString& append (const char* str, size_type len); - - void swap (TiXmlString& other) - { - Rep* r = rep_; - rep_ = other.rep_; - other.rep_ = r; - } - - private: - - void init(size_type sz) { init(sz, sz); } - void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; } - char* start() const { return rep_->str; } - char* finish() const { return rep_->str + rep_->size; } - - struct Rep - { - size_type size, capacity; - char str[1]; - }; - - void* Malloc(size_type size); - void Free(void* ptr); - - void init(size_type sz, size_type cap) - { - if (cap) - { - // Lee: the original form: - // rep_ = static_cast(operator new(sizeof(Rep) + cap)); - // doesn't work in some cases of new being overloaded. Switching - // to the normal allocation, although use an 'int' for systems - // that are overly picky about structure alignment. - const size_type bytesNeeded = sizeof(Rep) + cap; - const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int ); - //rep_ = reinterpret_cast( new int[ intsNeeded ] ); - rep_ = reinterpret_cast(Malloc(intsNeeded * sizeof (int))); - - rep_->str[ rep_->size = sz ] = '\0'; - rep_->capacity = cap; - } - else - { - rep_ = &nullrep_; - } - } - - void quit() - { - if (rep_ != &nullrep_) - { - // The rep_ is really an array of ints. (see the allocator, above). - // Cast it back before delete, so the compiler won't incorrectly call destructors. - //delete [] ( reinterpret_cast( rep_ ) ); - Free(rep_); - } - } - - Rep * rep_; - static Rep nullrep_; - -} ; - - -inline bool operator == (const TiXmlString & a, const TiXmlString & b) -{ - return ( a.length() == b.length() ) // optimization on some platforms - && ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare -} -inline bool operator < (const TiXmlString & a, const TiXmlString & b) -{ - return strcmp(a.c_str(), b.c_str()) < 0; -} - -inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); } -inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; } -inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); } -inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); } - -inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; } -inline bool operator == (const char* a, const TiXmlString & b) { return b == a; } -inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); } -inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); } - -TiXmlString operator + (const TiXmlString & a, const TiXmlString & b); -TiXmlString operator + (const TiXmlString & a, const char* b); -TiXmlString operator + (const char* a, const TiXmlString & b); - - -/* - TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString. - Only the operators that we need for TinyXML have been developped. -*/ -class TiXmlOutStream : public TiXmlString -{ -public : - - // TiXmlOutStream << operator. - TiXmlOutStream & operator << (const TiXmlString & in) - { - *this += in; - return *this; - } - - // TiXmlOutStream << operator. - TiXmlOutStream & operator << (const char * in) - { - *this += in; - return *this; - } - -} ; - -} // end nd namespace - -#endif // TIXML_STRING_INCLUDED -#endif // TIXML_USE_STL diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinyxml.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinyxml.cpp deleted file mode 100644 index 88d28fa0c2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinyxml.cpp +++ /dev/null @@ -1,1995 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndMemory.h" -#include - -#ifdef TIXML_USE_STL -#include -#include -#endif - -#include "tinyxml.h" - -namespace nd -{ - - //void SetXmlMemoryFunctions(xmlAlloc allocMemory, xmlFree freeMemory) - //{ - // __alloc__ = allocMemory; - // __free__ = freeMemory; - //} - - static void* __alloc__(size_t size) - { - return ndMemory::Malloc(size); - } - - static void __free__(void* const ptr) - { - return ndMemory::Free(ptr); - } - - void *TiXmlVisitor::operator new (size_t size) - { - return __alloc__(size); - } - - void *TiXmlVisitor::operator new[](size_t size) - { - return __alloc__(size); - } - - void TiXmlVisitor::operator delete (void* ptr) - { - __free__(ptr); - } - - void TiXmlVisitor::operator delete[](void* ptr) - { - __free__(ptr); - } - - void *TiXmlAttributeSet::operator new (size_t size) - { - return __alloc__(size); - } - - void *TiXmlAttributeSet::operator new[](size_t size) - { - return __alloc__(size); - } - - void TiXmlAttributeSet::operator delete (void* ptr) - { - __free__(ptr); - } - - void TiXmlAttributeSet::operator delete[](void* ptr) - { - __free__(ptr); - } - - void *TiXmlBase::operator new (size_t size) - { - return __alloc__(size); - } - - void *TiXmlBase::operator new[](size_t size) - { - return __alloc__(size); - } - - void TiXmlBase::operator delete (void* ptr) - { - __free__(ptr); - } - - void TiXmlBase::operator delete[](void* ptr) - { - __free__(ptr); - } - - void *TiXmlHandle::operator new (size_t size) - { - return __alloc__(size); - } - - void *TiXmlHandle::operator new[](size_t size) - { - return __alloc__(size); - } - - void TiXmlHandle::operator delete (void* ptr) - { - __free__(ptr); - } - - void TiXmlHandle::operator delete[](void* ptr) - { - __free__(ptr); - } - - bool TiXmlBase::condenseWhiteSpace = true; - - // Microsoft compiler security - FILE* TiXmlFOpen( const char* filename, const char* mode ) - { - #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) - FILE* fp = 0; - errno_t err = fopen_s( &fp, filename, mode ); - if ( !err && fp ) - return fp; - return 0; - #else - return fopen( filename, mode ); - #endif - } - - void TiXmlBase::EncodeString( const TIXML_STRING& str, TIXML_STRING* outString ) - { - size_t i=0; - - while( iappend( str.c_str() + i, 1 ); - ++i; - if ( str[i] == ';' ) - break; - } - } - else if ( c == '&' ) - { - outString->append( entity[0].str, entity[0].strLength ); - ++i; - } - else if ( c == '<' ) - { - outString->append( entity[1].str, entity[1].strLength ); - ++i; - } - else if ( c == '>' ) - { - outString->append( entity[2].str, entity[2].strLength ); - ++i; - } - else if ( c == '\"' ) - { - outString->append( entity[3].str, entity[3].strLength ); - ++i; - } - else if ( c == '\'' ) - { - outString->append( entity[4].str, entity[4].strLength ); - ++i; - } - else if ( c < 32 ) - { - // Easy pass at non-alpha/numeric/symbol - // Below 32 is symbolic. - char buf[ 32 ]; - - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) ); - #else - sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) ); - #endif - - //*ME: warning C4267: convert 'size_t' to 'int' - //*ME: Int-Cast to make compiler happy ... - outString->append( buf, strlen( buf ) ); - ++i; - } - else - { - //char realc = (char) c; - //outString->append( &realc, 1 ); - *outString += (char) c; // somewhat more efficient function call. - ++i; - } - } - } - - - TiXmlNode::TiXmlNode( NodeType _type ) : TiXmlBase() - { - parent = 0; - type = _type; - firstChild = 0; - lastChild = 0; - prev = 0; - next = 0; - } - - - TiXmlNode::~TiXmlNode() - { - TiXmlNode* node = firstChild; - TiXmlNode* temp = 0; - - while ( node ) - { - temp = node; - node = node->next; - delete temp; - } - } - - - void TiXmlNode::CopyTo( TiXmlNode* target ) const - { - target->SetValue (value.c_str() ); - target->userData = userData; - } - - - void TiXmlNode::Clear() - { - TiXmlNode* node = firstChild; - TiXmlNode* temp = 0; - - while ( node ) - { - temp = node; - node = node->next; - delete temp; - } - - firstChild = 0; - lastChild = 0; - } - - - TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node ) - { - assert( node->parent == 0 || node->parent == this ); - assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() ); - - if ( node->Type() == TiXmlNode::DOCUMENT ) - { - delete node; - if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - node->parent = this; - - node->prev = lastChild; - node->next = 0; - - if ( lastChild ) - lastChild->next = node; - else - firstChild = node; // it was an empty list. - - lastChild = node; - return node; - } - - - TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis ) - { - if ( addThis.Type() == TiXmlNode::DOCUMENT ) - { - if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - TiXmlNode* node = addThis.Clone(); - if ( !node ) - return 0; - - return LinkEndChild( node ); - } - - - TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ) - { - if ( !beforeThis || beforeThis->parent != this ) { - return 0; - } - if ( addThis.Type() == TiXmlNode::DOCUMENT ) - { - if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - TiXmlNode* node = addThis.Clone(); - if ( !node ) - return 0; - node->parent = this; - - node->next = beforeThis; - node->prev = beforeThis->prev; - if ( beforeThis->prev ) - { - beforeThis->prev->next = node; - } - else - { - assert( firstChild == beforeThis ); - firstChild = node; - } - beforeThis->prev = node; - return node; - } - - - TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ) - { - if ( !afterThis || afterThis->parent != this ) { - return 0; - } - if ( addThis.Type() == TiXmlNode::DOCUMENT ) - { - if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - TiXmlNode* node = addThis.Clone(); - if ( !node ) - return 0; - node->parent = this; - - node->prev = afterThis; - node->next = afterThis->next; - if ( afterThis->next ) - { - afterThis->next->prev = node; - } - else - { - assert( lastChild == afterThis ); - lastChild = node; - } - afterThis->next = node; - return node; - } - - - TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ) - { - if ( replaceThis->parent != this ) - return 0; - - TiXmlNode* node = withThis.Clone(); - if ( !node ) - return 0; - - node->next = replaceThis->next; - node->prev = replaceThis->prev; - - if ( replaceThis->next ) - replaceThis->next->prev = node; - else - lastChild = node; - - if ( replaceThis->prev ) - replaceThis->prev->next = node; - else - firstChild = node; - - delete replaceThis; - node->parent = this; - return node; - } - - - bool TiXmlNode::RemoveChild( TiXmlNode* removeThis ) - { - if ( removeThis->parent != this ) - { - assert( 0 ); - return false; - } - - if ( removeThis->next ) - removeThis->next->prev = removeThis->prev; - else - lastChild = removeThis->prev; - - if ( removeThis->prev ) - removeThis->prev->next = removeThis->next; - else - firstChild = removeThis->next; - - delete removeThis; - return true; - } - - const TiXmlNode* TiXmlNode::FirstChild( const char * _value ) const - { - const TiXmlNode* node; - for ( node = firstChild; node; node = node->next ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; - } - - - const TiXmlNode* TiXmlNode::LastChild( const char * _value ) const - { - const TiXmlNode* node; - for ( node = lastChild; node; node = node->prev ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; - } - - - const TiXmlNode* TiXmlNode::IterateChildren( const TiXmlNode* previous ) const - { - if ( !previous ) - { - return FirstChild(); - } - else - { - assert( previous->parent == this ); - return previous->NextSibling(); - } - } - - - const TiXmlNode* TiXmlNode::IterateChildren( const char * val, const TiXmlNode* previous ) const - { - if ( !previous ) - { - return FirstChild( val ); - } - else - { - assert( previous->parent == this ); - return previous->NextSibling( val ); - } - } - - - const TiXmlNode* TiXmlNode::NextSibling( const char * _value ) const - { - const TiXmlNode* node; - for ( node = next; node; node = node->next ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; - } - - - const TiXmlNode* TiXmlNode::PreviousSibling( const char * _value ) const - { - const TiXmlNode* node; - for ( node = prev; node; node = node->prev ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; - } - - - void TiXmlElement::RemoveAttribute( const char * name ) - { - #ifdef TIXML_USE_STL - TIXML_STRING str( name ); - TiXmlAttribute* node = attributeSet.Find( str ); - #else - TiXmlAttribute* node = attributeSet.Find( name ); - #endif - if ( node ) - { - attributeSet.Remove( node ); - delete node; - } - } - - const TiXmlElement* TiXmlNode::FirstChildElement() const - { - const TiXmlNode* node; - - for ( node = FirstChild(); - node; - node = node->NextSibling() ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; - } - - - const TiXmlElement* TiXmlNode::FirstChildElement( const char * _value ) const - { - const TiXmlNode* node; - - for ( node = FirstChild( _value ); - node; - node = node->NextSibling( _value ) ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; - } - - - const TiXmlElement* TiXmlNode::NextSiblingElement() const - { - const TiXmlNode* node; - - for ( node = NextSibling(); - node; - node = node->NextSibling() ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; - } - - - const TiXmlElement* TiXmlNode::NextSiblingElement( const char * _value ) const - { - const TiXmlNode* node; - - for ( node = NextSibling( _value ); - node; - node = node->NextSibling( _value ) ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; - } - - - const TiXmlDocument* TiXmlNode::GetDocument() const - { - const TiXmlNode* node; - - for( node = this; node; node = node->parent ) - { - if ( node->ToDocument() ) - return node->ToDocument(); - } - return 0; - } - - - TiXmlElement::TiXmlElement (const char * _value) - : TiXmlNode( TiXmlNode::ELEMENT ) - { - firstChild = lastChild = 0; - value = _value; - } - - - #ifdef TIXML_USE_STL - TiXmlElement::TiXmlElement( const std::string& _value ) - : TiXmlNode( TiXmlNode::ELEMENT ) - { - firstChild = lastChild = 0; - value = _value; - } - #endif - - - TiXmlElement::TiXmlElement( const TiXmlElement& copy) - : TiXmlNode( TiXmlNode::ELEMENT ) - { - firstChild = lastChild = 0; - copy.CopyTo( this ); - } - - - void TiXmlElement::operator=( const TiXmlElement& base ) - { - ClearThis(); - base.CopyTo( this ); - } - - - TiXmlElement::~TiXmlElement() - { - ClearThis(); - } - - - void TiXmlElement::ClearThis() - { - Clear(); - while( attributeSet.First() ) - { - TiXmlAttribute* node = attributeSet.First(); - attributeSet.Remove( node ); - delete node; - } - } - - - const char* TiXmlElement::Attribute( const char* name ) const - { - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( node ) - return node->Value(); - return 0; - } - - - #ifdef TIXML_USE_STL - const std::string* TiXmlElement::Attribute( const std::string& name ) const - { - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( node ) - return &node->ValueStr(); - return 0; - } - #endif - - - const char* TiXmlElement::Attribute( const char* name, int* i ) const - { - const char* s = Attribute( name ); - if ( i ) - { - if ( s ) { - *i = atoi( s ); - } - else { - *i = 0; - } - } - return s; - } - - - #ifdef TIXML_USE_STL - const std::string* TiXmlElement::Attribute( const std::string& name, int* i ) const - { - const std::string* s = Attribute( name ); - if ( i ) - { - if ( s ) { - *i = atoi( s->c_str() ); - } - else { - *i = 0; - } - } - return s; - } - #endif - - - const char* TiXmlElement::Attribute( const char* name, double* d ) const - { - const char* s = Attribute( name ); - if ( d ) - { - if ( s ) { - *d = atof( s ); - } - else { - *d = 0; - } - } - return s; - } - - - #ifdef TIXML_USE_STL - const std::string* TiXmlElement::Attribute( const std::string& name, double* d ) const - { - const std::string* s = Attribute( name ); - if ( d ) - { - if ( s ) { - *d = atof( s->c_str() ); - } - else { - *d = 0; - } - } - return s; - } - #endif - - - int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const - { - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - return node->QueryIntValue( ival ); - } - - - #ifdef TIXML_USE_STL - int TiXmlElement::QueryIntAttribute( const std::string& name, int* ival ) const - { - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - return node->QueryIntValue( ival ); - } - #endif - - - int TiXmlElement::QueryDoubleAttribute( const char* name, double* dval ) const - { - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - return node->QueryDoubleValue( dval ); - } - - - #ifdef TIXML_USE_STL - int TiXmlElement::QueryDoubleAttribute( const std::string& name, double* dval ) const - { - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - return node->QueryDoubleValue( dval ); - } - #endif - - - void TiXmlElement::SetAttribute( const char * name, int val ) - { - char buf[64]; - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "%d", val ); - #else - sprintf( buf, "%d", val ); - #endif - SetAttribute( name, buf ); - } - - - #ifdef TIXML_USE_STL - void TiXmlElement::SetAttribute( const std::string& name, int val ) - { - std::ostringstream oss; - oss << val; - SetAttribute( name, oss.str() ); - } - #endif - - - void TiXmlElement::SetDoubleAttribute( const char * name, double val ) - { - char buf[256]; - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "%f", val ); - #else - sprintf( buf, "%f", val ); - #endif - SetAttribute( name, buf ); - } - - - void TiXmlElement::SetAttribute( const char * cname, const char * cvalue ) - { - #ifdef TIXML_USE_STL - TIXML_STRING _name( cname ); - TIXML_STRING _value( cvalue ); - #else - const char* _name = cname; - const char* _value = cvalue; - #endif - - TiXmlAttribute* node = attributeSet.Find( _name ); - if ( node ) - { - node->SetValue( _value ); - return; - } - - TiXmlAttribute* attrib = new TiXmlAttribute( cname, cvalue ); - if ( attrib ) - { - attributeSet.Add( attrib ); - } - else - { - TiXmlDocument* document = GetDocument(); - if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); - } - } - - - #ifdef TIXML_USE_STL - void TiXmlElement::SetAttribute( const std::string& name, const std::string& _value ) - { - TiXmlAttribute* node = attributeSet.Find( name ); - if ( node ) - { - node->SetValue( _value ); - return; - } - - TiXmlAttribute* attrib = new TiXmlAttribute( name, _value ); - if ( attrib ) - { - attributeSet.Add( attrib ); - } - else - { - TiXmlDocument* document = GetDocument(); - if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); - } - } - #endif - - - void TiXmlElement::Print( FILE* cfile, int depth ) const - { - int i; - assert( cfile ); - for ( i=0; iNext() ) - { - fprintf( cfile, " " ); - attrib->Print( cfile, depth ); - } - - // There are 3 different formatting approaches: - // 1) An element without children is printed as a node - // 2) An element with only a text child is printed as text - // 3) An element with children is printed on multiple lines. - TiXmlNode* node; - if ( !firstChild ) - { - fprintf( cfile, " />" ); - } - else if ( firstChild == lastChild && firstChild->ToText() ) - { - fprintf( cfile, ">" ); - firstChild->Print( cfile, depth + 1 ); - fprintf( cfile, "", value.c_str() ); - } - else - { - fprintf( cfile, ">" ); - - for ( node = firstChild; node; node=node->NextSibling() ) - { - if ( !node->ToText() ) - { - fprintf( cfile, "\n" ); - } - node->Print( cfile, depth+1 ); - } - fprintf( cfile, "\n" ); - for( i=0; i", value.c_str() ); - } - } - - - void TiXmlElement::CopyTo( TiXmlElement* target ) const - { - // superclass: - TiXmlNode::CopyTo( target ); - - // Element class: - // Clone the attributes, then clone the children. - const TiXmlAttribute* attribute = 0; - for( attribute = attributeSet.First(); - attribute; - attribute = attribute->Next() ) - { - target->SetAttribute( attribute->Name(), attribute->Value() ); - } - - TiXmlNode* node = 0; - for ( node = firstChild; node; node = node->NextSibling() ) - { - target->LinkEndChild( node->Clone() ); - } - } - - bool TiXmlElement::Accept( TiXmlVisitor* visitor ) const - { - if ( visitor->VisitEnter( *this, attributeSet.First() ) ) - { - for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) - { - if ( !node->Accept( visitor ) ) - break; - } - } - return visitor->VisitExit( *this ); - } - - - TiXmlNode* TiXmlElement::Clone() const - { - TiXmlElement* clone = new TiXmlElement( Value() ); - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; - } - - - const char* TiXmlElement::GetText() const - { - const TiXmlNode* child = this->FirstChild(); - if ( child ) { - const TiXmlText* childText = child->ToText(); - if ( childText ) { - return childText->Value(); - } - } - return 0; - } - - - TiXmlDocument::TiXmlDocument() : TiXmlNode( TiXmlNode::DOCUMENT ) - { - tabsize = 4; - useMicrosoftBOM = false; - ClearError(); - } - - TiXmlDocument::TiXmlDocument( const char * documentName ) : TiXmlNode( TiXmlNode::DOCUMENT ) - { - tabsize = 4; - useMicrosoftBOM = false; - value = documentName; - ClearError(); - } - - - #ifdef TIXML_USE_STL - TiXmlDocument::TiXmlDocument( const std::string& documentName ) : TiXmlNode( TiXmlNode::DOCUMENT ) - { - tabsize = 4; - useMicrosoftBOM = false; - value = documentName; - ClearError(); - } - #endif - - - TiXmlDocument::TiXmlDocument( const TiXmlDocument& copy ) : TiXmlNode( TiXmlNode::DOCUMENT ) - { - copy.CopyTo( this ); - } - - - void TiXmlDocument::operator=( const TiXmlDocument& copy ) - { - Clear(); - copy.CopyTo( this ); - } - - - bool TiXmlDocument::LoadFile( TiXmlEncoding encoding ) - { - // See STL_STRING_BUG below. - //StringToBuffer buf( value ); - - return LoadFile( Value(), encoding ); - } - - - bool TiXmlDocument::SaveFile() const - { - // See STL_STRING_BUG below. - // StringToBuffer buf( value ); - // - // if ( buf.buffer && SaveFile( buf.buffer ) ) - // return true; - // - // return false; - return SaveFile( Value() ); - } - - bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding ) - { - // There was a really terrifying little bug here. The code: - // value = filename - // in the STL case, cause the assignment method of the std::string to - // be called. What is strange, is that the std::string had the same - // address as it's c_str() method, and so bad things happen. Looks - // like a bug in the Microsoft STL implementation. - // Add an extra string to avoid the crash. - TIXML_STRING filename( _filename ); - value = filename; - - // reading in binary mode so that tinyxml can normalize the EOL - FILE* file = TiXmlFOpen( value.c_str (), "rb" ); - - if ( file ) - { - bool result = LoadFile( file, encoding ); - fclose( file ); - return result; - } - else - { - SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } - } - - bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding ) - { - if ( !file ) - { - SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } - - // Delete the existing data: - Clear(); - location.Clear(); - - // Get the file size, so we can pre-allocate the string. HUGE speed impact. - long length = 0; - fseek( file, 0, SEEK_END ); - length = ftell( file ); - fseek( file, 0, SEEK_SET ); - - // Strange case, but good to handle up front. - if ( length <= 0 ) - { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } - - // If we have a file, assume it is all one big XML file, and read it in. - // The document parser may decide the document ends sooner than the entire file, however. - TIXML_STRING data; - data.reserve(size_t(length) ); - - // Subtle bug here. TinyXml did use fgets. But from the XML spec: - // 2.11 End-of-Line Handling - // - // - // ...the XML processor MUST behave as if it normalized all line breaks in external - // parsed entities (including the document entity) on input, before parsing, by translating - // both the two-character sequence #xD #xA and any #xD that is not followed by #xA to - // a single #xA character. - // - // - // It is not clear fgets does that, and certainly isn't clear it works cross platform. - // Generally, you expect fgets to translate from the convention of the OS to the c/unix - // convention, and not work generally. - - /* - while( fgets( buf, sizeof(buf), file ) ) - { - data += buf; - } - */ - - //char* buf = new char[ length+1 ]; - //char* buf = (char*)dMemory::Malloc((length + 1) * sizeof (char)); - char* buf = (char*)__alloc__((length + 1) * sizeof(char)); - buf[0] = 0; - - if ( fread( buf, size_t(length), 1, file ) != 1 ) { - //delete [] buf; - //dMemory::Free(buf); - __free__(buf); - SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } - - const char* lastPos = buf; - const char* p = buf; - - buf[length] = 0; - while( *p ) { - assert( p < (buf+length) ); - if ( *p == 0xa ) { - // Newline character. No special rules for this. Append all the characters - // since the last string, and include the newline. - data.append( lastPos, size_t(p-lastPos+1) ); // append, include the newline - ++p; // move past the newline - lastPos = p; // and point to the new buffer (may be 0) - assert( p <= (buf+length) ); - } - else if ( *p == 0xd ) { - // Carriage return. Append what we have so far, then - // handle moving forward in the buffer. - if ( (p-lastPos) > 0 ) { - data.append( lastPos, size_t(p-lastPos) ); // do not add the CR - } - data += (char)0xa; // a proper newline - - if ( *(p+1) == 0xa ) { - // Carriage return - new line sequence - p += 2; - lastPos = p; - assert( p <= (buf+length) ); - } - else { - // it was followed by something else...that is presumably characters again. - ++p; - lastPos = p; - assert( p <= (buf+length) ); - } - } - else { - ++p; - } - } - // Handle any left over characters. - if ( p-lastPos ) { - data.append( lastPos, size_t(p-lastPos) ); - } - //delete [] buf; - //dMemory::Free(buf); - __free__(buf); - buf = 0; - - Parse( data.c_str(), 0, encoding ); - - if ( Error() ) - return false; - else - return true; - } - - - bool TiXmlDocument::SaveFile( const char * filename ) const - { - // The old c stuff lives on... - FILE* fp = TiXmlFOpen( filename, "w" ); - if ( fp ) - { - bool result = SaveFile( fp ); - fclose( fp ); - return result; - } - return false; - } - - - bool TiXmlDocument::SaveFile( FILE* fp ) const - { - if ( useMicrosoftBOM ) - { - const unsigned char TIXML_UTF_LEAD_0 = 0xefU; - const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; - const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; - - fputc( TIXML_UTF_LEAD_0, fp ); - fputc( TIXML_UTF_LEAD_1, fp ); - fputc( TIXML_UTF_LEAD_2, fp ); - } - Print( fp, 0 ); - return (ferror(fp) == 0); - } - - - void TiXmlDocument::CopyTo( TiXmlDocument* target ) const - { - TiXmlNode::CopyTo( target ); - - target->error = error; - target->errorId = errorId; - target->errorDesc = errorDesc; - target->tabsize = tabsize; - target->errorLocation = errorLocation; - target->useMicrosoftBOM = useMicrosoftBOM; - - TiXmlNode* node = 0; - for ( node = firstChild; node; node = node->NextSibling() ) - { - target->LinkEndChild( node->Clone() ); - } - } - - - TiXmlNode* TiXmlDocument::Clone() const - { - TiXmlDocument* clone = new TiXmlDocument(); - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; - } - - - void TiXmlDocument::Print( FILE* cfile, int depth ) const - { - assert( cfile ); - for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) - { - node->Print( cfile, depth ); - fprintf( cfile, "\n" ); - } - } - - - bool TiXmlDocument::Accept( TiXmlVisitor* visitor ) const - { - if ( visitor->VisitEnter( *this ) ) - { - for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) - { - if ( !node->Accept( visitor ) ) - break; - } - } - return visitor->VisitExit( *this ); - } - - - const TiXmlAttribute* TiXmlAttribute::Next() const - { - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( next->value.empty() && next->name.empty() ) - return 0; - return next; - } - - /* - TiXmlAttribute* TiXmlAttribute::Next() - { - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( next->value.empty() && next->name.empty() ) - return 0; - return next; - } - */ - - const TiXmlAttribute* TiXmlAttribute::Previous() const - { - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( prev->value.empty() && prev->name.empty() ) - return 0; - return prev; - } - - /* - TiXmlAttribute* TiXmlAttribute::Previous() - { - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( prev->value.empty() && prev->name.empty() ) - return 0; - return prev; - } - */ - - void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const - { - TIXML_STRING n, v; - - EncodeString( name, &n ); - EncodeString( value, &v ); - - if (value.find ('\"') == TIXML_STRING::npos) { - if ( cfile ) { - fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() ); - } - if ( str ) { - (*str) += n; (*str) += "=\""; (*str) += v; (*str) += "\""; - } - } - else { - if ( cfile ) { - fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() ); - } - if ( str ) { - (*str) += n; (*str) += "='"; (*str) += v; (*str) += "'"; - } - } - } - - - int TiXmlAttribute::QueryIntValue( int* ival ) const - { - if ( TIXML_SSCANF( value.c_str(), "%d", ival ) == 1 ) - return TIXML_SUCCESS; - return TIXML_WRONG_TYPE; - } - - int TiXmlAttribute::QueryDoubleValue( double* dval ) const - { - if ( TIXML_SSCANF( value.c_str(), "%lf", dval ) == 1 ) - return TIXML_SUCCESS; - return TIXML_WRONG_TYPE; - } - - void TiXmlAttribute::SetIntValue( int _value ) - { - char buf [64]; - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF(buf, sizeof(buf), "%d", _value); - #else - sprintf (buf, "%d", _value); - #endif - SetValue (buf); - } - - void TiXmlAttribute::SetDoubleValue( double _value ) - { - char buf [256]; - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "%lf", _value); - #else - sprintf (buf, "%lf", _value); - #endif - SetValue (buf); - } - - int TiXmlAttribute::IntValue() const - { - return atoi (value.c_str ()); - } - - double TiXmlAttribute::DoubleValue() const - { - return atof (value.c_str ()); - } - - - TiXmlComment::TiXmlComment( const TiXmlComment& copy ) : TiXmlNode( TiXmlNode::COMMENT ) - { - copy.CopyTo( this ); - } - - - void TiXmlComment::operator=( const TiXmlComment& base ) - { - Clear(); - base.CopyTo( this ); - } - - - void TiXmlComment::Print( FILE* cfile, int depth ) const - { - assert( cfile ); - for ( int i=0; i", value.c_str() ); - } - - - void TiXmlComment::CopyTo( TiXmlComment* target ) const - { - TiXmlNode::CopyTo( target ); - } - - - bool TiXmlComment::Accept( TiXmlVisitor* visitor ) const - { - return visitor->Visit( *this ); - } - - - TiXmlNode* TiXmlComment::Clone() const - { - TiXmlComment* clone = new TiXmlComment(); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; - } - - - void TiXmlText::Print( FILE* cfile, int depth ) const - { - assert( cfile ); - if ( cdata ) - { - int i; - fprintf( cfile, "\n" ); - for ( i=0; i\n", value.c_str() ); // unformatted output - } - else - { - TIXML_STRING buffer; - EncodeString( value, &buffer ); - fprintf( cfile, "%s", buffer.c_str() ); - } - } - - - void TiXmlText::CopyTo( TiXmlText* target ) const - { - TiXmlNode::CopyTo( target ); - target->cdata = cdata; - } - - - bool TiXmlText::Accept( TiXmlVisitor* visitor ) const - { - return visitor->Visit( *this ); - } - - - TiXmlNode* TiXmlText::Clone() const - { - TiXmlText* clone = 0; - clone = new TiXmlText( "" ); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; - } - - - TiXmlDeclaration::TiXmlDeclaration( const char * _version, - const char * _encoding, - const char * _standalone ) - : TiXmlNode( TiXmlNode::DECLARATION ) - { - version = _version; - encoding = _encoding; - standalone = _standalone; - } - - - #ifdef TIXML_USE_STL - TiXmlDeclaration::TiXmlDeclaration( const std::string& _version, - const std::string& _encoding, - const std::string& _standalone ) - : TiXmlNode( TiXmlNode::DECLARATION ) - { - version = _version; - encoding = _encoding; - standalone = _standalone; - } - #endif - - - TiXmlDeclaration::TiXmlDeclaration( const TiXmlDeclaration& copy ) - : TiXmlNode( TiXmlNode::DECLARATION ) - { - copy.CopyTo( this ); - } - - - void TiXmlDeclaration::operator=( const TiXmlDeclaration& copy ) - { - Clear(); - copy.CopyTo( this ); - } - - - void TiXmlDeclaration::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const - { - if ( cfile ) fprintf( cfile, "" ); - if ( str ) (*str) += "?>"; - } - - - void TiXmlDeclaration::CopyTo( TiXmlDeclaration* target ) const - { - TiXmlNode::CopyTo( target ); - - target->version = version; - target->encoding = encoding; - target->standalone = standalone; - } - - - bool TiXmlDeclaration::Accept( TiXmlVisitor* visitor ) const - { - return visitor->Visit( *this ); - } - - - TiXmlNode* TiXmlDeclaration::Clone() const - { - TiXmlDeclaration* clone = new TiXmlDeclaration(); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; - } - - - void TiXmlUnknown::Print( FILE* cfile, int depth ) const - { - for ( int i=0; i", value.c_str() ); - } - - - void TiXmlUnknown::CopyTo( TiXmlUnknown* target ) const - { - TiXmlNode::CopyTo( target ); - } - - - bool TiXmlUnknown::Accept( TiXmlVisitor* visitor ) const - { - return visitor->Visit( *this ); - } - - - TiXmlNode* TiXmlUnknown::Clone() const - { - TiXmlUnknown* clone = new TiXmlUnknown(); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; - } - - - TiXmlAttributeSet::TiXmlAttributeSet() - { - sentinel.next = &sentinel; - sentinel.prev = &sentinel; - } - - - TiXmlAttributeSet::~TiXmlAttributeSet() - { - assert( sentinel.next == &sentinel ); - assert( sentinel.prev == &sentinel ); - } - - - void TiXmlAttributeSet::Add( TiXmlAttribute* addMe ) - { - #ifdef TIXML_USE_STL - assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set. - #else - assert( !Find( addMe->Name() ) ); // Shouldn't be multiply adding to the set. - #endif - - addMe->next = &sentinel; - addMe->prev = sentinel.prev; - - sentinel.prev->next = addMe; - sentinel.prev = addMe; - } - - void TiXmlAttributeSet::Remove( TiXmlAttribute* removeMe ) - { - TiXmlAttribute* node; - - for( node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( node == removeMe ) - { - node->prev->next = node->next; - node->next->prev = node->prev; - node->next = 0; - node->prev = 0; - return; - } - } - assert( 0 ); // we tried to remove a non-linked attribute. - } - - - #ifdef TIXML_USE_STL - const TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) const - { - for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( node->name == name ) - return node; - } - return 0; - } - - /* - TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) - { - for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( node->name == name ) - return node; - } - return 0; - } - */ - #endif - - - const TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) const - { - for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( strcmp( node->name.c_str(), name ) == 0 ) - return node; - } - return 0; - } - - /* - TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) - { - for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( strcmp( node->name.c_str(), name ) == 0 ) - return node; - } - return 0; - } - */ - - #ifdef TIXML_USE_STL - std::istream& operator>> (std::istream & in, TiXmlNode & base) - { - TIXML_STRING tag; - tag.reserve( 8 * 1000 ); - base.StreamIn( &in, &tag ); - - base.Parse( tag.c_str(), 0, TIXML_DEFAULT_ENCODING ); - return in; - } - #endif - - - #ifdef TIXML_USE_STL - std::ostream& operator<< (std::ostream & out, const TiXmlNode & base) - { - TiXmlPrinter printer; - printer.SetStreamPrinting(); - base.Accept( &printer ); - out << printer.Str(); - - return out; - } - - - std::string& operator<< (std::string& out, const TiXmlNode& base ) - { - TiXmlPrinter printer; - printer.SetStreamPrinting(); - base.Accept( &printer ); - out.append( printer.Str() ); - - return out; - } - #endif - - - TiXmlHandle TiXmlHandle::FirstChild() const - { - if ( node ) - { - TiXmlNode* child = node->FirstChild(); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); - } - - - TiXmlHandle TiXmlHandle::FirstChild( const char * value ) const - { - if ( node ) - { - TiXmlNode* child = node->FirstChild( value ); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); - } - - - TiXmlHandle TiXmlHandle::FirstChildElement() const - { - if ( node ) - { - TiXmlElement* child = node->FirstChildElement(); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); - } - - - TiXmlHandle TiXmlHandle::FirstChildElement( const char * value ) const - { - if ( node ) - { - TiXmlElement* child = node->FirstChildElement( value ); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); - } - - - TiXmlHandle TiXmlHandle::Child( int count ) const - { - if ( node ) - { - int i; - TiXmlNode* child = node->FirstChild(); - for ( i=0; - child && iNextSibling(), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); - } - - - TiXmlHandle TiXmlHandle::Child( const char* value, int count ) const - { - if ( node ) - { - int i; - TiXmlNode* child = node->FirstChild( value ); - for ( i=0; - child && iNextSibling( value ), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); - } - - - TiXmlHandle TiXmlHandle::ChildElement( int count ) const - { - if ( node ) - { - int i; - TiXmlElement* child = node->FirstChildElement(); - for ( i=0; - child && iNextSiblingElement(), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); - } - - - TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const - { - if ( node ) - { - int i; - TiXmlElement* child = node->FirstChildElement( value ); - for ( i=0; - child && iNextSiblingElement( value ), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); - } - - - bool TiXmlPrinter::VisitEnter( const TiXmlDocument& ) - { - return true; - } - - bool TiXmlPrinter::VisitExit( const TiXmlDocument& ) - { - return true; - } - - bool TiXmlPrinter::VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ) - { - DoIndent(); - buffer += "<"; - buffer += element.Value(); - - for( const TiXmlAttribute* attrib = firstAttribute; attrib; attrib = attrib->Next() ) - { - buffer += " "; - attrib->Print( 0, 0, &buffer ); - } - - if ( !element.FirstChild() ) - { - buffer += " />"; - DoLineBreak(); - } - else - { - buffer += ">"; - if ( element.FirstChild()->ToText() - && element.LastChild() == element.FirstChild() - && element.FirstChild()->ToText()->CDATA() == false ) - { - simpleTextPrint = true; - // no DoLineBreak()! - } - else - { - DoLineBreak(); - } - } - ++depth; - return true; - } - - - bool TiXmlPrinter::VisitExit( const TiXmlElement& element ) - { - --depth; - if ( !element.FirstChild() ) - { - // nothing. - } - else - { - if ( simpleTextPrint ) - { - simpleTextPrint = false; - } - else - { - DoIndent(); - } - buffer += ""; - DoLineBreak(); - } - return true; - } - - - bool TiXmlPrinter::Visit( const TiXmlText& text ) - { - if ( text.CDATA() ) - { - DoIndent(); - buffer += ""; - DoLineBreak(); - } - else if ( simpleTextPrint ) - { - TIXML_STRING str; - TiXmlBase::EncodeString( text.ValueTStr(), &str ); - buffer += str; - } - else - { - DoIndent(); - TIXML_STRING str; - TiXmlBase::EncodeString( text.ValueTStr(), &str ); - buffer += str; - DoLineBreak(); - } - return true; - } - - - bool TiXmlPrinter::Visit( const TiXmlDeclaration& declaration ) - { - DoIndent(); - declaration.Print( 0, 0, &buffer ); - DoLineBreak(); - return true; - } - - - bool TiXmlPrinter::Visit( const TiXmlComment& comment ) - { - DoIndent(); - buffer += ""; - DoLineBreak(); - return true; - } - - - bool TiXmlPrinter::Visit( const TiXmlUnknown& unknown ) - { - DoIndent(); - buffer += "<"; - buffer += unknown.Value(); - buffer += ">"; - DoLineBreak(); - return true; - } - -} // end nd namespace \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinyxml.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinyxml.h deleted file mode 100644 index c41f552878..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/tinyxml.h +++ /dev/null @@ -1,1836 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - - -#ifndef TINYXML_INCLUDED -#define TINYXML_INCLUDED - -#ifdef _MSC_VER -#pragma warning( push ) -#pragma warning( disable : 4530 ) -#pragma warning( disable : 4786 ) -#endif - -#include -#include -#include -#include -#include - -// Help out windows: -#if defined( _DEBUG ) && !defined( DEBUG ) -#define DEBUG -#endif - -#ifdef TIXML_USE_STL - #include - #include - #include - #define TIXML_STRING std::string -#else - #include "tinystr.h" - #define TIXML_STRING TiXmlString -#endif - -// Deprecated library function hell. Compilers want to use the -// new safe versions. This probably doesn't fully address the problem, -// but it gets closer. There are too many compilers for me to fully -// test. If you get compilation troubles, undefine TIXML_SAFE -#define TIXML_SAFE - -#ifdef TIXML_SAFE - #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) - // Microsoft visual studio, version 2005 and higher. - #define TIXML_SNPRINTF _snprintf_s - #define TIXML_SNSCANF _snscanf_s - #define TIXML_SSCANF sscanf_s - #elif defined(_MSC_VER) && (_MSC_VER >= 1200 ) - // Microsoft visual studio, version 6 and higher. - //#pragma message( "Using _sn* functions." ) - #define TIXML_SNPRINTF _snprintf - #define TIXML_SNSCANF _snscanf - #define TIXML_SSCANF sscanf - #elif defined(__GNUC__) && (__GNUC__ >= 3 ) - // GCC version 3 and higher.s - //#warning( "Using sn* functions." ) - #define TIXML_SNPRINTF snprintf - #define TIXML_SNSCANF snscanf - #define TIXML_SSCANF sscanf - #else - #define TIXML_SSCANF sscanf - #endif -#endif - -namespace nd -{ - class TiXmlDocument; - class TiXmlElement; - class TiXmlComment; - class TiXmlUnknown; - class TiXmlAttribute; - class TiXmlText; - class TiXmlDeclaration; - class TiXmlParsingData; - - const int TIXML_MAJOR_VERSION = 2; - const int TIXML_MINOR_VERSION = 5; - const int TIXML_PATCH_VERSION = 3; - - //void SetXmlMemoryFunctions(xmlAlloc allocMemory, xmlFree freeMemory); - - - /* Internal structure for tracking location of items - in the XML file. - */ - struct D_TINY_API TiXmlCursor - { - TiXmlCursor() { Clear(); } - void Clear() { row = col = -1; } - - int row; // 0 based. - int col; // 0 based. - }; - - - /** - If you call the Accept() method, it requires being passed a TiXmlVisitor - class to handle callbacks. For nodes that contain other nodes (Document, Element) - you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves - are simple called with Visit(). - - If you return 'true' from a Visit method, recursive parsing will continue. If you return - false, no children of this node or its sibilings will be Visited. - - All flavors of Visit methods have a default implementation that returns 'true' (continue - visiting). You need to only override methods that are interesting to you. - - Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting. - - You should never change the document from a callback. - - @sa TiXmlNode::Accept() - */ - class D_TINY_API TiXmlVisitor - { - public: - TiXmlVisitor() {} - TiXmlVisitor(const TiXmlVisitor&) {} - virtual ~TiXmlVisitor() {} - - TiXmlVisitor& operator=(const TiXmlVisitor&) - { - return *this; - } - - void *operator new (size_t size); - void *operator new[](size_t size); - void operator delete (void* ptr); - void operator delete[](void* ptr); - - /// Visit a document. - virtual bool VisitEnter( const TiXmlDocument& /*doc*/ ) { return true; } - /// Visit a document. - virtual bool VisitExit( const TiXmlDocument& /*doc*/ ) { return true; } - - /// Visit an element. - virtual bool VisitEnter( const TiXmlElement& /*element*/, const TiXmlAttribute* /*firstAttribute*/ ) { return true; } - /// Visit an element. - virtual bool VisitExit( const TiXmlElement& /*element*/ ) { return true; } - - /// Visit a declaration - virtual bool Visit( const TiXmlDeclaration& /*declaration*/ ) { return true; } - /// Visit a text node - virtual bool Visit( const TiXmlText& /*text*/ ) { return true; } - /// Visit a comment node - virtual bool Visit( const TiXmlComment& /*comment*/ ) { return true; } - /// Visit an unknow node - virtual bool Visit( const TiXmlUnknown& /*unknown*/ ) { return true; } - }; - - // Only used by Attribute::Query functions - enum - { - TIXML_SUCCESS, - TIXML_NO_ATTRIBUTE, - TIXML_WRONG_TYPE - }; - - - // Used by the parsing routines. - enum TiXmlEncoding - { - TIXML_ENCODING_UNKNOWN, - TIXML_ENCODING_UTF8, - TIXML_ENCODING_LEGACY - }; - - const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN; - - /** TiXmlBase is a base class for every class in TinyXml. - It does little except to establish that TinyXml classes - can be printed and provide some utility functions. - - In XML, the document and elements can contain - other elements and other types of nodes. - - @verbatim - A Document can contain: Element (container or leaf) - Comment (leaf) - Unknown (leaf) - Declaration( leaf ) - - An Element can contain: Element (container or leaf) - Text (leaf) - Attributes (not on tree) - Comment (leaf) - Unknown (leaf) - - A Decleration contains: Attributes (not on tree) - @endverbatim - */ - class D_TINY_API TiXmlBase - { - friend class TiXmlNode; - friend class TiXmlElement; - friend class TiXmlDocument; - - public: - TiXmlBase() : userData(0) {} - virtual ~TiXmlBase() {} - - void *operator new (size_t size); - void *operator new[](size_t size); - void operator delete (void* ptr); - void operator delete[](void* ptr); - - /** All TinyXml classes can print themselves to a filestream - or the string class (TiXmlString in non-STL mode, std::string - in STL mode.) Either or both cfile and str can be null. - - This is a formatted print, and will insert - tabs and newlines. - - (For an unformatted stream, use the << operator.) - */ - virtual void Print( FILE* cfile, int depth ) const = 0; - - /** The world does not agree on whether white space should be kept or - not. In order to make everyone happy, these global, static functions - are provided to set whether or not TinyXml will condense all white space - into a single space or not. The default is to condense. Note changing this - value is not thread safe. - */ - static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; } - - /// Return the current white space setting. - static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; } - - /** Return the position, in the original source file, of this node or attribute. - The row and column are 1-based. (That is the first row and first column is - 1,1). If the returns values are 0 or less, then the parser does not have - a row and column value. - - Generally, the row and column value will be set when the TiXmlDocument::Load(), - TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set - when the DOM was created from operator>>. - - The values reflect the initial load. Once the DOM is modified programmatically - (by adding or changing nodes and attributes) the new values will NOT update to - reflect changes in the document. - - There is a minor performance cost to computing the row and column. Computation - can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value. - - @sa TiXmlDocument::SetTabSize() - */ - int Row() const { return location.row + 1; } - int Column() const { return location.col + 1; } ///< See Row() - - void SetUserData( void* user ) { userData = user; } ///< Set a pointer to arbitrary user data. - void* GetUserData() { return userData; } ///< Get a pointer to arbitrary user data. - const void* GetUserData() const { return userData; } ///< Get a pointer to arbitrary user data. - - // Table that returs, for a given lead byte, the total number of bytes - // in the UTF-8 sequence. - static const int utf8ByteTable[256]; - - virtual const char* Parse( const char* p, - TiXmlParsingData* data, - TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0; - - /** Expands entities in a string. Note this should not contian the tag's '<', '>', etc, - or they will be transformed into entities! - */ - static void EncodeString( const TIXML_STRING& str, TIXML_STRING* out ); - - enum - { - TIXML_NO_ERROR = 0, - TIXML_ERROR, - TIXML_ERROR_OPENING_FILE, - TIXML_ERROR_OUT_OF_MEMORY, - TIXML_ERROR_PARSING_ELEMENT, - TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, - TIXML_ERROR_READING_ELEMENT_VALUE, - TIXML_ERROR_READING_ATTRIBUTES, - TIXML_ERROR_PARSING_EMPTY, - TIXML_ERROR_READING_END_TAG, - TIXML_ERROR_PARSING_UNKNOWN, - TIXML_ERROR_PARSING_COMMENT, - TIXML_ERROR_PARSING_DECLARATION, - TIXML_ERROR_DOCUMENT_EMPTY, - TIXML_ERROR_EMBEDDED_NULL, - TIXML_ERROR_PARSING_CDATA, - TIXML_ERROR_DOCUMENT_TOP_ONLY, - - TIXML_ERROR_STRING_COUNT - }; - - protected: - - static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding ); - inline static bool IsWhiteSpace( char c ) - { - return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); - } - inline static bool IsWhiteSpace( int c ) - { - if ( c < 256 ) - return IsWhiteSpace( (char) c ); - return false; // Again, only truly correct for English/Latin...but usually works. - } - - #ifdef TIXML_USE_STL - static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ); - static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag ); - #endif - - /* Reads an XML name into the string provided. Returns - a pointer just past the last character of the name, - or 0 if the function has an error. - */ - static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding ); - - /* Reads text. Returns a pointer past the given end tag. - Wickedly complex options, but it keeps the (sensitive) code in one place. - */ - static const char* ReadText( const char* in, // where to start - TIXML_STRING* text, // the string read - bool ignoreWhiteSpace, // whether to keep the white space - const char* endTag, // what ends this text - bool ignoreCase, // whether to ignore case in the end tag - TiXmlEncoding encoding ); // the current encoding - - // If an entity has been found, transform it into a character. - static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding ); - - // Get a character, while interpreting entities. - // The length can be from 0 to 4 bytes. - inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding ) - { - assert( p ); - if ( encoding == TIXML_ENCODING_UTF8 ) - { - *length = utf8ByteTable[ *((const unsigned char*)p) ]; - assert( *length >= 0 && *length < 5 ); - } - else - { - *length = 1; - } - - if ( *length == 1 ) - { - if ( *p == '&' ) - return GetEntity( p, _value, length, encoding ); - *_value = *p; - return p+1; - } - else if ( *length ) - { - //strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe), - // and the null terminator isn't needed - for( int i=0; p[i] && i<*length; ++i ) { - _value[i] = p[i]; - } - return p + (*length); - } - else - { - // Not valid text. - return 0; - } - } - - // Return true if the next characters in the stream are any of the endTag sequences. - // Ignore case only works for english, and should only be relied on when comparing - // to English words: StringEqual( p, "version", true ) is fine. - static bool StringEqual( const char* p, - const char* endTag, - bool ignoreCase, - TiXmlEncoding encoding ); - - static const char* errorString[ TIXML_ERROR_STRING_COUNT ]; - - TiXmlCursor location; - - /// Field containing a generic user pointer - void* userData; - - // None of these methods are reliable for any language except English. - // Good for approximation, not great for accuracy. - static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding ); - static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding ); - inline static int ToLower( int v, TiXmlEncoding encoding ) - { - if ( encoding == TIXML_ENCODING_UTF8 ) - { - if ( v < 128 ) return tolower( v ); - return v; - } - else - { - return tolower( v ); - } - } - static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); - - private: - TiXmlBase( const TiXmlBase& ); // not implemented. - void operator=( const TiXmlBase& base ); // not allowed. - - struct Entity - { - const char* str; - unsigned int strLength; - char chr; - }; - enum - { - NUM_ENTITY = 5, - MAX_ENTITY_LENGTH = 6 - - }; - static Entity entity[ NUM_ENTITY ]; - static bool condenseWhiteSpace; - }; - - - /** The parent class for everything in the Document Object Model. - (Except for attributes). - Nodes have siblings, a parent, and children. A node can be - in a document, or stand on its own. The type of a TiXmlNode - can be queried, and it can be cast to its more defined type. - */ - class D_TINY_API TiXmlNode : public TiXmlBase - { - friend class TiXmlDocument; - friend class TiXmlElement; - - public: - #ifdef TIXML_USE_STL - - /** An input stream operator, for every class. Tolerant of newlines and - formatting, but doesn't expect them. - */ - friend std::istream& operator >> (std::istream& in, TiXmlNode& base); - - /** An output stream operator, for every class. Note that this outputs - without any newlines or formatting, as opposed to Print(), which - includes tabs and new lines. - - The operator<< and operator>> are not completely symmetric. Writing - a node to a stream is very well defined. You'll get a nice stream - of output, without any extra whitespace or newlines. - - But reading is not as well defined. (As it always is.) If you create - a TiXmlElement (for example) and read that from an input stream, - the text needs to define an element or junk will result. This is - true of all input streams, but it's worth keeping in mind. - - A TiXmlDocument will read nodes until it reads a root element, and - all the children of that root element. - */ - friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base); - - /// Appends the XML node or attribute to a std::string. - friend std::string& operator<< (std::string& out, const TiXmlNode& base ); - - #endif - - /** The types of XML nodes supported by TinyXml. (All the - unsupported types are picked up by UNKNOWN.) - */ - enum NodeType - { - DOCUMENT, - ELEMENT, - COMMENT, - UNKNOWN, - TEXT, - DECLARATION, - TYPECOUNT - }; - - virtual ~TiXmlNode(); - - /** The meaning of 'value' changes for the specific type of - TiXmlNode. - @verbatim - Document: filename of the xml file - Element: name of the element - Comment: the comment text - Unknown: the tag contents - Text: the text string - @endverbatim - - The subclasses will wrap this function. - */ - const char *Value() const { return value.c_str (); } - - #ifdef TIXML_USE_STL - /** Return Value() as a std::string. If you only use STL, - this is more efficient than calling Value(). - Only available in STL mode. - */ - const std::string& ValueStr() const { return value; } - #endif - - const TIXML_STRING& ValueTStr() const { return value; } - - /** Changes the value of the node. Defined as: - @verbatim - Document: filename of the xml file - Element: name of the element - Comment: the comment text - Unknown: the tag contents - Text: the text string - @endverbatim - */ - void SetValue(const char * _value) { value = _value;} - - #ifdef TIXML_USE_STL - /// STL std::string form. - void SetValue( const std::string& _value ) { value = _value; } - #endif - - /// Delete all the children of this node. Does not affect 'this'. - void Clear(); - - /// One step up the DOM. - TiXmlNode* Parent() { return parent; } - const TiXmlNode* Parent() const { return parent; } - - const TiXmlNode* FirstChild() const { return firstChild; } ///< The first child of this node. Will be null if there are no children. - TiXmlNode* FirstChild() { return firstChild; } - const TiXmlNode* FirstChild( const char * value ) const; ///< The first child of this node with the matching 'value'. Will be null if none found. - /// The first child of this node with the matching 'value'. Will be null if none found. - TiXmlNode* FirstChild( const char * _value ) { - // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe) - // call the method, cast the return back to non-const. - return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value )); - } - const TiXmlNode* LastChild() const { return lastChild; } /// The last child of this node. Will be null if there are no children. - TiXmlNode* LastChild() { return lastChild; } - - const TiXmlNode* LastChild( const char * value ) const; /// The last child of this node matching 'value'. Will be null if there are no children. - TiXmlNode* LastChild( const char * _value ) { - return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value )); - } - - #ifdef TIXML_USE_STL - const TiXmlNode* FirstChild( const std::string& _value ) const { return FirstChild (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* FirstChild( const std::string& _value ) { return FirstChild (_value.c_str ()); } ///< STL std::string form. - const TiXmlNode* LastChild( const std::string& _value ) const { return LastChild (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* LastChild( const std::string& _value ) { return LastChild (_value.c_str ()); } ///< STL std::string form. - #endif - - /** An alternate way to walk the children of a node. - One way to iterate over nodes is: - @verbatim - for( child = parent->FirstChild(); child; child = child->NextSibling() ) - @endverbatim - - IterateChildren does the same thing with the syntax: - @verbatim - child = 0; - while( child = parent->IterateChildren( child ) ) - @endverbatim - - IterateChildren takes the previous child as input and finds - the next one. If the previous child is null, it returns the - first. IterateChildren will return null when done. - */ - const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const; - TiXmlNode* IterateChildren( const TiXmlNode* previous ) { - return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) ); - } - - /// This flavor of IterateChildren searches for children with a particular 'value' - const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const; - TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) { - return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) ); - } - - #ifdef TIXML_USE_STL - const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. - TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. - #endif - - /** Add a new node related to this. Adds a child past the LastChild. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* InsertEndChild( const TiXmlNode& addThis ); - - - /** Add a new node related to this. Adds a child past the LastChild. - - NOTE: the node to be added is passed by pointer, and will be - henceforth owned (and deleted) by tinyXml. This method is efficient - and avoids an extra copy, but should be used with care as it - uses a different memory model than the other insert functions. - - @sa InsertEndChild - */ - TiXmlNode* LinkEndChild( TiXmlNode* addThis ); - - /** Add a new node related to this. Adds a child before the specified child. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ); - - /** Add a new node related to this. Adds a child after the specified child. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ); - - /** Replace a child of this node. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ); - - /// Delete a child of this node. - bool RemoveChild( TiXmlNode* removeThis ); - - /// Navigate to a sibling node. - const TiXmlNode* PreviousSibling() const { return prev; } - TiXmlNode* PreviousSibling() { return prev; } - - /// Navigate to a sibling node. - const TiXmlNode* PreviousSibling( const char * ) const; - TiXmlNode* PreviousSibling( const char *_prev ) { - return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) ); - } - - #ifdef TIXML_USE_STL - const TiXmlNode* PreviousSibling( const std::string& _value ) const { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* PreviousSibling( const std::string& _value ) { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. - const TiXmlNode* NextSibling( const std::string& _value) const { return NextSibling (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* NextSibling( const std::string& _value) { return NextSibling (_value.c_str ()); } ///< STL std::string form. - #endif - - /// Navigate to a sibling node. - const TiXmlNode* NextSibling() const { return next; } - TiXmlNode* NextSibling() { return next; } - - /// Navigate to a sibling node with the given 'value'. - const TiXmlNode* NextSibling( const char * ) const; - TiXmlNode* NextSibling( const char* _next ) { - return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) ); - } - - /** Convenience function to get through elements. - Calls NextSibling and ToElement. Will skip all non-Element - nodes. Returns 0 if there is not another element. - */ - const TiXmlElement* NextSiblingElement() const; - TiXmlElement* NextSiblingElement() { - return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() ); - } - - /** Convenience function to get through elements. - Calls NextSibling and ToElement. Will skip all non-Element - nodes. Returns 0 if there is not another element. - */ - const TiXmlElement* NextSiblingElement( const char * ) const; - TiXmlElement* NextSiblingElement( const char *_next ) { - return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) ); - } - - #ifdef TIXML_USE_STL - const TiXmlElement* NextSiblingElement( const std::string& _value) const { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. - TiXmlElement* NextSiblingElement( const std::string& _value) { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. - #endif - - /// Convenience function to get through elements. - const TiXmlElement* FirstChildElement() const; - TiXmlElement* FirstChildElement() { - return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() ); - } - - /// Convenience function to get through elements. - const TiXmlElement* FirstChildElement( const char * _value ) const; - TiXmlElement* FirstChildElement( const char * _value ) { - return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) ); - } - - #ifdef TIXML_USE_STL - const TiXmlElement* FirstChildElement( const std::string& _value ) const { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. - TiXmlElement* FirstChildElement( const std::string& _value ) { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. - #endif - - /** Query the type (as an enumerated value, above) of this node. - The possible types are: DOCUMENT, ELEMENT, COMMENT, - UNKNOWN, TEXT, and DECLARATION. - */ - int Type() const { return type; } - - /** Return a pointer to the Document this node lives in. - Returns null if not in a document. - */ - const TiXmlDocument* GetDocument() const; - TiXmlDocument* GetDocument() { - return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() ); - } - - /// Returns true if this node has no children. - bool NoChildren() const { return !firstChild; } - - virtual const TiXmlDocument* ToDocument() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual const TiXmlElement* ToElement() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual const TiXmlComment* ToComment() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual const TiXmlUnknown* ToUnknown() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual const TiXmlText* ToText() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - - virtual TiXmlDocument* ToDocument() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual TiXmlElement* ToElement() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual TiXmlComment* ToComment() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual TiXmlUnknown* ToUnknown() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual TiXmlText* ToText() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual TiXmlDeclaration* ToDeclaration() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - - /** Create an exact duplicate of this node and return it. The memory must be deleted - by the caller. - */ - virtual TiXmlNode* Clone() const = 0; - - /** Accept a hierchical visit the nodes in the TinyXML DOM. Every node in the - XML tree will be conditionally visited and the host will be called back - via the TiXmlVisitor interface. - - This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse - the XML for the callbacks, so the performance of TinyXML is unchanged by using this - interface versus any other.) - - The interface has been based on ideas from: - - - http://www.saxproject.org/ - - http://c2.com/cgi/wiki?HierarchicalVisitorPattern - - Which are both good references for "visiting". - - An example of using Accept(): - @verbatim - TiXmlPrinter printer; - tinyxmlDoc.Accept( &printer ); - const char* xmlcstr = printer.CStr(); - @endverbatim - */ - virtual bool Accept( TiXmlVisitor* visitor ) const = 0; - - protected: - TiXmlNode( NodeType _type ); - - // Copy to the allocated object. Shared functionality between Clone, Copy constructor, - // and the assignment operator. - void CopyTo( TiXmlNode* target ) const; - - #ifdef TIXML_USE_STL - // The real work of the input operator. - virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0; - #endif - - // Figure out what is at *p, and parse it. Returns null if it is not an xml node. - TiXmlNode* Identify( const char* start, TiXmlEncoding encoding ); - - TiXmlNode* parent; - NodeType type; - - TiXmlNode* firstChild; - TiXmlNode* lastChild; - - TIXML_STRING value; - - TiXmlNode* prev; - TiXmlNode* next; - - private: - TiXmlNode( const TiXmlNode& ); // not implemented. - void operator=( const TiXmlNode& base ); // not allowed. - }; - - - /** An attribute is a name-value pair. Elements have an arbitrary - number of attributes, each with a unique name. - - @note The attributes are not TiXmlNodes, since they are not - part of the tinyXML document object model. There are other - suggested ways to look at this problem. - */ - class D_TINY_API TiXmlAttribute : public TiXmlBase - { - friend class TiXmlAttributeSet; - - public: - /// Construct an empty attribute. - TiXmlAttribute() : TiXmlBase() - { - document = 0; - prev = next = 0; - } - - #ifdef TIXML_USE_STL - /// std::string constructor. - TiXmlAttribute( const std::string& _name, const std::string& _value ) - { - name = _name; - value = _value; - document = 0; - prev = next = 0; - } - #endif - - /// Construct an attribute with a name and value. - TiXmlAttribute( const char * _name, const char * _value ) - { - name = _name; - value = _value; - document = 0; - prev = next = 0; - } - - const char* Name() const { return name.c_str(); } ///< Return the name of this attribute. - const char* Value() const { return value.c_str(); } ///< Return the value of this attribute. - #ifdef TIXML_USE_STL - const std::string& ValueStr() const { return value; } ///< Return the value of this attribute. - #endif - int IntValue() const; ///< Return the value of this attribute, converted to an integer. - double DoubleValue() const; ///< Return the value of this attribute, converted to a double. - - // Get the tinyxml string representation - const TIXML_STRING& NameTStr() const { return name; } - - /** QueryIntValue examines the value string. It is an alternative to the - IntValue() method with richer error checking. - If the value is an integer, it is stored in 'value' and - the call returns TIXML_SUCCESS. If it is not - an integer, it returns TIXML_WRONG_TYPE. - - A specialized but useful call. Note that for success it returns 0, - which is the opposite of almost all other TinyXml calls. - */ - int QueryIntValue( int* _value ) const; - /// QueryDoubleValue examines the value string. See QueryIntValue(). - int QueryDoubleValue( double* _value ) const; - - void SetName( const char* _name ) { name = _name; } ///< Set the name of this attribute. - void SetValue( const char* _value ) { value = _value; } ///< Set the value. - - void SetIntValue( int _value ); ///< Set the value from an integer. - void SetDoubleValue( double _value ); ///< Set the value from a double. - - #ifdef TIXML_USE_STL - /// STL std::string form. - void SetName( const std::string& _name ) { name = _name; } - /// STL std::string form. - void SetValue( const std::string& _value ) { value = _value; } - #endif - - /// Get the next sibling attribute in the DOM. Returns null at end. - const TiXmlAttribute* Next() const; - TiXmlAttribute* Next() { - return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() ); - } - - /// Get the previous sibling attribute in the DOM. Returns null at beginning. - const TiXmlAttribute* Previous() const; - TiXmlAttribute* Previous() { - return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() ); - } - - bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; } - bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; } - bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; } - - /* Attribute parsing starts: first letter of the name - returns: the next char after the value end quote - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - // Prints this Attribute to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const { - Print( cfile, depth, 0 ); - } - void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; - - // [internal use] - // Set the document pointer so the attribute can report errors. - void SetDocument( TiXmlDocument* doc ) { document = doc; } - - private: - TiXmlAttribute( const TiXmlAttribute& ); // not implemented. - void operator=( const TiXmlAttribute& base ); // not allowed. - - TiXmlDocument* document; // A pointer back to a document, for error reporting. - TIXML_STRING name; - TIXML_STRING value; - TiXmlAttribute* prev; - TiXmlAttribute* next; - }; - - - /* A class used to manage a group of attributes. - It is only used internally, both by the ELEMENT and the DECLARATION. - - The set can be changed transparent to the Element and Declaration - classes that use it, but NOT transparent to the Attribute - which has to implement a next() and previous() method. Which makes - it a bit problematic and prevents the use of STL. - - This version is implemented with circular lists because: - - I like circular lists - - it demonstrates some independence from the (typical) doubly linked list. - */ - class D_TINY_API TiXmlAttributeSet - { - public: - TiXmlAttributeSet(); - ~TiXmlAttributeSet(); - - void *operator new (size_t size); - void *operator new[](size_t size); - void operator delete (void* ptr); - void operator delete[](void* ptr); - - void Add( TiXmlAttribute* attribute ); - void Remove( TiXmlAttribute* attribute ); - - const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } - TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } - const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } - TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } - - const TiXmlAttribute* Find( const char* _name ) const; - TiXmlAttribute* Find( const char* _name ) { - return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); - } - #ifdef TIXML_USE_STL - const TiXmlAttribute* Find( const std::string& _name ) const; - TiXmlAttribute* Find( const std::string& _name ) { - return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); - } - - #endif - - private: - //*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element), - //*ME: this class must be also use a hidden/disabled copy-constructor !!! - TiXmlAttributeSet( const TiXmlAttributeSet& ); // not allowed - void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute) - - TiXmlAttribute sentinel; - }; - - - /** The element is a container class. It has a value, the element name, - and can contain other elements, text, comments, and unknowns. - Elements also contain an arbitrary number of attributes. - */ - class D_TINY_API TiXmlElement : public TiXmlNode - { - public: - /// Construct an element. - TiXmlElement (const char * in_value); - - #ifdef TIXML_USE_STL - /// std::string constructor. - TiXmlElement( const std::string& _value ); - #endif - - TiXmlElement( const TiXmlElement& ); - - void operator=( const TiXmlElement& base ); - - virtual ~TiXmlElement(); - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none exists. - */ - const char* Attribute( const char* name ) const; - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none exists. - If the attribute exists and can be converted to an integer, - the integer value will be put in the return 'i', if 'i' - is non-null. - */ - const char* Attribute( const char* name, int* i ) const; - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none exists. - If the attribute exists and can be converted to an double, - the double value will be put in the return 'd', if 'd' - is non-null. - */ - const char* Attribute( const char* name, double* d ) const; - - /** QueryIntAttribute examines the attribute - it is an alternative to the - Attribute() method with richer error checking. - If the attribute is an integer, it is stored in 'value' and - the call returns TIXML_SUCCESS. If it is not - an integer, it returns TIXML_WRONG_TYPE. If the attribute - does not exist, then TIXML_NO_ATTRIBUTE is returned. - */ - int QueryIntAttribute( const char* name, int* _value ) const; - /// QueryDoubleAttribute examines the attribute - see QueryIntAttribute(). - int QueryDoubleAttribute( const char* name, double* _value ) const; - /// QueryFloatAttribute examines the attribute - see QueryIntAttribute(). - int QueryFloatAttribute( const char* name, float* _value ) const { - double d; - int result = QueryDoubleAttribute( name, &d ); - if ( result == TIXML_SUCCESS ) { - *_value = (float)d; - } - return result; - } - - #ifdef TIXML_USE_STL - /** Template form of the attribute query which will try to read the - attribute into the specified type. Very easy, very powerful, but - be careful to make sure to call this with the correct type. - - NOTE: This method doesn't work correctly for 'string' types. - - @return TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE - */ - template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const - { - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - - std::stringstream sstream( node->ValueStr() ); - sstream >> *outValue; - if ( !sstream.fail() ) - return TIXML_SUCCESS; - return TIXML_WRONG_TYPE; - } - /* - This is - in theory - a bug fix for "QueryValueAtribute returns truncated std::string" - but template specialization is hard to get working cross-compiler. Leaving the bug for now. - - // The above will fail for std::string because the space character is used as a seperator. - // Specialize for strings. Bug [ 1695429 ] QueryValueAtribute returns truncated std::string - template<> int QueryValueAttribute( const std::string& name, std::string* outValue ) const - { - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - *outValue = node->ValueStr(); - return TIXML_SUCCESS; - } - */ - #endif - - /** Sets an attribute of name to a given value. The attribute - will be created if it does not exist, or changed if it does. - */ - void SetAttribute( const char* name, const char * _value ); - - #ifdef TIXML_USE_STL - const std::string* Attribute( const std::string& name ) const; - const std::string* Attribute( const std::string& name, int* i ) const; - const std::string* Attribute( const std::string& name, double* d ) const; - int QueryIntAttribute( const std::string& name, int* _value ) const; - int QueryDoubleAttribute( const std::string& name, double* _value ) const; - - /// STL std::string form. - void SetAttribute( const std::string& name, const std::string& _value ); - ///< STL std::string form. - void SetAttribute( const std::string& name, int _value ); - #endif - - /** Sets an attribute of name to a given value. The attribute - will be created if it does not exist, or changed if it does. - */ - void SetAttribute( const char * name, int value ); - - /** Sets an attribute of name to a given value. The attribute - will be created if it does not exist, or changed if it does. - */ - void SetDoubleAttribute( const char * name, double value ); - - /** Deletes an attribute with the given name. - */ - void RemoveAttribute( const char * name ); - #ifdef TIXML_USE_STL - void RemoveAttribute( const std::string& name ) { RemoveAttribute (name.c_str ()); } ///< STL std::string form. - #endif - - const TiXmlAttribute* FirstAttribute() const { return attributeSet.First(); } ///< Access the first attribute in this element. - TiXmlAttribute* FirstAttribute() { return attributeSet.First(); } - const TiXmlAttribute* LastAttribute() const { return attributeSet.Last(); } ///< Access the last attribute in this element. - TiXmlAttribute* LastAttribute() { return attributeSet.Last(); } - - /** Convenience function for easy access to the text inside an element. Although easy - and concise, GetText() is limited compared to getting the TiXmlText child - and accessing it directly. - - If the first child of 'this' is a TiXmlText, the GetText() - returns the character string of the Text node, else null is returned. - - This is a convenient method for getting the text of simple contained text: - @verbatim - This is text - const char* str = fooElement->GetText(); - @endverbatim - - 'str' will be a pointer to "This is text". - - Note that this function can be misleading. If the element foo was created from - this XML: - @verbatim - This is text - @endverbatim - - then the value of str would be null. The first child node isn't a text node, it is - another element. From this XML: - @verbatim - This is text - @endverbatim - GetText() will return "This is ". - - WARNING: GetText() accesses a child node - don't become confused with the - similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are - safe type casts on the referenced node. - */ - const char* GetText() const; - - /// Creates a new Element and returns it - the returned element is a copy. - virtual TiXmlNode* Clone() const; - // Print the Element to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - /* Attribtue parsing starts: next char past '<' - returns: next char past '>' - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - virtual const TiXmlElement* ToElement() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlElement* ToElement() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* visitor ) const; - - protected: - - void CopyTo( TiXmlElement* target ) const; - void ClearThis(); // like clear, but initializes 'this' object as well - - // Used to be public [internal use] - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif - /* [internal use] - Reads the "value" of the element -- another element, or text. - This should terminate with the current end tag. - */ - const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding ); - - private: - - TiXmlAttributeSet attributeSet; - }; - - - /** An XML comment. - */ - class D_TINY_API TiXmlComment : public TiXmlNode - { - public: - /// Constructs an empty comment. - TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {} - /// Construct a comment from text. - TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::COMMENT ) { - SetValue( _value ); - } - TiXmlComment( const TiXmlComment& ); - void operator=( const TiXmlComment& base ); - - virtual ~TiXmlComment() {} - - /// Returns a copy of this Comment. - virtual TiXmlNode* Clone() const; - // Write this Comment to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - /* Attribtue parsing starts: at the ! of the !-- - returns: next char past '>' - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - virtual const TiXmlComment* ToComment() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlComment* ToComment() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* visitor ) const; - - protected: - void CopyTo( TiXmlComment* target ) const; - - // used to be public - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif - // virtual void StreamOut( TIXML_OSTREAM * out ) const; - - private: - - }; - - - /** XML text. A text node can have 2 ways to output the next. "normal" output - and CDATA. It will default to the mode it was parsed from the XML file and - you generally want to leave it alone, but you can change the output mode with - SetCDATA() and query it with CDATA(). - */ - class D_TINY_API TiXmlText : public TiXmlNode - { - friend class TiXmlElement; - public: - /** Constructor for text element. By default, it is treated as - normal, encoded text. If you want it be output as a CDATA text - element, set the parameter _cdata to 'true' - */ - TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT) - { - SetValue( initValue ); - cdata = false; - } - virtual ~TiXmlText() {} - - #ifdef TIXML_USE_STL - /// Constructor. - TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT) - { - SetValue( initValue ); - cdata = false; - } - #endif - - TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT ) { copy.CopyTo( this ); } - void operator=( const TiXmlText& base ) { base.CopyTo( this ); } - - // Write this text object to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - /// Queries whether this represents text using a CDATA section. - bool CDATA() const { return cdata; } - /// Turns on or off a CDATA representation of text. - void SetCDATA( bool _cdata ) { cdata = _cdata; } - - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - virtual const TiXmlText* ToText() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlText* ToText() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* content ) const; - - protected : - /// [internal use] Creates a new Element and returns it. - virtual TiXmlNode* Clone() const; - void CopyTo( TiXmlText* target ) const; - - bool Blank() const; // returns true if all white space and new lines - // [internal use] - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif - - private: - bool cdata; // true if this should be input and output as a CDATA style text element - }; - - - /** In correct XML the declaration is the first entry in the file. - @verbatim - - @endverbatim - - TinyXml will happily read or write files without a declaration, - however. There are 3 possible attributes to the declaration: - version, encoding, and standalone. - - Note: In this version of the code, the attributes are - handled as special cases, not generic attributes, simply - because there can only be at most 3 and they are always the same. - */ - class D_TINY_API TiXmlDeclaration : public TiXmlNode - { - public: - /// Construct an empty declaration. - TiXmlDeclaration() : TiXmlNode( TiXmlNode::DECLARATION ) {} - - #ifdef TIXML_USE_STL - /// Constructor. - TiXmlDeclaration( const std::string& _version, - const std::string& _encoding, - const std::string& _standalone ); - #endif - - /// Construct. - TiXmlDeclaration( const char* _version, - const char* _encoding, - const char* _standalone ); - - TiXmlDeclaration( const TiXmlDeclaration& copy ); - void operator=( const TiXmlDeclaration& copy ); - - virtual ~TiXmlDeclaration() {} - - /// Version. Will return an empty string if none was found. - const char *Version() const { return version.c_str (); } - /// Encoding. Will return an empty string if none was found. - const char *Encoding() const { return encoding.c_str (); } - /// Is this a standalone document? - const char *Standalone() const { return standalone.c_str (); } - - /// Creates a copy of this Declaration and returns it. - virtual TiXmlNode* Clone() const; - // Print this declaration to a FILE stream. - virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; - virtual void Print( FILE* cfile, int depth ) const { - Print( cfile, depth, 0 ); - } - - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - virtual const TiXmlDeclaration* ToDeclaration() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlDeclaration* ToDeclaration() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* visitor ) const; - - protected: - void CopyTo( TiXmlDeclaration* target ) const; - // used to be public - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif - - private: - - TIXML_STRING version; - TIXML_STRING encoding; - TIXML_STRING standalone; - }; - - - /** Any tag that tinyXml doesn't recognize is saved as an - unknown. It is a tag of text, but should not be modified. - It will be written back to the XML, unchanged, when the file - is saved. - - DTD tags get thrown into TiXmlUnknowns. - */ - class D_TINY_API TiXmlUnknown : public TiXmlNode - { - public: - TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN ) {} - virtual ~TiXmlUnknown() {} - - TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN ) { copy.CopyTo( this ); } - void operator=( const TiXmlUnknown& copy ) { copy.CopyTo( this ); } - - /// Creates a copy of this Unknown and returns it. - virtual TiXmlNode* Clone() const; - // Print this Unknown to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - virtual const TiXmlUnknown* ToUnknown() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlUnknown* ToUnknown() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* content ) const; - - protected: - void CopyTo( TiXmlUnknown* target ) const; - - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif - - private: - - }; - - - /** Always the top level node. A document binds together all the - XML pieces. It can be saved, loaded, and printed to the screen. - The 'value' of a document node is the xml file name. - */ - class D_TINY_API TiXmlDocument : public TiXmlNode - { - public: - /// Create an empty document, that has no name. - TiXmlDocument(); - /// Create a document with a name. The name of the document is also the filename of the xml. - TiXmlDocument( const char * documentName ); - - #ifdef TIXML_USE_STL - /// Constructor. - TiXmlDocument( const std::string& documentName ); - #endif - - TiXmlDocument( const TiXmlDocument& copy ); - void operator=( const TiXmlDocument& copy ); - - virtual ~TiXmlDocument() {} - - /** Load a file using the current document value. - Returns true if successful. Will delete any existing - document data before loading. - */ - bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); - /// Save a file using the current document value. Returns true if successful. - bool SaveFile() const; - /// Load a file using the given filename. Returns true if successful. - bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); - /// Save a file using the given filename. Returns true if successful. - bool SaveFile( const char * filename ) const; - /** Load a file using the given FILE*. Returns true if successful. Note that this method - doesn't stream - the entire object pointed at by the FILE* - will be interpreted as an XML file. TinyXML doesn't stream in XML from the current - file location. Streaming may be added in the future. - */ - bool LoadFile( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); - /// Save a file using the given FILE*. Returns true if successful. - bool SaveFile( FILE* ) const; - - #ifdef TIXML_USE_STL - bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) ///< STL std::string version. - { - // StringToBuffer f( filename ); - // return ( f.buffer && LoadFile( f.buffer, encoding )); - return LoadFile( filename.c_str(), encoding ); - } - bool SaveFile( const std::string& filename ) const ///< STL std::string version. - { - // StringToBuffer f( filename ); - // return ( f.buffer && SaveFile( f.buffer )); - return SaveFile( filename.c_str() ); - } - #endif - - /** Parse the given null terminated block of xml data. Passing in an encoding to this - method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml - to use that encoding, regardless of what TinyXml might otherwise try to detect. - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); - - /** Get the root element -- the only top level element -- of the document. - In well formed XML, there should only be one. TinyXml is tolerant of - multiple elements at the document level. - */ - const TiXmlElement* RootElement() const { return FirstChildElement(); } - TiXmlElement* RootElement() { return FirstChildElement(); } - - /** If an error occurs, Error will be set to true. Also, - - The ErrorId() will contain the integer identifier of the error (not generally useful) - - The ErrorDesc() method will return the name of the error. (very useful) - - The ErrorRow() and ErrorCol() will return the location of the error (if known) - */ - bool Error() const { return error; } - - /// Contains a textual (english) description of the error if one occurs. - const char * ErrorDesc() const { return errorDesc.c_str (); } - - /** Generally, you probably want the error string ( ErrorDesc() ). But if you - prefer the ErrorId, this function will fetch it. - */ - int ErrorId() const { return errorId; } - - /** Returns the location (if known) of the error. The first column is column 1, - and the first row is row 1. A value of 0 means the row and column wasn't applicable - (memory errors, for example, have no row/column) or the parser lost the error. (An - error in the error reporting, in that case.) - - @sa SetTabSize, Row, Column - */ - int ErrorRow() const { return errorLocation.row+1; } - int ErrorCol() const { return errorLocation.col+1; } ///< The column where the error occured. See ErrorRow() - - /** SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) - to report the correct values for row and column. It does not change the output - or input in any way. - - By calling this method, with a tab size - greater than 0, the row and column of each node and attribute is stored - when the file is loaded. Very useful for tracking the DOM back in to - the source file. - - The tab size is required for calculating the location of nodes. If not - set, the default of 4 is used. The tabsize is set per document. Setting - the tabsize to 0 disables row/column tracking. - - Note that row and column tracking is not supported when using operator>>. - - The tab size needs to be enabled before the parse or load. Correct usage: - @verbatim - TiXmlDocument doc; - doc.SetTabSize( 8 ); - doc.Load( "myfile.xml" ); - @endverbatim - - @sa Row, Column - */ - void SetTabSize( int _tabsize ) { tabsize = _tabsize; } - - int TabSize() const { return tabsize; } - - /** If you have handled the error, it can be reset with this call. The error - state is automatically cleared if you Parse a new XML block. - */ - void ClearError() { error = false; - errorId = 0; - errorDesc = ""; - errorLocation.row = errorLocation.col = 0; - //errorLocation.last = 0; - } - - /** Write the document to standard out using formatted printing ("pretty print"). */ - void Print() const { Print( stdout, 0 ); } - - /* Write the document to a string using formatted printing ("pretty print"). This - will allocate a character array (new char[]) and return it as a pointer. The - calling code pust call delete[] on the return char* to avoid a memory leak. - */ - //char* PrintToMemory() const; - - /// Print this Document to a FILE stream. - virtual void Print( FILE* cfile, int depth = 0 ) const; - // [internal use] - void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding ); - - virtual const TiXmlDocument* ToDocument() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlDocument* ToDocument() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* content ) const; - - protected : - // [internal use] - virtual TiXmlNode* Clone() const; - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif - - private: - void CopyTo( TiXmlDocument* target ) const; - - bool error; - int errorId; - TIXML_STRING errorDesc; - int tabsize; - TiXmlCursor errorLocation; - bool useMicrosoftBOM; // the UTF-8 BOM were found when read. Note this, and try to write. - }; - - - /** - A TiXmlHandle is a class that wraps a node pointer with null checks; this is - an incredibly useful thing. Note that TiXmlHandle is not part of the TinyXml - DOM structure. It is a separate utility class. - - Take an example: - @verbatim - - - - - - - @endverbatim - - Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very - easy to write a *lot* of code that looks like: - - @verbatim - TiXmlElement* root = document.FirstChildElement( "Document" ); - if ( root ) - { - TiXmlElement* element = root->FirstChildElement( "Element" ); - if ( element ) - { - TiXmlElement* child = element->FirstChildElement( "Child" ); - if ( child ) - { - TiXmlElement* child2 = child->NextSiblingElement( "Child" ); - if ( child2 ) - { - // Finally do something useful. - @endverbatim - - And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity - of such code. A TiXmlHandle checks for null pointers so it is perfectly safe - and correct to use: - - @verbatim - TiXmlHandle docHandle( &document ); - TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement(); - if ( child2 ) - { - // do something useful - @endverbatim - - Which is MUCH more concise and useful. - - It is also safe to copy handles - internally they are nothing more than node pointers. - @verbatim - TiXmlHandle handleCopy = handle; - @endverbatim - - What they should not be used for is iteration: - - @verbatim - int i=0; - while ( true ) - { - TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement(); - if ( !child ) - break; - // do something - ++i; - } - @endverbatim - - It seems reasonable, but it is in fact two embedded while loops. The Child method is - a linear walk to find the element, so this code would iterate much more than it needs - to. Instead, prefer: - - @verbatim - TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement(); - - for( child; child; child=child->NextSiblingElement() ) - { - // do something - } - @endverbatim - */ - class D_TINY_API TiXmlHandle - { - public: - /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. - TiXmlHandle( TiXmlNode* _node ) { this->node = _node; } - /// Copy constructor - TiXmlHandle( const TiXmlHandle& ref ) { this->node = ref.node; } - - void *operator new (size_t size); - void *operator new[](size_t size); - void operator delete (void* ptr); - void operator delete[](void* ptr); - - TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; } - - /// Return a handle to the first child node. - TiXmlHandle FirstChild() const; - /// Return a handle to the first child node with the given name. - TiXmlHandle FirstChild( const char * value ) const; - /// Return a handle to the first child element. - TiXmlHandle FirstChildElement() const; - /// Return a handle to the first child element with the given name. - TiXmlHandle FirstChildElement( const char * value ) const; - - /** Return a handle to the "index" child with the given name. - The first child is 0, the second 1, etc. - */ - TiXmlHandle Child( const char* value, int index ) const; - /** Return a handle to the "index" child. - The first child is 0, the second 1, etc. - */ - TiXmlHandle Child( int index ) const; - /** Return a handle to the "index" child element with the given name. - The first child element is 0, the second 1, etc. Note that only TiXmlElements - are indexed: other types are not counted. - */ - TiXmlHandle ChildElement( const char* value, int index ) const; - /** Return a handle to the "index" child element. - The first child element is 0, the second 1, etc. Note that only TiXmlElements - are indexed: other types are not counted. - */ - TiXmlHandle ChildElement( int index ) const; - - #ifdef TIXML_USE_STL - TiXmlHandle FirstChild( const std::string& _value ) const { return FirstChild( _value.c_str() ); } - TiXmlHandle FirstChildElement( const std::string& _value ) const { return FirstChildElement( _value.c_str() ); } - - TiXmlHandle Child( const std::string& _value, int index ) const { return Child( _value.c_str(), index ); } - TiXmlHandle ChildElement( const std::string& _value, int index ) const { return ChildElement( _value.c_str(), index ); } - #endif - - /** Return the handle as a TiXmlNode. This may return null. - */ - TiXmlNode* ToNode() const { return node; } - /** Return the handle as a TiXmlElement. This may return null. - */ - TiXmlElement* ToElement() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); } - /** Return the handle as a TiXmlText. This may return null. - */ - TiXmlText* ToText() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); } - /** Return the handle as a TiXmlUnknown. This may return null. - */ - TiXmlUnknown* ToUnknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); } - - /** @deprecated use ToNode. - Return the handle as a TiXmlNode. This may return null. - */ - TiXmlNode* Node() const { return ToNode(); } - /** @deprecated use ToElement. - Return the handle as a TiXmlElement. This may return null. - */ - TiXmlElement* Element() const { return ToElement(); } - /** @deprecated use ToText() - Return the handle as a TiXmlText. This may return null. - */ - TiXmlText* Text() const { return ToText(); } - /** @deprecated use ToUnknown() - Return the handle as a TiXmlUnknown. This may return null. - */ - TiXmlUnknown* Unknown() const { return ToUnknown(); } - - private: - TiXmlNode* node; - }; - - - /** Print to memory functionality. The TiXmlPrinter is useful when you need to: - - -# Print to memory (especially in non-STL mode) - -# Control formatting (line endings, etc.) - - When constructed, the TiXmlPrinter is in its default "pretty printing" mode. - Before calling Accept() you can call methods to control the printing - of the XML document. After TiXmlNode::Accept() is called, the printed document can - be accessed via the CStr(), Str(), and Size() methods. - - TiXmlPrinter uses the Visitor API. - @verbatim - TiXmlPrinter printer; - printer.SetIndent( "\t" ); - - doc.Accept( &printer ); - fprintf( stdout, "%s", printer.CStr() ); - @endverbatim - */ - class D_TINY_API TiXmlPrinter : public TiXmlVisitor - { - public: - TiXmlPrinter() : depth( 0 ), simpleTextPrint( false ), - buffer(), indent( " " ), lineBreak( "\n" ) {} - - virtual bool VisitEnter( const TiXmlDocument& doc ); - virtual bool VisitExit( const TiXmlDocument& doc ); - - virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ); - virtual bool VisitExit( const TiXmlElement& element ); - - virtual bool Visit( const TiXmlDeclaration& declaration ); - virtual bool Visit( const TiXmlText& text ); - virtual bool Visit( const TiXmlComment& comment ); - virtual bool Visit( const TiXmlUnknown& unknown ); - - /** Set the indent characters for printing. By default 4 spaces - but tab (\t) is also useful, or null/empty string for no indentation. - */ - void SetIndent( const char* _indent ) { indent = _indent ? _indent : "" ; } - /// Query the indention string. - const char* Indent() { return indent.c_str(); } - /** Set the line breaking string. By default set to newline (\n). - Some operating systems prefer other characters, or can be - set to the null/empty string for no indenation. - */ - void SetLineBreak( const char* _lineBreak ) { lineBreak = _lineBreak ? _lineBreak : ""; } - /// Query the current line breaking string. - const char* LineBreak() { return lineBreak.c_str(); } - - /** Switch over to "stream printing" which is the most dense formatting without - linebreaks. Common when the XML is needed for network transmission. - */ - void SetStreamPrinting() { indent = ""; - lineBreak = ""; - } - /// Return the result. - const char* CStr() { return buffer.c_str(); } - /// Return the length of the result string. - size_t Size() { return buffer.size(); } - - #ifdef TIXML_USE_STL - /// Return the result. - const std::string& Str() { return buffer; } - #endif - - private: - void DoIndent() { - for( int i=0; i -#include - -#include "tinyxml.h" -namespace nd -{ - -//#define DEBUG_PARSER -#if defined( DEBUG_PARSER ) -# if defined( DEBUG ) && defined( _MSC_VER ) -# include -# define TIXML_LOG OutputDebugString -# else -# define TIXML_LOG printf -# endif -#endif - -// Note tha "PutString" hardcodes the same list. This -// is less flexible than it appears. Changing the entries -// or order will break putstring. -TiXmlBase::Entity TiXmlBase::entity[ NUM_ENTITY ] = -{ - { "&", 5, '&' }, - { "<", 4, '<' }, - { ">", 4, '>' }, - { """, 6, '\"' }, - { "'", 6, '\'' } -}; - -// Bunch of unicode info at: -// http://www.unicode.org/faq/utf_bom.html -// Including the basic of this table, which determines the #bytes in the -// sequence from the lead byte. 1 placed for invalid sequences -- -// although the result will be junk, pass it through as much as possible. -// Beware of the non-characters in UTF-8: -// ef bb bf (Microsoft "lead bytes") -// ef bf be -// ef bf bf - -const unsigned char TIXML_UTF_LEAD_0 = 0xefU; -const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; -const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; - -const int TiXmlBase::utf8ByteTable[256] = -{ - // 0 1 2 3 4 5 6 7 8 9 a b c d e f - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70 End of ASCII range - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x80 0x80 to 0xc1 invalid - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x90 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xa0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xb0 - 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xc0 0xc2 to 0xdf 2 byte - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xd0 - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xe0 0xe0 to 0xef 3 byte - 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid -}; - - -void TiXmlBase::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ) -{ - const unsigned long BYTE_MASK = 0xBF; - const unsigned long BYTE_MARK = 0x80; - const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; - - if (input < 0x80) - *length = 1; - else if ( input < 0x800 ) - *length = 2; - else if ( input < 0x10000 ) - *length = 3; - else if ( input < 0x200000 ) - *length = 4; - else - { *length = 0; return; } // This code won't covert this correctly anyway. - - output += *length; - - // Scary scary fall throughs. - switch (*length) - { - case 4: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 3: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 2: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 1: - --output; - *output = (char)(input | FIRST_BYTE_MARK[*length]); - } -} - - -/*static*/ int TiXmlBase::IsAlpha( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) -{ - // This will only work for low-ascii, everything else is assumed to be a valid - // letter. I'm not sure this is the best approach, but it is quite tricky trying - // to figure out alhabetical vs. not across encoding. So take a very - // conservative approach. - -// if ( encoding == TIXML_ENCODING_UTF8 ) -// { - if ( anyByte < 127 ) - return isalpha( anyByte ); - else - return 1; // What else to do? The unicode set is huge...get the english ones right. -// } -// else -// { -// return isalpha( anyByte ); -// } -} - - -/*static*/ int TiXmlBase::IsAlphaNum( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) -{ - // This will only work for low-ascii, everything else is assumed to be a valid - // letter. I'm not sure this is the best approach, but it is quite tricky trying - // to figure out alhabetical vs. not across encoding. So take a very - // conservative approach. - -// if ( encoding == TIXML_ENCODING_UTF8 ) -// { - if ( anyByte < 127 ) - return isalnum( anyByte ); - else - return 1; // What else to do? The unicode set is huge...get the english ones right. -// } -// else -// { -// return isalnum( anyByte ); -// } -} - - -class TiXmlParsingData -{ - friend class TiXmlDocument; - public: - void Stamp( const char* now, TiXmlEncoding encoding ); - - const TiXmlCursor& Cursor() { return cursor; } - - private: - // Only used by the document! - TiXmlParsingData( const char* start, int _tabsize, int row, int col ) - { - assert( start ); - stamp = start; - tabsize = _tabsize; - cursor.row = row; - cursor.col = col; - } - - TiXmlCursor cursor; - const char* stamp; - int tabsize; -}; - - -void TiXmlParsingData::Stamp( const char* now, TiXmlEncoding encoding ) -{ - assert( now ); - - // Do nothing if the tabsize is 0. - if ( tabsize < 1 ) - { - return; - } - - // Get the current row, column. - int row = cursor.row; - int col = cursor.col; - const char* p = stamp; - assert( p ); - - while ( p < now ) - { - // Treat p as unsigned, so we have a happy compiler. - const unsigned char* pU = (const unsigned char*)p; - - // Code contributed by Fletcher Dunn: (modified by lee) - switch (*pU) { - case 0: - // We *should* never get here, but in case we do, don't - // advance past the terminating null character, ever - return; - - case '\r': - // bump down to the next line - ++row; - col = 0; - // Eat the character - ++p; - - // Check for \r\n sequence, and treat this as a single character - if (*p == '\n') { - ++p; - } - break; - - case '\n': - // bump down to the next line - ++row; - col = 0; - - // Eat the character - ++p; - - // Check for \n\r sequence, and treat this as a single - // character. (Yes, this bizarre thing does occur still - // on some arcane platforms...) - if (*p == '\r') { - ++p; - } - break; - - case '\t': - // Eat the character - ++p; - - // Skip to next tab stop - col = (col / tabsize + 1) * tabsize; - break; - - case TIXML_UTF_LEAD_0: - if ( encoding == TIXML_ENCODING_UTF8 ) - { - if ( *(p+1) && *(p+2) ) - { - // In these cases, don't advance the column. These are - // 0-width spaces. - if ( *(pU+1)==TIXML_UTF_LEAD_1 && *(pU+2)==TIXML_UTF_LEAD_2 ) - p += 3; - else if ( *(pU+1)==0xbfU && *(pU+2)==0xbeU ) - p += 3; - else if ( *(pU+1)==0xbfU && *(pU+2)==0xbfU ) - p += 3; - else - { p +=3; ++col; } // A normal character. - } - } - else - { - ++p; - ++col; - } - break; - - default: - if ( encoding == TIXML_ENCODING_UTF8 ) - { - // Eat the 1 to 4 byte utf8 character. - int step = TiXmlBase::utf8ByteTable[*((const unsigned char*)p)]; - if ( step == 0 ) - step = 1; // Error case from bad encoding, but handle gracefully. - p += step; - - // Just advance one column, of course. - ++col; - } - else - { - ++p; - ++col; - } - break; - } - } - cursor.row = row; - cursor.col = col; - assert( cursor.row >= -1 ); - assert( cursor.col >= -1 ); - stamp = p; - assert( stamp ); -} - - -const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding ) -{ - if ( !p || !*p ) - { - return 0; - } - if ( encoding == TIXML_ENCODING_UTF8 ) - { - while ( *p ) - { - const unsigned char* pU = (const unsigned char*)p; - - // Skip the stupid Microsoft UTF-8 Byte order marks - if ( *(pU+0)==TIXML_UTF_LEAD_0 - && *(pU+1)==TIXML_UTF_LEAD_1 - && *(pU+2)==TIXML_UTF_LEAD_2 ) - { - p += 3; - continue; - } - else if(*(pU+0)==TIXML_UTF_LEAD_0 - && *(pU+1)==0xbfU - && *(pU+2)==0xbeU ) - { - p += 3; - continue; - } - else if(*(pU+0)==TIXML_UTF_LEAD_0 - && *(pU+1)==0xbfU - && *(pU+2)==0xbfU ) - { - p += 3; - continue; - } - - if ( IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) // Still using old rules for white space. - ++p; - else - break; - } - } - else - { - while ( ( *p && IsWhiteSpace( *p ) ) || *p == '\n' || *p =='\r' ) - ++p; - } - - return p; -} - -#ifdef TIXML_USE_STL -/*static*/ bool TiXmlBase::StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ) -{ - for( ;; ) - { - if ( !in->good() ) return false; - - int c = in->peek(); - // At this scope, we can't get to a document. So fail silently. - if ( !IsWhiteSpace( c ) || c <= 0 ) - return true; - - *tag += (char) in->get(); - } -} - -/*static*/ bool TiXmlBase::StreamTo( std::istream * in, int character, TIXML_STRING * tag ) -{ - //assert( character > 0 && character < 128 ); // else it won't work in utf-8 - while ( in->good() ) - { - int c = in->peek(); - if ( c == character ) - return true; - if ( c <= 0 ) // Silent failure: can't get document at this scope - return false; - - in->get(); - *tag += (char) c; - } - return false; -} -#endif - -// One of TinyXML's more performance demanding functions. Try to keep the memory overhead down. The -// "assign" optimization removes over 10% of the execution time. -// -const char* TiXmlBase::ReadName( const char* p, TIXML_STRING * name, TiXmlEncoding encoding ) -{ - // Oddly, not supported on some comilers, - //name->clear(); - // So use this: - *name = ""; - assert( p ); - - // Names start with letters or underscores. - // Of course, in unicode, tinyxml has no idea what a letter *is*. The - // algorithm is generous. - // - // After that, they can be letters, underscores, numbers, - // hyphens, or colons. (Colons are valid ony for namespaces, - // but tinyxml can't tell namespaces from names.) - if ( p && *p - && ( IsAlpha( (unsigned char) *p, encoding ) || *p == '_' ) ) - { - const char* start = p; - while( p && *p - && ( IsAlphaNum( (unsigned char ) *p, encoding ) - || *p == '_' - || *p == '-' - || *p == '.' - || *p == ':' ) ) - { - //(*name) += *p; // expensive - ++p; - } - if ( p-start > 0 ) { - name->assign( start, size_t (p-start) ); - } - return p; - } - return 0; -} - -const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXmlEncoding encoding ) -{ - // Presume an entity, and pull it out. - TIXML_STRING ent; - int i; - *length = 0; - - if ( *(p+1) && *(p+1) == '#' && *(p+2) ) - { - unsigned long ucs = 0; - ptrdiff_t delta = 0; - unsigned mult = 1; - - if ( *(p+2) == 'x' ) - { - // Hexadecimal. - if ( !*(p+3) ) return 0; - - const char* q = p+3; - q = strchr( q, ';' ); - - if ( !q || !*q ) return 0; - - delta = q-p; - --q; - - while ( *q != 'x' ) - { - if ( *q >= '0' && *q <= '9' ) - ucs += mult * (*q - '0'); - else if ( *q >= 'a' && *q <= 'f' ) - ucs += mult * (*q - 'a' + 10); - else if ( *q >= 'A' && *q <= 'F' ) - ucs += mult * (*q - 'A' + 10 ); - else - return 0; - mult *= 16; - --q; - } - } - else - { - // Decimal. - if ( !*(p+2) ) return 0; - - const char* q = p+2; - q = strchr( q, ';' ); - - if ( !q || !*q ) return 0; - - delta = q-p; - --q; - - while ( *q != '#' ) - { - if ( *q >= '0' && *q <= '9' ) - ucs += mult * (*q - '0'); - else - return 0; - mult *= 10; - --q; - } - } - if ( encoding == TIXML_ENCODING_UTF8 ) - { - // convert the UCS to UTF-8 - ConvertUTF32ToUTF8( ucs, value, length ); - } - else - { - *value = (char)ucs; - *length = 1; - } - return p + delta + 1; - } - - // Now try to match it. - for( i=0; iappend( cArr, size_t (len) ); - } - } - else - { - bool whitespace = false; - - // Remove leading white space: - p = SkipWhiteSpace( p, encoding ); - while ( p && *p - && !StringEqual( p, endTag, caseInsensitive, encoding ) ) - { - if ( *p == '\r' || *p == '\n' ) - { - whitespace = true; - ++p; - } - else if ( IsWhiteSpace( *p ) ) - { - whitespace = true; - ++p; - } - else - { - // If we've found whitespace, add it before the - // new character. Any whitespace just becomes a space. - if ( whitespace ) - { - (*text) += ' '; - whitespace = false; - } - int len; - char cArr[4] = { 0, 0, 0, 0 }; - p = GetChar( p, cArr, &len, encoding ); - if ( len == 1 ) - (*text) += cArr[0]; // more efficient - else - text->append( cArr, size_t(len) ); - } - } - } - if ( p ) - p += strlen( endTag ); - return p; -} - -#ifdef TIXML_USE_STL - -void TiXmlDocument::StreamIn( std::istream * in, TIXML_STRING * tag ) -{ - // The basic issue with a document is that we don't know what we're - // streaming. Read something presumed to be a tag (and hope), then - // identify it, and call the appropriate stream method on the tag. - // - // This "pre-streaming" will never read the closing ">" so the - // sub-tag can orient itself. - - if ( !StreamTo( in, '<', tag ) ) - { - SetError( TIXML_ERROR_PARSING_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - - while ( in->good() ) - { - int tagIndex = (int) tag->length(); - while ( in->good() && in->peek() != '>' ) - { - int c = in->get(); - if ( c <= 0 ) - { - SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); - break; - } - (*tag) += (char) c; - } - - if ( in->good() ) - { - // We now have something we presume to be a node of - // some sort. Identify it, and call the node to - // continue streaming. - TiXmlNode* node = Identify( tag->c_str() + tagIndex, TIXML_DEFAULT_ENCODING ); - - if ( node ) - { - node->StreamIn( in, tag ); - bool isElement = node->ToElement() != 0; - delete node; - node = 0; - - // If this is the root element, we're done. Parsing will be - // done by the >> operator. - if ( isElement ) - { - return; - } - } - else - { - SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - } - } - // We should have returned sooner. - SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); -} - -#endif - -const char* TiXmlDocument::Parse( const char* p, TiXmlParsingData* prevData, TiXmlEncoding encoding ) -{ - ClearError(); - - // Parse away, at the document level. Since a document - // contains nothing but other tags, most of what happens - // here is skipping white space. - if ( !p || !*p ) - { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - // Note that, for a document, this needs to come - // before the while space skip, so that parsing - // starts from the pointer we are given. - location.Clear(); - if ( prevData ) - { - location.row = prevData->cursor.row; - location.col = prevData->cursor.col; - } - else - { - location.row = 0; - location.col = 0; - } - TiXmlParsingData data( p, TabSize(), location.row, location.col ); - location = data.Cursor(); - - if ( encoding == TIXML_ENCODING_UNKNOWN ) - { - // Check for the Microsoft UTF-8 lead bytes. - const unsigned char* pU = (const unsigned char*)p; - if ( *(pU+0) && *(pU+0) == TIXML_UTF_LEAD_0 - && *(pU+1) && *(pU+1) == TIXML_UTF_LEAD_1 - && *(pU+2) && *(pU+2) == TIXML_UTF_LEAD_2 ) - { - encoding = TIXML_ENCODING_UTF8; - useMicrosoftBOM = true; - } - } - - p = SkipWhiteSpace( p, encoding ); - if ( !p ) - { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - while ( p && *p ) - { - TiXmlNode* node = Identify( p, encoding ); - if ( node ) - { - p = node->Parse( p, &data, encoding ); - LinkEndChild( node ); - } - else - { - break; - } - - // Did we get encoding info? - if ( encoding == TIXML_ENCODING_UNKNOWN - && node->ToDeclaration() ) - { - TiXmlDeclaration* dec = node->ToDeclaration(); - const char* enc = dec->Encoding(); - assert( enc ); - - if ( *enc == 0 ) - encoding = TIXML_ENCODING_UTF8; - else if ( StringEqual( enc, "UTF-8", true, TIXML_ENCODING_UNKNOWN ) ) - encoding = TIXML_ENCODING_UTF8; - else if ( StringEqual( enc, "UTF8", true, TIXML_ENCODING_UNKNOWN ) ) - encoding = TIXML_ENCODING_UTF8; // incorrect, but be nice - else - encoding = TIXML_ENCODING_LEGACY; - } - - p = SkipWhiteSpace( p, encoding ); - } - - // Was this empty? - if ( !firstChild ) { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, encoding ); - return 0; - } - - // All is well. - return p; -} - -void TiXmlDocument::SetError( int err, const char* pError, TiXmlParsingData* data, TiXmlEncoding encoding ) -{ - // The first error in a chain is more accurate - don't set again! - if ( error ) - return; - - assert( err > 0 && err < TIXML_ERROR_STRING_COUNT ); - error = true; - errorId = err; - errorDesc = errorString[ errorId ]; - - errorLocation.Clear(); - if ( pError && data ) - { - data->Stamp( pError, encoding ); - errorLocation = data->Cursor(); - } -} - - -TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding ) -{ - TiXmlNode* returnNode = 0; - - p = SkipWhiteSpace( p, encoding ); - if( !p || !*p || *p != '<' ) - { - return 0; - } - - TiXmlDocument* doc = GetDocument(); - p = SkipWhiteSpace( p, encoding ); - - if ( !p || !*p ) - { - return 0; - } - - // What is this thing? - // - Elements start with a letter or underscore, but xml is reserved. - // - Comments: "; - - if ( !StringEqual( p, startTag, false, encoding ) ) - { - document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding ); - return 0; - } - p += strlen( startTag ); - - // [ 1475201 ] TinyXML parses entities in comments - // Oops - ReadText doesn't work, because we don't want to parse the entities. - // p = ReadText( p, &value, false, endTag, false, encoding ); - // - // from the XML spec: - /* - [Definition: Comments may appear anywhere in a document outside other markup; in addition, - they may appear within the document type declaration at places allowed by the grammar. - They are not part of the document's character data; an XML processor MAY, but need not, - make it possible for an application to retrieve the text of comments. For compatibility, - the string "--" (double-hyphen) MUST NOT occur within comments.] Parameter entity - references MUST NOT be recognized within comments. - - An example of a comment: - - - */ - - value = ""; - // Keep all the white space. - while ( p && *p && !StringEqual( p, endTag, false, encoding ) ) - { - value.append( p, 1 ); - ++p; - } - if ( p ) - p += strlen( endTag ); - - return p; -} - - -const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) -{ - p = SkipWhiteSpace( p, encoding ); - if ( !p || !*p ) return 0; - -// int tabsize = 4; -// if ( document ) -// tabsize = document->TabSize(); - - if ( data ) - { - data->Stamp( p, encoding ); - location = data->Cursor(); - } - // Read the name, the '=' and the value. - const char* pErr = p; - p = ReadName( p, &name, encoding ); - if ( !p || !*p ) - { - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding ); - return 0; - } - p = SkipWhiteSpace( p, encoding ); - if ( !p || !*p || *p != '=' ) - { - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); - return 0; - } - - ++p; // skip '=' - p = SkipWhiteSpace( p, encoding ); - if ( !p || !*p ) - { - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); - return 0; - } - - const char* end; - const char SINGLE_QUOTE = '\''; - const char DOUBLE_QUOTE = '\"'; - - if ( *p == SINGLE_QUOTE ) - { - ++p; - end = "\'"; // single quote in string - p = ReadText( p, &value, false, end, false, encoding ); - } - else if ( *p == DOUBLE_QUOTE ) - { - ++p; - end = "\""; // double quote in string - p = ReadText( p, &value, false, end, false, encoding ); - } - else - { - // All attribute values should be in single or double quotes. - // But this is such a common error that the parser will try - // its best, even without them. - value = ""; - while ( p && *p // existence - && !IsWhiteSpace( *p ) && *p != '\n' && *p != '\r' // whitespace - && *p != '/' && *p != '>' ) // tag end - { - if ( *p == SINGLE_QUOTE || *p == DOUBLE_QUOTE ) { - // [ 1451649 ] Attribute values with trailing quotes not handled correctly - // We did not have an opening quote but seem to have a - // closing one. Give up and throw an error. - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); - return 0; - } - value += *p; - ++p; - } - } - return p; -} - -#ifdef TIXML_USE_STL -void TiXmlText::StreamIn( std::istream * in, TIXML_STRING * tag ) -{ - while ( in->good() ) - { - int c = in->peek(); - if ( !cdata && (c == '<' ) ) - { - return; - } - if ( c <= 0 ) - { - TiXmlDocument* document = GetDocument(); - if ( document ) - document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - - (*tag) += (char) c; - in->get(); // "commits" the peek made above - - if ( cdata && c == '>' && tag->size() >= 3 ) { - size_t len = tag->size(); - if ( (*tag)[len-2] == ']' && (*tag)[len-3] == ']' ) { - // terminator of cdata. - return; - } - } - } -} -#endif - -const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) -{ - value = ""; - TiXmlDocument* document = GetDocument(); - - if ( data ) - { - data->Stamp( p, encoding ); - location = data->Cursor(); - } - - const char* const startTag = ""; - - if ( cdata || StringEqual( p, startTag, false, encoding ) ) - { - cdata = true; - - if ( !StringEqual( p, startTag, false, encoding ) ) - { - document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding ); - return 0; - } - p += strlen( startTag ); - - // Keep all the white space, ignore the encoding, etc. - while ( p && *p - && !StringEqual( p, endTag, false, encoding ) - ) - { - value += *p; - ++p; - } - - TIXML_STRING dummy; - p = ReadText( p, &dummy, false, endTag, false, encoding ); - return p; - } - else - { - bool ignoreWhite = true; - - const char* end = "<"; - p = ReadText( p, &value, ignoreWhite, end, false, encoding ); - if ( p ) - return p-1; // don't truncate the '<' - return 0; - } -} - -#ifdef TIXML_USE_STL -void TiXmlDeclaration::StreamIn( std::istream * in, TIXML_STRING * tag ) -{ - while ( in->good() ) - { - int c = in->get(); - if ( c <= 0 ) - { - TiXmlDocument* document = GetDocument(); - if ( document ) - document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - (*tag) += (char) c; - - if ( c == '>' ) - { - // All is well. - return; - } - } -} -#endif - -const char* TiXmlDeclaration::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding ) -{ - p = SkipWhiteSpace( p, _encoding ); - // Find the beginning, find the end, and look for - // the stuff in-between. - TiXmlDocument* document = GetDocument(); - if ( !p || !*p || !StringEqual( p, "SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding ); - return 0; - } - if ( data ) - { - data->Stamp( p, _encoding ); - location = data->Cursor(); - } - p += 5; - - version = ""; - encoding = ""; - standalone = ""; - - while ( p && *p ) - { - if ( *p == '>' ) - { - ++p; - return p; - } - - p = SkipWhiteSpace( p, _encoding ); - if ( StringEqual( p, "version", true, _encoding ) ) - { - TiXmlAttribute attrib; - p = attrib.Parse( p, data, _encoding ); - version = attrib.Value(); - } - else if ( StringEqual( p, "encoding", true, _encoding ) ) - { - TiXmlAttribute attrib; - p = attrib.Parse( p, data, _encoding ); - encoding = attrib.Value(); - } - else if ( StringEqual( p, "standalone", true, _encoding ) ) - { - TiXmlAttribute attrib; - p = attrib.Parse( p, data, _encoding ); - standalone = attrib.Value(); - } - else - { - // Read over whatever it is. - while( p && *p && *p != '>' && !IsWhiteSpace( *p ) ) - ++p; - } - } - return 0; -} - -bool TiXmlText::Blank() const -{ - for ( unsigned i=0; i - - The world has many languages - Мир имеет много Ñзыков - el mundo tiene muchos idiomas - 世界有很多语言 - <РуÑÑкий название="name" ценноÑÑ‚ÑŒ="value"><имеет> - <汉语 åå­—="name" 价值="value">世界有很多语言 - "Mëtæl!" - <ä>Umlaut Element - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/utf8testverify.xml b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/utf8testverify.xml deleted file mode 100644 index 91a319df5d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dCore/tinyxml/utf8testverify.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - The world has many languages - Мир имеет много Ñзыков - el mundo tiene muchos idiomas - 世界有很多语言 - <РуÑÑкий название="name" ценноÑÑ‚ÑŒ="value"><имеет> - <汉语 åå­—="name" 价值="value">世界有很多语言 - "Mëtæl!" - <ä>Umlaut Element - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndDynamicsUpdateAvx2.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndDynamicsUpdateAvx2.cpp deleted file mode 100644 index f4375ffb65..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndDynamicsUpdateAvx2.cpp +++ /dev/null @@ -1,2276 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndDynamicsUpdateAvx2.h" - -#define D_AVX_WORK_GROUP 8 -#define D_AVX_DEFAULT_BUFFER_SIZE 1024 - -#ifdef D_NEWTON_USE_DOUBLE - D_MSV_NEWTON_ALIGN_32 - class ndAvxFloat - { - public: - inline ndAvxFloat() - { - } - - inline ndAvxFloat(const ndFloat32 val) - :m_low(_mm256_set1_pd(val)) - ,m_high(_mm256_set1_pd(val)) - { - } - - inline ndAvxFloat(const ndInt32 val) - :m_low(_mm256_castsi256_pd(_mm256_set1_epi64x(ndInt64(val)))) - ,m_high(_mm256_castsi256_pd(_mm256_set1_epi64x(ndInt64(val)))) - { - } - - inline ndAvxFloat(const __m256d low, const __m256d high) - :m_low(low) - ,m_high(high) - { - } - - inline ndAvxFloat(const ndAvxFloat& copy) - :m_low(copy.m_low) - ,m_high(copy.m_high) - { - } - - #ifdef D_SCALAR_VECTOR_CLASS - inline ndAvxFloat(const ndVector& low, const ndVector& high) - //:m_low(low.m_type) - //,m_high(high.m_type) - { - m_vector8.m_linear = low; - m_vector8.m_angular = high; - } - #else - inline ndAvxFloat(const ndVector& low, const ndVector& high) - :m_low(_mm256_set_m128d(low.m_typeHigh, low.m_typeLow)) - ,m_high(_mm256_set_m128d(high.m_typeHigh, high.m_typeLow)) - { - } - #endif - - inline ndAvxFloat(const ndAvxFloat* const baseAddr, const ndAvxFloat& index) - :m_low(_mm256_i64gather_pd(&(*baseAddr)[0], index.m_lowInt, 8)) - ,m_high(_mm256_i64gather_pd(&(*baseAddr)[0], index.m_highInt, 8)) - { - } - - inline ndFloat32& operator[] (ndInt32 i) - { - ndAssert(i >= 0); - ndAssert(i < D_AVX_WORK_GROUP); - ndFloat32* const ptr = (ndFloat32*)&m_low; - return ptr[i]; - } - - inline const ndFloat32& operator[] (ndInt32 i) const - { - ndAssert(i >= 0); - ndAssert(i < D_AVX_WORK_GROUP); - const ndFloat32* const ptr = (ndFloat32*)&m_low; - return ptr[i]; - } - - inline ndAvxFloat& operator= (const ndAvxFloat& A) - { - m_low = A.m_low; - m_high = A.m_high; - return *this; - } - - inline ndAvxFloat operator+ (const ndAvxFloat& A) const - { - return ndAvxFloat(_mm256_add_pd(m_low, A.m_low), _mm256_add_pd(m_high, A.m_high)); - } - - inline ndAvxFloat operator- (const ndAvxFloat& A) const - { - return ndAvxFloat(_mm256_sub_pd(m_low, A.m_low), _mm256_sub_pd(m_high, A.m_high)); - } - - inline ndAvxFloat operator* (const ndAvxFloat& A) const - { - return ndAvxFloat(_mm256_mul_pd(m_low, A.m_low), _mm256_mul_pd(m_high, A.m_high)); - } - - inline ndAvxFloat MulAdd(const ndAvxFloat& A, const ndAvxFloat& B) const - { - return ndAvxFloat(_mm256_fmadd_pd(A.m_low, B.m_low, m_low), _mm256_fmadd_pd(A.m_high, B.m_high, m_high)); - } - - inline ndAvxFloat MulSub(const ndAvxFloat& A, const ndAvxFloat& B) const - { - return ndAvxFloat(_mm256_fnmadd_pd(A.m_low, B.m_low, m_low), _mm256_fnmadd_pd(A.m_high, B.m_high, m_high)); - } - - inline ndAvxFloat operator> (const ndAvxFloat& A) const - { - return ndAvxFloat(_mm256_cmp_pd(m_low, A.m_low, _CMP_GT_OQ), _mm256_cmp_pd(m_high, A.m_high, _CMP_GT_OQ)); - } - - inline ndAvxFloat operator< (const ndAvxFloat& A) const - { - return ndAvxFloat(_mm256_cmp_pd(m_low, A.m_low, _CMP_LT_OQ), _mm256_cmp_pd(m_high, A.m_high, _CMP_LT_OQ)); - } - - inline ndAvxFloat operator| (const ndAvxFloat& A) const - { - return ndAvxFloat(_mm256_or_pd(m_low, A.m_low), _mm256_or_pd(m_high, A.m_high)); - } - - inline ndAvxFloat operator& (const ndAvxFloat& A) const - { - return ndAvxFloat(_mm256_and_pd(m_low, A.m_low), _mm256_and_pd(m_high, A.m_high)); - } - - inline ndAvxFloat GetMin(const ndAvxFloat& A) const - { - return ndAvxFloat(_mm256_min_pd(m_low, A.m_low), _mm256_min_pd(m_high, A.m_high)); - } - - inline ndAvxFloat GetMax(const ndAvxFloat& A) const - { - return ndAvxFloat(_mm256_max_pd(m_low, A.m_low), _mm256_max_pd(m_high, A.m_high)); - } - - inline ndAvxFloat Select(const ndAvxFloat& data, const ndAvxFloat& mask) const - { - // (((b ^ a) & mask)^a) - //return _mm_or_ps (_mm_and_ps (mask.m_type, data.m_type), _mm_andnot_ps(mask.m_type, m_type)); - //return _mm256_xor_ps(m_type, _mm256_and_ps(mask.m_type, _mm256_xor_ps(m_type, data.m_type))); - __m256d low (_mm256_xor_pd(m_low, _mm256_and_pd(mask.m_low, _mm256_xor_pd(m_low, data.m_low)))); - __m256d high(_mm256_xor_pd(m_high, _mm256_and_pd(mask.m_high, _mm256_xor_pd(m_high, data.m_high)))); - return ndAvxFloat(low, high); - } - - inline ndVector GetLow() const - { - return m_vector8.m_linear; - } - - inline ndVector GetHigh() const - { - return m_vector8.m_angular; - } - - inline ndFloat32 GetMax() const - { - __m256d tmp0(_mm256_max_pd(m_low, m_high)); - __m256d tmp1(_mm256_max_pd(tmp0, _mm256_permute2f128_pd(tmp0, tmp0, 1))); - __m256d tmp2(_mm256_max_pd(tmp1, _mm256_unpackhi_pd(tmp1, tmp1))); - return _mm256_cvtsd_f64(tmp2); - } - - inline ndFloat32 AddHorizontal() const - { - __m256d tmp0(_mm256_add_pd(m_low, m_high)); - __m256d tmp1(_mm256_add_pd(tmp0, _mm256_permute2f128_pd(tmp0, tmp0, 1))); - __m256d tmp2(_mm256_add_pd(tmp1, _mm256_unpackhi_pd(tmp1, tmp1))); - return _mm256_cvtsd_f64(tmp2); - } - - static inline void FlushRegisters() - { - _mm256_zeroall(); - } - - static inline void Transpose( - __m256d& dst0, __m256d& dst1, __m256d& dst2, __m256d& dst3, - const __m256d& src0, const __m256d& src1, const __m256d& src2, const __m256d& src3) - { - __m256d tmp[4]; - tmp[0] = _mm256_permute2f128_pd(src0, src2, 0x20); - tmp[1] = _mm256_permute2f128_pd(src1, src3, 0x20); - tmp[2] = _mm256_permute2f128_pd(src0, src2, 0x31); - tmp[3] = _mm256_permute2f128_pd(src1, src3, 0x31); - - dst0 = _mm256_unpacklo_pd(tmp[0], tmp[1]); - dst1 = _mm256_unpackhi_pd(tmp[0], tmp[1]); - dst2 = _mm256_unpacklo_pd(tmp[2], tmp[3]); - dst3 = _mm256_unpackhi_pd(tmp[2], tmp[3]); - } - - static inline void Transpose( - ndAvxFloat& dst0, ndAvxFloat& dst1, ndAvxFloat& dst2, ndAvxFloat& dst3, - ndAvxFloat& dst4, ndAvxFloat& dst5, ndAvxFloat& dst6, ndAvxFloat& dst7, - const ndAvxFloat& src0, const ndAvxFloat& src1, const ndAvxFloat& src2, const ndAvxFloat& src3, - const ndAvxFloat& src4, const ndAvxFloat& src5, const ndAvxFloat& src6, const ndAvxFloat& src7) - { - Transpose( - dst0.m_low, dst1.m_low, dst2.m_low, dst3.m_low, - src0.m_low, src1.m_low, src2.m_low, src3.m_low); - - Transpose( - dst0.m_high, dst1.m_high, dst2.m_high, dst3.m_high, - src4.m_low, src5.m_low, src6.m_low, src7.m_low); - - Transpose( - dst4.m_low, dst5.m_low, dst6.m_low, dst7.m_low, - src0.m_high, src1.m_high, src2.m_high, src3.m_high); - - Transpose( - dst4.m_high, dst5.m_high, dst6.m_high, dst7.m_high, - src4.m_high, src5.m_high, src6.m_high, src7.m_high); - } - - union - { - struct - { - __m256d m_low; - __m256d m_high; - }; - struct - { - __m256i m_lowInt; - __m256i m_highInt; - }; - ndJacobian m_vector8; - ndInt64 m_int[D_AVX_WORK_GROUP]; - }; - - static ndAvxFloat m_one; - static ndAvxFloat m_zero; - static ndAvxFloat m_mask; - static ndAvxFloat m_ordinals; - } D_GCC_NEWTON_ALIGN_32; - -#else - D_MSV_NEWTON_ALIGN_32 - class ndAvxFloat - { - public: - #ifndef PERMUTE_MASK - #define PERMUTE_MASK(w, z, y, x) _MM_SHUFFLE (w, z, y, x) - #endif - - inline ndAvxFloat() - { - } - - inline ndAvxFloat(const ndFloat32 val) - :m_type(_mm256_set1_ps(val)) - { - } - - inline ndAvxFloat(const ndInt32 val) - :m_type(_mm256_castsi256_ps(_mm256_set1_epi32(val))) - { - } - - inline ndAvxFloat(const __m256 type) - : m_type(type) - { - } - - inline ndAvxFloat(const ndAvxFloat& copy) - : m_type(copy.m_type) - { - } - - inline ndAvxFloat(const ndVector& low, const ndVector& high) - #ifdef D_SCALAR_VECTOR_CLASS - :m_type(_mm256_set_m128(_mm_set_ps(high.m_w, high.m_z, high.m_y, high.m_x), _mm_set_ps(low.m_w, low.m_z, low.m_y, low.m_x))) - #else - :m_type(_mm256_set_m128(high.m_type, low.m_type)) - #endif - { - } - - inline ndAvxFloat(const ndAvxFloat* const baseAddr, const ndAvxFloat& index) - : m_type(_mm256_i32gather_ps(&(*baseAddr)[0], index.m_typeInt, 4)) - { - } - - inline ndFloat32& operator[] (ndInt32 i) - { - ndAssert(i >= 0); - ndAssert(i < D_AVX_WORK_GROUP); - ndFloat32* const ptr = (ndFloat32*)&m_type; - return ptr[i]; - } - - inline const ndFloat32& operator[] (ndInt32 i) const - { - ndAssert(i >= 0); - ndAssert(i < D_AVX_WORK_GROUP); - const ndFloat32* const ptr = (ndFloat32*)&m_type; - return ptr[i]; - } - - inline ndAvxFloat& operator= (const ndAvxFloat& A) - { - m_type = A.m_type; - return *this; - } - - inline ndAvxFloat operator+ (const ndAvxFloat& A) const - { - return _mm256_add_ps(m_type, A.m_type); - } - - inline ndAvxFloat operator- (const ndAvxFloat& A) const - { - return _mm256_sub_ps(m_type, A.m_type); - } - - inline ndAvxFloat operator* (const ndAvxFloat& A) const - { - return _mm256_mul_ps(m_type, A.m_type); - } - - inline ndAvxFloat MulAdd(const ndAvxFloat& A, const ndAvxFloat& B) const - { - return _mm256_fmadd_ps(A.m_type, B.m_type, m_type); - } - - inline ndAvxFloat MulSub(const ndAvxFloat& A, const ndAvxFloat& B) const - { - return _mm256_fnmadd_ps(A.m_type, B.m_type, m_type); - } - - inline ndAvxFloat operator> (const ndAvxFloat& A) const - { - return _mm256_cmp_ps(m_type, A.m_type, _CMP_GT_OQ); - } - - inline ndAvxFloat operator< (const ndAvxFloat& A) const - { - return _mm256_cmp_ps(m_type, A.m_type, _CMP_LT_OQ); - } - - inline ndAvxFloat operator| (const ndAvxFloat& A) const - { - return _mm256_or_ps(m_type, A.m_type); - } - - inline ndAvxFloat operator& (const ndAvxFloat& A) const - { - return _mm256_and_ps(m_type, A.m_type); - } - - inline ndAvxFloat GetMin(const ndAvxFloat& A) const - { - return _mm256_min_ps(m_type, A.m_type); - } - - inline ndAvxFloat GetMax(const ndAvxFloat& A) const - { - return _mm256_max_ps(m_type, A.m_type); - } - - inline ndAvxFloat Select(const ndAvxFloat& data, const ndAvxFloat& mask) const - { - // (((b ^ a) & mask)^a) - //return _mm_or_ps (_mm_and_ps (mask.m_type, data.m_type), _mm_andnot_ps(mask.m_type, m_type)); - return _mm256_xor_ps(m_type, _mm256_and_ps(mask.m_type, _mm256_xor_ps(m_type, data.m_type))); - } - - inline ndVector GetLow() const - { - return m_vector8.m_linear; - } - - inline ndVector GetHigh() const - { - return m_vector8.m_angular; - } - - inline ndFloat32 GetMax() const - { - __m128 tmp0(_mm_max_ps(m_typeLow, m_typeHigh)); - __m128 tmp1(_mm_max_ps(tmp0, _mm_movehl_ps(tmp0, tmp0))); - __m128 tmp2(_mm_max_ps(tmp1, _mm_shuffle_ps(tmp1, tmp1, PERMUTE_MASK(2, 3, 0, 1)))); - return _mm_cvtss_f32(tmp2); - } - - inline ndFloat32 AddHorizontal() const - { - __m128 tmp0(_mm_add_ps(m_typeLow, m_typeHigh)); - __m128 tmp1(_mm_add_ps(tmp0, _mm_movehl_ps(tmp0, tmp0))); - __m128 tmp2(_mm_add_ps(tmp1, _mm_shuffle_ps(tmp1, tmp1, PERMUTE_MASK(2, 3, 0, 1)))); - return _mm_cvtss_f32(tmp2); - } - - static inline void FlushRegisters() - { - _mm256_zeroall(); - } - - static inline void Transpose( - ndAvxFloat& dst0, ndAvxFloat& dst1, ndAvxFloat& dst2, ndAvxFloat& dst3, - ndAvxFloat& dst4, ndAvxFloat& dst5, ndAvxFloat& dst6, ndAvxFloat& dst7, - const ndAvxFloat& src0, const ndAvxFloat& src1, const ndAvxFloat& src2, const ndAvxFloat& src3, - const ndAvxFloat& src4, const ndAvxFloat& src5, const ndAvxFloat& src6, const ndAvxFloat& src7) - { - ndAvxFloat blocks4x4[8]; - - blocks4x4[0].m_type = _mm256_permute2f128_ps(src0.m_type, src4.m_type, 0x20); - blocks4x4[1].m_type = _mm256_permute2f128_ps(src0.m_type, src4.m_type, 0x31); - blocks4x4[2].m_type = _mm256_permute2f128_ps(src1.m_type, src5.m_type, 0x20); - blocks4x4[3].m_type = _mm256_permute2f128_ps(src1.m_type, src5.m_type, 0x31); - blocks4x4[4].m_type = _mm256_permute2f128_ps(src2.m_type, src6.m_type, 0x20); - blocks4x4[5].m_type = _mm256_permute2f128_ps(src2.m_type, src6.m_type, 0x31); - blocks4x4[6].m_type = _mm256_permute2f128_ps(src3.m_type, src7.m_type, 0x20); - blocks4x4[7].m_type = _mm256_permute2f128_ps(src3.m_type, src7.m_type, 0x31); - - ndAvxFloat blocks2x2[8]; - blocks2x2[0].m_type = _mm256_unpacklo_ps(blocks4x4[0].m_type, blocks4x4[4].m_type); - blocks2x2[1].m_type = _mm256_unpackhi_ps(blocks4x4[0].m_type, blocks4x4[4].m_type); - blocks2x2[2].m_type = _mm256_unpacklo_ps(blocks4x4[1].m_type, blocks4x4[5].m_type); - blocks2x2[3].m_type = _mm256_unpackhi_ps(blocks4x4[1].m_type, blocks4x4[5].m_type); - blocks2x2[4].m_type = _mm256_unpacklo_ps(blocks4x4[2].m_type, blocks4x4[6].m_type); - blocks2x2[5].m_type = _mm256_unpackhi_ps(blocks4x4[2].m_type, blocks4x4[6].m_type); - blocks2x2[6].m_type = _mm256_unpacklo_ps(blocks4x4[3].m_type, blocks4x4[7].m_type); - blocks2x2[7].m_type = _mm256_unpackhi_ps(blocks4x4[3].m_type, blocks4x4[7].m_type); - - dst0.m_type = _mm256_unpacklo_ps(blocks2x2[0].m_type, blocks2x2[4].m_type); - dst1.m_type = _mm256_unpackhi_ps(blocks2x2[0].m_type, blocks2x2[4].m_type); - dst2.m_type = _mm256_unpacklo_ps(blocks2x2[1].m_type, blocks2x2[5].m_type); - dst3.m_type = _mm256_unpackhi_ps(blocks2x2[1].m_type, blocks2x2[5].m_type); - dst4.m_type = _mm256_unpacklo_ps(blocks2x2[2].m_type, blocks2x2[6].m_type); - dst5.m_type = _mm256_unpackhi_ps(blocks2x2[2].m_type, blocks2x2[6].m_type); - dst6.m_type = _mm256_unpacklo_ps(blocks2x2[3].m_type, blocks2x2[7].m_type); - dst7.m_type = _mm256_unpackhi_ps(blocks2x2[3].m_type, blocks2x2[7].m_type); - } - - union - { - __m256 m_type; - __m256i m_typeInt; - struct - { - __m128 m_typeLow; - __m128 m_typeHigh; - }; - ndJacobian m_vector8; - ndInt32 m_int[D_AVX_WORK_GROUP]; - }; - - static ndAvxFloat m_one; - static ndAvxFloat m_zero; - static ndAvxFloat m_mask; - static ndAvxFloat m_ordinals; - } D_GCC_NEWTON_ALIGN_32; -#endif - -ndAvxFloat ndAvxFloat::m_one(ndFloat32(1.0f)); -ndAvxFloat ndAvxFloat::m_zero(ndFloat32 (0.0f)); -ndAvxFloat ndAvxFloat::m_ordinals(ndVector(0, 1, 2, 3), ndVector(4, 5, 6, 7)); -ndAvxFloat ndAvxFloat::m_mask(ndVector(-1, -1, -1, -1), ndVector(-1, -1, -1, -1)); - -D_MSV_NEWTON_ALIGN_32 -class ndAvxVector3 -{ - public: - ndAvxFloat m_x; - ndAvxFloat m_y; - ndAvxFloat m_z; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndAvxVector6 -{ - public: - ndAvxVector3 m_linear; - ndAvxVector3 m_angular; -} D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndOpenclJacobianPair -{ - public: - ndAvxVector6 m_jacobianM0; - ndAvxVector6 m_jacobianM1; -}D_GCC_NEWTON_ALIGN_32; - -D_MSV_NEWTON_ALIGN_32 -class ndSoaMatrixElement -{ - public: - ndOpenclJacobianPair m_Jt; - ndOpenclJacobianPair m_JMinv; - - ndAvxFloat m_force; - ndAvxFloat m_diagDamp; - ndAvxFloat m_invJinvMJt; - ndAvxFloat m_coordenateAccel; - ndAvxFloat m_normalForceIndex; - ndAvxFloat m_lowerBoundFrictionCoefficent; - ndAvxFloat m_upperBoundFrictionCoefficent; -} D_GCC_NEWTON_ALIGN_32; - -class ndAvxMatrixArray : public ndArray -{ -}; - -ndDynamicsUpdateAvx2::ndDynamicsUpdateAvx2(ndWorld* const world) - :ndDynamicsUpdate(world) - ,m_groupType(D_AVX_DEFAULT_BUFFER_SIZE) - ,m_jointMask(D_AVX_DEFAULT_BUFFER_SIZE) - ,m_avxJointRows(D_AVX_DEFAULT_BUFFER_SIZE) - ,m_avxMassMatrixArray(new ndAvxMatrixArray) -{ -} - -ndDynamicsUpdateAvx2::~ndDynamicsUpdateAvx2() -{ - Clear(); - m_jointMask.Resize(D_AVX_DEFAULT_BUFFER_SIZE); - m_groupType.Resize(D_AVX_DEFAULT_BUFFER_SIZE); - m_avxJointRows.Resize(D_AVX_DEFAULT_BUFFER_SIZE); - delete m_avxMassMatrixArray; -} - -const char* ndDynamicsUpdateAvx2::GetStringId() const -{ - return "avx2"; -} - -void ndDynamicsUpdateAvx2::DetermineSleepStates() -{ - D_TRACKTIME(); - ndAtomic iterator(0); - auto CalculateSleepState = ndMakeObject::ndFunction([this, &iterator](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CalculateSleepState); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyIndex = GetJointForceIndexBuffer(); - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - ndConstraint** const jointArray = &scene->GetActiveContactArray()[0]; - ndBodyKinematic** const bodyArray = &scene->GetActiveBodyArray()[0]; - - const ndVector zero(ndVector::m_zero); - const ndInt32 bodyCount = ndInt32 (bodyIndex.GetCount()) - 1; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < bodyCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((bodyCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : bodyCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 m = i + j; - const ndInt32 index = bodyIndex[m]; - ndBodyKinematic* const body = bodyArray[jointBodyPairIndexBuffer[index].m_body]; - ndAssert(body->m_isStatic <= 1); - ndAssert(body->m_index == jointBodyPairIndexBuffer[index].m_body); - const ndInt32 mask = ndInt32(body->m_isStatic) - 1; - const ndInt32 count = mask & (bodyIndex[m + 1] - index); - if (count) - { - ndUnsigned8 equilibrium = body->m_isJointFence0; - if (equilibrium & body->m_autoSleep) - { - for (ndInt32 k = 0; k < count; ++k) - { - const ndJointBodyPairIndex& scan = jointBodyPairIndexBuffer[index + k]; - ndConstraint* const joint = jointArray[scan.m_joint >> 1]; - ndBodyKinematic* const body1 = (joint->GetBody0() == body) ? joint->GetBody1() : joint->GetBody0(); - ndAssert(body1 != body); - equilibrium = ndUnsigned8(equilibrium & body1->m_isJointFence0); - } - } - body->m_equilibrium = ndUnsigned8(equilibrium & body->m_autoSleep); - if (body->m_equilibrium) - { - body->m_veloc = zero; - body->m_omega = zero; - } - } - } - } - }); - - ndScene* const scene = m_world->GetScene(); - if (scene->GetActiveContactArray().GetCount()) - { - scene->ParallelExecute(CalculateSleepState); - } -} - -void ndDynamicsUpdateAvx2::SortJoints() -{ - D_TRACKTIME(); - SortJointsScan(); - if (!m_activeJointCount) - { - return; - } - - ndScene* const scene = m_world->GetScene(); - ndArray& jointArray = scene->GetActiveContactArray(); - - #ifdef _DEBUG - for (ndInt32 i = 1; i < m_activeJointCount; ++i) - { - ndConstraint* const joint0 = jointArray[i - 1]; - ndConstraint* const joint1 = jointArray[i - 0]; - ndAssert(!joint0->m_resting); - ndAssert(!joint1->m_resting); - ndAssert(joint0->m_rowCount >= joint1->m_rowCount); - ndAssert(!(joint0->GetBody0()->m_equilibrium0 & joint0->GetBody1()->m_equilibrium0)); - ndAssert(!(joint1->GetBody0()->m_equilibrium0 & joint1->GetBody1()->m_equilibrium0)); - } - - for (ndInt32 i = m_activeJointCount + 1; i < ndInt32 (jointArray.GetCount()); ++i) - { - ndConstraint* const joint0 = jointArray[i - 1]; - ndConstraint* const joint1 = jointArray[i - 0]; - ndAssert(joint0->m_resting); - ndAssert(joint1->m_resting); - ndAssert(joint0->m_rowCount >= joint1->m_rowCount); - ndAssert(joint0->GetBody0()->m_equilibrium0 & joint0->GetBody1()->m_equilibrium0); - ndAssert(joint1->GetBody0()->m_equilibrium0 & joint1->GetBody1()->m_equilibrium0); - } - #endif - - const ndInt32 mask = -ndInt32(D_AVX_WORK_GROUP); - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - const ndInt32 soaJointCount = (jointCount + D_AVX_WORK_GROUP - 1) & mask; - ndAssert(jointArray.GetCapacity() > soaJointCount); - ndConstraint** const jointArrayPtr = &jointArray[0]; - for (ndInt32 i = jointCount; i < soaJointCount; ++i) - { - jointArrayPtr[i] = nullptr; - } - - if (m_activeJointCount - jointArray.GetCount()) - { - const ndInt32 base = m_activeJointCount & mask; - const ndInt32 count = jointArrayPtr[base + D_AVX_WORK_GROUP - 1] ? D_AVX_WORK_GROUP : ndInt32 (jointArray.GetCount()) - base; - ndAssert(count <= D_AVX_WORK_GROUP); - ndConstraint** const array = &jointArrayPtr[base]; - for (ndInt32 j = 1; j < count; ++j) - { - ndInt32 slot = j; - ndConstraint* const joint = array[slot]; - for (; (slot > 0) && array[slot - 1] && (array[slot - 1]->m_rowCount < joint->m_rowCount); slot--) - { - array[slot] = array[slot - 1]; - } - array[slot] = joint; - } - } - - const ndInt32 soaJointCountBatches = soaJointCount / D_AVX_WORK_GROUP; - m_jointMask.SetCount(soaJointCountBatches); - m_groupType.SetCount(soaJointCountBatches); - m_avxJointRows.SetCount(soaJointCountBatches); - - ndInt32 rowsCount = 0; - ndInt32 soaJointRowCount = 0; - auto SetRowStarts = ndMakeObject::ndFunction([this, &jointArray, &rowsCount, &soaJointRowCount](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(SetRowStarts); - auto SetRowsCount = [&jointArray, &rowsCount]() - { - ndInt32 rowCount = 1; - const ndInt32 count = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = 0; i < count; ++i) - { - ndConstraint* const joint = jointArray[i]; - joint->m_rowStart = rowCount; - rowCount += joint->m_rowCount; - } - rowsCount = rowCount; - }; - - auto SetSoaRowsCount = [this, &jointArray, &soaJointRowCount]() - { - ndInt32 rowCount = 0; - ndArray& soaJointRows = m_avxJointRows; - const ndInt32 count = ndInt32 (soaJointRows.GetCount()); - for (ndInt32 i = 0; i < count; ++i) - { - const ndConstraint* const joint = jointArray[i * D_AVX_WORK_GROUP]; - soaJointRows[i] = rowCount; - rowCount += joint->m_rowCount; - } - soaJointRowCount = rowCount; - }; - - if (threadCount == 1) - { - SetRowsCount(); - SetSoaRowsCount(); - } - else if (threadIndex == 0) - { - SetRowsCount(); - } - else if (threadIndex == 1) - { - SetSoaRowsCount(); - } - }); - scene->ParallelExecute(SetRowStarts); - - m_leftHandSide.SetCount(rowsCount); - m_rightHandSide.SetCount(rowsCount); - m_avxMassMatrixArray->SetCount(soaJointRowCount); - - #ifdef _DEBUG - ndAssert(m_activeJointCount <= jointArray.GetCount()); - const ndInt32 maxRowCount = ndInt32 (m_leftHandSide.GetCount()); - for (ndInt32 i = 0; i < ndInt32 (jointArray.GetCount()); ++i) - { - ndConstraint* const joint = jointArray[i]; - ndAssert(joint->m_rowStart < ndInt32 (m_leftHandSide.GetCount())); - ndAssert((joint->m_rowStart + joint->m_rowCount) <= maxRowCount); - } - - for (ndInt32 i = 0; i < jointCount; i += D_AVX_WORK_GROUP) - { - const ndInt32 count = jointArrayPtr[i + D_AVX_WORK_GROUP - 1] ? D_AVX_WORK_GROUP : jointCount - i; - for (ndInt32 j = 1; j < count; ++j) - { - ndConstraint* const joint0 = jointArrayPtr[i + j - 1]; - ndConstraint* const joint1 = jointArrayPtr[i + j - 0]; - ndAssert(joint0->m_rowCount >= joint1->m_rowCount); - } - } - #endif - SortBodyJointScan(); -} - -void ndDynamicsUpdateAvx2::SortIslands() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyArray = scene->GetActiveBodyArray(); - ndArray& activeBodyArray = GetBodyIslandOrder(); - GetInternalForces().SetCount(bodyArray.GetCount()); - activeBodyArray.SetCount(bodyArray.GetCount()); - - ndInt32 histogram[D_MAX_THREADS_COUNT][3]; - auto Scan0 = ndMakeObject::ndFunction([&bodyArray, &histogram](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(Scan0); - ndInt32* const hist = &histogram[threadIndex][0]; - hist[0] = 0; - hist[1] = 0; - hist[2] = 0; - - ndInt32 map[4]; - map[0] = 0; - map[1] = 1; - map[2] = 2; - map[3] = 2; - const ndStartEnd startEnd(ndInt32 (bodyArray.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndBodyKinematic* const body = bodyArray[i]; - ndInt32 key = map[body->m_equilibrium0 * 2 + 1 - body->m_isConstrained]; - ndAssert(key < 3); - hist[key] = hist[key] + 1; - } - }); - - auto Sort0 = ndMakeObject::ndFunction([&bodyArray, &activeBodyArray, &histogram](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(Sort0); - ndInt32* const hist = &histogram[threadIndex][0]; - - ndInt32 map[4]; - map[0] = 0; - map[1] = 1; - map[2] = 2; - map[3] = 2; - - const ndStartEnd startEnd(ndInt32(bodyArray.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndBodyKinematic* const body = bodyArray[i]; - ndInt32 key = map[body->m_equilibrium0 * 2 + 1 - body->m_isConstrained]; - ndAssert(key < 3); - const ndInt32 entry = hist[key]; - activeBodyArray[entry] = body; - hist[key] = entry + 1; - } - }); - - scene->ParallelExecute(Scan0); - - ndInt32 scan[3]; - scan[0] = 0; - scan[1] = 0; - scan[2] = 0; - const ndInt32 threadCount = scene->GetThreadCount(); - - ndInt32 sum = 0; - for (ndInt32 i = 0; i < 3; ++i) - { - for (ndInt32 j = 0; j < threadCount; ++j) - { - ndInt32 partialSum = histogram[j][i]; - histogram[j][i] = sum; - sum += partialSum; - } - scan[i] = sum; - } - - scene->ParallelExecute(Sort0); - activeBodyArray.SetCount(scan[1]); - m_unConstrainedBodyCount = scan[1] - scan[0]; -} - -void ndDynamicsUpdateAvx2::BuildIsland() -{ - m_unConstrainedBodyCount = 0; - GetBodyIslandOrder().SetCount(0); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyArray = scene->GetActiveBodyArray(); - ndAssert(bodyArray.GetCount() >= 1); - if (bodyArray.GetCount() - 1) - { - D_TRACKTIME(); - SortJoints(); - SortIslands(); - } -} - -void ndDynamicsUpdateAvx2::IntegrateUnconstrainedBodies() -{ - ndScene* const scene = m_world->GetScene(); - ndAtomic iterator(0); - auto IntegrateUnconstrainedBodies = ndMakeObject::ndFunction([this, &iterator, &scene](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(IntegrateUnconstrainedBodies); - ndArray& bodyArray = GetBodyIslandOrder(); - - const ndFloat32 timestep = scene->GetTimestep(); - const ndInt32 base = ndInt32 (bodyArray.GetCount() - GetUnconstrainedBodyCount()); - - const ndInt32 count = GetUnconstrainedBodyCount(); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[base + i + j]; - ndAssert(body); - body->UpdateInvInertiaMatrix(); - body->AddDampingAcceleration(timestep); - body->IntegrateExternalForce(timestep); - } - } - }); - - if (GetUnconstrainedBodyCount()) - { - D_TRACKTIME(); - scene->ParallelExecute(IntegrateUnconstrainedBodies); - } -} - -void ndDynamicsUpdateAvx2::IntegrateBodies() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndVector invTime(m_invTimestep); - const ndFloat32 timestep = scene->GetTimestep(); - - ndAtomic iterator(0); - auto IntegrateBodies = ndMakeObject::ndFunction([this, &iterator, timestep, invTime](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(IntegrateBodies); - const ndWorld* const world = m_world; - const ndArray& bodyArray = GetBodyIslandOrder(); - - const ndFloat32 speedFreeze2 = world->m_freezeSpeed2; - const ndFloat32 accelFreeze2 = world->m_freezeAccel2; - - const ndInt32 count = ndInt32 (bodyArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - if (!body->m_equilibrium) - { - body->SetAcceleration(invTime * (body->m_veloc - body->m_accel), invTime * (body->m_omega - body->m_alpha)); - body->IntegrateVelocity(timestep); - } - body->EvaluateSleepState(speedFreeze2, accelFreeze2); - } - } - }); - scene->ParallelExecute(IntegrateBodies); -} - -void ndDynamicsUpdateAvx2::InitWeights() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - m_invTimestep = ndFloat32(1.0f) / m_timestep; - m_invStepRK = ndFloat32(0.25f); - m_timestepRK = m_timestep * m_invStepRK; - m_invTimestepRK = m_invTimestep * ndFloat32(4.0f); - - const ndArray& bodyArray = scene->GetActiveBodyArray(); - const ndInt32 bodyCount = ndInt32 (bodyArray.GetCount()); - GetInternalForces().SetCount(bodyCount); - - ndInt32 extraPassesArray[D_MAX_THREADS_COUNT]; - - ndAtomic iterator(0); - auto InitWeights = ndMakeObject::ndFunction([this, &iterator, &bodyArray, &extraPassesArray](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(InitWeights); - const ndArray& jointForceIndexBuffer = GetJointForceIndexBuffer(); - const ndArray& jointBodyPairIndex = GetJointBodyPairIndexBuffer(); - - ndInt32 maxExtraPasses = 1; - const ndInt32 jointCount = ndInt32 (jointForceIndexBuffer.GetCount()) - 1; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < jointCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((jointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : jointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 index = jointForceIndexBuffer[i + j]; - const ndJointBodyPairIndex& scan = jointBodyPairIndex[index]; - ndBodyKinematic* const body = bodyArray[scan.m_body]; - ndAssert(body->m_index == scan.m_body); - ndAssert(body->m_isConstrained <= 1); - const ndInt32 count = jointForceIndexBuffer[i + j + 1] - index - 1; - const ndInt32 mask = -ndInt32(body->m_isConstrained & ~body->m_isStatic); - const ndInt32 weigh = 1 + (mask & count); - ndAssert(weigh >= 0); - if (weigh) - { - body->m_weigh = ndFloat32(weigh); - } - maxExtraPasses = ndMax(weigh, maxExtraPasses); - } - } - extraPassesArray[threadIndex] = maxExtraPasses; - }); - - if (scene->GetActiveContactArray().GetCount()) - { - - scene->ParallelExecute(InitWeights); - - ndInt32 extraPasses = 0; - const ndInt32 threadCount = scene->GetThreadCount(); - for (ndInt32 i = 0; i < threadCount; ++i) - { - extraPasses = ndMax(extraPasses, extraPassesArray[i]); - } - - const ndInt32 conectivity = 7; - m_solverPasses = ndUnsigned32(m_world->GetSolverIterations() + 2 * extraPasses / conectivity + 2); - } -} - -void ndDynamicsUpdateAvx2::InitBodyArray() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndFloat32 timestep = scene->GetTimestep(); - - ndAtomic iterator(0); - auto InitBodyArray = ndMakeObject::ndFunction([this, &iterator, timestep](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitBodyArray); - const ndArray& bodyArray = GetBodyIslandOrder(); - - const ndInt32 count = ndInt32 (bodyArray.GetCount() - GetUnconstrainedBodyCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - ndAssert(body); - ndAssert(body->m_isConstrained | body->m_isStatic); - - body->UpdateInvInertiaMatrix(); - body->AddDampingAcceleration(timestep); - const ndVector angularMomentum(body->CalculateAngularMomentum()); - body->m_gyroTorque = body->m_omega.CrossProduct(angularMomentum); - body->m_gyroAlpha = body->m_invWorldInertiaMatrix.RotateVector(body->m_gyroTorque); - - body->m_accel = body->m_veloc; - body->m_alpha = body->m_omega; - body->m_gyroRotation = body->m_rotation; - } - } - }); - scene->ParallelExecute(InitBodyArray); -} - -void ndDynamicsUpdateAvx2::GetJacobianDerivatives(ndConstraint* const joint) -{ - ndConstraintDescritor constraintParam; - ndAssert(joint->GetRowsCount() <= D_CONSTRAINT_MAX_ROWS); - for (ndInt32 i = ndInt32(joint->GetRowsCount() - 1); i >= 0; i--) - { - constraintParam.m_forceBounds[i].m_low = D_MIN_BOUND; - constraintParam.m_forceBounds[i].m_upper = D_MAX_BOUND; - constraintParam.m_forceBounds[i].m_jointForce = nullptr; - constraintParam.m_forceBounds[i].m_normalIndex = D_INDEPENDENT_ROW; - } - - constraintParam.m_rowsCount = 0; - constraintParam.m_timestep = m_timestep; - constraintParam.m_invTimestep = m_invTimestep; - joint->JacobianDerivative(constraintParam); - const ndInt32 dof = constraintParam.m_rowsCount; - ndAssert(dof <= joint->m_rowCount); - - if (joint->GetAsContact()) - { - ndContact* const contactJoint = joint->GetAsContact(); - contactJoint->m_isInSkeletonLoop = 0; - ndSkeletonContainer* const skeleton0 = contactJoint->GetBody0()->GetSkeleton(); - ndSkeletonContainer* const skeleton1 = contactJoint->GetBody1()->GetSkeleton(); - if (skeleton0 && (skeleton0 == skeleton1)) - { - if (contactJoint->IsSkeletonSelftCollision()) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(contactJoint); - } - } - else - { - if (skeleton0 && !skeleton1) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(contactJoint); - } - else if (skeleton1 && !skeleton0) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton1->AddCloseLoopJoint(contactJoint); - } - } - } - else - { - ndJointBilateralConstraint* const bilareral = joint->GetAsBilateral(); - ndAssert(bilareral); - if (!bilareral->m_isInSkeleton && (bilareral->GetSolverModel() == m_jointkinematicAttachment)) - { - ndSkeletonContainer* const skeleton0 = bilareral->m_body0->GetSkeleton(); - ndSkeletonContainer* const skeleton1 = bilareral->m_body1->GetSkeleton(); - if (skeleton0 || skeleton1) - { - if (skeleton0 && !skeleton1) - { - bilareral->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(bilareral); - } - else if (skeleton1 && !skeleton0) - { - bilareral->m_isInSkeletonLoop = 1; - skeleton1->AddCloseLoopJoint(bilareral); - } - } - } - } - - joint->m_rowCount = dof; - const ndInt32 baseIndex = joint->m_rowStart; - for (ndInt32 i = 0; i < dof; ++i) - { - ndAssert(constraintParam.m_forceBounds[i].m_jointForce); - - ndLeftHandSide* const row = &m_leftHandSide[baseIndex + i]; - ndRightHandSide* const rhs = &m_rightHandSide[baseIndex + i]; - - row->m_Jt = constraintParam.m_jacobian[i]; - rhs->m_diagDamp = ndFloat32(0.0f); - rhs->m_diagonalRegularizer = ndMax(constraintParam.m_diagonalRegularizer[i], ndFloat32(1.0e-5f)); - - rhs->m_coordenateAccel = constraintParam.m_jointAccel[i]; - rhs->m_restitution = constraintParam.m_restitution[i]; - rhs->m_penetration = constraintParam.m_penetration[i]; - rhs->m_penetrationStiffness = constraintParam.m_penetrationStiffness[i]; - rhs->m_lowerBoundFrictionCoefficent = constraintParam.m_forceBounds[i].m_low; - rhs->m_upperBoundFrictionCoefficent = constraintParam.m_forceBounds[i].m_upper; - rhs->m_jointFeebackForce = constraintParam.m_forceBounds[i].m_jointForce; - - ndAssert(constraintParam.m_forceBounds[i].m_normalIndex >= -1); - rhs->m_normalForceIndex = constraintParam.m_forceBounds[i].m_normalIndex; - } -} - -void ndDynamicsUpdateAvx2::InitJacobianMatrix() -{ - ndScene* const scene = m_world->GetScene(); - ndBodyKinematic** const bodyArray = &scene->GetActiveBodyArray()[0]; - ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator(0); - auto InitJacobianMatrix = ndMakeObject::ndFunction([this, &iterator, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitJacobianMatrix); - ndAvxFloat* const internalForces = (ndAvxFloat*)&GetTempInternalForces()[0]; - auto BuildJacobianMatrix = [this, &internalForces](ndConstraint* const joint, ndInt32 jointIndex) - { - ndAssert(joint->GetBody0()); - ndAssert(joint->GetBody1()); - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - - ndAvxFloat force0(body0->GetForce(), body0->GetTorque()); - ndAvxFloat force1(body1->GetForce(), body1->GetTorque()); - - const ndInt32 index = joint->m_rowStart; - const ndInt32 count = joint->m_rowCount; - - const bool isBilateral = joint->IsBilateral(); - - const ndMatrix& invInertia0 = body0->m_invWorldInertiaMatrix; - const ndMatrix& invInertia1 = body1->m_invWorldInertiaMatrix; - const ndVector invMass0(body0->m_invMass[3]); - const ndVector invMass1(body1->m_invMass[3]); - - ndAvxFloat forceAcc0(ndAvxFloat::m_zero); - ndAvxFloat forceAcc1(ndAvxFloat::m_zero); - const ndAvxFloat weigh0(body0->m_weigh); - const ndAvxFloat weigh1(body1->m_weigh); - - for (ndInt32 i = 0; i < count; ++i) - { - ndLeftHandSide* const row = &m_leftHandSide[index + i]; - ndRightHandSide* const rhs = &m_rightHandSide[index + i]; - - row->m_JMinv.m_jacobianM0.m_linear = row->m_Jt.m_jacobianM0.m_linear * invMass0; - row->m_JMinv.m_jacobianM0.m_angular = invInertia0.RotateVector(row->m_Jt.m_jacobianM0.m_angular); - row->m_JMinv.m_jacobianM1.m_linear = row->m_Jt.m_jacobianM1.m_linear * invMass1; - row->m_JMinv.m_jacobianM1.m_angular = invInertia1.RotateVector(row->m_Jt.m_jacobianM1.m_angular); - - const ndAvxFloat& JMinvM0 = (ndAvxFloat&)row->m_JMinv.m_jacobianM0; - const ndAvxFloat& JMinvM1 = (ndAvxFloat&)row->m_JMinv.m_jacobianM1; - - const ndAvxFloat tmpAccel((JMinvM0 * force0).MulAdd(JMinvM1, force1)); - - ndFloat32 extenalAcceleration = -tmpAccel.AddHorizontal(); - rhs->m_deltaAccel = extenalAcceleration; - rhs->m_coordenateAccel += extenalAcceleration; - ndAssert(rhs->m_jointFeebackForce); - const ndFloat32 force = rhs->m_jointFeebackForce->GetInitialGuess(); - - rhs->m_force = isBilateral ? ndClamp(force, rhs->m_lowerBoundFrictionCoefficent, rhs->m_upperBoundFrictionCoefficent) : force; - rhs->m_maxImpact = ndFloat32(0.0f); - - const ndAvxFloat& JtM0 = (ndAvxFloat&)row->m_Jt.m_jacobianM0; - const ndAvxFloat& JtM1 = (ndAvxFloat&)row->m_Jt.m_jacobianM1; - const ndAvxFloat tmpDiag(weigh0 * JMinvM0 * JtM0 + weigh1 * JMinvM1 * JtM1); - - ndFloat32 diag = tmpDiag.AddHorizontal(); - ndAssert(diag > ndFloat32(0.0f)); - rhs->m_diagDamp = diag * rhs->m_diagonalRegularizer; - - diag *= (ndFloat32(1.0f) + rhs->m_diagonalRegularizer); - rhs->m_invJinvMJt = ndFloat32(1.0f) / diag; - - forceAcc0 = forceAcc0.MulAdd(JtM0, ndAvxFloat(rhs->m_force)); - forceAcc1 = forceAcc1.MulAdd(JtM1, ndAvxFloat(rhs->m_force)); - } - - const ndInt32 index0 = jointIndex * 2 + 0; - ndAvxFloat& outBody0 = internalForces[index0]; - outBody0 = forceAcc0; - - const ndInt32 index1 = jointIndex * 2 + 1; - ndAvxFloat& outBody1 = internalForces[index1]; - outBody1 = forceAcc1; - }; - - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < jointCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((jointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : jointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndConstraint* const joint = jointArray[i + j]; - GetJacobianDerivatives(joint); - BuildJacobianMatrix(joint, i + j); - } - } - }); - - ndAtomic iterator1(0); - auto InitJacobianAccumulatePartialForces = ndMakeObject::ndFunction([this, &iterator1, &bodyArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitJacobianAccumulatePartialForces); - const ndVector zero(ndVector::m_zero); - ndJacobian* const internalForces = &GetInternalForces()[0]; - const ndArray& bodyIndex = GetJointForceIndexBuffer(); - - const ndJacobian* const jointInternalForces = &GetTempInternalForces()[0]; - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - - const ndInt32 bodyCount = ndInt32 (bodyIndex.GetCount()) - 1; - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < bodyCount; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((bodyCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : bodyCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndVector force(zero); - ndVector torque(zero); - - const ndInt32 m = i + j; - const ndInt32 index = bodyIndex[m]; - const ndJointBodyPairIndex& scan = jointBodyPairIndexBuffer[index]; - ndBodyKinematic* const body = bodyArray[scan.m_body]; - - ndAssert(body->m_isStatic <= 1); - ndAssert(body->m_index == scan.m_body); - const ndInt32 mask = ndInt32(body->m_isStatic) - 1; - const ndInt32 count = mask & (bodyIndex[m + 1] - index); - - for (ndInt32 k = 0; k < count; ++k) - { - const ndInt32 jointIndex = jointBodyPairIndexBuffer[index + k].m_joint; - force += jointInternalForces[jointIndex].m_linear; - torque += jointInternalForces[jointIndex].m_angular; - } - internalForces[m].m_linear = force; - internalForces[m].m_angular = torque; - } - } - }); - - ndAtomic iterator2(0); - auto TransposeMassMatrix = ndMakeObject::ndFunction([this, &iterator2, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(TransposeMassMatrix); - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - - const ndLeftHandSide* const leftHandSide = &GetLeftHandSide()[0]; - const ndRightHandSide* const rightHandSide = &GetRightHandSide()[0]; - ndAvxMatrixArray& massMatrix = *m_avxMassMatrixArray; - - const ndAvxFloat zero(ndAvxFloat::m_zero); - const ndAvxFloat ordinals(ndAvxFloat::m_ordinals); - const ndInt32 mask = -ndInt32(D_AVX_WORK_GROUP); - const ndInt32 soaJointCount = ((jointCount + D_AVX_WORK_GROUP - 1) & mask) / D_AVX_WORK_GROUP; - - ndInt8* const groupType = &m_groupType[0]; - ndAvxFloat* const jointMask = (ndAvxFloat*)&m_jointMask[0]; - const ndInt32* const soaJointRows = &m_avxJointRows[0]; - - ndConstraint** const jointsPtr = &jointArray[0]; - for (ndInt32 i = iterator2.fetch_add(D_WORKER_BATCH_SIZE); i < soaJointCount; i = iterator2.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((soaJointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : soaJointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 m = i + j; - const ndInt32 index = m * D_AVX_WORK_GROUP; - ndInt32 maxRow = 0; - ndInt32 minRow = 255; - ndAvxFloat selectMask(-1); - for (ndInt32 k = 0; k < D_AVX_WORK_GROUP; ++k) - { - ndConstraint* const joint = jointsPtr[index + k]; - if (joint) - { - const ndInt32 maxMask = (maxRow - joint->m_rowCount) >> 8; - const ndInt32 minMask = (minRow - joint->m_rowCount) >> 8; - maxRow = ( maxMask & joint->m_rowCount) | (~maxMask & maxRow); - minRow = (~minMask & joint->m_rowCount) | ( minMask & minRow); - if (!joint->m_rowCount) - { - selectMask[k] = ndFloat32(0.0f); - } - } - else - { - minRow = 0; - selectMask[k] = ndFloat32(0.0f); - } - } - ndAssert(maxRow >= 0); - ndAssert(minRow < 255); - jointMask[m] = selectMask; - - const ndInt8 isUniformGroup = (maxRow == minRow) & (maxRow > 0); - groupType[m] = isUniformGroup; - - const ndInt32 soaRowBase = soaJointRows[m]; - if (isUniformGroup) - { - const ndConstraint* const joint0 = jointsPtr[index + 0]; - const ndConstraint* const joint1 = jointsPtr[index + 1]; - const ndConstraint* const joint2 = jointsPtr[index + 2]; - const ndConstraint* const joint3 = jointsPtr[index + 3]; - const ndConstraint* const joint4 = jointsPtr[index + 4]; - const ndConstraint* const joint5 = jointsPtr[index + 5]; - const ndConstraint* const joint6 = jointsPtr[index + 6]; - const ndConstraint* const joint7 = jointsPtr[index + 7]; - - ndAvxFloat dommy; - const ndInt32 rowCount = joint0->m_rowCount; - for (ndInt32 k = 0; k < rowCount; ++k) - { - const ndLeftHandSide* const row0 = &leftHandSide[joint0->m_rowStart + k]; - const ndLeftHandSide* const row1 = &leftHandSide[joint1->m_rowStart + k]; - const ndLeftHandSide* const row2 = &leftHandSide[joint2->m_rowStart + k]; - const ndLeftHandSide* const row3 = &leftHandSide[joint3->m_rowStart + k]; - const ndLeftHandSide* const row4 = &leftHandSide[joint4->m_rowStart + k]; - const ndLeftHandSide* const row5 = &leftHandSide[joint5->m_rowStart + k]; - const ndLeftHandSide* const row6 = &leftHandSide[joint6->m_rowStart + k]; - const ndLeftHandSide* const row7 = &leftHandSide[joint7->m_rowStart + k]; - ndSoaMatrixElement& row = massMatrix[soaRowBase + k]; - - ndAvxFloat::Transpose( - row.m_Jt.m_jacobianM0.m_linear.m_x, - row.m_Jt.m_jacobianM0.m_linear.m_y, - row.m_Jt.m_jacobianM0.m_linear.m_z, - dommy, - row.m_Jt.m_jacobianM0.m_angular.m_x, - row.m_Jt.m_jacobianM0.m_angular.m_y, - row.m_Jt.m_jacobianM0.m_angular.m_z, - dommy, - (ndAvxFloat&)row0->m_Jt.m_jacobianM0, - (ndAvxFloat&)row1->m_Jt.m_jacobianM0, - (ndAvxFloat&)row2->m_Jt.m_jacobianM0, - (ndAvxFloat&)row3->m_Jt.m_jacobianM0, - (ndAvxFloat&)row4->m_Jt.m_jacobianM0, - (ndAvxFloat&)row5->m_Jt.m_jacobianM0, - (ndAvxFloat&)row6->m_Jt.m_jacobianM0, - (ndAvxFloat&)row7->m_Jt.m_jacobianM0); - - ndAvxFloat::Transpose( - row.m_Jt.m_jacobianM1.m_linear.m_x, - row.m_Jt.m_jacobianM1.m_linear.m_y, - row.m_Jt.m_jacobianM1.m_linear.m_z, - dommy, - row.m_Jt.m_jacobianM1.m_angular.m_x, - row.m_Jt.m_jacobianM1.m_angular.m_y, - row.m_Jt.m_jacobianM1.m_angular.m_z, - dommy, - (ndAvxFloat&)row0->m_Jt.m_jacobianM1, - (ndAvxFloat&)row1->m_Jt.m_jacobianM1, - (ndAvxFloat&)row2->m_Jt.m_jacobianM1, - (ndAvxFloat&)row3->m_Jt.m_jacobianM1, - (ndAvxFloat&)row4->m_Jt.m_jacobianM1, - (ndAvxFloat&)row5->m_Jt.m_jacobianM1, - (ndAvxFloat&)row6->m_Jt.m_jacobianM1, - (ndAvxFloat&)row7->m_Jt.m_jacobianM1); - - ndAvxFloat::Transpose( - row.m_JMinv.m_jacobianM0.m_linear.m_x, - row.m_JMinv.m_jacobianM0.m_linear.m_y, - row.m_JMinv.m_jacobianM0.m_linear.m_z, - dommy, - row.m_JMinv.m_jacobianM0.m_angular.m_x, - row.m_JMinv.m_jacobianM0.m_angular.m_y, - row.m_JMinv.m_jacobianM0.m_angular.m_z, - dommy, - (ndAvxFloat&)row0->m_JMinv.m_jacobianM0, - (ndAvxFloat&)row1->m_JMinv.m_jacobianM0, - (ndAvxFloat&)row2->m_JMinv.m_jacobianM0, - (ndAvxFloat&)row3->m_JMinv.m_jacobianM0, - (ndAvxFloat&)row4->m_JMinv.m_jacobianM0, - (ndAvxFloat&)row5->m_JMinv.m_jacobianM0, - (ndAvxFloat&)row6->m_JMinv.m_jacobianM0, - (ndAvxFloat&)row7->m_JMinv.m_jacobianM0); - - ndAvxFloat::Transpose( - row.m_JMinv.m_jacobianM1.m_linear.m_x, - row.m_JMinv.m_jacobianM1.m_linear.m_y, - row.m_JMinv.m_jacobianM1.m_linear.m_z, - dommy, - row.m_JMinv.m_jacobianM1.m_angular.m_x, - row.m_JMinv.m_jacobianM1.m_angular.m_y, - row.m_JMinv.m_jacobianM1.m_angular.m_z, - dommy, - (ndAvxFloat&)row0->m_JMinv.m_jacobianM1, - (ndAvxFloat&)row1->m_JMinv.m_jacobianM1, - (ndAvxFloat&)row2->m_JMinv.m_jacobianM1, - (ndAvxFloat&)row3->m_JMinv.m_jacobianM1, - (ndAvxFloat&)row4->m_JMinv.m_jacobianM1, - (ndAvxFloat&)row5->m_JMinv.m_jacobianM1, - (ndAvxFloat&)row6->m_JMinv.m_jacobianM1, - (ndAvxFloat&)row7->m_JMinv.m_jacobianM1); - - #ifdef D_NEWTON_USE_DOUBLE - ndInt64* const normalIndex = (ndInt64*)&row.m_normalForceIndex[0]; - #else - ndInt32* const normalIndex = (ndInt32*)&row.m_normalForceIndex[0]; - #endif - for (ndInt32 n = 0; n < D_AVX_WORK_GROUP; ++n) - { - const ndConstraint* const soaJoint = jointsPtr[index + n]; - const ndRightHandSide* const rhs = &rightHandSide[soaJoint->m_rowStart + k]; - row.m_force[n] = rhs->m_force; - row.m_diagDamp[n] = rhs->m_diagDamp; - row.m_invJinvMJt[n] = rhs->m_invJinvMJt; - row.m_coordenateAccel[n] = rhs->m_coordenateAccel; - normalIndex[n] = (rhs->m_normalForceIndex + 1) * D_AVX_WORK_GROUP + n; - row.m_lowerBoundFrictionCoefficent[n] = rhs->m_lowerBoundFrictionCoefficent; - row.m_upperBoundFrictionCoefficent[n] = rhs->m_upperBoundFrictionCoefficent; - } - } - } - else - { - const ndConstraint* const firstJoint = jointsPtr[index]; - for (ndInt32 k = 0; k < firstJoint->m_rowCount; ++k) - { - ndSoaMatrixElement& row = massMatrix[soaRowBase + k]; - row.m_Jt.m_jacobianM0.m_linear.m_x = zero; - row.m_Jt.m_jacobianM0.m_linear.m_y = zero; - row.m_Jt.m_jacobianM0.m_linear.m_z = zero; - row.m_Jt.m_jacobianM0.m_angular.m_x = zero; - row.m_Jt.m_jacobianM0.m_angular.m_y = zero; - row.m_Jt.m_jacobianM0.m_angular.m_z = zero; - row.m_Jt.m_jacobianM1.m_linear.m_x = zero; - row.m_Jt.m_jacobianM1.m_linear.m_y = zero; - row.m_Jt.m_jacobianM1.m_linear.m_z = zero; - row.m_Jt.m_jacobianM1.m_angular.m_x = zero; - row.m_Jt.m_jacobianM1.m_angular.m_y = zero; - row.m_Jt.m_jacobianM1.m_angular.m_z = zero; - - row.m_JMinv.m_jacobianM0.m_linear.m_x = zero; - row.m_JMinv.m_jacobianM0.m_linear.m_y = zero; - row.m_JMinv.m_jacobianM0.m_linear.m_z = zero; - row.m_JMinv.m_jacobianM0.m_angular.m_x = zero; - row.m_JMinv.m_jacobianM0.m_angular.m_y = zero; - row.m_JMinv.m_jacobianM0.m_angular.m_z = zero; - row.m_JMinv.m_jacobianM1.m_linear.m_x = zero; - row.m_JMinv.m_jacobianM1.m_linear.m_y = zero; - row.m_JMinv.m_jacobianM1.m_linear.m_z = zero; - row.m_JMinv.m_jacobianM1.m_angular.m_x = zero; - row.m_JMinv.m_jacobianM1.m_angular.m_y = zero; - row.m_JMinv.m_jacobianM1.m_angular.m_z = zero; - - row.m_force = zero; - row.m_diagDamp = zero; - row.m_invJinvMJt = zero; - row.m_coordenateAccel = zero; - row.m_normalForceIndex = ordinals; - row.m_lowerBoundFrictionCoefficent = zero; - row.m_upperBoundFrictionCoefficent = zero; - } - - for (ndInt32 k = 0; k < D_AVX_WORK_GROUP; ++k) - { - const ndConstraint* const joint = jointsPtr[index + k]; - if (joint) - { - for (ndInt32 n = 0; n < joint->m_rowCount; ++n) - { - ndSoaMatrixElement& row = massMatrix[soaRowBase + n]; - const ndLeftHandSide* const lhs = &leftHandSide[joint->m_rowStart + n]; - - row.m_Jt.m_jacobianM0.m_linear.m_x[k] = lhs->m_Jt.m_jacobianM0.m_linear.m_x; - row.m_Jt.m_jacobianM0.m_linear.m_y[k] = lhs->m_Jt.m_jacobianM0.m_linear.m_y; - row.m_Jt.m_jacobianM0.m_linear.m_z[k] = lhs->m_Jt.m_jacobianM0.m_linear.m_z; - row.m_Jt.m_jacobianM0.m_angular.m_x[k] = lhs->m_Jt.m_jacobianM0.m_angular.m_x; - row.m_Jt.m_jacobianM0.m_angular.m_y[k] = lhs->m_Jt.m_jacobianM0.m_angular.m_y; - row.m_Jt.m_jacobianM0.m_angular.m_z[k] = lhs->m_Jt.m_jacobianM0.m_angular.m_z; - row.m_Jt.m_jacobianM1.m_linear.m_x[k] = lhs->m_Jt.m_jacobianM1.m_linear.m_x; - row.m_Jt.m_jacobianM1.m_linear.m_y[k] = lhs->m_Jt.m_jacobianM1.m_linear.m_y; - row.m_Jt.m_jacobianM1.m_linear.m_z[k] = lhs->m_Jt.m_jacobianM1.m_linear.m_z; - row.m_Jt.m_jacobianM1.m_angular.m_x[k] = lhs->m_Jt.m_jacobianM1.m_angular.m_x; - row.m_Jt.m_jacobianM1.m_angular.m_y[k] = lhs->m_Jt.m_jacobianM1.m_angular.m_y; - row.m_Jt.m_jacobianM1.m_angular.m_z[k] = lhs->m_Jt.m_jacobianM1.m_angular.m_z; - - row.m_JMinv.m_jacobianM0.m_linear.m_x[k] = lhs->m_JMinv.m_jacobianM0.m_linear.m_x; - row.m_JMinv.m_jacobianM0.m_linear.m_y[k] = lhs->m_JMinv.m_jacobianM0.m_linear.m_y; - row.m_JMinv.m_jacobianM0.m_linear.m_z[k] = lhs->m_JMinv.m_jacobianM0.m_linear.m_z; - row.m_JMinv.m_jacobianM0.m_angular.m_x[k] = lhs->m_JMinv.m_jacobianM0.m_angular.m_x; - row.m_JMinv.m_jacobianM0.m_angular.m_y[k] = lhs->m_JMinv.m_jacobianM0.m_angular.m_y; - row.m_JMinv.m_jacobianM0.m_angular.m_z[k] = lhs->m_JMinv.m_jacobianM0.m_angular.m_z; - row.m_JMinv.m_jacobianM1.m_linear.m_x[k] = lhs->m_JMinv.m_jacobianM1.m_linear.m_x; - row.m_JMinv.m_jacobianM1.m_linear.m_y[k] = lhs->m_JMinv.m_jacobianM1.m_linear.m_y; - row.m_JMinv.m_jacobianM1.m_linear.m_z[k] = lhs->m_JMinv.m_jacobianM1.m_linear.m_z; - row.m_JMinv.m_jacobianM1.m_angular.m_x[k] = lhs->m_JMinv.m_jacobianM1.m_angular.m_x; - row.m_JMinv.m_jacobianM1.m_angular.m_y[k] = lhs->m_JMinv.m_jacobianM1.m_angular.m_y; - row.m_JMinv.m_jacobianM1.m_angular.m_z[k] = lhs->m_JMinv.m_jacobianM1.m_angular.m_z; - - const ndRightHandSide* const rhs = &rightHandSide[joint->m_rowStart + n]; - row.m_force[k] = rhs->m_force; - row.m_diagDamp[k] = rhs->m_diagDamp; - row.m_invJinvMJt[k] = rhs->m_invJinvMJt; - row.m_coordenateAccel[k] = rhs->m_coordenateAccel; - - #ifdef D_NEWTON_USE_DOUBLE - ndInt64* const normalIndex = (ndInt64*)&row.m_normalForceIndex[0]; - #else - ndInt32* const normalIndex = (ndInt32*)&row.m_normalForceIndex[0]; - #endif - normalIndex[k] = (rhs->m_normalForceIndex + 1) * D_AVX_WORK_GROUP + k; - row.m_lowerBoundFrictionCoefficent[k] = rhs->m_lowerBoundFrictionCoefficent; - row.m_upperBoundFrictionCoefficent[k] = rhs->m_upperBoundFrictionCoefficent; - } - } - } - } - } - } - }); - - if (scene->GetActiveContactArray().GetCount()) - { - D_TRACKTIME(); - m_rightHandSide[0].m_force = ndFloat32(1.0f); - - scene->ParallelExecute(InitJacobianMatrix); - scene->ParallelExecute(InitJacobianAccumulatePartialForces); - scene->ParallelExecute(TransposeMassMatrix); - } -} - -void ndDynamicsUpdateAvx2::UpdateForceFeedback() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator(0); - auto UpdateForceFeedback = ndMakeObject::ndFunction([this, &iterator, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(UpdateForceFeedback); - ndArray& rightHandSide = m_rightHandSide; - const ndArray& leftHandSide = m_leftHandSide; - - ndAvxFloat zero(ndFloat32(0.0f)); - const ndFloat32 timestepRK = GetTimestepRK(); - - const ndInt32 count = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndConstraint* const joint = jointArray[i + j]; - const ndInt32 rows = joint->m_rowCount; - const ndInt32 first = joint->m_rowStart; - - for (ndInt32 k = 0; k < rows; ++k) - { - const ndRightHandSide* const rhs = &rightHandSide[k + first]; - ndAssert(ndCheckFloat(rhs->m_force)); - rhs->m_jointFeebackForce->Push(rhs->m_force); - rhs->m_jointFeebackForce->m_force = rhs->m_force; - rhs->m_jointFeebackForce->m_impact = rhs->m_maxImpact * timestepRK; - } - - //if (joint->GetAsBilateral()) - { - ndAvxFloat force0(zero); - ndAvxFloat force1(zero); - - for (ndInt32 k = 0; k < rows; ++k) - { - const ndRightHandSide* const rhs = &rightHandSide[k + first]; - const ndLeftHandSide* const lhs = &leftHandSide[k + first]; - const ndAvxFloat f(rhs->m_force); - force0 = force0.MulAdd((ndAvxFloat&)lhs->m_Jt.m_jacobianM0, f); - force1 = force1.MulAdd((ndAvxFloat&)lhs->m_Jt.m_jacobianM1, f); - } - //ndJointBilateralConstraint* const bilateral = (ndJointBilateralConstraint*)joint; - joint->m_forceBody0 = force0.GetLow(); - joint->m_torqueBody0 = force0.GetHigh(); - joint->m_forceBody1 = force1.GetLow(); - joint->m_torqueBody1 = force1.GetHigh(); - } - } - } - }); - - scene->ParallelExecute(UpdateForceFeedback); -} - -void ndDynamicsUpdateAvx2::InitSkeletons() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& activeSkeletons = m_world->m_activeSkeletons; - - ndAtomic iterator(0); - auto InitSkeletons = ndMakeObject::ndFunction([this, &iterator, &activeSkeletons](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitSkeletons); - ndArray& rightHandSide = m_rightHandSide; - const ndArray& leftHandSide = m_leftHandSide; - - const ndInt32 count = ndInt32 (activeSkeletons.GetCount()); - for (ndInt32 i = iterator++; i < count; i = iterator++) - { - ndSkeletonContainer* const skeleton = activeSkeletons[i]; - skeleton->InitMassMatrix(&leftHandSide[0], &rightHandSide[0]); - } - }); - - if (activeSkeletons.GetCount()) - { - scene->ParallelExecute(InitSkeletons); - } -} - -void ndDynamicsUpdateAvx2::UpdateSkeletons() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& activeSkeletons = m_world->m_activeSkeletons; - - ndAtomic iterator(0); - auto UpdateSkeletons = ndMakeObject::ndFunction([this, &iterator, &activeSkeletons](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(UpdateSkeletons); - ndJacobian* const internalForces = &GetInternalForces()[0]; - - const ndInt32 count = ndInt32(activeSkeletons.GetCount()); - for (ndInt32 i = iterator++; i < count; i = iterator++) - { - ndSkeletonContainer* const skeleton = activeSkeletons[i]; - skeleton->CalculateReactionForces(internalForces); - } - }); - - if (activeSkeletons.GetCount()) - { - scene->ParallelExecute(UpdateSkeletons); - } -} - -void ndDynamicsUpdateAvx2::CalculateJointsAcceleration() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator(0); - auto CalculateJointsAcceleration = ndMakeObject::ndFunction([this, &iterator, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CalculateJointsAcceleration); - ndJointAccelerationDecriptor joindDesc; - joindDesc.m_timestep = m_timestepRK; - joindDesc.m_invTimestep = m_invTimestepRK; - joindDesc.m_firstPassCoefFlag = m_firstPassCoef; - ndArray& leftHandSide = m_leftHandSide; - ndArray& rightHandSide = m_rightHandSide; - - const ndInt32 count = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndConstraint* const joint = jointArray[i + j]; - const ndInt32 pairStart = joint->m_rowStart; - joindDesc.m_rowsCount = joint->m_rowCount; - joindDesc.m_leftHandSide = &leftHandSide[pairStart]; - joindDesc.m_rightHandSide = &rightHandSide[pairStart]; - joint->JointAccelerations(&joindDesc); - } - } - }); - - ndAtomic iterator1(0); - auto UpdateAcceleration = ndMakeObject::ndFunction([this, &iterator1, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(UpdateAcceleration); - const ndArray& rightHandSide = m_rightHandSide; - - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - const ndInt32 mask = -ndInt32(D_AVX_WORK_GROUP); - const ndInt32* const soaJointRows = &m_avxJointRows[0]; - const ndInt32 soaJointCountBatches = ((jointCount + D_AVX_WORK_GROUP - 1) & mask) / D_AVX_WORK_GROUP; - const ndInt8* const groupType = &m_groupType[0]; - - const ndConstraint* const * jointArrayPtr = &jointArray[0]; - ndAvxMatrixArray& massMatrix = *m_avxMassMatrixArray; - - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < soaJointCountBatches; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((soaJointCountBatches - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : soaJointCountBatches - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 m = i + j; - if (groupType[m]) - { - const ndInt32 soaRowStartBase = soaJointRows[m]; - const ndConstraint* const* jointGroup = &jointArrayPtr[m * D_AVX_WORK_GROUP]; - const ndConstraint* const firstJoint = jointGroup[0]; - const ndInt32 rowCount = firstJoint->m_rowCount; - for (ndInt32 k = 0; k < D_AVX_WORK_GROUP; ++k) - { - const ndConstraint* const Joint = jointGroup[k]; - const ndInt32 base = Joint->m_rowStart; - for (ndInt32 n = 0; n < rowCount; ++n) - { - ndSoaMatrixElement* const row = &massMatrix[soaRowStartBase + n]; - row->m_coordenateAccel[k] = rightHandSide[base + n].m_coordenateAccel; - } - } - } - else - { - const ndInt32 soaRowStartBase = soaJointRows[m]; - const ndConstraint* const* jointGroup = &jointArrayPtr[m * D_AVX_WORK_GROUP]; - for (ndInt32 k = 0; k < D_AVX_WORK_GROUP; ++k) - { - const ndConstraint* const Joint = jointGroup[k]; - if (Joint) - { - const ndInt32 base = Joint->m_rowStart; - const ndInt32 rowCount = Joint->m_rowCount; - for (ndInt32 n = 0; n < rowCount; ++n) - { - ndSoaMatrixElement* const row = &massMatrix[soaRowStartBase + n]; - row->m_coordenateAccel[k] = rightHandSide[base + n].m_coordenateAccel; - } - } - } - } - } - } - }); - - scene->ParallelExecute(CalculateJointsAcceleration); - - m_firstPassCoef = ndFloat32(1.0f); - scene->ParallelExecute(UpdateAcceleration); -} - -void ndDynamicsUpdateAvx2::IntegrateBodiesVelocity() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - - ndAtomic iterator(0); - auto IntegrateBodiesVelocity = ndMakeObject::ndFunction([this, &iterator](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(IntegrateBodiesVelocity); - ndArray& bodyArray = GetBodyIslandOrder(); - const ndArray& internalForces = GetInternalForces(); - - const ndVector timestep4(GetTimestepRK()); - const ndVector speedFreeze2(m_world->m_freezeSpeed2 * ndFloat32(0.1f)); - - const ndInt32 count = ndInt32 (bodyArray.GetCount() - GetUnconstrainedBodyCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - - ndAssert(body); - ndAssert(body->m_isConstrained); - // no necessary anymore because the virtual function handle it. - //ndAssert(body->GetAsBodyDynamic()); - const ndInt32 index = body->m_index; - const ndJacobian& forceAndTorque = internalForces[index]; - const ndVector force(body->GetForce() + forceAndTorque.m_linear); - const ndVector torque(body->GetTorque() + forceAndTorque.m_angular - body->GetGyroTorque()); - const ndJacobian velocStep(body->IntegrateForceAndToque(force, torque, timestep4)); - - if (!body->m_equilibrium0) - { - body->m_veloc += velocStep.m_linear; - body->m_omega += velocStep.m_angular; - body->IntegrateGyroSubstep(timestep4); - } - else - { - const ndVector velocStep2(velocStep.m_linear.DotProduct(velocStep.m_linear)); - const ndVector omegaStep2(velocStep.m_angular.DotProduct(velocStep.m_angular)); - const ndVector test(((velocStep2 > speedFreeze2) | (omegaStep2 > speedFreeze2)) & ndVector::m_negOne); - const ndUnsigned8 equilibrium = ndUnsigned8(test.GetSignMask() ? 0 : 1); - body->m_equilibrium0 = equilibrium; - } - ndAssert(body->m_veloc.m_w == ndFloat32(0.0f)); - ndAssert(body->m_omega.m_w == ndFloat32(0.0f)); - } - } - }); - - scene->ParallelExecute(IntegrateBodiesVelocity); -} - -void ndDynamicsUpdateAvx2::CalculateJointsForce() -{ - D_TRACKTIME(); - const ndUnsigned32 passes = m_solverPasses; - ndScene* const scene = m_world->GetScene(); - - ndArray& bodyArray = scene->GetActiveBodyArray(); - ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator0(0); - auto CalculateJointsForce = ndMakeObject::ndFunction([this, &iterator0, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CalculateJointsForce); - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - ndJacobian* const jointPartialForces = &GetTempInternalForces()[0]; - - const ndInt32* const soaJointRows = &m_avxJointRows[0]; - ndAvxMatrixArray& soaMassMatrixArray = *m_avxMassMatrixArray; - ndSoaMatrixElement* const soaMassMatrix = &soaMassMatrixArray[0]; - - auto JointForce = [this, &jointArray, jointPartialForces](ndInt32 group, ndSoaMatrixElement* const massMatrix) - { - ndAvxVector6 forceM0; - ndAvxVector6 forceM1; - ndAvxFloat preconditioner0; - ndAvxFloat preconditioner1; - ndAvxFloat normalForce[D_CONSTRAINT_MAX_ROWS + 1]; - - const ndInt32 block = group * D_AVX_WORK_GROUP; - ndConstraint** const jointGroup = &jointArray[block]; - - ndAvxFloat zero(ndFloat32(0.0f)); - const ndInt8 isUniformGruop = m_groupType[group]; - if (isUniformGruop) - { - for (ndInt32 i = 0; i < D_AVX_WORK_GROUP; ++i) - { - const ndConstraint* const joint = jointGroup[i]; - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - - const ndInt32 m0 = body0->m_index; - const ndInt32 m1 = body1->m_index; - - preconditioner0[i] = body0->m_weigh; - preconditioner1[i] = body1->m_weigh; - - forceM0.m_linear.m_x[i] = m_internalForces[m0].m_linear.m_x; - forceM0.m_linear.m_y[i] = m_internalForces[m0].m_linear.m_y; - forceM0.m_linear.m_z[i] = m_internalForces[m0].m_linear.m_z; - forceM0.m_angular.m_x[i] = m_internalForces[m0].m_angular.m_x; - forceM0.m_angular.m_y[i] = m_internalForces[m0].m_angular.m_y; - forceM0.m_angular.m_z[i] = m_internalForces[m0].m_angular.m_z; - - forceM1.m_linear.m_x[i] = m_internalForces[m1].m_linear.m_x; - forceM1.m_linear.m_y[i] = m_internalForces[m1].m_linear.m_y; - forceM1.m_linear.m_z[i] = m_internalForces[m1].m_linear.m_z; - forceM1.m_angular.m_x[i] = m_internalForces[m1].m_angular.m_x; - forceM1.m_angular.m_y[i] = m_internalForces[m1].m_angular.m_y; - forceM1.m_angular.m_z[i] = m_internalForces[m1].m_angular.m_z; - } - } - else - { - preconditioner0 = zero; - preconditioner1 = zero; - forceM0.m_linear.m_x = zero; - forceM0.m_linear.m_y = zero; - forceM0.m_linear.m_z = zero; - forceM0.m_angular.m_x = zero; - forceM0.m_angular.m_y = zero; - forceM0.m_angular.m_z = zero; - - forceM1.m_linear.m_x = zero; - forceM1.m_linear.m_y = zero; - forceM1.m_linear.m_z = zero; - forceM1.m_angular.m_x = zero; - forceM1.m_angular.m_y = zero; - forceM1.m_angular.m_z = zero; - for (ndInt32 i = 0; i < D_AVX_WORK_GROUP; ++i) - { - const ndConstraint* const joint = jointGroup[i]; - if (joint && joint->m_rowCount) - { - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - - const ndInt32 m0 = body0->m_index; - const ndInt32 m1 = body1->m_index; - preconditioner0[i] = body0->m_weigh; - preconditioner1[i] = body1->m_weigh; - - forceM0.m_linear.m_x[i] = m_internalForces[m0].m_linear.m_x; - forceM0.m_linear.m_y[i] = m_internalForces[m0].m_linear.m_y; - forceM0.m_linear.m_z[i] = m_internalForces[m0].m_linear.m_z; - forceM0.m_angular.m_x[i] = m_internalForces[m0].m_angular.m_x; - forceM0.m_angular.m_y[i] = m_internalForces[m0].m_angular.m_y; - forceM0.m_angular.m_z[i] = m_internalForces[m0].m_angular.m_z; - - forceM1.m_linear.m_x[i] = m_internalForces[m1].m_linear.m_x; - forceM1.m_linear.m_y[i] = m_internalForces[m1].m_linear.m_y; - forceM1.m_linear.m_z[i] = m_internalForces[m1].m_linear.m_z; - forceM1.m_angular.m_x[i] = m_internalForces[m1].m_angular.m_x; - forceM1.m_angular.m_y[i] = m_internalForces[m1].m_angular.m_y; - forceM1.m_angular.m_z[i] = m_internalForces[m1].m_angular.m_z; - } - } - } - - ndAvxFloat accNorm(zero); - normalForce[0] = ndAvxFloat (ndFloat32 (1.0f)); - const ndInt32 rowsCount = jointGroup[0]->m_rowCount; - - for (ndInt32 j = 0; j < rowsCount; ++j) - { - ndSoaMatrixElement* const row = &massMatrix[j]; - - ndAvxFloat a0(row->m_JMinv.m_jacobianM0.m_linear.m_x * forceM0.m_linear.m_x); - ndAvxFloat a1(row->m_JMinv.m_jacobianM1.m_linear.m_x * forceM1.m_linear.m_x); - a0 = a0.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_x, forceM0.m_angular.m_x); - a1 = a1.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_x, forceM1.m_angular.m_x); - - a0 = a0.MulAdd(row->m_JMinv.m_jacobianM0.m_linear.m_y, forceM0.m_linear.m_y); - a1 = a1.MulAdd(row->m_JMinv.m_jacobianM1.m_linear.m_y, forceM1.m_linear.m_y); - a0 = a0.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_y, forceM0.m_angular.m_y); - a1 = a1.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_y, forceM1.m_angular.m_y); - - a0 = a0.MulAdd(row->m_JMinv.m_jacobianM0.m_linear.m_z, forceM0.m_linear.m_z); - a1 = a1.MulAdd(row->m_JMinv.m_jacobianM1.m_linear.m_z, forceM1.m_linear.m_z); - a0 = a0.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_z, forceM0.m_angular.m_z); - a1 = a1.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_z, forceM1.m_angular.m_z); - - ndAvxFloat a(a0 + a1); - a = row->m_coordenateAccel.MulSub(row->m_force, row->m_diagDamp) - a; - ndAvxFloat f(row->m_force.MulAdd(row->m_invJinvMJt, a)); - - const ndAvxFloat frictionNormal(normalForce, row->m_normalForceIndex); - const ndAvxFloat lowerFrictionForce(frictionNormal * row->m_lowerBoundFrictionCoefficent); - const ndAvxFloat upperFrictionForce(frictionNormal * row->m_upperBoundFrictionCoefficent); - - a = a & (f < upperFrictionForce) & (f > lowerFrictionForce); - accNorm = accNorm.MulAdd(a, a); - - f = f.GetMax(lowerFrictionForce).GetMin(upperFrictionForce); - normalForce[j + 1] = f; - - const ndAvxFloat deltaForce(f - row->m_force); - const ndAvxFloat deltaForce0(deltaForce * preconditioner0); - const ndAvxFloat deltaForce1(deltaForce * preconditioner1); - forceM0.m_linear.m_x = forceM0.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_x, deltaForce0); - forceM0.m_linear.m_y = forceM0.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_y, deltaForce0); - forceM0.m_linear.m_z = forceM0.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_z, deltaForce0); - forceM0.m_angular.m_x = forceM0.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_x, deltaForce0); - forceM0.m_angular.m_y = forceM0.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_y, deltaForce0); - forceM0.m_angular.m_z = forceM0.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_z, deltaForce0); - - forceM1.m_linear.m_x = forceM1.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_x, deltaForce1); - forceM1.m_linear.m_y = forceM1.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_y, deltaForce1); - forceM1.m_linear.m_z = forceM1.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_z, deltaForce1); - forceM1.m_angular.m_x = forceM1.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_x, deltaForce1); - forceM1.m_angular.m_y = forceM1.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_y, deltaForce1); - forceM1.m_angular.m_z = forceM1.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_z, deltaForce1); - } - - const ndFloat32 tol = ndFloat32(0.125f); - const ndFloat32 tol2 = tol * tol; - - ndAvxFloat maxAccel(accNorm); - for (ndInt32 k = 0; (k < 4) && (maxAccel.GetMax() > tol2); ++k) - { - maxAccel = zero; - for (ndInt32 j = 0; j < rowsCount; ++j) - { - ndSoaMatrixElement* const row = &massMatrix[j]; - - ndAvxFloat a0(row->m_JMinv.m_jacobianM0.m_linear.m_x * forceM0.m_linear.m_x); - ndAvxFloat a1(row->m_JMinv.m_jacobianM1.m_linear.m_x * forceM1.m_linear.m_x); - a0 = a0.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_x, forceM0.m_angular.m_x); - a1 = a1.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_x, forceM1.m_angular.m_x); - - a0 = a0.MulAdd(row->m_JMinv.m_jacobianM0.m_linear.m_y, forceM0.m_linear.m_y); - a1 = a1.MulAdd(row->m_JMinv.m_jacobianM1.m_linear.m_y, forceM1.m_linear.m_y); - a0 = a0.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_y, forceM0.m_angular.m_y); - a1 = a1.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_y, forceM1.m_angular.m_y); - - a0 = a0.MulAdd(row->m_JMinv.m_jacobianM0.m_linear.m_z, forceM0.m_linear.m_z); - a1 = a1.MulAdd(row->m_JMinv.m_jacobianM1.m_linear.m_z, forceM1.m_linear.m_z); - a0 = a0.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_z, forceM0.m_angular.m_z); - a1 = a1.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_z, forceM1.m_angular.m_z); - - ndAvxFloat a(a0 + a1); - const ndAvxFloat force(normalForce[j + 1]); - a = row->m_coordenateAccel.MulSub(force, row->m_diagDamp) - a; - ndAvxFloat f(force.MulAdd(row->m_invJinvMJt, a)); - - const ndAvxFloat frictionNormal(normalForce, row->m_normalForceIndex); - const ndAvxFloat lowerFrictionForce(frictionNormal * row->m_lowerBoundFrictionCoefficent); - const ndAvxFloat upperFrictionForce(frictionNormal * row->m_upperBoundFrictionCoefficent); - - a = a & (f < upperFrictionForce) & (f > lowerFrictionForce); - maxAccel = maxAccel.MulAdd(a, a); - - f = f.GetMax(lowerFrictionForce).GetMin(upperFrictionForce); - normalForce[j + 1] = f; - - const ndAvxFloat deltaForce(f - force); - const ndAvxFloat deltaForce0(deltaForce * preconditioner0); - const ndAvxFloat deltaForce1(deltaForce * preconditioner1); - - forceM0.m_linear.m_x = forceM0.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_x, deltaForce0); - forceM0.m_linear.m_y = forceM0.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_y, deltaForce0); - forceM0.m_linear.m_z = forceM0.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_z, deltaForce0); - forceM0.m_angular.m_x = forceM0.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_x, deltaForce0); - forceM0.m_angular.m_y = forceM0.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_y, deltaForce0); - forceM0.m_angular.m_z = forceM0.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_z, deltaForce0); - - forceM1.m_linear.m_x = forceM1.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_x, deltaForce1); - forceM1.m_linear.m_y = forceM1.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_y, deltaForce1); - forceM1.m_linear.m_z = forceM1.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_z, deltaForce1); - forceM1.m_angular.m_x = forceM1.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_x, deltaForce1); - forceM1.m_angular.m_y = forceM1.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_y, deltaForce1); - forceM1.m_angular.m_z = forceM1.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_z, deltaForce1); - } - } - - ndAvxFloat mask(ndAvxFloat::m_mask); - for (ndInt32 i = 0; i < D_AVX_WORK_GROUP; ++i) - { - const ndConstraint* const joint = jointGroup[i]; - if (joint && joint->m_rowCount) - { - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - ndAssert(body0); - ndAssert(body1); - const ndInt32 resting = body0->m_equilibrium0 & body1->m_equilibrium0; - if (resting) - { - mask[i] = ndFloat32(0.0f); - } - } - } - - forceM0.m_linear.m_x = zero; - forceM0.m_linear.m_y = zero; - forceM0.m_linear.m_z = zero; - forceM0.m_angular.m_x = zero; - forceM0.m_angular.m_y = zero; - forceM0.m_angular.m_z = zero; - - forceM1.m_linear.m_x = zero; - forceM1.m_linear.m_y = zero; - forceM1.m_linear.m_z = zero; - forceM1.m_angular.m_x = zero; - forceM1.m_angular.m_y = zero; - forceM1.m_angular.m_z = zero; - for (ndInt32 i = 0; i < rowsCount; ++i) - { - ndSoaMatrixElement* const row = &massMatrix[i]; - const ndAvxFloat force(row->m_force.Select(normalForce[i + 1], mask)); - row->m_force = force; - - forceM0.m_linear.m_x = forceM0.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_x, force); - forceM0.m_linear.m_y = forceM0.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_y, force); - forceM0.m_linear.m_z = forceM0.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_z, force); - forceM0.m_angular.m_x = forceM0.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_x, force); - forceM0.m_angular.m_y = forceM0.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_y, force); - forceM0.m_angular.m_z = forceM0.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_z, force); - - forceM1.m_linear.m_x = forceM1.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_x, force); - forceM1.m_linear.m_y = forceM1.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_y, force); - forceM1.m_linear.m_z = forceM1.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_z, force); - forceM1.m_angular.m_x = forceM1.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_x, force); - forceM1.m_angular.m_y = forceM1.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_y, force); - forceM1.m_angular.m_z = forceM1.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_z, force); - } - - ndAvxFloat force0[8]; - ndAvxFloat force1[8]; - ndVector::Transpose4x4( - force0[0].m_vector8.m_linear, - force0[1].m_vector8.m_linear, - force0[2].m_vector8.m_linear, - force0[3].m_vector8.m_linear, - forceM0.m_linear.m_x.m_vector8.m_linear, - forceM0.m_linear.m_y.m_vector8.m_linear, - forceM0.m_linear.m_z.m_vector8.m_linear, ndVector::m_zero); - ndVector::Transpose4x4( - force0[4].m_vector8.m_linear, - force0[5].m_vector8.m_linear, - force0[6].m_vector8.m_linear, - force0[7].m_vector8.m_linear, - forceM0.m_linear.m_x.m_vector8.m_angular, - forceM0.m_linear.m_y.m_vector8.m_angular, - forceM0.m_linear.m_z.m_vector8.m_angular, ndVector::m_zero); - ndVector::Transpose4x4( - force0[0].m_vector8.m_angular, - force0[1].m_vector8.m_angular, - force0[2].m_vector8.m_angular, - force0[3].m_vector8.m_angular, - forceM0.m_angular.m_x.m_vector8.m_linear, - forceM0.m_angular.m_y.m_vector8.m_linear, - forceM0.m_angular.m_z.m_vector8.m_linear, ndVector::m_zero); - ndVector::Transpose4x4( - force0[4].m_vector8.m_angular, - force0[5].m_vector8.m_angular, - force0[6].m_vector8.m_angular, - force0[7].m_vector8.m_angular, - forceM0.m_angular.m_x.m_vector8.m_angular, - forceM0.m_angular.m_y.m_vector8.m_angular, - forceM0.m_angular.m_z.m_vector8.m_angular, ndVector::m_zero); - - ndVector::Transpose4x4( - force1[0].m_vector8.m_linear, - force1[1].m_vector8.m_linear, - force1[2].m_vector8.m_linear, - force1[3].m_vector8.m_linear, - forceM1.m_linear.m_x.m_vector8.m_linear, - forceM1.m_linear.m_y.m_vector8.m_linear, - forceM1.m_linear.m_z.m_vector8.m_linear, ndVector::m_zero); - ndVector::Transpose4x4( - force1[4].m_vector8.m_linear, - force1[5].m_vector8.m_linear, - force1[6].m_vector8.m_linear, - force1[7].m_vector8.m_linear, - forceM1.m_linear.m_x.m_vector8.m_angular, - forceM1.m_linear.m_y.m_vector8.m_angular, - forceM1.m_linear.m_z.m_vector8.m_angular, ndVector::m_zero); - ndVector::Transpose4x4( - force1[0].m_vector8.m_angular, - force1[1].m_vector8.m_angular, - force1[2].m_vector8.m_angular, - force1[3].m_vector8.m_angular, - forceM1.m_angular.m_x.m_vector8.m_linear, - forceM1.m_angular.m_y.m_vector8.m_linear, - forceM1.m_angular.m_z.m_vector8.m_linear, ndVector::m_zero); - ndVector::Transpose4x4( - force1[4].m_vector8.m_angular, - force1[5].m_vector8.m_angular, - force1[6].m_vector8.m_angular, - force1[7].m_vector8.m_angular, - forceM1.m_angular.m_x.m_vector8.m_angular, - forceM1.m_angular.m_y.m_vector8.m_angular, - forceM1.m_angular.m_z.m_vector8.m_angular, ndVector::m_zero); - - ndRightHandSide* const rightHandSide = &m_rightHandSide[0]; - for (ndInt32 i = 0; i < D_AVX_WORK_GROUP; ++i) - { - const ndConstraint* const joint = jointGroup[i]; - if (joint) - { - const ndInt32 rowCount = joint->m_rowCount; - const ndInt32 rowStartBase = joint->m_rowStart; - for (ndInt32 j = 0; j < rowCount; ++j) - { - const ndSoaMatrixElement* const row = &massMatrix[j]; - rightHandSide[j + rowStartBase].m_force = row->m_force[i]; - rightHandSide[j + rowStartBase].m_maxImpact = ndMax(ndAbs(row->m_force[i]), rightHandSide[j + rowStartBase].m_maxImpact); - } - - const ndInt32 index0 = (block + i) * 2 + 0; - ndAvxFloat& outBody0 = (ndAvxFloat&)jointPartialForces[index0]; - outBody0 = force0[i]; - - const ndInt32 index1 = (block + i) * 2 + 1; - ndAvxFloat& outBody1 = (ndAvxFloat&)jointPartialForces[index1]; - outBody1 = force1[i]; - } - } - }; - - const ndInt32 mask = -ndInt32(D_AVX_WORK_GROUP); - const ndInt32 soaJointCount = ((jointCount + D_AVX_WORK_GROUP - 1) & mask) / D_AVX_WORK_GROUP; - for (ndInt32 i = iterator0.fetch_add(D_WORKER_BATCH_SIZE); i < soaJointCount; i = iterator0.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((soaJointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : soaJointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 m = i + j; - JointForce(m, &soaMassMatrix[soaJointRows[m]]); - } - } - }); - - ndAtomic iterator1(0); - auto ApplyJacobianAccumulatePartialForces = ndMakeObject::ndFunction([this, &iterator1, &bodyArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(ApplyJacobianAccumulatePartialForces); - const ndAvxFloat zero(ndAvxFloat::m_zero); - const ndInt32* const bodyIndex = &GetJointForceIndexBuffer()[0]; - ndAvxFloat* const internalForces = (ndAvxFloat*)&GetInternalForces()[0]; - const ndAvxFloat* const jointInternalForces = (ndAvxFloat*)&GetTempInternalForces()[0]; - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - - const ndInt32 bodyCount = ndInt32 (bodyArray.GetCount()); - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < bodyCount; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((bodyCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : bodyCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndAvxFloat force(zero); - ndAvxFloat torque(zero); - const ndInt32 m = i + j; - const ndBodyKinematic* const body = bodyArray[m]; - - const ndInt32 startIndex = bodyIndex[m]; - const ndInt32 mask = body->m_isStatic - 1; - const ndInt32 count = mask & (bodyIndex[m + 1] - startIndex); - for (ndInt32 k = 0; k < count; ++k) - { - const ndInt32 index = jointBodyPairIndexBuffer[startIndex + k].m_joint; - force = force + jointInternalForces[index]; - } - internalForces[m] = force; - } - } - }); - - for (ndInt32 i = 0; i < ndInt32(passes); ++i) - { - iterator0 = 0; - iterator1 = 0; - scene->ParallelExecute(CalculateJointsForce); - scene->ParallelExecute(ApplyJacobianAccumulatePartialForces); - } -} - -void ndDynamicsUpdateAvx2::CalculateForces() -{ - D_TRACKTIME(); - if (m_world->GetScene()->GetActiveContactArray().GetCount()) - { - m_firstPassCoef = ndFloat32(0.0f); - - InitSkeletons(); - for (ndInt32 step = 0; step < 4; step++) - { - CalculateJointsAcceleration(); - CalculateJointsForce(); - UpdateSkeletons(); - IntegrateBodiesVelocity(); - } - - UpdateForceFeedback(); - } -} - -void ndDynamicsUpdateAvx2::Update() -{ - D_TRACKTIME(); - m_timestep = m_world->GetScene()->GetTimestep(); - - BuildIsland(); - IntegrateUnconstrainedBodies(); - InitWeights(); - InitBodyArray(); - InitJacobianMatrix(); - CalculateForces(); - IntegrateBodies(); - DetermineSleepStates(); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndDynamicsUpdateAvx2.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndDynamicsUpdateAvx2.h deleted file mode 100644 index 6a1104707e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndDynamicsUpdateAvx2.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_DYNAMICS_UPDATE_AVX2_H__ -#define __ND_DYNAMICS_UPDATE_AVX2_H__ - -#include - -class ndAvxMatrixArray; - -D_MSV_NEWTON_ALIGN_32 -class ndDynamicsUpdateAvx2: public ndDynamicsUpdate -{ - public: - ndDynamicsUpdateAvx2(ndWorld* const world); - virtual ~ndDynamicsUpdateAvx2(); - - virtual const char* GetStringId() const; - - protected: - virtual void Update(); - - private: - void SortJoints(); - void SortIslands(); - void BuildIsland(); - void InitWeights(); - void InitBodyArray(); - void InitSkeletons(); - void CalculateForces(); - void IntegrateBodies(); - void UpdateSkeletons(); - void InitJacobianMatrix(); - void UpdateForceFeedback(); - void CalculateJointsForce(); - void IntegrateBodiesVelocity(); - void CalculateJointsAcceleration(); - void IntegrateUnconstrainedBodies(); - - void DetermineSleepStates(); - void GetJacobianDerivatives(ndConstraint* const joint); - - ndArray m_groupType; - ndArray m_jointMask; - ndArray m_avxJointRows; - ndAvxMatrixArray* m_avxMassMatrixArray; - -} D_GCC_NEWTON_ALIGN_32; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndWorldSceneAvx2.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndWorldSceneAvx2.cpp deleted file mode 100644 index b1bf608ae2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndWorldSceneAvx2.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndWorldSceneAvx2.h" - -ndWorldSceneAvx2::ndWorldSceneAvx2(const ndWorldScene& src) - :ndWorldScene(src) -{ -} - -ndWorldSceneAvx2::~ndWorldSceneAvx2() -{ -} - -void ndWorldSceneAvx2::ParticleUpdate(ndFloat32 timestep) -{ - D_TRACKTIME(); - //ndWorldScene::ParticleUpdate(timestep); - for (ndBodyList::ndNode* node = m_particleSetList.GetFirst(); node; node = node->GetNext()) - { - ndBodyParticleSet* const body = node->GetInfo()->GetAsBodyParticleSet(); - body->Update(this, timestep); - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndWorldSceneAvx2.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndWorldSceneAvx2.h deleted file mode 100644 index 3608982c8e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dAvx2/ndWorldSceneAvx2.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_WORLD_SCENE_AVX2_H__ -#define __ND_WORLD_SCENE_AVX2_H__ - -#include - -class ndWorldSceneAvx2 : public ndWorldScene -{ - public: - ndWorldSceneAvx2(const ndWorldScene& src); - virtual ~ndWorldSceneAvx2(); - - virtual void ParticleUpdate(ndFloat32 timestep); -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaBodyProxy.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaBodyProxy.h deleted file mode 100644 index 772525cc54..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaBodyProxy.h +++ /dev/null @@ -1,159 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODY_BUFFER_H__ -#define __ND_BODY_BUFFER_H__ - -#include -#include -#include "ndCudaQuat.h" -#include "ndCudaVector.h" -#include "ndCudaMatrix3x3.h" -#include "ndCudaDeviceBuffer.h" - -class ndCudaBodyProxy -{ - public: - inline ndCudaMatrix3x3 __device__ CalculateInvInertiaMatrix(const ndCudaMatrix3x3& matrix) const - { - const ndCudaVector invIxx(m_invIntertia.GetElement(0)); - const ndCudaVector invIyy(m_invIntertia.GetElement(1)); - const ndCudaVector invIzz(m_invIntertia.GetElement(2)); - return ndCudaMatrix3x3( - matrix.m_front.Scale(matrix.m_front.GetElement(0)) * invIxx + - matrix.m_up.Scale(matrix.m_up.GetElement(0)) * invIyy + - matrix.m_right.Scale(matrix.m_right.GetElement(0)) * invIzz, - - matrix.m_front.Scale(matrix.m_front.GetElement(1)) * invIxx + - matrix.m_up.Scale(matrix.m_up.GetElement(1)) * invIyy + - matrix.m_right.Scale(matrix.m_right.GetElement(1)) * invIzz, - - matrix.m_front.Scale(matrix.m_front.GetElement(2)) * invIxx + - matrix.m_up.Scale(matrix.m_up.GetElement(2)) * invIyy + - matrix.m_right.Scale(matrix.m_right.GetElement(2)) * invIzz); - } - - inline void __device__ AddDampingAcceleration(const ndCudaMatrix3x3& matrix) - { - const ndCudaVector omega(matrix.UnrotateVector(m_omega) * m_dampCoef); - m_omega = matrix.RotateVector(omega); - m_veloc = m_veloc.Scale(m_dampCoef.w); - } - - inline void __device__ IntegrateExternalForce(const ndCudaMatrix3x3& matrix, float timestep) - { - //if (!m_equilibrium && (m_invMass.m_w > float(0.0f))) - { - //const ndVector accel(GetForce().Scale(m_invMass.m_w)); - //const ndVector torque(GetTorque()); - const ndCudaVector accel(0.0); - const ndCudaVector torque(0.0); - - ndCudaVector localOmega(matrix.UnrotateVector(m_omega)); - const ndCudaVector localAngularMomentum(localOmega * m_mass); - const ndCudaVector angularMomentum(matrix.RotateVector(localAngularMomentum)); - const ndCudaVector gyroTorque(m_omega.CrossProduct(angularMomentum)); - const ndCudaVector localTorque(matrix.UnrotateVector(torque - gyroTorque)); - - // and solving for alpha we get the angular acceleration at t + dt - // calculate gradient at a full time step - // derivative at half time step. (similar to midpoint Euler so that it does not loses too much energy) - const ndCudaVector dw(localOmega.Scale(0.5f * timestep)); - - const ndCudaMatrix3x3 jacobianMatrix( - ndCudaVector(m_mass.x, (m_mass.z - m_mass.y) * dw.z, (m_mass.z - m_mass.y) * dw.y, 0.0f), - ndCudaVector((m_mass.x - m_mass.z) * dw.z, m_mass.y, (m_mass.x - m_mass.z) * dw.x, 0.0f), - ndCudaVector((m_mass.y - m_mass.x) * dw.y, (m_mass.y - m_mass.x) * dw.x, m_mass.z, 0.0f)); - - const ndCudaVector gradientStep (jacobianMatrix.SolveByGaussianElimination(localTorque.Scale(timestep))); - localOmega = localOmega + gradientStep; - const ndCudaVector alpha(matrix.RotateVector(localTorque * m_invIntertia)); - - //SetAccel(accel); - //SetAlpha(alpha); - m_veloc = m_veloc + accel.Scale(timestep); - m_omega = matrix.RotateVector(localOmega); - } - //else - //{ - // SetAccel(ndVector::m_zero); - // SetAlpha(ndVector::m_zero); - //} - } - - inline void __device__ IntegrateVelocity(float timestep) - { - m_posit = m_posit + m_veloc.Scale(timestep); - const float omegaMag2 = m_omega.DotProduct(m_omega); - - const float tol = (float(0.0125f) * 3.141592f / 180.0f); - const float tol2 = tol * tol; - if (omegaMag2 > tol2) - { - // this is correct - const float omegaAngle = sqrtf(omegaMag2); - const ndCudaVector omegaAxis(m_omega.Scale(float(1.0f) / omegaAngle)); - const ndCudaQuat rotationStep(omegaAxis, omegaAngle * timestep); - const ndCudaQuat rotation(m_rotation * rotationStep); - m_rotation = rotation.Normalize(); - } - } - - //void ProxyToBody(ndBodyKinematic* const body) const - //void ProxyToBody(ndBodyKinematic* const) const - void ProxyToBody(void* const) const - { - ndAssert(0); - //const ndVector veloc(m_veloc.x, m_veloc.y, m_veloc.z, float(0.0f)); - //const ndVector omega(m_omega.x, m_omega.y, m_omega.z, float(0.0f)); - //const ndVector position(m_posit.x, m_posit.y, m_posit.z, float(1.0f)); - //const ndQuaternion rotation(ndVector(m_rotation.x, m_rotation.y, m_rotation.z, m_rotation.w)); - // - //body->SetOmegaNoSleep(omega); - //body->SetVelocityNoSleep(veloc); - //body->SetMatrixAndCentreOfMass(rotation, position); - } - - ndCudaQuat m_rotation; - ndCudaVector m_posit; - ndCudaVector m_veloc; - ndCudaVector m_omega; - - // scene Management data - ndCudaQuat m_globalSphapeRotation; - ndCudaVector m_globalSphapePosition; - ndCudaVector m_minAabb; - ndCudaVector m_maxAabb; - - // constant Data - ndCudaVector m_mass; - ndCudaVector m_dampCoef; - ndCudaVector m_invIntertia; - ndCudaVector m_obbSize; - ndCudaVector m_obbOrigin; - ndCudaVector m_scale; - ndCudaVector m_localPosition; - ndCudaQuat m_localRotation; - ndCudaQuat m_alignRotation; -}; - - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContext.cu b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContext.cu deleted file mode 100644 index a3abceccac..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContext.cu +++ /dev/null @@ -1,144 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCudaStdafx.h" -#include "ndCudaUtils.h" -#include "ndCudaContext.h" -#include "ndCudaContextImplement.h" - -#define D_CUDA_MIN_COMPUTE_CAP 610 - -void CudaSetMemoryAllocators(ndMemAllocCallback alloc, ndMemFreeCallback free); - -ndCudaContext::ndCudaContext() - :m_device (new ndCudaDevice) - ,m_implement(nullptr) -{ - int capability = m_device->m_prop.major * 100 + m_device->m_prop.minor * 10; - // go as far back as 5.2 Maxwell GeForce GTX 960 or better. - // go as far back as 6.1 Pascal GeForce GTX 1050 or better. - if (capability >= D_CUDA_MIN_COMPUTE_CAP) - { - cudaError_t cudaStatus = cudaSetDevice(0); - if (cudaStatus == cudaSuccess) - { - m_implement = new ndCudaContextImplement(m_device); - } - } -} - -ndCudaContext::~ndCudaContext() -{ - if (m_implement) - { - delete m_implement; - } - delete m_device; -} - -void* ndCudaContext::operator new (size_t size) -{ - return ndCudaMalloc(size); -} - -void ndCudaContext::operator delete (void* ptr) -{ - ndCudaFree(ptr); -} - -void ndCudaContext::SetMemoryAllocators(ndMemAllocCallback alloc, ndMemFreeCallback free) -{ - CudaSetMemoryAllocators(alloc, free); -} - -bool ndCudaContext::IsValid() const -{ - return m_implement ? true : false; -} - -const char* ndCudaContext::GetStringId() const -{ - ndAssert(m_implement); - return m_implement->GetStringId(); -} - -#if 0 -ndCudaSpatialVector* ndCudaContext::GetTransformBuffer() -{ - return m_implement->GetTransformBuffer(); -} - - -void ndCudaContext::ResizeBuffers(int size) -{ - m_implement->ResizeBuffers(size); -} - -void ndCudaContext::LoadBodyData(const ndCudaBodyProxy* const src, int size) -{ - m_implement->LoadBodyData(src, size); -} - -void ndCudaContext::ValidateContextBuffers() -{ - m_implement->ValidateContextBuffers(); -} - -void ndCudaContext::InitBodyArray() -{ - m_implement->InitBodyArray(); -} - -void ndCudaContext::IntegrateBodies(float timestep) -{ - m_implement->IntegrateBodies(timestep); -} - -void ndCudaContext::IntegrateUnconstrainedBodies(float timestep) -{ - m_implement->IntegrateUnconstrainedBodies(timestep); -} - -void ndCudaContext::UpdateTransform() -{ - m_implement->UpdateTransform(); -} -#endif - -void ndCudaContext::Begin() -{ - m_implement->Begin(); -} - -void ndCudaContext::End() -{ - m_implement->End(); -} - -void ndCudaContext::Cleanup() -{ - m_implement->Cleanup(); -} - -void ndCudaContext::PrepareCleanup() -{ - m_implement->PrepareCleanup(); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContext.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContext.h deleted file mode 100644 index 8a3ff85246..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContext.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_CONTEXT_H__ -#define __ND_CUDA_CONTEXT_H__ - -#include "ndCudaStdafx.h" - -class ndCudaDevice; -//class ndCudaBodyProxy; -//class ndCudaSpatialVector; -class ndCudaContextImplement; - -typedef void* (*ndMemAllocCallback) (size_t size); -typedef void (*ndMemFreeCallback) (void* const ptr); - -class ndCudaContext -{ - public: - D_CUDA_API ndCudaContext(); - D_CUDA_API ~ndCudaContext(); - - D_CUDA_API void* operator new (size_t size); - D_CUDA_API void operator delete (void* ptr); - - D_CUDA_API bool IsValid() const; - D_CUDA_API const char* GetStringId() const; - - D_CUDA_API void Begin(); - D_CUDA_API void End(); - D_CUDA_API void Cleanup(); - D_CUDA_API void PrepareCleanup(); - -#if 0 - D_CUDA_API void ResizeBuffers(int size); - D_CUDA_API void LoadBodyData(const ndCudaBodyProxy* const src, int size); - - D_CUDA_API void InitBodyArray(); - D_CUDA_API void UpdateTransform(); - D_CUDA_API void ValidateContextBuffers(); - - D_CUDA_API ndCudaSpatialVector* GetTransformBuffer(); - - D_CUDA_API void IntegrateBodies(float timestep); - D_CUDA_API void IntegrateUnconstrainedBodies(float timestep); -#endif - - D_CUDA_API static void SetMemoryAllocators(ndMemAllocCallback alloc, ndMemFreeCallback free); - - ndCudaDevice* m_device; - ndCudaContextImplement* m_implement; -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplement.cu b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplement.cu deleted file mode 100644 index 8bb724b3fc..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplement.cu +++ /dev/null @@ -1,579 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCudaStdafx.h" -#include "ndCudaUtils.h" -#include "ndCudaSort.cuh" -#include "ndCudaDevice.h" -#include "ndCudaContext.h" -#include "ndCudaPrefixScan.cuh" -#include "ndCudaSortUnOrdered.cuh" -#include "ndCudaContextImplement.h" -#include "ndCudaContextImplementInternal.cuh" - -#define D_PROFILE_KERNELS -#define D_USE_EVENT_FOR_SYNC - -ndCudaContextImplement::ndCudaContextImplement(ndCudaDevice* const device) - :m_device(device) - //,m_sceneInfoGpu(nullptr) - //,m_sceneInfoCpu(nullptr) - //,m_histogram() - //,m_bodyBuffer() - //,m_sceneGraph() - //,m_bodyAabbCell() - //,m_bodyAabbCellScratch() - //,m_transformBuffer0() - //,m_transformBuffer1() - //,m_transformBufferCpu() - //,m_solverMemCpuStream(0) - //,m_solverComputeStream(0) - //,m_timeInSeconds(0.0f) - //,m_frameCounter(0) -{ - //cudaError_t cudaStatus; - //cudaStatus = cudaStreamCreate(&m_solverMemCpuStream); - //ndAssert(cudaStatus == cudaSuccess); - // - //cudaStatus = cudaStreamCreate(&m_solverComputeStream); - //ndAssert(cudaStatus == cudaSuccess); - // - //cudaStatus = cudaMalloc((void**)&m_sceneInfoGpu, sizeof(ndCudaSceneInfo)); - //ndAssert(cudaStatus == cudaSuccess); - // - //cudaStatus = cudaMallocHost((void**)&m_sceneInfoCpu, sizeof(ndCudaSceneInfo)); - //ndAssert(cudaStatus == cudaSuccess); - // - //if (cudaStatus != cudaSuccess) - //{ - // ndAssert(0); - //} - // - //*m_sceneInfoCpu = ndCudaSceneInfo(); - m_sortPrefixBuffer.SetCount(m_sortPrefixBuffer.GetCapacity()); - - // *********************************** - //m_src.SetCount(8); - //m_src.SetCount(17); - //m_src.SetCount(64); - //m_src.SetCount(256); - //m_src.SetCount(256 + 99); - //m_src.SetCount(301); - //m_src.SetCount(512); - //m_src.SetCount(512 + 100); - //m_src.SetCount(512 + 99); - m_src.SetCount(10000); - //m_src.SetCount(100000); - //m_src.SetCount(1000000); - for (int i = 0; i < m_src.GetCount(); ++i) - { - //m_src[i] = rand() % 256; - m_src[i] = rand() % (256 * 256); - //m_src[i] = rand() & 0x7fffffff; - //m_src[i] = m_src.GetCount() - i - 1; - //m_src[i] = m_src[i] & 0xff; - //m_src[i] = m_src.GetCount() - 1 - i; - } - - //m_src[4] = 1; - //m_src[9] = 1; - //m_src[14] = 1; - //m_src[0] = 255; - //m_src[11] = 1; - //m_src[20] = 0; - //m_src[21] = 1; - - m_dst1 = m_src; - m_dst0 = m_src; - - m_buf = m_src; - m_buf0 = m_buf; - m_buf1 = m_buf; - - class GetKey0 - { - public: - int GetRadix(int item) const - { - return item & 0xff; - }; - }; - - class GetKey1 - { - public: - int GetRadix(int item) const - { - return (item >> 8) & 0xff; - }; - }; - - ndCudaHostBuffer scan; - scan.SetCount(1024 * 256); - ndCountingSort(m_src, m_dst0, scan); - ndCountingSort(m_src, m_dst0, scan); - //ndCountingSort(m_dst0, m_src, scan); - for (int i = 1; i < m_src.GetCount(); ++i) - { - int a = m_src[i - 1]; - int b = m_src[i - 0]; - ndAssert(a <= b); - } -} - -ndCudaContextImplement::~ndCudaContextImplement() -{ - ndAssert(m_device); - - //cudaError_t cudaStatus; - //cudaStatus = cudaFreeHost(m_sceneInfoCpu); - //ndAssert(cudaStatus == cudaSuccess); - // - //cudaStatus = cudaFree(m_sceneInfoGpu); - //ndAssert(cudaStatus == cudaSuccess); - // - //cudaStatus = cudaStreamDestroy(m_solverComputeStream); - //ndAssert(cudaStatus == cudaSuccess); - // - //cudaStatus = cudaStreamDestroy(m_solverMemCpuStream); - //ndAssert(cudaStatus == cudaSuccess); - // - //if (cudaStatus != cudaSuccess) - //{ - // ndAssert(0); - //} -} - -ndCudaDevice* ndCudaContextImplement::GetDevice() const -{ - return m_device; -} - -const char* ndCudaContextImplement::GetStringId() const -{ - return m_device->m_prop.name; -} - -int ndCudaContextImplement::GetComputeUnits() const -{ - return m_device->GetComputeUnits(); -} - -ndCudaDeviceBuffer& ndCudaContextImplement::GetPrefixScanBuffer() -{ - return m_sortPrefixBuffer; -} - -#if 0 -ndCudaSpatialVector* ndCudaContextImplement::GetTransformBuffer() -{ - return &m_transformBufferCpu[0]; -} - -void ndCudaContextImplement::ResizeBuffers(int cpuBodyCount) -{ - ndCudaDeviceBuffer& histogram = m_histogram; - ndCudaDeviceBuffer& bodyBuffer = m_bodyBuffer; - ndCudaDeviceBuffer& sceneGraph = m_sceneGraph; - ndCudaDeviceBuffer& bodyAabbCell0 = m_bodyAabbCell; - ndCudaDeviceBuffer& bodyAabbCell1 = m_bodyAabbCellScratch; - ndCudaDeviceBuffer& transformBuffer0 = m_transformBuffer0; - ndCudaDeviceBuffer& transformBuffer1 = m_transformBuffer1; - - histogram.SetCount(cpuBodyCount); - bodyBuffer.SetCount(cpuBodyCount); - sceneGraph.SetCount(cpuBodyCount * 2); - bodyAabbCell0.SetCount(cpuBodyCount); - bodyAabbCell1.SetCount(cpuBodyCount); - transformBuffer0.SetCount(cpuBodyCount); - transformBuffer1.SetCount(cpuBodyCount); - - ndCudaHostBuffer& transformBufferCpu = m_transformBufferCpu; - transformBufferCpu.SetCount(cpuBodyCount); -} - -void ndCudaContextImplement::LoadBodyData(const ndCudaBodyProxy* const src, int cpuBodyCount) -{ - m_imageCpu.m_context->m_device->SyncDevice(); - - ndCudaSceneInfo info; - info.m_histogram = ndCudaBuffer(m_histogram); - info.m_bodyArray = ndCudaBuffer(m_bodyBuffer); - info.m_sceneGraph = ndCudaBuffer(m_sceneGraph); - info.m_bodyAabbCell = ndCudaBuffer(m_bodyAabbCell); - info.m_bodyAabbCellScratch = ndCudaBuffer(m_bodyAabbCellScratch); - info.m_transformBuffer0 = ndCudaBuffer(m_transformBuffer0); - info.m_transformBuffer1 = ndCudaBuffer(m_transformBuffer1); - - *m_sceneInfoCpu = info; - cudaError_t cudaStatus = cudaMemcpy(m_sceneInfoGpu, &info, sizeof(ndCudaSceneInfo), cudaMemcpyHostToDevice); - ndAssert(cudaStatus == cudaSuccess); - - const int blocksCount = (cpuBodyCount + D_THREADS_PER_BLOCK - 1) / D_THREADS_PER_BLOCK; - m_bodyBuffer.ReadData(src, cpuBodyCount); - ndCudaInitTransforms << > > (*m_sceneInfoCpu); - ndCudaGenerateSceneGraph << <1, 1, 0, m_solverComputeStream >> > (*m_sceneInfoCpu); - - m_imageCpu.m_context->m_device->SyncDevice(); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } -} - -void ndCudaContextImplement::ValidateContextBuffers() -{ - ndCudaSceneInfo* const sceneInfo = m_sceneInfoCpu; - if (!sceneInfo->m_frameIsValid) - { - m_device->SyncDevice(); - - if (sceneInfo->m_histogram.m_size > sceneInfo->m_histogram.m_capacity) - { - sceneInfo->m_frameIsValid = 1; - m_histogram.SetCount(sceneInfo->m_histogram.m_size); - sceneInfo->m_histogram = ndCudaBuffer(m_histogram); - } - - if (sceneInfo->m_bodyAabbCell.m_size > sceneInfo->m_bodyAabbCell.m_capacity) - { - sceneInfo->m_frameIsValid = 1; - m_bodyAabbCell.SetCount(sceneInfo->m_bodyAabbCell.m_size); - m_bodyAabbCellScratch.SetCount(sceneInfo->m_bodyAabbCell.m_size); - sceneInfo->m_bodyAabbCell = ndCudaBuffer(m_bodyAabbCell); - sceneInfo->m_bodyAabbCellScratch = ndCudaBuffer(m_bodyAabbCellScratch); - } - - if (!sceneInfo->m_frameCount) - { - sceneInfo->m_frameIsValid = 1; - } - - ndAssert(sceneInfo->m_frameIsValid); - cudaError_t cudaStatus = cudaMemcpy(m_sceneInfoGpu, sceneInfo, sizeof(ndCudaSceneInfo), cudaMemcpyHostToDevice); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } - m_imageCpu.m_context->m_device->SyncDevice(); - } -} - -void ndCudaContextImplement::UpdateTransform() -{ - ndCudaSceneInfo* const infoGpu = m_sceneInfoGpu; - ndCudaGetBodyTransforms << <1, 1, 0, m_solverComputeStream >> > (*infoGpu); -} - -void ndCudaContextImplement::InitBodyArray() -{ - //auto CompactMovingBodies = ndMakeObject::ndFunction([this, &scans](int threadIndex, int threadCount) - //{ - // const ndArray& activeBodyArray = GetActiveBodyArray(); - // ndBodyKinematic** const sceneBodyArray = &m_sceneBodyArray[0]; - // - // const ndArray& view = m_bodyList.m_view; - // int* const scan = &scans[threadIndex][0]; - // - // const ndStartEnd startEnd(view.GetCount(), threadIndex, threadCount); - // for (int i = startEnd.m_start; i < startEnd.m_end; ++i) - // { - // ndBodyKinematic* const body = activeBodyArray[i]; - // const int key = body->m_sceneEquilibrium; - // const int index = scan[key]; - // sceneBodyArray[index] = body; - // scan[key] ++; - // } - //}); - //ParallelExecute(BuildBodyArray); - //int sum = 0; - //int threadCount = GetThreadCount(); - //for (int j = 0; j < 2; j++) - //{ - // for (int i = 0; i < threadCount; ++i) - // { - // const int count = scans[i][j]; - // scans[i][j] = sum; - // sum += count; - // } - //} - // - //int movingBodyCount = scans[0][1] - scans[0][0]; - //m_sceneBodyArray.SetCount(m_bodyList.GetCount()); - //if (movingBodyCount) - //{ - // ParallelExecute(CompactMovingBodies); - //} - // - //m_sceneBodyArray.SetCount(movingBodyCount); - // - //ndBodyKinematic* const sentinelBody = m_sentinelBody; - //sentinelBody->PrepareStep(GetActiveBodyArray().GetCount() - 1); - // - //sentinelBody->m_isStatic = 1; - //sentinelBody->m_autoSleep = 1; - //sentinelBody->m_equilibrium = 1; - //sentinelBody->m_equilibrium0 = 1; - //sentinelBody->m_isJointFence0 = 1; - //sentinelBody->m_isJointFence1 = 1; - //sentinelBody->m_isConstrained = 0; - //sentinelBody->m_sceneEquilibrium = 1; - //sentinelBody->m_weigh = ndFloat32(0.0f); - - auto GetItemsCount = [] __device__(const ndCudaSceneInfo & info) - { - return info.m_bodyAabbCell.m_size - 1; - }; - - auto GetSrcBuffer = [] __device__(const ndCudaSceneInfo &info) - { - return &info.m_bodyAabbCell.m_array[0].m_value; - }; - - auto GetDstBuffer = [] __device__(const ndCudaSceneInfo & info) - { - return &info.m_bodyAabbCellScratch.m_array[0].m_value; - }; - - auto GetSortKey_x = [] __device__(long long value) - { - ndCudaBodyAabbCell item; - item.m_value = value; - const unsigned key = item.m_key; - return key & 0xff; - }; - - auto GetSortKey_y = [] __device__(long long value) - { - ndCudaBodyAabbCell item; - item.m_value = value; - const unsigned key = item.m_key; - return (key>>8) & 0xff; - }; - - auto GetSortKey_z = [] __device__(long long value) - { - ndCudaBodyAabbCell item; - item.m_value = value; - const unsigned key = item.m_key; - return (key >> 16) & 0xff; - }; - - auto GetSortKey_w = [] __device__(long long value) - { - ndCudaBodyAabbCell item; - item.m_value = value; - const unsigned key = item.m_key; - return (key >> 24) & 0xff; - }; - - long long dommyType = 0; - ndCudaSceneInfo* const infoGpu = m_sceneInfoGpu; - - ndCudaInitBodyArray << <1, 1, 0, m_solverComputeStream >> > (*infoGpu); - ndCudaHillisSteelePrefixScan << <1, 1, 0, m_solverComputeStream >> > (*infoGpu); - ndCudaGenerateGrids << <1, 1, 0, m_solverComputeStream >> > (*infoGpu); - ndCudaCountingSort << <1, 1, 0, m_solverComputeStream >> > (*infoGpu, dommyType, GetSrcBuffer, GetDstBuffer, GetItemsCount, GetSortKey_x, 256); - ndCudaCountingSort << <1, 1, 0, m_solverComputeStream >> > (*infoGpu, dommyType, GetDstBuffer, GetSrcBuffer, GetItemsCount, GetSortKey_y, 256); - ndCudaCountingSort << <1, 1, 0, m_solverComputeStream >> > (*infoGpu, dommyType, GetSrcBuffer, GetDstBuffer, GetItemsCount, GetSortKey_z, 256); - ndCudaCountingSort << <1, 1, 0, m_solverComputeStream >> > (*infoGpu, dommyType, GetDstBuffer, GetSrcBuffer, GetItemsCount, GetSortKey_w, 256); - ndCudaCalculateBodyPairsCount << <1, 1, 0, m_solverComputeStream >> > (*infoGpu); -} - -#endif - -void ndCudaContextImplement::PrepareCleanup() -{ - m_device->SyncDevice(); -} - -void ndCudaContextImplement::Cleanup() -{ - m_device->SyncDevice(); - -#ifdef D_USE_EVENT_FOR_SYNC - m_device->m_lastError = cudaEventRecord(m_device->m_syncEvent, 0); - ndAssert(m_device->m_lastError == cudaSuccess); -#endif -} - -void ndCudaContextImplement::Begin() -{ -#ifdef D_PROFILE_KERNELS - m_device->m_lastError = cudaEventRecord(m_device->m_startTimer, 0); - ndAssert(m_device->m_lastError == cudaSuccess); -#endif - - //// get the scene info from the update - //ndCudaSceneInfo* const gpuInfo = m_sceneInfoGpu; - //ndCudaSceneInfo* const cpuInfo = m_sceneInfoCpu; - // - //cudaError_t cudaStatus = cudaMemcpyAsync(cpuInfo, gpuInfo, sizeof(ndCudaSceneInfo), cudaMemcpyDeviceToHost, m_solverMemCpuStream); - //ndAssert(cudaStatus == cudaSuccess); - //if (cudaStatus != cudaSuccess) - //{ - // ndAssert(0); - //} - // - //m_timeInSeconds = double(cpuInfo->m_frameTimeInNanosecunds) * double(1.0e-9f); - ////printf("cpu frame:%d ms:%lld\n", cpuInfo->m_frameCount, cpuInfo->m_frameTimeInNanosecunds/1000000); - // - //const int frameCounter = m_frameCounter; - //if (frameCounter) - //{ - // ndCudaHostBuffer& cpuBuffer = m_transformBufferCpu; - // ndCudaDeviceBuffer& gpuBuffer = (frameCounter & 1) ? m_transformBuffer1 : m_transformBuffer0; - // gpuBuffer.WriteData(&cpuBuffer[0], cpuBuffer.GetCount() - 1, m_solverMemCpuStream); - //} - // - //ndCudaBeginFrame << < 1, 1, 0, m_solverComputeStream >> > (*gpuInfo); - - //class GetKey - //{ - // public: - // int GetRadix(int item) const - // { - // return item & 0xff; - // }; - //}; - //ndCountingSort(m_src, m_dst0, m_scan0); - //ndCountingSort(m_src, m_dst0, m_scan0); - //ndCountingSort(m_src, m_dst0, m_scan0); - //ndCountingSort(m_src, m_dst0, m_scan0); - -#if 1 - - cudaEvent_t start_event, stop_event; - cudaEventCreate(&start_event); - cudaEventCreate(&stop_event); - - int numIterations = 1; - //int numIterations = 100; - cudaEventRecord(start_event, 0); - for (int i = 0; i < numIterations; ++i) - { -#if 0 - auto GetRadix = [] __host__ __device__(int item) - { - //return item & (1024 - 1); - return item & (256 - 1); - }; - - ndCountingSortUnOrdered(this, m_buf0, m_buf1, GetRadix); - //ndCountingSortUnOrdered(this, m_buf0, m_buf1, GetRadix); - //ndCountingSortUnOrdered(this, m_buf0, m_buf1, GetRadix); - //ndCountingSortUnOrdered(this, m_buf0, m_buf1, GetRadix); -#else - auto GetRadix0 = [] __host__ __device__(int item) - { - return item & 0xff; - }; - - auto GetRadix1 = [] __host__ __device__(int item) - { - return (item >> 8) & 0xff; - }; - - //auto GetRadix2 = [] __host__ __device__(int item) - //{ - // return (item >> 16) & 0xff; - //}; - // - //auto GetRadix3 = [] __host__ __device__(int item) - //{ - // return (item >> 24) & 0xff; - //}; - - //m_dst0 = m_buf1; - //ndCountingSort(this, m_buf0, m_buf1, GetRadix0); - //ndCountingSort(this, m_buf0, m_buf1, GetRadix0); - //ndCountingSort(this, m_buf0, m_buf1, GetRadix0); - //ndCountingSort(this, m_buf0, m_buf1, GetRadix0); - - ndCountingSort(this, m_buf0, m_buf1, GetRadix0); - ndCountingSort(this, m_buf0, m_buf1, GetRadix1); - //ndCountingSort(this, m_buf0, m_buf1, GetRadix2); - //ndCountingSort(this, m_buf1, m_buf1, GetRadix3); -#endif - } - cudaEventRecord(stop_event, 0); - cudaEventSynchronize(stop_event); - - float totalTime; - cudaEventElapsedTime(&totalTime, start_event, stop_event); - - //totalTime = totalTime * 1.0e-3f; - float gigKeys = float (m_buf0.GetCount() * numIterations) * (1.0e-9f * 1.0e3f); - cudaExpandTraceMessage("newton sort, throughput = %f gigaKeys/seconds, time = %f ms, size = %u elements\n", gigKeys / totalTime, totalTime/numIterations, m_buf0.GetCount()); - -#if 1 - m_device->SyncDevice(); - //m_buf1.WriteData(&m_dst0[0], m_dst0.GetCount()); - //m_buf0.WriteData(&m_dst0[0], m_dst0.GetCount()); - - m_dst0 = m_buf0; - m_dst1 = m_buf1; - for (int i = 1; i < m_dst0.GetCount(); ++i) - { - int a = m_dst0[i - 1]; - int b = m_dst0[i - 0]; - ndAssert(a <= b); - } - m_buf0.WriteData(&m_dst1[0], m_dst1.GetCount()); - #endif -#endif -} - -void ndCudaContextImplement::End() -{ -#ifdef D_PROFILE_KERNELS - cudaEventRecord(m_device->m_stopTimer, 0); -#endif - -#ifdef D_USE_EVENT_FOR_SYNC - m_device->m_lastError = cudaEventRecord(m_device->m_syncEvent, 0); - ndAssert(m_device->m_lastError == cudaSuccess); - cudaEventSynchronize(m_device->m_syncEvent); -#else - m_device->SyncDevice(); -#endif - -#ifdef D_PROFILE_KERNELS - float elapsedTime; - cudaEventElapsedTime(&elapsedTime, m_device->m_startTimer, m_device->m_stopTimer); - - m_device->m_timerFrames++; - m_device->m_timeAcc += elapsedTime; - if (m_device->m_timerFrames >= 60) - { - cuTrace (("kernels average time = %f ms\n", m_device->m_timeAcc / m_device->m_timerFrames)); - m_device->m_timerFrames = 0; - m_device->m_timeAcc = 0.0f; - } -#endif - - //m_frameCounter = m_frameCounter + 1; - //ndCudaSceneInfo* const gpuInfo = m_sceneInfoGpu; - //ndCudaEndFrame << < 1, 1, 0, m_solverComputeStream >> > (*gpuInfo, m_frameCounter); -} - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplement.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplement.h deleted file mode 100644 index e7211bf1d1..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplement.h +++ /dev/null @@ -1,106 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_CONTEXT_IMPLEMENT_H__ -#define __ND_CUDA_CONTEXT_IMPLEMENT_H__ - -#include "ndCudaStdafx.h" -#include "ndCudaUtils.h" -#include "ndCudaDevice.h" -#include "ndCudaSceneInfo.h" -#include "ndCudaBodyProxy.h" -#include "ndCudaHostBuffer.h" -#include "ndCudaDeviceBuffer.h" - -#define D_THREADS_PER_BLOCK_BITS 8 -#define D_THREADS_PER_BLOCK (1<& GetPrefixScanBuffer(); - - - //ndCudaSceneInfo* m_sceneInfoGpu; - //ndCudaSceneInfo* m_sceneInfoCpu; - // - //// gpu buffers - //ndCudaDeviceBuffer m_histogram; - //ndCudaDeviceBuffer m_bodyBuffer; - //ndCudaDeviceBuffer m_sceneGraph; - //ndCudaDeviceBuffer m_bodyAabbCell; - //ndCudaDeviceBuffer m_bodyAabbCellScratch; - //ndCudaDeviceBuffer m_transformBuffer0; - //ndCudaDeviceBuffer m_transformBuffer1; - // - //// host buffers - //ndCudaHostBuffer m_transformBufferCpu; - // - //cudaStream_t m_solverMemCpuStream; - //cudaStream_t m_solverComputeStream; - //unsigned m_frameCounter; - - - - private: - ndCudaDevice* m_device; - ndCudaDeviceBuffer m_sortPrefixBuffer; - - friend class ndCudaSphFluid; - - /// ********************** - ndCudaHostBuffer m_src; - ndCudaHostBuffer m_dst0; - ndCudaHostBuffer m_dst1; - ndCudaDeviceBuffer m_buf; - ndCudaDeviceBuffer m_buf0; - ndCudaDeviceBuffer m_buf1; -}; - - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplementInternal.cu b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplementInternal.cu deleted file mode 100644 index c9ab06954d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplementInternal.cu +++ /dev/null @@ -1,421 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCudaStdafx.h" -#include "ndCudaUtils.h" -#include "ndCudaDevice.h" -#include "ndCudaSort.cuh" -#include "ndCudaContext.h" -#include "ndCudaPrefixScan.cuh" -#include "ndCudaContextImplement.h" -#include "ndCudaContextImplementInternal.cuh" - -#if 0 -#define D_CUDA_SCENE_GRID_SIZE 8.0f -#define D_CUDA_SCENE_INV_GRID_SIZE (1.0f/D_CUDA_SCENE_GRID_SIZE) - -static ndCudaBoundingBox __device__ g_boundingBoxBuffer[1024 * 1024 / D_THREADS_PER_BLOCK]; - -__global__ void ndCudaInitBodyArrayInternal(ndCudaSceneInfo& info) -{ - __shared__ ndCudaBoundingBox cacheAabb[D_THREADS_PER_BLOCK]; - - const unsigned threadId = threadIdx.x; - const unsigned index = threadId + blockDim.x * blockIdx.x; - const unsigned bodyCount = info.m_bodyArray.m_size - 1; - if (index < bodyCount) - { - ndCudaBodyProxy* bodyArray = info.m_bodyArray.m_array; - ndCudaBodyProxy& body = bodyArray[index]; - - // calculate shape global Matrix - body.m_globalSphapeRotation = body.m_localRotation * body.m_rotation; - ndCudaMatrix3x3 matrix(body.m_globalSphapeRotation.GetMatrix3x3()); - body.m_globalSphapePosition = matrix.RotateVector(body.m_localPosition) + body.m_posit; - - matrix.m_front = matrix.m_front.Scale(body.m_scale.x); - matrix.m_up = matrix.m_up.Scale(body.m_scale.y); - matrix.m_right = matrix.m_right.Scale(body.m_scale.z); - matrix = body.m_alignRotation.GetMatrix3x3() * matrix; - - const ndCudaVector origin(matrix.RotateVector(body.m_obbOrigin) + body.m_globalSphapePosition); - const ndCudaVector size(matrix.m_front.Abs().Scale(body.m_obbSize.x) + matrix.m_up.Abs().Scale(body.m_obbSize.y) + matrix.m_right.Abs().Scale(body.m_obbSize.z)); - - const ndCudaVector padding(1.0f / 16.0f); - const ndCudaVector minBox(origin - size - padding); - const ndCudaVector maxBox(origin + size + padding); - - // save aabb and calculate bonding box for this thread block - body.m_minAabb = minBox; - body.m_maxAabb = maxBox; - cacheAabb[threadId].m_min = minBox; - cacheAabb[threadId].m_max = maxBox; - } - - const unsigned lastBlock = bodyCount / D_THREADS_PER_BLOCK; - if (lastBlock == blockIdx.x) - { - __syncthreads(); - const unsigned lastId = bodyCount - D_THREADS_PER_BLOCK * lastBlock; - const ndCudaBoundingBox box(cacheAabb[0]); - if (threadId >= lastId) - { - cacheAabb[threadId] = box; - } - } - __syncthreads(); - - for (int i = D_THREADS_PER_BLOCK / 2; i; i = i >> 1) - { - if (threadId < i) - { - cacheAabb[threadId].m_min = cacheAabb[threadId].m_min.Min(cacheAabb[threadId + i].m_min); - cacheAabb[threadId].m_max = cacheAabb[threadId].m_max.Max(cacheAabb[threadId + i].m_max); - } - __syncthreads(); - } - - if (threadId == 0) - { - g_boundingBoxBuffer[blockIdx.x].m_min = cacheAabb[0].m_min; - g_boundingBoxBuffer[blockIdx.x].m_max = cacheAabb[0].m_max; - } -}; - -__global__ void ndCudaMergeAabbInternal(ndCudaSceneInfo& info) -{ - __shared__ ndCudaBoundingBox cacheAabb[D_THREADS_PER_BLOCK]; - const unsigned threadId = threadIdx.x; - const unsigned boxCount = ((info.m_bodyArray.m_size - 1) + D_THREADS_PER_BLOCK - 1) / D_THREADS_PER_BLOCK; - const unsigned aabbBlocks = boxCount / D_THREADS_PER_BLOCK; - const unsigned boxLastRow = boxCount - aabbBlocks * D_THREADS_PER_BLOCK; - - cacheAabb[threadId] = g_boundingBoxBuffer[0]; - if (threadId < boxLastRow) - { - cacheAabb[threadId] = g_boundingBoxBuffer[aabbBlocks * D_THREADS_PER_BLOCK + threadId]; - } - __syncthreads(); - - unsigned base = 0; - for (int i = 0; i < aabbBlocks; i++) - { - cacheAabb[threadId].m_min = cacheAabb[threadId].m_min.Min(cacheAabb[base + threadId].m_min); - cacheAabb[threadId].m_max = cacheAabb[threadId].m_max.Min(cacheAabb[base + threadId].m_max); - base += D_THREADS_PER_BLOCK; - } - __syncthreads(); - - for (int i = D_THREADS_PER_BLOCK / 2; i; i = i >> 1) - { - if (threadId < i) - { - cacheAabb[threadId].m_min = cacheAabb[threadId].m_min.Min(cacheAabb[threadId + i].m_min); - cacheAabb[threadId].m_max = cacheAabb[threadId].m_max.Max(cacheAabb[threadId + i].m_max); - } - __syncthreads(); - } - - if (threadIdx.x == 0) - { - ndCudaVector minBox((cacheAabb[0].m_min.Scale(D_CUDA_SCENE_INV_GRID_SIZE).Floor()).Scale(D_CUDA_SCENE_GRID_SIZE)); - ndCudaVector maxBox((cacheAabb[0].m_max.Scale(D_CUDA_SCENE_INV_GRID_SIZE).Floor()).Scale(D_CUDA_SCENE_GRID_SIZE) + ndCudaVector(D_CUDA_SCENE_GRID_SIZE)); - minBox.w = 0.0f; - maxBox.w = 0.0f; - info.m_worldBox.m_min = minBox; - info.m_worldBox.m_max = maxBox; - } -}; - -__global__ void ndCudaGenerateGridsInternal(ndCudaSceneInfo& info) -{ - const unsigned threadId = threadIdx.x; - const unsigned index = threadId + blockDim.x * blockIdx.x; - const unsigned bodyCount = info.m_bodyArray.m_size - 1; - if (index < bodyCount) - { - const unsigned* histogram = info.m_histogram.m_array; - const ndCudaBodyProxy* bodyArray = info.m_bodyArray.m_array; - ndCudaBodyAabbCell* hashArray = info.m_bodyAabbCell.m_array; - - const ndCudaVector minBox(info.m_worldBox.m_min); - const ndCudaVector bodyBoxMin(bodyArray[index].m_minAabb); - const ndCudaVector bodyBoxMax(bodyArray[index].m_maxAabb); - - const int x0 = __float2int_rd((bodyBoxMin.x - minBox.x) * D_CUDA_SCENE_INV_GRID_SIZE); - const int y0 = __float2int_rd((bodyBoxMin.y - minBox.y) * D_CUDA_SCENE_INV_GRID_SIZE); - const int z0 = __float2int_rd((bodyBoxMin.z - minBox.z) * D_CUDA_SCENE_INV_GRID_SIZE); - const int x1 = __float2int_rd((bodyBoxMax.x - minBox.x) * D_CUDA_SCENE_INV_GRID_SIZE) + 1; - const int y1 = __float2int_rd((bodyBoxMax.y - minBox.y) * D_CUDA_SCENE_INV_GRID_SIZE) + 1; - const int z1 = __float2int_rd((bodyBoxMax.z - minBox.z) * D_CUDA_SCENE_INV_GRID_SIZE) + 1; - - ndCudaBodyAabbCell hash; - - hash.m_key = 0; - hash.m_id = index; - unsigned start = index ? histogram[index - 1] : 0; - for (int z = z0; z < z1; z++) - { - hash.m_z = z; - for (int y = y0; y < y1; y++) - { - hash.m_y = y; - for (int x = x0; x < x1; x++) - { - hash.m_x = x; - hashArray[start].m_value = hash.m_value; - start++; - } - } - } - } -}; - -__global__ void ndCudaCountAabbInternal(ndCudaSceneInfo& info) -{ - const unsigned blockId = blockIdx.x; - const unsigned bodyCount = info.m_bodyArray.m_size - 1; - const unsigned threadId = threadIdx.x; - const unsigned index = threadId + blockDim.x * blockId; - - unsigned* histogram = info.m_histogram.m_array; - const ndCudaBodyProxy* bodyArray = info.m_bodyArray.m_array; - if (index < bodyCount) - { - const ndCudaVector minBox(info.m_worldBox.m_min); - const ndCudaVector bodyBoxMin(bodyArray[index].m_minAabb); - const ndCudaVector bodyBoxMax(bodyArray[index].m_maxAabb); - - const int x0 = __float2int_rd((bodyBoxMin.x - minBox.x) * D_CUDA_SCENE_INV_GRID_SIZE); - const int y0 = __float2int_rd((bodyBoxMin.y - minBox.y) * D_CUDA_SCENE_INV_GRID_SIZE); - const int z0 = __float2int_rd((bodyBoxMin.z - minBox.z) * D_CUDA_SCENE_INV_GRID_SIZE); - const int x1 = __float2int_rd((bodyBoxMax.x - minBox.x) * D_CUDA_SCENE_INV_GRID_SIZE) + 1; - const int y1 = __float2int_rd((bodyBoxMax.y - minBox.y) * D_CUDA_SCENE_INV_GRID_SIZE) + 1; - const int z1 = __float2int_rd((bodyBoxMax.z - minBox.z) * D_CUDA_SCENE_INV_GRID_SIZE) + 1; - const int count = (z1 - z0) * (y1 - y0) * (x1 - x0); - histogram[index] = count; - } -}; - -//auto CalculateBodyPairsCount = [] __device__(cuSceneInfo & info) -__global__ void ndCudaCalculateBodyPairsCountInternal(ndCudaSceneInfo& info) -{ - //__shared__ unsigned cacheBuffer[D_THREADS_PER_BLOCK / 2 + D_THREADS_PER_BLOCK]; - // - //const unsigned blockId = blockIdx.x; - //const unsigned cellCount = info.m_bodyAabbCell.m_size - 1; - //const unsigned blocks = (cellCount + blockDim.x - 1) / blockDim.x; - //if (blockId < blocks) - //{ - // const unsigned threadId = threadIdx.x; - // const unsigned threadId1 = D_THREADS_PER_BLOCK / 2 + threadId; - // int index = threadId + blockDim.x * blockIdx.x; - // - // cacheBuffer[threadId] = 0; - // cacheBuffer[threadId1] = 0; - // if (index < cellCount) - // { - // const cuBodyAabbCell* hashArray = info.m_bodyAabbCell.m_array; - // - // unsigned count = 0; - // const cuBodyAabbCell& cell = hashArray[index]; - // - // for (int i = index + 1; cell.m_key == hashArray[i].m_key; i++) - // { - // count++; - // } - // cacheBuffer[threadId1] = count; - // } - // - // __syncthreads(); - // for (int i = 1; i < D_THREADS_PER_BLOCK; i = i << 1) - // { - // int sum = cacheBuffer[threadId1] + cacheBuffer[threadId1 - i]; - // __syncthreads(); - // cacheBuffer[threadId1] = sum; - // __syncthreads(); - // } - // - // if (index < cellCount) - // { - // unsigned* scan = info.m_histogram.m_array; - // const unsigned prefixScanSuperBlockAlign = D_PREFIX_SCAN_PASSES * D_THREADS_PER_BLOCK; - // const unsigned offset = (cellCount + prefixScanSuperBlockAlign) & (-prefixScanSuperBlockAlign); - // scan[offset + index] = cacheBuffer[threadId1]; - // } - //} -}; - -__global__ void ndCudaGetBodyTransformsInternal (ndCudaSceneInfo & info) -{ - int index = threadIdx.x + blockDim.x * blockIdx.x; - if (index < (info.m_bodyArray.m_size - 1)) - { - const ndCudaBodyProxy* src = info.m_bodyArray.m_array; - ndCudaSpatialVector* dst = (info.m_frameCount & 1) ? info.m_transformBuffer0.m_array : info.m_transformBuffer1.m_array; - - dst[index].m_linear = src[index].m_posit; - dst[index].m_angular = src[index].m_rotation; - } -}; - -__global__ void ndCudaBeginFrame(ndCudaSceneInfo& info) -{ - long long start; - asm volatile("mov.u64 %0, %%globaltimer;" : "=l"(start)); - info.m_startFrameTime = start; -} - -__global__ void ndCudaEndFrame(ndCudaSceneInfo& info, int frameCount) -{ - long long end; - asm volatile("mov.u64 %0, %%globaltimer;" : "=l"(end)); - info.m_frameTimeInNanosecunds = end - info.m_startFrameTime; - - //printf("gpu frame:%d ms:%lld\n", info.m_frameCount, info.m_frameTimeInNanosecunds / 1000000); - info.m_frameCount = frameCount; -} - -__global__ void ndCudaInitBodyArray(ndCudaSceneInfo& info) -{ - if (info.m_frameIsValid) - { - const unsigned bodyCount = info.m_bodyArray.m_size - 1; - const unsigned blocksCount = (bodyCount + D_THREADS_PER_BLOCK - 1) / D_THREADS_PER_BLOCK; - ndCudaInitBodyArrayInternal << > > (info); - #ifdef _DEBUG - if (blocksCount > D_THREADS_PER_BLOCK * 16) - { - printf("function: %sn too many block to ruun in one block\n", __FUNCTION__); - } - #endif - ndCudaMergeAabbInternal << <1, D_THREADS_PER_BLOCK, 0 >> > (info); - - m_device->SyncDevice(); - info.m_histogram.m_size = bodyCount; - if (bodyCount > info.m_histogram.m_capacity) - { - cuInvalidateFrame(info, __FUNCTION__, __LINE__); - return; - } - ndCudaCountAabbInternal << > > (info); - } -} - -__global__ void ndCudaGenerateGrids(ndCudaSceneInfo& info) -{ - if (info.m_frameIsValid) - { - const unsigned bodyCount = info.m_bodyArray.m_size - 1; - const unsigned cellCount = info.m_histogram.m_array[bodyCount - 1]; - if ((cellCount + D_THREADS_PER_BLOCK) > info.m_bodyAabbCell.m_capacity) - { - cuInvalidateFrame(info, __FUNCTION__, __LINE__); - info.m_bodyAabbCell.m_size = cellCount + D_THREADS_PER_BLOCK; - info.m_bodyAabbCellScratch.m_size = cellCount + D_THREADS_PER_BLOCK; - printf("skipping frame %d function %s line %d\n", info.m_frameCount, __FUNCTION__, __LINE__); - return; - } - - ndCudaBodyAabbCell cell; - ndCudaBodyAabbCell* cellArray = info.m_bodyAabbCell.m_array; - ndCudaBodyAabbCell* cellArrayScratch = info.m_bodyAabbCellScratch.m_array; - - cell.m_value = 0; - cell.m_x = unsigned(-1); - cell.m_y = unsigned(-1); - cell.m_z = unsigned(-1); - cell.m_id = unsigned(-1); - cellArray[cellCount].m_value = cell.m_value; - cellArrayScratch[cellCount].m_value = cell.m_value; - - const unsigned blocksCount = (cellCount + D_THREADS_PER_BLOCK - 1) / D_THREADS_PER_BLOCK; - - info.m_bodyAabbCell.m_size = cellCount + 1; - info.m_bodyAabbCellScratch.m_size = cellCount + 1; - ndCudaGenerateGridsInternal << > > (info); - - const unsigned newCapacity = ndCudaCountingSortCalculateScanPrefixSize(cellCount + 2, D_THREADS_PER_BLOCK); - if (newCapacity > info.m_histogram.m_capacity) - { - cuInvalidateFrame(info, __FUNCTION__, __LINE__); - info.m_histogram.m_size = newCapacity; - } - } -} - -__global__ void ndCudaCalculateBodyPairsCount(ndCudaSceneInfo& info) -{ - if (info.m_frameIsValid) - { - //printf("unsorted: %s\n", __FUNCTION__); - //const ndCudaBodyAabbCell* dst = info.m_bodyAabbCellScrath.m_array; - //for (int i = 0; i < info.m_bodyAabbCellScrath.m_size; i++) - //{ - // ndCudaBodyAabbCell cell = dst[i]; - // printf("x(%d) y(%d) z(%d) id(%d) %llx\n", cell.m_x, cell.m_y, cell.m_z, cell.m_id, cell.m_value); - //} - //printf("\n"); - // - //printf("sorted: %s\n", __FUNCTION__); - //const ndCudaBodyAabbCell* src = info.m_bodyAabbCell.m_array; - //for (int i = 0; i < info.m_bodyAabbCell.m_size; i++) - //{ - // const ndCudaBodyAabbCell cell = src[i]; - // printf("x(%d) y(%d) z(%d) id(%d) %llx\n", cell.m_x, cell.m_y, cell.m_z, cell.m_id, cell.m_value); - //} - //printf("\n"); - // - //printf("\n"); - //printf("%s %d\n", __FUNCTION__, info.m_frameCount); - } -}; - -__global__ void ndCudaGetBodyTransforms(ndCudaSceneInfo& info) -{ - if (info.m_frameIsValid) - { - const unsigned threads = info.m_bodyArray.m_size - 1; - const unsigned blocks = (threads + D_THREADS_PER_BLOCK - 1) / D_THREADS_PER_BLOCK; - ndCudaGetBodyTransformsInternal << > > (info); - } -} - -__global__ void ndCudaInitTransforms(ndCudaSceneInfo& info) -{ - int index = threadIdx.x + blockDim.x * blockIdx.x; - if (index < info.m_bodyArray.m_size) - { - const ndCudaBodyProxy* src = info.m_bodyArray.m_array; - ndCudaSpatialVector* dst0 = info.m_transformBuffer0.m_array; - ndCudaSpatialVector* dst1 = info.m_transformBuffer1.m_array; - - dst0[index].m_linear = src[index].m_posit; - dst0[index].m_angular = src[index].m_rotation; - dst1[index].m_linear = src[index].m_posit; - dst1[index].m_angular = src[index].m_rotation; - } -} - -__global__ void ndCudaGenerateSceneGraph(ndCudaSceneInfo& info) -{ -} -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplementInternal.cuh b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplementInternal.cuh deleted file mode 100644 index b831b10766..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplementInternal.cuh +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_CONTEXT_IMPLEMENT_INTERNAL_H__ -#define __ND_CUDA_CONTEXT_IMPLEMENT_INTERNAL_H__ - -//#include "ndCudaStdafx.h" -//#include "ndCudaUtils.h" -//#include "ndCudaDevice.h" -//#include "ndCudaSceneInfo.h" -//#include "ndCudaBodyProxy.h" -//#include "ndCudaHostBuffer.h" -//#include "ndCudaDeviceBuffer.h" - -#include - -#if 0 -class ndCudaSceneInfo; - -__global__ void ndCudaMergeAabbInternal(ndCudaSceneInfo& info); -__global__ void ndCudaCountAabbInternal(ndCudaSceneInfo& info); -__global__ void ndCudaInitBodyArrayInternal(ndCudaSceneInfo& info); -__global__ void ndCudaGenerateGridsInternal(const ndCudaSceneInfo& info); -__global__ void ndCudaCalculateBodyPairsCountInternal(ndCudaSceneInfo& info); -__global__ void ndCudaGetBodyTransformsInternal(const ndCudaSceneInfo& info); - - -__global__ void ndCudaBeginFrame(ndCudaSceneInfo& info); -__global__ void ndCudaInitTransforms(ndCudaSceneInfo& info); -__global__ void ndCudaInitBodyArray(ndCudaSceneInfo& info); -__global__ void ndCudaGenerateGrids(ndCudaSceneInfo& info); -__global__ void ndCudaGetBodyTransforms(ndCudaSceneInfo& info); -__global__ void ndCudaGenerateSceneGraph(ndCudaSceneInfo& info); -__global__ void ndCudaCalculateBodyPairsCount(ndCudaSceneInfo& info); -__global__ void ndCudaEndFrame(ndCudaSceneInfo& info, int frameCount); - -#endif - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplementSolver.cu b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplementSolver.cu deleted file mode 100644 index f039440d1f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaContextImplementSolver.cu +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCudaStdafx.h" -#include "ndCudaUtils.h" -#include "ndCudaSort.cuh" -#include "ndCudaDevice.h" -#include "ndCudaContext.h" -#include "ndCudaPrefixScan.cuh" -#include "ndCudaContextImplement.h" - -#if 0 -__global__ void CudaIntegrateUnconstrainedBodiesInternal(ndCudaSceneInfo& info, float timestep) -{ - int index = threadIdx.x + blockDim.x * blockIdx.x; - const unsigned maxCount = info.m_bodyArray.m_size - 1; - ndCudaBodyProxy* bodyArray = info.m_bodyArray.m_array; - if (index < maxCount) - { - ndCudaBodyProxy& body = bodyArray[index]; - const ndCudaMatrix3x3 matrix(body.m_rotation.GetMatrix3x3()); - body.AddDampingAcceleration(matrix); - body.IntegrateExternalForce(matrix, timestep); - } -} - -__global__ void CudaIntegrateBodiesInternal(ndCudaSceneInfo& info, float timestep) -{ - int index = threadIdx.x + blockDim.x * blockIdx.x; - const unsigned maxCount = info.m_bodyArray.m_size - 1; - ndCudaBodyProxy* bodyArray = info.m_bodyArray.m_array; - if (index < maxCount) - { - ndCudaBodyProxy& body = bodyArray[index]; - body.IntegrateVelocity(timestep); - //printf("%f %f %f %f\n", body.m_rotation.x, body.m_rotation.y, body.m_rotation.z, body.m_rotation.w); - } -}; - -__global__ void CudaIntegrateUnconstrainedBodies(ndCudaSceneInfo& info, float timestep) -{ - const unsigned threads = info.m_bodyArray.m_size - 1; - if (info.m_frameIsValid && threads) - { - const unsigned blocks = (threads + D_THREADS_PER_BLOCK - 1) / D_THREADS_PER_BLOCK; - CudaIntegrateUnconstrainedBodiesInternal << > > (info, timestep); - } -} - - -__global__ void CudaIntegrateBodies(ndCudaSceneInfo& info, float timestep) -{ - const unsigned threads = info.m_bodyArray.m_size - 1; - if (info.m_frameIsValid && threads) - { - const unsigned blocks = (threads + D_THREADS_PER_BLOCK - 1) / D_THREADS_PER_BLOCK; - CudaIntegrateBodiesInternal << > > (info, timestep); - } -} - -void ndCudaContextImplement::IntegrateBodies(float timestep) -{ - ndCudaSceneInfo* const infoGpu = m_sceneInfoGpu; - CudaIntegrateBodies << <1, 1, 0, m_solverComputeStream >> > (*infoGpu, timestep); -} - -void ndCudaContextImplement::IntegrateUnconstrainedBodies(float timestep) -{ - ndCudaSceneInfo* const infoGpu = m_sceneInfoGpu; - CudaIntegrateUnconstrainedBodies <<<1, 1, 0, m_solverComputeStream >>> (*infoGpu, timestep); -} -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaDevice.cu b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaDevice.cu deleted file mode 100644 index 575dabcbcd..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaDevice.cu +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCudaStdafx.h" -#include "ndCudaUtils.h" -#include "ndCudaDevice.h" - -#define D_STATUS_ERROR_SIZE 512 - -ndErrorCode::ndErrorCode() - :m_baseAdress(nullptr) - ,m_offset(0) -{ -} - -ndErrorCode::ndErrorCode(ndCudaDevice* const context) - :m_baseAdress(context->m_statusMemory) - ,m_offset(0) -{ - for (int i = 0; i < D_STATUS_ERROR_SIZE; i++) - { - if (m_baseAdress[i] == -1) - { - m_offset = i; - m_baseAdress[m_offset] = 0; - return; - } - } - ndAssert(0); -} - -ndErrorCode::~ndErrorCode() -{ - Set(-1); -} - -ndCudaDevice::ndCudaDevice() -{ - m_lastError = cudaGetDeviceProperties(&m_prop, 0); - ndAssert(m_lastError == cudaSuccess); - - m_lastError = cudaSetDevice(0); - ndAssert(m_lastError == cudaSuccess); - - cuTrace(("gpu: %s\n", m_prop.name)); - cuTrace(("compute capability: %d.%d\n", m_prop.major, m_prop.minor)); - - cuTrace(("warp size: %d\n", m_prop.warpSize)); - cuTrace(("multiprocessors: %d\n", m_prop.multiProcessorCount)); - cuTrace(("max threads per blocks %d\n", m_prop.maxThreadsPerBlock)); - cuTrace(("memory bus width: %d bits\n", m_prop.memoryBusWidth)); - cuTrace(("shared memory: (kbytes) %d\n", m_prop.sharedMemPerBlock / 1024)); - cuTrace(("global memory: (mbytes) %d\n", m_prop.totalGlobalMem / (1024 * 1024))); - cuTrace(("blocks per multiprocessors %d\n", m_prop.maxBlocksPerMultiProcessor)); - - m_workGroupSize = std::min(m_prop.maxThreadsPerBlock, 1024); - m_computeUnits = std::min(4 * m_prop.multiProcessorCount, 512); - - m_lastError = cudaMallocManaged(&m_statusMemory, D_STATUS_ERROR_SIZE * sizeof(int)); - ndAssert(m_lastError == cudaSuccess); - memset(m_statusMemory, -1, D_STATUS_ERROR_SIZE * sizeof(int)); - - m_lastError = cudaEventCreate(&m_startTimer); - ndAssert(m_lastError == cudaSuccess); - - m_lastError = cudaEventCreate(&m_stopTimer); - ndAssert(m_lastError == cudaSuccess); - - m_lastError = cudaEventCreate(&m_syncEvent); - ndAssert(m_lastError == cudaSuccess); - - m_lastError = cudaStreamCreateWithFlags(&m_childStream, cudaStreamDefault); - ndAssert(m_lastError == cudaSuccess); - - m_timeAcc = 0.0f; - m_timerFrames = 0; -} - -ndCudaDevice::~ndCudaDevice() -{ - m_lastError = cudaEventDestroy(m_startTimer); - ndAssert(m_lastError == cudaSuccess); - - m_lastError = cudaEventDestroy(m_stopTimer); - ndAssert(m_lastError == cudaSuccess); - - m_lastError = cudaEventDestroy(m_syncEvent); - ndAssert(m_lastError == cudaSuccess); - - m_lastError = cudaStreamDestroy(m_childStream); - ndAssert(m_lastError == cudaSuccess); - - m_lastError = cudaFree(m_statusMemory); - ndAssert(m_lastError == cudaSuccess); - - m_lastError = cudaDeviceReset(); - ndAssert(m_lastError == cudaSuccess); - - m_lastError = cudaStreamCreateWithFlags(&m_childStream, cudaStreamDefault); - ndAssert(m_lastError == cudaSuccess); -} - -void ndCudaDevice::SyncDevice() const -{ - cudaDeviceSynchronize(); -} - -void* ndCudaDevice::operator new (size_t size) -{ - return ndCudaMalloc(size); -} - -void ndCudaDevice::operator delete (void* ptr) -{ - ndCudaFree(ptr); -} - -int ndCudaDevice::GetComputeUnits() const -{ - return m_computeUnits; -} - -ndKernelParams::ndKernelParams(const ndCudaDevice* const device, int workGroupSize, int itemCount) - :m_itemCount(itemCount) - ,m_workGroupSize(workGroupSize) - ,m_deviceComputeUnits(device->GetComputeUnits()) -{ - ndAssert(workGroupSize); - ndAssert(!(workGroupSize & (workGroupSize - 1))); - ndAssert(workGroupSize <= device->m_workGroupSize); - int computeUnitsBashCount = (itemCount + m_workGroupSize - 1) / m_workGroupSize; - - m_blocksPerKernel = (computeUnitsBashCount + m_deviceComputeUnits - 1) / m_deviceComputeUnits; - m_kernelCount = (itemCount + m_blocksPerKernel * m_workGroupSize - 1) / (m_blocksPerKernel * m_workGroupSize); - ndAssert(m_kernelCount <= m_deviceComputeUnits); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaDevice.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaDevice.h deleted file mode 100644 index 2b8bb70a73..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaDevice.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_DEVICE_H__ -#define __ND_CUDA_DEVICE_H__ - -#include "ndCudaStdafx.h" - -#include -#include -#include - -class ndCudaDevice -{ - public: - ndCudaDevice(); - ~ndCudaDevice(); - - void* operator new (size_t size); - void operator delete (void* ptr); - - void SyncDevice() const; - int GetComputeUnits() const; - - cudaDeviceProp m_prop; - cudaEvent_t m_startTimer; - cudaEvent_t m_stopTimer; - cudaEvent_t m_syncEvent; - cudaStream_t m_childStream; - - int* m_statusMemory; - int m_computeUnits; - int m_workGroupSize; - int m_timerFrames; - float m_timeAcc; - cudaError_t m_lastError; -}; - -class ndKernelParams -{ - public: - ndKernelParams() {} - ndKernelParams(const ndCudaDevice* const device, int workGroupSize, int itemCount); - - __device__ __host__ ndKernelParams(const ndKernelParams& params, int workGroupSize, int itemCount) - :m_itemCount(itemCount) - ,m_workGroupSize(workGroupSize) - ,m_deviceComputeUnits(params.m_deviceComputeUnits) - { - int computeUnitsBashCount = (itemCount + m_workGroupSize - 1) / m_workGroupSize; - m_blocksPerKernel = (computeUnitsBashCount + m_deviceComputeUnits - 1) / m_deviceComputeUnits; - m_kernelCount = (itemCount + m_blocksPerKernel * m_workGroupSize - 1) / (m_blocksPerKernel * m_workGroupSize); - } - - int m_itemCount; - int m_kernelCount; - int m_workGroupSize; - int m_blocksPerKernel; - int m_deviceComputeUnits; -}; - -class ndErrorCode -{ - public: - ndErrorCode(); - ndErrorCode(ndCudaDevice* const context); - ~ndErrorCode(); - - int __device__ __host__ Get() const - { - return m_baseAdress[m_offset]; - } - - void __device__ __host__ Set(int x) - { - m_baseAdress[m_offset] = x; - } - - int* Pointer() const - { - return &m_baseAdress[m_offset]; - } - - private: - int* m_baseAdress; - int m_offset; -}; - - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaDeviceBuffer.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaDeviceBuffer.h deleted file mode 100644 index 9d3ea09844..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaDeviceBuffer.h +++ /dev/null @@ -1,303 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_DEVICE_BUFFER_H__ -#define __ND_CUDA_DEVICE_BUFFER_H__ - -#include -#include -#include "ndCudaUtils.h" -#include "ndCudaIntrinsics.h" - -template -class ndCudaHostBuffer; - -template -class ndCudaDeviceBuffer -{ - public: - ndCudaDeviceBuffer(); - ndCudaDeviceBuffer(const ndCudaDeviceBuffer& src); - ~ndCudaDeviceBuffer(); - - int GetCount() const; - void SetCount(int count); - - void Clear(); - void Resize(int count); - int GetCapacity() const; - - T& operator[] (int i); - const T& operator[] (int i) const; - - ndCudaDeviceBuffer& operator= (const ndCudaHostBuffer& src); - ndCudaDeviceBuffer& operator= (const ndCudaDeviceBuffer& src); - - void ReadData(const T* const src, int elements); - void WriteData(T* const dst, int elements) const; - - void ReadData(const T* const src, int elements, cudaStream_t stream); - void WriteData(T* const dst, int elements, cudaStream_t stream) const; - - T* m_array; - int m_size; - int m_capacity; -}; - -template -class ndAssessor -{ - public: - ndAssessor() - :m_array(nullptr) - ,m_size(0) - ,m_capacity(0) - { - } - - __device__ __host__ ndAssessor(const ndCudaDeviceBuffer& buffer) - :m_array(buffer.m_array) - ,m_size(buffer.m_size) - ,m_capacity(buffer.m_capacity) - { - } - - __device__ __host__ T& operator[] (int i) - { - return m_array[i]; - } - - __device__ __host__ const T& operator[] (int i) const - { - return m_array[i]; - } - - T* m_array; - int m_size; - int m_capacity; -}; - -template -ndCudaDeviceBuffer::ndCudaDeviceBuffer() - :m_array(nullptr) - ,m_size(0) - ,m_capacity(0) -{ - SetCount(D_GRANULARITY); - SetCount(0); -} - -template -ndCudaDeviceBuffer::ndCudaDeviceBuffer(const ndCudaDeviceBuffer& src) - :m_array(SetCount(src.GetCount())) - ,m_size(src.m_size) - ,m_capacity(src.m_capacity) -{ - cudaError_t cudaStatus = cudaSuccess; - cudaStatus = cudaMemcpy(m_array, src.m_array, m_size * sizeof(T), cudaMemcpyDeviceToDevice); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } -} - -template -ndCudaDeviceBuffer::~ndCudaDeviceBuffer() -{ - if (m_array) - { - cudaError_t cudaStatus = cudaSuccess; - cudaStatus = cudaFree(m_array); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } - } -} - -template -const T& ndCudaDeviceBuffer::operator[] (int i) const -{ - ndAssert(i >= 0); - ndAssert(i < m_size); - return m_array[i]; -} - -template -T& ndCudaDeviceBuffer::operator[] (int i) -{ - ndAssert(i >= 0); - ndAssert(i < m_size); - return m_array[i]; -} - -template -ndCudaDeviceBuffer& ndCudaDeviceBuffer::operator= (const ndCudaDeviceBuffer& src) -{ - cudaError_t cudaStatus; - SetCount(src.GetCount()); - cudaStatus = cudaMemcpy(m_array, src.m_array, m_size * sizeof(T), cudaMemcpyDeviceToDevice); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } - return *this; -} - -template -ndCudaDeviceBuffer& ndCudaDeviceBuffer::operator= (const ndCudaHostBuffer& src) -{ - cudaError_t cudaStatus; - SetCount(src.GetCount()); - cudaStatus = cudaMemcpy(m_array, src.m_array, m_size * sizeof(T), cudaMemcpyHostToDevice); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } - - return *this; -} - -template -int ndCudaDeviceBuffer::GetCount() const -{ - return m_size; -} - -template -void ndCudaDeviceBuffer::SetCount(int count) -{ - while (count > m_capacity) - { - Resize(m_capacity * 2); - } - m_size = count; -} - -template -int ndCudaDeviceBuffer::GetCapacity() const -{ - return m_capacity; -} - -template -void ndCudaDeviceBuffer::Clear() -{ - m_size = 0; -} - -template -void ndCudaDeviceBuffer::Resize(int newSize) -{ - cudaError_t cudaStatus = cudaSuccess; - if (newSize > m_capacity || (m_capacity == 0)) - { - T* newArray; - newSize = std::max(newSize, D_GRANULARITY); - const int itemSizeInBytes = sizeof(T); - cudaStatus = cudaMalloc((void**)&newArray, newSize * itemSizeInBytes); - ndAssert(cudaStatus == cudaSuccess); - if (m_array) - { - cudaStatus = cudaMemcpy(newArray, m_array, m_size * itemSizeInBytes, cudaMemcpyDeviceToDevice); - ndAssert(cudaStatus == cudaSuccess); - cudaStatus = cudaFree(m_array); - ndAssert(cudaStatus == cudaSuccess); - } - m_array = newArray; - m_capacity = newSize; - } - else if (newSize < m_capacity) - { - T* newArray; - const int itemSizeInBytes = sizeof(T); - newSize = std::max(newSize, D_GRANULARITY); - cudaStatus = cudaMalloc((void**)&newArray, newSize * itemSizeInBytes); - if (m_array) - { - cudaStatus = cudaMemcpy(newArray, m_array, newSize * itemSizeInBytes, cudaMemcpyDeviceToDevice); - cudaStatus = cudaFree(m_array); - ndAssert(cudaStatus == cudaSuccess); - } - - m_capacity = newSize; - m_array = newArray; - } - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } -} - -template -void ndCudaDeviceBuffer::ReadData(const T* const src, int elements) -{ - cudaError_t cudaStatus; - ndAssert(elements <= m_size); - cudaStatus = cudaMemcpy(m_array, src, sizeof (T) * elements, cudaMemcpyHostToDevice); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } -} - -template -void ndCudaDeviceBuffer::WriteData(T* const dst, int elements) const -{ - cudaError_t cudaStatus; - ndAssert(m_size <= elements); - cudaStatus = cudaMemcpy(dst, m_array, sizeof(T) * elements, cudaMemcpyDeviceToHost); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } -} - -template -void ndCudaDeviceBuffer::ReadData(const T* const src, int elements, cudaStream_t stream) -{ - ndAssert(elements <= m_size); - cudaError_t cudaStatus = cudaMemcpyAsync(m_array, src, sizeof(T) * elements, cudaMemcpyHostToDevice, stream); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } -} - -template -void ndCudaDeviceBuffer::WriteData(T* const dst, int elements, cudaStream_t stream) const -{ - ndAssert(elements <= m_size); - cudaError_t cudaStatus = cudaMemcpyAsync(dst, m_array, sizeof(T) * elements, cudaMemcpyDeviceToHost, stream); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaHostBuffer.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaHostBuffer.h deleted file mode 100644 index 64f264ef45..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaHostBuffer.h +++ /dev/null @@ -1,1435 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_HOST_BUFFER_H__ -#define __ND_CUDA_HOST_BUFFER_H__ - -#include -#include -#include "ndCudaUtils.h" -#include "ndCudaIntrinsics.h" -#include "ndCudaPrefixScan.cuh" - -#define D_HOST_SORTING_ALGORITHM 1 - -template -class ndCudaDeviceBuffer; - -template -class ndCudaHostBuffer -{ - public: - ndCudaHostBuffer(); - ndCudaHostBuffer(const ndCudaHostBuffer& src); - ~ndCudaHostBuffer(); - - int GetCount() const; - void SetCount(int count); - - void Clear(); - void Resize(int count); - int GetCapacity() const; - - T& operator[] (int i); - const T& operator[] (int i) const; - - ndCudaHostBuffer& operator= (const ndCudaHostBuffer& src); - ndCudaHostBuffer& operator= (const ndCudaDeviceBuffer& src); - - void Swap(ndCudaHostBuffer& buffer); - - void ReadData(const T* const src, int elements); - void WriteData(T* const dst, int elements) const; - - void ReadData(const T* const src, int elements, cudaStream_t stream); - void WriteData(T* const dst, int elements, cudaStream_t stream) const; - - T* m_array; - int m_size; - int m_capacity; -}; - -template -void ndCountingSort(ndCudaHostBuffer& buffer, ndCudaHostBuffer& auxiliaryBuffer, ndCudaHostBuffer& scansBuffer); - -template -ndCudaHostBuffer::ndCudaHostBuffer() - :m_array(nullptr) - ,m_size(0) - ,m_capacity(0) -{ - SetCount(D_GRANULARITY); - SetCount(0); -} - -template -ndCudaHostBuffer::ndCudaHostBuffer(const ndCudaHostBuffer& src) - :m_array(SetCount(src.GetCount())) - ,m_size(src.m_size) - ,m_capacity(src.m_capacity) -{ - cudaError_t cudaStatus = cudaSuccess; - cudaStatus = cudaMemcpy(m_array, src.m_array, m_size * sizeof(T), cudaMemcpyHostToHost); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } -} - -template -ndCudaHostBuffer::~ndCudaHostBuffer() -{ - if (m_array) - { - cudaError_t cudaStatus = cudaSuccess; - cudaStatus = cudaFreeHost(m_array); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } - } -} - -template -const T& ndCudaHostBuffer::operator[] (int i) const -{ - ndAssert(i >= 0); - ndAssert(i < m_size); - return m_array[i]; -} - -template -T& ndCudaHostBuffer::operator[] (int i) -{ - ndAssert(i >= 0); - ndAssert(i < m_size); - return m_array[i]; -} - -template -ndCudaHostBuffer& ndCudaHostBuffer::operator=(const ndCudaHostBuffer& src) -{ - cudaError_t cudaStatus; - SetCount(src.GetCount()); - cudaStatus = cudaMemcpy(m_array, src.m_array, m_size * sizeof(T), cudaMemcpyHostToHost); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } - return* this; -} - -template -ndCudaHostBuffer& ndCudaHostBuffer::operator=(const ndCudaDeviceBuffer& src) -{ - cudaError_t cudaStatus; - SetCount(src.GetCount()); - cudaStatus = cudaMemcpy(m_array, src.m_array, m_size * sizeof(T), cudaMemcpyDeviceToHost); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } - return*this; -} - -template -int ndCudaHostBuffer::GetCount() const -{ - return m_size; -} - -template -void ndCudaHostBuffer::SetCount(int count) -{ - while (count > m_capacity) - { - Resize(m_capacity * 2); - } - m_size = count; -} - -template -int ndCudaHostBuffer::GetCapacity() const -{ - return m_capacity; -} - -template -void ndCudaHostBuffer::Clear() -{ - m_size = 0; -} - -template -void ndCudaHostBuffer::Swap(ndCudaHostBuffer& buffer) -{ - cuSwap(m_size, buffer.m_size); - cuSwap(m_array, buffer.m_array); - cuSwap(m_capacity, buffer.m_capacity); -} - -template -void ndCudaHostBuffer::Resize(int newSize) -{ - cudaError_t cudaStatus = cudaSuccess; - if (newSize > m_capacity || (m_capacity == 0)) - { - T* newArray; - newSize = std::max(newSize, D_GRANULARITY); - cudaStatus = cudaMallocHost((void**)&newArray, newSize * sizeof(T)); - ndAssert(cudaStatus == cudaSuccess); - if (m_array) - { - cudaStatus = cudaMemcpy(newArray, m_array, m_size * sizeof(T), cudaMemcpyHostToHost); - ndAssert(cudaStatus == cudaSuccess); - cudaStatus = cudaFreeHost(m_array); - ndAssert(cudaStatus == cudaSuccess); - } - m_array = newArray; - m_capacity = newSize; - } - else if (newSize < m_capacity) - { - T* newArray; - newSize = std::max(newSize, D_GRANULARITY); - cudaStatus = cudaMallocHost((void**)&newArray, newSize * sizeof(T)); - if (m_array) - { - ndAssert(0); - cudaStatus = cudaMemcpy(newArray, m_array, newSize * sizeof(T), cudaMemcpyHostToHost); - cudaStatus = cudaFreeHost(m_array); - ndAssert(cudaStatus == cudaSuccess); - } - - m_capacity = newSize; - m_array = newArray; - } - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } -} - -template -void ndCudaHostBuffer::ReadData(const T* const src, int elements) -{ - ndAssert(elements <= m_size); - cudaMemcpy(m_array, src, sizeof (T) * elements, cudaMemcpyHostToDevice); -} - -template -void ndCudaHostBuffer::WriteData(T* const dst, int elements) const -{ - ndAssert(elements <= m_size); - cudaMemcpy(dst, m_array, sizeof(T) * elements, cudaMemcpyDeviceToHost); -} - -template -void ndCudaHostBuffer::ReadData(const T* const src, int elements, cudaStream_t stream) -{ - ndAssert(elements <= m_size); - cudaError_t cudaStatus = cudaMemcpyAsync(m_array, src, sizeof(T) * elements, cudaMemcpyHostToDevice, stream); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } -} - -template -void ndCudaHostBuffer::WriteData(T* const dst, int elements, cudaStream_t stream) const -{ - ndAssert(elements <= m_size); - cudaError_t cudaStatus = cudaMemcpyAsync(dst, m_array, sizeof(T) * elements, cudaMemcpyDeviceToHost, stream); - ndAssert(cudaStatus == cudaSuccess); - if (cudaStatus != cudaSuccess) - { - ndAssert(0); - } -} - -template -class ndBankFreeArray -{ - public: - ndBankFreeArray() - { - } - - int GetBankAddress(int address) const - { - int low = address & (D_BANK_COUNT_GPU - 1); - int high = address >> D_LOG_BANK_COUNT_GPU; - int dst = high * (D_BANK_COUNT_GPU + 1) + low; - return dst; - } - - T& operator[] (int address) - { - int index = GetBankAddress(address); - return m_array[index]; - } - - T m_array[((size + D_BANK_COUNT_GPU - 1) >> D_LOG_BANK_COUNT_GPU) * (D_BANK_COUNT_GPU + 1)]; -}; - -template -void ndCountingSort(ndCudaHostBuffer& buffer, ndCudaHostBuffer& auxiliaryBuffer, ndCudaHostBuffer& scansBuffer) -{ -#if 1 - //optimized Hillis-Steele prefix scan sum - auto AddPrefix = [&](int blockIdx, int blockDim, int computeUnits) - { - int localPrefixScan[D_DEVICE_SORT_MAX_RADIX_SIZE + 1]; - - auto ShuffleUp = [&](const int* in, int* out, int offset) - { - //for (int i = 0; i < offset; ++i) - for (int i = 0; i < D_BANK_COUNT_GPU; ++i) - { - out[i] = in[i]; - } - - for (int i = D_BANK_COUNT_GPU - offset - 1; i >= 0; --i) - { - out[i + offset] = in[i]; - } - }; - - int sumReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int offsetReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - for (int threadId = 0; threadId < blockDim; ++threadId) - { - sumReg[threadId] = 0; - offsetReg[threadId] = threadId; - } - localPrefixScan[0] = 0; - - for (int i = 0; i < computeUnits; ++i) - { - for (int threadId = 0; threadId < blockDim; ++threadId) - { - int count = scansBuffer[offsetReg[threadId]]; - scansBuffer[offsetReg[threadId]] = sumReg[threadId]; - sumReg[threadId] += count; - offsetReg[threadId] += blockDim; - } - } - - int memoryTransactions = 0; - for (int bankBase = 0; bankBase < blockDim; bankBase += D_BANK_COUNT_GPU) - { - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int sumTempReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - ShuffleUp(&sumReg[bankBase], &sumTempReg[bankBase], n); - for (int threadId = 0; threadId < D_BANK_COUNT_GPU; ++threadId) - { - int laneId = threadId & (D_BANK_COUNT_GPU - 1); - if (laneId >= n) - { - sumReg[bankBase + threadId] += sumTempReg[bankBase + threadId]; - } - } - } - } - - for (int threadId = 0; threadId < blockDim; ++threadId) - { - if (!(threadId & D_BANK_COUNT_GPU)) - { - localPrefixScan[threadId + 1] = sumReg[threadId]; - memoryTransactions += 1 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - - int scale = 0; - for (int segment = blockDim; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - for (int threadId = 0; threadId < blockDim; ++threadId) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - sumReg[threadId] += localPrefixScan[warpSumIndex - 1 + 1]; - localPrefixScan[threadId + 1] = sumReg[threadId]; - - memoryTransactions += 2 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - scale++; - } - - for (int threadId = 0; threadId < blockDim; ++threadId) - { - scansBuffer[offsetReg[threadId]] = localPrefixScan[threadId]; - } - }; - -#else - //implementation of the Blelloch scan, not better than optimized Hillis-Steele prefix scan sum - //actually three time slower, - //however this is still good for porting to hardware without shuffle instructions - auto AddPrefix = [&](int blockIdx, int blockDim, int computeUnits) - { - int sumReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int offsetReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - //int localPrefixScan[D_DEVICE_SORT_MAX_RADIX_SIZE + 1]; - ndBankFreeArray localPrefixScan; - - for (int threadId = 0; threadId < blockDim; ++threadId) - { - sumReg[threadId] = 0; - offsetReg[threadId] = threadId; - } - - for (int i = 0; i < computeUnits; ++i) - { - for (int threadId = 0; threadId < blockDim; ++threadId) - { - int count = scansBuffer[offsetReg[threadId]]; - scansBuffer[offsetReg[threadId]] = sumReg[threadId]; - sumReg[threadId] += count; - offsetReg[threadId] += blockDim; - } - } - - int memoryTransactions = 0; - for (int threadId = 0; threadId < blockDim; ++threadId) - { - localPrefixScan[threadId] = sumReg[threadId]; - memoryTransactions += 1 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - - int radixBit = 0; - for (int k = 1; k < blockDim; k = k * 2) - { - radixBit++; - for (int threadId = 0; threadId < (blockDim >> radixBit); threadId++) - { - int id1 = ((threadId + 1) << radixBit) - 1; - int id0 = id1 - (1 << (radixBit - 1)); - //cuTrace(("%d ", localPrefixScan.GetBankAddress(id0) % D_BANK_COUNT_GPU)); - int a = localPrefixScan[id0]; - int b = localPrefixScan[id1]; - localPrefixScan[id1] = a + b; - - memoryTransactions += 3 * ((threadId & (D_BANK_COUNT_GPU-1)) == 1); - } - //cuTrace(("\n")); - } - //cuTrace(("\n")); - - localPrefixScan[blockDim] = localPrefixScan[blockDim - 1]; - localPrefixScan[blockDim - 1] = 0; - for (int k = 1; k < blockDim; k = k * 2) - { - for (int threadId = 0; threadId < k; threadId++) - { - int id1 = ((threadId + 1) << radixBit) - 1; - int id0 = id1 - (1 << (radixBit - 1)); - int a = localPrefixScan[id1]; - int b = localPrefixScan[id0] + a; - - localPrefixScan[id0] = a; - localPrefixScan[id1] = b; - - memoryTransactions += 4 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - radixBit--; - } - - for (int threadId = 0; threadId < blockDim; ++threadId) - { - scansBuffer[offsetReg[threadId]] = localPrefixScan[threadId]; - } - }; -#endif - -#if (D_HOST_SORTING_ALGORITHM == 0) - //optimized Hillis-Steele prefix scan sum - //using a simple bitonic sort with two ways bank conflict - auto CountAndSortBlockItems = [&](int blockIndex, int blocksCount) - { - T cachedItems[D_DEVICE_SORT_BLOCK_SIZE]; - int sortedRadix[D_DEVICE_SORT_BLOCK_SIZE]; - int radixCountBuffer[D_DEVICE_SORT_MAX_RADIX_SIZE]; - - int size = buffer.GetCount(); - int radixStride = 1 << exponentRadix; - int blockStride = D_DEVICE_SORT_BLOCK_SIZE; - int bashSize = blocksCount * blockStride * blockIndex; - - ndEvaluateKey evaluator; - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixCountBuffer[threadId] = 0; - } - - for (int i = 0; i < blocksCount; ++i) - { - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int sortedRadixReg[D_DEVICE_SORT_BLOCK_SIZE]; - int index = bashSize + threadId; - sortedRadixReg[threadId] = (radixStride << 16); - if (index < size) - { - const T item(buffer[index]); - cachedItems[threadId] = item; - int radix = evaluator.GetRadix(item); - radixCountBuffer[radix] ++; - sortedRadixReg[threadId] = (radix << 16) + threadId; - } - sortedRadix[threadId] = sortedRadixReg[threadId]; - } - - int memoryTransactions = 0; - for (int k = 1; k < blockStride; k = k << 1) - { - for (int j = k; j > 0; j = j >> 1) - { - int highMask = -j; - int lowMask = ~highMask; - for (int threadId = 0; threadId < blockStride / 2; ++threadId) - { - int lowIndex = threadId & lowMask; - int highIndex = (threadId & highMask) * 2; - - int id0 = highIndex + lowIndex; - int id1 = highIndex + lowIndex + j; - int oddEven = highIndex & k * 2; - //cuTrace(("%d ", id0 % D_BANK_COUNT)); - - int a = sortedRadix[id0]; - int b = sortedRadix[id1]; - - int test = a < b; - int a1 = test ? a : b; - int b1 = test ? b : a; - - int a2 = oddEven ? b1 : a1; - int b2 = oddEven ? a1 : b1; - - sortedRadix[id0] = a2; - sortedRadix[id1] = b2; - - memoryTransactions += 4 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - //cuTrace(("\n")); - } - //cuTrace(("\n")); - } - - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int index = bashSize + threadId; - if (index < size) - { - int keyIndex = sortedRadix[threadId] & 0xffff; - auxiliaryBuffer[index] = cachedItems[keyIndex]; - } - } - - bashSize += blockStride; - } - - for (int threadId = 0; threadId < radixStride; ++threadId) - { - int index = threadId + radixStride * blockIndex; - scansBuffer[index] = radixCountBuffer[threadId]; - } - }; - - auto MergeBuckects = [&](int blockIdx, int blocksCount, int computeUnits) - { - //T cachedItems[D_DEVICE_SORT_BLOCK_SIZE]; - int radixPrefixCount[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int radixPrefixStart[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int radixPrefixScan[D_DEVICE_SORT_MAX_RADIX_SIZE + 1]; - - auto ShuffleUp = [&](const int* in, int* out, int offset) - { - //for (int i = 0; i < offset; ++i) - for (int i = 0; i < D_BANK_COUNT_GPU; ++i) - { - out[i] = in[i]; - } - - for (int i = D_BANK_COUNT_GPU - offset - 1; i >= 0; --i) - { - out[i + offset] = in[i]; - } - }; - - int size = buffer.GetCount(); - int radixStride = (1 << exponentRadix); - int blockStride = D_DEVICE_SORT_BLOCK_SIZE; - int radixBase = blockIdx * radixStride; - int bashSize = blocksCount * blockStride * blockIdx; - int radixPrefixOffset = computeUnits * radixStride; - - ndEvaluateKey evaluator; - - int radixPrefixStartReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - for (int threadId = 0; threadId < radixStride; ++threadId) - { - int a = scansBuffer[radixBase + threadId]; - int b = scansBuffer[radixPrefixOffset + threadId]; - radixPrefixStartReg[threadId] = a + b; - radixPrefixStart[threadId] = radixPrefixStartReg[threadId]; - } - - radixPrefixScan[0] = 0; - for (int i = 0; i < blocksCount; ++i) - { - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixPrefixCount[threadId] = 0; - } - - T cachedItemsReg[D_DEVICE_SORT_BLOCK_SIZE]; - int sortedRadixReg[D_DEVICE_SORT_BLOCK_SIZE]; - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int index = bashSize + threadId; - int radix = radixStride - 1; - sortedRadixReg[threadId] = radix; - if (index < size) - { - const T item(auxiliaryBuffer[index]); - //cachedItems[threadId] = item; - cachedItemsReg[threadId] = item; - radix = evaluator.GetRadix(item); - sortedRadixReg[threadId] = radix; - } - radixPrefixCount[radix] ++; - } - - int memoryTransactions = 0; - - int radixPrefixScanReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int radixPrefixCountReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixPrefixCountReg[threadId] = radixPrefixCount[threadId]; - radixPrefixScanReg[threadId] = radixPrefixCountReg[threadId]; - memoryTransactions += 1 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - - for (int bankBase = 0; bankBase < radixStride; bankBase += D_BANK_COUNT_GPU) - { - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp[D_DEVICE_SORT_MAX_RADIX_SIZE]; - ShuffleUp(&radixPrefixScanReg[bankBase], &radixPrefixScanRegTemp[bankBase], n); - for (int threadId = 0; threadId < D_BANK_COUNT_GPU; ++threadId) - { - if ((threadId & (D_BANK_COUNT_GPU - 1)) >= n) - { - radixPrefixScanReg[bankBase + threadId] += radixPrefixScanRegTemp[bankBase + threadId]; - } - } - } - } - - for (int threadId = 0; threadId < radixStride; ++threadId) - { - if (!(threadId & D_BANK_COUNT_GPU)) - { - radixPrefixScan[threadId + 1] = radixPrefixScanReg[threadId]; - memoryTransactions += 1 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - - int scale = 0; - for (int segment = radixStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - for (int threadId = 0; threadId < radixStride; ++threadId) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - radixPrefixScanReg[threadId] += radixPrefixScan[warpSumIndex]; - radixPrefixScan[threadId + 1] = radixPrefixScanReg[threadId]; - memoryTransactions += 2 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - scale++; - } - - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int index = bashSize + threadId; - if (index < size) - { - int keyLow = sortedRadixReg[threadId]; - int dstOffset1 = radixPrefixStart[keyLow]; - int dstOffset0 = threadId - radixPrefixScan[keyLow]; - //buffer[dstOffset0 + dstOffset1] = cachedItems[threadId]; - buffer[dstOffset0 + dstOffset1] = cachedItemsReg[threadId]; - } - } - - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixPrefixStartReg[threadId] += radixPrefixCountReg[threadId]; - radixPrefixStart[threadId] = radixPrefixStartReg[threadId]; - } - - bashSize += blockStride; - } - }; - -#elif (D_HOST_SORTING_ALGORITHM == 1) - //optimized Hillis-Steele prefix scan sum - //using a two bits counting sort - auto CountAndSortBlockItems = [&](int blockIndex, int blocksCount) - { - T cachedItems[D_DEVICE_SORT_BLOCK_SIZE]; - int sortedRadix[D_DEVICE_SORT_BLOCK_SIZE]; - int radixPrefixCount[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int radixPrefixScan[2 * (D_DEVICE_SORT_BLOCK_SIZE + 1)]; - - auto ShuffleUp = [&](const int* in, int* out, int offset) - { - //for (int i = 0; i < offset; ++i) - for (int i = 0; i < D_BANK_COUNT_GPU; ++i) - { - out[i] = in[i]; - } - - for (int i = D_BANK_COUNT_GPU - offset - 1; i >= 0; --i) - { - out[i + offset] = in[i]; - } - }; - - int size = buffer.GetCount(); - int radixStride = 1 << exponentRadix; - int blockStride = D_DEVICE_SORT_BLOCK_SIZE; - int bashSize = blocksCount * blockStride * blockIndex; - - ndEvaluateKey evaluator; - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixPrefixCount[threadId] = 0; - } - - radixPrefixScan[0] = 0; - radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1] = 0; - - for (int i = 0; i < blocksCount; ++i) - { - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int index = bashSize + threadId; - int radix = radixStride - 1; - int sortKey = radix; - if (index < size) - { - const T item(buffer[index]); - cachedItems[threadId] = item; - radix = evaluator.GetRadix(item); - sortKey = (threadId << 16) + radix; - } - radixPrefixCount[radix] ++; - sortedRadix[threadId] = sortKey; - } - - int memoryTransactions = 0; - for (int bit = 0; (1 << (bit * 2)) < radixStride; ++bit) - { - int keyReg[D_DEVICE_SORT_BLOCK_SIZE]; - for (int threadId = 0; threadId < blockStride; ++threadId) - { - keyReg[threadId] = sortedRadix[threadId]; - memoryTransactions += 1 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - - int dstLocalOffsetReg[D_DEVICE_SORT_BLOCK_SIZE]; - int radixPrefixScanReg0[D_DEVICE_SORT_BLOCK_SIZE]; - int radixPrefixScanReg1[D_DEVICE_SORT_BLOCK_SIZE]; - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int test = (keyReg[threadId] >> (bit * 2)) & 0x3; - dstLocalOffsetReg[threadId] = test; - int bit0 = (test == 0) ? 1 : 0; - int bit1 = (test == 1) ? 1 << 16 : 0; - int bit2 = (test == 2) ? 1 : 0; - int bit3 = (test == 3) ? 1 << 16 : 0; - radixPrefixScanReg0[threadId] = bit0 + bit1; - radixPrefixScanReg1[threadId] = bit2 + bit3; - } - - for (int bankBase = 0; bankBase < blockStride; bankBase += D_BANK_COUNT_GPU) - { - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp0[D_DEVICE_SORT_BLOCK_SIZE]; - int radixPrefixScanRegTemp1[D_DEVICE_SORT_BLOCK_SIZE]; - ShuffleUp(&radixPrefixScanReg0[bankBase], &radixPrefixScanRegTemp0[bankBase], n); - ShuffleUp(&radixPrefixScanReg1[bankBase], &radixPrefixScanRegTemp1[bankBase], n); - for (int threadId = 0; threadId < D_BANK_COUNT_GPU; ++threadId) - { - if ((threadId & (D_BANK_COUNT_GPU - 1)) >= n) - { - radixPrefixScanReg0[bankBase + threadId] += radixPrefixScanRegTemp0[bankBase + threadId]; - radixPrefixScanReg1[bankBase + threadId] += radixPrefixScanRegTemp1[bankBase + threadId]; - } - } - } - } - - for (int threadId = 0; threadId < blockStride; ++threadId) - { - if (!(threadId & D_BANK_COUNT_GPU)) - { - radixPrefixScan[threadId + 1] = radixPrefixScanReg0[threadId]; - radixPrefixScan[threadId + 1 + D_DEVICE_SORT_BLOCK_SIZE + 1] = radixPrefixScanReg1[threadId]; - memoryTransactions += 2 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - - int scale = 0; - for (int segment = blockStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - - radixPrefixScanReg0[threadId] += radixPrefixScan[warpSumIndex - 1 + 1]; - radixPrefixScan[threadId + 1] = radixPrefixScanReg0[threadId]; - - radixPrefixScanReg1[threadId] += radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1 + warpSumIndex - 1 + 1]; - radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1 + threadId + 1] = radixPrefixScanReg1[threadId]; - - memoryTransactions += 4 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - scale++; - } - - int sum0 = radixPrefixScan[1 * (D_DEVICE_SORT_BLOCK_SIZE + 1) - 1]; - int sum1 = radixPrefixScan[2 * (D_DEVICE_SORT_BLOCK_SIZE + 1) - 1]; - int base0 = 0; - int base1 = sum0 & 0xffff; - int base2 = base1 + (sum0 >> 16); - int base3 = base2 + (sum1 & 0xffff); - - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int key0 = radixPrefixScan[threadId]; - int key1 = radixPrefixScan[threadId + D_DEVICE_SORT_BLOCK_SIZE + 1]; - int shift = dstLocalOffsetReg[threadId]; - - int dstIndex = 0; - dstIndex += (shift == 1) ? base1 + (key0 >> 16) : 0; - dstIndex += (shift == 3) ? base3 + (key1 >> 16) : 0; - dstIndex += (shift == 0) ? base0 + (key0 & 0xffff) : 0; - dstIndex += (shift == 2) ? base2 + (key1 & 0xffff) : 0; - - ndAssert(dstIndex >= 0); - ndAssert(dstIndex < blockStride); - sortedRadix[dstIndex] = keyReg[threadId]; - } - } - - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int index = bashSize + threadId; - if (index < size) - { - int keyIndex = sortedRadix[threadId] >> 16; - auxiliaryBuffer[index] = cachedItems[keyIndex]; - } - } - - bashSize += blockStride; - } - - for (int threadId = 0; threadId < radixStride; ++threadId) - { - int index = threadId + radixStride * blockIndex; - scansBuffer[index] = radixPrefixCount[threadId]; - } - }; - - auto MergeBuckects = [&](int blockIdx, int blocksCount, int computeUnits) - { - int radixPrefixCount[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int radixPrefixStart[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int radixPrefixScan[D_DEVICE_SORT_MAX_RADIX_SIZE + 1]; - - auto ShuffleUp = [&](const int* in, int* out, int offset) - { - //for (int i = 0; i < offset; ++i) - for (int i = 0; i < D_BANK_COUNT_GPU; ++i) - { - out[i] = in[i]; - } - - for (int i = D_BANK_COUNT_GPU - offset - 1; i >= 0; --i) - { - out[i + offset] = in[i]; - } - }; - - int size = buffer.GetCount(); - int radixStride = (1 << exponentRadix); - int blockStride = D_DEVICE_SORT_BLOCK_SIZE; - int radixBase = blockIdx * radixStride; - int bashSize = blocksCount * blockStride * blockIdx; - int radixPrefixOffset = computeUnits * radixStride; - - ndEvaluateKey evaluator; - int radixPrefixStartReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - for (int threadId = 0; threadId < radixStride; ++threadId) - { - int a = scansBuffer[radixBase + threadId]; - int b = scansBuffer[radixPrefixOffset + threadId]; - radixPrefixStartReg[threadId] = a + b; - radixPrefixStart[threadId] = radixPrefixStartReg[threadId]; - } - - radixPrefixScan[0] = 0; - for (int i = 0; i < blocksCount; ++i) - { - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixPrefixCount[threadId] = 0; - } - - T cachedItemsReg[D_DEVICE_SORT_BLOCK_SIZE]; - int sortedRadixReg[D_DEVICE_SORT_BLOCK_SIZE]; - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int index = bashSize + threadId; - int radix = radixStride - 1; - sortedRadixReg[threadId] = radix; - if (index < size) - { - const T item(auxiliaryBuffer[index]); - cachedItemsReg[threadId] = item; - radix = evaluator.GetRadix(item); - sortedRadixReg[threadId] = radix; - } - radixPrefixCount[radix] ++; - } - - int memoryTransactions = 0; - - int radixPrefixScanReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int radixPrefixCountReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixPrefixCountReg[threadId] = radixPrefixCount[threadId]; - radixPrefixScanReg[threadId] = radixPrefixCountReg[threadId]; - memoryTransactions += 1 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - - for (int bankBase = 0; bankBase < radixStride; bankBase += D_BANK_COUNT_GPU) - { - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp[D_DEVICE_SORT_MAX_RADIX_SIZE]; - ShuffleUp(&radixPrefixScanReg[bankBase], &radixPrefixScanRegTemp[bankBase], n); - for (int threadId = 0; threadId < D_BANK_COUNT_GPU; ++threadId) - { - if ((threadId & (D_BANK_COUNT_GPU - 1)) >= n) - { - radixPrefixScanReg[bankBase + threadId] += radixPrefixScanRegTemp[bankBase + threadId]; - } - } - } - } - - for (int threadId = 0; threadId < radixStride; ++threadId) - { - if (!(threadId & D_BANK_COUNT_GPU)) - { - radixPrefixScan[threadId + 1] = radixPrefixScanReg[threadId]; - memoryTransactions += 1 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - - int scale = 0; - for (int segment = radixStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - for (int threadId = 0; threadId < radixStride; ++threadId) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - radixPrefixScanReg[threadId] += radixPrefixScan[warpSumIndex]; - radixPrefixScan[threadId + 1] = radixPrefixScanReg[threadId]; - memoryTransactions += 2 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - scale++; - } - - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int index = bashSize + threadId; - if (index < size) - { - int keyLow = sortedRadixReg[threadId]; - int dstOffset1 = radixPrefixStart[keyLow]; - int dstOffset0 = threadId - radixPrefixScan[keyLow]; - buffer[dstOffset0 + dstOffset1] = cachedItemsReg[threadId]; - } - } - - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixPrefixStartReg[threadId] += radixPrefixCountReg[threadId]; - radixPrefixStart[threadId] = radixPrefixStartReg[threadId]; - } - - bashSize += blockStride; - } - }; - -#elif (D_HOST_SORTING_ALGORITHM == 1) -//optimized Hillis-Steele prefix scan sum -//using a two bits counting sort -auto CountAndSortBlockItems = [&](int blockIndex, int blocksCount) -{ - T cachedItems[D_DEVICE_SORT_BLOCK_SIZE]; - int sortedRadix[D_DEVICE_SORT_BLOCK_SIZE]; - int radixPrefixCount[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int radixPrefixScan[2 * (D_DEVICE_SORT_BLOCK_SIZE + 1)]; - int skipDigit[D_BANK_COUNT_GPU]; - - auto ShuffleUp = [&](const int* in, int* out, int offset) - { - //for (int i = 0; i < offset; ++i) - for (int i = 0; i < D_BANK_COUNT_GPU; ++i) - { - out[i] = in[i]; - } - - for (int i = D_BANK_COUNT_GPU - offset - 1; i >= 0; --i) - { - out[i + offset] = in[i]; - } - }; - - auto ShuffleDown = [&](const int* in, int* out, int offset) - { - for (int i = 0; i < D_BANK_COUNT_GPU; ++i) - { - out[i] = in[i]; - } - - for (int i = D_BANK_COUNT_GPU - offset - 1; i >= 0; --i) - { - out[i] = in[i + offset]; - } - }; - - int size = buffer.GetCount(); - int radixStride = 1 << exponentRadix; - int blockStride = D_DEVICE_SORT_BLOCK_SIZE; - int bashSize = blocksCount * blockStride * blockIndex; - - ndEvaluateKey evaluator; - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixPrefixCount[threadId] = 0; - } - - radixPrefixScan[0] = 0; - radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1] = 0; - - for (int i = 0; i < blocksCount; ++i) - { - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int index = bashSize + threadId; - int radix = radixStride - 1; - int sortKey = radix; - if (index < size) - { - const T item(buffer[index]); - cachedItems[threadId] = item; - radix = evaluator.GetRadix(item); - sortKey = (threadId << 16) + radix; - } - radixPrefixCount[radix] ++; - sortedRadix[threadId] = sortKey; - } - -#if 1 - int keyTest = sortedRadix[0] & 0xff; - int sortedRadixReg[D_DEVICE_SORT_BLOCK_SIZE]; - for (int threadId = 0; threadId < blockStride; ++threadId) - { - sortedRadixReg[threadId] = (~(sortedRadix[threadId] ^ keyTest)) & 0xff; - } - for (int bankBase = 0; bankBase < blockStride; bankBase += D_BANK_COUNT_GPU) - { - for (int n = D_BANK_COUNT_GPU / 2; n; n = n / 2) - { - int radixPrefixScanRegTemp[D_DEVICE_SORT_BLOCK_SIZE]; - ShuffleDown(&sortedRadixReg[bankBase], &radixPrefixScanRegTemp[bankBase], n); - for (int threadId = 0; threadId < D_BANK_COUNT_GPU; ++threadId) - { - sortedRadixReg[bankBase + threadId] = sortedRadixReg[bankBase + threadId] & radixPrefixScanRegTemp[bankBase + threadId]; - } - } - } - for (int threadId = 0; threadId < D_BANK_COUNT_GPU; ++threadId) - { - skipDigit[threadId] = 0xff; - } - for (int threadId = 0; threadId < blockStride; threadId += D_BANK_COUNT_GPU) - { - skipDigit[threadId >> D_LOG_BANK_COUNT_GPU] = sortedRadixReg[threadId]; - } - int skipDigitReg[D_BANK_COUNT_GPU]; - for (int threadId = 0; threadId < D_BANK_COUNT_GPU; ++threadId) - { - skipDigitReg[threadId] = skipDigit[threadId]; - } - for (int n = D_BANK_COUNT_GPU / 2; n; n = n / 2) - { - int radixPrefixScanRegTemp[D_DEVICE_SORT_BLOCK_SIZE]; - ShuffleDown(&skipDigitReg[0], &radixPrefixScanRegTemp[0], n); - for (int threadId = 0; threadId < D_BANK_COUNT_GPU; ++threadId) - { - skipDigitReg[threadId] = skipDigitReg[threadId] & radixPrefixScanRegTemp[threadId]; - } - } -#endif - - keyTest = skipDigitReg[0]; - int memoryTransactions = 0; - for (int bit = 0; (1 << (bit * 2)) < radixStride; ++bit) - { - if ((keyTest & 0x03) != 0x03) - { - int keyReg[D_DEVICE_SORT_BLOCK_SIZE]; - for (int threadId = 0; threadId < blockStride; ++threadId) - { - keyReg[threadId] = sortedRadix[threadId]; - memoryTransactions += 1 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - - int dstLocalOffsetReg[D_DEVICE_SORT_BLOCK_SIZE]; - int radixPrefixScanReg0[D_DEVICE_SORT_BLOCK_SIZE]; - int radixPrefixScanReg1[D_DEVICE_SORT_BLOCK_SIZE]; - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int test = (keyReg[threadId] >> (bit * 2)) & 0x3; - dstLocalOffsetReg[threadId] = test; - int bit0 = (test == 0) ? 1 : 0; - int bit1 = (test == 1) ? 1 << 16 : 0; - int bit2 = (test == 2) ? 1 : 0; - int bit3 = (test == 3) ? 1 << 16 : 0; - radixPrefixScanReg0[threadId] = bit0 + bit1; - radixPrefixScanReg1[threadId] = bit2 + bit3; - } - - for (int bankBase = 0; bankBase < blockStride; bankBase += D_BANK_COUNT_GPU) - { - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp0[D_DEVICE_SORT_BLOCK_SIZE]; - int radixPrefixScanRegTemp1[D_DEVICE_SORT_BLOCK_SIZE]; - ShuffleUp(&radixPrefixScanReg0[bankBase], &radixPrefixScanRegTemp0[bankBase], n); - ShuffleUp(&radixPrefixScanReg1[bankBase], &radixPrefixScanRegTemp1[bankBase], n); - for (int threadId = 0; threadId < D_BANK_COUNT_GPU; ++threadId) - { - if ((threadId & (D_BANK_COUNT_GPU - 1)) >= n) - { - radixPrefixScanReg0[bankBase + threadId] += radixPrefixScanRegTemp0[bankBase + threadId]; - radixPrefixScanReg1[bankBase + threadId] += radixPrefixScanRegTemp1[bankBase + threadId]; - } - } - } - } - - for (int threadId = 0; threadId < blockStride; ++threadId) - { - if (!(threadId & D_BANK_COUNT_GPU)) - { - radixPrefixScan[threadId + 1] = radixPrefixScanReg0[threadId]; - radixPrefixScan[threadId + 1 + D_DEVICE_SORT_BLOCK_SIZE + 1] = radixPrefixScanReg1[threadId]; - memoryTransactions += 2 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - - int scale = 0; - for (int segment = blockStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - - radixPrefixScanReg0[threadId] += radixPrefixScan[warpSumIndex - 1 + 1]; - radixPrefixScan[threadId + 1] = radixPrefixScanReg0[threadId]; - - radixPrefixScanReg1[threadId] += radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1 + warpSumIndex - 1 + 1]; - radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1 + threadId + 1] = radixPrefixScanReg1[threadId]; - - memoryTransactions += 4 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - scale++; - } - - int sum0 = radixPrefixScan[1 * (D_DEVICE_SORT_BLOCK_SIZE + 1) - 1]; - int sum1 = radixPrefixScan[2 * (D_DEVICE_SORT_BLOCK_SIZE + 1) - 1]; - int base0 = 0; - int base1 = sum0 & 0xffff; - int base2 = base1 + (sum0 >> 16); - int base3 = base2 + (sum1 & 0xffff); - - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int key0 = radixPrefixScan[threadId]; - int key1 = radixPrefixScan[threadId + D_DEVICE_SORT_BLOCK_SIZE + 1]; - int shift = dstLocalOffsetReg[threadId]; - - int dstIndex = 0; - dstIndex += (shift == 1) ? base1 + (key0 >> 16) : 0; - dstIndex += (shift == 3) ? base3 + (key1 >> 16) : 0; - dstIndex += (shift == 0) ? base0 + (key0 & 0xffff) : 0; - dstIndex += (shift == 2) ? base2 + (key1 & 0xffff) : 0; - - ndAssert(dstIndex >= 0); - ndAssert(dstIndex < blockStride); - sortedRadix[dstIndex] = keyReg[threadId]; - } - } - keyTest >>= 2; - } - - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int index = bashSize + threadId; - if (index < size) - { - int keyIndex = sortedRadix[threadId] >> 16; - auxiliaryBuffer[index] = cachedItems[keyIndex]; - } - } - - bashSize += blockStride; - } - - for (int threadId = 0; threadId < radixStride; ++threadId) - { - int index = threadId + radixStride * blockIndex; - scansBuffer[index] = radixPrefixCount[threadId]; - } -}; - -auto MergeBuckects = [&](int blockIdx, int blocksCount, int computeUnits) -{ - int radixPrefixCount[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int radixPrefixStart[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int radixPrefixScan[D_DEVICE_SORT_MAX_RADIX_SIZE + 1]; - - auto ShuffleUp = [&](const int* in, int* out, int offset) - { - //for (int i = 0; i < offset; ++i) - for (int i = 0; i < D_BANK_COUNT_GPU; ++i) - { - out[i] = in[i]; - } - - for (int i = D_BANK_COUNT_GPU - offset - 1; i >= 0; --i) - { - out[i + offset] = in[i]; - } - }; - - int size = buffer.GetCount(); - int radixStride = (1 << exponentRadix); - int blockStride = D_DEVICE_SORT_BLOCK_SIZE; - int radixBase = blockIdx * radixStride; - int bashSize = blocksCount * blockStride * blockIdx; - int radixPrefixOffset = computeUnits * radixStride; - - ndEvaluateKey evaluator; - int radixPrefixStartReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - for (int threadId = 0; threadId < radixStride; ++threadId) - { - int a = scansBuffer[radixBase + threadId]; - int b = scansBuffer[radixPrefixOffset + threadId]; - radixPrefixStartReg[threadId] = a + b; - radixPrefixStart[threadId] = radixPrefixStartReg[threadId]; - } - - radixPrefixScan[0] = 0; - for (int i = 0; i < blocksCount; ++i) - { - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixPrefixCount[threadId] = 0; - } - - T cachedItemsReg[D_DEVICE_SORT_BLOCK_SIZE]; - int sortedRadixReg[D_DEVICE_SORT_BLOCK_SIZE]; - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int index = bashSize + threadId; - int radix = radixStride - 1; - sortedRadixReg[threadId] = radix; - if (index < size) - { - const T item(auxiliaryBuffer[index]); - cachedItemsReg[threadId] = item; - radix = evaluator.GetRadix(item); - sortedRadixReg[threadId] = radix; - } - radixPrefixCount[radix] ++; - } - - int memoryTransactions = 0; - - int radixPrefixScanReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - int radixPrefixCountReg[D_DEVICE_SORT_MAX_RADIX_SIZE]; - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixPrefixCountReg[threadId] = radixPrefixCount[threadId]; - radixPrefixScanReg[threadId] = radixPrefixCountReg[threadId]; - memoryTransactions += 1 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - - for (int bankBase = 0; bankBase < radixStride; bankBase += D_BANK_COUNT_GPU) - { - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp[D_DEVICE_SORT_MAX_RADIX_SIZE]; - ShuffleUp(&radixPrefixScanReg[bankBase], &radixPrefixScanRegTemp[bankBase], n); - for (int threadId = 0; threadId < D_BANK_COUNT_GPU; ++threadId) - { - if ((threadId & (D_BANK_COUNT_GPU - 1)) >= n) - { - radixPrefixScanReg[bankBase + threadId] += radixPrefixScanRegTemp[bankBase + threadId]; - } - } - } - } - - for (int threadId = 0; threadId < radixStride; ++threadId) - { - if (!(threadId & D_BANK_COUNT_GPU)) - { - radixPrefixScan[threadId + 1] = radixPrefixScanReg[threadId]; - memoryTransactions += 1 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - - int scale = 0; - for (int segment = radixStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - for (int threadId = 0; threadId < radixStride; ++threadId) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - radixPrefixScanReg[threadId] += radixPrefixScan[warpSumIndex]; - radixPrefixScan[threadId + 1] = radixPrefixScanReg[threadId]; - memoryTransactions += 2 * ((threadId & (D_BANK_COUNT_GPU - 1)) == 1); - } - } - scale++; - } - - for (int threadId = 0; threadId < blockStride; ++threadId) - { - int index = bashSize + threadId; - if (index < size) - { - int keyLow = sortedRadixReg[threadId]; - int dstOffset1 = radixPrefixStart[keyLow]; - int dstOffset0 = threadId - radixPrefixScan[keyLow]; - buffer[dstOffset0 + dstOffset1] = cachedItemsReg[threadId]; - } - } - - for (int threadId = 0; threadId < radixStride; ++threadId) - { - radixPrefixStartReg[threadId] += radixPrefixCountReg[threadId]; - radixPrefixStart[threadId] = radixPrefixStartReg[threadId]; - } - - bashSize += blockStride; - } -}; - -#else - #error implement new local sort and merge algorthm? -#endif - - ndAssert(buffer.GetCount() == auxiliaryBuffer.GetCount()); - ndAssert((1 << exponentRadix) <= D_DEVICE_SORT_MAX_RADIX_SIZE); - - //int deviceComputeUnits = 20; - int deviceComputeUnits = 1; - int itemCount = buffer.GetCount(); - int computeUnitsBashCount = (itemCount + D_DEVICE_SORT_BLOCK_SIZE - 1) / D_DEVICE_SORT_BLOCK_SIZE; - int bashCount = (computeUnitsBashCount + deviceComputeUnits - 1) / deviceComputeUnits; - int computeUnits = (itemCount + bashCount * D_DEVICE_SORT_BLOCK_SIZE - 1) / (bashCount * D_DEVICE_SORT_BLOCK_SIZE); - ndAssert(computeUnits <= deviceComputeUnits); - - for (int block = 0; block < computeUnits; ++block) - { - CountAndSortBlockItems(block, bashCount); - } - - for (int block = 0; block < 1; ++block) - { - AddPrefix(block, 1 << exponentRadix, computeUnits); - } - - for (int block = 0; block < computeUnits; ++block) - { - MergeBuckects(block, bashCount, computeUnits); - } -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaIntrinsics.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaIntrinsics.h deleted file mode 100644 index eb8f64fa9e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaIntrinsics.h +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_INTRINSICS_H__ -#define __ND_CUDA_INTRINSICS_H__ - -#include -#include - -#define D_GRANULARITY (1024 * 64) -#define D_LOG_BANK_COUNT_GPU 5 -#define D_BANK_COUNT_GPU (1< -inline T __device__ __host__ cuAbs(T A) -{ - return fabsf(A); -} - -template -inline T __device__ __host__ cuFloor(T A) -{ - return floorf(A); -} - -template -inline T __device__ __host__ cuMax(T A, T B) -{ - return fmaxf(A, B); -} - -template -inline T __device__ __host__ cuMin(T A, T B) -{ - return fminf(A, B); -} - -template -inline T __device__ __host__ cuSelect(bool test, T A, T B) -{ - return test ? A : B; -} - -template -inline void __device__ __host__ cuSwap(T& A, T& B) -{ - T tmpA(A); - T tmpB(B); - A = tmpB; - B = tmpA; -} - -template -class cuBankFreeArray -{ - public: - __device__ cuBankFreeArray() - { - } - - __device__ T& operator[] (int address) - { - int low = address & (D_BANK_COUNT_GPU - 1); - int high = address >> D_LOG_BANK_COUNT_GPU; - int dst = high * (D_BANK_COUNT_GPU + 1) + low; - return m_array[dst]; - } - - T m_array[((size + D_BANK_COUNT_GPU - 1) >> D_LOG_BANK_COUNT_GPU) * (D_BANK_COUNT_GPU + 1)]; -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaMatrix3x3.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaMatrix3x3.h deleted file mode 100644 index 9db05f6a8e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaMatrix3x3.h +++ /dev/null @@ -1,123 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_MATRIX3x3_H__ -#define __ND_CUDA_MATRIX3x3_H__ - -#include "ndCudaVector.h" -#include "ndCudaIntrinsics.h" - -class ndCudaMatrix3x3 -{ - public: - inline __device__ __host__ ndCudaMatrix3x3() - { - } - - inline __device__ __host__ ndCudaMatrix3x3(const ndCudaMatrix3x3& src) - :m_front(src.m_front) - ,m_up(src.m_up) - ,m_right(src.m_right) - { - } - - inline __device__ __host__ ndCudaMatrix3x3(const ndCudaVector& front, const ndCudaVector& up, const ndCudaVector& right) - :m_front(front) - ,m_up(up) - ,m_right(right) - { - } - - inline ndCudaMatrix3x3 __device__ __host__ operator* (const ndCudaMatrix3x3& A) const - { - return ndCudaMatrix3x3(A.RotateVector(m_front), A.RotateVector(m_up), A.RotateVector(m_right)); - } - - inline ndCudaVector __device__ __host__ UnrotateVector(const ndCudaVector &v) const - { - return ndCudaVector((m_front * v).AddHorizontal(), (m_up * v).AddHorizontal(), (m_right * v).AddHorizontal(), 0.0f); - } - - inline ndCudaVector __device__ __host__ RotateVector(const ndCudaVector& v) const - { - return m_front.Scale(v.x) + m_up.Scale(v.y) + m_right.Scale(v.z); - } - - inline ndCudaVector __device__ __host__ SolveByGaussianElimination(const ndCudaVector &v) const - { - ndCudaMatrix3x3 tmp(*this); - ndCudaVector ret(v); - for (int i = 0; i < 3; ++i) - { - float pivot = cuAbs(tmp.m_data[i].GetElement(i)); - if (pivot < float(0.01f)) - { - int permute = i; - for (int j = i + 1; j < 3; ++j) - { - float pivot1 = cuAbs(tmp.m_data[j].GetElement(i)); - if (pivot1 > pivot) - { - permute = j; - pivot = pivot1; - } - } - - if (permute != i) - { - float a0 = ret.GetElement(i); - ret.SetElement(i, ret.GetElement(permute)); - ret.SetElement(permute, a0); - cuSwap(tmp.m_data[i], tmp.m_data[permute]); - } - } - - for (int j = i + 1; j < 3; ++j) - { - const ndCudaVector scale(tmp.m_data[j].GetElement(i) / tmp.m_data[i].GetElement(i)); - tmp.m_data[j] = tmp.m_data[j] - tmp.m_data[i] * scale; - ret.SetElement(j, ret.GetElement(j) - ret.GetElement(i) * scale.x); - tmp.m_data[j].SetElement(i, 0.0f); - } - } - - for (int i = 2; i >= 0; --i) - { - const ndCudaVector pivot(tmp.m_data[i] * ret); - ret.SetElement(i, (ret.GetElement(i) - pivot.AddHorizontal() + tmp.m_data[i].GetElement(i) * ret.GetElement(i)) / tmp.m_data[i].GetElement(i)); - } - - return ret; - } - - union - { - struct - { - ndCudaVector m_front; - ndCudaVector m_up; - ndCudaVector m_right; - }; - ndCudaVector m_data[3]; - }; -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaPrefixScan.cu b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaPrefixScan.cu deleted file mode 100644 index e99e1ebd77..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaPrefixScan.cu +++ /dev/null @@ -1,325 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -#include "ndCudaContext.h" -#include "ndCudaSceneInfo.h" -#include "ndCudaIntrinsics.h" - -#include "ndCudaSort.cuh" -#include "ndCudaPrefixScan.cuh" - - -#if 0 -#define D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE 1024 - -__global__ void ndCudaHillisSteeleSanityCheck(ndCudaSceneInfo& info) -{ - const unsigned index = threadIdx.x + blockIdx.x * blockDim.x; - const unsigned* histogram = info.m_histogram.m_array; - - if ((index >= 1) && (index < info.m_histogram.m_size)) - { - unsigned item0 = histogram[index - 1]; - unsigned item1 = histogram[index - 0]; - if (info.m_frameIsValid && (item0 > item1)) - { - //printf("block(%d) id:%d (%d %d)\n", blockIdx.x, threadIdx.x, item0, item1); - cuInvalidateFrame(info, __FUNCTION__, __LINE__); - } - } -} - -__global__ void ndCudaHillisSteeleInternal(ndCudaSceneInfo& info) -{ - __shared__ unsigned cacheBuffer[D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE / 2 + D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE + 1]; - - const unsigned blockId = blockIdx.x; - const unsigned threadId0 = threadIdx.x; - const unsigned threadId1 = D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE / 2 + threadId0; - cacheBuffer[threadId0] = 0; - __syncthreads(); - - cacheBuffer[threadId1] = 0; - unsigned* histogram = info.m_histogram.m_array; - const unsigned index = threadId0 + blockDim.x * blockId; - if (index < info.m_histogram.m_size) - { - cacheBuffer[threadId1] = histogram[index]; - } - __syncthreads(); - - for (int i = 1; i < D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE; i = i << 1) - { - int sum = cacheBuffer[threadId1] + cacheBuffer[threadId1 - i]; - __syncthreads(); - cacheBuffer[threadId1] = sum; - __syncthreads(); - } - - if (index < info.m_histogram.m_size) - { - histogram[index] = cacheBuffer[threadId1]; - } -} - -__global__ void ndCudaHillisSteeleAddBlocksInternal(ndCudaSceneInfo& info) -{ - const unsigned threadId = threadIdx.x; - const unsigned itemsCount = info.m_histogram.m_size; - const unsigned superBlockCount = (itemsCount + D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE - 1) / D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE; - - unsigned* histogram = info.m_histogram.m_array; - - unsigned offset = D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE; - for (int i = 1; i < superBlockCount; i++) - { - const unsigned value = histogram[offset - 1]; - histogram[offset + threadId] += value; - offset += D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE; - __syncthreads(); - } -} - - - -/* -__global__ void ndCudaHillisSteelePaddBufferInternal(ndCudaSceneInfo& info) -{ - const unsigned blockId = blockIdx.x; - const unsigned threadId = threadIdx.x; - const unsigned itemsCount = info.m_histogram.m_size; - const unsigned blockStart = blockDim.x * ((itemsCount + blockDim.x - 1) / blockDim.x); - - const unsigned blockOffset = blockId * blockDim.x; - unsigned* histogram = info.m_histogram.m_array; - - if (blockOffset >= blockStart) - { - histogram[blockOffset + threadId] = 0; - } -} - -__global__ void ndCudaHillisSteelePrefixScanAddBlocksInternal(ndCudaSceneInfo& info, int bit) -{ - const unsigned blockId = blockIdx.x; - const unsigned itemsCount = info.m_histogram.m_size; - const unsigned prefixScanSuperBlockAlign = D_PREFIX_SCAN_PASSES * blockDim.x; - const unsigned alignedItemsCount = prefixScanSuperBlockAlign * ((itemsCount + prefixScanSuperBlockAlign - 1) / prefixScanSuperBlockAlign); - const unsigned blocks = ((alignedItemsCount + blockDim.x - 1) / blockDim.x); - if (blockId < blocks) - { - const unsigned power = 1 << (bit + 1); - const unsigned blockFrac = blockId & (power - 1); - if (blockFrac >= (power >> 1)) - { - const unsigned threadId = threadIdx.x; - const unsigned dstIndex = blockDim.x * blockId; - const unsigned srcIndex = blockDim.x * (blockId - blockFrac + (power >> 1)) - 1; - - unsigned* histogram = info.m_histogram.m_array; - const unsigned value = histogram[srcIndex]; - histogram[dstIndex + threadId] += value; - } - } -} - -__global__ void ndCudaHillisSteelePrefixScanAddBlocksFinalInternal(ndCudaSceneInfo& info) -{ - const unsigned blockId = blockIdx.x; - const unsigned itemsCount = info.m_histogram.m_size; - const unsigned prefixScanSuperBlockAlign = D_PREFIX_SCAN_PASSES * blockDim.x; - const unsigned alignedItemsCount = prefixScanSuperBlockAlign * ((itemsCount + prefixScanSuperBlockAlign - 1) / prefixScanSuperBlockAlign); - const unsigned blocks = ((alignedItemsCount + blockDim.x - 1) / blockDim.x); - if (blockId < blocks) - { - const unsigned power = 1 << D_PREFIX_SCAN_PASSES_BITS; - const unsigned blockFrac = blockId & (power - 1); - if (blockFrac >= (power >> 1)) - { - const unsigned threadId = threadIdx.x; - const unsigned dstIndex = blockDim.x * blockId; - const unsigned srcIndex = blockDim.x * (blockId - blockFrac + (power >> 1)) - 1; - - unsigned* histogram = info.m_histogram.m_array; - const unsigned value = histogram[srcIndex]; - histogram[dstIndex + threadId] += value; - - if (blockFrac == (power - 1)) - { - __syncthreads(); - if (threadId == (blockDim.x - 1)) - { - const unsigned dstBlock = blockId / D_PREFIX_SCAN_PASSES; - const unsigned sum = histogram[blockId * blockDim.x + threadId]; - histogram[alignedItemsCount + dstBlock] = sum; - } - } - } - } -} - -__global__ void ndCudaHillisSteeleAddSupeBlocksInternal(ndCudaSceneInfo& info) -{ - const unsigned blockId = blockIdx.x; - const unsigned threadId = threadIdx.x; - const unsigned itemsCount = info.m_histogram.m_size; - const unsigned prefixScanSuperBlockAlign = D_PREFIX_SCAN_PASSES * blockDim.x; - const unsigned superBlockCount = (itemsCount + prefixScanSuperBlockAlign - 1) / prefixScanSuperBlockAlign; - - unsigned* histogram = info.m_histogram.m_array; - unsigned offset = blockId * blockDim.x + prefixScanSuperBlockAlign; - const unsigned superBlockOffset = superBlockCount * prefixScanSuperBlockAlign; - - unsigned value = histogram[superBlockOffset]; - for (int i = 1; i < superBlockCount; i++) - { - histogram[offset + threadId] += value; - value += histogram[superBlockOffset + i]; - offset += prefixScanSuperBlockAlign; - } -} - -__global__ void ndCudaHillisSteelePrefixScan(ndCudaSceneInfo& info) -{ - if (info.m_frameIsValid) - { - const unsigned threads = info.m_histogram.m_size; - //const unsigned prefixScanSuperBlockAlign = D_PREFIX_SCAN_PASSES * blockSize; - //const unsigned superBlocks = (threads + prefixScanSuperBlockAlign - 1) / prefixScanSuperBlockAlign; - //const unsigned histogramBlocks = D_PREFIX_SCAN_PASSES * superBlocks; - const unsigned blocks = (threads + D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE - 1) / D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE; - if (blocks * D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE > info.m_histogram.m_capacity) - { - cuInvalidateFrame(info, __FUNCTION__, __LINE__); - info.m_histogram.m_size = blocks * D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE; - return; - } - - ndCudaHillisSteeleInternal << > > (info); - //ndCudaHillisSteelePaddBufferInternal << > > (info); - //for (int i = 0; i < (D_PREFIX_SCAN_PASSES_BITS - 1); i++) - //{ - // ndCudaHillisSteelePrefixScanAddBlocksInternal << > > (info, i); - //} - //ndCudaHillisSteelePrefixScanAddBlocksFinalInternal << > > (info); - //ndCudaHillisSteeleAddSupeBlocksInternal << > > (info); - - if (blocks > 1) - { - ndCudaHillisSteeleInternal << <1, D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE, 0 >> > (info); - } - -#ifdef _DEBUG - ndCudaHillisSteeleSanityCheck << > > (info); -#endif - } -} -*/ - - - -__global__ void ndCudaHillisSteelePrefixScan(ndCudaSceneInfo& info) -{ - if (info.m_frameIsValid) - { - const unsigned threads = info.m_histogram.m_size; - const unsigned blocks = (threads + D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE - 1) / D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE; - if (blocks * D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE > info.m_histogram.m_capacity) - { - cuInvalidateFrame(info, __FUNCTION__, __LINE__); - info.m_histogram.m_size = blocks * D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE; - return; - } - - ndCudaHillisSteeleInternal << > > (info); - if (blocks > 1) - { - ndCudaHillisSteeleAddBlocksInternal << <1, D_HILL_STEELE_PREFIX_SCAN_BLOCK_SIZE, 0 >> > (info); - } - - #ifdef _DEBUG - ndCudaHillisSteeleSanityCheck << > > (info); - #endif - } -} - -#endif - - -//optimized single block Hillis-Steele prefix scan sum -__global__ void ndCudaAddPrefix(const ndKernelParams params, ndAssessor scanBuffer) -{ - __shared__ int localPrefixScan[D_DEVICE_SORT_MAX_RADIX_SIZE + 1]; - - int threadId = threadIdx.x; - int blockStride = blockDim.x; - - int sum = 0; - int offset = 0; - if (threadId == 0) - { - localPrefixScan[0] = 0; - } - for (int i = 0; i < params.m_kernelCount; ++i) - { - int count = scanBuffer[offset + threadId]; - scanBuffer[offset + threadId] = sum; - sum += count; - offset += blockStride; - } - - int lane = threadId & (D_BANK_COUNT_GPU - 1); - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp = __shfl_up_sync(0xffffffff, sum, n, D_BANK_COUNT_GPU); - if (lane >= n) - { - sum += radixPrefixScanRegTemp; - } - } - - if (!(threadId & D_BANK_COUNT_GPU)) - { - localPrefixScan[threadId + 1] = sum; - } - - int scale = 0; - __syncthreads(); - for (int segment = blockStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - sum += localPrefixScan[warpSumIndex]; - localPrefixScan[threadId + 1] = sum; - } - scale++; - __syncthreads(); - } - scanBuffer[offset + threadId] = localPrefixScan[threadId]; -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaPrefixScan.cuh b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaPrefixScan.cuh deleted file mode 100644 index 5081481866..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaPrefixScan.cuh +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __CUDA_PREFIX_SCAN_H__ -#define __CUDA_PREFIX_SCAN_H__ - -#include - -#include "ndCudaDevice.h" -#include "ndCudaContext.h" -#include "ndCudaIntrinsics.h" -#include "ndCudaDeviceBuffer.h" - -#define D_DEVICE_SORT_BLOCK_SIZE (1<<8) -#define D_DEVICE_SORT_MAX_RADIX_SIZE (1<<8) - -#if D_DEVICE_SORT_MAX_RADIX_SIZE > D_DEVICE_SORT_BLOCK_SIZE - #error counting sort diget larger that block -#endif - -__global__ void ndCudaAddPrefix(const ndKernelParams params, ndAssessor scanBuffer); - -#if 0 -class ndCudaSceneInfo; - -__global__ void ndCudaHillisSteelePrefixScan(ndCudaSceneInfo& info); -#endif - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaQuat.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaQuat.h deleted file mode 100644 index 4b8992152a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaQuat.h +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_QUAT_H__ -#define __ND_CUDA_QUAT_H__ - -#include "ndCudaVector.h" -#include "ndCudaMatrix3x3.h" - -class ndCudaQuat: public ndCudaVector -{ - public: - inline __device__ __host__ ndCudaQuat() - :ndCudaVector(0.0f, 0.0f, 0.0f, 1.0f) - { - } - - inline __device__ __host__ ndCudaQuat(float x, float y, float z, float w) - :ndCudaVector(x, y, z, w) - { - } - - inline __device__ __host__ ndCudaQuat(const ndCudaQuat& src) - :ndCudaVector(src) - { - } - - inline __device__ __host__ ndCudaQuat(const ndCudaVector& src) - :ndCudaVector(src) - { - } - - inline __device__ __host__ ndCudaQuat(const ndCudaVector& unitAxis, float angle) - :ndCudaVector() - { - angle = angle * 0.5f; - w = cosf(angle); - const float sinAng = sinf(angle); - x = unitAxis.x * sinAng; - y = unitAxis.y * sinAng; - z = unitAxis.z * sinAng; - } - - //inline ndCudaQuat(const ndVector& src) - // :ndCudaVector(src) - //{ - //} - - inline ndCudaMatrix3x3 __device__ __host__ GetMatrix3x3 () const - { - //const ndCudaQuat quat0 = *this; - const ndCudaQuat quat1 (Scale (2.0)); - - const float x2 = x * quat1.x; - const float y2 = y * quat1.y; - const float z2 = z * quat1.z; - - const float xy = x * quat1.y; - const float xz = x * quat1.z; - const float xw = x * quat1.w; - const float yz = y * quat1.z; - const float yw = y * quat1.w; - const float zw = z * quat1.w; - - const ndCudaVector front(1.0f - y2 - z2, xy + zw, xz - yw, 0.0f); - const ndCudaVector up (xy - zw, 1.0f - x2 - z2, yz + xw, 0.0f); - const ndCudaVector right(xz + yw, yz - xw, 1.0f - x2 - y2, 0.0f); - return ndCudaMatrix3x3(front, up, right); - } - - inline ndCudaQuat __device__ __host__ Normalize() const - { - return ndCudaVector::Normalize(); - } - - inline ndCudaQuat __device__ __host__ operator* (const ndCudaQuat &q) const - { - const ndCudaVector x_( q.w, q.z, -q.y, -q.x); - const ndCudaVector y_(-q.z, q.w, q.x, -q.y); - const ndCudaVector z_( q.y, -q.x, q.w, -q.z); - const ndCudaVector w_(q); - return x_ * ndCudaVector(x) + y_ * ndCudaVector(y) + z_ * ndCudaVector(z) + w_ * ndCudaVector(w); - } -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSceneInfo.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSceneInfo.h deleted file mode 100644 index a0ab27991f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSceneInfo.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_SCENE_INFO_H__ -#define __ND_CUDA_SCENE_INFO_H__ - -#include -#include -#include -#include "ndCudaTypes.h" - - -#if 0 -class ndCudaSceneInfo -{ - public: - ndCudaSceneInfo() - :m_worldBox() - ,m_histogram() - ,m_bodyArray() - ,m_sceneGraph() - ,m_bodyAabbCell() - ,m_bodyAabbCellScratch() - ,m_transformBuffer0() - ,m_transformBuffer1() - ,m_frameCount(0) - ,m_frameIsValid(0) - ,m_startFrameTime(0) - ,m_frameTimeInNanosecunds(0) - { - } - - ndCudaBoundingBox m_worldBox; - ndCudaBuffer m_histogram; - ndCudaBuffer m_bodyArray; - ndCudaBuffer m_sceneGraph; - ndCudaBuffer m_bodyAabbCell; - ndCudaBuffer m_bodyAabbCellScratch; - ndCudaBuffer m_transformBuffer0; - ndCudaBuffer m_transformBuffer1; - - unsigned m_frameCount; - unsigned m_frameIsValid; - long long m_startFrameTime; - long long m_frameTimeInNanosecunds; -}; - -inline void __device__ cuInvalidateFrame(ndCudaSceneInfo& info, const char* functionName, unsigned lineNumber) -{ - m_device->SyncDevice(); - info.m_frameIsValid = 0; - printf("skipping frame %d function %s line %d\n", info.m_frameCount, functionName, lineNumber); -} -#endif - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSort.cuh b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSort.cuh deleted file mode 100644 index a6590911c0..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSort.cuh +++ /dev/null @@ -1,809 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __CUDA_SORT_H__ -#define __CUDA_SORT_H__ - -#include -#include -#include - -#include "ndCudaDevice.h" -#include "ndCudaContext.h" -#include "ndCudaIntrinsics.h" -#include "ndCudaDeviceBuffer.h" -#include "ndCudaPrefixScan.cuh" - - -#define D_GPU_SORTING_ALGORITHM 1 - -template -void ndCountingSort(ndCudaContextImplement* const context, ndCudaDeviceBuffer& buffer, ndCudaDeviceBuffer& auxiliaryBuffer, ndEvaluateRadix evaluateRadix); - -// ***************************************************************** -// -// support function implementation -// -// ***************************************************************** -#if (D_GPU_SORTING_ALGORITHM == 0) - -//optimized Hillis-Steele prefix scan sum -//using a simple bitonic sort with two ways bank conflict -template -__global__ void CountAndSortBlockItems(const ndKernelParams params, const ndAssessor input, ndAssessor output, ndAssessor scanBuffer, int radixStride, SortKeyPredicate getRadix) -{ - __shared__ T cachedItems[D_DEVICE_SORT_BLOCK_SIZE]; - __shared__ int sortedRadix[D_DEVICE_SORT_BLOCK_SIZE]; - __shared__ int radixCountBuffer[D_DEVICE_SORT_MAX_RADIX_SIZE]; - - int threadId = threadIdx.x; - int blockIndex = blockIdx.x; - int blockStride = blockDim.x; - int bashSize = params.m_blocksPerKernel * params.m_workGroupSize * blockIndex; - - if (threadId < radixStride) - { - radixCountBuffer[threadId] = 0; - } - __syncthreads(); - - for (int i = 0; i < params.m_blocksPerKernel; ++i) - { - int index = bashSize + threadId; - int sortedRadixReg = (radixStride << 16); - if (index < input.m_size) - { - const T item(input[index]); - cachedItems[threadId] = item; - int radix = getRadix(item); - atomicAdd(&radixCountBuffer[radix], 1); - sortedRadixReg = (radix << 16) + threadId; - } - - sortedRadix[threadId] = sortedRadixReg; - __syncthreads(); - - for (int k = 1; k < blockStride; k = k << 1) - { - for (int j = k; j > 0; j = j >> 1) - { - int highMask = -j; - int lowMask = ~highMask; - if (threadId < blockStride / 2) - { - int lowIndex = threadId & lowMask; - int highIndex = (threadId & highMask) * 2; - - int id0 = highIndex + lowIndex; - int id1 = highIndex + lowIndex + j; - int oddEven = highIndex & k * 2; - - int a = sortedRadix[id0]; - int b = sortedRadix[id1]; - - int test = a < b; - int a1 = test ? a : b; - int b1 = test ? b : a; - - int a2 = oddEven ? b1 : a1; - int b2 = oddEven ? a1 : b1; - - sortedRadix[id0] = a2; - sortedRadix[id1] = b2; - } - __syncthreads(); - } - } - - if (index < input.m_size) - { - int keyIndex = sortedRadix[threadId] & 0xffff; - output[index] = cachedItems[keyIndex]; - } - - bashSize += blockStride; - } - - __syncthreads(); - if (threadId < radixStride) - { - int index = threadId + radixStride * blockIndex; - scanBuffer[index] = radixCountBuffer[threadId]; - } -} - -template -__global__ void ndCudaMergeBuckets(const ndKernelParams params, const ndAssessor input, ndAssessor output, const ndAssessor scanBuffer, int radixStride, SortKeyPredicate getRadix) -{ - __shared__ int radixPrefixCount[D_DEVICE_SORT_MAX_RADIX_SIZE]; - __shared__ int radixPrefixStart[D_DEVICE_SORT_MAX_RADIX_SIZE]; - __shared__ int radixPrefixScan[D_DEVICE_SORT_MAX_RADIX_SIZE + 1]; - - int threadId = threadIdx.x; - int blockStride = blockDim.x; - int blockIndex = blockIdx.x; - int radixBase = blockIndex * radixStride; - int radixPrefixOffset = params.m_kernelCount * radixStride; - int bashSize = params.m_blocksPerKernel * params.m_workGroupSize * blockIndex; - - int radixPrefixStartReg; - if (threadId < radixStride) - { - int a = scanBuffer[radixBase + threadId]; - int b = scanBuffer[radixPrefixOffset + threadId]; - radixPrefixStartReg = a + b; - radixPrefixStart[threadId] = radixPrefixStartReg; - - if (threadId == 0) - { - radixPrefixScan[0] = 0; - } - } - - for (int i = 0; i < params.m_blocksPerKernel; ++i) - { - if (threadId < radixStride) - { - radixPrefixCount[threadId] = 0; - } - __syncthreads(); - - T cachedItemsReg; - int sortedRadixReg; - int index = bashSize + threadId; - int radix = radixStride - 1; - sortedRadixReg = radix; - if (index < input.m_size) - { - const T item(input[index]); - cachedItemsReg = item; - radix = getRadix(item); - sortedRadixReg = radix; - } - atomicAdd(&radixPrefixCount[radix], 1); - __syncthreads(); - - int radixPrefixScanReg; - int radixPrefixCountReg; - if (threadId < radixStride) - { - radixPrefixCountReg = radixPrefixCount[threadId]; - radixPrefixScanReg = radixPrefixCountReg; - } - - int lane = threadId & (D_BANK_COUNT_GPU - 1); - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp = __shfl_up_sync(0xffffffff, radixPrefixScanReg, n, D_BANK_COUNT_GPU); - if (lane >= n) - { - radixPrefixScanReg += radixPrefixScanRegTemp; - } - } - - if (threadId < radixStride) - { - if (!(threadId & D_BANK_COUNT_GPU)) - { - radixPrefixScan[threadId + 1] = radixPrefixScanReg; - } - } - - int scale = 0; - __syncthreads(); - for (int segment = radixStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - if (threadId < radixStride) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - radixPrefixScanReg += radixPrefixScan[warpSumIndex]; - radixPrefixScan[threadId + 1] = radixPrefixScanReg; - } - } - scale++; - __syncthreads(); - } - - if (index < input.m_size) - { - int keyLow = sortedRadixReg; - int dstOffset1 = radixPrefixStart[keyLow]; - int dstOffset0 = threadId - radixPrefixScan[keyLow]; - output[dstOffset0 + dstOffset1] = cachedItemsReg; - } - - __syncthreads(); - if (threadId < radixStride) - { - radixPrefixStartReg += radixPrefixCountReg; - radixPrefixStart[threadId] = radixPrefixStartReg; - } - - bashSize += blockStride; - } -} - -#elif (D_GPU_SORTING_ALGORITHM == 1) -//optimized Hillis-Steele prefix scan sum -//using a two bits counting sort, in theory, not bank conflits -template -__global__ void CountAndSortBlockItems(const ndKernelParams params, const ndAssessor input, ndAssessor output, ndAssessor scanBuffer, int radixStride, SortKeyPredicate getRadix) -{ - __shared__ T cachedItems[D_DEVICE_SORT_BLOCK_SIZE]; - __shared__ int sortedRadix[D_DEVICE_SORT_BLOCK_SIZE]; - __shared__ int radixPrefixCount[D_DEVICE_SORT_MAX_RADIX_SIZE]; - __shared__ int radixPrefixScan[2 * (D_DEVICE_SORT_BLOCK_SIZE + 1)]; - - int threadId = threadIdx.x; - int blockStride = blockDim.x; - int blockIndex = blockIdx.x; - int bashSize = params.m_blocksPerKernel * params.m_workGroupSize * blockIndex; - - if (threadId < radixStride) - { - radixPrefixCount[threadId] = 0; - if (threadId == 0) - { - radixPrefixScan[0] = 0; - radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1] = 0; - } - } - __syncthreads(); - - int lane = threadId & (D_BANK_COUNT_GPU - 1); - for (int i = 0; i < params.m_blocksPerKernel; ++i) - { - int index = bashSize + threadId; - int radix = radixStride - 1; - int sortKey = radix; - if (index < input.m_size) - { - const T item(input[index]); - cachedItems[threadId] = item; - radix = getRadix(item); - atomicAdd(&radixPrefixCount[radix], 1); - sortKey = (threadId << 16) + radix; - } - sortedRadix[threadId] = sortKey; - __syncthreads(); - - for (int bit = 0; (1 << (bit * 2)) < radixStride; ++bit) - { - int keyReg = sortedRadix[threadId]; - int test = (keyReg >> (bit * 2)) & 0x3; - int dstLocalOffsetReg = test; - int bit0 = (test == 0) ? 1 : 0; - int bit1 = (test == 1) ? 1 << 16 : 0; - int bit2 = (test == 2) ? 1 : 0; - int bit3 = (test == 3) ? 1 << 16 : 0; - int radixPrefixScanReg0 = bit0 + bit1; - int radixPrefixScanReg1 = bit2 + bit3; - - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp0 = __shfl_up_sync(0xffffffff, radixPrefixScanReg0, n, D_BANK_COUNT_GPU); - int radixPrefixScanRegTemp1 = __shfl_up_sync(0xffffffff, radixPrefixScanReg1, n, D_BANK_COUNT_GPU); - if (lane >= n) - { - radixPrefixScanReg0 += radixPrefixScanRegTemp0; - radixPrefixScanReg1 += radixPrefixScanRegTemp1; - } - } - - if (!(threadId & D_BANK_COUNT_GPU)) - { - radixPrefixScan[threadId + 1] = radixPrefixScanReg0; - radixPrefixScan[threadId + 1 + D_DEVICE_SORT_BLOCK_SIZE + 1] = radixPrefixScanReg1; - } - - int scale = 0; - __syncthreads(); - for (int segment = blockStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - - radixPrefixScanReg0 += radixPrefixScan[warpSumIndex - 1 + 1]; - radixPrefixScan[threadId + 1] = radixPrefixScanReg0; - - radixPrefixScanReg1 += radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1 + warpSumIndex - 1 + 1]; - radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1 + threadId + 1] = radixPrefixScanReg1; - } - - scale++; - __syncthreads(); - } - - int sum0 = radixPrefixScan[1 * (D_DEVICE_SORT_BLOCK_SIZE + 1) - 1]; - int sum1 = radixPrefixScan[2 * (D_DEVICE_SORT_BLOCK_SIZE + 1) - 1]; - int base0 = 0; - int base1 = sum0 & 0xffff; - int base2 = base1 + (sum0 >> 16); - int base3 = base2 + (sum1 & 0xffff); - - int key0 = radixPrefixScan[threadId]; - int key1 = radixPrefixScan[threadId + D_DEVICE_SORT_BLOCK_SIZE + 1]; - int shift = dstLocalOffsetReg; - - int dstIndex = 0; - dstIndex += (shift == 1) ? base1 + (key0 >> 16) : 0; - dstIndex += (shift == 3) ? base3 + (key1 >> 16) : 0; - dstIndex += (shift == 0) ? base0 + (key0 & 0xffff) : 0; - dstIndex += (shift == 2) ? base2 + (key1 & 0xffff) : 0; - - sortedRadix[dstIndex] = keyReg; - __syncthreads(); - } - - if (index < input.m_size) - { - int keyIndex = sortedRadix[threadId] >> 16; - output[index] = cachedItems[keyIndex]; - } - - bashSize += blockStride; - } - - __syncthreads(); - if (threadId < radixStride) - { - int index = threadId + radixStride * blockIndex; - scanBuffer[index] = radixPrefixCount[threadId]; - } -} - -template -__global__ void ndCudaMergeBuckets(const ndKernelParams params, const ndAssessor input, ndAssessor output, const ndAssessor scanBuffer, int radixStride, SortKeyPredicate getRadix) -{ - __shared__ int radixPrefixCount[D_DEVICE_SORT_MAX_RADIX_SIZE]; - __shared__ int radixPrefixStart[D_DEVICE_SORT_MAX_RADIX_SIZE]; - __shared__ int radixPrefixScan[D_DEVICE_SORT_MAX_RADIX_SIZE + 1]; - - int threadId = threadIdx.x; - int blockStride = blockDim.x; - int blockIndex = blockIdx.x; - int radixBase = blockIndex * radixStride; - int radixPrefixOffset = params.m_kernelCount * radixStride; - int bashSize = params.m_blocksPerKernel * params.m_workGroupSize * blockIndex; - - int radixPrefixStartReg; - if (threadId < radixStride) - { - int a = scanBuffer[radixBase + threadId]; - int b = scanBuffer[radixPrefixOffset + threadId]; - radixPrefixStartReg = a + b; - radixPrefixStart[threadId] = radixPrefixStartReg; - - if (threadId == 0) - { - radixPrefixScan[0] = 0; - } - } - - for (int i = 0; i < params.m_blocksPerKernel; ++i) - { - if (threadId < radixStride) - { - radixPrefixCount[threadId] = 0; - } - __syncthreads(); - - T cachedItemsReg; - int sortedRadixReg; - int index = bashSize + threadId; - int radix = radixStride - 1; - sortedRadixReg = radix; - if (index < input.m_size) - { - const T item(input[index]); - cachedItemsReg = item; - radix = getRadix(item); - sortedRadixReg = radix; - } - atomicAdd(&radixPrefixCount[radix], 1); - __syncthreads(); - - int radixPrefixScanReg; - int radixPrefixCountReg; - if (threadId < radixStride) - { - radixPrefixCountReg = radixPrefixCount[threadId]; - radixPrefixScanReg = radixPrefixCountReg; - } - - int lane = threadId & (D_BANK_COUNT_GPU - 1); - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp = __shfl_up_sync(0xffffffff, radixPrefixScanReg, n, D_BANK_COUNT_GPU); - if (lane >= n) - { - radixPrefixScanReg += radixPrefixScanRegTemp; - } - } - - if (threadId < radixStride) - { - if (!(threadId & D_BANK_COUNT_GPU)) - { - radixPrefixScan[threadId + 1] = radixPrefixScanReg; - } - } - - int scale = 0; - __syncthreads(); - for (int segment = radixStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - if (threadId < radixStride) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - radixPrefixScanReg += radixPrefixScan[warpSumIndex]; - radixPrefixScan[threadId + 1] = radixPrefixScanReg; - } - } - scale++; - __syncthreads(); - } - - if (index < input.m_size) - { - int keyLow = sortedRadixReg; - int dstOffset1 = radixPrefixStart[keyLow]; - int dstOffset0 = threadId - radixPrefixScan[keyLow]; - output[dstOffset0 + dstOffset1] = cachedItemsReg; - } - - __syncthreads(); - if (threadId < radixStride) - { - radixPrefixStartReg += radixPrefixCountReg; - radixPrefixStart[threadId] = radixPrefixStartReg; - } - - bashSize += blockStride; - } -} - - -#elif (D_GPU_SORTING_ALGORITHM == 2) -//optimized Hillis-Steele prefix scan sum -//using a two bits counting sort, in theory, not bank conflits -template -__global__ void CountAndSortBlockItems(const ndKernelParams params, const ndAssessor input, ndAssessor output, ndAssessor scanBuffer, int radixStride, SortKeyPredicate getRadix) -{ - __shared__ T cachedItems[D_DEVICE_SORT_BLOCK_SIZE]; - __shared__ int sortedRadix[D_DEVICE_SORT_BLOCK_SIZE]; - __shared__ int radixPrefixCount[D_DEVICE_SORT_MAX_RADIX_SIZE]; - __shared__ int radixPrefixScan[2 * (D_DEVICE_SORT_BLOCK_SIZE + 1)]; - __shared__ int skipDigit[D_BANK_COUNT_GPU]; - - int threadId = threadIdx.x; - int blockStride = blockDim.x; - int blockIndex = blockIdx.x; - int bashSize = params.m_blocksPerKernel * params.m_workGroupSize * blockIndex; - - if (threadId < radixStride) - { - radixPrefixCount[threadId] = 0; - if (threadId == 0) - { - radixPrefixScan[0] = 0; - radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1] = 0; - } - } - __syncthreads(); - - int lane = threadId & (D_BANK_COUNT_GPU - 1); - for (int i = 0; i < params.m_blocksPerKernel; ++i) - { - int index = bashSize + threadId; - int radix = radixStride - 1; - int sortKey = radix; - if (index < input.m_size) - { - const T item(input[index]); - cachedItems[threadId] = item; - radix = getRadix(item); - atomicAdd(&radixPrefixCount[radix], 1); - sortKey = (threadId << 16) + radix; - } - sortedRadix[threadId] = sortKey; - -sortedRadix[threadId] = 0x05; -sortedRadix[15] = 0x04; -radix = sortedRadix[threadId]; - - __syncthreads(); - - int keyTest = sortedRadix[0] & 0xffff; - //int sortedRadixReg = (~(radix ^ keyTest)) & 0xff; - int sortedRadixReg = ~(radix ^ keyTest); - for (int n = D_BANK_COUNT_GPU / 2; n; n = n / 2) - { - int radixPrefixScanRegTemp = __shfl_down_sync(0xffffffff, sortedRadixReg, n, D_BANK_COUNT_GPU); - sortedRadixReg = sortedRadixReg & radixPrefixScanRegTemp; - } - - if (threadId < D_BANK_COUNT_GPU) - { - skipDigit[threadId] = 0xff; - } - __syncthreads(); - if ((threadId & (D_BANK_COUNT_GPU - 1)) == 0) - { - skipDigit[threadId >> D_LOG_BANK_COUNT_GPU] = sortedRadixReg; - } - __syncthreads(); - - if (threadId < D_BANK_COUNT_GPU) - { - printf("%d %x\n", threadId, skipDigit[threadId]); - keyTest = skipDigit[threadId]; - for (int n = D_BANK_COUNT_GPU / 2; n; n = n / 2) - { - int radixPrefixScanRegTemp = __shfl_down_sync(0xffffffff, keyTest, n, D_BANK_COUNT_GPU); - keyTest = keyTest & radixPrefixScanRegTemp; - } - - if (threadId == 0) - { - skipDigit[0] = keyTest; - } - } - __syncthreads(); - keyTest = skipDigit[0]; - - for (int bit = 0; (1 << (bit * 2)) < radixStride; ++bit) - { - int keyReg = sortedRadix[threadId]; - int test = (keyReg >> (bit * 2)) & 0x3; - int dstLocalOffsetReg = test; - int bit0 = (test == 0) ? 1 : 0; - int bit1 = (test == 1) ? 1 << 16 : 0; - int bit2 = (test == 2) ? 1 : 0; - int bit3 = (test == 3) ? 1 << 16 : 0; - int radixPrefixScanReg0 = bit0 + bit1; - int radixPrefixScanReg1 = bit2 + bit3; - - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp0 = __shfl_up_sync(0xffffffff, radixPrefixScanReg0, n, D_BANK_COUNT_GPU); - int radixPrefixScanRegTemp1 = __shfl_up_sync(0xffffffff, radixPrefixScanReg1, n, D_BANK_COUNT_GPU); - if (lane >= n) - { - radixPrefixScanReg0 += radixPrefixScanRegTemp0; - radixPrefixScanReg1 += radixPrefixScanRegTemp1; - } - } - - if (!(threadId & D_BANK_COUNT_GPU)) - { - radixPrefixScan[threadId + 1] = radixPrefixScanReg0; - radixPrefixScan[threadId + 1 + D_DEVICE_SORT_BLOCK_SIZE + 1] = radixPrefixScanReg1; - } - - int scale = 0; - __syncthreads(); - for (int segment = blockStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - - radixPrefixScanReg0 += radixPrefixScan[warpSumIndex - 1 + 1]; - radixPrefixScan[threadId + 1] = radixPrefixScanReg0; - - radixPrefixScanReg1 += radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1 + warpSumIndex - 1 + 1]; - radixPrefixScan[D_DEVICE_SORT_BLOCK_SIZE + 1 + threadId + 1] = radixPrefixScanReg1; - } - - scale++; - __syncthreads(); - } - - int sum0 = radixPrefixScan[1 * (D_DEVICE_SORT_BLOCK_SIZE + 1) - 1]; - int sum1 = radixPrefixScan[2 * (D_DEVICE_SORT_BLOCK_SIZE + 1) - 1]; - int base0 = 0; - int base1 = sum0 & 0xffff; - int base2 = base1 + (sum0 >> 16); - int base3 = base2 + (sum1 & 0xffff); - - int key0 = radixPrefixScan[threadId]; - int key1 = radixPrefixScan[threadId + D_DEVICE_SORT_BLOCK_SIZE + 1]; - int shift = dstLocalOffsetReg; - - int dstIndex = 0; - dstIndex += (shift == 1) ? base1 + (key0 >> 16) : 0; - dstIndex += (shift == 3) ? base3 + (key1 >> 16) : 0; - dstIndex += (shift == 0) ? base0 + (key0 & 0xffff) : 0; - dstIndex += (shift == 2) ? base2 + (key1 & 0xffff) : 0; - - sortedRadix[dstIndex] = keyReg; - __syncthreads(); - } - - if (index < input.m_size) - { - int keyIndex = sortedRadix[threadId] >> 16; - output[index] = cachedItems[keyIndex]; - } - - bashSize += blockStride; - } - - __syncthreads(); - if (threadId < radixStride) - { - int index = threadId + radixStride * blockIndex; - scanBuffer[index] = radixPrefixCount[threadId]; - } -} - -template -__global__ void ndCudaMergeBuckets(const ndKernelParams params, const ndAssessor input, ndAssessor output, const ndAssessor scanBuffer, int radixStride, SortKeyPredicate getRadix) -{ - __shared__ int radixPrefixCount[D_DEVICE_SORT_MAX_RADIX_SIZE]; - __shared__ int radixPrefixStart[D_DEVICE_SORT_MAX_RADIX_SIZE]; - __shared__ int radixPrefixScan[D_DEVICE_SORT_MAX_RADIX_SIZE + 1]; - - int threadId = threadIdx.x; - int blockStride = blockDim.x; - int blockIndex = blockIdx.x; - int radixBase = blockIndex * radixStride; - int radixPrefixOffset = params.m_kernelCount * radixStride; - int bashSize = params.m_blocksPerKernel * params.m_workGroupSize * blockIndex; - - int radixPrefixStartReg; - if (threadId < radixStride) - { - int a = scanBuffer[radixBase + threadId]; - int b = scanBuffer[radixPrefixOffset + threadId]; - radixPrefixStartReg = a + b; - radixPrefixStart[threadId] = radixPrefixStartReg; - - if (threadId == 0) - { - radixPrefixScan[0] = 0; - } - } - - for (int i = 0; i < params.m_blocksPerKernel; ++i) - { - if (threadId < radixStride) - { - radixPrefixCount[threadId] = 0; - } - __syncthreads(); - - T cachedItemsReg; - int sortedRadixReg; - int index = bashSize + threadId; - int radix = radixStride - 1; - sortedRadixReg = radix; - if (index < input.m_size) - { - const T item(input[index]); - cachedItemsReg = item; - radix = getRadix(item); - sortedRadixReg = radix; - } - atomicAdd(&radixPrefixCount[radix], 1); - __syncthreads(); - - int radixPrefixScanReg; - int radixPrefixCountReg; - if (threadId < radixStride) - { - radixPrefixCountReg = radixPrefixCount[threadId]; - radixPrefixScanReg = radixPrefixCountReg; - } - - int lane = threadId & (D_BANK_COUNT_GPU - 1); - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp = __shfl_up_sync(0xffffffff, radixPrefixScanReg, n, D_BANK_COUNT_GPU); - if (lane >= n) - { - radixPrefixScanReg += radixPrefixScanRegTemp; - } - } - - if (threadId < radixStride) - { - if (!(threadId & D_BANK_COUNT_GPU)) - { - radixPrefixScan[threadId + 1] = radixPrefixScanReg; - } - } - - int scale = 0; - __syncthreads(); - for (int segment = radixStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - if (threadId < radixStride) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - radixPrefixScanReg += radixPrefixScan[warpSumIndex]; - radixPrefixScan[threadId + 1] = radixPrefixScanReg; - } - } - scale++; - __syncthreads(); - } - - if (index < input.m_size) - { - int keyLow = sortedRadixReg; - int dstOffset1 = radixPrefixStart[keyLow]; - int dstOffset0 = threadId - radixPrefixScan[keyLow]; - output[dstOffset0 + dstOffset1] = cachedItemsReg; - } - - __syncthreads(); - if (threadId < radixStride) - { - radixPrefixStartReg += radixPrefixCountReg; - radixPrefixStart[threadId] = radixPrefixStartReg; - } - - bashSize += blockStride; - } -} - -#else - #error implement new local gpu sort and merge algorthm? -#endif - - -template -void ndCountingSort(ndCudaContextImplement* const context, ndCudaDeviceBuffer& buffer, ndCudaDeviceBuffer& auxiliaryBuffer, ndEvaluateRadix evaluateRadix) -{ - ndAssessor assessor0(buffer); - ndAssessor assessor1(auxiliaryBuffer); - ndAssessor prefixScanBuffer(context->GetPrefixScanBuffer()); - ndKernelParams params(context->GetDevice(), D_DEVICE_SORT_BLOCK_SIZE, buffer.GetCount()); - - ndAssert(buffer.GetCount() == auxiliaryBuffer.GetCount()); - ndAssert((1 << exponentRadix) <= D_DEVICE_SORT_MAX_RADIX_SIZE); - - int radixStride = 1 << exponentRadix; - CountAndSortBlockItems << > > (params, assessor0, assessor1, prefixScanBuffer, radixStride, evaluateRadix); - ndCudaAddPrefix <<< 1, radixStride, 0 >>> (params, prefixScanBuffer); - ndCudaMergeBuckets << > > (params, assessor1, assessor0, prefixScanBuffer, radixStride, evaluateRadix); -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSortUnOrdered.cuh b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSortUnOrdered.cuh deleted file mode 100644 index c7d34dd7b3..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSortUnOrdered.cuh +++ /dev/null @@ -1,208 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __CUDA_SORT_UNORDERED_H__ -#define __CUDA_SORT_UNORDERED_H__ - -#include -#include -#include - -#include "ndCudaDevice.h" -#include "ndCudaContext.h" -#include "ndCudaHostBuffer.h" -#include "ndCudaDeviceBuffer.h" -#include "ndCudaPrefixScan.cuh" - -#define D_DEVICE_UNORDERED_SORT_BLOCK_SIZE (1<<10) - -#if D_DEVICE_SORT_MAX_RADIX_SIZE > D_DEVICE_UNORDERED_SORT_BLOCK_SIZE - #error counting sort diget larger that block -#endif - -/// -/// ndCountingSortUnOrdered use for fast unstable sort. -/// since the orted array is unstable, this funtion can not be used as the base for a stable radix sort -/// -/// item class or type -/// radix sort size in bits -/// cuda context class, for internal temporary scan array and other info -/// source input array, data will be sort on this buffer -/// temporary scratch buffer for intemidiate work, must be the same size as buffer -/// lambda function to get radix form items in array -template -void ndCountingSortUnOrdered(ndCudaContextImplement* const context, ndCudaDeviceBuffer& buffer, ndCudaDeviceBuffer& auxiliaryBuffer, ndEvaluateRadix evaluateRadix); - -// ***************************************************************** -// -// support function implementation -// -// ***************************************************************** -#if 0 -template -__global__ void ndCudaAddPrefixUnordered(const ndKernelParams params, const ndAssessor dommy, ndAssessor scansBuffer, SortKeyPredicate getRadix) -{ - //optimized Hillis-Steele prefix scan sum - __shared__ int localPrefixScan[D_DEVICE_SORT_MAX_RADIX_SIZE + 1]; - - int threadId = threadIdx.x; - int blockStride = blockDim.x; - - int sum = 0; - int offset = 0; - if (threadId == 0) - { - localPrefixScan[0] = 0; - } - for (int i = 0; i < params.m_kernelCount; ++i) - { - int count = scansBuffer[offset + threadId]; - scansBuffer[offset + threadId] = sum; - sum += count; - offset += blockStride; - } - - int lane = threadId & (D_BANK_COUNT_GPU - 1); - for (int n = 1; n < D_BANK_COUNT_GPU; n *= 2) - { - int radixPrefixScanRegTemp = __shfl_up_sync(0xffffffff, sum, n, D_BANK_COUNT_GPU); - if (lane >= n) - { - sum += radixPrefixScanRegTemp; - } - } - - if (!(threadId & D_BANK_COUNT_GPU)) - { - localPrefixScan[threadId + 1] = sum; - } - - int scale = 0; - __syncthreads(); - for (int segment = blockStride; segment > D_BANK_COUNT_GPU; segment >>= 1) - { - int bank = 1 << (D_LOG_BANK_COUNT_GPU + scale); - int warpBase = threadId & bank; - if (warpBase) - { - int warpSumIndex = threadId & (-warpBase); - sum += localPrefixScan[warpSumIndex]; - localPrefixScan[threadId + 1] = sum; - } - scale++; - __syncthreads(); - } - scansBuffer[offset + threadId] = localPrefixScan[threadId]; -} -#endif - -template -__global__ void ndCudaCountItemsAndCopyUnordered(const ndKernelParams params, const ndAssessor input, ndAssessor output, ndAssessor scansBuffer, int radixStride, SortKeyPredicate getRadix) -{ - // the bank free template does not seems to make any difference, but I use it anyway. - //__shared__ int radixCountBuffer[D_DEVICE_SORT_MAX_RADIX_SIZE]; - __shared__ cuBankFreeArray radixCountBuffer; - - int threadId = threadIdx.x; - int blockStride = blockDim.x; - int blockIndex = blockIdx.x; - int bashSize = params.m_blocksPerKernel * params.m_workGroupSize * blockIndex; - - if (threadId < radixStride) - { - radixCountBuffer[threadId] = 0; - } - __syncthreads(); - - for (int i = 0; i < params.m_blocksPerKernel; ++i) - { - int index = bashSize + threadId; - if (index < input.m_size) - { - T item(input[index]); - output[index] = item; - int radix = getRadix(item); - atomicAdd(&radixCountBuffer[radix], 1); - } - bashSize += blockStride; - } - - __syncthreads(); - if (threadId < radixStride) - { - int index = threadId + radixStride * blockIndex; - scansBuffer[index] = radixCountBuffer[threadId]; - } -} - -template -__global__ void ndCudaMergeBucketsUnOrdered(const ndKernelParams params, const ndAssessor input, ndAssessor output, const ndAssessor scansBuffer, int radixStride, SortKeyPredicate getRadix) -{ - // the bank free template does not seems to make any difference, but I use it anyway. - //__shared__ int radixCountBuffer[D_DEVICE_SORT_MAX_RADIX_SIZE]; - __shared__ cuBankFreeArray radixCountBuffer; - - int threadId = threadIdx.x; - int blockIndex = blockIdx.x; - int blockStride = blockDim.x; - int radixBase = blockIndex * radixStride; - int radixPrefixOffset = params.m_kernelCount * radixStride; - int bashSize = params.m_blocksPerKernel * params.m_workGroupSize * blockIndex; - - if (threadId < radixStride) - { - radixCountBuffer[threadId] = scansBuffer[radixPrefixOffset + threadId] + scansBuffer[radixBase + threadId]; - } - __syncthreads(); - - for (int i = 0; i < params.m_blocksPerKernel; ++i) - { - int index = bashSize + threadId; - if (index < input.m_size) - { - T item(input[index]); - int radix = getRadix(item); - int address = atomicAdd(&radixCountBuffer[radix], 1); - output[address] = item; - } - bashSize += blockStride; - } -} - -template -void ndCountingSortUnOrdered(ndCudaContextImplement* const context, ndCudaDeviceBuffer& buffer, ndCudaDeviceBuffer& auxiliaryBuffer, ndEvaluateRadix evaluateRadix) -{ - ndAssessor assessor0(buffer); - ndAssessor assessor1(auxiliaryBuffer); - ndAssessor prefixScanBuffer(context->GetPrefixScanBuffer()); - ndKernelParams params(context->GetDevice(), D_DEVICE_UNORDERED_SORT_BLOCK_SIZE, buffer.GetCount()); - - ndAssert(buffer.GetCount() == auxiliaryBuffer.GetCount()); - ndAssert((1 << exponentRadix) <= D_DEVICE_SORT_MAX_RADIX_SIZE); - - int radixStride = 1 << exponentRadix; - ndCudaCountItemsAndCopyUnordered << > > (params, assessor0, assessor1, prefixScanBuffer, radixStride, evaluateRadix); - //ndCudaAddPrefixUnordered << <1, radixStride, 0 >> > (params, input, prefixScanBuffer, evaluateRadix); - ndCudaAddPrefix << < 1, radixStride, 0 >> > (params, prefixScanBuffer); - ndCudaMergeBucketsUnOrdered << > > (params, assessor1, assessor0, prefixScanBuffer, radixStride, evaluateRadix); -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSphFluid.cu b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSphFluid.cu deleted file mode 100644 index 4d8044b94a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSphFluid.cu +++ /dev/null @@ -1,737 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCudaStdafx.h" -#include "ndCudaDevice.h" -#include "ndCudaSort.cuh" -#include "ndCudaContext.h" -#include "ndCudaSphFluid.h" -#include "ndCudaContextImplement.h" - -#define D_MAX_LOCAL_SIZE 512 - -ndCudaSphFluid::Image::Image(const ndSphFluidInitInfo& info) - :ndSphFluidInitInfo(info) -{ -} - -ndCudaSphFluid::Image::~Image() -{ -} - -void ndCudaSphFluid::Image::Init(ndCudaSphFluid& fluid) -{ - m_error = m_noError; - m_param = ndKernelParams (m_context->m_device, m_context->m_device->m_workGroupSize, fluid.m_points.GetCount()); - - fluid.m_pointsAabb.SetCount(m_param.m_kernelCount + 32); - if (m_context->m_implement->m_sortPrefixBuffer.GetCount() < m_param.m_itemCount * 2) - { - m_context->m_implement->m_sortPrefixBuffer.SetCount(m_param.m_itemCount * 2); - } - fluid.m_errorCode.Set(0); - fluid.m_hashGridMap.SetCount(m_param.m_itemCount * 4 + 1024); - fluid.m_hashGridMapTemp.SetCount(fluid.m_hashGridMap.GetCount()); - m_activeHashGridMapSize = fluid.m_hashGridMap.GetCount(); - - m_errorCode = fluid.m_errorCode.Pointer(); - m_childStream = m_context->m_device->m_childStream; - m_points = ndAssessor(fluid.m_points); - m_hashGridMap = ndAssessor(fluid.m_hashGridMap); - m_hashGridMapTemp = ndAssessor(fluid.m_hashGridMapTemp); - m_pointsAabb = ndAssessor(fluid.m_pointsAabb); - m_gridScans = ndAssessor(m_context->m_implement->m_sortPrefixBuffer); -} - -__global__ void ndCalculateBlockAabb(ndCudaSphFluid::Image* fluid) -{ - __shared__ float box_x0[D_MAX_LOCAL_SIZE]; - __shared__ float box_y0[D_MAX_LOCAL_SIZE]; - __shared__ float box_z0[D_MAX_LOCAL_SIZE]; - __shared__ float box_x1[D_MAX_LOCAL_SIZE]; - __shared__ float box_y1[D_MAX_LOCAL_SIZE]; - __shared__ float box_z1[D_MAX_LOCAL_SIZE]; - - int blockId = blockIdx.x; - int threadId = threadIdx.x; - int blockSride = blockDim.x; - - float xMin = 1.0e15f; - float yMin = 1.0e15f; - float zMin = 1.0e15f; - float xMax = -1.0e15f; - float yMax = -1.0e15f; - float zMax = -1.0e15f; - - int base = blockSride * fluid->m_param.m_blocksPerKernel * blockId; - for (int i = 0; i < fluid->m_param.m_blocksPerKernel; ++i) - { - int index = base + threadId; - ndCudaVector point(index < fluid->m_points.m_size ? fluid->m_points[index] : fluid->m_points[0]); - - xMin = point.x < xMin ? point.x : xMin; - yMin = point.y < yMin ? point.y : yMin; - zMin = point.z < zMin ? point.z : zMin; - - xMax = point.x > xMax ? point.x : xMax; - yMax = point.y > yMax ? point.y : yMax; - zMax = point.z > zMax ? point.z : zMax; - - base += blockSride; - } - - box_x0[threadId] = xMin; - box_y0[threadId] = yMin; - box_z0[threadId] = zMin; - - box_x1[threadId] = xMax; - box_y1[threadId] = yMax; - box_z1[threadId] = zMax; - - for (int i = fluid->m_param.m_workGroupSize / 2; i > 0; i = i >> 1) - { - if (threadId < i) - { - float x0 = box_x0[threadId]; - float y0 = box_y0[threadId]; - float z0 = box_z0[threadId]; - float x1 = box_x0[i + threadId]; - float y1 = box_y0[i + threadId]; - float z1 = box_z0[i + threadId]; - box_x0[threadId] = x0 < x1 ? x0 : x1; - box_y0[threadId] = y0 < y1 ? y0 : y1; - box_z0[threadId] = z0 < z1 ? z0 : z1; - - x0 = box_x1[threadId]; - y0 = box_y1[threadId]; - z0 = box_z1[threadId]; - x1 = box_x1[i + threadId]; - y1 = box_y1[i + threadId]; - z1 = box_z1[i + threadId]; - box_x1[threadId] = x0 > x1 ? x0 : x1; - box_y1[threadId] = y0 > y1 ? y0 : y1; - box_z1[threadId] = z0 > z1 ? z0 : z1; - } - __syncthreads(); - } - - if (threadId == 0) - { - fluid->m_pointsAabb[blockId].m_min = ndCudaVector(box_x0[0], box_y0[0], box_z0[0], 0.0f); - fluid->m_pointsAabb[blockId].m_max = ndCudaVector(box_x1[0], box_y1[0], box_z1[0], 0.0f); - } -} - -__global__ void ndCalculateAabb(ndCudaSphFluid::Image* fluid) -{ - __shared__ float box_x0[D_MAX_LOCAL_SIZE]; - __shared__ float box_y0[D_MAX_LOCAL_SIZE]; - __shared__ float box_z0[D_MAX_LOCAL_SIZE]; - __shared__ float box_x1[D_MAX_LOCAL_SIZE]; - __shared__ float box_y1[D_MAX_LOCAL_SIZE]; - __shared__ float box_z1[D_MAX_LOCAL_SIZE]; - - int threadId = threadIdx.x; - int blockSride = blockDim.x; - - if (threadId < fluid->m_param.m_kernelCount) - { - box_x0[threadId] = fluid->m_pointsAabb[threadId].m_min.x; - box_y0[threadId] = fluid->m_pointsAabb[threadId].m_min.y; - box_z0[threadId] = fluid->m_pointsAabb[threadId].m_min.z; - box_x1[threadId] = fluid->m_pointsAabb[threadId].m_max.x; - box_y1[threadId] = fluid->m_pointsAabb[threadId].m_max.y; - box_z1[threadId] = fluid->m_pointsAabb[threadId].m_max.z; - } - else - { - box_x0[threadId] = fluid->m_pointsAabb[0].m_min.x; - box_y0[threadId] = fluid->m_pointsAabb[0].m_min.y; - box_z0[threadId] = fluid->m_pointsAabb[0].m_min.z; - box_x1[threadId] = fluid->m_pointsAabb[0].m_max.x; - box_y1[threadId] = fluid->m_pointsAabb[0].m_max.y; - box_z1[threadId] = fluid->m_pointsAabb[0].m_max.z; - } - - for (int i = blockSride / 2; i > 0; i = i >> 1) - { - if (threadId < i) - { - float x0 = box_x0[threadId]; - float y0 = box_y0[threadId]; - float z0 = box_z0[threadId]; - float x1 = box_x0[i + threadId]; - float y1 = box_y0[i + threadId]; - float z1 = box_z0[i + threadId]; - box_x0[threadId] = x0 < x1 ? x0 : x1; - box_y0[threadId] = y0 < y1 ? y0 : y1; - box_z0[threadId] = z0 < z1 ? z0 : z1; - - x0 = box_x1[threadId]; - y0 = box_y1[threadId]; - z0 = box_z1[threadId]; - x1 = box_x1[i + threadId]; - y1 = box_y1[i + threadId]; - z1 = box_z1[i + threadId]; - box_x1[threadId] = x0 > x1 ? x0 : x1; - box_y1[threadId] = y0 > y1 ? y0 : y1; - box_z1[threadId] = z0 > z1 ? z0 : z1; - } - __syncthreads(); - } - - if (threadId == 0) - { - ndSphFluidAabb box; - - box.m_min = ndCudaVector(box_x0[0], box_y0[0], box_z0[0], 0.0f); - box.m_max = ndCudaVector(box_x1[0], box_y1[0], box_z1[0], 0.0f); - ndCudaVector grid(fluid->m_gridSize); - ndCudaVector invGrid(1.0f / fluid->m_gridSize); - - // add one grid padding to the aabb - box.m_min = box.m_min - grid; - box.m_max = box.m_max + grid + grid; - - // quantize the aabb to integers of the gird size - box.m_min = grid * (box.m_min * invGrid).Floor(); - box.m_max = grid * (box.m_max * invGrid).Floor(); - - // make sure the w component is zero. - //m_box0 = box.m_min & ndVector::m_triplexMask; - //m_box1 = box.m_max & ndVector::m_triplexMask; - box.m_min.w = 0.0f; - box.m_max.w = 0.0f; - fluid->m_aabb = box; - - //const ndVector boxSize((m_box1 - m_box0).Scale(ndFloat32(1.0f) / GetSphGridSize()).GetInt()); - fluid->m_gridSizeX = int(cuFloor((box.m_max.x - box.m_min.x) * invGrid.x)); - fluid->m_gridSizeY = int(cuFloor((box.m_max.y - box.m_min.y) * invGrid.y)); - fluid->m_gridSizeZ = int(cuFloor((box.m_max.z - box.m_min.z) * invGrid.z)); - - //ndWorkingBuffers& data = *m_workingBuffers; - //ndInt32 numberOfGrid = ndInt32((box.m_max.m_x - box.m_min.m_x) * invGrid.m_x + ndFloat32(1.0f)); - //data.SetWorldToGridMapping(numberOfGrid, m_box1.m_x, m_box0.m_x); - } -} - -__global__ void ndCountGrids(ndCudaSphFluid::Image* fluid) -{ - __shared__ float scans[D_MAX_LOCAL_SIZE/2 + D_MAX_LOCAL_SIZE + 1]; - - int blockId = blockIdx.x; - int threadId = threadIdx.x; - int blockSride = blockDim.x; - int halfBlockSride = blockSride / 2; - int base = blockSride * fluid->m_param.m_blocksPerKernel * blockId; - - const ndCudaVector origin(fluid->m_aabb.m_min); - const ndCudaVector box(fluid->m_gridSize * 0.5f * 0.99f); - const ndCudaVector invGridSize(1.0f / fluid->m_gridSize); - - int sumAccumulator = 0; - for (int i = 0; i < fluid->m_param.m_blocksPerKernel; ++i) - { - int index = base + threadId; - - if (threadId < halfBlockSride) - { - scans[threadId] = 0; - } - - if (index < fluid->m_points.m_size) - { - const ndCudaVector posit(fluid->m_points[index]); - const ndCudaVector r(posit - origin); - const ndCudaVector p(r - origin); - const ndCudaVector p0((r - box) * invGridSize); - const ndCudaVector p1((r + box) * invGridSize); - - const ndCudaSphFluid::ndGridHash box0Hash(p0, index); - const ndCudaSphFluid::ndGridHash box1Hash(p1, index); - const ndCudaSphFluid::ndGridHash codeHash(box1Hash.m_gridHash - box0Hash.m_gridHash); - - const unsigned code = unsigned(codeHash.m_z * 2 + codeHash.m_x); - scans[halfBlockSride + threadId] = fluid->m_neighborgInfo.m_counter[code]; - } - else - { - scans[halfBlockSride + threadId] = 0; - } - - for (int j = 1; j < blockSride; j = j << 1) - { - __syncthreads(); - int sum = scans[halfBlockSride + threadId] + scans[halfBlockSride + threadId - j]; - __syncthreads(); - scans[halfBlockSride + threadId] = sum; - } - __syncthreads(); - fluid->m_gridScans[index] = scans[halfBlockSride + threadId] + sumAccumulator; - sumAccumulator += scans[halfBlockSride + blockSride - 1]; - - base += blockSride; - } - __syncthreads(); - - if (threadId == 0) - { - int offset = blockSride * fluid->m_param.m_blocksPerKernel * fluid->m_param.m_kernelCount; - fluid->m_gridScans[offset + blockId] = sumAccumulator; - } -} - -__global__ void ndPrefixScanSum(ndCudaSphFluid::Image* fluid, int kernelStride) -{ - __shared__ float scanSum[D_MAX_LOCAL_SIZE / 2 + D_MAX_LOCAL_SIZE + 1]; - - int blockId = blockIdx.x; - int threadId = threadIdx.x; - int blockSride = blockDim.x; - int halfKernelStride = kernelStride / 2; - int scanSize = fluid->m_param.m_workGroupSize * fluid->m_param.m_blocksPerKernel * fluid->m_param.m_kernelCount; - - if (kernelStride > 1) - { - if (threadId < halfKernelStride) - { - scanSum[threadId] = 0; - } - - scanSum[halfKernelStride + threadId] = fluid->m_gridScans[scanSize + threadId]; - for (int j = 1; j < kernelStride; j = j << 1) - { - int sum; - __syncthreads(); - if (threadId < kernelStride) - { - sum = scanSum[halfKernelStride + threadId] + scanSum[halfKernelStride + threadId - j]; - } - __syncthreads(); - if (threadId < kernelStride) - { - scanSum[halfKernelStride + threadId] = sum; - } - } - - int base = blockSride * blockId; - int itemsPerBlock = fluid->m_param.m_workGroupSize * fluid->m_param.m_blocksPerKernel; - for (int i = 0; i < fluid->m_param.m_kernelCount; ++i) - { - int index = base + threadId; - float sumAcc = scanSum[halfKernelStride + i - 1]; - fluid->m_gridScans[index] = fluid->m_gridScans[index] + sumAcc; - base += itemsPerBlock; - } - __syncthreads(); - - if ((blockId == (gridDim.x - 1) && (threadId == 0))) - { - int activeHashGridMapSize = scanSum[halfKernelStride + kernelStride - 1]; - fluid->m_hashGridMap[activeHashGridMapSize].m_gridHash = uint64_t (- 1); - fluid->m_activeHashGridMapSize = activeHashGridMapSize; - - fluid->m_sortHashGridMap0 = fluid->m_hashGridMap; - fluid->m_sortHashGridMap1 = fluid->m_hashGridMapTemp; - fluid->m_sortHashGridMap0.m_size = activeHashGridMapSize; - fluid->m_sortHashGridMap1.m_size = activeHashGridMapSize; - - if (fluid->m_activeHashGridMapSize > fluid->m_hashGridMap.m_capacity) - { - *fluid->m_errorCode = 1; - fluid->m_error = ndCudaSphFluid::Image::m_gridsOverFlow; - } - } - } - else - { - if ((blockId == (gridDim.x - 1) && (threadId == 0))) - { - int activeHashGridMapSize = fluid->m_gridScans[scanSize]; - fluid->m_hashGridMap[activeHashGridMapSize].m_gridHash = uint64_t(-1); - fluid->m_activeHashGridMapSize = activeHashGridMapSize; - - fluid->m_sortHashGridMap0 = fluid->m_hashGridMap; - fluid->m_sortHashGridMap1 = fluid->m_hashGridMapTemp; - fluid->m_sortHashGridMap0.m_size = activeHashGridMapSize; - fluid->m_sortHashGridMap1.m_size = activeHashGridMapSize; - - if (fluid->m_activeHashGridMapSize > fluid->m_hashGridMap.m_capacity) - { - *fluid->m_errorCode = 1; - fluid->m_error = ndCudaSphFluid::Image::m_gridsOverFlow; - } - } - } -} - -__global__ void ndCreateGrids(ndCudaSphFluid::Image* fluid) -{ - __shared__ float error; - __shared__ float scanStart; - - int blockId = blockIdx.x; - int threadId = threadIdx.x; - int blockSride = blockDim.x; - int base = blockSride * fluid->m_param.m_blocksPerKernel * blockId; - - const ndCudaVector origin(fluid->m_aabb.m_min); - const ndCudaVector box(fluid->m_gridSize * 0.5f * 0.99f); - const ndCudaVector invGridSize(1.0f / fluid->m_gridSize); - - if (threadId == 0) - { - error = fluid->m_error; - scanStart = fluid->m_gridScans[0]; - } - __syncthreads(); - - if (error == ndCudaSphFluid::Image::m_noError) - { - for (int i = 0; i < fluid->m_param.m_blocksPerKernel; ++i) - { - int index = base + threadId; - if (index < fluid->m_points.m_size) - { - //const ndVector r(posit[i] - origin); - //const ndVector p(r * invGridSize); - //const ndGridHash hashKey(p, i); - const ndCudaVector posit(fluid->m_points[index]); - const ndCudaVector r(posit - origin); - const ndCudaVector p(r - origin); - //const ndCudaSphFluid::ndGridHash boxHash(p, i); - - //const ndVector p0((r - box) * invGridSize); - //const ndVector p1((r + box) * invGridSize); - //ndGridHash box0Hash(p0, i); - //const ndGridHash box1Hash(p1, i); - //const ndGridHash codeHash(box1Hash.m_gridHash - box0Hash.m_gridHash); - const ndCudaVector p0((r - box) * invGridSize); - const ndCudaVector p1((r + box) * invGridSize); - const ndCudaSphFluid::ndGridHash box0Hash(p0, index); - const ndCudaSphFluid::ndGridHash box1Hash(p1, index); - const ndCudaSphFluid::ndGridHash codeHash(box1Hash.m_gridHash - box0Hash.m_gridHash); - - //const ndInt32 base = scans[i]; - //const ndInt32 count = scans[i + 1] - base; - //const ndInt32 code = ndInt32(codeHash.m_z * 2 + codeHash.m_x); - const int base = fluid->m_gridScans[index] - scanStart; - const unsigned code = unsigned(codeHash.m_z * 2 + codeHash.m_x); - const ndCudaSphFluid::ndGridHash* const neigborgh = &fluid->m_neighborgInfo.m_neighborDirs[code][0]; - //ndAssert(count == neiborghood.m_counter[code]); - const int count = fluid->m_neighborgInfo.m_counter[code]; - - const ndCudaSphFluid::ndGridHash hashKey(p, index); - for (int j = 0; j < count; ++j) - { - //ndGridHash quadrand(box0Hash); - ndCudaSphFluid::ndGridHash quadrand(box0Hash); - //quadrand.m_gridHash += neigborgh[j].m_gridHash; - quadrand.m_gridHash += neigborgh[j].m_gridHash; - //quadrand.m_cellType = ndGridType(quadrand.m_gridHash == hashKey.m_gridHash); - quadrand.m_cellType = ndCudaSphFluid::ndGridType(quadrand.m_gridHash == hashKey.m_gridHash); - //ndAssert(quadrand.m_cellType == ((quadrand.m_gridHash == hashKey.m_gridHash) ? ndHomeGrid : ndAdjacentGrid)); - //dst[base + j] = quadrand; - fluid->m_hashGridMap[base + j] = quadrand; - } - } - base += blockSride; - } - } -} - -__global__ void ndSwapGrids(ndCudaSphFluid::Image* fluid) -{ - cuSwap(fluid->m_sortHashGridMap0, fluid->m_sortHashGridMap1); -} - -template -__global__ void ndSortGrids(ndCudaSphFluid::Image* fluid, - ndEvaluateRadix_xLow sort_xLow, ndEvaluateRadix_xHigh sort_xHigh, - ndEvaluateRadix_zLow sort_zLow, ndEvaluateRadix_zHigh sort_zHigh) -{ - if (fluid->m_error == ndCudaSphFluid::Image::m_noError) - { - //ndAssert(0); - //cudaStream_t stream = fluid->m_childStream; - ////cudaStreamCreateWithFlags(&stream, cudaStreamDefault); - // - //ndKernelParams params(fluid->m_param, D_DEVICE_SORT_BLOCK_SIZE, fluid->m_activeHashGridMapSize); - // - //int radixSize = 1 << D_SPH_CUDA_HASH_BITS; - //ndCudaCountItems << > > (params, fluid->m_sortHashGridMap0, fluid->m_gridScans, radixSize, sort_xLow); - //ndCudaAddPrefix << <1, radixSize, 0, stream >> > (params, fluid->m_sortHashGridMap0, fluid->m_gridScans, sort_xLow); - //ndCudaMergeBuckets << > > (params, fluid->m_sortHashGridMap0, fluid->m_sortHashGridMap1, fluid->m_gridScans, radixSize, sort_xLow); - //ndSwapGrids << <1, 1, 0 >> > (fluid); - //if (fluid->m_gridSizeX >= radixSize) - //{ - // printf("xxxxxxxxxxx %d\n", fluid->m_gridSizeX); - // ndCudaCountItems << > > (params, fluid->m_sortHashGridMap0, fluid->m_gridScans, radixSize, sort_xHigh); - // ndCudaAddPrefix << <1, radixSize, 0, stream >> > (params, fluid->m_sortHashGridMap0, fluid->m_gridScans, sort_xHigh); - // ndCudaMergeBuckets << > > (params, fluid->m_sortHashGridMap0, fluid->m_sortHashGridMap1, fluid->m_gridScans, radixSize, sort_xHigh); - // ndSwapGrids << <1, 1, 0 >> > (fluid); - //} - // - //ndCudaCountItems << > > (params, fluid->m_sortHashGridMap0, fluid->m_gridScans, 256, sort_zLow); - //ndCudaAddPrefix << <1, radixSize, 0, stream >> > (params, fluid->m_sortHashGridMap0, fluid->m_gridScans, sort_zLow); - //ndCudaMergeBuckets << > > (params, fluid->m_sortHashGridMap0, fluid->m_sortHashGridMap1, fluid->m_gridScans, 256, sort_zLow); - //ndSwapGrids << <1, 1, 0 >> > (fluid); - //if (fluid->m_gridSizeZ >= radixSize) - //{ - // printf("zzzzzzzz %d\n", fluid->m_gridSizeZ); - // ndCudaCountItems << > > (params, fluid->m_sortHashGridMap0, fluid->m_gridScans, radixSize, sort_zHigh); - // ndCudaAddPrefix << <1, radixSize, 0, stream >> > (params, fluid->m_sortHashGridMap0, fluid->m_gridScans, sort_zHigh); - // ndCudaMergeBuckets << > > (params, fluid->m_sortHashGridMap0, fluid->m_sortHashGridMap1, fluid->m_gridScans, radixSize, sort_zHigh); - // ndSwapGrids << <1, 1, 0 >> > (fluid); - //} - ////cudaStreamDestroy(stream); - } -} - -ndCudaSphFluid::ndCudaSphFluid(const ndSphFluidInitInfo& info) - :m_imageCpu(info) - ,m_imageGpu(nullptr) - ,m_points() - ,m_pointsAabb() - ,m_errorCode(m_imageCpu.m_context->m_device) -{ - m_imageCpu.m_context->m_device->m_lastError = cudaMalloc((void**)&m_imageGpu, sizeof (Image)); - ndAssert(m_imageCpu.m_context->m_device->m_lastError == cudaSuccess); -} - -ndCudaSphFluid::~ndCudaSphFluid() -{ - m_imageCpu.m_context->m_device->m_lastError = cudaFree(m_imageGpu); - ndAssert(m_imageCpu.m_context->m_device->m_lastError == cudaSuccess); -} - -void ndCudaSphFluid::MemCpy(const double* const src, int strideInItems, int items) -{ - ndAssert(0); -} - -void GetPositions(double* const dst, int strideInItems, int items) -{ - ndAssert(0); -} - -void ndCudaSphFluid::MemCpy(const float* const src, int strideInItems, int items) -{ - m_points.SetCount(items); - - if (strideInItems == sizeof(ndCudaVector) / sizeof(float)) - { - const ndCudaVector* const srcPtr = (ndCudaVector*)src; - m_points.ReadData(srcPtr, items); - } - else - { - ndAssert(0); - } - - InitBuffers(); -} - -void ndCudaSphFluid::GetPositions(float* const dst, int strideInItems, int items) -{ - if (strideInItems == sizeof(ndCudaVector) / sizeof(float)) - { - ndCudaVector* const dstPtr = (ndCudaVector*)dst; - m_points.WriteData(dstPtr, items); - } - else - { - ndAssert(0); - } -} - -void ndCudaSphFluid::InitBuffers() -{ - m_imageCpu.Init(*this); - m_imageCpu.m_context->m_device->m_lastError = cudaMemcpy(m_imageGpu, &m_imageCpu, sizeof (Image), cudaMemcpyHostToDevice); - ndAssert(m_imageCpu.m_context->m_device->m_lastError == cudaSuccess); -} - -void ndCudaSphFluid::CaculateAabb() -{ - int power = 1; - while (power < m_imageCpu.m_param.m_kernelCount) - { - power *= 2; - } - ndCalculateBlockAabb << > > (m_imageGpu); - ndCalculateAabb << <1, power, 0 >> > (m_imageGpu); -} - -bool ndCudaSphFluid::TraceHashes() -{ -#if 1 - Image* image = ndAlloca(Image, 2); - m_imageCpu.m_context->m_device->m_lastError = cudaMemcpy(image, m_imageGpu, sizeof(Image), cudaMemcpyDeviceToHost); - ndAssert(m_imageCpu.m_context->m_device->m_lastError == cudaSuccess); - m_imageCpu.m_context->m_device->SyncDevice(); - - ndCudaHostBuffer buffer; - buffer.SetCount(image->m_sortHashGridMap0.m_size + 256); - buffer.ReadData(&image->m_sortHashGridMap0[0], image->m_sortHashGridMap0.m_size); - for (int i = 0; i < image->m_sortHashGridMap0.m_size; i++) - { - cuTrace(("id(%d)\tx(%d)\tz(%d)\n", buffer[i].m_particleIndex, buffer[i].m_x, buffer[i].m_z)); - } - cuTrace(("\n")); -#endif - - return true; -} - -void ndCudaSphFluid::Update(float timestep) -{ - HandleErrors(); - CaculateAabb(); - CreateGrids(); - //SortGrids(); - -#if 0 - Image* image = ndAlloca(Image, 2); - m_imageCpu.m_context->m_device->m_lastError = cudaMemcpy(image, m_imageGpu, sizeof(Image), cudaMemcpyDeviceToHost); - ndAssert(m_imageCpu.m_context->m_device->m_lastError == cudaSuccess); - m_imageCpu.m_context->m_device->SyncDevice(); - - ndCudaHostBuffer scans; - scans.SetCount(image->m_param.m_itemCount + 4000); - scans.ReadData(&image->m_gridScans[0], scans.GetCount()); - scans.SetCount(image->m_param.m_itemCount); -#endif -} - -void ndCudaSphFluid::HandleErrors() -{ - if (m_errorCode.Get()) - { - ndAssert(0); - char imageBuff[sizeof(Image) + 256]; - Image* image = (Image*)&imageBuff; - m_imageCpu.m_context->m_device->m_lastError = cudaMemcpy(image, m_imageGpu, sizeof(Image), cudaMemcpyDeviceToHost); - ndAssert(m_imageCpu.m_context->m_device->m_lastError == cudaSuccess); - m_imageCpu.m_context->m_device->SyncDevice(); - - switch (image->m_error) - { - case Image::m_gridsOverFlow: - { - ndAssert(0); - break; - } - - default:; - { - ndAssert(0); - } - } - - m_errorCode.Set(0); - m_imageCpu.m_error = Image::m_noError; - - m_imageCpu.m_context->m_device->m_lastError = cudaMemcpy(m_imageGpu, &m_imageCpu, sizeof(Image), cudaMemcpyHostToDevice); - ndAssert(m_imageCpu.m_context->m_device->m_lastError == cudaSuccess); - } - - m_errorCode.Set(0); -} - -void ndCudaSphFluid::CreateGrids() -{ - int power = 1; - while (power < m_imageCpu.m_param.m_kernelCount) - { - power *= 2; - } - ndCountGrids << > > (m_imageGpu); - ndPrefixScanSum << > > (m_imageGpu, power); - ndCreateGrids << > > (m_imageGpu); -} - -void ndCudaSphFluid::SortGrids() -{ -#if 0 - Image* image = ndAlloca(Image, 2); - m_imageCpu.m_context->m_device->m_lastError = cudaMemcpy(image, m_imageGpu, sizeof(Image), cudaMemcpyDeviceToHost); - ndAssert(m_imageCpu.m_context->m_device->m_lastError == cudaSuccess); - m_imageCpu.m_context->m_device->SyncDevice(); - - auto GetRadix_xLow = [] __device__(const ndGridHash& item) - { - return item.m_xLow; - }; - auto GetRadix_xHigh = [] __device__(const ndGridHash& item) - { - return item.m_xHigh; - }; - - auto GetRadix_zLow = [] __device__(const ndGridHash& item) - { - return item.m_zLow; - }; - - auto GetRadix_zHigh = [] __device__(const ndGridHash& item) - { - return item.m_zHigh; - }; - - m_hashGridMap.SetCount(image->m_activeHashGridMapSize); - m_hashGridMapTemp.SetCount(image->m_activeHashGridMapSize); - - //ndAssert(TraceHashes()); - ndCountingSort(m_imageCpu.m_context->m_implement, m_hashGridMap, m_hashGridMapTemp, GetRadix_xLow); - ndCountingSort(m_imageCpu.m_context->m_implement, m_hashGridMapTemp, m_hashGridMap, GetRadix_xHigh); - ndCountingSort(m_imageCpu.m_context->m_implement, m_hashGridMap, m_hashGridMapTemp, GetRadix_zLow); - ndCountingSort(m_imageCpu.m_context->m_implement, m_hashGridMapTemp, m_hashGridMap, GetRadix_zHigh); - - //ndAssert(TraceHashes()); - -#else - auto GetRadix_xLow = [] __device__(const ndGridHash & item) - { - return item.m_xLow; - }; - - auto GetRadix_xHigh = [] __device__(const ndGridHash & item) - { - return item.m_xHigh; - }; - - auto GetRadix_zLow = [] __device__(const ndGridHash& item) - { - return item.m_zLow; - }; - - auto GetRadix_zHigh = [] __device__(const ndGridHash & item) - { - return item.m_zHigh; - }; - - ndAssert(0); - ndSortGrids << < 1, 1, 0 >>> (m_imageGpu, GetRadix_xLow, GetRadix_xHigh, GetRadix_zLow, GetRadix_zHigh); - - //ndAssert(TraceHashes()); -#endif -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSphFluid.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSphFluid.h deleted file mode 100644 index 2748aec8fc..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaSphFluid.h +++ /dev/null @@ -1,246 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_SPH_FLUID_H__ -#define __ND_CUDA_SPH_FLUID_H__ - -#include "ndCudaUtils.h" -#include "ndCudaStdafx.h" -#include "ndCudaVector.h" -#include "ndCudaDevice.h" -#include "ndCudaDeviceBuffer.h" - -class ndCudaContext; -class ndBodySphFluid; - -#define D_SPH_CUDA_HASH_BITS 8 - - -class ndSphFluidInitInfo -{ - public: - ndCudaContext* m_context; - ndBodySphFluid* m_owner; - float m_gridSize; -}; - -class ndSphFluidAabb -{ - public: - ndCudaVector m_min; - ndCudaVector m_max; -}; - -class ndCudaSphFluid -{ - public: - D_CUDA_OPERATOR_NEW_AND_DELETE; - - enum ndGridType - { - ndAdjacentGrid = 0, - ndHomeGrid = 1, - }; - - class ndGridHash - { - public: - ndGridHash() - { - } - - __device__ __host__ ndGridHash(uint64_t gridHash) - :m_gridHash(gridHash) - { - } - - ndGridHash(int x, int z) - { - m_gridHash = 0; - m_x = uint64_t (x); - m_z = uint64_t (z); - } - - __device__ __host__ ndGridHash(const ndCudaVector& grid, int particleIndex) - { - //ndCudaVector hash(grid.GetInt()); - unsigned hash_x = unsigned(floor(grid.x)); - unsigned hash_z = unsigned(floor(grid.z)); - - m_gridHash = 0; - m_x = uint64_t (hash_x); - m_z = uint64_t (hash_z); - m_cellType = ndAdjacentGrid; - m_particleIndex = uint64_t (particleIndex); - } - - union - { - struct - { - uint64_t m_x : D_SPH_CUDA_HASH_BITS * 2; - uint64_t m_z : D_SPH_CUDA_HASH_BITS * 2; - uint64_t m_particleIndex : 23; - uint64_t m_cellType : 1; - }; - struct - { - uint64_t m_xLow : D_SPH_CUDA_HASH_BITS; - uint64_t m_xHigh : D_SPH_CUDA_HASH_BITS; - uint64_t m_zLow : D_SPH_CUDA_HASH_BITS; - uint64_t m_zHigh : D_SPH_CUDA_HASH_BITS; - }; - uint64_t m_gridHash : D_SPH_CUDA_HASH_BITS * 2 * 2; - }; - }; - - class ndGridNeighborInfo - { - public: - ndGridNeighborInfo() - { - //ndGridHash stepsCode; - m_neighborDirs[0][0] = ndGridHash(0, 0); - m_neighborDirs[0][1] = ndGridHash(0, 0); - m_neighborDirs[0][2] = ndGridHash(0, 0); - m_neighborDirs[0][3] = ndGridHash(0, 0); - - m_counter[0] = 1; - m_isPadd[0][0] = 0; - m_isPadd[0][1] = 1; - m_isPadd[0][2] = 1; - m_isPadd[0][3] = 1; - - //ndGridHash stepsCode_y; - m_neighborDirs[1][0] = ndGridHash(0, 0); - m_neighborDirs[1][1] = ndGridHash(1, 0); - m_neighborDirs[1][2] = ndGridHash(0, 0); - m_neighborDirs[1][3] = ndGridHash(0, 0); - - m_counter[1] = 2; - m_isPadd[1][0] = 0; - m_isPadd[1][1] = 0; - m_isPadd[1][2] = 1; - m_isPadd[1][3] = 1; - - //ndGridHash stepsCode_z; - m_neighborDirs[2][0] = ndGridHash(0, 0); - m_neighborDirs[2][1] = ndGridHash(0, 1); - m_neighborDirs[2][2] = ndGridHash(0, 0); - m_neighborDirs[2][3] = ndGridHash(0, 0); - - m_counter[2] = 2; - m_isPadd[2][0] = 0; - m_isPadd[2][1] = 0; - m_isPadd[2][2] = 1; - m_isPadd[2][3] = 1; - - //ndGridHash stepsCode_yz; - m_neighborDirs[3][0] = ndGridHash(0, 0); - m_neighborDirs[3][1] = ndGridHash(1, 0); - m_neighborDirs[3][2] = ndGridHash(0, 1); - m_neighborDirs[3][3] = ndGridHash(1, 1); - - m_counter[3] = 4; - m_isPadd[3][0] = 0; - m_isPadd[3][1] = 0; - m_isPadd[3][2] = 0; - m_isPadd[3][3] = 0; - } - - ndGridHash m_neighborDirs[4][4]; - unsigned char m_isPadd[4][4]; - unsigned char m_counter[4]; - }; - - class Image: public ndSphFluidInitInfo - { - public: - - enum ndError - { - m_noError, - m_gridsOverFlow, - }; - - Image(const ndSphFluidInitInfo& info); - ~Image(); - void Init(ndCudaSphFluid& fluid); - - ndKernelParams m_param; - ndAssessor m_gridScans; - ndAssessor m_points; - ndAssessor m_hashGridMap; - ndAssessor m_hashGridMapTemp; - ndAssessor m_pointsAabb; - - ndAssessor m_sortHashGridMap0; - ndAssessor m_sortHashGridMap1; - - ndSphFluidAabb m_aabb; - ndGridNeighborInfo m_neighborgInfo; - - int* m_errorCode; - int m_gridSizeX; - int m_gridSizeY; - int m_gridSizeZ; - int m_activeHashGridMapSize; - - ndError m_error; - cudaStream_t m_childStream; - }; - - D_CUDA_API ndCudaSphFluid(const ndSphFluidInitInfo& info); - D_CUDA_API ~ndCudaSphFluid(); - - ndBodySphFluid* GetOwner(); - - D_CUDA_API void MemCpy(const float* const src, int strideInItems, int items); - D_CUDA_API void MemCpy(const double* const src, int strideInItems, int items); - - D_CUDA_API void GetPositions(float* const dst, int strideInItems, int items); - D_CUDA_API void GetPositions(double* const dst, int strideInItems, int items); - - D_CUDA_API void Update(float timestep); - - void InitBuffers(); - void HandleErrors(); - void CaculateAabb(); - void CreateGrids(); - void SortGrids(); - - bool TraceHashes(); - - Image m_imageCpu; - Image* m_imageGpu; - - ndErrorCode m_errorCode; - ndCudaDeviceBuffer m_points; - ndCudaDeviceBuffer m_hashGridMap; - ndCudaDeviceBuffer m_hashGridMapTemp; - ndCudaDeviceBuffer m_pointsAabb; -}; - -inline ndBodySphFluid* ndCudaSphFluid::GetOwner() -{ - return m_imageCpu.m_owner; -} -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaStdafx.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaStdafx.cpp deleted file mode 100644 index 5eefe53ea2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaStdafx.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCudaStdafx.h" - -#if (defined(WIN32) || defined(_WIN32)) - BOOL APIENTRY DllMain(HMODULE, DWORD, LPVOID ) - { - return TRUE; - } -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaStdafx.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaStdafx.h deleted file mode 100644 index ddb7832a8d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaStdafx.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_STDAFX_H__ -#define __ND_CUDA_STDAFX_H__ - -#if (defined (WIN32) || defined(_WIN32) || defined (_M_ARM) || defined (_M_ARM64)) - #include - #include - #include - #include - #include - #include - #include - - #pragma warning (push, 3) - #include - #include - #pragma warning (pop) -#else - #include -#endif - -#ifdef _D_CUDA_EXPORT_DLL - #define D_CUDA_API __declspec(dllexport) -#else - #define D_CUDA_API __declspec(dllimport) -#endif - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaTypes.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaTypes.h deleted file mode 100644 index 8fd709b98e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaTypes.h +++ /dev/null @@ -1,103 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_TYPES_H__ -#define __ND_CUDA_TYPES_H__ - -#include -#include -#include - -#include "ndCudaVector.h" -#include "ndCudaDeviceBuffer.h" - -class ndCudaBoundingBox -{ - public: - ndCudaVector m_min; - ndCudaVector m_max; -}; - -class ndCudaSpatialVector -{ - public: - ndCudaVector m_linear; - ndCudaVector m_angular; -}; - -class ndCudaSceneNode -{ - public: - ndCudaBoundingBox m_box; - float m_nodeArea; - int m_bodyIndex; -}; - - -// maybe to be removed -#define D_AABB_GRID_CELL_BITS 10 -class ndCudaBodyAabbCell -{ - public: - union - { - struct - { - union - { - struct - { - unsigned m_x : D_AABB_GRID_CELL_BITS; - unsigned m_y : D_AABB_GRID_CELL_BITS; - unsigned m_z : D_AABB_GRID_CELL_BITS; - }; - unsigned m_key; - }; - unsigned m_id; - }; - long long m_value; - }; -}; - -template -class ndCudaBuffer -{ - public: - ndCudaBuffer() - :m_array(nullptr) - ,m_size(0) - ,m_capacity(0) - { - } - - ndCudaBuffer(const ndCudaDeviceBuffer& src) - :m_array((T*)&src[0]) - ,m_size(src.GetCount()) - ,m_capacity(src.GetCapacity()) - { - } - - T* m_array; - unsigned m_size; - unsigned m_capacity; -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaUtils.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaUtils.cpp deleted file mode 100644 index 6964350f9e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaUtils.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - - -#include "ndCudaStdafx.h" -#include "ndCudaUtils.h" - -static ndMemFreeCallback g_free = free; -static ndMemAllocCallback g_alloc = malloc; - -void* ndCudaMalloc(size_t size) -{ - return g_alloc(size); -} - -void ndCudaFree(void* const ptr) -{ - g_free(ptr); -} - -void CudaSetMemoryAllocators(ndMemAllocCallback alloc, ndMemFreeCallback free) -{ - g_alloc = alloc; - g_free = free; -} - -void* operator new (size_t size) -{ - ndAssert(0); - return g_alloc(size); -} - -void operator delete (void* ptr) -{ - ndAssert(0); - g_free(ptr); -} - -void cudaExpandTraceMessage(const char* const fmt, ...) -{ - va_list v_args; - char text[4096]; - - text[0] = 0; - va_start(v_args, fmt); - vsprintf(text, fmt, v_args); - va_end(v_args); - - #if (defined(WIN32) || defined(_WIN32)) - OutputDebugStringA(text); - #else - printf("%s\n", text); - #endif -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaUtils.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaUtils.h deleted file mode 100644 index 807b4a6106..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaUtils.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_UTILS_H__ -#define __ND_CUDA_UTILS_H__ - -#include "ndCudaStdafx.h" - -#ifdef D_DISABLE_ASSERT - #define ndAssert(x) -#else - #ifdef _DEBUG - #if (defined (WIN32) || defined(_WIN32) || defined (_M_ARM) || defined (_M_ARM64)) - #define ndAssert(x) _ASSERTE(x) - #else - #define ndAssert(x) assert(x) - #endif - #else - #define ndAssert(x) - #endif -#endif - -#ifdef _MSC_VER - #ifdef _DEBUG - #define CUDA_TRACE - #endif -#endif - -void cudaExpandTraceMessage(const char* const fmt, ...); - -#ifdef CUDA_TRACE - #define cuTrace(x) cudaExpandTraceMessage x; -#else - #define cuTrace(x); -#endif - -typedef void* (*ndMemAllocCallback) (size_t size); -typedef void (*ndMemFreeCallback) (void* const ptr); - -D_CUDA_API void* ndCudaMalloc(size_t size); -D_CUDA_API void ndCudaFree(void* const ptr); - -#define ndAlloca(type, count) (type*) alloca (sizeof (type) * (count)) - -#define D_CUDA_OPERATOR_NEW_AND_DELETE \ -inline void *operator new (size_t size) \ -{ \ - return ndCudaMalloc(size); \ -} \ - \ -inline void *operator new[](size_t size) \ -{ \ - return ndCudaMalloc(size); \ -} \ - \ -inline void operator delete (void* ptr) \ -{ \ - ndCudaFree(ptr); \ -} \ - \ -inline void operator delete[](void* ptr) \ -{ \ - ndCudaFree(ptr); \ -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaVector.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaVector.h deleted file mode 100644 index 8852db72dc..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/dContext/ndCudaVector.h +++ /dev/null @@ -1,173 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CUDA_VECTOR_H__ -#define __ND_CUDA_VECTOR_H__ - -#include -#include -#include -#include "ndCudaIntrinsics.h" - -class ndCudaVector: public float4 -{ - public: - inline __device__ __host__ ndCudaVector() - { - } - - inline __device__ __host__ ndCudaVector(float val) - { - x = val; - y = val; - z = val; - w = val; - } - - inline __device__ __host__ ndCudaVector(float val_x, float val_y, float val_z, float val_w) - { - x = val_x; - y = val_y; - z = val_z; - w = val_w; - } - - inline __device__ __host__ ndCudaVector(const ndCudaVector& src) - { - x = src.x; - y = src.y; - z = src.z; - w = src.w; - } - - //inline ndCudaVector(const ndVector& src) - //{ - // x = src.m_x; - // y = src.m_y; - // z = src.m_z; - // w = src.m_w; - //} - // - //inline ndVector ToNdVector(const ndCudaVector& src) const - //{ - // return ndVector(src.x, src.y, src.z, src.w); - //} - - inline float __device__ __host__ GetElement(int i) const - { - return (&this->x)[i]; - } - - inline void __device__ __host__ SetElement(int i, float val) - { - (&this->x)[i] = val; - } - - inline ndCudaVector __device__ __host__ operator+ (const ndCudaVector& A) const - { - return ndCudaVector(x + A.x, y + A.y, z + A.z, w + A.w); - } - - inline ndCudaVector __device__ __host__ operator- (const ndCudaVector& A) const - { - return ndCudaVector(x - A.x, y - A.y, z - A.z, w - A.w); - } - - inline ndCudaVector __device__ __host__ operator* (const ndCudaVector& A) const - { - return ndCudaVector(x * A.x, y * A.y, z * A.z, w * A.w); - } - - inline ndCudaVector __device__ __host__ operator> (const ndCudaVector& A) const - { - return ndCudaVector( - cuSelect(x > A.x, 1.0f, 0.0f), - cuSelect(y > A.y, 1.0f, 0.0f), - cuSelect(z > A.z, 1.0f, 0.0f), - cuSelect(w > A.w, 1.0f, 0.0f)); - } - - inline ndCudaVector __device__ __host__ operator< (const ndCudaVector& A) const - { - return ndCudaVector( - cuSelect(x < A.x, 1.0f, 0.0f), - cuSelect(y < A.y, 1.0f, 0.0f), - cuSelect(z < A.z, 1.0f, 0.0f), - cuSelect(w < A.w, 1.0f, 0.0f)); - } - - inline ndCudaVector __device__ __host__ Abs() const - { - return ndCudaVector(cuAbs(x), cuAbs(y), cuAbs(z), cuAbs(w)); - } - - inline ndCudaVector __device__ __host__ Select(const ndCudaVector& test, const ndCudaVector& A) const - { - return ndCudaVector(*this * test + A * (ndCudaVector(1.0f) - test)); - } - - inline ndCudaVector __device__ __host__ Min (const ndCudaVector& A) const - { - return ndCudaVector(cuMin(x, A.x), cuMin(y, A.y), cuMin(z, A.z), cuMin(w, A.w)); - } - - inline ndCudaVector __device__ __host__ Max(const ndCudaVector& A) const - { - return ndCudaVector(cuMax(x, A.x), cuMax(y, A.y), cuMax(z, A.z), cuMax(w, A.w)); - } - - inline ndCudaVector __device__ __host__ Floor() const - { - return ndCudaVector(cuFloor(x), cuFloor(y), cuFloor(z), cuFloor(w)); - } - - inline ndCudaVector __device__ __host__ Scale(float s) const - { - return ndCudaVector(x * s, y * s, z * s, w * s); - } - - inline float __device__ __host__ AddHorizontal() const - { - return x + y + z + w; - } - - inline float __device__ __host__ DotProduct(const ndCudaVector& B) const - { - return (*this * B).AddHorizontal(); - } - - inline ndCudaVector __device__ __host__ CrossProduct(const ndCudaVector& B) const - { - return ndCudaVector( - y * B.z - z * B.y, - z * B.x - x * B.z, - x * B.y - y * B.x, - w); - } - - inline ndCudaVector __device__ __host__ Normalize() const - { - float den = 1.0f / sqrtf(DotProduct(*this)); - return ndCudaVector(x * den, y * den, z * den, w * den); - } -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndDynamicsUpdateCuda.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndDynamicsUpdateCuda.cpp deleted file mode 100644 index 07fa1dec59..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndDynamicsUpdateCuda.cpp +++ /dev/null @@ -1,1527 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndModel.h" -#include "ndConstraint.h" -#include "ndWorldScene.h" -#include "ndBodyDynamic.h" -#include "ndSkeletonList.h" -#include "ndDynamicsUpdate.h" -#include "ndWorldSceneCuda.h" -#include "ndDynamicsUpdateCuda.h" -#include "ndJointBilateralConstraint.h" - -//#include "cuQuat.h" -//#include "cuVector.h" -//#include "cuMatrix3x3.h" -//#include "cuSolverTypes.h" -//#include "ndCudaContext.h" - - - -#if 0 -template -__global__ void CudaIntegrateBodies(Predicate IntegrateVelocity, cuSceneInfo& info, float timestep) -{ - int index = threadIdx.x + blockDim.x * blockIdx.x; - if (info.m_frameIsValid & (index < (info.m_bodyArray.m_size - 1))) - { - cuBodyProxy* bodyArray = info.m_bodyArray.m_array; - IntegrateVelocity(bodyArray[index], timestep); - } -} -#endif - - -#if 0 - -//void ndDynamicsUpdateCuda::Clear() -//{ -// m_islands.Resize(D_DEFAULT_BUFFER_SIZE); -// m_rightHandSide.Resize(D_DEFAULT_BUFFER_SIZE); -// m_internalForces.Resize(D_DEFAULT_BUFFER_SIZE); -// m_bodyIslandOrder.Resize(D_DEFAULT_BUFFER_SIZE); -// m_leftHandSide.Resize(D_DEFAULT_BUFFER_SIZE * 4); -// m_tempInternalForces.Resize(D_DEFAULT_BUFFER_SIZE); -// m_jointForcesIndex.Resize(D_DEFAULT_BUFFER_SIZE); -// m_jointBodyPairIndexBuffer.Resize(D_DEFAULT_BUFFER_SIZE); -//} - -//void ndDynamicsUpdateCuda::SortBodyJointScan() -//{ -// D_TRACKTIME(); -// class ndEvaluateKey -// { -// public: -// ndEvaluateKey(void* const context) -// { -// ndInt32 digit = *((ndInt32*)context); -// m_shift = digit * D_MAX_BODY_RADIX_BIT; -// } -// -// ndUnsigned32 GetKey(const ndDynamicsUpdateCuda::ndJointBodyPairIndex& entry) const -// { -// ndUnsigned32 key = entry.m_body >> m_shift; -// return key & ((1 << D_MAX_BODY_RADIX_BIT) - 1); -// } -// ndUnsigned32 m_shift; -// }; -// -// ndScene* const scene = m_world->GetScene(); -// ndArray& jointArray = scene->GetActiveContactArray(); -// ndArray& bodyJointPairs = GetJointBodyPairIndexBuffer(); -// -// bodyJointPairs.SetCount(jointArray.GetCount() * 2); -// GetTempInternalForces().SetCount(jointArray.GetCount() * 2); -// -// auto CountJointBodyPairs = ndMakeObject::ndFunction([this, &jointArray](ndInt32 threadIndex, ndInt32 threadCount) -// { -// D_TRACKTIME(); -// ndJointBodyPairIndex* const jointBodyBuffer = &GetJointBodyPairIndexBuffer()[0]; -// -// const ndStartEnd startEnd(jointArray.GetCount(), threadIndex, threadCount); -// for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) -// { -// const ndInt32 index = i; -// const ndConstraint* const joint = jointArray[index]; -// const ndBodyKinematic* const body0 = joint->GetBody0(); -// const ndBodyKinematic* const body1 = joint->GetBody1(); -// -// const ndInt32 m0 = body0->m_index; -// const ndInt32 m1 = body1->m_index; -// jointBodyBuffer[index * 2 + 0].m_body = m0; -// jointBodyBuffer[index * 2 + 0].m_joint = index * 2 + 0; -// jointBodyBuffer[index * 2 + 1].m_body = m1; -// jointBodyBuffer[index * 2 + 1].m_joint = index * 2 + 1; -// } -// }); -// scene->ParallelExecute(CountJointBodyPairs); -// -// ndJointBodyPairIndex* const tempBuffer = (ndJointBodyPairIndex*)GetTempBuffer(); -// -// ndInt32 digit = 0; -// ndCountingSort(*scene, &bodyJointPairs[0], tempBuffer, bodyJointPairs.GetCount(), &digit); -// -// digit = 1; -// ndCountingSort(*scene, tempBuffer, &bodyJointPairs[0], bodyJointPairs.GetCount(), &digit); -// -// bodyJointPairs.SetCount(bodyJointPairs.GetCount() + 1); -// bodyJointPairs[bodyJointPairs.GetCount() - 1] = bodyJointPairs[bodyJointPairs.GetCount() - 2]; -// -// ndArray& bodyJointIndex = GetJointForceIndexBuffer(); -// const ndInt32 bodyJointIndexCount = scene->GetActiveBodyArray().GetCount() + 1; -// bodyJointIndex.SetCount(bodyJointIndexCount); -// ClearBuffer(&bodyJointIndex[0], bodyJointIndexCount * sizeof(ndInt32)); -// -// for (ndInt32 i = 0; i < jointArray.GetCount(); ++i) -// { -// const ndConstraint* const joint = jointArray[i]; -// const ndBodyKinematic* const body0 = joint->GetBody0(); -// const ndBodyKinematic* const body1 = joint->GetBody1(); -// const ndInt32 m0 = body0->m_index; -// const ndInt32 m1 = body1->m_index; -// bodyJointIndex[m0] ++; -// bodyJointIndex[m1] ++; -// } -// -// ndInt32 bodyJointIndexAcc = 0; -// for (ndInt32 i = 0; i < bodyJointIndexCount; ++i) -// { -// ndInt32 count = bodyJointIndex[i]; -// bodyJointIndex[i] = bodyJointIndexAcc; -// bodyJointIndexAcc += count; -// } -// -//#ifdef _DEBUG -// const ndArray& jointBodyPairIndexBuffer = GetJointBodyPairIndexBuffer(); -// for (ndInt32 i = 0; i < scene->GetActiveBodyArray().GetCount(); ++i) -// { -// ndInt32 startIndex = bodyJointIndex[i]; -// ndInt32 count = bodyJointIndex[i + 1] - startIndex; -// for (ndInt32 j = 0; j < count; ++j) -// { -// ndInt32 bodyIndex = jointBodyPairIndexBuffer[startIndex + j].m_body; -// ndAssert(bodyIndex == i); -// } -// } -//#endif -//} - -//void ndDynamicsUpdateCuda::SortJointsScan() -//{ -// D_TRACKTIME(); -// class ndEvaluateCountRows -// { -// public: -// class ndSortKey -// { -// public: -// ndSortKey(ndInt32 sleep, ndInt32 rows) -// :m_value(0) -// { -// ndAssert(rows > 0); -// m_upperBit = sleep; -// m_lowerBit = (1 << 6) - rows - 1; -// } -// -// union -// { -// ndInt32 m_value; -// struct -// { -// ndUnsigned32 m_lowerBit : 6; -// ndUnsigned32 m_upperBit : 1; -// }; -// }; -// }; -// -// ndEvaluateCountRows(void* const) {} -// ndUnsigned32 GetKey(const ndConstraint* const joint) const -// { -// const ndSortKey key(joint->m_resting, joint->m_rowCount); -// return key.m_value; -// } -// }; -// -// ndScene* const scene = m_world->GetScene(); -// -// for (ndSkeletonList::ndNode* node = m_world->GetSkeletonList().GetFirst(); node; node = node->GetNext()) -// { -// ndSkeletonContainer* const skeleton = &node->GetInfo(); -// skeleton->CheckSleepState(); -// } -// -// const ndJointList& jointList = m_world->GetJointList(); -// ndArray& jointArray = scene->GetActiveContactArray(); -// -// ndInt32 jointCount = jointArray.GetCount(); -// jointArray.SetCount(jointCount + jointList.GetCount()); -// -// for (ndJointList::ndNode* node = jointList.GetFirst(); node; node = node->GetNext()) -// { -// ndJointBilateralConstraint* const joint = node->GetInfo(); -// if (joint->IsActive()) -// { -// jointArray[jointCount] = joint; -// jointCount++; -// } -// } -// jointArray.SetCount(jointCount); -// -// m_leftHandSide.SetCount(jointArray.GetCount() + 32); -// -// ndInt32 histogram[D_MAX_THREADS_COUNT][2]; -// ndInt32 movingJoints[D_MAX_THREADS_COUNT]; -// const ndInt32 threadCount = scene->GetThreadCount(); -// -// auto MarkFence0 = ndMakeObject::ndFunction([this, &jointArray](ndInt32 threadIndex, ndInt32 threadCount) -// { -// D_TRACKTIME(); -// const ndStartEnd startEnd(jointArray.GetCount(), threadIndex, threadCount); -// for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) -// { -// ndConstraint* const joint = jointArray[i]; -// ndBodyKinematic* const body0 = joint->GetBody0(); -// ndBodyKinematic* const body1 = joint->GetBody1(); -// const ndInt32 rows = joint->GetRowsCount(); -// joint->m_rowCount = rows; -// -// const ndInt32 equilibrium = body0->m_equilibrium & body1->m_equilibrium; -// if (!equilibrium) -// { -// body0->m_isJointFence0 = 0; -// body1->m_isJointFence0 = body1->m_isStatic; -// ndAssert((body1->m_invMass.m_w == ndFloat32(0.0f)) == body1->m_isStatic); -// } -// -// body0->m_isConstrained = 1; -// body0->m_equilibrium0 = body0->m_equilibrium0 & equilibrium; -// if (!body1->m_isStatic) -// { -// body1->m_isConstrained = 1; -// body1->m_equilibrium0 = body1->m_equilibrium0 & equilibrium; -// } -// } -// }); -// -// auto MarkFence1 = ndMakeObject::ndFunction([this, &jointArray, &movingJoints](ndInt32 threadIndex, ndInt32 threadCount) -// { -// D_TRACKTIME(); -// ndInt32 activeJointCount = 0; -// const ndStartEnd startEnd(jointArray.GetCount(), threadIndex, threadCount); -// for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) -// { -// ndConstraint* const joint = jointArray[i]; -// ndBodyKinematic* const body0 = joint->GetBody0(); -// ndBodyKinematic* const body1 = joint->GetBody1(); -// -// const ndInt8 resting = body0->m_equilibrium0 & body1->m_equilibrium0; -// activeJointCount += (1 - resting); -// joint->m_resting = resting; -// -// const ndInt32 solverSleep0 = body0->m_isJointFence0 & body1->m_isJointFence0; -// if (!solverSleep0) -// { -// body0->m_isJointFence1 = 0; -// body1->m_isJointFence1 = body1->m_isStatic; -// ndAssert((body1->m_invMass.m_w == ndFloat32(0.0f)) == body1->m_isStatic); -// } -// } -// movingJoints[threadIndex] = activeJointCount; -// }); -// -// auto Scan0 = ndMakeObject::ndFunction([this, &jointArray, &histogram](ndInt32 threadIndex, ndInt32 threadCount) -// { -// D_TRACKTIME(); -// ndInt32* const hist = &histogram[threadIndex][0]; -// ndConstraint** const dstBuffer = (ndConstraint**)GetTempBuffer(); -// -// hist[0] = 0; -// hist[1] = 0; -// const ndStartEnd startEnd(jointArray.GetCount(), threadIndex, threadCount); -// for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) -// { -// ndConstraint* const joint = jointArray[i]; -// ndBodyKinematic* const body0 = joint->GetBody0(); -// ndBodyKinematic* const body1 = joint->GetBody1(); -// const ndInt32 key = body0->m_isJointFence1 & body1->m_isJointFence1; -// const ndInt32 entry = hist[key]; -// dstBuffer[entry] = joint; -// hist[key] = entry + 1; -// } -// }); -// -// auto Sort0 = ndMakeObject::ndFunction([this, &jointArray, &histogram](ndInt32 threadIndex, ndInt32 threadCount) -// { -// D_TRACKTIME(); -// ndInt32* const hist = &histogram[threadIndex][0]; -// ndConstraint** const dstBuffer = (ndConstraint**)GetTempBuffer(); -// -// const ndStartEnd startEnd(jointArray.GetCount(), threadIndex, threadCount); -// for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) -// { -// ndConstraint* const joint = jointArray[i]; -// ndBodyKinematic* const body0 = joint->GetBody0(); -// ndBodyKinematic* const body1 = joint->GetBody1(); -// const ndInt32 key = body0->m_isJointFence1 & body1->m_isJointFence1; -// const ndInt32 entry = hist[key]; -// dstBuffer[entry] = joint; -// hist[key] = entry + 1; -// } -// }); -// -// scene->ParallelExecute(MarkFence0); -// scene->ParallelExecute(MarkFence1); -// scene->ParallelExecute(Scan0); -// -// ndInt32 scan[2]; -// scan[0] = 0; -// scan[1] = 0; -// ndInt32 movingJointCount = 0; -// for (ndInt32 i = 0; i < threadCount; ++i) -// { -// scan[0] += histogram[i][0]; -// scan[1] += histogram[i][1]; -// movingJointCount += movingJoints[i]; -// } -// -// m_activeJointCount = scan[0]; -// ndAssert(m_activeJointCount <= jointArray.GetCount()); -// if (!m_activeJointCount) -// { -// jointArray.SetCount(0); -// return; -// } -// -// ndInt32 sum = 0; -// for (ndInt32 i = 0; i < 2; ++i) -// { -// for (ndInt32 j = 0; j < threadCount; ++j) -// { -// ndInt32 partialSum = histogram[j][i]; -// histogram[j][i] = sum; -// sum += partialSum; -// } -// } -// -// scene->ParallelExecute(Sort0); -// ndConstraint** const tempJointBuffer = (ndConstraint**)GetTempBuffer(); -// -//#ifdef _DEBUG -// for (ndInt32 i = 0; i < (jointArray.GetCount() - 1); ++i) -// { -// const ndConstraint* const joint0 = tempJointBuffer[i]; -// const ndConstraint* const joint1 = tempJointBuffer[i + 1]; -// const ndInt32 key0 = (joint0->GetBody0()->m_isJointFence1 & joint0->GetBody1()->m_isJointFence1) ? 1 : 0; -// const ndInt32 key1 = (joint1->GetBody0()->m_isJointFence1 & joint1->GetBody1()->m_isJointFence1) ? 1 : 0; -// ndAssert(key0 <= key1); -// } -//#endif -// -// ndAssert(m_activeJointCount <= jointArray.GetCount()); -// jointArray.SetCount(m_activeJointCount); - -// m_activeJointCount = movingJointCount; -// GetTempInternalForces().SetCount(jointArray.GetCount() * 2); -// GetJointBodyPairIndexBuffer().SetCount(jointArray.GetCount() * 2); -// ndCountingSort(*scene, tempJointBuffer, &jointArray[0], jointArray.GetCount()); -//} - -void ndDynamicsUpdateCuda::SortJoints() -{ - D_TRACKTIME(); - - SortJointsScan(); - if (!m_activeJointCount) - { - return; - } - - ndScene* const scene = m_world->GetScene(); - ndArray& jointArray = scene->GetActiveContactArray(); - - ndInt32 rowCount = 1; - for (ndInt32 i = 0; i < jointArray.GetCount(); ++i) - { - ndConstraint* const joint = jointArray[i]; - joint->m_rowStart = rowCount; - rowCount += joint->m_rowCount; - } - - m_leftHandSide.SetCount(rowCount); - m_rightHandSide.SetCount(rowCount); - -#ifdef _DEBUG - ndAssert(m_activeJointCount <= jointArray.GetCount()); - for (ndInt32 i = 0; i < jointArray.GetCount(); ++i) - { - ndConstraint* const joint = jointArray[i]; - ndAssert(joint->m_rowStart < m_leftHandSide.GetCount()); - ndAssert((joint->m_rowStart + joint->m_rowCount) <= rowCount); - } - - for (ndInt32 i = 1; i < m_activeJointCount; ++i) - { - ndConstraint* const joint0 = jointArray[i - 1]; - ndConstraint* const joint1 = jointArray[i - 0]; - ndAssert(!joint0->m_resting); - ndAssert(!joint1->m_resting); - ndAssert(joint0->m_rowCount >= joint1->m_rowCount); - ndAssert(!(joint0->GetBody0()->m_equilibrium0 & joint0->GetBody1()->m_equilibrium0)); - ndAssert(!(joint1->GetBody0()->m_equilibrium0 & joint1->GetBody1()->m_equilibrium0)); - } - - for (ndInt32 i = m_activeJointCount + 1; i < jointArray.GetCount(); ++i) - { - ndConstraint* const joint0 = jointArray[i - 1]; - ndConstraint* const joint1 = jointArray[i - 0]; - ndAssert(joint0->m_resting); - ndAssert(joint1->m_resting); - ndAssert(joint0->m_rowCount >= joint1->m_rowCount); - ndAssert(joint0->GetBody0()->m_equilibrium0 & joint0->GetBody1()->m_equilibrium0); - ndAssert(joint1->GetBody0()->m_equilibrium0 & joint1->GetBody1()->m_equilibrium0); - } -#endif - - SortBodyJointScan(); -} - -void ndDynamicsUpdateCuda::SortIslands() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyArray = scene->GetActiveBodyArray(); - ndArray& activeBodyArray = GetBodyIslandOrder(); - GetInternalForces().SetCount(bodyArray.GetCount()); - activeBodyArray.SetCount(bodyArray.GetCount()); - - ndInt32 histogram[D_MAX_THREADS_COUNT][3]; - auto Scan0 = ndMakeObject::ndFunction([this, &bodyArray, &histogram](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - ndInt32* const hist = &histogram[threadIndex][0]; - hist[0] = 0; - hist[1] = 0; - hist[2] = 0; - - ndInt32 map[4]; - map[0] = 0; - map[1] = 1; - map[2] = 2; - map[3] = 2; - const ndStartEnd startEnd(bodyArray.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndBodyKinematic* const body = bodyArray[i]; - ndInt32 key = map[body->m_equilibrium0 * 2 + 1 - body->m_isConstrained]; - ndAssert(key < 3); - hist[key] = hist[key] + 1; - } - }); - - auto Sort0 = ndMakeObject::ndFunction([this, &bodyArray, &activeBodyArray, &histogram](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - ndInt32* const hist = &histogram[threadIndex][0]; - const ndStartEnd startEnd(bodyArray.GetCount(), threadIndex, threadCount); - - ndInt32 map[4]; - map[0] = 0; - map[1] = 1; - map[2] = 2; - map[3] = 2; - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndBodyKinematic* const body = bodyArray[i]; - ndInt32 key = map[body->m_equilibrium0 * 2 + 1 - body->m_isConstrained]; - ndAssert(key < 3); - const ndInt32 entry = hist[key]; - activeBodyArray[entry] = body; - hist[key] = entry + 1; - } - }); - - scene->ParallelExecute(Scan0); - - ndInt32 scan[3]; - scan[0] = 0; - scan[1] = 0; - scan[2] = 0; - const ndInt32 threadCount = scene->GetThreadCount(); - - ndInt32 sum = 0; - for (ndInt32 i = 0; i < 3; ++i) - { - for (ndInt32 j = 0; j < threadCount; ++j) - { - ndInt32 partialSum = histogram[j][i]; - histogram[j][i] = sum; - sum += partialSum; - } - scan[i] = sum; - } - - scene->ParallelExecute(Sort0); - activeBodyArray.SetCount(scan[1]); - m_unConstrainedBodyCount = scan[1] - scan[0]; -} - -void ndDynamicsUpdateCuda::BuildIsland() -{ - m_unConstrainedBodyCount = 0; - GetBodyIslandOrder().SetCount(0); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyArray = scene->GetActiveBodyArray(); - ndAssert(bodyArray.GetCount() >= 1); - if (bodyArray.GetCount() - 1) - { - D_TRACKTIME(); - SortJoints(); - SortIslands(); - } -} - - -void ndDynamicsUpdateCuda::IntegrateUnconstrainedBodies() -{ - //ndAssert(0); - //ndScene* const scene = m_world->GetScene(); - //auto IntegrateUnconstrainedBodiesCPU = ndMakeObject::ndFunction([this, &scene](ndInt32 threadIndex, ndInt32 threadCount) - //{ - // D_TRACKTIME(); - // ndArray& bodyArray = GetBodyIslandOrder(); - // - // const ndFloat32 timestep = scene->GetTimestep(); - // const ndInt32 base = bodyArray.GetCount() - GetUnconstrainedBodyCount(); - // - // const ndStartEnd startEnd(GetUnconstrainedBodyCount(), threadIndex, threadCount); - // for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - // { - // ndBodyKinematic* const body = bodyArray[base + i]; - // ndAssert(body); - // body->UpdateInvInertiaMatrix(); - // body->AddDampingAcceleration(timestep); - // body->IntegrateExternalForce(timestep); - // } - //}); - // - //auto IntegrateUnconstrainedBodies = [] __device__(cuBodyProxy& body, float timestep) - //{ - // const cuMatrix3x3 matrix(body.m_rotation.GetMatrix3x3()); - // //cuMatrix3x3 invInertia(body.CalculateInvInertiaMatrix(matrix)); - // body.AddDampingAcceleration(matrix); - // body.IntegrateExternalForce(matrix, timestep); - //}; - - m_context->IntegrateUnconstrainedBodies(m_timestep); -} - -void ndDynamicsUpdateCuda::InitWeights() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - m_invTimestep = ndFloat32(1.0f) / m_timestep; - m_invStepRK = ndFloat32(0.25f); - m_timestepRK = m_timestep * m_invStepRK; - m_invTimestepRK = m_invTimestep * ndFloat32(4.0f); - - const ndArray& bodyArray = scene->GetActiveBodyArray(); - const ndInt32 bodyCount = bodyArray.GetCount(); - GetInternalForces().SetCount(bodyCount); - - ndInt32 extraPassesArray[D_MAX_THREADS_COUNT]; - - auto InitWeights = ndMakeObject::ndFunction([this, &bodyArray, &extraPassesArray](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - const ndArray& jointForceIndexBuffer = GetJointForceIndexBuffer(); - const ndArray& jointBodyPairIndex = GetJointBodyPairIndexBuffer(); - - ndInt32 maxExtraPasses = 1; - const ndStartEnd startEnd(jointForceIndexBuffer.GetCount() - 1, threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndInt32 index = jointForceIndexBuffer[i]; - const ndJointBodyPairIndex& scan = jointBodyPairIndex[index]; - ndBodyKinematic* const body = bodyArray[scan.m_body]; - ndAssert(body->m_index == scan.m_body); - ndAssert(body->m_isConstrained <= 1); - const ndInt32 count = jointForceIndexBuffer[i + 1] - index - 1; - const ndInt32 mask = -ndInt32(body->m_isConstrained & ~body->m_isStatic); - const ndInt32 weigh = 1 + (mask & count); - ndAssert(weigh >= 0); - if (weigh) - { - body->m_weigh = ndFloat32(weigh); - } - maxExtraPasses = ndMax(weigh, maxExtraPasses); - } - extraPassesArray[threadIndex] = maxExtraPasses; - }); - - if (scene->GetActiveContactArray().GetCount()) - { - scene->ParallelExecute(InitWeights); - - ndInt32 extraPasses = 0; - const ndInt32 threadCount = scene->GetThreadCount(); - for (ndInt32 i = 0; i < threadCount; ++i) - { - extraPasses = ndMax(extraPasses, extraPassesArray[i]); - } - - const ndInt32 conectivity = 7; - //m_solverPasses = m_world->GetSolverIterations() + 2 * extraPasses / conectivity + 2; - m_solverPasses = ndUnsigned32(m_world->GetSolverIterations() + 2 * extraPasses / conectivity + 2); - } -} - -void ndDynamicsUpdateCuda::InitBodyArray() -{ - D_TRACKTIME(); - - ndScene* const scene = m_world->GetScene(); - const ndFloat32 timestep = scene->GetTimestep(); - - auto InitBodyArray = ndMakeObject::ndFunction([this, timestep](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - const ndArray& bodyArray = GetBodyIslandOrder(); - const ndStartEnd startEnd(bodyArray.GetCount() - GetUnconstrainedBodyCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndBodyKinematic* const body = bodyArray[i]; - ndAssert(body); - ndAssert(body->m_isConstrained | body->m_isStatic); - - body->UpdateInvInertiaMatrix(); - body->AddDampingAcceleration(timestep); - const ndVector angularMomentum(body->CalculateAngularMomentum()); - body->m_gyroTorque = body->m_omega.CrossProduct(angularMomentum); - body->m_gyroAlpha = body->m_invWorldInertiaMatrix.RotateVector(body->m_gyroTorque); - - body->m_accel = body->m_veloc; - body->m_alpha = body->m_omega; - body->m_gyroRotation = body->m_rotation; - } - }); - scene->ParallelExecute(InitBodyArray); -} - -void ndDynamicsUpdateCuda::GetJacobianDerivatives(ndConstraint* const joint) -{ - ndConstraintDescritor constraintParam; - ndAssert(joint->GetRowsCount() <= D_CONSTRAINT_MAX_ROWS); - for (ndInt32 i = ndInt32(joint->GetRowsCount() - 1); i >= 0; i--) - { - constraintParam.m_forceBounds[i].m_low = D_MIN_BOUND; - constraintParam.m_forceBounds[i].m_upper = D_MAX_BOUND; - constraintParam.m_forceBounds[i].m_jointForce = nullptr; - constraintParam.m_forceBounds[i].m_normalIndex = D_INDEPENDENT_ROW; - } - - constraintParam.m_rowsCount = 0; - constraintParam.m_timestep = m_timestep; - constraintParam.m_invTimestep = m_invTimestep; - joint->JacobianDerivative(constraintParam); - const ndInt32 dof = constraintParam.m_rowsCount; - ndAssert(dof <= joint->m_rowCount); - - if (joint->GetAsContact()) - { - ndContact* const contactJoint = joint->GetAsContact(); - contactJoint->m_isInSkeletonLoop = 0; - ndSkeletonContainer* const skeleton0 = contactJoint->GetBody0()->GetSkeleton(); - ndSkeletonContainer* const skeleton1 = contactJoint->GetBody1()->GetSkeleton(); - if (skeleton0 && (skeleton0 == skeleton1)) - { - if (contactJoint->IsSkeletonSelftCollision()) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(contactJoint); - } - } - //else if (contactJoint->IsSkeletonIntraCollision()) - else - { - if (skeleton0 && !skeleton1) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(contactJoint); - } - else if (skeleton1 && !skeleton0) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton1->AddCloseLoopJoint(contactJoint); - } - } - } - else - { - ndJointBilateralConstraint* const bilareral = joint->GetAsBilateral(); - ndAssert(bilareral); - if (!bilareral->m_isInSkeleton && (bilareral->GetSolverModel() == m_jointkinematicAttachment)) - { - ndSkeletonContainer* const skeleton0 = bilareral->m_body0->GetSkeleton(); - ndSkeletonContainer* const skeleton1 = bilareral->m_body1->GetSkeleton(); - if (skeleton0 || skeleton1) - { - if (skeleton0 && !skeleton1) - { - bilareral->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(bilareral); - } - else if (skeleton1 && !skeleton0) - { - bilareral->m_isInSkeletonLoop = 1; - skeleton1->AddCloseLoopJoint(bilareral); - } - } - } - } - - joint->m_rowCount = dof; - const ndInt32 baseIndex = joint->m_rowStart; - for (ndInt32 i = 0; i < dof; ++i) - { - ndAssert(constraintParam.m_forceBounds[i].m_jointForce); - - ndLeftHandSide* const row = &m_leftHandSide[baseIndex + i]; - ndRightHandSide* const rhs = &m_rightHandSide[baseIndex + i]; - - row->m_Jt = constraintParam.m_jacobian[i]; - rhs->m_diagDamp = ndFloat32(0.0f); - rhs->m_diagonalRegularizer = ndMax(constraintParam.m_diagonalRegularizer[i], ndFloat32(1.0e-5f)); - - rhs->m_coordenateAccel = constraintParam.m_jointAccel[i]; - rhs->m_restitution = constraintParam.m_restitution[i]; - rhs->m_penetration = constraintParam.m_penetration[i]; - rhs->m_penetrationStiffness = constraintParam.m_penetrationStiffness[i]; - rhs->m_lowerBoundFrictionCoefficent = constraintParam.m_forceBounds[i].m_low; - rhs->m_upperBoundFrictionCoefficent = constraintParam.m_forceBounds[i].m_upper; - rhs->m_jointFeebackForce = constraintParam.m_forceBounds[i].m_jointForce; - - ndAssert(constraintParam.m_forceBounds[i].m_normalIndex >= -1); - const ndInt32 frictionIndex = constraintParam.m_forceBounds[i].m_normalIndex; - const ndInt32 mask = frictionIndex >> 31; - rhs->m_normalForceIndex = frictionIndex; - rhs->m_normalForceIndexFlat = ~mask & (frictionIndex + baseIndex); - } -} - -void ndDynamicsUpdateCuda::InitJacobianMatrix() -{ - ndScene* const scene = m_world->GetScene(); - ndBodyKinematic** const bodyArray = &scene->GetActiveBodyArray()[0]; - ndArray& jointArray = scene->GetActiveContactArray(); - - auto InitJacobianMatrix = ndMakeObject::ndFunction([this, &jointArray](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - ndJacobian* const internalForces = &GetTempInternalForces()[0]; - auto BuildJacobianMatrix = [this, &internalForces](ndConstraint* const joint, ndInt32 jointIndex) - { - ndAssert(joint->GetBody0()); - ndAssert(joint->GetBody1()); - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - - const ndVector force0(body0->GetForce()); - const ndVector torque0(body0->GetTorque()); - const ndVector force1(body1->GetForce()); - const ndVector torque1(body1->GetTorque()); - - const ndInt32 index = joint->m_rowStart; - const ndInt32 count = joint->m_rowCount; - const ndMatrix& invInertia0 = body0->m_invWorldInertiaMatrix; - const ndMatrix& invInertia1 = body1->m_invWorldInertiaMatrix; - const ndVector invMass0(body0->m_invMass[3]); - const ndVector invMass1(body1->m_invMass[3]); - - #ifdef D_JOINT_PRECONDITIONER - joint->m_preconditioner0 = ndFloat32(1.0f); - joint->m_preconditioner1 = ndFloat32(1.0f); - - const bool test = !((body0->m_isStatic | body1->m_isStatic) || (body0->GetSkeleton() && body1->GetSkeleton())); - ndAssert(test == ((invMass0.GetScalar() > ndFloat32(0.0f)) && (invMass1.GetScalar() > ndFloat32(0.0f)) && !(body0->GetSkeleton() && body1->GetSkeleton()))); - if (test) - { - const ndFloat32 mass0 = body0->GetMassMatrix().m_w; - const ndFloat32 mass1 = body1->GetMassMatrix().m_w; - if (mass0 > (D_DIAGONAL_PRECONDITIONER * mass1)) - { - joint->m_preconditioner0 = mass0 / (mass1 * D_DIAGONAL_PRECONDITIONER); - } - else if (mass1 > (D_DIAGONAL_PRECONDITIONER * mass0)) - { - joint->m_preconditioner1 = mass1 / (mass0 * D_DIAGONAL_PRECONDITIONER); - } - } - #endif - - const ndVector zero(ndVector::m_zero); - ndVector forceAcc0(zero); - ndVector torqueAcc0(zero); - ndVector forceAcc1(zero); - ndVector torqueAcc1(zero); - - #ifdef D_JOINT_PRECONDITIONER - const ndVector weigh0(body0->m_weigh * joint->m_preconditioner0); - const ndVector weigh1(body1->m_weigh * joint->m_preconditioner1); - - const ndFloat32 preconditioner0 = joint->m_preconditioner0; - const ndFloat32 preconditioner1 = joint->m_preconditioner1; - #else - const ndVector weigh0(body0->m_weigh); - const ndVector weigh1(body1->m_weigh); - #endif - - const bool isBilateral = joint->IsBilateral(); - for (ndInt32 i = 0; i < count; ++i) - { - ndLeftHandSide* const row = &m_leftHandSide[index + i]; - ndRightHandSide* const rhs = &m_rightHandSide[index + i]; - - row->m_JMinv.m_jacobianM0.m_linear = row->m_Jt.m_jacobianM0.m_linear * invMass0; - row->m_JMinv.m_jacobianM0.m_angular = invInertia0.RotateVector(row->m_Jt.m_jacobianM0.m_angular); - row->m_JMinv.m_jacobianM1.m_linear = row->m_Jt.m_jacobianM1.m_linear * invMass1; - row->m_JMinv.m_jacobianM1.m_angular = invInertia1.RotateVector(row->m_Jt.m_jacobianM1.m_angular); - - const ndJacobian& JMinvM0 = row->m_JMinv.m_jacobianM0; - const ndJacobian& JMinvM1 = row->m_JMinv.m_jacobianM1; - const ndVector tmpAccel( - JMinvM0.m_linear * force0 + JMinvM0.m_angular * torque0 + - JMinvM1.m_linear * force1 + JMinvM1.m_angular * torque1); - - const ndFloat32 extenalAcceleration = -tmpAccel.AddHorizontal().GetScalar(); - rhs->m_deltaAccel = extenalAcceleration; - rhs->m_coordenateAccel += extenalAcceleration; - ndAssert(rhs->m_jointFeebackForce); - const ndFloat32 force = rhs->m_jointFeebackForce->GetInitialGuess(); - - rhs->m_force = isBilateral ? ndClamp(force, rhs->m_lowerBoundFrictionCoefficent, rhs->m_upperBoundFrictionCoefficent) : force; - rhs->m_maxImpact = ndFloat32(0.0f); - - const ndJacobian& JtM0 = row->m_Jt.m_jacobianM0; - const ndJacobian& JtM1 = row->m_Jt.m_jacobianM1; - const ndVector tmpDiag( - weigh0 * (JMinvM0.m_linear * JtM0.m_linear + JMinvM0.m_angular * JtM0.m_angular) + - weigh1 * (JMinvM1.m_linear * JtM1.m_linear + JMinvM1.m_angular * JtM1.m_angular)); - - ndFloat32 diag = tmpDiag.AddHorizontal().GetScalar(); - ndAssert(diag > ndFloat32(0.0f)); - rhs->m_diagDamp = diag * rhs->m_diagonalRegularizer; - - diag *= (ndFloat32(1.0f) + rhs->m_diagonalRegularizer); - rhs->m_invJinvMJt = ndFloat32(1.0f) / diag; - - #ifdef D_JOINT_PRECONDITIONER - const ndVector f0(rhs->m_force * preconditioner0); - const ndVector f1(rhs->m_force * preconditioner1); - forceAcc0 = forceAcc0 + JtM0.m_linear * f0; - torqueAcc0 = torqueAcc0 + JtM0.m_angular * f0; - forceAcc1 = forceAcc1 + JtM1.m_linear * f1; - torqueAcc1 = torqueAcc1 + JtM1.m_angular * f1; - #else - const ndVector f(rhs->m_force); - forceAcc0 = forceAcc0 + JtM0.m_linear * f; - torqueAcc0 = torqueAcc0 + JtM0.m_angular * f; - forceAcc1 = forceAcc1 + JtM1.m_linear * f; - torqueAcc1 = torqueAcc1 + JtM1.m_angular * f; - #endif - } - - const ndInt32 index0 = jointIndex * 2 + 0; - ndJacobian& outBody0 = internalForces[index0]; - outBody0.m_linear = forceAcc0; - outBody0.m_angular = torqueAcc0; - - const ndInt32 index1 = jointIndex * 2 + 1; - ndJacobian& outBody1 = internalForces[index1]; - outBody1.m_linear = forceAcc1; - outBody1.m_angular = torqueAcc1; - }; - - const ndInt32 jointCount = jointArray.GetCount(); - for (ndInt32 i = threadIndex; i < jointCount; i += threadCount) - { - ndConstraint* const joint = jointArray[i]; - GetJacobianDerivatives(joint); - BuildJacobianMatrix(joint, i); - } - }); - - auto InitJacobianAccumulatePartialForces = ndMakeObject::ndFunction([this, &bodyArray](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - const ndVector zero(ndVector::m_zero); - ndJacobian* const internalForces = &GetInternalForces()[0]; - const ndArray& bodyIndex = GetJointForceIndexBuffer(); - - const ndJacobian* const jointInternalForces = &GetTempInternalForces()[0]; - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - - const ndStartEnd startEnd(bodyIndex.GetCount() - 1, threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndVector force(zero); - ndVector torque(zero); - - const ndInt32 index = bodyIndex[i]; - const ndJointBodyPairIndex& scan = jointBodyPairIndexBuffer[index]; - ndBodyKinematic* const body = bodyArray[scan.m_body]; - - ndAssert(body->m_isStatic <= 1); - ndAssert(body->m_index == scan.m_body); - const ndInt32 mask = ndInt32(body->m_isStatic) - 1; - const ndInt32 count = mask & (bodyIndex[i + 1] - index); - - for (ndInt32 j = 0; j < count; ++j) - { - const ndInt32 jointIndex = jointBodyPairIndexBuffer[index + j].m_joint; - force += jointInternalForces[jointIndex].m_linear; - torque += jointInternalForces[jointIndex].m_angular; - } - internalForces[i].m_linear = force; - internalForces[i].m_angular = torque; - } - }); - - if (scene->GetActiveContactArray().GetCount()) - { - D_TRACKTIME(); - m_rightHandSide[0].m_force = ndFloat32(1.0f); - - scene->ParallelExecute(InitJacobianMatrix); - scene->ParallelExecute(InitJacobianAccumulatePartialForces); - } -} - -void ndDynamicsUpdateCuda::CalculateJointsAcceleration() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& jointArray = scene->GetActiveContactArray(); - - auto CalculateJointsAcceleration = ndMakeObject::ndFunction([this, &jointArray](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - ndJointAccelerationDecriptor joindDesc; - joindDesc.m_timestep = m_timestepRK; - joindDesc.m_invTimestep = m_invTimestepRK; - joindDesc.m_firstPassCoefFlag = m_firstPassCoef; - ndArray& leftHandSide = m_leftHandSide; - ndArray& rightHandSide = m_rightHandSide; - - const ndStartEnd startEnd(jointArray.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndConstraint* const joint = jointArray[i]; - const ndInt32 pairStart = joint->m_rowStart; - joindDesc.m_rowsCount = joint->m_rowCount; - joindDesc.m_leftHandSide = &leftHandSide[pairStart]; - joindDesc.m_rightHandSide = &rightHandSide[pairStart]; - joint->JointAccelerations(&joindDesc); - } - }); - - scene->ParallelExecute(CalculateJointsAcceleration); - m_firstPassCoef = ndFloat32(1.0f); -} - -void ndDynamicsUpdateCuda::IntegrateBodiesVelocity() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - auto IntegrateBodiesVelocity = ndMakeObject::ndFunction([this](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - ndArray& bodyArray = GetBodyIslandOrder(); - const ndArray& internalForces = GetInternalForces(); - - const ndVector timestep4(GetTimestepRK()); - const ndVector speedFreeze2(m_world->m_freezeSpeed2 * ndFloat32(0.1f)); - - const ndStartEnd startEnd(bodyArray.GetCount() - GetUnconstrainedBodyCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndBodyKinematic* const body = bodyArray[i]; - - ndAssert(body); - ndAssert(body->m_isConstrained); - // no necessary anymore because the virtual function handle it. - //ndAssert(body->GetAsBodyDynamic()); - const ndInt32 index = body->m_index; - const ndJacobian& forceAndTorque = internalForces[index]; - const ndVector force(body->GetForce() + forceAndTorque.m_linear); - const ndVector torque(body->GetTorque() + forceAndTorque.m_angular - body->GetGyroTorque()); - const ndJacobian velocStep(body->IntegrateForceAndToque(force, torque, timestep4)); - - if (!body->m_equilibrium0) - { - body->m_veloc += velocStep.m_linear; - body->m_omega += velocStep.m_angular; - body->IntegrateGyroSubstep(timestep4); - } - else - { - const ndVector velocStep2(velocStep.m_linear.DotProduct(velocStep.m_linear)); - const ndVector omegaStep2(velocStep.m_angular.DotProduct(velocStep.m_angular)); - const ndVector test(((velocStep2 > speedFreeze2) | (omegaStep2 > speedFreeze2)) & ndVector::m_negOne); - const ndInt8 equilibrium = test.GetSignMask() ? 0 : 1; - body->m_equilibrium0 = ndUnsigned8(equilibrium); - } - ndAssert(body->m_veloc.m_w == ndFloat32(0.0f)); - ndAssert(body->m_omega.m_w == ndFloat32(0.0f)); - } - }); - scene->ParallelExecute(IntegrateBodiesVelocity); -} - -void ndDynamicsUpdateCuda::UpdateForceFeedback() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& jointArray = scene->GetActiveContactArray(); - - auto UpdateForceFeedback = ndMakeObject::ndFunction([this, &jointArray](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - ndArray& rightHandSide = m_rightHandSide; - const ndArray& leftHandSide = m_leftHandSide; - - const ndVector zero(ndVector::m_zero); - const ndFloat32 timestepRK = GetTimestepRK(); - const ndStartEnd startEnd(jointArray.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndConstraint* const joint = jointArray[i]; - const ndInt32 rows = joint->m_rowCount; - const ndInt32 first = joint->m_rowStart; - - for (ndInt32 j = 0; j < rows; ++j) - { - const ndRightHandSide* const rhs = &rightHandSide[j + first]; - ndAssert(ndCheckFloat(rhs->m_force)); - rhs->m_jointFeebackForce->Push(rhs->m_force); - rhs->m_jointFeebackForce->m_force = rhs->m_force; - rhs->m_jointFeebackForce->m_impact = rhs->m_maxImpact * timestepRK; - } - - if (joint->GetAsBilateral()) - { - ndVector force0(zero); - ndVector force1(zero); - ndVector torque0(zero); - ndVector torque1(zero); - - for (ndInt32 j = 0; j < rows; ++j) - { - const ndRightHandSide* const rhs = &rightHandSide[j + first]; - const ndLeftHandSide* const lhs = &leftHandSide[j + first]; - const ndVector f(rhs->m_force); - force0 += lhs->m_Jt.m_jacobianM0.m_linear * f; - torque0 += lhs->m_Jt.m_jacobianM0.m_angular * f; - force1 += lhs->m_Jt.m_jacobianM1.m_linear * f; - torque1 += lhs->m_Jt.m_jacobianM1.m_angular * f; - } - ndJointBilateralConstraint* const bilateral = (ndJointBilateralConstraint*)joint; - bilateral->m_forceBody0 = force0; - bilateral->m_torqueBody0 = torque0; - bilateral->m_forceBody1 = force1; - bilateral->m_torqueBody1 = torque1; - } - } - }); - - scene->ParallelExecute(UpdateForceFeedback); -} - -void ndDynamicsUpdateCuda::IntegrateBodies() -{ - D_TRACKTIME(); - //ndAssert(0); - //ndScene* const scene = m_world->GetScene(); - //const ndVector invTime(m_invTimestep); - //const ndFloat32 timestep = scene->GetTimestep(); - // - //auto IntegrateBodiesCPU = ndMakeObject::ndFunction([this, timestep, invTime](ndInt32 threadIndex, ndInt32 threadCount) - //{ - // D_TRACKTIME(); - // const ndWorld* const world = m_world; - // const ndArray& bodyArray = GetBodyIslandOrder(); - // const ndStartEnd startEnd(bodyArray.GetCount(), threadIndex, threadCount); - // - // const ndFloat32 speedFreeze2 = world->m_freezeSpeed2; - // const ndFloat32 accelFreeze2 = world->m_freezeAccel2; - // - // for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - // { - // ndBodyKinematic* const body = bodyArray[i]; - // if (!body->m_equilibrium) - // { - // body->m_accel = invTime * (body->m_veloc - body->m_accel); - // body->m_alpha = invTime * (body->m_omega - body->m_alpha); - // body->IntegrateVelocity(timestep); - // } - // body->EvaluateSleepState(speedFreeze2, accelFreeze2); - // } - //}); - // - //auto IntegrateBodies = [] __device__(cuBodyProxy& body, float timestep) - //{ - // //const cuMatrix3x3 matrix(body.m_rotation.GetMatrix3x3()); - // body.IntegrateVelocity(timestep); - //}; - // - //if (m_context->m_bodyBufferGpu.GetCount()) - //{ - // cudaStream_t stream = m_context->m_solverComputeStream; - // ndInt32 threads = m_context->m_bodyBufferGpu.GetCount(); - // ndInt32 blocks = (threads + D_THREADS_PER_BLOCK - 1) / D_THREADS_PER_BLOCK; - // cuSceneInfo& sceneInfo = *m_context->m_sceneInfoGpu; - // - // CudaIntegrateBodies <<>> (IntegrateBodies, sceneInfo, timestep); - //} - - m_context->IntegrateBodies(m_timestep); -} - -void ndDynamicsUpdateCuda::DetermineSleepStates() -{ - D_TRACKTIME(); - auto CalculateSleepState = ndMakeObject::ndFunction([this](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyIndex = GetJointForceIndexBuffer(); - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - ndConstraint** const jointArray = &scene->GetActiveContactArray()[0]; - ndBodyKinematic** const bodyArray = &scene->GetActiveBodyArray()[0]; - - const ndVector zero(ndVector::m_zero); - const ndStartEnd startEnd(bodyIndex.GetCount() - 1, threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - const ndInt32 index = bodyIndex[i]; - ndBodyKinematic* const body = bodyArray[jointBodyPairIndexBuffer[index].m_body]; - ndAssert(body->m_isStatic <= 1); - ndAssert(body->m_index == jointBodyPairIndexBuffer[index].m_body); - const ndInt32 mask = ndInt32(body->m_isStatic) - 1; - const ndInt32 count = mask & (bodyIndex[i + 1] - index); - if (count) - { - ndUnsigned8 equilibrium = body->m_isJointFence0; - if (equilibrium & body->m_autoSleep) - { - for (ndInt32 j = 0; j < count; ++j) - { - const ndJointBodyPairIndex& scan = jointBodyPairIndexBuffer[index + j]; - ndConstraint* const joint = jointArray[scan.m_joint >> 1]; - ndBodyKinematic* const body1 = (joint->GetBody0() == body) ? joint->GetBody1() : joint->GetBody0(); - ndAssert(body1 != body); - equilibrium = ndUnsigned8(equilibrium & body1->m_isJointFence0); - } - } - body->m_equilibrium = ndUnsigned8(equilibrium & body->m_autoSleep); - if (body->m_equilibrium) - { - body->m_veloc = zero; - body->m_omega = zero; - } - } - } - }); - - ndScene* const scene = m_world->GetScene(); - if (scene->GetActiveContactArray().GetCount()) - { - scene->ParallelExecute(CalculateSleepState); - } -} - -void ndDynamicsUpdateCuda::InitSkeletons() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& activeSkeletons = m_world->m_activeSkeletons; - - auto InitSkeletons = ndMakeObject::ndFunction([this, &activeSkeletons](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - ndArray& rightHandSide = m_rightHandSide; - const ndArray& leftHandSide = m_leftHandSide; - - for (ndInt32 i = threadIndex; i < activeSkeletons.GetCount(); i += threadCount) - { - ndSkeletonContainer* const skeleton = activeSkeletons[i]; - skeleton->InitMassMatrix(&leftHandSide[0], &rightHandSide[0]); - } - }); - - if (activeSkeletons.GetCount()) - { - scene->ParallelExecute(InitSkeletons); - } -} - -void ndDynamicsUpdateCuda::UpdateSkeletons() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& activeSkeletons = m_world->m_activeSkeletons; - const ndBodyKinematic** const bodyArray = (const ndBodyKinematic**)(&scene->GetActiveBodyArray()[0]); - - auto UpdateSkeletons = ndMakeObject::ndFunction([this, &bodyArray, &activeSkeletons](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - ndJacobian* const internalForces = &GetInternalForces()[0]; - for (ndInt32 i = threadIndex; i < activeSkeletons.GetCount(); i += threadCount) - { - ndSkeletonContainer* const skeleton = activeSkeletons[i]; - skeleton->CalculateReactionForces(internalForces); - } - }); - - if (activeSkeletons.GetCount()) - { - scene->ParallelExecute(UpdateSkeletons); - } -} - -void ndDynamicsUpdateCuda::CalculateJointsForce() -{ - D_TRACKTIME(); - const ndUnsigned32 passes = m_solverPasses; - ndScene* const scene = m_world->GetScene(); - - ndArray& bodyArray = scene->GetActiveBodyArray(); - ndArray& jointArray = scene->GetActiveContactArray(); - - auto CalculateJointsForce = ndMakeObject::ndFunction([this, &jointArray](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - const ndInt32 jointCount = jointArray.GetCount(); - ndJacobian* const jointPartialForces = &GetTempInternalForces()[0]; - - auto JointForce = [this, &jointPartialForces](ndConstraint* const joint, ndInt32 jointIndex) - { - const ndVector zero(ndVector::m_zero); - ndVector accNorm(zero); - ndBodyKinematic* const body0 = joint->GetBody0(); - ndBodyKinematic* const body1 = joint->GetBody1(); - ndAssert(body0); - ndAssert(body1); - - const ndInt32 m0 = body0->m_index; - const ndInt32 m1 = body1->m_index; - const ndInt32 rowStart = joint->m_rowStart; - const ndInt32 rowsCount = joint->m_rowCount; - - const ndInt32 resting = body0->m_equilibrium0 & body1->m_equilibrium0; - if (!resting) - { - #ifdef D_JOINT_PRECONDITIONER - ndVector preconditioner0(joint->m_preconditioner0); - ndVector preconditioner1(joint->m_preconditioner1); - - ndVector forceM0(m_internalForces[m0].m_linear * preconditioner0); - ndVector torqueM0(m_internalForces[m0].m_angular * preconditioner0); - ndVector forceM1(m_internalForces[m1].m_linear * preconditioner1); - ndVector torqueM1(m_internalForces[m1].m_angular * preconditioner1); - - preconditioner0 = preconditioner0.Scale(body0->m_weigh); - preconditioner1 = preconditioner1.Scale(body1->m_weigh); - #else - const ndVector preconditioner0(body0->m_weigh); - const ndVector preconditioner1(body1->m_weigh); - - ndVector forceM0(m_internalForces[m0].m_linear); - ndVector torqueM0(m_internalForces[m0].m_angular); - ndVector forceM1(m_internalForces[m1].m_linear); - ndVector torqueM1(m_internalForces[m1].m_angular); - #endif - - for (ndInt32 j = 0; j < rowsCount; ++j) - { - ndRightHandSide* const rhs = &m_rightHandSide[rowStart + j]; - const ndLeftHandSide* const lhs = &m_leftHandSide[rowStart + j]; - const ndVector force(rhs->m_force); - - ndVector a(lhs->m_JMinv.m_jacobianM0.m_linear * forceM0); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM0.m_angular, torqueM0); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM1.m_linear, forceM1); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM1.m_angular, torqueM1); - a = ndVector(rhs->m_coordenateAccel - rhs->m_force * rhs->m_diagDamp) - a.AddHorizontal(); - - ndAssert(rhs->m_normalForceIndexFlat >= 0); - ndVector f(force + a.Scale(rhs->m_invJinvMJt)); - const ndInt32 frictionIndex = rhs->m_normalForceIndexFlat; - const ndFloat32 frictionNormal = m_rightHandSide[frictionIndex].m_force; - const ndVector lowerFrictionForce(frictionNormal * rhs->m_lowerBoundFrictionCoefficent); - const ndVector upperFrictionForce(frictionNormal * rhs->m_upperBoundFrictionCoefficent); - - a = a & (f < upperFrictionForce) & (f > lowerFrictionForce); - accNorm = accNorm.MulAdd(a, a); - - f = f.GetMax(lowerFrictionForce).GetMin(upperFrictionForce); - rhs->m_force = f.GetScalar(); - - const ndVector deltaForce(f - force); - const ndVector deltaForce0(deltaForce * preconditioner0); - const ndVector deltaForce1(deltaForce * preconditioner1); - - forceM0 = forceM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_linear, deltaForce0); - torqueM0 = torqueM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_angular, deltaForce0); - forceM1 = forceM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_linear, deltaForce1); - torqueM1 = torqueM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_angular, deltaForce1); - } - - const ndFloat32 tol = ndFloat32(0.125f); - const ndFloat32 tol2 = tol * tol; - - ndVector maxAccel(accNorm); - for (ndInt32 k = 0; (k < 4) && (maxAccel.GetScalar() > tol2); k++) - { - maxAccel = zero; - for (ndInt32 j = 0; j < rowsCount; ++j) - { - ndRightHandSide* const rhs = &m_rightHandSide[rowStart + j]; - const ndLeftHandSide* const lhs = &m_leftHandSide[rowStart + j]; - const ndVector force(rhs->m_force); - - ndVector a(lhs->m_JMinv.m_jacobianM0.m_linear * forceM0); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM0.m_angular, torqueM0); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM1.m_linear, forceM1); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM1.m_angular, torqueM1); - a = ndVector(rhs->m_coordenateAccel - rhs->m_force * rhs->m_diagDamp) - a.AddHorizontal(); - - ndVector f(force + a.Scale(rhs->m_invJinvMJt)); - ndAssert(rhs->m_normalForceIndexFlat >= 0); - const ndInt32 frictionIndex = rhs->m_normalForceIndexFlat; - const ndFloat32 frictionNormal = m_rightHandSide[frictionIndex].m_force; - - const ndVector lowerFrictionForce(frictionNormal * rhs->m_lowerBoundFrictionCoefficent); - const ndVector upperFrictionForce(frictionNormal * rhs->m_upperBoundFrictionCoefficent); - - a = a & (f < upperFrictionForce) & (f > lowerFrictionForce); - maxAccel = maxAccel.MulAdd(a, a); - - f = f.GetMax(lowerFrictionForce).GetMin(upperFrictionForce); - rhs->m_force = f.GetScalar(); - - const ndVector deltaForce(f - force); - const ndVector deltaForce0(deltaForce * preconditioner0); - const ndVector deltaForce1(deltaForce * preconditioner1); - forceM0 = forceM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_linear, deltaForce0); - torqueM0 = torqueM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_angular, deltaForce0); - forceM1 = forceM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_linear, deltaForce1); - torqueM1 = torqueM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_angular, deltaForce1); - } - } - } - - ndVector forceM0(zero); - ndVector torqueM0(zero); - ndVector forceM1(zero); - ndVector torqueM1(zero); - - for (ndInt32 j = 0; j < rowsCount; ++j) - { - ndRightHandSide* const rhs = &m_rightHandSide[rowStart + j]; - const ndLeftHandSide* const lhs = &m_leftHandSide[rowStart + j]; - - const ndVector f(rhs->m_force); - forceM0 = forceM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_linear, f); - torqueM0 = torqueM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_angular, f); - forceM1 = forceM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_linear, f); - torqueM1 = torqueM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_angular, f); - rhs->m_maxImpact = ndMax(ndAbs(f.GetScalar()), rhs->m_maxImpact); - } - - const ndInt32 index0 = jointIndex * 2 + 0; - ndJacobian& outBody0 = jointPartialForces[index0]; - outBody0.m_linear = forceM0; - outBody0.m_angular = torqueM0; - - const ndInt32 index1 = jointIndex * 2 + 1; - ndJacobian& outBody1 = jointPartialForces[index1]; - outBody1.m_linear = forceM1; - outBody1.m_angular = torqueM1; - }; - - for (ndInt32 i = threadIndex; i < jointCount; i += threadCount) - { - ndConstraint* const joint = jointArray[i]; - JointForce(joint, i); - } - }); - - auto ApplyJacobianAccumulatePartialForces = ndMakeObject::ndFunction([this, &bodyArray](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - const ndVector zero(ndVector::m_zero); - - ndJacobian* const internalForces = &GetInternalForces()[0]; - const ndInt32* const bodyIndex = &GetJointForceIndexBuffer()[0]; - - const ndJacobian* const jointInternalForces = &GetTempInternalForces()[0]; - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - - const ndStartEnd startEnd(bodyArray.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndVector force(zero); - ndVector torque(zero); - const ndBodyKinematic* const body = bodyArray[i]; - - const ndInt32 startIndex = bodyIndex[i]; - const ndInt32 mask = body->m_isStatic - 1; - const ndInt32 count = mask & (bodyIndex[i + 1] - startIndex); - for (ndInt32 j = 0; j < count; ++j) - { - const ndInt32 index = jointBodyPairIndexBuffer[startIndex + j].m_joint; - force += jointInternalForces[index].m_linear; - torque += jointInternalForces[index].m_angular; - } - internalForces[i].m_linear = force; - internalForces[i].m_angular = torque; - } - }); - - for (ndInt32 i = 0; i < ndInt32(passes); ++i) - { - scene->ParallelExecute(CalculateJointsForce); - scene->ParallelExecute(ApplyJacobianAccumulatePartialForces); - } -} - -void ndDynamicsUpdateCuda::CalculateForces() -{ - D_TRACKTIME(); - if (m_world->GetScene()->GetActiveContactArray().GetCount()) - { - m_firstPassCoef = ndFloat32(0.0f); - - InitSkeletons(); - for (ndInt32 step = 0; step < 4; step++) - { - CalculateJointsAcceleration(); - CalculateJointsForce(); - UpdateSkeletons(); - IntegrateBodiesVelocity(); - } - UpdateForceFeedback(); - } -} - -void ndDynamicsUpdateCuda::Update() -{ - if (m_context) - { - DeviceUpdate(); - } - else - { - ndDynamicsUpdate::Update(); - } -} - -void ndDynamicsUpdateCuda::DeviceUpdate() -{ - D_TRACKTIME(); - m_timestep = m_world->GetScene()->GetTimestep(); - - //BuildIsland(); - IntegrateUnconstrainedBodies(); - //InitWeights(); - //InitBodyArray(); - //InitJacobianMatrix(); - //CalculateForces(); - IntegrateBodies(); - //DetermineSleepStates(); -} - -#endif - -ndDynamicsUpdateCuda::ndDynamicsUpdateCuda(ndWorld* const world) - :ndDynamicsUpdate(world) -{ - ndWorldSceneCuda* const scene = (ndWorldSceneCuda*)world->GetScene(); - m_context = scene->m_context; -} - -ndDynamicsUpdateCuda::~ndDynamicsUpdateCuda() -{ -} - -const char* ndDynamicsUpdateCuda::GetStringId() const -{ - ndAssert(m_context); - return m_context->GetStringId(); -} - -void ndDynamicsUpdateCuda::Update() -{ -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndDynamicsUpdateCuda.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndDynamicsUpdateCuda.h deleted file mode 100644 index 09288d1b34..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndDynamicsUpdateCuda.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __D_WORLD_DYNAMICS_UPDATE_CUDA_H__ -#define __D_WORLD_DYNAMICS_UPDATE_CUDA_H__ - -#include "ndNewtonStdafx.h" -#include "ndDynamicsUpdate.h" - -class ndCudaContext; - -class ndDynamicsUpdateCuda : public ndDynamicsUpdate -{ - public: - ndDynamicsUpdateCuda(ndWorld* const world); - virtual ~ndDynamicsUpdateCuda(); - - virtual const char* GetStringId() const; - - protected: - virtual void Update(); - - public: - //void SortJoints(); - //void SortIslands(); - //void BuildIsland(); - //void InitWeights(); - //void InitBodyArray(); - //void InitSkeletons(); - //void CalculateForces(); - //void IntegrateBodies(); - //void UpdateSkeletons(); - //void FinishGpuUpdate(); - //void InitJacobianMatrix(); - //void UpdateForceFeedback(); - //void CalculateJointsForce(); - //void IntegrateBodiesVelocity(); - //void CalculateJointsAcceleration(); - //void IntegrateUnconstrainedBodies(); - // - //void DeviceUpdate(); - //void DetermineSleepStates(); - //void GetJacobianDerivatives(ndConstraint* const joint); - - ndCudaContext* m_context; -}; - - - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndWorldSceneCuda.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndWorldSceneCuda.cpp deleted file mode 100644 index 24c0df45d6..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndWorldSceneCuda.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndModel.h" -#include "ndWorldScene.h" -#include "ndBodyDynamic.h" -#include "ndCudaContext.h" -#include "ndSkeletonList.h" -#include "ndCudaSceneInfo.h" -#include "ndWorldSceneCuda.h" -#include "ndDynamicsUpdate.h" -#include "ndJointBilateralConstraint.h" - -ndWorldSceneCuda::ndWorldSceneCuda(const ndWorldScene& src) - :ndWorldScene(src) - ,m_fluidParticles() -{ - m_context = new ndCudaContext(); - - const ndBodyList& particles = GetParticleList(); - for (ndBodyList::ndNode* node = particles.GetFirst(); node; node = node->GetNext()) - { - ndBody* const body = *node->GetInfo(); - ndBodySphFluid* const particle = body->GetAsBodySphFluid(); - if (particle) - { - //m_fluidParticles.Append(new ndCudaSphFluid(particle)); - Addparticle(particle); - } - } -} - -ndWorldSceneCuda::~ndWorldSceneCuda() -{ - for (ndSpecialList::ndNode* node = m_fluidParticles.GetFirst(); node; node = node->GetNext()) - { - delete node->GetInfo(); - } - - if (m_context) - { - delete m_context; - } -} - -bool ndWorldSceneCuda::IsValid() const -{ - return m_context->IsValid(); -} - -void ndWorldSceneCuda::Begin() -{ - ndWorldScene::Begin(); - m_context->Begin(); -} - -void ndWorldSceneCuda::End() -{ - m_context->End(); - ndWorldScene::End(); -} - -void ndWorldSceneCuda::Cleanup() -{ - m_context->Cleanup(); - ndWorldScene::Cleanup(); -} - -void ndWorldSceneCuda::PrepareCleanup() -{ - m_context->PrepareCleanup(); - ndWorldScene::PrepareCleanup(); -} - -bool ndWorldSceneCuda::IsHighPerformanceCompute() const -{ - return true; -} - -#if 0 -void ndWorldSceneCuda::LoadBodyData() -{ - auto CopyBodies = ndMakeObject::ndFunction([this](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME(); - const ndCudaVector minBox(ndFloat32(1.0e15f)); - const ndCudaVector maxBox(ndFloat32(-1.0e15f)); - - ndArray& data = m_bodyBufferCpu; - ndCudaSpatialVector* const transformBufferCpu = GetTransformBuffer(); - - ndArray& bodyArray = GetActiveBodyArray(); - const ndStartEnd startEnd(bodyArray.GetCount(), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndCudaSpatialVector transform; - ndBodyKinematic* const body = bodyArray[i]; - ndCudaBodyProxy& proxi = data[i]; - - // Get thansform and velocity - const ndVector massMatrix(body->GetMassMatrix()); - const ndQuaternion rotation(body->GetRotation()); - const ndVector invInertia(body->GetInvInertia()); - const ndVector dampCoef(body->GetCachedDamping()); - const ndVector position(body->GetGlobalGetCentreOfMass()); - const ndVector veloc(body->GetVelocity()); - const ndVector omega(body->GetOmega()); - - proxi.m_mass = ndCudaVector(massMatrix.m_x, massMatrix.m_y, massMatrix.m_z, massMatrix.m_w); - proxi.m_rotation = ndCudaQuat(rotation.m_x, rotation.m_y, rotation.m_z, rotation.m_w); - proxi.m_posit = ndCudaVector(position.m_x, position.m_y, position.m_z, position.m_w); - proxi.m_invIntertia = ndCudaVector(invInertia.m_x, invInertia.m_y, invInertia.m_z, invInertia.m_w); - proxi.m_dampCoef = ndCudaVector(dampCoef.m_x, dampCoef.m_y, dampCoef.m_z, dampCoef.m_w); - proxi.m_veloc = ndCudaVector(veloc.m_x, veloc.m_y, veloc.m_z, veloc.m_w); - proxi.m_omega = ndCudaVector(omega.m_x, omega.m_y, omega.m_z, omega.m_w); - - // Get scene manager data - const ndShapeInstance& collision = body->GetCollisionShape(); - const ndShape* const shape = collision.GetShape(); - - const ndVector scale(collision.GetScale()); - const ndVector obbSize(shape->GetObbSize()); - const ndVector obbOrigin(shape->GetObbOrigin()); - const ndVector localPosition (collision.GetLocalMatrix().m_posit); - const ndQuaternion localRotation(collision.GetLocalMatrix()); - const ndQuaternion alignRotation(collision.GetAlignmentMatrix()); - - proxi.m_minAabb = minBox; - proxi.m_maxAabb = maxBox; - proxi.m_obbSize = ndCudaVector(obbSize.m_x, obbSize.m_y, obbSize.m_z, obbSize.m_w); - proxi.m_obbOrigin = ndCudaVector(obbOrigin.m_x, obbOrigin.m_y, obbOrigin.m_z, obbOrigin.m_w); - proxi.m_scale = ndCudaVector(scale.m_x, scale.m_y, scale.m_z, scale.m_w); - proxi.m_localPosition = ndCudaVector(localPosition.m_x, localPosition.m_y, localPosition.m_z, localPosition.m_w); - proxi.m_localRotation = ndCudaQuat(localRotation.m_x, localRotation.m_y, localRotation.m_z, localRotation.m_w); - proxi.m_alignRotation = ndCudaQuat(alignRotation.m_x, alignRotation.m_y, alignRotation.m_z, alignRotation.m_w); - - transform.m_linear = proxi.m_posit; - transform.m_angular = proxi.m_rotation; - transformBufferCpu[i] = transform; - } - }); - - const ndArray& bodyArray = GetActiveBodyArray(); - const ndInt32 cpuBodyCount = bodyArray.GetCount(); - ndArray& bodyBufferCpu = m_bodyBufferCpu; - bodyBufferCpu.SetCount(cpuBodyCount); - ndCudaContext::ResizeBuffers(cpuBodyCount); - - ParallelExecute(CopyBodies); - - ndCudaContext::LoadBodyData(&bodyBufferCpu[0], cpuBodyCount); -} - -void ndWorldSceneCuda::GetBodyTransforms() -{ - D_TRACKTIME(); - ndAssert(0); - //auto GetTransform = [] __device__(const cuSceneInfo& info, int frameCount) - //{ - // int index = threadIdx.x + blockDim.x * blockIdx.x; - // if (index < (info.m_bodyArray.m_size - 1)) - // { - // cuBodyProxy* src = info.m_bodyArray.m_array; - // cuSpatialVector* dst = (frameCount & 1) ? info.m_transformBuffer0.m_array : info.m_transformBuffer1.m_array; - // - // dst[index].m_linear = src[index].m_posit; - // dst[index].m_angular = src[index].m_rotation; - // } - //}; - // - //cudaStream_t stream = m_context->m_solverComputeStream; - //cuSceneInfo* const infoGpu = m_context->m_sceneInfoGpu; - // - //ndInt32 threads = m_context->m_bodyBufferGpu.GetCount() - 1; - //ndInt32 blocks = (threads + D_THREADS_PER_BLOCK - 1) / D_THREADS_PER_BLOCK; - //CudaGetBodyTransforms << > > (GetTransform, *infoGpu, m_context->m_frameCounter); - // - ////cuHostBuffer& cpuBuffer = m_context->m_transformBufferCpu0; - ////cuDeviceBuffer& gpuBuffer = m_context->m_transformBufferGpu0; - ////gpuBuffer.WriteData(&cpuBuffer[0], cpuBuffer.GetCount() - 1, stream); -} - - - -void ndWorldSceneCuda::BalanceScene() -{ - ndWorldScene::BalanceScene(); -} - -void ndWorldSceneCuda::CalculateContacts() -{ - //ndWorldScene::CalculateContacts(); -} - -void ndWorldSceneCuda::UpdateBodyList() -{ - bool bodyListChanged = m_bodyList.IsListDirty(); - - ndWorldScene::UpdateBodyList(); - if (bodyListChanged) - { - LoadBodyData(); - } - - ValidateContextBuffers(); -} - -void ndWorldSceneCuda::FindCollidingPairs() -{ - ndWorldScene::FindCollidingPairs(); -} - -void ndWorldSceneCuda::ApplyExtForce() -{ - ndWorldScene::ApplyExtForce(); -} - -void ndWorldSceneCuda::InitBodyArray() -{ - ndWorldScene::InitBodyArray(); - ndCudaContext::InitBodyArray(); -} - -void ndWorldSceneCuda::CalculateContacts(ndInt32, ndContact* const) -{ - ndAssert(0); -} -#endif - -void ndWorldSceneCuda::Addparticle(ndBodySphFluid* const particle) -{ - ndAssert(0); - //ndSphFluidInitInfo info; - //info.m_owner = particle; - //info.m_context = m_context; - //info.m_owner = particle; - //info.m_gridSize = particle->GetSphGridSize(); - // - //ndCudaSphFluid* const fluid = new ndCudaSphFluid(info); - //m_fluidParticles.Append(fluid); - // - //const ndArray& posit = particle->GetPositions(); - //fluid->MemCpy(&posit[0].m_x, sizeof(ndVector) / sizeof(ndFloat32), posit.GetCount()); -} - -bool ndWorldSceneCuda::AddParticle(ndSharedPtr& particle) -{ - bool ret = ndWorldScene::AddParticle(particle); - - ndBodySphFluid* const fluid = particle->GetAsBodySphFluid(); - if (fluid) - { - Addparticle(fluid); - } - else - { - ndAssert(0); - } - - return ret; -} - -bool ndWorldSceneCuda::RemoveParticle(ndSharedPtr& particle) -{ - ndBodySphFluid* const fluid = particle->GetAsBodySphFluid(); - if (fluid) - { - for (ndSpecialList::ndNode* node = m_fluidParticles.GetFirst(); node; node = node->GetNext()) - { - if (node->GetInfo()->GetOwner() == fluid) - { - delete node->GetInfo(); - m_fluidParticles.Remove(node); - break; - } - } - } - else - { - ndAssert(0); - } - - bool ret = ndWorldScene::RemoveParticle(particle); - return ret; -} - -void ndWorldSceneCuda::UpdateTransform() -{ - D_TRACKTIME(); - for (ndSpecialList::ndNode* node = m_fluidParticles.GetFirst(); node; node = node->GetNext()) - { - ndCudaSphFluid* const fluid = node->GetInfo(); - ndBodySphFluid* const owner = fluid->GetOwner(); - ndArray& posit = owner->GetPositions(); - fluid->GetPositions(&posit[0].m_x, sizeof(ndVector) / sizeof(ndFloat32), posit.GetCount()); - } - - //m_context->UpdateTransform(); - //auto SetTransform = ndMakeObject::ndFunction([this](ndInt32 threadIndex, ndInt32 threadCount) - //{ - // D_TRACKTIME(); - // const ndArray& bodyArray = GetActiveBodyArray(); - // const ndCudaSpatialVector* const data = GetTransformBuffer(); - // const ndStartEnd startEnd(bodyArray.GetCount() - 1, threadIndex, threadCount); - // for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - // { - // ndBodyKinematic* const body = bodyArray[i]; - // const ndCudaSpatialVector& transform = data[i]; - // const ndVector position(transform.m_linear.x, transform.m_linear.y, transform.m_linear.z, ndFloat32(1.0f)); - // const ndQuaternion rotation(ndVector(transform.m_angular.x, transform.m_angular.y, transform.m_angular.z, transform.m_angular.w)); - // body->SetMatrixAndCentreOfMass(rotation, position); - // - // body->m_transformIsDirty = true; - // UpdateTransformNotify(threadIndex, body); - // } - //}); - //ParallelExecute(SetTransform); - - ndWorldScene::UpdateTransform(); -} - -void ndWorldSceneCuda::ParticleUpdate(ndFloat32 timestep) -{ - for (ndSpecialList::ndNode* node = m_fluidParticles.GetFirst(); node; node = node->GetNext()) - { - ndCudaSphFluid* const fluid = node->GetInfo(); - fluid->Update(timestep); - } -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndWorldSceneCuda.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndWorldSceneCuda.h deleted file mode 100644 index c26f6b87c3..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dExtensions/dCuda/ndWorldSceneCuda.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright (c) <2003-2021> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include -#include - -class ndCudaContext; - -class ndWorldSceneCuda : public ndWorldScene -{ - public: - ndWorldSceneCuda(const ndWorldScene& src); - virtual ~ndWorldSceneCuda(); - - virtual void Begin(); - virtual void End(); - virtual void Cleanup(); - virtual void PrepareCleanup(); - virtual bool IsValid() const; - virtual bool IsHighPerformanceCompute() const; - - //virtual void ApplyExtForce(); - //virtual void BalanceScene(); - //virtual void InitBodyArray(); - //virtual void UpdateBodyList(); - //virtual void CalculateContacts(); - //virtual void FindCollidingPairs(); - // - ////virtual void FindCollidingPairs(ndBodyKinematic* const body); - //virtual void CalculateContacts(ndInt32 threadIndex, ndContact* const contact); - - //void LoadBodyData(); - //void GetBodyTransforms(); - //ndCudaContext* GetContext(); - - virtual void UpdateTransform(); - - virtual void ParticleUpdate(ndFloat32 timestep); - virtual bool AddParticle(ndSharedPtr& particle); - virtual bool RemoveParticle(ndSharedPtr& particle); - - - //ndArray m_bodyBufferCpu; - // - //friend class ndDynamicsUpdateCuda; - - private: - void Addparticle(ndBodySphFluid* const fluid); - - ndCudaContext* m_context; - ndSpecialList m_fluidParticles; - - friend class ndDynamicsUpdateCuda; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIk6DofEffector.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIk6DofEffector.cpp deleted file mode 100644 index 08d8a4c42b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIk6DofEffector.cpp +++ /dev/null @@ -1,326 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndIk6DofEffector.h" -#include "ndSkeletonContainer.h" - -ndIk6DofEffector::ndIk6DofEffector() - :ndJointBilateralConstraint() - ,m_targetFrame(ndGetIdentityMatrix()) - ,m_angularSpring(ndFloat32(1000.0f)) - ,m_angularDamper(ndFloat32(50.0f)) - ,m_angularMaxTorque(D_LCP_MAX_VALUE) - ,m_angularRegularizer(ndFloat32(5.0e-3f)) - ,m_angularMaxSpringRamp(ndFloat32(1.0e10f)) - ,m_linearSpring(ndFloat32(1000.0f)) - ,m_linearDamper(ndFloat32(50.0f)) - ,m_linearMaxForce(D_LCP_MAX_VALUE) - ,m_linearRegularizer(ndFloat32(5.0e-3f)) - ,m_linearMaxSpringRamp(ndFloat32(1.0e10f)) - ,m_rotationType(m_disabled) - ,m_controlDofOptions(0xff) -{ - m_maxDof = 6; -} - -ndIk6DofEffector::ndIk6DofEffector(const ndMatrix& pinAndPivotChild, const ndMatrix& pinAndPivotParent, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(6, child, parent, pinAndPivotChild, pinAndPivotParent) - ,m_targetFrame(pinAndPivotChild * pinAndPivotParent.OrthoInverse()) - ,m_angularSpring(ndFloat32(1000.0f)) - ,m_angularDamper(ndFloat32(50.0f)) - ,m_angularMaxTorque(D_LCP_MAX_VALUE) - ,m_angularRegularizer(ndFloat32(5.0e-3f)) - ,m_angularMaxSpringRamp(ndFloat32(1.0e10f)) - ,m_linearSpring(ndFloat32(1000.0f)) - ,m_linearDamper(ndFloat32(50.0f)) - ,m_linearMaxForce(D_LCP_MAX_VALUE) - ,m_linearRegularizer(ndFloat32(5.0e-3f)) - ,m_linearMaxSpringRamp(ndFloat32(1.0e10f)) - ,m_rotationType(m_disabled) - ,m_controlDofOptions(0xff) -{ - SetSolverModel(m_jointkinematicCloseLoop); -} - -ndIk6DofEffector::~ndIk6DofEffector() -{ -} - -void ndIk6DofEffector::EnableAxisX(bool state) -{ - m_axisX = ndUnsigned8(state ? 1 : 0); -} - -void ndIk6DofEffector::EnableAxisY(bool state) -{ - m_axisY = ndUnsigned8(state ? 1 : 0); -} - -void ndIk6DofEffector::EnableAxisZ(bool state) -{ - m_axisZ = ndUnsigned8(state ? 1 : 0); -} - -bool ndIk6DofEffector::GetAxisX() const -{ - return m_axisX ? true : false; -} - -bool ndIk6DofEffector::GetAxisY() const -{ - return m_axisY ? true : false; -} - -bool ndIk6DofEffector::GetAxisZ() const -{ - return m_axisZ ? true : false; -} - -void ndIk6DofEffector::EnableRotationAxis(ndRotationType type) -{ - m_rotationType = type; -} - -ndIk6DofEffector::ndRotationType ndIk6DofEffector::GetRotationAxis() const -{ - return m_rotationType; -} - -ndMatrix ndIk6DofEffector::GetOffsetMatrix() const -{ - return m_targetFrame; -} - -void ndIk6DofEffector::SetOffsetMatrix(const ndMatrix& matrix) -{ - m_targetFrame = matrix; -} - -ndMatrix ndIk6DofEffector::GetEffectorMatrix() const -{ - ndMatrix matrix0; - ndMatrix matrix1; - ndJointBilateralConstraint::CalculateGlobalMatrix(matrix0, matrix1); - const ndMatrix matrix(matrix0 * matrix1.OrthoInverse()); - return matrix; -} - -ndMatrix ndIk6DofEffector::CalculateGlobalBaseMatrix1() const -{ - return ndJointBilateralConstraint::CalculateGlobalMatrix1(); -} - -ndMatrix ndIk6DofEffector::CalculateGlobalMatrix1() const -{ - return m_targetFrame * CalculateGlobalBaseMatrix1(); -} - -ndFloat32 ndIk6DofEffector::GetMaxForce() const -{ - return m_linearMaxForce; -} - -void ndIk6DofEffector::SetMaxForce(ndFloat32 force) -{ - m_linearMaxForce = ndAbs(force); -} - -ndFloat32 ndIk6DofEffector::GetMaxTorque() const -{ - return m_angularMaxTorque; -} - -void ndIk6DofEffector::SetMaxTorque(ndFloat32 torque) -{ - m_angularMaxTorque = ndAbs(torque); -} - -void ndIk6DofEffector::SetLinearSpringDamper(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_linearSpring = ndAbs(spring); - m_linearDamper = ndAbs(damper); - m_linearRegularizer = ndClamp(regularizer, ndFloat32(1.0e-4f), ndFloat32(0.99f)); -} - -void ndIk6DofEffector::GetLinearSpringDamper(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_linearSpring; - damper = m_linearDamper; - regularizer = m_linearRegularizer; -} - -void ndIk6DofEffector::SetAngularSpringDamper(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_angularSpring = ndAbs(spring); - m_angularDamper = ndAbs(damper); - m_angularRegularizer = ndClamp(regularizer, ndFloat32(1.0e-4f), ndFloat32(0.99f)); -} - -void ndIk6DofEffector::GetAngularSpringDamper(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_angularSpring; - damper = m_angularDamper; - regularizer = m_angularRegularizer; -} - -void ndIk6DofEffector::DebugJoint(ndConstraintDebugCallback& debugCallback) const -{ - //const ndMatrix matrix0(m_localMatrix0 * m_body0->GetMatrix()); - //const ndMatrix matrix1(m_localMatrix1 * m_body1->GetMatrix()); - //const ndMatrix targetFrame(m_targetFrame * matrix1); - const ndMatrix matrix0(CalculateGlobalMatrix0()); - const ndMatrix matrix1(ndJointBilateralConstraint::CalculateGlobalMatrix1()); - const ndMatrix targetFrame(CalculateGlobalMatrix1()); - - debugCallback.DrawFrame(matrix0); - debugCallback.DrawFrame(matrix1); - debugCallback.DrawFrame(targetFrame); - debugCallback.DrawPoint(targetFrame.m_posit, ndVector(1.0f, 1.0f, 0.0f, 0.0f), 8.0f); -} - -void ndIk6DofEffector::SubmitShortestPathAxis(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc) -{ - const ndQuaternion rotation(matrix0.OrthoInverse() * matrix1); - const ndVector pin(rotation & ndVector::m_triplexMask); - const ndFloat32 dirMag2 = pin.DotProduct(pin).GetScalar(); - const ndFloat32 tol = ndFloat32(3.0f * ndPi / 180.0f); - if (dirMag2 > (tol * tol)) - { - const ndMatrix basis(ndGramSchmidtMatrix(pin)); - const ndFloat32 dirMag = ndSqrt(dirMag2); - const ndFloat32 angle = ndAtan2(dirMag, rotation.m_w); - AddAngularRowJacobian(desc, basis[0], angle); - SetMassSpringDamperAcceleration(desc, m_angularRegularizer, m_angularSpring, m_angularDamper); - SetLowerFriction(desc, -m_angularMaxTorque); - SetHighFriction(desc, m_angularMaxTorque); - - AddAngularRowJacobian(desc, basis[1], ndFloat32(0.0f)); - SetLowerFriction(desc, -m_angularMaxTorque); - SetHighFriction(desc, m_angularMaxTorque); - - AddAngularRowJacobian(desc, basis[2], ndFloat32(0.0f)); - SetLowerFriction(desc, -m_angularMaxTorque); - SetHighFriction(desc, m_angularMaxTorque); - } - else - { - ndFloat32 angle0 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up); - AddAngularRowJacobian(desc, matrix1.m_up, angle0); - SetMassSpringDamperAcceleration(desc, m_angularRegularizer, m_angularSpring, m_angularDamper); - SetLowerFriction(desc, -m_angularMaxTorque); - SetHighFriction(desc, m_angularMaxTorque); - - ndFloat32 angle1 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - AddAngularRowJacobian(desc, matrix1.m_right, angle1); - SetMassSpringDamperAcceleration(desc, m_angularRegularizer, m_angularSpring, m_angularDamper); - SetLowerFriction(desc, -m_angularMaxTorque); - SetHighFriction(desc, m_angularMaxTorque); - - ndFloat32 angle2 = CalculateAngle(matrix0.m_up, matrix1.m_up, matrix1.m_front); - AddAngularRowJacobian(desc, matrix1.m_front, angle2); - SetMassSpringDamperAcceleration(desc, m_angularRegularizer, m_angularSpring, m_angularDamper); - SetLowerFriction(desc, -m_angularMaxTorque); - SetHighFriction(desc, m_angularMaxTorque); - } -} - -void ndIk6DofEffector::SubmitAngularAxis(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc) -{ - switch (m_rotationType) - { - case m_fixAxis: - { - const ndMatrix matrix11(m_targetFrame * matrix1); - const ndVector& pin = matrix11.m_front; - - const ndFloat32 angle = CalculateAngle(matrix0[1], matrix11[1], matrix11[0]); - AddAngularRowJacobian(desc, pin, angle); - SetMassSpringDamperAcceleration(desc, m_angularRegularizer, m_angularSpring, m_angularDamper); - break; - } - - case m_shortestPath: - { - const ndMatrix matrix(m_targetFrame * matrix1); - SubmitShortestPathAxis(matrix0, matrix, desc); - break; - } - - case m_disabled: - default:; - } -} - -void ndIk6DofEffector::SubmitLinearAxis(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc) -{ - const ndMatrix& axisDir = matrix1; - const ndVector posit0(matrix0.m_posit); - const ndVector posit1(matrix1.TransformVector(m_targetFrame.m_posit)); - -#if 1 - for (ndInt32 i = 0; i < 3; ++i) - { - if (m_controlDofOptions & (1 << i)) - { - const ndVector pin = axisDir[i]; - AddLinearRowJacobian(desc, posit0, posit1, pin); - - //m_linearMaxSpringRamp = 0.1f; - //ndFloat32 springError = ndClamp (GetJointErrorPosit(desc), -m_linearMaxSpringRamp, m_linearMaxSpringRamp); - //SetJointErrorPosit(desc, springError); - SetMassSpringDamperAcceleration(desc, m_linearRegularizer, m_linearSpring, m_linearDamper); - - //ndTrace(("xxxxxxxxxx %f %f\n", springError, GetMotorAcceleration(desc))); - - SetLowerFriction(desc, -m_linearMaxForce); - SetHighFriction(desc, m_linearMaxForce); - } - } -#else - - const ndBodyKinematic* const body0 = GetBody0(); - const ndBodyKinematic* const body1 = GetBody1(); - - const ndVector omega0(body0->GetOmega()); - const ndVector omega1(body1->GetOmega()); - const ndVector veloc0 (body0->GetVelocity()); - const ndVector veloc1 (body1->GetVelocity()); - - for (ndInt32 i = 0; i < 3; ++i) - { - if (m_controlDofOptions & (1 << i)) - { - const ndVector pin = axisDir[i]; - AddLinearRowJacobian(desc, posit0, posit1, pin); - const ndInt32 index = desc.m_rowsCount - 1; - const ndJacobian& jacobian0 = desc.m_jacobian[index].m_jacobianM0; - const ndJacobian& jacobian1 = desc.m_jacobian[index].m_jacobianM1; - const ndFloat32 relPosit = (jacobian0.m_linear * posit0 + jacobian1.m_linear * posit1).AddHorizontal().GetScalar(); - const ndFloat32 relVeloc = (jacobian0.m_linear * veloc0 + jacobian0.m_angular * omega0 + jacobian1.m_linear * veloc1 + jacobian1.m_angular * omega1).AddHorizontal().GetScalar(); - const ndFloat32 accel = CalculateSpringDamperAcceleration(desc.m_timestep, m_linearSpring, relPosit, m_linearDamper, relVeloc); - SetMotorAcceleration(desc, accel); - SetLowerFriction(desc, -m_linearMaxForce); - SetHighFriction(desc, m_linearMaxForce); - } - } -#endif -} - -void ndIk6DofEffector::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - SubmitLinearAxis(matrix0, matrix1, desc); - SubmitAngularAxis(matrix0, matrix1, desc); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIk6DofEffector.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIk6DofEffector.h deleted file mode 100644 index 6934ee43b7..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIk6DofEffector.h +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_IK_6DOF_EFFECTOR_H__ -#define __ND_IK_6DOF_EFFECTOR_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndIk6DofEffector: public ndJointBilateralConstraint -{ - public: - enum ndRotationType - { - m_disabled, - m_fixAxis, - m_shortestPath, - }; - - D_CLASS_REFLECTION(ndIk6DofEffector, ndJointBilateralConstraint) - - D_NEWTON_API ndIk6DofEffector(); - D_NEWTON_API ndIk6DofEffector(const ndMatrix& pinAndPivotChild, const ndMatrix& pinAndPivotParent, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndIk6DofEffector(); - - D_NEWTON_API void EnableAxisX(bool state); - D_NEWTON_API void EnableAxisY(bool state); - D_NEWTON_API void EnableAxisZ(bool state); - D_NEWTON_API void EnableRotationAxis(ndRotationType type); - - D_NEWTON_API bool GetAxisX() const; - D_NEWTON_API bool GetAxisY() const; - D_NEWTON_API bool GetAxisZ() const; - D_NEWTON_API ndRotationType GetRotationAxis() const; - - D_NEWTON_API ndMatrix GetOffsetMatrix() const; - D_NEWTON_API ndMatrix GetEffectorMatrix() const; - D_NEWTON_API void SetOffsetMatrix(const ndMatrix& matrix); - - D_NEWTON_API void SetLinearSpringDamper(ndFloat32 regularizer, ndFloat32 springConst, ndFloat32 damperConst); - D_NEWTON_API void GetLinearSpringDamper(ndFloat32& regularizer, ndFloat32& springConst, ndFloat32& damperConst) const; - - D_NEWTON_API void SetAngularSpringDamper(ndFloat32 regularizer, ndFloat32 springConst, ndFloat32 damperConst); - D_NEWTON_API void GetAngularSpringDamper(ndFloat32& regularizer, ndFloat32& springConst, ndFloat32& damperConst) const; - - D_NEWTON_API ndFloat32 GetMaxForce() const; - D_NEWTON_API void SetMaxForce(ndFloat32 force); - - D_NEWTON_API ndFloat32 GetMaxTorque() const; - D_NEWTON_API void SetMaxTorque(ndFloat32 torque); - D_NEWTON_API void DebugJoint(ndConstraintDebugCallback& debugCallback) const; - - D_NEWTON_API ndMatrix CalculateGlobalMatrix1() const; - D_NEWTON_API ndMatrix CalculateGlobalBaseMatrix1() const; - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - D_NEWTON_API void SubmitLinearAxis(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc); - D_NEWTON_API void SubmitAngularAxis(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc); - D_NEWTON_API void SubmitShortestPathAxis(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc); - - ndMatrix m_targetFrame; - ndFloat32 m_angularSpring; - ndFloat32 m_angularDamper; - ndFloat32 m_angularMaxTorque; - ndFloat32 m_angularRegularizer; - ndFloat32 m_angularMaxSpringRamp; - - ndFloat32 m_linearSpring; - ndFloat32 m_linearDamper; - ndFloat32 m_linearMaxForce; - ndFloat32 m_linearRegularizer; - ndFloat32 m_linearMaxSpringRamp; - - ndRotationType m_rotationType; - union - { - ndUnsigned8 m_controlDofOptions; - struct - { - ndUnsigned8 m_axisX : 1; - ndUnsigned8 m_axisY : 1; - ndUnsigned8 m_axisZ : 1; - }; - }; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointDoubleHinge.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointDoubleHinge.cpp deleted file mode 100644 index 4190644b14..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointDoubleHinge.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndIkJointDoubleHinge.h" - -ndIkJointDoubleHinge::ndIkJointDoubleHinge() - :ndJointDoubleHinge() - ,ndJointBilateralConstraint::ndIkInterface() -{ -} - -ndIkJointDoubleHinge::ndIkJointDoubleHinge(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointDoubleHinge(pinAndPivotFrame, child, parent) - ,ndJointBilateralConstraint::ndIkInterface() -{ -} - -ndIkJointDoubleHinge::~ndIkJointDoubleHinge() -{ -} - -void ndIkJointDoubleHinge::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - ApplyBaseRows(desc, matrix0, matrix1); - if (!m_ikMode) - { - const ndVector pin0(matrix0.m_front); - ndFloat32 accel0 = (pin0 * m_accel0.m_angular - pin0 * m_accel1.m_angular).AddHorizontal().GetScalar(); - AddAngularRowJacobian(desc, pin0, 0.0f); - SetMotorAcceleration(desc, accel0); - SetDiagonalRegularizer(desc, m_defualtRegularizer); - - const ndVector pin1(matrix1.m_up); - ndFloat32 accel1 = (pin1 * m_accel0.m_angular - pin1 * m_accel1.m_angular).AddHorizontal().GetScalar(); - AddAngularRowJacobian(desc, pin1, 0.0f); - SetMotorAcceleration(desc, accel1); - SetDiagonalRegularizer(desc, m_defualtRegularizer); - } - SubmitLimits(desc, matrix0, matrix1); -} - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointDoubleHinge.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointDoubleHinge.h deleted file mode 100644 index 5af6452efb..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointDoubleHinge.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_IK_DOUBLE_JOINT_HINGE_H__ -#define __ND_IK_DOUBLE_JOINT_HINGE_H__ - -#include "ndNewtonStdafx.h" -#include "dJoints/ndJointDoubleHinge.h" - -class ndIkJointDoubleHinge: public ndJointDoubleHinge, public ndJointBilateralConstraint::ndIkInterface -{ - public: - D_CLASS_REFLECTION(ndIkJointDoubleHinge, ndJointDoubleHinge) - - D_NEWTON_API ndIkJointDoubleHinge(); - D_NEWTON_API ndIkJointDoubleHinge(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndIkJointDoubleHinge(); - - // inverse dynamics interface - D_ADD_IK_INTERFACE() - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointHinge.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointHinge.cpp deleted file mode 100644 index dc62e1d487..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointHinge.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndIkJointHinge.h" - -ndIkJointHinge::ndIkJointHinge() - :ndJointHinge() - ,ndJointBilateralConstraint::ndIkInterface() - ,m_maxTorque(D_IK_HINGE_MAX_TORQUE) -{ -} - -ndIkJointHinge::ndIkJointHinge(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointHinge(pinAndPivotFrame, child, parent) - ,ndJointBilateralConstraint::ndIkInterface() - ,m_maxTorque (D_IK_HINGE_MAX_TORQUE) -{ -} - -ndIkJointHinge::ndIkJointHinge(const ndMatrix& pinAndPivotInChild, const ndMatrix& pinAndPivotInParent, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointHinge(pinAndPivotInChild, pinAndPivotInParent, child, parent) - ,ndJointBilateralConstraint::ndIkInterface() - ,m_maxTorque(D_IK_HINGE_MAX_TORQUE) -{ -} - -ndIkJointHinge::~ndIkJointHinge() -{ -} - -ndFloat32 ndIkJointHinge::GetMaxTorque() const -{ - return m_maxTorque; -} - -void ndIkJointHinge::SetMaxTorque(ndFloat32 maxTorque) -{ - m_maxTorque = ndAbs(maxTorque); -} - -void ndIkJointHinge::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - ApplyBaseRows(desc, matrix0, matrix1); - if (!m_ikMode) - { - const ndVector pin(matrix0.m_front); - ndFloat32 accel = (pin * m_accel0.m_angular - pin * m_accel1.m_angular).AddHorizontal().GetScalar(); - AddAngularRowJacobian(desc, pin, 0.0f); - SetMotorAcceleration(desc, accel); - SetDiagonalRegularizer(desc, m_defualtRegularizer); - if (m_maxTorque < D_IK_HINGE_MAX_TORQUE) - { - SetHighFriction(desc, m_maxTorque); - SetLowerFriction(desc, -m_maxTorque); - } - } - SubmitLimits(desc, matrix0, matrix1); -} - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointHinge.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointHinge.h deleted file mode 100644 index 8a2e81c34d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointHinge.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_IK_JOINT_HINGE_H__ -#define __ND_IK_JOINT_HINGE_H__ - -#include "ndNewtonStdafx.h" -#include "dJoints/ndJointHinge.h" - -// setting to a value larger that D_IK_HINGE_MAX_TORQUE, disable torque limit -#define D_IK_HINGE_MAX_TORQUE ndFloat32 (1.0e10f) - -class ndIkJointHinge: public ndJointHinge, public ndJointBilateralConstraint::ndIkInterface -{ - public: - D_CLASS_REFLECTION(ndIkJointHinge, ndJointHinge) - - D_NEWTON_API ndIkJointHinge(); - D_NEWTON_API ndIkJointHinge(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API ndIkJointHinge(const ndMatrix& pinAndPivotInChild, const ndMatrix& pinAndPivotInParent, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndIkJointHinge(); - - // inverse dynamics interface - D_ADD_IK_INTERFACE() - - D_NEWTON_API ndFloat32 GetMaxTorque() const; - D_NEWTON_API void SetMaxTorque(ndFloat32 maxTorque); - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - - ndFloat32 m_maxTorque; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointSpherical.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointSpherical.cpp deleted file mode 100644 index 28a28f2175..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointSpherical.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndIkJointSpherical.h" - -ndIkJointSpherical::ndIkJointSpherical() - :ndJointSpherical() - ,ndJointBilateralConstraint::ndIkInterface() -{ -} - -ndIkJointSpherical::ndIkJointSpherical(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointSpherical(pinAndPivotFrame, child, parent) - ,ndJointBilateralConstraint::ndIkInterface() -{ -} - -ndIkJointSpherical::~ndIkJointSpherical() -{ -} - -void ndIkJointSpherical::DebugJoint(ndConstraintDebugCallback& debugCallback) const -{ - ndJointSpherical::DebugJoint(debugCallback); -} - -void ndIkJointSpherical::SubmitAccel(const ndMatrix&, const ndMatrix& matrix1, ndConstraintDescritor& desc) -{ - // if we have the alpha, there is not need to find a shortest path, any set of axis will do - for (ndInt32 i = 0; i < 3; ++i) - { - ndFloat32 accel = (matrix1[i] * m_accel0.m_angular - matrix1[i] * m_accel1.m_angular).AddHorizontal().GetScalar(); - AddAngularRowJacobian(desc, matrix1[i], ndFloat32(0.0f)); - SetMotorAcceleration(desc, accel); - SetDiagonalRegularizer(desc, m_defualtRegularizer); - } -} - -void ndIkJointSpherical::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - ApplyBaseRows(matrix0, matrix1, desc); - if (!m_ikMode) - { - SubmitAccel(matrix0, matrix1, desc); - } - SubmitLimits(matrix0, matrix1, desc); -} - -ndInt32 ndIkJointSpherical::GetKinematicState(ndKinematicState* const state) const -{ - ndMatrix matrix0; - ndMatrix matrix1; - ndVector euler1; - - const ndBodyKinematic* const body0 = GetBody0(); - const ndBodyKinematic* const body1 = GetBody1(); - CalculateGlobalMatrix(matrix0, matrix1); - - const ndMatrix relMatrix(matrix0 * matrix1.Transpose3x3()); - const ndVector euler(relMatrix.CalcPitchYawRoll(euler1)); - state[0].m_posit = euler.m_x; - state[1].m_posit = euler.m_y; - state[2].m_posit = euler.m_z; - - const ndVector relOmega(matrix1.UnrotateVector(body0->GetOmega() - body1->GetOmega())); - state[0].m_velocity = relOmega.m_x; - state[1].m_velocity = relOmega.m_y; - state[2].m_velocity = relOmega.m_z; - - return 3; -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointSpherical.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointSpherical.h deleted file mode 100644 index 4d26366a42..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkJointSpherical.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_IK_JOINT_SPHERICAL_H__ -#define __ND_IK_JOINT_SPHERICAL_H__ - -#include "ndNewtonStdafx.h" -#include "dJoints/ndJointSpherical.h" - -class ndIkJointSpherical: public ndJointSpherical, public ndJointBilateralConstraint::ndIkInterface -{ - public: - D_CLASS_REFLECTION(ndIkJointSpherical, ndJointSpherical) - - D_NEWTON_API ndIkJointSpherical(); - D_NEWTON_API ndIkJointSpherical(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndIkJointSpherical(); - - // inverse dynamics interface - D_ADD_IK_INTERFACE() - - protected: - D_NEWTON_API void SubmitAccel(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc); - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - D_NEWTON_API void DebugJoint(ndConstraintDebugCallback& debugCallback) const; - - D_NEWTON_API ndInt32 GetKinematicState(ndKinematicState* const state) const; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSolver.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSolver.cpp deleted file mode 100644 index 46585d3f76..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSolver.cpp +++ /dev/null @@ -1,610 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndIkSolver.h" -#include "ndBodyDynamic.h" -#include "ndDynamicsUpdate.h" -#include "ndSkeletonContainer.h" -#include "ndJointBilateralConstraint.h" - -ndIkSolver::ndIkSolver() - :ndClassAlloc() - ,m_contacts(32) - ,m_bodies(32) - ,m_savedBodiesIndex(32) - ,m_leftHandSide(128) - ,m_rightHandSide(128) - ,m_surrogateContact(32) - ,m_surrogateBodies(32) - ,m_world(nullptr) - ,m_skeleton(nullptr) - ,m_timestep(ndFloat32(0.0f)) - ,m_invTimestep(ndFloat32(0.0f)) - ,m_maxAccel(ndFloat32(1.0e3f)) - ,m_maxAlpha(ndFloat32(1.0e4f)) -{ - ndBodyDynamic* const sentinelBody = new ndBodyDynamic; - m_surrogateBodies.PushBack(sentinelBody); - sentinelBody->m_uniqueId = 0; -} - -ndIkSolver::~ndIkSolver() -{ - for (ndInt32 i = ndInt32(m_surrogateBodies.GetCount()) - 1; i >= 0; --i) - { - delete m_surrogateBodies[i]; - } - - for (ndInt32 i = ndInt32(m_surrogateContact.GetCount()) - 1; i >= 0; --i) - { - delete m_surrogateContact[i]; - } -} - -void ndIkSolver::SetMaxAccel(ndFloat32 maxAccel, ndFloat32 maxAlpha) -{ - m_maxAlpha = ndAbs(maxAlpha); - m_maxAccel = ndAbs(maxAccel); -} - -void ndIkSolver::GetJacobianDerivatives(ndConstraint* const joint) -{ - ndConstraintDescritor constraintParam; - ndAssert(joint->GetRowsCount() <= D_CONSTRAINT_MAX_ROWS); - for (ndInt32 i = ndInt32(joint->GetRowsCount() - 1); i >= 0; --i) - { - constraintParam.m_forceBounds[i].m_low = D_MIN_BOUND; - constraintParam.m_forceBounds[i].m_upper = D_MAX_BOUND; - constraintParam.m_forceBounds[i].m_jointForce = nullptr; - constraintParam.m_forceBounds[i].m_normalIndex = D_INDEPENDENT_ROW; - } - joint->m_rowCount = ndInt32(joint->GetRowsCount()); - - constraintParam.m_rowsCount = 0; - constraintParam.m_timestep = m_timestep; - constraintParam.m_invTimestep = m_invTimestep; - joint->JacobianDerivative(constraintParam); - const ndInt32 dof = constraintParam.m_rowsCount; - ndAssert(dof <= joint->m_rowCount); - - if (joint->GetAsContact()) - { - ndContact* const contactJoint = joint->GetAsContact(); - contactJoint->m_isInSkeletonLoop = 0; - ndSkeletonContainer* const skeleton0 = contactJoint->GetBody0()->GetSkeleton(); - ndSkeletonContainer* const skeleton1 = contactJoint->GetBody1()->GetSkeleton(); - if (skeleton0 && (skeleton0 == skeleton1)) - { - if (contactJoint->IsSkeletonSelftCollision()) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(contactJoint); - } - } - else - { - if (skeleton0 && !skeleton1) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(contactJoint); - } - else if (skeleton1 && !skeleton0) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton1->AddCloseLoopJoint(contactJoint); - } - } - } - else - { - ndJointBilateralConstraint* const bilareral = joint->GetAsBilateral(); - ndAssert(bilareral); - if (!bilareral->GetSkeletonFlag() && (bilareral->GetSolverModel() == m_jointkinematicAttachment)) - { - ndSkeletonContainer* const skeleton0 = bilareral->GetBody0()->GetSkeleton(); - ndSkeletonContainer* const skeleton1 = bilareral->GetBody1()->GetSkeleton(); - if (skeleton0 || skeleton1) - { - if (skeleton0 && !skeleton1) - { - bilareral->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(bilareral); - } - else if (skeleton1 && !skeleton0) - { - bilareral->m_isInSkeletonLoop = 1; - skeleton1->AddCloseLoopJoint(bilareral); - } - } - } - } - - joint->m_rowCount = dof; - joint->m_rowStart = ndInt32(m_leftHandSide.GetCount()); - const ndInt32 baseIndex = joint->m_rowStart; - ndAssert(baseIndex == ndInt32(m_leftHandSide.GetCount())); - ndAssert(baseIndex == ndInt32(m_leftHandSide.GetCount())); - for (ndInt32 i = 0; i < dof; ++i) - { - ndAssert(constraintParam.m_forceBounds[i].m_jointForce); - - m_leftHandSide.PushBack(ndLeftHandSide()); - m_rightHandSide.PushBack(ndRightHandSide()); - ndLeftHandSide* const row = &m_leftHandSide[baseIndex + i]; - ndRightHandSide* const rhs = &m_rightHandSide[baseIndex + i]; - - row->m_Jt = constraintParam.m_jacobian[i]; - rhs->m_diagDamp = ndFloat32(0.0f); - rhs->m_diagonalRegularizer = ndMax(constraintParam.m_diagonalRegularizer[i], ndFloat32(1.0e-5f)); - - rhs->m_coordenateAccel = constraintParam.m_jointAccel[i]; - rhs->m_restitution = constraintParam.m_restitution[i]; - rhs->m_penetration = constraintParam.m_penetration[i]; - rhs->m_penetrationStiffness = constraintParam.m_penetrationStiffness[i]; - rhs->m_lowerBoundFrictionCoefficent = constraintParam.m_forceBounds[i].m_low; - rhs->m_upperBoundFrictionCoefficent = constraintParam.m_forceBounds[i].m_upper; - rhs->m_jointFeebackForce = constraintParam.m_forceBounds[i].m_jointForce; - - ndAssert(constraintParam.m_forceBounds[i].m_normalIndex >= -1); - const ndInt32 frictionIndex = constraintParam.m_forceBounds[i].m_normalIndex; - const ndInt32 mask = frictionIndex >> 31; - rhs->m_normalForceIndex = frictionIndex; - rhs->m_normalForceIndexFlat = ~mask & (frictionIndex + baseIndex); - } -} - -void ndIkSolver::UpdateJointAcceleration(ndConstraint* const joint) -{ - ndConstraintDescritor constraintParam; - ndAssert(joint->GetRowsCount() <= D_CONSTRAINT_MAX_ROWS); - for (ndInt32 i = ndInt32(joint->GetRowsCount() - 1); i >= 0; --i) - { - constraintParam.m_forceBounds[i].m_low = D_MIN_BOUND; - constraintParam.m_forceBounds[i].m_upper = D_MAX_BOUND; - constraintParam.m_forceBounds[i].m_jointForce = nullptr; - constraintParam.m_forceBounds[i].m_normalIndex = D_INDEPENDENT_ROW; - } - ndAssert(!joint->GetAsContact()); - const ndInt32 dof = joint->m_rowCount; - joint->m_rowCount = ndInt32(joint->GetRowsCount()); - constraintParam.m_rowsCount = 0; - constraintParam.m_timestep = m_timestep; - constraintParam.m_invTimestep = m_invTimestep; - joint->JacobianDerivative(constraintParam); - - ndAssert(dof <= joint->m_rowCount); - ndAssert(dof == constraintParam.m_rowsCount); - joint->m_rowCount = dof; - - ndAssert(joint->GetAsBilateral()); - ndAssert(joint->GetAsBilateral()->GetSolverModel() != m_jointkinematicAttachment); - ndAssert(joint->GetAsBilateral()->GetBody0()->GetSkeleton() == m_skeleton); - ndAssert(joint->GetAsBilateral()->GetBody1()->GetSkeleton() == m_skeleton); - - const ndInt32 baseIndex = joint->m_rowStart; - for (ndInt32 i = 0; i < dof; ++i) - { - ndAssert(constraintParam.m_forceBounds[i].m_jointForce); - ndRightHandSide* const rhs = &m_rightHandSide[baseIndex + i]; - rhs->m_coordenateAccel = constraintParam.m_jointAccel[i]; - } -} - -void ndIkSolver::BuildJacobianMatrix (ndConstraint* const joint) -{ - ndAssert(joint->GetBody0()); - ndAssert(joint->GetBody1()); - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - - const ndInt32 index = joint->m_rowStart; - const ndInt32 count = joint->m_rowCount; - const ndMatrix& invInertia0 = body0->m_invWorldInertiaMatrix; - const ndMatrix& invInertia1 = body1->m_invWorldInertiaMatrix; - const ndVector invMass0(body0->m_invMass[3]); - const ndVector invMass1(body1->m_invMass[3]); - const ndFloat32 diagDampScale = joint->GetAsContact() ? ndFloat32(0.1f) : ndFloat32(1.0f); - - //const ndVector force0(body0->GetForce()); - //const ndVector torque0(body0->GetTorque()); - //const ndVector force1(body1->GetForce()); - //const ndVector torque1(body1->GetTorque()); - - for (ndInt32 i = 0; i < count; ++i) - { - ndLeftHandSide* const row = &m_leftHandSide[index + i]; - ndRightHandSide* const rhs = &m_rightHandSide[index + i]; - - row->m_JMinv.m_jacobianM0.m_linear = row->m_Jt.m_jacobianM0.m_linear * invMass0; - row->m_JMinv.m_jacobianM0.m_angular = invInertia0.RotateVector(row->m_Jt.m_jacobianM0.m_angular); - row->m_JMinv.m_jacobianM1.m_linear = row->m_Jt.m_jacobianM1.m_linear * invMass1; - row->m_JMinv.m_jacobianM1.m_angular = invInertia1.RotateVector(row->m_Jt.m_jacobianM1.m_angular); - - const ndJacobian& JtM0 = row->m_Jt.m_jacobianM0; - const ndJacobian& JtM1 = row->m_Jt.m_jacobianM1; - const ndJacobian& JMinvM0 = row->m_JMinv.m_jacobianM0; - const ndJacobian& JMinvM1 = row->m_JMinv.m_jacobianM1; - - rhs->m_force = ndFloat32(0.0f); - const ndVector tmpDiag( - JMinvM0.m_linear * JtM0.m_linear + JMinvM0.m_angular * JtM0.m_angular + - JMinvM1.m_linear * JtM1.m_linear + JMinvM1.m_angular * JtM1.m_angular); - - ndAssert(tmpDiag.AddHorizontal().GetScalar() * diagDampScale > ndFloat32(0.0f)); - rhs->m_diagDamp = tmpDiag.AddHorizontal().GetScalar() * diagDampScale * rhs->m_diagonalRegularizer; - } -} - -bool ndIkSolver::IsSleeping(ndSkeletonContainer* const skeleton) const -{ - return skeleton->m_isResting ? true : false; -} - -void ndIkSolver::BuildMassMatrix() -{ - m_bodies.SetCount(0); - m_contacts.SetCount(0); - m_leftHandSide.SetCount(0); - m_rightHandSide.SetCount(0); - - const ndVector zero(ndVector::m_zero); - m_bodies.PushBack(m_surrogateBodies[0]); - m_surrogateBodies[0]->m_index = 0; - m_surrogateBodies[0]->m_accel = zero; - m_surrogateBodies[0]->m_alpha = zero; - - auto CopyOpenLoopBody = [this](ndBodyKinematic* const body) - { - if (body->GetInvMass() > ndFloat32(0.0f)) - { - ndAssert(body->GetId() > 0); - ndAssert(body->GetInvMass() > ndFloat32(0.0f)); - ndUnsigned32 id = body->GetId(); - - m_bodies.PushBack(body); - for (ndInt32 i = ndInt32(m_bodies.GetCount()) - 1; i >= 1; --i) - { - if (id > m_bodies[i - 1]->GetId()) - { - m_bodies[i] = body; - break; - } - m_bodies[i] = m_bodies[i - 1]; - } - } - }; - - // add open loop bodies - for (ndInt32 i = 0; i < m_skeleton->m_nodeList.GetCount(); ++i) - { - ndSkeletonContainer::ndNode* const node = m_skeleton->m_nodesOrder[i]; - ndBodyKinematic* const body = node->m_body; - CopyOpenLoopBody(body); - } - - auto CopyCloseLoopBody = [this](ndBodyKinematic* const body) - { - ndAssert(body->GetId() > 0); - if (body->GetInvMass() == ndFloat32(0.0f)) - { - return; - } - - for (ndInt32 i = ndInt32(m_bodies.GetCount()) - 1; i >= 1; --i) - { - if (body == m_bodies[i]) - { - return; - } - } - - ndUnsigned32 id = body->GetId(); - m_bodies.PushBack(body); - for (ndInt32 i = ndInt32(m_bodies.GetCount()) - 1; i >= 1; --i) - { - if (id > m_bodies[i - 1]->GetId()) - { - m_bodies[i] = body; - break; - } - m_bodies[i] = m_bodies[i - 1]; - } - }; - - // add close loop - for (ndInt32 i = m_skeleton->m_dynamicsLoopCount + m_skeleton->m_loopCount - 1; i >= 0; --i) - { - ndConstraint* const joint = m_skeleton->m_loopingJoints[i]; - ndBodyKinematic* const body0 = joint->GetBody0(); - ndBodyKinematic* const body1 = joint->GetBody1(); - - ndAssert(body0->GetInvMass() > ndFloat32(0.0f)); - CopyCloseLoopBody(body0); - CopyCloseLoopBody(body1); - } - - // add contacts loop bodies and joints - class ndBodyPair - { - public: - ndBodyKinematic* m_body; - ndBodyKinematic* m_surrogateBody; - }; - ndFixSizeArray m_surrogateArray; - - ndInt32 surrogateBodiesIndex = 1; - ndInt32 surrogateContactIndex = 0; - for (ndInt32 i = m_skeleton->m_nodeList.GetCount() - 1; i >= 0 ; --i) - { - ndSkeletonContainer::ndNode* const node = m_skeleton->m_nodesOrder[i]; - ndBodyKinematic* const body = node->m_body; - - if (body->GetInvMass() > ndFloat32(0.0f)) - { - ndBodyKinematic::ndContactMap& contactMap = body->GetContactMap(); - ndBodyKinematic::ndContactMap::Iterator it(contactMap); - - for (it.Begin(); it; it++) - { - ndContact* const contact = it.GetNode()->GetInfo(); - if (contact->IsActive()) - { - bool duplicate = false; - for (ndInt32 j = ndInt32(m_contacts.GetCount()) - 1; j >= 0; --j) - { - duplicate = duplicate || (m_contacts[j] == contact); - } - if (!duplicate) - { - auto GetSurrogateBody = [this, &m_surrogateArray, &surrogateBodiesIndex](ndBodyKinematic* const body) - { - for (ndInt32 i = m_surrogateArray.GetCount() - 1; i >= 0; --i) - { - if (body == m_surrogateArray[i].m_body) - { - return m_surrogateArray[i].m_surrogateBody; - } - } - if (surrogateBodiesIndex == ndInt32(m_surrogateBodies.GetCount())) - { - ndBodyDynamic* const surrogateBody = new ndBodyDynamic(); - m_surrogateBodies.PushBack(surrogateBody); - } - ndBodyKinematic* const surrogateBody = m_surrogateBodies[surrogateBodiesIndex]; - - ndBodyPair pair; - pair.m_body = body; - pair.m_surrogateBody = surrogateBody; - m_surrogateArray.PushBack(pair); - - m_bodies.PushBack(surrogateBody); - surrogateBodiesIndex++; - body->InitSurrogateBody(surrogateBody); - return surrogateBody; - }; - - ndBodyKinematic* const body0 = contact->GetBody0()->GetAsBodyDynamic(); - ndBodyKinematic* const body1 = contact->GetBody1()->GetAsBodyDynamic(); - if (body0 == body) - { - if (body1->GetInvMass() == ndFloat32(0.0f)) - { - m_contacts.PushBack(contact); - } - else - { - ndBodyKinematic* const surrogateBody = GetSurrogateBody(body1); - - if (surrogateContactIndex == ndInt32(m_surrogateContact.GetCount())) - { - m_surrogateContact.PushBack(new ndContact); - } - ndContact* const surrogateContact = m_surrogateContact[surrogateContactIndex]; - surrogateContactIndex++; - contact->InitSurrogateContact(surrogateContact, body0, surrogateBody); - m_contacts.PushBack(surrogateContact); - } - } - else - { - ndAssert(body1 == body); - ndAssert(body1->GetInvMass() > ndFloat32(0.0f)); - ndBodyKinematic* const surrogateBody = GetSurrogateBody(body0); - - if (surrogateContactIndex == ndInt32(m_surrogateContact.GetCount())) - { - m_surrogateContact.PushBack(new ndContact); - } - ndContact* const surrogateContact = m_surrogateContact[surrogateContactIndex]; - surrogateContactIndex++; - contact->InitSurrogateContact(surrogateContact, surrogateBody, body1); - m_contacts.PushBack(surrogateContact); - } - } - } - } - } - } - - m_savedBodiesIndex.SetCount(m_bodies.GetCount()); - for (ndInt32 i = ndInt32(m_bodies.GetCount()) - 1; i >= 1 ; --i) - { - ndBodyKinematic* const body = m_bodies[i]; - m_savedBodiesIndex[i] = body->m_index; - body->m_index = i; - - body->UpdateInvInertiaMatrix(); - const ndVector gyroTorque(body->m_omega.CrossProduct(body->CalculateAngularMomentum())); - body->m_gyroTorque = gyroTorque; - } - - for (ndInt32 i = m_skeleton->m_nodeList.GetCount() - 2; i >= 0; --i) - { - ndSkeletonContainer::ndNode* const node = m_skeleton->m_nodesOrder[i]; - ndJointBilateralConstraint* const joint = node->m_joint; - GetJacobianDerivatives(joint); - BuildJacobianMatrix(joint); - } - - const ndInt32 loops = m_skeleton->m_dynamicsLoopCount + m_skeleton->m_loopCount; - for (ndInt32 i = 0; i < loops; ++i) - { - ndConstraint* const joint = m_skeleton->m_loopingJoints[i]; - GetJacobianDerivatives(joint); - BuildJacobianMatrix(joint); - } - - for (ndInt32 i = 0; i < m_contacts.GetCount(); ++i) - { - ndContact* const contact = m_contacts[i]; - GetJacobianDerivatives(contact); - BuildJacobianMatrix(contact); - } - - m_skeleton->InitMassMatrix(&m_leftHandSide[0], &m_rightHandSide[0]); -} - -void ndIkSolver::SolverBegin(ndSkeletonContainer* const skeleton, ndJointBilateralConstraint* const* joints, ndInt32 jointCount, ndWorld* const world, ndFloat32 timestep) -{ - m_world = world; - m_skeleton = skeleton; - if (m_skeleton) - { - m_timestep = timestep; - m_invTimestep = ndFloat32(1.0f) / m_timestep; - - m_skeleton->ClearCloseLoopJoints(); - for (ndInt32 i = jointCount - 1; i >= 0; --i) - { - m_skeleton->AddCloseLoopJoint((ndConstraint*)joints[i]); - } - - for (ndInt32 i = m_skeleton->m_nodeList.GetCount() - 2; i >= 0; --i) - { - ndSkeletonContainer::ndNode* const node = m_skeleton->m_nodesOrder[i]; - ndJointBilateralConstraint* const joint = node->m_joint; - joint->SetIkMode(true); - } - - BuildMassMatrix(); - } -} - -void ndIkSolver::SolverEnd() -{ - if (m_skeleton) - { - for (ndInt32 i = ndInt32(m_bodies.GetCount())-1; i >= 1; --i) - { - ndBodyKinematic* const body = m_bodies[i]; - body->m_buildSkelIndex = 0; - body->m_index = m_savedBodiesIndex[i]; - } - - m_skeleton->ClearCloseLoopJoints(); - } -} - -//#pragma optimize( "", off ) -void ndIkSolver::Solve() -{ - ndAssert(m_skeleton); - if (m_skeleton) - { - const ndVector zero(ndVector::m_zero); - for (ndInt32 i = ndInt32(m_bodies.GetCount()) - 1; i >= 0; --i) - { - ndBodyKinematic* const body = m_bodies[i]; - body->m_accel = body->GetForce(); - body->m_alpha = body->GetTorque() - body->GetGyroTorque(); - } - for (ndInt32 i = ndInt32(m_contacts.GetCount()) - 1; i >= 0; --i) - { - ndContact* const contact = m_contacts[i]; - ndBodyKinematic* const body1 = contact->GetBody1(); - if (body1->GetInvMass() > ndFloat32 (0.0f)) - { - ndBodyKinematic* const body0 = contact->GetBody0(); - ndAssert((body0->GetSkeleton() == m_skeleton) || (body1->GetSkeleton() == m_skeleton)); - - ndBodyKinematic* const body = (body0->GetSkeleton() != m_skeleton) ? body0 : body1; - ndBodyKinematic::ndContactMap& contactMap = body->GetContactMap(); - ndBodyKinematic::ndContactMap::Iterator it(contactMap); - for (it.Begin(); it; it++) - { - ndContact* const fronterContact = it.GetNode()->GetInfo(); - if (fronterContact->IsActive() && (fronterContact != contact)) - { - if (body == fronterContact->GetBody0()) - { - body->m_accel += fronterContact->GetForceBody0(); - body->m_alpha += fronterContact->GetTorqueBody0(); - } - else - { - ndAssert(body == fronterContact->GetBody1()); - body->m_accel += fronterContact->GetForceBody1(); - body->m_alpha += fronterContact->GetTorqueBody1(); - } - } - } - } - } - - m_skeleton->SolveImmediate(*this); - - for (ndInt32 i = m_skeleton->m_nodeList.GetCount() - 2; i >= 0; --i) - { - ndJacobian accel0; - ndJacobian accel1; - const ndSkeletonContainer::ndNode* const node = m_skeleton->m_nodesOrder[i]; - ndJointBilateralConstraint* const joint = node->m_joint; - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - accel0.m_linear = body0->m_accel; - accel0.m_angular = body0->m_alpha; - accel1.m_linear = body1->m_accel; - accel1.m_angular = body1->m_alpha; - - #if 0 - ndFloat32 xxx0 = body0->m_omega.DotProduct(body0->m_omega).GetScalar(); - ndFloat32 xxx1 = body1->m_omega.DotProduct(body1->m_omega).GetScalar(); - ndFloat32 xxx2 = body0->m_accel.DotProduct(body0->m_accel).GetScalar(); - ndFloat32 xxx3 = body1->m_alpha.DotProduct(body1->m_alpha).GetScalar(); - if ((xxx0 > 50000.0f) || (xxx1 > 50000.0f) || (xxx2 > 1.0e8f) || (xxx3 > 1.0e8f)) - { - for (ndInt32 j = ndInt32(m_bodies.GetCount()) - 1; j >= 0; --j) - { - ndBodyKinematic* const body = m_bodies[j]; - body->m_accel = body->GetForce(); - body->m_alpha = body->GetTorque() - body->GetGyroTorque(); - } - m_skeleton->SolveImmediate(*this); - } - #endif - joint->SetIkSetAccel(accel0, accel1); - joint->SetIkMode(false); - } - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSolver.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSolver.h deleted file mode 100644 index 91d2a09070..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSolver.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SKELETON_IMMEDIATE_SOLVER_H__ -#define __ND_SKELETON_IMMEDIATE_SOLVER_H__ - -#include "ndNewtonStdafx.h" - -class ndWorld; -class ndConstraint; -class ndSkeletonContainer; - -class ndIkSolver: public ndClassAlloc -{ - public: - D_NEWTON_API ndIkSolver(); - D_NEWTON_API ~ndIkSolver(); - - D_NEWTON_API void SetMaxAccel(ndFloat32 maxAccel, ndFloat32 maxAlpha); - D_NEWTON_API bool IsSleeping(ndSkeletonContainer* const skeleton) const; - - D_NEWTON_API void SolverBegin(ndSkeletonContainer* const skeleton, ndJointBilateralConstraint* const* joint, ndInt32 jointCount, ndWorld* const world, ndFloat32 timestep); - D_NEWTON_API void Solve(); - D_NEWTON_API void UpdateJointAcceleration(ndConstraint* const joint); - D_NEWTON_API void SolverEnd(); - - //D_NEWTON_API ndVector GetBodyForce(const ndBodyKinematic* const body) const; - //D_NEWTON_API ndVector GetBodyTorque(const ndBodyKinematic* const body) const; - - private: - void BuildMassMatrix(); - void GetJacobianDerivatives(ndConstraint* const joint); - void BuildJacobianMatrix(ndConstraint* const joint); - - class ndSurrogates - { - public: - ndContact* m_contact; - ndBodyDynamic* m_body; - ndContact* m_surrogateContact; - ndBodyDynamic* m_surrogateBody; - }; - - ndArray m_contacts; - ndArray m_bodies; - ndArray m_savedBodiesIndex; - ndArray m_leftHandSide; - ndArray m_rightHandSide; - - ndArray m_surrogateContact; - ndArray m_surrogateBodies; - - ndWorld* m_world; - ndSkeletonContainer* m_skeleton; - ndFloat32 m_timestep; - ndFloat32 m_invTimestep; - ndFloat32 m_maxAccel; - ndFloat32 m_maxAlpha; - - friend class ndSkeletonContainer; -}; - - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSwivelPositionEffector.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSwivelPositionEffector.cpp deleted file mode 100644 index 6b4f39f92c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSwivelPositionEffector.cpp +++ /dev/null @@ -1,333 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndSkeletonContainer.h" -#include "ndIkSwivelPositionEffector.h" - -ndIkSwivelPositionEffector::ndIkSwivelPositionEffector() - :ndJointBilateralConstraint() - ,m_restPosition(ndVector::m_wOne) - ,m_localTargetPosit(ndVector::m_wOne) - ,m_swivelAngle(ndFloat32(0.0f)) - ,m_angularSpring(ndFloat32(1000.0f)) - ,m_angularDamper(ndFloat32(50.0f)) - ,m_angularMaxTorque(D_LCP_MAX_VALUE) - ,m_angularRegularizer(ndFloat32(5.0e-3f)) - ,m_linearSpring(ndFloat32(1000.0f)) - ,m_linearDamper(ndFloat32(50.0f)) - ,m_linearMaxForce(D_LCP_MAX_VALUE) - ,m_linearRegularizer(ndFloat32(5.0e-3f)) - ,m_minWorkSpaceRadio(ndFloat32(0.0f)) - ,m_maxWorkSpaceRadio(ndFloat32(0.0f)) - ,m_enableSwivelControl(true) -{ - m_maxDof = 6; -} - -ndIkSwivelPositionEffector::ndIkSwivelPositionEffector(const ndVector& childPivotInGlobalSpace, const ndMatrix& pinAndPivotParentInGlobalSpace, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(6, child, parent, pinAndPivotParentInGlobalSpace) - ,m_restPosition(ndVector::m_wOne) - ,m_localTargetPosit(ndVector::m_wOne) - ,m_swivelAngle(ndFloat32(0.0f)) - ,m_angularSpring(ndFloat32(1000.0f)) - ,m_angularDamper(ndFloat32(50.0f)) - ,m_angularMaxTorque(D_LCP_MAX_VALUE) - ,m_angularRegularizer(ndFloat32(5.0e-3f)) - ,m_linearSpring(ndFloat32(1000.0f)) - ,m_linearDamper(ndFloat32(50.0f)) - ,m_linearMaxForce(D_LCP_MAX_VALUE) - ,m_linearRegularizer(ndFloat32(5.0e-3f)) - ,m_minWorkSpaceRadio(ndFloat32(0.0f)) - ,m_maxWorkSpaceRadio(ndFloat32(0.0f)) - ,m_enableSwivelControl(true) -{ - ndMatrix temp; - ndMatrix matrix(pinAndPivotParentInGlobalSpace); - matrix.m_posit = childPivotInGlobalSpace; - CalculateLocalMatrix(matrix, m_localMatrix0, temp); - ndAssert((temp[0].DotProduct(m_localMatrix0[0]).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert((temp[1].DotProduct(m_localMatrix0[1]).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - ndAssert((temp[2].DotProduct(m_localMatrix0[2]).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-4f)); - - ndVector offset(pinAndPivotParentInGlobalSpace.UntransformVector(childPivotInGlobalSpace) & ndVector::m_triplexMask); - m_maxWorkSpaceRadio = ndFloat32(0.99f) * ndSqrt(offset.DotProduct(offset).GetScalar()); - m_restPosition = offset.Normalize().Scale(m_maxWorkSpaceRadio) | ndVector::m_wOne; - SetLocalTargetPosition(m_restPosition); - - SetSolverModel(m_jointkinematicCloseLoop); -} - -ndIkSwivelPositionEffector::~ndIkSwivelPositionEffector() -{ -} - -bool ndIkSwivelPositionEffector::GetSwivelMode() const -{ - return m_enableSwivelControl; -} - -void ndIkSwivelPositionEffector::SetSwivelMode(bool active) -{ - m_enableSwivelControl = active; -} - -ndFloat32 ndIkSwivelPositionEffector::GetSwivelAngle() const -{ - return m_swivelAngle; -} - -void ndIkSwivelPositionEffector::SetSwivelAngle(ndFloat32 angle) -{ - m_swivelAngle = angle; -} - -ndVector ndIkSwivelPositionEffector::GetRestPosit() const -{ - return m_restPosition; -} - -void ndIkSwivelPositionEffector::SetRestPosit(const ndVector& posit) -{ - m_restPosition = posit & ndVector::m_wOne; -} - -ndVector ndIkSwivelPositionEffector::GetLocalTargetPosition() const -{ - return m_localTargetPosit; -} - -void ndIkSwivelPositionEffector::SetLocalTargetPosition(const ndVector& posit) -{ - ndVector target (posit & ndVector::m_triplexMask); - ndFloat32 dist2 = target.DotProduct(target).GetScalar(); - if (dist2 < ndFloat32(1.0e-4f)) - { - target = m_restPosition; - dist2 = target.DotProduct(target).GetScalar(); - } - if (dist2 > m_maxWorkSpaceRadio * m_maxWorkSpaceRadio) - { - target = target.Normalize().Scale(m_maxWorkSpaceRadio); - } - else if (dist2 < m_minWorkSpaceRadio * m_minWorkSpaceRadio) - { - target = target.Normalize().Scale(m_minWorkSpaceRadio); - } - m_localTargetPosit = target | ndVector::m_wOne; -} - -ndVector ndIkSwivelPositionEffector::GetGlobalPosition() const -{ - return GetBody0()->GetMatrix().TransformVector(GetLocalMatrix0().m_posit); -} - -void ndIkSwivelPositionEffector::SetWorkSpaceConstraints(ndFloat32 minRadio, ndFloat32 maxRadio) -{ - m_minWorkSpaceRadio = minRadio; - m_maxWorkSpaceRadio = maxRadio; - // make sure the target is with in the workspace constraint - SetLocalTargetPosition(GetLocalTargetPosition()); -} - -void ndIkSwivelPositionEffector::GetWorkSpaceConstraints(ndFloat32& minRadio, ndFloat32& maxRadio) const -{ - minRadio = m_minWorkSpaceRadio; - maxRadio = m_maxWorkSpaceRadio; -} - -ndFloat32 ndIkSwivelPositionEffector::GetMaxForce() const -{ - return m_linearMaxForce; -} - -void ndIkSwivelPositionEffector::SetMaxForce(ndFloat32 force) -{ - m_linearMaxForce = ndAbs(force); -} - -ndFloat32 ndIkSwivelPositionEffector::GetMaxTorque() const -{ - return m_angularMaxTorque; -} - -void ndIkSwivelPositionEffector::SetMaxTorque(ndFloat32 torque) -{ - m_angularMaxTorque = ndAbs(torque); -} - -void ndIkSwivelPositionEffector::SetLinearSpringDamper(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_linearSpring = ndAbs(spring); - m_linearDamper = ndAbs(damper); - m_linearRegularizer = ndClamp(regularizer, ndFloat32(1.0e-4f), ndFloat32(0.99f)); -} - -void ndIkSwivelPositionEffector::GetLinearSpringDamper(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_linearSpring; - damper = m_linearDamper; - regularizer = m_linearRegularizer; -} - -void ndIkSwivelPositionEffector::SetAngularSpringDamper(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_angularSpring = ndAbs(spring); - m_angularDamper = ndAbs(damper); - m_angularRegularizer = ndClamp(regularizer, ndFloat32(1.0e-4f), ndFloat32(0.99f)); -} - -void ndIkSwivelPositionEffector::GetAngularSpringDamper(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_angularSpring; - damper = m_angularDamper; - regularizer = m_angularRegularizer; -} - -ndMatrix ndIkSwivelPositionEffector::CalculateSwivelFrame(const ndMatrix& matrix1) const -{ - ndMatrix swivelMatrix; - ndVector pin((m_localTargetPosit & ndVector::m_triplexMask).Normalize()); - ndFloat32 yaw = -ndAsin(pin.m_z); - ndFloat32 roll = ndAtan2(pin.m_y, pin.m_x); - swivelMatrix = ndYawMatrix(yaw) * ndRollMatrix(roll) * matrix1; - swivelMatrix.m_posit = matrix1.TransformVector(m_localTargetPosit); - return swivelMatrix; -} - -ndVector ndIkSwivelPositionEffector::GetEffectorPosit() const -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - ndVector posit(matrix1.UntransformVector(matrix0.m_posit)); - - //const ndMatrix swivelMatrix(ndPitchMatrix(-m_swivelAngle) * CalculateSwivelFrame(matrix1)); - //posit.m_w = CalculateAngle(matrix0[1], swivelMatrix[1], swivelMatrix[0]); - return posit; -} - -ndInt32 ndIkSwivelPositionEffector::GetKinematicState(ndKinematicState* const state) const -{ - ndVector posit; - ndVector veloc; - ndMatrix matrix0; - ndMatrix matrix1; - - CalculateGlobalMatrix(matrix0, matrix1); - matrix1.m_posit = matrix1.TransformVector(m_localTargetPosit); - - const ndMatrix& axisDir = matrix1; - const ndVector omega0(m_body0->GetOmega()); - const ndVector omega1(m_body1->GetOmega()); - const ndVector veloc0(m_body0->GetVelocity()); - const ndVector veloc1(m_body1->GetVelocity()); - - ndPointParam param; - InitPointParam(param, matrix0.m_posit, matrix1.m_posit); - for (ndInt32 i = 0; i < 3; ++i) - { - const ndVector& pin = axisDir[i]; - const ndVector r0CrossDir(param.m_r0.CrossProduct(pin)); - const ndVector r1CrossDir(param.m_r1.CrossProduct(pin)); - posit[i] = (pin * param.m_posit0 - pin * param.m_posit1).AddHorizontal().GetScalar(); - veloc[i] = (pin * veloc0 + r0CrossDir * omega0 - pin * veloc1 - r1CrossDir * omega1).AddHorizontal().GetScalar(); - } - - const ndMatrix swivelMatrix(ndPitchMatrix(-m_swivelAngle) * CalculateSwivelFrame(matrix1)); - posit.m_w = CalculateAngle(matrix0[1], swivelMatrix[1], swivelMatrix[0]); - veloc.m_w = (omega0 * swivelMatrix.m_front - omega1 * swivelMatrix.m_front).AddHorizontal().GetScalar(); - - for (ndInt32 i = 0; i < 4; i++) - { - state[i].m_posit = posit[i]; - state[i].m_velocity = veloc[i]; - } - return 4; -} - -ndFloat32 ndIkSwivelPositionEffector::CalculateLookAtSwivelAngle(const ndVector& upDir) const -{ - ndFloat32 swivelAngle = GetSwivelAngle(); - const ndMatrix swivelMatrix(CalculateSwivelFrame(m_localMatrix1 * m_body1->GetMatrix())); - - ndVector side (swivelMatrix.m_front.CrossProduct(upDir)); - if (ndAbs(side.DotProduct(side).GetScalar()) > ndFloat32 (0.01f)) - { - ndMatrix targetswivelMatrix(swivelMatrix); - targetswivelMatrix.m_right = side.Normalize(); - targetswivelMatrix.m_up = targetswivelMatrix.m_right.CrossProduct(targetswivelMatrix.m_front); - const ndMatrix swivelPitch(swivelMatrix * targetswivelMatrix.OrthoInverse()); - swivelAngle = ndAtan2(swivelPitch.m_up.m_z, swivelPitch.m_up.m_y); - } - - return swivelAngle; -} - -void ndIkSwivelPositionEffector::DebugJoint(ndConstraintDebugCallback& debugCallback) const -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - //debugCallback.DrawFrame(matrix0); - //debugCallback.DrawFrame(matrix1); - debugCallback.DrawLine(matrix0.m_posit, matrix1.m_posit, ndVector(ndFloat32(0.89f), ndFloat32(0.70f), ndFloat32(0.13f), ndFloat32(1.0f))); - - const ndVector origin((matrix0.m_posit + matrix1.m_posit) * ndVector::m_half); - ndMatrix swivelMatrix1(CalculateSwivelFrame(matrix1)); - swivelMatrix1.m_posit = origin; - debugCallback.DrawFrame(swivelMatrix1); - - const ndMatrix swivelMatrix0(ndPitchMatrix(-m_swivelAngle) * swivelMatrix1); - debugCallback.DrawFrame(swivelMatrix0); -} - -void ndIkSwivelPositionEffector::SubmitLinearAxis(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - const ndVector posit0(matrix0.m_posit); - const ndVector posit1(matrix1.TransformVector(m_localTargetPosit)); - const ndMatrix& axisDir = matrix1; - for (ndInt32 i = 0; i < 3; ++i) - { - const ndVector pin = axisDir[i]; - AddLinearRowJacobian(desc, posit0, posit1, pin); - SetMassSpringDamperAcceleration(desc, m_linearRegularizer, m_linearSpring, m_linearDamper); - SetHighFriction(desc, m_linearMaxForce); - SetLowerFriction(desc, -m_linearMaxForce); - } -} - -void ndIkSwivelPositionEffector::SubmitAngularAxis(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - const ndMatrix swivelMatrix1(ndPitchMatrix(-m_swivelAngle) * CalculateSwivelFrame(matrix1)); - const ndVector& pin = swivelMatrix1.m_front; - const ndFloat32 angle = CalculateAngle(matrix0[1], swivelMatrix1[1], swivelMatrix1[0]); - - AddAngularRowJacobian(desc, pin, angle); - SetMassSpringDamperAcceleration(desc, m_angularRegularizer, m_angularSpring, m_angularDamper); - SetHighFriction(desc, m_angularMaxTorque); - SetLowerFriction(desc, -m_angularMaxTorque); -} - -void ndIkSwivelPositionEffector::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - SubmitLinearAxis(desc, matrix0, matrix1); - if (m_enableSwivelControl) - { - SubmitAngularAxis(desc, matrix0, matrix1); - } -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSwivelPositionEffector.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSwivelPositionEffector.h deleted file mode 100644 index db6dafb18f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/ndIkSwivelPositionEffector.h +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_IK_SWIVEL_POSITION_EFFECTOR_H__ -#define __ND_IK_SWIVEL_POSITION_EFFECTOR_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndIkSwivelPositionEffector: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndIkSwivelPositionEffector, ndJointBilateralConstraint) - - D_NEWTON_API ndIkSwivelPositionEffector(); - D_NEWTON_API ndIkSwivelPositionEffector(const ndVector& childPivotInGlobalSpace, const ndMatrix& pinAndPivotParentInGlobalSpace, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndIkSwivelPositionEffector(); - - D_NEWTON_API ndVector GetLocalTargetPosition() const; - D_NEWTON_API void SetLocalTargetPosition(const ndVector& posit); - - D_NEWTON_API ndVector GetEffectorPosit() const; - D_NEWTON_API ndVector GetGlobalPosition() const; - - D_NEWTON_API ndVector GetRestPosit() const; - D_NEWTON_API void SetRestPosit(const ndVector& posit); - - D_NEWTON_API ndFloat32 GetSwivelAngle() const; - D_NEWTON_API void SetSwivelAngle(ndFloat32 angle); - D_NEWTON_API ndFloat32 CalculateLookAtSwivelAngle(const ndVector& lookAtDir) const; - - D_NEWTON_API void SetLinearSpringDamper(ndFloat32 regularizer, ndFloat32 springConst, ndFloat32 damperConst); - D_NEWTON_API void GetLinearSpringDamper(ndFloat32& regularizer, ndFloat32& springConst, ndFloat32& damperConst) const; - - D_NEWTON_API void SetAngularSpringDamper(ndFloat32 regularizer, ndFloat32 springConst, ndFloat32 damperConst); - D_NEWTON_API void GetAngularSpringDamper(ndFloat32& regularizer, ndFloat32& springConst, ndFloat32& damperConst) const; - - D_NEWTON_API void SetWorkSpaceConstraints(ndFloat32 minRadio, ndFloat32 maxRadio); - D_NEWTON_API void GetWorkSpaceConstraints(ndFloat32& minRadio, ndFloat32& maxRadio) const; - - D_NEWTON_API ndFloat32 GetMaxForce() const; - D_NEWTON_API void SetMaxForce(ndFloat32 force); - - D_NEWTON_API bool GetSwivelMode() const; - D_NEWTON_API void SetSwivelMode(bool active); - - D_NEWTON_API ndFloat32 GetMaxTorque() const; - D_NEWTON_API void SetMaxTorque(ndFloat32 torque); - - D_NEWTON_API void DebugJoint(ndConstraintDebugCallback& debugCallback) const; - D_NEWTON_API ndInt32 GetKinematicState(ndKinematicState* const state) const; - - protected: - ndMatrix CalculateSwivelFrame(const ndMatrix& matrix1) const; - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - - void SubmitLinearAxis(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - void SubmitAngularAxis(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - ndVector m_restPosition; - ndVector m_localTargetPosit; - ndFloat32 m_swivelAngle; - - ndFloat32 m_angularSpring; - ndFloat32 m_angularDamper; - ndFloat32 m_angularMaxTorque; - ndFloat32 m_angularRegularizer; - - ndFloat32 m_linearSpring; - ndFloat32 m_linearDamper; - ndFloat32 m_linearMaxForce; - ndFloat32 m_linearRegularizer; - - ndFloat32 m_minWorkSpaceRadio; - ndFloat32 m_maxWorkSpaceRadio; - bool m_enableSwivelControl; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointCylinder.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointCylinder.cpp deleted file mode 100644 index df7e6cbcb2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointCylinder.cpp +++ /dev/null @@ -1,456 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointCylinder.h" - -#define D_MAX_SLIDER_RECOVERY_SPEED ndFloat32 (0.5f) -#define D_MAX_SLIDER_PENETRATION ndFloat32 (0.05f) - -#define D_MAX_HINGE_RECOVERY_SPEED ndFloat32 (0.25f) -#define D_MAX_HINGE_PENETRATION (ndFloat32 (4.0f) * ndDegreeToRad) - -ndJointCylinder::ndJointCylinder() - :ndJointBilateralConstraint() - ,m_angle(ndFloat32(0.0f)) - ,m_omega(ndFloat32(0.0f)) - ,m_springKAngle(ndFloat32(0.0f)) - ,m_damperCAngle(ndFloat32(0.0f)) - ,m_minLimitAngle(ndFloat32(-1.0e10f)) - ,m_maxLimitAngle(ndFloat32(1.0e10f)) - ,m_offsetAngle(ndFloat32(0.0f)) - ,m_springDamperRegularizerAngle(ndFloat32(0.1f)) - ,m_posit(ndFloat32(0.0f)) - ,m_speed(ndFloat32(0.0f)) - ,m_springKPosit(ndFloat32(0.0f)) - ,m_damperCPosit(ndFloat32(0.0f)) - ,m_minLimitPosit(ndFloat32(-1.0e10f)) - ,m_maxLimitPosit(ndFloat32(1.0e10f)) - ,m_offsetPosit(ndFloat32(0.0f)) - ,m_springDamperRegularizerPosit(ndFloat32(0.1f)) - ,m_limitStatePosit(0) - ,m_limitStateAngle(0) -{ - m_maxDof = 8; -} - -ndJointCylinder::ndJointCylinder(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(8, child, parent, pinAndPivotFrame) - ,m_angle(ndFloat32(0.0f)) - ,m_omega(ndFloat32(0.0f)) - ,m_springKAngle(ndFloat32(0.0f)) - ,m_damperCAngle(ndFloat32(0.0f)) - ,m_minLimitAngle(ndFloat32(-1.0e10f)) - ,m_maxLimitAngle(ndFloat32(1.0e10f)) - ,m_offsetAngle(ndFloat32(0.0f)) - ,m_springDamperRegularizerAngle(ndFloat32(0.1f)) - ,m_posit(ndFloat32(0.0f)) - ,m_speed(ndFloat32(0.0f)) - ,m_springKPosit(ndFloat32(0.0f)) - ,m_damperCPosit(ndFloat32(0.0f)) - ,m_minLimitPosit(ndFloat32(-1.0e10f)) - ,m_maxLimitPosit(ndFloat32(1.0e10f)) - ,m_offsetPosit(ndFloat32(0.0f)) - ,m_springDamperRegularizerPosit(ndFloat32(0.1f)) - ,m_limitStatePosit(0) - ,m_limitStateAngle(0) -{ -} - -ndJointCylinder::ndJointCylinder(const ndMatrix& pinAndPivotInChild, const ndMatrix& pinAndPivotInParent, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(8, child, parent, pinAndPivotInChild) - ,m_angle(ndFloat32(0.0f)) - ,m_omega(ndFloat32(0.0f)) - ,m_springKAngle(ndFloat32(0.0f)) - ,m_damperCAngle(ndFloat32(0.0f)) - ,m_minLimitAngle(ndFloat32(-1.0e10f)) - ,m_maxLimitAngle(ndFloat32(1.0e10f)) - ,m_offsetAngle(ndFloat32(0.0f)) - ,m_springDamperRegularizerAngle(ndFloat32(0.1f)) - ,m_posit(ndFloat32(0.0f)) - ,m_speed(ndFloat32(0.0f)) - ,m_springKPosit(ndFloat32(0.0f)) - ,m_damperCPosit(ndFloat32(0.0f)) - ,m_minLimitPosit(ndFloat32(-1.0e10f)) - ,m_maxLimitPosit(ndFloat32(1.0e10f)) - ,m_offsetPosit(ndFloat32(0.0f)) - ,m_springDamperRegularizerPosit(ndFloat32(0.1f)) - ,m_limitStatePosit(0) - ,m_limitStateAngle(0) -{ - ndMatrix tmp; - CalculateLocalMatrix(pinAndPivotInChild, m_localMatrix0, tmp); - CalculateLocalMatrix(pinAndPivotInParent, tmp, m_localMatrix1); -} - -ndJointCylinder::~ndJointCylinder() -{ -} - -ndFloat32 ndJointCylinder::GetAngle() const -{ - return m_angle; -} - -ndFloat32 ndJointCylinder::GetOmega() const -{ - return m_omega; -} - -bool ndJointCylinder::GetLimitStateAngle() const -{ - return m_limitStateAngle ? true : false; -} - -void ndJointCylinder::SetLimitStateAngle(bool state) -{ - m_limitStateAngle = state ? 1 : 0; - if (m_limitStateAngle) - { - SetLimitsAngle(m_minLimitAngle, m_maxLimitAngle); - } -} - -void ndJointCylinder::SetLimitsAngle(ndFloat32 minLimit, ndFloat32 maxLimit) -{ -#ifdef _DEBUG - if (minLimit > 0.0f) - { - ndTrace(("warning: %s minLimit %f larger than zero\n", __FUNCTION__, minLimit)) - } - if (maxLimit < 0.0f) - { - ndTrace(("warning: %s m_maxLimit %f smaller than zero\n", __FUNCTION__, maxLimit)) - } -#endif - - m_minLimitAngle = minLimit; - m_maxLimitAngle = maxLimit; - - if (m_angle > m_maxLimitAngle) - { - //const ndFloat32 deltaAngle = ndAnglesAdd(m_angle, -m_maxLimitAngle); - //m_angle = m_maxLimitAngle + deltaAngle; - m_angle = m_maxLimitAngle; - } - else if (m_angle < m_minLimitAngle) - { - //const ndFloat32 deltaAngle = ndAnglesAdd(m_angle, -m_minLimitAngle); - //m_angle = m_minLimitAngle + deltaAngle; - m_angle = m_minLimitAngle; - } -} - -void ndJointCylinder::GetLimitsAngle(ndFloat32& minLimit, ndFloat32& maxLimit) const -{ - minLimit = m_minLimitAngle; - maxLimit = m_maxLimitAngle; -} - -ndFloat32 ndJointCylinder::GetOffsetAngle() const -{ - return m_offsetAngle; -} - -void ndJointCylinder::SetOffsetAngle(ndFloat32 angle) -{ - m_offsetAngle = angle; -} - -void ndJointCylinder::SetAsSpringDamperAngle(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_springKAngle = ndAbs(spring); - m_damperCAngle = ndAbs(damper); - m_springDamperRegularizerAngle = ndClamp(regularizer, ndFloat32(1.0e-2f), ndFloat32(0.99f)); -} - -void ndJointCylinder::GetSpringDamperAngle(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_springKAngle; - damper = m_damperCAngle; - regularizer = m_springDamperRegularizerAngle; -} - -ndFloat32 ndJointCylinder::GetPosit() const -{ - return m_posit; -} - -ndFloat32 ndJointCylinder::GetOffsetPosit() const -{ - return m_offsetPosit; -} - -void ndJointCylinder::SetOffsetPosit(ndFloat32 offset) -{ - m_offsetPosit = offset; -} - -bool ndJointCylinder::GetLimitStatePosit() const -{ - return m_limitStatePosit ? true : false; -} - -void ndJointCylinder::SetLimitStatePosit(bool state) -{ - m_limitStatePosit = state ? 1 : 0; - if (m_limitStatePosit) - { - SetLimitsPosit(m_minLimitPosit, m_maxLimitPosit); - } -} - -void ndJointCylinder::SetLimitsPosit(ndFloat32 minLimit, ndFloat32 maxLimit) -{ - ndAssert(minLimit <= 0.0f); - ndAssert(maxLimit >= 0.0f); - -#ifdef _DEBUG - if (minLimit > 0.0f) - { - ndTrace(("warning: %s minLimit %f larger than zero\n", __FUNCTION__, minLimit)) - } - if (maxLimit < 0.0f) - { - ndTrace(("warning: %s m_maxLimit %f smaller than zero\n", __FUNCTION__, maxLimit)) - } -#endif - - m_minLimitPosit = minLimit; - m_maxLimitPosit = maxLimit; - if (m_posit > m_maxLimitPosit) - { - m_posit = m_maxLimitPosit; - } - else if (m_posit < m_minLimitPosit) - { - m_posit = m_minLimitPosit; - } -} - -void ndJointCylinder::GetLimitsPosit(ndFloat32& minLimit, ndFloat32& maxLimit) const -{ - minLimit = m_minLimitPosit; - maxLimit = m_maxLimitPosit; -} - -void ndJointCylinder::SetAsSpringDamperPosit(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_springKPosit = ndAbs(spring); - m_damperCPosit = ndAbs(damper); - m_springDamperRegularizerPosit = ndClamp(regularizer, ndFloat32(1.0e-2f), ndFloat32(0.99f)); -} - -void ndJointCylinder::GetSpringDamperPosit(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_springKPosit; - damper = m_damperCPosit; - regularizer = m_springDamperRegularizerPosit; -} - -void ndJointCylinder::DebugJoint(ndConstraintDebugCallback& debugCallback) const -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - debugCallback.DrawFrame(matrix0); - debugCallback.DrawFrame(matrix1); - - const ndInt32 subdiv = 8; - const ndFloat32 radius = debugCallback.m_debugScale; - ndVector arch[subdiv + 1]; - - ndFloat32 deltaTwist = m_maxLimitAngle - m_minLimitAngle; - if ((deltaTwist > ndFloat32(1.0e-3f)) && (deltaTwist <= ndFloat32(2.0f) * ndPi)) - { - ndMatrix pitchMatrix(matrix1); - pitchMatrix.m_posit = matrix1.m_posit; - - ndVector point(ndFloat32(0.0f), ndFloat32(radius), ndFloat32(0.0f), ndFloat32(0.0f)); - - ndFloat32 angleStep = ndMin(deltaTwist, ndFloat32(2.0f * ndPi)) / subdiv; - ndFloat32 angle0 = m_minLimitAngle; - - ndVector color(ndFloat32(0.4f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - for (ndInt32 i = 0; i <= subdiv; ++i) - { - arch[i] = pitchMatrix.TransformVector(ndPitchMatrix(angle0).RotateVector(point)); - debugCallback.DrawLine(pitchMatrix.m_posit, arch[i], color); - angle0 += angleStep; - } - - for (ndInt32 i = 0; i < subdiv; ++i) - { - debugCallback.DrawLine(arch[i], arch[i + 1], color); - } - } -} - -void ndJointCylinder::SubmitSpringDamperAngle(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& ) -{ - // add spring damper row - AddAngularRowJacobian(desc, matrix0.m_front, m_offsetAngle - m_angle); - SetMassSpringDamperAcceleration(desc, m_springDamperRegularizerAngle, m_springKAngle, m_damperCAngle); -} - -void ndJointCylinder::SubmitSpringDamperPosit(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - // add spring damper row - const ndVector p1(matrix1.m_posit + matrix1.m_front.Scale(m_offsetPosit)); - AddLinearRowJacobian(desc, matrix0.m_posit, p1, matrix1.m_front); - SetMassSpringDamperAcceleration(desc, m_springDamperRegularizerPosit, m_springKPosit, m_damperCPosit); -} - -void ndJointCylinder::ApplyBaseRows(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - const ndVector veloc0(m_body0->GetVelocityAtPoint(matrix0.m_posit)); - const ndVector veloc1(m_body1->GetVelocityAtPoint(matrix1.m_posit)); - - const ndVector& pin = matrix1[0]; - const ndVector& p0 = matrix0.m_posit; - const ndVector& p1 = matrix1.m_posit; - const ndVector prel(p0 - p1); - const ndVector vrel(veloc0 - veloc1); - - m_speed = vrel.DotProduct(matrix1.m_front).GetScalar(); - m_posit = prel.DotProduct(matrix1.m_front).GetScalar(); - const ndVector projectedPoint = p1 + pin.Scale(pin.DotProduct(prel).GetScalar()); - - AddLinearRowJacobian(desc, p0, projectedPoint, matrix1[1]); - AddLinearRowJacobian(desc, p0, projectedPoint, matrix1[2]); - - //const ndFloat32 angle0 = CalculateAngle(matrix0.m_up, matrix1.m_up, matrix1.m_front); - //AddAngularRowJacobian(desc, matrix1.m_front, angle0); - - const ndFloat32 angle1 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up); - AddAngularRowJacobian(desc, matrix1.m_up, angle1); - - const ndFloat32 angle2 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - AddAngularRowJacobian(desc, matrix1.m_right, angle2); - - // save the current joint Omega - const ndVector omega0(m_body0->GetOmega()); - const ndVector omega1(m_body1->GetOmega()); - - // the joint angle can be determined by getting the angle between any two non parallel vectors - const ndFloat32 deltaAngle = ndAnglesAdd(-CalculateAngle(matrix0.m_up, matrix1.m_up, matrix1.m_front), -m_angle); - m_angle += deltaAngle; - m_omega = matrix1.m_front.DotProduct(omega0 - omega1).GetScalar(); -} - -ndFloat32 ndJointCylinder::PenetrationOmega(ndFloat32 penetration) const -{ - ndFloat32 param = ndClamp(penetration, ndFloat32(0.0f), D_MAX_HINGE_PENETRATION) / D_MAX_HINGE_PENETRATION; - ndFloat32 omega = D_MAX_HINGE_RECOVERY_SPEED * param; - return omega; -} - -void ndJointCylinder::SubmitLimitsAngle(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - if (m_limitStateAngle) - { - if ((m_minLimitAngle > (ndFloat32(-1.0f) * ndDegreeToRad)) && (m_maxLimitAngle < (ndFloat32(1.0f) * ndDegreeToRad))) - { - AddAngularRowJacobian(desc, &matrix1.m_front[0], -m_angle); - } - else - { - const ndFloat32 angle = m_angle + m_omega * desc.m_timestep; - if (angle < m_minLimitAngle) - { - AddAngularRowJacobian(desc, &matrix0.m_front[0], ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_minLimitAngle; - const ndFloat32 recoveringAceel = -desc.m_invTimestep * PenetrationOmega(-penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetLowerFriction(desc, ndFloat32(0.0f)); - } - else if (angle > m_maxLimitAngle) - { - AddAngularRowJacobian(desc, &matrix0.m_front[0], ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_maxLimitAngle; - const ndFloat32 recoveringAceel = desc.m_invTimestep * PenetrationOmega(penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetHighFriction(desc, ndFloat32(0.0f)); - } - } - } -} - -ndFloat32 ndJointCylinder::PenetrationSpeed(ndFloat32 penetration) const -{ - ndFloat32 param = ndClamp(penetration, ndFloat32(0.0f), D_MAX_SLIDER_PENETRATION) / D_MAX_SLIDER_PENETRATION; - ndFloat32 speed = D_MAX_SLIDER_RECOVERY_SPEED * param; - return speed; -} - -void ndJointCylinder::SubmitLimitsPosit(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - if (m_limitStatePosit) - { - if ((m_minLimitPosit == ndFloat32(0.0f)) && (m_maxLimitPosit == ndFloat32(0.0f))) - { - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1.m_front); - } - else - { - ndFloat32 x = m_posit + m_speed * desc.m_timestep; - if (x < m_minLimitPosit) - { - ndVector p1(matrix1.m_posit + matrix1.m_front.Scale(m_minLimitPosit)); - AddLinearRowJacobian(desc, matrix0.m_posit, p1, matrix1.m_front); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = x - m_minLimitPosit; - const ndFloat32 recoveringAceel = -desc.m_invTimestep * PenetrationSpeed(-penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetLowerFriction(desc, ndFloat32(0.0f)); - } - else if (x > m_maxLimitPosit) - { - AddLinearRowJacobian(desc, matrix0.m_posit, matrix0.m_posit, matrix1.m_front); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = x - m_maxLimitPosit; - const ndFloat32 recoveringAceel = desc.m_invTimestep * PenetrationSpeed(penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetHighFriction(desc, ndFloat32(0.0f)); - } - } - } -} - -void ndJointCylinder::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - ApplyBaseRows(desc, matrix0, matrix1); - - if (m_springDamperRegularizerAngle && ((m_springKAngle > ndFloat32(0.0f)) || (m_damperCAngle > ndFloat32(0.0f)))) - { - // spring damper with limits - SubmitSpringDamperAngle(desc, matrix0, matrix1); - } - - if (m_springDamperRegularizerPosit && ((m_springKPosit > ndFloat32(0.0f)) || (m_damperCPosit > ndFloat32(0.0f)))) - { - // spring damper with limits - SubmitSpringDamperPosit(desc, matrix0, matrix1); - } - - SubmitLimitsPosit(desc, matrix0, matrix1); - SubmitLimitsAngle(desc, matrix0, matrix1); -} - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointCylinder.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointCylinder.h deleted file mode 100644 index 01322d97a0..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointCylinder.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_CYLINDER_H__ -#define __ND_JOINT_CYLINDER_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndJointCylinder: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointCylinder, ndJointBilateralConstraint) - - D_NEWTON_API ndJointCylinder(); - D_NEWTON_API ndJointCylinder(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API ndJointCylinder(const ndMatrix& pinAndPivotInChild, const ndMatrix& pinAndPivotInParent, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndJointCylinder(); - - D_NEWTON_API ndFloat32 GetAngle() const; - D_NEWTON_API ndFloat32 GetOmega() const; - D_NEWTON_API ndFloat32 GetOffsetAngle() const; - D_NEWTON_API void SetOffsetAngle(ndFloat32 angle); - D_NEWTON_API bool GetLimitStateAngle() const; - D_NEWTON_API void SetLimitStateAngle(bool state); - D_NEWTON_API void SetLimitsAngle(ndFloat32 minLimit, ndFloat32 maxLimit); - D_NEWTON_API void GetLimitsAngle(ndFloat32& minLimit, ndFloat32& maxLimit) const; - D_NEWTON_API void SetAsSpringDamperAngle(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); - D_NEWTON_API void GetSpringDamperAngle(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const; - - D_NEWTON_API ndFloat32 GetPosit() const; - D_NEWTON_API ndFloat32 GetOffsetPosit() const; - D_NEWTON_API void SetOffsetPosit(ndFloat32 offset); - D_NEWTON_API bool GetLimitStatePosit() const; - D_NEWTON_API void SetLimitStatePosit(bool state); - D_NEWTON_API void SetLimitsPosit(ndFloat32 minLimit, ndFloat32 maxLimit); - D_NEWTON_API void GetLimitsPosit(ndFloat32& minLimit, ndFloat32& maxLimit) const; - D_NEWTON_API void SetAsSpringDamperPosit(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); - D_NEWTON_API void GetSpringDamperPosit(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const; - D_NEWTON_API void DebugJoint(ndConstraintDebugCallback& debugCallback) const; - - protected: - D_NEWTON_API ndFloat32 PenetrationOmega(ndFloat32 penetartion) const; - D_NEWTON_API void SubmitLimitsAngle(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - D_NEWTON_API void SubmitSpringDamperAngle(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - D_NEWTON_API ndFloat32 PenetrationSpeed(ndFloat32 penetration) const; - D_NEWTON_API void SubmitLimitsPosit(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - D_NEWTON_API void SubmitSpringDamperPosit(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - D_NEWTON_API void ApplyBaseRows(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - ndFloat32 m_angle; - ndFloat32 m_omega; - ndFloat32 m_springKAngle; - ndFloat32 m_damperCAngle; - ndFloat32 m_minLimitAngle; - ndFloat32 m_maxLimitAngle; - ndFloat32 m_offsetAngle; - ndFloat32 m_springDamperRegularizerAngle; - - ndFloat32 m_posit; - ndFloat32 m_speed; - ndFloat32 m_springKPosit; - ndFloat32 m_damperCPosit; - ndFloat32 m_minLimitPosit; - ndFloat32 m_maxLimitPosit; - ndFloat32 m_offsetPosit; - ndFloat32 m_springDamperRegularizerPosit; - - ndInt8 m_limitStatePosit; - ndInt8 m_limitStateAngle; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDoubleHinge.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDoubleHinge.cpp deleted file mode 100644 index 65215eee0a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDoubleHinge.cpp +++ /dev/null @@ -1,374 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointDoubleHinge.h" - -ndJointDoubleHinge::ndAxisParam::ndAxisParam() - :m_angle(ndFloat32(0.0f)) - ,m_omega(ndFloat32(0.0f)) - ,m_springK(ndFloat32(0.0f)) - ,m_damperC(ndFloat32(0.0f)) - ,m_minLimit(ndFloat32(-1.0e10f)) - ,m_maxLimit(ndFloat32(1.0e10f)) - ,m_offsetAngle(ndFloat32(0.0f)) - ,m_springDamperRegularizer(ndFloat32(0.1f)) -{ -} - -ndJointDoubleHinge::ndJointDoubleHinge() - :ndJointBilateralConstraint() - ,m_axis0() - ,m_axis1() -{ - m_maxDof = 8; -} - -ndJointDoubleHinge::ndJointDoubleHinge(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(8, child, parent, pinAndPivotFrame) - ,m_axis0() - ,m_axis1() -{ -} - -ndJointDoubleHinge::~ndJointDoubleHinge() -{ -} - -ndFloat32 ndJointDoubleHinge::GetAngle0() const -{ - return m_axis0.m_angle; -} - -ndFloat32 ndJointDoubleHinge::GetOmega0() const -{ - return m_axis0.m_omega; -} - -void ndJointDoubleHinge::SetLimits0(ndFloat32 minLimit, ndFloat32 maxLimit) -{ - ndAssert(minLimit <= 0.0f); - ndAssert(maxLimit >= 0.0f); - m_axis0.m_minLimit = minLimit; - m_axis0.m_maxLimit = maxLimit; -} - -void ndJointDoubleHinge::GetLimits0(ndFloat32& minLimit, ndFloat32& maxLimit) -{ - minLimit = m_axis0.m_minLimit; - maxLimit = m_axis0.m_maxLimit; -} - -ndFloat32 ndJointDoubleHinge::GetOffsetAngle0() const -{ - return m_axis0.m_offsetAngle; -} - -void ndJointDoubleHinge::SetOffsetAngle0(ndFloat32 angle) -{ - m_axis0.m_offsetAngle = angle; -} - -void ndJointDoubleHinge::SetAsSpringDamper0(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_axis0.m_springK = ndAbs(spring); - m_axis0.m_damperC = ndAbs(damper); - m_axis0.m_springDamperRegularizer = ndClamp(regularizer, ND_SPRING_DAMP_MIN_REG, ndFloat32(0.99f)); -} - -void ndJointDoubleHinge::GetSpringDamper0(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_axis0.m_springK; - damper = m_axis0.m_damperC; - regularizer = m_axis0.m_springDamperRegularizer; -} - -ndFloat32 ndJointDoubleHinge::GetAngle1() const -{ - return m_axis1.m_angle; -} - -ndFloat32 ndJointDoubleHinge::GetOmega1() const -{ - return m_axis1.m_omega; -} - -void ndJointDoubleHinge::SetLimits1(ndFloat32 minLimit, ndFloat32 maxLimit) -{ - ndAssert(minLimit <= 0.0f); - ndAssert(maxLimit >= 0.0f); - m_axis1.m_minLimit = minLimit; - m_axis1.m_maxLimit = maxLimit; -} - -void ndJointDoubleHinge::GetLimits1(ndFloat32& minLimit, ndFloat32& maxLimit) -{ - minLimit = m_axis1.m_minLimit; - maxLimit = m_axis1.m_maxLimit; -} - -ndFloat32 ndJointDoubleHinge::GetOffsetAngle1() const -{ - return m_axis1.m_offsetAngle; -} - -void ndJointDoubleHinge::SetOffsetAngle1(ndFloat32 angle) -{ - m_axis1.m_offsetAngle = angle; -} - -void ndJointDoubleHinge::SetAsSpringDamper1(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_axis1.m_springK = ndAbs(spring); - m_axis1.m_damperC = ndAbs(damper); - m_axis1.m_springDamperRegularizer = ndClamp(regularizer, ND_SPRING_DAMP_MIN_REG, ndFloat32(0.99f)); -} - -void ndJointDoubleHinge::GetSpringDamper1(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_axis1.m_springK; - damper = m_axis1.m_damperC; - regularizer = m_axis1.m_springDamperRegularizer; -} - -void ndJointDoubleHinge::DebugJoint(ndConstraintDebugCallback& debugCallback) const -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - debugCallback.DrawFrame(matrix0); - debugCallback.DrawFrame(matrix1); - - const int subdiv = 12; - ndVector arch[subdiv + 1]; - const ndFloat32 radius = debugCallback.m_debugScale; - - if ((m_axis0.m_maxLimit > ndFloat32(1.0e-3f)) || (m_axis0.m_minLimit < -ndFloat32(1.0e-3f))) - { - // show pitch angle limits - ndVector point(ndFloat32(0.0f), ndFloat32(radius), ndFloat32(0.0f), ndFloat32(0.0f)); - - ndFloat32 minAngle = m_axis0.m_minLimit; - ndFloat32 maxAngle = m_axis0.m_maxLimit; - if ((maxAngle - minAngle) >= ndPi * ndFloat32(2.0f)) - { - minAngle = 0.0f; - maxAngle = ndPi * ndFloat32(2.0f); - } - - ndFloat32 angleStep = (maxAngle - minAngle) / subdiv; - ndFloat32 angle0 = minAngle; - - ndVector color(ndVector(0.5f, 0.0f, 0.0f, 0.0f)); - for (ndInt32 i = 0; i <= subdiv; ++i) - { - arch[i] = matrix0.TransformVector(ndPitchMatrix(angle0).RotateVector(point)); - debugCallback.DrawLine(matrix1.m_posit, arch[i], color); - angle0 += angleStep; - } - - for (ndInt32 i = 0; i < subdiv; ++i) - { - debugCallback.DrawLine(arch[i], arch[i + 1], color); - } - } - - if ((m_axis1.m_maxLimit > ndFloat32(1.0e-3f)) || (m_axis1.m_minLimit < -ndFloat32(1.0e-3f))) - { - // show yaw angle limits - ndVector point(ndFloat32(radius), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - - ndFloat32 minAngle = m_axis1.m_minLimit; - ndFloat32 maxAngle = m_axis1.m_maxLimit; - if ((maxAngle - minAngle) >= ndPi * ndFloat32(2.0f)) - { - minAngle = 0.0f; - maxAngle = ndPi * ndFloat32(2.0f); - } - - ndFloat32 angleStep = (maxAngle - minAngle) / subdiv; - ndFloat32 angle0 = minAngle; - - ndVector color(ndVector(0.0f, 0.5f, 0.0f, 0.0f)); - for (ndInt32 i = 0; i <= subdiv; ++i) - { - arch[i] = matrix1.TransformVector(ndYawMatrix(angle0).RotateVector(point)); - debugCallback.DrawLine(matrix1.m_posit, arch[i], color); - angle0 += angleStep; - } - - for (ndInt32 i = 0; i < subdiv; ++i) - { - debugCallback.DrawLine(arch[i], arch[i + 1], color); - } - } -} - -void ndJointDoubleHinge::ApplyBaseRows(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1[0]); - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1[1]); - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1[2]); - - const ndVector frontDir((matrix0.m_front - matrix1.m_up.Scale(matrix0.m_front.DotProduct(matrix1.m_up).GetScalar())).Normalize()); - const ndVector sideDir(frontDir.CrossProduct(matrix1.m_up)); - const ndFloat32 angle = CalculateAngle(matrix0.m_front, frontDir, sideDir); - AddAngularRowJacobian(desc, sideDir, angle); - - // not happy with this method because it is a penalty system, - // but is hard for a first order integrator to prevent the side angle - // from drifting, even an implicit one expanding the Jacobian partial - // derivatives still has a hard time. - // nullifying the gyro torque generated by the two angular velocities. - const ndFloat32 alphaRollError = GetMotorZeroAcceleration(desc) + ndFloat32 (0.5f) * angle * desc.m_invTimestep * desc.m_invTimestep; - SetMotorAcceleration(desc, alphaRollError); - - // save the current joint Omega - const ndVector omega0(m_body0->GetOmega()); - const ndVector omega1(m_body1->GetOmega()); - - // calculate joint parameters, angles and omega - const ndFloat32 deltaAngle0 = ndAnglesAdd(-CalculateAngle(matrix0.m_up, matrix1.m_up, frontDir), -m_axis0.m_angle); - m_axis0.m_angle += deltaAngle0; - m_axis0.m_omega = frontDir.DotProduct(omega0 - omega1).GetScalar(); - - const ndFloat32 deltaAngle1 = ndAnglesAdd(-CalculateAngle(frontDir, matrix1.m_front, matrix1.m_up), -m_axis1.m_angle); - m_axis1.m_angle += deltaAngle1; - m_axis1.m_omega = matrix1.m_up.DotProduct(omega0 - omega1).GetScalar(); -} - -ndFloat32 ndJointDoubleHinge::PenetrationOmega(ndFloat32 penetration) const -{ - ndFloat32 param = ndClamp(penetration, ndFloat32(0.0f), D_MAX_DOUBLE_HINGE_PENETRATION) / D_MAX_DOUBLE_HINGE_PENETRATION; - ndFloat32 omega = D_MAX_DOUBLE_HINGE_RECOVERY_SPEED * param; - return omega; -} - -void ndJointDoubleHinge::ClearMemory() -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - ndJointBilateralConstraint::ClearMemory(); - - // save the current joint Omega - const ndVector omega0(m_body0->GetOmega()); - const ndVector omega1(m_body1->GetOmega()); - - const ndVector frontDir((matrix0.m_front - matrix1.m_up.Scale(matrix0.m_front.DotProduct(matrix1.m_up).GetScalar())).Normalize()); - - // calculate joint parameters, angles and omega - const ndFloat32 deltaAngle0 = CalculateAngle(matrix0.m_up, matrix1.m_up, frontDir); - m_axis0.m_angle = deltaAngle0; - m_axis0.m_offsetAngle = deltaAngle0; - m_axis0.m_omega = frontDir.DotProduct(omega0 - omega1).GetScalar(); - - const ndFloat32 deltaAngle1 = CalculateAngle(frontDir, matrix1.m_front, matrix1.m_up); - m_axis1.m_angle += deltaAngle1; - m_axis1.m_offsetAngle = deltaAngle1; - m_axis1.m_omega = matrix1.m_up.DotProduct(omega0 - omega1).GetScalar(); -} - -void ndJointDoubleHinge::SubmitLimits(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - if ((m_axis0.m_minLimit > (ndFloat32(-1.0f) * ndDegreeToRad)) && (m_axis0.m_maxLimit < (ndFloat32(1.0f) * ndDegreeToRad))) - { - AddAngularRowJacobian(desc, &matrix1.m_front[0], -m_axis0.m_angle); - } - else - { - const ndFloat32 angle = m_axis0.m_angle + m_axis0.m_omega * desc.m_timestep; - if (angle < m_axis0.m_minLimit) - { - AddAngularRowJacobian(desc, &matrix0.m_front[0], ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_axis0.m_minLimit; - const ndFloat32 recoveringAceel = -desc.m_invTimestep * PenetrationOmega(-penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetLowerFriction(desc, ndFloat32(0.0f)); - } - else if (angle > m_axis0.m_maxLimit) - { - AddAngularRowJacobian(desc, &matrix0.m_front[0], ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_axis0.m_maxLimit; - const ndFloat32 recoveringAceel = desc.m_invTimestep * PenetrationOmega(penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetHighFriction(desc, ndFloat32(0.0f)); - } - } - - if ((m_axis1.m_minLimit > (ndFloat32(-1.0f) * ndDegreeToRad)) && (m_axis1.m_maxLimit < (ndFloat32(1.0f) * ndDegreeToRad))) - { - AddAngularRowJacobian(desc, &matrix1.m_up[0], -m_axis1.m_angle); - } - else - { - const ndFloat32 angle = m_axis1.m_angle + m_axis1.m_omega * desc.m_timestep; - if (angle < m_axis1.m_minLimit) - { - AddAngularRowJacobian(desc, &matrix1.m_up[0], ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_axis1.m_minLimit; - const ndFloat32 recoveringAceel = -desc.m_invTimestep * PenetrationOmega(-penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetLowerFriction(desc, ndFloat32(0.0f)); - } - else if (angle > m_axis1.m_maxLimit) - { - AddAngularRowJacobian(desc, &matrix1.m_up[0], ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_axis1.m_maxLimit; - const ndFloat32 recoveringAceel = desc.m_invTimestep * PenetrationOmega(penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetHighFriction(desc, ndFloat32(0.0f)); - } - } -} - -void ndJointDoubleHinge::SubmitSpringDamper0(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix&) -{ - AddAngularRowJacobian(desc, matrix0.m_front, m_axis0.m_offsetAngle - m_axis0.m_angle); - SetMassSpringDamperAcceleration(desc, m_axis0.m_springDamperRegularizer, m_axis0.m_springK, m_axis0.m_damperC); -} - -void ndJointDoubleHinge::SubmitSpringDamper1(ndConstraintDescritor& desc, const ndMatrix&, const ndMatrix& matrix1) -{ - AddAngularRowJacobian(desc, matrix1.m_up, m_axis1.m_offsetAngle - m_axis1.m_angle); - SetMassSpringDamperAcceleration(desc, m_axis1.m_springDamperRegularizer, m_axis1.m_springK, m_axis1.m_damperC); -} - -void ndJointDoubleHinge::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - ApplyBaseRows(desc, matrix0, matrix1); - - if (m_axis0.m_springDamperRegularizer && ((m_axis0.m_springK > ndFloat32(0.0f)) || (m_axis0.m_damperC > ndFloat32(0.0f)))) - { - // spring damper with limits - SubmitSpringDamper0(desc, matrix0, matrix1); - } - - if (m_axis1.m_springDamperRegularizer && ((m_axis1.m_springK > ndFloat32(0.0f)) || (m_axis1.m_damperC > ndFloat32(0.0f)))) - { - // spring damper with limits - SubmitSpringDamper1(desc, matrix0, matrix1); - } - - SubmitLimits(desc, matrix0, matrix1); -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDoubleHinge.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDoubleHinge.h deleted file mode 100644 index 546c93e7a4..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDoubleHinge.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_DOUBLE_HINGE_H__ -#define __ND_JOINT_DOUBLE_HINGE_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -#define D_MAX_DOUBLE_HINGE_RECOVERY_SPEED ndFloat32 (0.25f) -#define D_MAX_DOUBLE_HINGE_PENETRATION (ndFloat32 (4.0f) * ndDegreeToRad) - -class ndJointDoubleHinge: public ndJointBilateralConstraint -{ - public: - class ndAxisParam - { - public: - ndAxisParam(); - ndFloat32 m_angle; - ndFloat32 m_omega; - ndFloat32 m_springK; - ndFloat32 m_damperC; - ndFloat32 m_minLimit; - ndFloat32 m_maxLimit; - ndFloat32 m_offsetAngle; - ndFloat32 m_springDamperRegularizer; - }; - - D_CLASS_REFLECTION(ndJointDoubleHinge, ndJointBilateralConstraint) - - D_NEWTON_API ndJointDoubleHinge(); - D_NEWTON_API ndJointDoubleHinge(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndJointDoubleHinge(); - - D_NEWTON_API ndFloat32 GetAngle0() const; - D_NEWTON_API ndFloat32 GetOmega0() const; - D_NEWTON_API ndFloat32 GetOffsetAngle0() const; - D_NEWTON_API void SetOffsetAngle0(ndFloat32 angle); - D_NEWTON_API void SetLimits0(ndFloat32 minLimit, ndFloat32 maxLimit); - D_NEWTON_API void GetLimits0(ndFloat32& minLimit, ndFloat32& maxLimit); - D_NEWTON_API void SetAsSpringDamper0(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); - D_NEWTON_API void GetSpringDamper0(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const; - - D_NEWTON_API ndFloat32 GetAngle1() const; - D_NEWTON_API ndFloat32 GetOmega1() const; - D_NEWTON_API ndFloat32 GetOffsetAngle1() const; - D_NEWTON_API void SetOffsetAngle1(ndFloat32 angle); - D_NEWTON_API void SetLimits1(ndFloat32 minLimit, ndFloat32 maxLimit); - D_NEWTON_API void GetLimits1(ndFloat32& minLimit, ndFloat32& maxLimit); - D_NEWTON_API void SetAsSpringDamper1(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); - D_NEWTON_API void GetSpringDamper1(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const; - - protected: - D_NEWTON_API void ClearMemory(); - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - D_NEWTON_API ndFloat32 PenetrationOmega(ndFloat32 penetartion) const; - D_NEWTON_API void DebugJoint(ndConstraintDebugCallback& debugCallback) const; - D_NEWTON_API void ApplyBaseRows(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - D_NEWTON_API void SubmitLimits(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - D_NEWTON_API void SubmitSpringDamper0(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - D_NEWTON_API void SubmitSpringDamper1(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - ndAxisParam m_axis0; - ndAxisParam m_axis1; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDryRollingFriction.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDryRollingFriction.cpp deleted file mode 100644 index 3081889a8b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDryRollingFriction.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointDryRollingFriction.h" - -ndJointDryRollingFriction::ndJointDryRollingFriction() - :ndJointBilateralConstraint() - ,m_coefficient(ndFloat32(0.5f)) - ,m_contactTrail(ndFloat32(0.1f)) -{ - m_maxDof = 1; -} - -ndJointDryRollingFriction::ndJointDryRollingFriction(ndBodyKinematic* const body0, ndBodyKinematic* const body1, ndFloat32 coefficient) - :ndJointBilateralConstraint(1, body0, body1, ndGetIdentityMatrix()) - ,m_coefficient(ndClamp (coefficient, ndFloat32(0.0f), ndFloat32 (1.0f))) - ,m_contactTrail(ndFloat32 (0.1f)) -{ - ndMatrix matrix(body0->GetMatrix()); - CalculateLocalMatrix(matrix, m_localMatrix0, m_localMatrix1); - - SetSolverModel(m_jointIterativeSoft); -} - -ndJointDryRollingFriction::~ndJointDryRollingFriction() -{ -} - -void ndJointDryRollingFriction::SetContactTrail(ndFloat32 trail) -{ - m_contactTrail = ndClamp(trail, ndFloat32(0.1f), ndFloat32(1.0f)); -} - -void ndJointDryRollingFriction::SetFrictionCoefficient(ndFloat32 friction) -{ - m_coefficient = ndClamp(friction, ndFloat32(0.0f), ndFloat32(1.0f)); -} - -ndFloat32 ndJointDryRollingFriction::GetContactTrail() const -{ - return m_contactTrail; -} - -ndFloat32 ndJointDryRollingFriction::GetFrictionCoefficient() const -{ - return m_coefficient; -} - - -// rolling friction works as follow: the idealization of the contact of a spherical object -// with a another surface is a point that pass by the center of the sphere. -// in most cases this is enough to model the collision but in insufficient for modeling -// the rolling friction. In reality contact with the sphere with the other surface is not -// a point but a contact patch. A contact patch has the property the it generates a fix -// constant rolling torque that opposes the movement of the sphere. -// we can model this torque by adding a clamped torque aligned to the instantaneously axis -// of rotation of the ball. and with a magnitude of the stopping angular acceleration. -//void ndJointDryRollingFriction::SubmitConstraints (dFloat timestep, int threadIndex) -void ndJointDryRollingFriction::JacobianDerivative(ndConstraintDescritor& desc) -{ - const ndBodyKinematic::ndContactMap& contactMap = m_body0->GetContactMap(); - - ndFloat32 maxForce = ndFloat32 (0.0f); - ndBodyKinematic::ndContactMap::Iterator it(contactMap); - for (it.Begin(); it; it++) - { - const ndContact* const contact = *it; - if (contact->IsActive()) - { - const ndContactPointList& contactPoints = contact->GetContactPoints(); - for (ndContactPointList::ndNode* node = contactPoints.GetFirst(); node; node = node->GetNext()) - { - const ndForceImpactPair& normalForce = node->GetInfo().m_normal_Force; - ndFloat32 force = normalForce.GetInitialGuess(); - maxForce = ndMax(force, maxForce); - } - } - } - - if (maxForce > ndFloat32 (0.0f)) - { - ndVector omega(m_body0->GetOmega()); - - ndFloat32 omegaMag = omega.DotProduct(omega).GetScalar(); - if (omegaMag > ndFloat32(0.1f * 0.1f)) - { - // tell newton to used this the friction of the omega vector to apply the rolling friction - ndVector pin(omega.Normalize()); - - AddAngularRowJacobian(desc, pin, ndFloat32(0.0f)); - - ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - SetMotorAcceleration(desc, stopAccel); - - ndFloat32 torqueFriction = maxForce * m_coefficient * m_contactTrail; - SetLowerFriction(desc, -torqueFriction); - SetHighFriction(desc, torqueFriction); - } - else - { - // when omega is too low cheat a little bit and damp the omega directly - omega = omega.Scale(0.5f); - m_body0->SetOmega(omega); - } - } -} - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDryRollingFriction.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDryRollingFriction.h deleted file mode 100644 index 84e0b23c68..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointDryRollingFriction.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - - -#ifndef __ND_JOINT_DRY_ROLLING_FRICTION_H_ -#define __ND_JOINT_DRY_ROLLING_FRICTION_H_ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -// this joint is usefully to simulate the rolling friction of a rolling ball over -// a flat surface. -// normally this is not important for non spherical objects, but for games like -// poll, pinball, bolling, golf or any other where the movement of balls is the main objective -// the rolling friction is a real big problem. -class ndJointDryRollingFriction: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointDryRollingFriction, ndJointBilateralConstraint) - - D_NEWTON_API ndJointDryRollingFriction(); - D_NEWTON_API ndJointDryRollingFriction(ndBodyKinematic* const body0, ndBodyKinematic* const body1, ndFloat32 coefficient); - D_NEWTON_API virtual ~ndJointDryRollingFriction(); - - D_NEWTON_API void SetContactTrail(ndFloat32 trail); - D_NEWTON_API void SetFrictionCoefficient(ndFloat32 friction); - - D_NEWTON_API ndFloat32 GetContactTrail() const; - D_NEWTON_API ndFloat32 GetFrictionCoefficient() const; - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - - ndFloat32 m_coefficient; - ndFloat32 m_contactTrail; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFix6dof.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFix6dof.cpp deleted file mode 100644 index 96aa07df1c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFix6dof.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointFix6dof.h" - -ndJointFix6dof::ndJointFix6dof() - :ndJointBilateralConstraint() - ,m_softness(ndFloat32(0.0f)) - ,m_maxForce(D_MAX_BOUND) - ,m_maxTorque(D_MAX_BOUND) -{ - m_maxDof = 6; -} - -ndJointFix6dof::ndJointFix6dof(const ndMatrix& frameInGlbalSpace, ndBodyKinematic* const body0, ndBodyKinematic* const body1) - :ndJointBilateralConstraint(6, body0, body1, frameInGlbalSpace) - ,m_softness(ndFloat32(0.0f)) - ,m_maxForce(D_MAX_BOUND) - ,m_maxTorque(D_MAX_BOUND) -{ -} - -ndJointFix6dof::ndJointFix6dof(ndBodyKinematic* const body0, ndBodyKinematic* const body1, const ndMatrix& globalMatrixBody0, const ndMatrix& globalMatrixBody1) - :ndJointBilateralConstraint(6, body0, body1, globalMatrixBody0, globalMatrixBody1) - ,m_softness(ndFloat32(0.0f)) - ,m_maxForce(D_MAX_BOUND) - ,m_maxTorque(D_MAX_BOUND) -{ -} - -ndJointFix6dof::~ndJointFix6dof() -{ -} - -void ndJointFix6dof::SetAsSoftJoint(bool) -{ - ndAssert(0); - //SetSolverModel(mode ? m_secundaryCloseLoop : m_primaryOpenLoop); -} - -void ndJointFix6dof::SetRegularizer(ndFloat32 regularizer) -{ - m_softness = ndClamp(regularizer, ndFloat32(0.0f), ndFloat32(1.0f)); -} - -ndFloat32 ndJointFix6dof::GetRegularizer() const -{ - return m_softness; -} - -ndFloat32 ndJointFix6dof::GetMaxForce() const -{ - return m_maxForce; -} - -ndFloat32 ndJointFix6dof::GetMaxTorque() const -{ - return m_maxTorque; -} - -void ndJointFix6dof::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - - ndAssert(IsActive()); - // calculate the position of the pivot point and the Jacobian direction vectors, in global space. - CalculateGlobalMatrix(matrix0, matrix1); - - for (ndInt32 i = 0; i < 3; ++i) - { - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1[i]); - SetLowerFriction(desc, -m_maxForce); - SetHighFriction(desc, m_maxForce); - SetDiagonalRegularizer(desc, m_softness); - } - - ndFloat32 cosAngle = matrix1.m_front.DotProduct(matrix0.m_front).GetScalar(); - if (cosAngle >= ndFloat32(0.998f)) - { - // about 3.5 degree deviation, consider small angular approximation - SubmitAngularAxisCartisianApproximation(desc, matrix0, matrix1); - } - else - { - // beyond 3.5 degree need to decompose the relative matrix into an orthonormal basics - SubmitAngularAxis(desc, matrix0, matrix1); - } -} - -void ndJointFix6dof::SubmitAngularAxisCartisianApproximation(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - // since very small angle rotation commute, we can issue - // three angle around the matrix1 axis in any order. - ndFloat32 angle0 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up); - AddAngularRowJacobian(desc, matrix1.m_up, angle0); - SetLowerFriction(desc, -m_maxTorque); - SetHighFriction(desc, m_maxTorque); - SetDiagonalRegularizer(desc, m_softness); - - ndFloat32 angle1 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - AddAngularRowJacobian(desc, matrix1.m_right, angle1); - SetLowerFriction(desc, -m_maxTorque); - SetHighFriction(desc, m_maxTorque); - SetDiagonalRegularizer(desc, m_softness); - - ndFloat32 angle2 = CalculateAngle(matrix0.m_up, matrix1.m_up, matrix1.m_front); - AddAngularRowJacobian(desc, matrix1.m_front, angle2); - SetLowerFriction(desc, -m_maxTorque); - SetHighFriction(desc, m_maxTorque); - SetDiagonalRegularizer(desc, m_softness); -} - -void ndJointFix6dof::SubmitAngularAxis(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - // calculate cone angle - ndVector lateralDir(matrix1.m_front.CrossProduct(matrix0.m_front)); - ndAssert(lateralDir.DotProduct(lateralDir).GetScalar() > ndFloat32 (1.0e-6f)); - lateralDir = lateralDir.Normalize(); - ndFloat32 coneAngle = ndAcos(ndClamp(matrix1.m_front.DotProduct(matrix0.m_front).GetScalar(), ndFloat32(-1.0f), ndFloat32(1.0f))); - ndMatrix coneRotation(ndCalculateMatrix(ndQuaternion(lateralDir, coneAngle), matrix1.m_posit)); - - AddAngularRowJacobian(desc, lateralDir, -coneAngle); - SetLowerFriction(desc, -m_maxTorque); - SetHighFriction(desc, m_maxTorque); - SetDiagonalRegularizer(desc, m_softness); - - ndVector sideDir(lateralDir.CrossProduct(matrix0.m_front)); - AddAngularRowJacobian(desc, sideDir, ndFloat32(0.0f)); - SetLowerFriction(desc, -m_maxTorque); - SetHighFriction(desc, m_maxTorque); - SetDiagonalRegularizer(desc, m_softness); - - // calculate pitch angle - ndMatrix pitchMatrix(matrix1 * coneRotation * matrix0.OrthoInverse()); - ndFloat32 pitchAngle = ndAtan2(pitchMatrix[1][2], pitchMatrix[1][1]); - AddAngularRowJacobian(desc, matrix0.m_front, pitchAngle); - SetLowerFriction(desc, -m_maxTorque); - SetHighFriction(desc, m_maxTorque); - SetDiagonalRegularizer(desc, m_softness); - //dTrace(("%f %f\n", coneAngle * dRadToDegree, pitchAngle * dRadToDegree)); -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFix6dof.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFix6dof.h deleted file mode 100644 index ea9d56ad42..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFix6dof.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_FIX_6DOF_H_ -#define __ND_JOINT_FIX_6DOF_H_ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndJointFix6dof: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointFix6dof, ndJointBilateralConstraint) - - D_NEWTON_API ndJointFix6dof(); - D_NEWTON_API ndJointFix6dof(const ndMatrix& frameInGlobalSpace, ndBodyKinematic* const body0, ndBodyKinematic* const body1); - D_NEWTON_API ndJointFix6dof(ndBodyKinematic* const body0, ndBodyKinematic* const body1, const ndMatrix& globalMatrixBody0, const ndMatrix& globalMatrixBody1 ); - D_NEWTON_API virtual ~ndJointFix6dof(); - - D_NEWTON_API void SetAsSoftJoint(bool mode); - - D_NEWTON_API ndFloat32 GetRegularizer() const; - D_NEWTON_API void SetRegularizer(ndFloat32 regularizer); - - D_NEWTON_API ndFloat32 GetMaxForce() const; - D_NEWTON_API ndFloat32 GetMaxTorque() const; - - private: - void JacobianDerivative(ndConstraintDescritor& desc); - void SubmitAngularAxis(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - void SubmitAngularAxisCartisianApproximation(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - ndFloat32 m_softness; - ndFloat32 m_maxForce; - ndFloat32 m_maxTorque; -}; -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFixDistance.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFixDistance.cpp deleted file mode 100644 index 6a21cc2485..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFixDistance.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointFixDistance.h" - -ndJointFixDistance::ndJointFixDistance() - :ndJointBilateralConstraint() -{ - m_maxDof = 1; -} - -ndJointFixDistance::ndJointFixDistance(const ndVector& pivotInChildInGlobalSpace, const ndVector& pivotInParentInGlobalSpace, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(1, child, parent, ndGetIdentityMatrix()) -{ - m_localMatrix0 = ndGetIdentityMatrix(); - m_localMatrix1 = ndGetIdentityMatrix(); - m_localMatrix0.m_posit = child->GetMatrix().UntransformVector(pivotInChildInGlobalSpace); - m_localMatrix1.m_posit = parent->GetMatrix().UntransformVector(pivotInParentInGlobalSpace); - - ndVector dist(pivotInChildInGlobalSpace - pivotInParentInGlobalSpace); - m_distance = ndSqrt(dist.DotProduct(dist).GetScalar()); -} - -ndJointFixDistance::~ndJointFixDistance() -{ -} - -ndFloat32 ndJointFixDistance::GetDistance() const -{ - return m_distance; -} - -void ndJointFixDistance::SetDistance(ndFloat32 dist) -{ - m_distance = dist; -} - -void ndJointFixDistance::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - - // calculate the position of the pivot point and the Jacobian direction vectors, in global space. - CalculateGlobalMatrix(matrix0, matrix1); - - ndVector p0(matrix0.m_posit); - ndVector p1(matrix1.m_posit); - - ndVector dir(p1 - p0); - ndFloat32 mag2 = dir.DotProduct(dir).GetScalar(); - if (mag2 > ndFloat32(1.0e-3f)) - { - dir = dir.Scale(1.0f / ndSqrt(mag2)); - ndFloat32 x = ndSqrt (mag2) - m_distance; - - ndMatrix matrix(ndGramSchmidtMatrix(dir)); - ndVector com0(m_body0->GetCentreOfMass()); - ndMatrix body0Matrix(m_body0->GetMatrix()); - ndVector veloc0(m_body0->GetVelocityAtPoint(p0)); - - ndVector com1(m_body1->GetCentreOfMass()); - ndMatrix body1Matrix(m_body1->GetMatrix()); - ndVector veloc1(m_body1->GetVelocityAtPoint(p1)); - - ndFloat32 v((veloc0 - veloc1).DotProduct(dir).GetScalar()); - ndFloat32 a = (x - v * desc.m_timestep) * desc.m_invTimestep * desc.m_invTimestep; - - ndVector r0 ((p0 - body0Matrix.TransformVector(com0)).CrossProduct(matrix.m_front)); - ndVector r1 ((p1 - body1Matrix.TransformVector(com1)).CrossProduct(matrix.m_front)); - - AddLinearRowJacobian(desc, p0, p0, matrix0.m_right); - ndJacobian& jacobian0 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM0; - ndJacobian& jacobian1 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM1; - - jacobian0.m_linear = matrix[0]; - jacobian0.m_angular = r0; - - jacobian1.m_linear = matrix[0].Scale(ndFloat32 (-1.0f)); - jacobian1.m_angular = r1.Scale(ndFloat32(-1.0f)); - - SetMotorAcceleration(desc, a); - } -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFixDistance.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFixDistance.h deleted file mode 100644 index a61c73e08d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFixDistance.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_FIX_DISTANCE_H_ -#define __ND_JOINT_FIX_DISTANCE_H_ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndJointFixDistance: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointFixDistance, ndJointBilateralConstraint) - - D_NEWTON_API ndJointFixDistance(); - D_NEWTON_API ndJointFixDistance(const ndVector& childPivotInGlobalSpace, const ndVector& parentPivotInGlobalSpace, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndJointFixDistance(); - - D_NEWTON_API ndFloat32 GetDistance() const; - D_NEWTON_API void SetDistance(ndFloat32 dist); - - protected: - void JacobianDerivative(ndConstraintDescritor& desc); - - ndFloat32 m_distance; -}; -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFollowPath.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFollowPath.cpp deleted file mode 100644 index ba0b42ba12..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFollowPath.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointFollowPath.h" - -ndJointFollowPath::ndJointFollowPath() - :ndJointBilateralConstraint() -{ - m_maxDof = 6; -} - -ndJointFollowPath::ndJointFollowPath (const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(6, child, parent, pinAndPivotFrame) -{ - // calculate the two local matrix of the pivot point - CalculateLocalMatrix (pinAndPivotFrame, m_localMatrix0, m_localMatrix1); -} - -ndJointFollowPath::~ndJointFollowPath() -{ -} - -void ndJointFollowPath::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - ndVector pathPosit(ndVector::m_zero); - ndVector pathTangent(ndVector::m_zero); - - // Get the global matrices of each rigid body. - CalculateGlobalMatrix (matrix0, matrix1); - - GetPointAndTangentAtLocation(matrix0.m_posit, pathPosit, pathTangent); - if (pathTangent.DotProduct(matrix0.m_front).GetScalar() < ndFloat32 (0.0f)) - { - pathTangent = pathTangent.Scale (-1.0f); - } - - matrix1 = ndMatrix(ndGramSchmidtMatrix(pathTangent)); - matrix1.m_posit = pathPosit; - matrix1.m_posit.m_w = 1.0f; - - // Restrict the movement on the pivot point along all tree the normal and bi normal of the path - const ndVector& p0 = matrix0.m_posit; - const ndVector& p1 = matrix1.m_posit; - ndVector p00 (p0 + matrix0.m_front.Scale(50.0f)); - ndVector p11 (p1 + matrix1.m_front.Scale(50.0f)); - - AddLinearRowJacobian(desc, p0, p1, matrix1[1]); - AddLinearRowJacobian(desc, p0, p1, matrix1[2]); - AddLinearRowJacobian(desc, p00, p11, matrix1[1]); - AddLinearRowJacobian(desc, p00, p11, matrix1[2]); -} - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFollowPath.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFollowPath.h deleted file mode 100644 index fbaf507e7a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointFollowPath.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - - -#ifndef __ND_JOINT_FOLLOW_PATH_H__ -#define __ND_JOINT_FOLLOW_PATH_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndJointFollowPath: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointFollowPath, ndJointBilateralConstraint) - - D_NEWTON_API ndJointFollowPath(); - D_NEWTON_API ndJointFollowPath (const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndJointFollowPath(); - - virtual void GetPointAndTangentAtLocation(const ndVector& location, ndVector& positOut, ndVector& tangentOut) const - { - positOut = location; - tangentOut = ndVector(1.0f, 0.0f, 0.0f, 0.0f); - } - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointGear.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointGear.cpp deleted file mode 100644 index 6b988504d6..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointGear.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointGear.h" - -ndJointGear::ndJointGear() - :ndJointBilateralConstraint() -{ - m_maxDof = 1; -} - -ndJointGear::ndJointGear(ndFloat32 gearRatio, - const ndVector& body0Pin, ndBodyKinematic* const body0, - const ndVector& body1Pin, ndBodyKinematic* const body1) - :ndJointBilateralConstraint(1, body0, body1, ndGetIdentityMatrix()) - ,m_gearRatio(gearRatio) -{ - // calculate the two local matrix of the pivot point - ndMatrix dommyMatrix; - - // calculate the local matrix for body body0 - ndMatrix pinAndPivot0(ndGramSchmidtMatrix(body0Pin)); - CalculateLocalMatrix(pinAndPivot0, m_localMatrix0, dommyMatrix); - m_localMatrix0.m_posit = ndVector::m_wOne; - - // calculate the local matrix for body body1 - ndMatrix pinAndPivot1(ndGramSchmidtMatrix(body1Pin)); - CalculateLocalMatrix(pinAndPivot1, dommyMatrix, m_localMatrix1); - m_localMatrix1.m_posit = ndVector::m_wOne; - - // set as kinematic loop - SetSolverModel(m_jointkinematicOpenLoop); -} - -ndJointGear::~ndJointGear() -{ -} - - -ndFloat32 ndJointGear::GetRatio() const -{ - return m_gearRatio; -} - -void ndJointGear::SetRatio(ndFloat32 ratio) -{ - m_gearRatio = ratio; -} - -void ndJointGear::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - - // calculate the position of the pivot point and the Jacobian direction vectors, in global space. - CalculateGlobalMatrix(matrix0, matrix1); - - AddAngularRowJacobian(desc, matrix0.m_front, ndFloat32(0.0f)); - - ndJacobian& jacobian0 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM0; - ndJacobian& jacobian1 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM1; - - jacobian0.m_angular = matrix0.m_front.Scale(m_gearRatio); - jacobian1.m_angular = matrix1.m_front; - - const ndVector& omega0 = m_body0->GetOmega(); - const ndVector& omega1 = m_body1->GetOmega(); - - const ndVector relOmega(omega0 * jacobian0.m_angular + omega1 * jacobian1.m_angular); - const ndFloat32 w = relOmega.AddHorizontal().GetScalar() * ndFloat32(0.5f); - SetMotorAcceleration(desc, -w * desc.m_invTimestep); -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointGear.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointGear.h deleted file mode 100644 index 144d346207..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointGear.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_GEAR_H__ -#define __ND_JOINT_GEAR_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndJointGear: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointGear, ndJointBilateralConstraint) - - D_NEWTON_API ndJointGear(); - D_NEWTON_API ndJointGear(ndFloat32 gearRatio, - const ndVector& body0Pin, ndBodyKinematic* const body0, - const ndVector& body1Pin, ndBodyKinematic* const body1); - D_NEWTON_API virtual ~ndJointGear(); - - D_NEWTON_API ndFloat32 GetRatio() const; - D_NEWTON_API void SetRatio(ndFloat32 ratio); - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - - ndFloat32 m_gearRatio; -}; - - - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointHinge.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointHinge.cpp deleted file mode 100644 index 3750b93c5b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointHinge.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointHinge.h" - -#define D_MAX_HINGE_RECOVERY_SPEED ndFloat32 (0.25f) -#define D_MAX_HINGE_PENETRATION (ndFloat32 (4.0f) * ndDegreeToRad) - -ndJointHinge::ndJointHinge() - :ndJointBilateralConstraint() - ,m_angle(ndFloat32(0.0f)) - ,m_omega(ndFloat32(0.0f)) - ,m_springK(ndFloat32(0.0f)) - ,m_damperC(ndFloat32(0.0f)) - ,m_minLimit(ndFloat32(-1.0e10f)) - ,m_maxLimit(ndFloat32(1.0e10f)) - ,m_targetAngle(ndFloat32(0.0f)) - ,m_springDamperRegularizer(ndFloat32(0.1f)) - ,m_limitState(0) -{ - m_maxDof = 7; -} - -ndJointHinge::ndJointHinge(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(7, child, parent, pinAndPivotFrame) - ,m_angle(ndFloat32(0.0f)) - ,m_omega(ndFloat32(0.0f)) - ,m_springK(ndFloat32(0.0f)) - ,m_damperC(ndFloat32(0.0f)) - ,m_minLimit(ndFloat32(-1.0e10f)) - ,m_maxLimit(ndFloat32(1.0e10f)) - ,m_targetAngle(ndFloat32(0.0f)) - ,m_springDamperRegularizer(ndFloat32(0.1f)) - ,m_limitState(0) -{ -} - -ndJointHinge::ndJointHinge(const ndMatrix& pinAndPivotInChild, const ndMatrix& pinAndPivotInParent, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(6, child, parent, pinAndPivotInChild) - ,m_angle(ndFloat32(0.0f)) - ,m_omega(ndFloat32(0.0f)) - ,m_springK(ndFloat32(0.0f)) - ,m_damperC(ndFloat32(0.0f)) - ,m_minLimit(ndFloat32(-1.0e10f)) - ,m_maxLimit(ndFloat32(1.0e10f)) - ,m_targetAngle(ndFloat32(0.0f)) - ,m_springDamperRegularizer(ndFloat32(0.1f)) - ,m_limitState(0) -{ - ndMatrix tmp; - CalculateLocalMatrix(pinAndPivotInChild, m_localMatrix0, tmp); - CalculateLocalMatrix(pinAndPivotInParent, tmp, m_localMatrix1); -} - -ndJointHinge::~ndJointHinge() -{ -} - -ndFloat32 ndJointHinge::GetAngle() const -{ - return m_angle; -} - -ndFloat32 ndJointHinge::GetOmega() const -{ - return m_omega; -} - -bool ndJointHinge::GetLimitState() const -{ - return m_limitState ? true : false; -} - -void ndJointHinge::SetLimitState(bool state) -{ - m_limitState = state ? 1 : 0; - if (m_limitState) - { - SetLimits(m_minLimit, m_maxLimit); - } -} - -void ndJointHinge::SetLimits(ndFloat32 minLimit, ndFloat32 maxLimit) -{ - #ifdef _DEBUG - if (minLimit > 0.0f) - { - ndTrace (("warning: %s minLimit %f larger than zero\n", __FUNCTION__, minLimit)) - } - if (maxLimit < 0.0f) - { - ndTrace(("warning: %s m_maxLimit %f smaller than zero\n", __FUNCTION__, maxLimit)) - } - #endif - - m_minLimit = minLimit; - m_maxLimit = maxLimit; - if (m_angle > m_maxLimit) - { - //const ndFloat32 deltaAngle = ndAnglesAdd(m_angle, -m_maxLimit); - //m_angle = m_maxLimit + deltaAngle; - m_angle = m_maxLimit; - } - else if (m_angle < m_minLimit) - { - //const ndFloat32 deltaAngle = ndAnglesAdd(m_angle, -m_minLimit); - //m_angle = m_minLimit + deltaAngle; - m_angle = m_minLimit; - } -} - -void ndJointHinge::GetLimits(ndFloat32& minLimit, ndFloat32& maxLimit) const -{ - minLimit = m_minLimit; - maxLimit = m_maxLimit; -} - -ndFloat32 ndJointHinge::GetTargetAngle() const -{ - return m_targetAngle; -} - -void ndJointHinge::SetTargetAngle(ndFloat32 angle) -{ - m_targetAngle = angle; -} - -void ndJointHinge::SetAsSpringDamper(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_springK = ndAbs(spring); - m_damperC = ndAbs(damper); - m_springDamperRegularizer = ndClamp(regularizer, ND_SPRING_DAMP_MIN_REG, ndFloat32(0.99f)); -} - -void ndJointHinge::GetSpringDamper(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_springK; - damper = m_damperC; - regularizer = m_springDamperRegularizer; -} - -void ndJointHinge::DebugJoint(ndConstraintDebugCallback& debugCallback) const -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - debugCallback.DrawFrame(matrix0); - debugCallback.DrawFrame(matrix1, 0.5f); - - const ndInt32 subdiv = 8; - const ndFloat32 radius = debugCallback.m_debugScale; - ndVector arch[subdiv + 1]; - - ndFloat32 deltaTwist = m_maxLimit - m_minLimit; - if ((deltaTwist > ndFloat32(1.0e-3f)) && (deltaTwist <= ndFloat32(2.0f) * ndPi)) - { - ndMatrix pitchMatrix(matrix1); - pitchMatrix.m_posit = matrix1.m_posit; - - ndVector point(ndFloat32(0.0f), ndFloat32(radius), ndFloat32(0.0f), ndFloat32(0.0f)); - - ndFloat32 angleStep = ndMin(deltaTwist, ndFloat32(2.0f * ndPi)) / subdiv; - ndFloat32 angle0 = m_minLimit; - - ndVector color(ndFloat32(0.4f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - for (ndInt32 i = 0; i <= subdiv; ++i) - { - arch[i] = pitchMatrix.TransformVector(ndPitchMatrix(angle0).RotateVector(point)); - debugCallback.DrawLine(pitchMatrix.m_posit, arch[i], color); - angle0 += angleStep; - } - - for (ndInt32 i = 0; i < subdiv; ++i) - { - debugCallback.DrawLine(arch[i], arch[i + 1], color); - } - } -} - -void ndJointHinge::SubmitSpringDamper(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& ) -{ - // add spring damper row - AddAngularRowJacobian(desc, matrix0.m_front, m_targetAngle - m_angle); - SetMassSpringDamperAcceleration(desc, m_springDamperRegularizer, m_springK, m_damperC); -} - -void ndJointHinge::ApplyBaseRows(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1[0]); - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1[1]); - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1[2]); - - // two rows to restrict rotation around around the parent coordinate system - const ndFloat32 angle0 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up); - AddAngularRowJacobian(desc, matrix1.m_up, angle0); - - const ndFloat32 angle1 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - AddAngularRowJacobian(desc, matrix1.m_right, angle1); - - // save the current joint Omega - const ndVector omega0(m_body0->GetOmega()); - const ndVector omega1(m_body1->GetOmega()); - - // the joint angle can be determined by getting the angle between any two non parallel vectors - const ndFloat32 deltaAngle = ndAnglesAdd(-CalculateAngle(matrix0.m_up, matrix1.m_up, matrix1.m_front), -m_angle); - m_angle += deltaAngle; - m_omega = matrix1.m_front.DotProduct(omega0 - omega1).GetScalar(); -} - -ndFloat32 ndJointHinge::PenetrationOmega(ndFloat32 penetration) const -{ - ndFloat32 param = ndClamp(penetration, ndFloat32(0.0f), D_MAX_HINGE_PENETRATION) / D_MAX_HINGE_PENETRATION; - ndFloat32 omega = D_MAX_HINGE_RECOVERY_SPEED * param; - return omega; -} - -//#pragma optimize( "", off ) -void ndJointHinge::ClearMemory() -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - ndJointBilateralConstraint::ClearMemory(); - - // save the current joint Omega - const ndVector omega0(m_body0->GetOmega()); - const ndVector omega1(m_body1->GetOmega()); - - // the joint angle can be determined by getting the angle between any two non parallel vectors - m_angle = CalculateAngle(matrix0.m_up, matrix1.m_up, matrix1.m_front); - m_omega = matrix1.m_front.DotProduct(omega0 - omega1).GetScalar(); - m_targetAngle = m_angle; -} - -ndInt32 ndJointHinge::GetKinematicState(ndKinematicState* const state) const -{ - state->m_posit = m_angle; - state->m_velocity = m_omega; - return 1; -} - -void ndJointHinge::SubmitLimits(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - m_hitLimits = false; - if (m_limitState) - { - if ((m_minLimit > (ndFloat32(-1.0f) * ndDegreeToRad)) && (m_maxLimit < (ndFloat32(1.0f) * ndDegreeToRad))) - { - AddAngularRowJacobian(desc, &matrix1.m_front[0], -m_angle); - } - else - { - const ndFloat32 angle = m_angle + m_omega * desc.m_timestep; - if (angle < m_minLimit) - { - m_hitLimits = true; - AddAngularRowJacobian(desc, &matrix0.m_front[0], ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_minLimit; - const ndFloat32 recoveringAceel = -desc.m_invTimestep * PenetrationOmega(-penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetLowerFriction(desc, ndFloat32(0.0f)); - } - else if (angle > m_maxLimit) - { - m_hitLimits = true; - AddAngularRowJacobian(desc, &matrix0.m_front[0], ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_maxLimit; - const ndFloat32 recoveringAceel = desc.m_invTimestep * PenetrationOmega(penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetHighFriction(desc, ndFloat32(0.0f)); - } - } - } -} - -void ndJointHinge::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - ApplyBaseRows(desc, matrix0, matrix1); - if (m_springDamperRegularizer && ((m_springK > ndFloat32(0.0f)) || (m_damperC > ndFloat32(0.0f)))) - { - // spring damper with limits - SubmitSpringDamper(desc, matrix0, matrix1); - } - SubmitLimits(desc, matrix0, matrix1); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointHinge.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointHinge.h deleted file mode 100644 index d6b4ef902a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointHinge.h +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_HINGE_H__ -#define __ND_JOINT_HINGE_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndJointHinge: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointHinge, ndJointBilateralConstraint) - - D_NEWTON_API ndJointHinge(); - D_NEWTON_API ndJointHinge(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API ndJointHinge(const ndMatrix& pinAndPivotInChild, const ndMatrix& pinAndPivotInParent, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndJointHinge(); - - D_NEWTON_API ndFloat32 GetAngle() const; - D_NEWTON_API ndFloat32 GetOmega() const; - D_NEWTON_API ndFloat32 GetTargetAngle() const; - D_NEWTON_API void SetTargetAngle(ndFloat32 angle); - D_NEWTON_API bool GetLimitState() const; - D_NEWTON_API void SetLimitState(bool state); - D_NEWTON_API void SetLimits(ndFloat32 minLimit, ndFloat32 maxLimit); - D_NEWTON_API void GetLimits(ndFloat32& minLimit, ndFloat32& maxLimit) const; - D_NEWTON_API void SetAsSpringDamper(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); - D_NEWTON_API void GetSpringDamper(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const; - D_NEWTON_API void DebugJoint(ndConstraintDebugCallback& debugCallback) const; - - protected: - D_NEWTON_API void ClearMemory(); - D_NEWTON_API ndFloat32 PenetrationOmega(ndFloat32 penetartion) const; - D_NEWTON_API void SubmitLimits(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - D_NEWTON_API void SubmitSpringDamper(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - D_NEWTON_API ndInt32 GetKinematicState(ndKinematicState* const state) const; - D_NEWTON_API void ApplyBaseRows(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - ndFloat32 m_angle; - ndFloat32 m_omega; - ndFloat32 m_springK; - ndFloat32 m_damperC; - ndFloat32 m_minLimit; - ndFloat32 m_maxLimit; - ndFloat32 m_targetAngle; - ndFloat32 m_springDamperRegularizer; - ndInt8 m_limitState; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointKinematicController.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointKinematicController.cpp deleted file mode 100644 index 30620d8377..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointKinematicController.cpp +++ /dev/null @@ -1,417 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointKinematicController.h" - -#define D_NOMINAL_TIMESTEP ndFloat32(1.0f / 60.0f) - -#if 0 -void ndJointKinematicController::SubmitConstraints (dFloat32 timestep, dInt32 threadIndex) -{ - dMatrix matrix0; - dMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - SubmitLinearConstraints (matrix0, matrix1, timestep); - - if (m_controlMode != m_linear) - { - dVector omega0(0.0f); - dVector omega1(0.0f); - dVector veloc0(0.0f); - dVector veloc1(0.0f); - dComplementaritySolver::dJacobian jacobian0; - dComplementaritySolver::dJacobian jacobian1; - - ndBodyKinematicGetOmega(m_body0, &omega0[0]); - ndBodyKinematicGetVelocity(m_body0, &veloc0[0]); - if (m_body1) - { - ndBodyKinematicGetOmega(m_body1, &omega1[0]); - ndBodyKinematicGetVelocity(m_body1, &veloc1[0]); - } - - const dFloat32 damp = 0.3f; - const dFloat32 invTimestep = 1.0f / timestep; - if (m_controlMode == m_linearPlusAngularFriction) - { - dFloat32 omegaMag2 = omega0.DotProduct3(omega0); - dFloat32 angularFriction = m_maxAngularFriction + m_angularFrictionCoefficient * omegaMag2; - for (dInt32 i = 0; i < 3; ++i) - { - NewtonUserJointAddAngularRow(m_joint, 0.0f, &matrix1[i][0]); - NewtonUserJointGetRowJacobian(m_joint, &jacobian0.m_linear[0], &jacobian0.m_angular[0], &jacobian1.m_linear[0], &jacobian1.m_angular[0]); - - dVector pointOmega(omega0 * jacobian0.m_angular + omega1 * jacobian1.m_angular); - dFloat32 relSpeed = pointOmega.m_x + pointOmega.m_y + pointOmega.m_z; - dFloat32 relAccel = relSpeed * invTimestep; - - NewtonUserJointSetRowAcceleration(m_joint, -relAccel); - NewtonUserJointSetRowMinimumFriction(m_joint, -angularFriction); - NewtonUserJointSetRowMaximumFriction(m_joint, angularFriction); - } - } - else - { - - dFloat32 pitchAngle = 0.0f; - const dFloat32 maxAngle = 2.0f * m_maxOmega * timestep; - dFloat32 cosAngle = matrix1[0].DotProduct3(matrix0[0]); - if (cosAngle > dFloat32 (0.998f)) - { - if ((m_controlMode == m_linearAndCone) || (m_controlMode == m_full6dof)) - { - for (dInt32 i = 1; i < 3; ++i) - { - dFloat32 coneAngle = -damp * CalculateAngle(matrix0[0], matrix1[0], matrix1[i]); - NewtonUserJointAddAngularRow(m_joint, 0.0f, &matrix1[i][0]); - NewtonUserJointGetRowJacobian(m_joint, &jacobian0.m_linear[0], &jacobian0.m_angular[0], &jacobian1.m_linear[0], &jacobian1.m_angular[0]); - - dVector pointOmega(omega0 * jacobian0.m_angular + omega1 * jacobian1.m_angular); - dFloat32 relOmega = pointOmega.m_x + pointOmega.m_y + pointOmega.m_z; - - dFloat32 w = m_maxOmega * dSign(coneAngle); - if ((coneAngle < maxAngle) && (coneAngle > -maxAngle)) - { - w = damp * coneAngle * invTimestep; - } - - dAssert(dAbs(w) <= m_maxOmega); - dFloat32 relAlpha = (w + relOmega) * invTimestep; - - NewtonUserJointSetRowAcceleration(m_joint, -relAlpha); - NewtonUserJointSetRowMinimumFriction(m_joint, -m_maxAngularFriction); - NewtonUserJointSetRowMaximumFriction(m_joint, m_maxAngularFriction); - } - } - pitchAngle = -CalculateAngle(matrix0[1], matrix1[1], matrix1[0]); - - } - else - { - - dVector lateralDir(matrix1[0].CrossProduct(matrix0[0])); - dAssert(lateralDir.DotProduct3(lateralDir) > 1.0e-6f); - lateralDir = lateralDir.Normalize(); - dFloat32 coneAngle = dAcos(dClamp(cosAngle, dFloat32(-1.0f), dFloat32(1.0f))); - dMatrix coneRotation(dQuaternion(lateralDir, coneAngle), matrix1.m_posit); - - if ((m_controlMode == m_linearAndCone) || (m_controlMode == m_full6dof)) - { - NewtonUserJointAddAngularRow(m_joint, 0.0f, &lateralDir[0]); - NewtonUserJointGetRowJacobian(m_joint, &jacobian0.m_linear[0], &jacobian0.m_angular[0], &jacobian1.m_linear[0], &jacobian1.m_angular[0]); - - dVector pointOmega(omega0 * jacobian0.m_angular + omega1 * jacobian1.m_angular); - dFloat32 relOmega = pointOmega.m_x + pointOmega.m_y + pointOmega.m_z; - - dFloat32 w = m_maxOmega * dSign(coneAngle); - if ((coneAngle < maxAngle) && (coneAngle > -maxAngle)) - { - w = damp * coneAngle * invTimestep; - } - dFloat32 relAlpha = (w + relOmega) * invTimestep; - - NewtonUserJointSetRowAcceleration(m_joint, -relAlpha); - NewtonUserJointSetRowMinimumFriction(m_joint, -m_maxAngularFriction); - NewtonUserJointSetRowMaximumFriction(m_joint, m_maxAngularFriction); - - - dVector sideDir(lateralDir.CrossProduct(matrix0.m_front)); - NewtonUserJointAddAngularRow(m_joint, 0.0f, &sideDir[0]); - NewtonUserJointGetRowJacobian(m_joint, &jacobian0.m_linear[0], &jacobian0.m_angular[0], &jacobian1.m_linear[0], &jacobian1.m_angular[0]); - pointOmega = omega0 * jacobian0.m_angular + omega1 * jacobian1.m_angular; - relOmega = pointOmega.m_x + pointOmega.m_y + pointOmega.m_z; - relAlpha = relOmega * invTimestep; - - NewtonUserJointSetRowAcceleration(m_joint, -relAlpha); - NewtonUserJointSetRowMinimumFriction(m_joint, -m_maxAngularFriction); - NewtonUserJointSetRowMaximumFriction(m_joint, m_maxAngularFriction); - } - - dMatrix pitchMatrix(matrix1 * coneRotation * matrix0.Inverse()); - pitchAngle = -dAtan2(pitchMatrix[1][2], pitchMatrix[1][1]); - } - - if ((m_controlMode == m_linearAndTwist) || (m_controlMode == m_full6dof)) - { - NewtonUserJointAddAngularRow(m_joint, 0.0f, &matrix0[0][0]); - NewtonUserJointGetRowJacobian(m_joint, &jacobian0.m_linear[0], &jacobian0.m_angular[0], &jacobian1.m_linear[0], &jacobian1.m_angular[0]); - dVector pointOmega(omega0 * jacobian0.m_angular + omega1 * jacobian1.m_angular); - dFloat32 relOmega = pointOmega.m_x + pointOmega.m_y + pointOmega.m_z; - - dFloat32 w = m_maxOmega * dSign(pitchAngle); - if ((pitchAngle < maxAngle) && (pitchAngle > -maxAngle)) { - w = damp * pitchAngle * invTimestep; - } - dAssert(dAbs(w) <= m_maxOmega); - dFloat32 relAlpha = (w + relOmega) * invTimestep; - - NewtonUserJointSetRowAcceleration(m_joint, -relAlpha); - NewtonUserJointSetRowMinimumFriction(m_joint, -m_maxAngularFriction); - NewtonUserJointSetRowMaximumFriction(m_joint, m_maxAngularFriction); - } - } - } -} -#endif - -ndJointKinematicController::ndJointKinematicController() - :ndJointBilateralConstraint() -{ - m_maxDof = 6; -} - -ndJointKinematicController::ndJointKinematicController(ndBodyKinematic* const body, ndBodyKinematic* const referenceBody, const ndVector& attachmentPointInGlobalSpace) - :ndJointBilateralConstraint(6, body, referenceBody, ndGramSchmidtMatrix(attachmentPointInGlobalSpace)) -{ - ndAssert(GetBody0() == body); - ndMatrix matrix(body->GetMatrix()); - matrix.m_posit = attachmentPointInGlobalSpace; - matrix.m_posit.m_w = ndFloat32(1.0f); - - Init(matrix); -} - -ndJointKinematicController::ndJointKinematicController(ndBodyKinematic* const referenceBody, ndBodyKinematic* const body, const ndMatrix& attachmentMatrixInGlobalSpace) - :ndJointBilateralConstraint(6, referenceBody, body, attachmentMatrixInGlobalSpace) -{ - Init(attachmentMatrixInGlobalSpace); -} - -ndJointKinematicController::~ndJointKinematicController() -{ - m_body0->SetAutoSleep(m_autoSleepState); -} - -void ndJointKinematicController::Init(const ndMatrix& globalMatrix) -{ - CalculateLocalMatrix(globalMatrix, m_localMatrix0, m_localMatrix1); - - m_autoSleepState = m_body0->GetAutoSleep(); - m_body0->SetAutoSleep(false); - - SetControlMode(m_full6dof); - SetMaxLinearFriction(1.0f); - SetMaxAngularFriction(1.0f); - SetAngularViscousFrictionCoefficient(1.0f); - SetMaxSpeed(30.0f); - SetMaxOmega(10.0f * 360.0f * ndDegreeToRad); - - // set as soft joint - SetSolverModel(m_jointkinematicAttachment); -} - -void ndJointKinematicController::CheckSleep() const -{ - GetBody0()->SetSleepState(false); - - //ndAssert(0); - //ndMatrix matrix0; - //ndMatrix matrix1; - //CalculateGlobalMatrix(matrix0, matrix1); - // - //ndMatrix matrix(matrix1 * matrix0.Inverse()); - //matrix.m_posit.m_w = 0.0f; - //if (matrix.m_posit.DotProduct3(matrix.m_posit) > ndFloat32(1.0e-6f)) - //{ - // ndBodyKinematicSetSleepState(m_body0, 0); - //} - //else - //{ - // switch (m_controlMode) - // { - // case m_full6dof: - // case m_linearPlusAngularFriction: - // { - // ndFloat32 trace = matrix[0][0] * matrix[1][1] * matrix[2][2]; - // if (trace < 0.9995f) - // { - // ndBodyKinematicSetSleepState(m_body0, 0); - // } - // break; - // } - // - // case m_linearAndCone: - // { - // ndFloat32 cosAngle = matrix1[0].DotProduct3(matrix0[0]); - // if (cosAngle > 0.998f) - // { - // ndBodyKinematicSetSleepState(m_body0, 0); - // } - // break; - // } - // - // case m_linearAndTwist: - // { - // ndFloat32 pitchAngle = 0.0f; - // ndFloat32 cosAngle = matrix1[0].DotProduct3(matrix0[0]); - // if (cosAngle > 0.998f) - // { - // pitchAngle = CalculateAngle(matrix0[1], matrix1[1], matrix1[0]); - // } - // else - // { - // ndVector lateralDir(matrix1[0].CrossProduct(matrix0[0])); - // ndAssert(lateralDir.DotProduct3(lateralDir) > 1.0e-6f); - // lateralDir = lateralDir.Normalize(); - // ndFloat32 coneAngle = dAcos(ndClamp(cosAngle, ndFloat32(-1.0f), ndFloat32(1.0f))); - // ndMatrix coneRotation(dQuaternion(lateralDir, coneAngle), matrix1.m_posit); - // ndMatrix pitchMatrix(matrix1 * coneRotation * matrix0.Inverse()); - // pitchAngle = dAtan2(pitchMatrix[1][2], pitchMatrix[1][1]); - // } - // - // if (ndAbs(pitchAngle) > (1.0 * ndDegreeToRad)) - // { - // ndBodyKinematicSetSleepState(m_body0, 0); - // } - // break; - // } - // } - //} -} - -void ndJointKinematicController::SetTargetMatrix(const ndMatrix& matrix) -{ - const ndVector maxStep(ndVector(m_maxSpeed * D_NOMINAL_TIMESTEP)); - const ndVector minStep(maxStep * ndVector::m_negOne); - const ndVector step((maxStep.GetMin(matrix.m_posit - m_localMatrix1.m_posit)).GetMax(minStep)); - const ndVector posit(m_localMatrix1.m_posit + (step & ndVector::m_triplexMask)); - - m_localMatrix1 = matrix; - m_localMatrix1.m_posit = posit; - CheckSleep(); -} - -void ndJointKinematicController::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - const ndVector omega0(m_body0->GetOmega()); - const ndVector omega1(m_body1->GetOmega()); - const ndVector veloc0(m_body0->GetVelocity()); - const ndVector veloc1(m_body1->GetVelocity()); - - const ndFloat32 timestep = desc.m_timestep; - const ndFloat32 invTimestep = desc.m_invTimestep; - - const ndFloat32 damp = ndFloat32 (0.3f); - const ndFloat32 maxDistance = 2.0f * m_maxSpeed * timestep; - for (ndInt32 i = 0; i < 3; ++i) - { - const ndInt32 index = desc.m_rowsCount; - AddLinearRowJacobian(desc, matrix0.m_posit, matrix0.m_posit, matrix1[i]); - const ndJacobianPair& jacobianPair = desc.m_jacobian[index]; - - const ndVector pointPosit( - matrix0.m_posit * jacobianPair.m_jacobianM0.m_linear + - matrix1.m_posit * jacobianPair.m_jacobianM1.m_linear); - - const ndVector pointVeloc( - veloc0 * jacobianPair.m_jacobianM0.m_linear + omega0 * jacobianPair.m_jacobianM0.m_angular + - veloc1 * jacobianPair.m_jacobianM1.m_linear + omega1 * jacobianPair.m_jacobianM1.m_angular); - - const ndFloat32 dist = pointPosit.AddHorizontal().GetScalar(); - const ndFloat32 speed = pointVeloc.AddHorizontal().GetScalar(); - - ndFloat32 v = m_maxSpeed * ndSign(dist); - if ((dist < maxDistance) && (dist > -maxDistance)) - { - v = damp * dist * invTimestep; - } - ndAssert(ndAbs(v) <= m_maxSpeed); - - const ndFloat32 relAccel = ndClamp ((v + speed) * invTimestep, ndFloat32 (-400.0f), ndFloat32 (400.0f)); - - SetMotorAcceleration(desc, -relAccel); - SetLowerFriction(desc, -m_maxLinearFriction); - SetHighFriction(desc, m_maxLinearFriction); - } - - if (m_controlMode == m_linearPlusAngularFriction) - { - const ndFloat32 omegaMag2 = omega0.DotProduct(omega0).GetScalar(); - const ndFloat32 angularFriction = m_maxAngularFriction + m_angularFrictionCoefficient * omegaMag2; - for (ndInt32 i = 0; i < 3; ++i) - { - const ndInt32 index = desc.m_rowsCount; - AddAngularRowJacobian(desc, matrix1[i], ndFloat32 (0.0f)); - const ndJacobianPair& jacobianPair = desc.m_jacobian[index]; - - const ndVector pointOmega(omega0 * jacobianPair.m_jacobianM0.m_angular + omega1 * jacobianPair.m_jacobianM1.m_angular); - const ndFloat32 relSpeed = pointOmega.AddHorizontal().GetScalar(); - const ndFloat32 relAccel = ndClamp (relSpeed * invTimestep, ndFloat32 (-3000.0f), ndFloat32(3000.0f)); - SetMotorAcceleration(desc, -relAccel); - SetLowerFriction(desc, -angularFriction); - SetHighFriction(desc, angularFriction); - } - } - else if (m_controlMode == m_full6dof) - { -//test angle parameters -//m_maxOmega = 10.0f; -//m_maxAngularFriction = 10000.0f; -//matrix1 = ndPitchMatrix(125.0f * ndDegreeToRad) * ndYawMatrix(-60.0f * ndDegreeToRad) * ndRollMatrix(80.0f * ndDegreeToRad); - - const ndQuaternion rotation(matrix0.OrthoInverse() * matrix1); - const ndVector pin(rotation & ndVector::m_triplexMask); - const ndFloat32 dirMag2 = pin.DotProduct(pin).GetScalar(); - const ndFloat32 tol = ndFloat32(3.0f * ndPi / 180.0f); - if (dirMag2 > (tol * tol)) - { - const ndMatrix basis(ndGramSchmidtMatrix(pin)); - const ndFloat32 dirMag = ndSqrt(dirMag2); - const ndFloat32 angle = ndAtan2(dirMag, rotation.m_w); - AddAngularRowJacobian(desc, basis[0], angle); - const ndJacobian& jacobian0 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM0; - const ndJacobian& jacobian1 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM1; - const ndVector pointOmega(omega0 * jacobian0.m_angular + omega1 * jacobian1.m_angular); - const ndFloat32 omega = pointOmega.m_x + pointOmega.m_y + pointOmega.m_z; - const ndFloat32 relOmega = m_maxOmega - omega; - ndFloat32 deltaAngle = ndFloat32 (2.0f) * relOmega * timestep; - if (deltaAngle < angle) - { - ndFloat32 relAccel = relOmega * invTimestep; - SetMotorAcceleration(desc, relAccel); - } - SetLowerFriction(desc, -m_maxAngularFriction); - SetHighFriction(desc, m_maxAngularFriction); - - AddAngularRowJacobian(desc, basis[1], ndFloat32(0.0f)); - SetLowerFriction(desc, -m_maxAngularFriction); - SetHighFriction(desc, m_maxAngularFriction); - - AddAngularRowJacobian(desc, basis[2], ndFloat32(0.0f)); - SetLowerFriction(desc, -m_maxAngularFriction); - SetHighFriction(desc, m_maxAngularFriction); - } - else - { - ndFloat32 angle0 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up); - AddAngularRowJacobian(desc, matrix1.m_up, angle0); - SetLowerFriction(desc, -m_maxAngularFriction); - SetHighFriction(desc, m_maxAngularFriction); - - ndFloat32 angle1 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - AddAngularRowJacobian(desc, matrix1.m_right, angle1); - SetLowerFriction(desc, -m_maxAngularFriction); - SetHighFriction(desc, m_maxAngularFriction); - - ndFloat32 angle2 = CalculateAngle(matrix0.m_up, matrix1.m_up, matrix1.m_front); - AddAngularRowJacobian(desc, matrix1.m_front, angle2); - SetLowerFriction(desc, -m_maxAngularFriction); - SetHighFriction(desc, m_maxAngularFriction); - } - } -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointKinematicController.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointKinematicController.h deleted file mode 100644 index e9e5fe8684..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointKinematicController.h +++ /dev/null @@ -1,158 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_KINEMATIC_CONTROLLER_H__ -#define __ND_JOINT_KINEMATIC_CONTROLLER_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndJointKinematicController: public ndJointBilateralConstraint -{ - public: - enum ndControlModes - { - m_linear, - m_full6dof, - m_linearPlusAngularFriction, // for pick mode from screen - }; - - D_CLASS_REFLECTION(ndJointKinematicController, ndJointBilateralConstraint) - - D_NEWTON_API ndJointKinematicController(); - D_NEWTON_API ndJointKinematicController(ndBodyKinematic* const referenceBody, ndBodyKinematic* const body, const ndVector& attachmentPointInGlobalSpace); - D_NEWTON_API ndJointKinematicController(ndBodyKinematic* const referenceBody, ndBodyKinematic* const body, const ndMatrix& attachmentMatrixInGlobalSpace); - D_NEWTON_API virtual ~ndJointKinematicController(); - - virtual bool IsBilateral() const; - void SetControlMode(ndControlModes mode); - void SetMaxSpeed(ndFloat32 speedInMetersPerSeconds); - void SetMaxOmega(ndFloat32 speedInRadiansPerSeconds); - void SetMaxLinearFriction(ndFloat32 force); - void SetMaxAngularFriction(ndFloat32 torque); - void SetAngularViscousFrictionCoefficient(ndFloat32 coefficient); - - ndFloat32 GetMaxSpeed() const; - ndFloat32 GetMaxOmega() const; - ndControlModes GetControlMode() const; - ndFloat32 GetMaxLinearFriction() const; - ndFloat32 GetMaxAngularFriction() const; - ndFloat32 GetAngularViscousFrictionCoefficient() const; - - ndMatrix GetTargetMatrix() const; - void SetTargetPosit(const ndVector& posit); - void SetTargetRotation(const ndQuaternion& rotation); - - D_NEWTON_API void SetTargetMatrix(const ndMatrix& matrix); - - protected: - void Init(const ndMatrix& matrix); - - D_NEWTON_API void CheckSleep() const; - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - - private: - ndFloat32 m_maxSpeed; - ndFloat32 m_maxOmega; - ndFloat32 m_maxLinearFriction; - ndFloat32 m_maxAngularFriction; - ndFloat32 m_angularFrictionCoefficient; - ndControlModes m_controlMode; - bool m_autoSleepState; -}; - -inline void ndJointKinematicController::SetControlMode(ndControlModes mode) -{ - m_controlMode = mode; -} - -inline void ndJointKinematicController::SetMaxSpeed(ndFloat32 speedInMetersPerSeconds) -{ - m_maxSpeed = ndAbs(speedInMetersPerSeconds); -} - -inline void ndJointKinematicController::SetMaxLinearFriction(ndFloat32 frictionForce) -{ - m_maxLinearFriction = ndAbs(frictionForce); -} - -inline void ndJointKinematicController::SetMaxAngularFriction(ndFloat32 frictionTorque) -{ - m_maxAngularFriction = ndAbs(frictionTorque); -} - -inline void ndJointKinematicController::SetMaxOmega(ndFloat32 speedInRadiansPerSeconds) -{ - m_maxOmega = ndAbs(speedInRadiansPerSeconds); -} - -inline void ndJointKinematicController::SetAngularViscousFrictionCoefficient(ndFloat32 coefficient) -{ - ndVector mass (GetBody0()->GetMassMatrix()); - m_angularFrictionCoefficient = ndAbs(coefficient) * ndMax(mass.m_x, ndMax(mass.m_y, mass.m_z)); -} - -inline void ndJointKinematicController::SetTargetPosit(const ndVector& posit) -{ - ndMatrix matrix(m_localMatrix1); - matrix.m_posit = posit; - SetTargetMatrix(matrix); -} - -inline void ndJointKinematicController::SetTargetRotation(const ndQuaternion& rotation) -{ - ndMatrix matrix(ndCalculateMatrix(rotation, m_localMatrix1.m_posit)); - SetTargetMatrix(matrix); -} - -inline ndMatrix ndJointKinematicController::GetTargetMatrix() const -{ - ndAssert(0); - return m_localMatrix0; -} - -inline bool ndJointKinematicController::IsBilateral() const -{ - return true; -} - -inline ndFloat32 ndJointKinematicController::GetMaxSpeed() const -{ - return m_maxSpeed; -} - -inline ndFloat32 ndJointKinematicController::GetMaxOmega() const -{ - return m_maxOmega; -} - -inline ndJointKinematicController::ndControlModes ndJointKinematicController::GetControlMode() const -{ - return m_controlMode; -} - -inline ndFloat32 ndJointKinematicController::GetMaxLinearFriction() const -{ - return m_maxLinearFriction; -} - -inline ndFloat32 ndJointKinematicController::GetMaxAngularFriction() const -{ - return m_maxAngularFriction; -} - -inline ndFloat32 ndJointKinematicController::GetAngularViscousFrictionCoefficient() const -{ - return m_angularFrictionCoefficient; -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPlane.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPlane.cpp deleted file mode 100644 index 60d8be3bb6..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPlane.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointPlane.h" - -ndJointPlane::ndJointPlane() - :ndJointBilateralConstraint() - ,m_enableControlRotation(true) -{ - m_maxDof = 5; -} - -ndJointPlane::ndJointPlane (const ndVector& pivot, const ndVector& normal, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(5, child, parent, ndGetIdentityMatrix()) - ,m_enableControlRotation(true) -{ - ndMatrix pinAndPivotFrame(ndGramSchmidtMatrix(normal)); - pinAndPivotFrame.m_posit = pivot; - pinAndPivotFrame.m_posit.m_w = 1.0f; - // calculate the two local matrix of the pivot point - CalculateLocalMatrix (pinAndPivotFrame, m_localMatrix0, m_localMatrix1); -} - -ndJointPlane::~ndJointPlane() -{ -} - -void ndJointPlane::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - - // calculate the position of the pivot point and the Jacobian direction vectors, in global space. - CalculateGlobalMatrix (matrix0, matrix1); - - // Restrict the movement on the pivot point along all two orthonormal axis direction perpendicular to the motion - const ndVector& dir = matrix1[0]; - const ndVector& p0 = matrix0.m_posit; - const ndVector& p1 = matrix1.m_posit; - //NewtonUserJointAddLinearRow(m_joint, &p0[0], &p1[0], &dir[0]); - AddLinearRowJacobian(desc, p0, p1, dir); - - //const ndFloat32 invTimeStep = 1.0f / timestep; - const ndFloat32 dist = 0.25f * dir.DotProduct((p1 - p0) & ndVector::m_triplexMask).GetScalar(); - //const ndFloat32 accel = NewtonUserJointCalculateRowZeroAcceleration(m_joint) + dist * invTimeStep * invTimeStep; - const ndFloat32 accel = GetMotorZeroAcceleration(desc) + dist * desc.m_invTimestep * desc.m_invTimestep; - - //NewtonUserJointSetRowAcceleration(m_joint, accel); - SetMotorAcceleration(desc, accel); - //NewtonUserJointSetRowStiffness(m_joint, m_stiffness); - - // construct an orthogonal coordinate system with these two vectors - if (m_enableControlRotation) - { - //NewtonUserJointAddAngularRow(m_joint, CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up), &matrix1.m_up[0]); - AddAngularRowJacobian(desc, matrix1.m_up, CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up)); - //NewtonUserJointSetRowStiffness(m_joint, m_stiffness); - - //NewtonUserJointAddAngularRow(m_joint, CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right), &matrix1.m_right[0]); - AddAngularRowJacobian(desc, matrix1.m_right, CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right)); - //NewtonUserJointSetRowStiffness(m_joint, m_stiffness); - } -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPlane.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPlane.h deleted file mode 100644 index 7667c49ebd..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPlane.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_PLANE_H__ -#define __ND_JOINT_PLANE_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndJointPlane: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointPlane, ndJointBilateralConstraint) - - D_NEWTON_API ndJointPlane(); - D_NEWTON_API ndJointPlane (const ndVector& pivot, const ndVector& normal, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndJointPlane(); - - void EnableControlRotation(bool state); - bool GetEnableControlRotation() const; - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - - bool m_enableControlRotation; -}; - -inline void ndJointPlane::EnableControlRotation(bool state) -{ - m_enableControlRotation = state; -} - -inline bool ndJointPlane::GetEnableControlRotation() const -{ - return m_enableControlRotation; -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPulley.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPulley.cpp deleted file mode 100644 index 84df5bcfa1..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPulley.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointPulley.h" - -ndJointPulley::ndJointPulley() - :ndJointBilateralConstraint() - ,m_gearRatio(ndFloat32 (1.0f)) -{ - m_maxDof = 1; -} - -ndJointPulley::ndJointPulley(ndFloat32 gearRatio, - const ndVector& body0Pin, ndBodyKinematic* const body0, - const ndVector& body1Pin, ndBodyKinematic* const body1) - :ndJointBilateralConstraint(1, body0, body1, ndGetIdentityMatrix()) - ,m_gearRatio(gearRatio) -{ - // calculate the two local matrix of the pivot point - ndMatrix dommyMatrix; - - // calculate the local matrix for body body0 - ndMatrix pinAndPivot0(ndGramSchmidtMatrix(body0Pin)); - CalculateLocalMatrix(pinAndPivot0, m_localMatrix0, dommyMatrix); - m_localMatrix0.m_posit = ndVector::m_wOne; - - // calculate the local matrix for body body1 - ndMatrix pinAndPivot1(ndGramSchmidtMatrix(body1Pin)); - CalculateLocalMatrix(pinAndPivot1, dommyMatrix, m_localMatrix1); - m_localMatrix1.m_posit = ndVector::m_wOne; - - // set as kinematic loop - SetSolverModel(m_jointkinematicCloseLoop); -} - -ndJointPulley::~ndJointPulley() -{ -} - -ndFloat32 ndJointPulley::GetRatio() const -{ - return m_gearRatio; -} - -void ndJointPulley::SetRatio(ndFloat32 ratio) -{ - m_gearRatio = ratio; -} - -void ndJointPulley::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - - // calculate the position of the pivot point and the Jacobian direction vectors, in global space. - CalculateGlobalMatrix(matrix0, matrix1); - - AddAngularRowJacobian(desc, matrix0.m_front, ndFloat32(0.0f)); - - ndJacobian& jacobian0 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM0; - ndJacobian& jacobian1 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM1; - - jacobian0.m_linear = matrix0.m_front.Scale(m_gearRatio); - jacobian1.m_linear = matrix1.m_front; - - const ndVector& veloc0 = m_body0->GetVelocity(); - const ndVector& veloc1 = m_body1->GetVelocity(); - - const ndVector relVeloc(veloc0 * jacobian0.m_linear + veloc1 * jacobian1.m_linear); - const ndFloat32 w = relVeloc.AddHorizontal().GetScalar() * ndFloat32(0.5f); - SetMotorAcceleration(desc, -w * desc.m_invTimestep); -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPulley.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPulley.h deleted file mode 100644 index a5830bd9b4..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointPulley.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_PULLEY_H__ -#define __ND_JOINT_PULLEY_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndJointPulley: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointPulley, ndJointBilateralConstraint) - - D_NEWTON_API ndJointPulley(); - D_NEWTON_API ndJointPulley(ndFloat32 gearRatio, - const ndVector& body0Pin, ndBodyKinematic* const body0, - const ndVector& body1Pin, ndBodyKinematic* const body1); - D_NEWTON_API virtual ~ndJointPulley(); - - D_NEWTON_API ndFloat32 GetRatio() const; - D_NEWTON_API void SetRatio(ndFloat32 ratio); - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - - ndFloat32 m_gearRatio; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointRoller.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointRoller.cpp deleted file mode 100644 index 6b2c6d8d89..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointRoller.cpp +++ /dev/null @@ -1,457 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointRoller.h" - -#define D_MAX_SLIDER_RECOVERY_SPEED ndFloat32 (0.5f) -#define D_MAX_SLIDER_PENETRATION ndFloat32 (0.05f) - -#define D_MAX_HINGE_RECOVERY_SPEED ndFloat32 (0.25f) -#define D_MAX_HINGE_PENETRATION (ndFloat32 (4.0f) * ndDegreeToRad) - -ndJointRoller::ndJointRoller() - :ndJointBilateralConstraint() - ,m_angle(ndFloat32(0.0f)) - ,m_omega(ndFloat32(0.0f)) - ,m_springKAngle(ndFloat32(0.0f)) - ,m_damperCAngle(ndFloat32(0.0f)) - ,m_minLimitAngle(ndFloat32(-1.0e10f)) - ,m_maxLimitAngle(ndFloat32(1.0e10f)) - ,m_offsetAngle(ndFloat32(0.0f)) - ,m_springDamperRegularizerAngle(ndFloat32(0.1f)) - ,m_posit(ndFloat32(0.0f)) - ,m_speed(ndFloat32(0.0f)) - ,m_springKPosit(ndFloat32(0.0f)) - ,m_damperCPosit(ndFloat32(0.0f)) - ,m_minLimitPosit(ndFloat32(-1.0e10f)) - ,m_maxLimitPosit(ndFloat32(1.0e10f)) - ,m_offsetPosit(ndFloat32(0.0f)) - ,m_springDamperRegularizerPosit(ndFloat32(0.1f)) - ,m_limitStatePosit(0) - ,m_limitStateAngle(0) -{ - m_maxDof = 8; -} - -ndJointRoller::ndJointRoller(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(8, child, parent, pinAndPivotFrame) - ,m_angle(ndFloat32(0.0f)) - ,m_omega(ndFloat32(0.0f)) - ,m_springKAngle(ndFloat32(0.0f)) - ,m_damperCAngle(ndFloat32(0.0f)) - ,m_minLimitAngle(ndFloat32(-1.0e10f)) - ,m_maxLimitAngle(ndFloat32(1.0e10f)) - ,m_offsetAngle(ndFloat32(0.0f)) - ,m_springDamperRegularizerAngle(ndFloat32(0.1f)) - ,m_posit(ndFloat32(0.0f)) - ,m_speed(ndFloat32(0.0f)) - ,m_springKPosit(ndFloat32(0.0f)) - ,m_damperCPosit(ndFloat32(0.0f)) - ,m_minLimitPosit(ndFloat32(-1.0e10f)) - ,m_maxLimitPosit(ndFloat32(1.0e10f)) - ,m_offsetPosit(ndFloat32(0.0f)) - ,m_springDamperRegularizerPosit(ndFloat32(0.1f)) - ,m_limitStatePosit(0) - ,m_limitStateAngle(0) -{ -} - -ndJointRoller::ndJointRoller(const ndMatrix& pinAndPivotInChild, const ndMatrix& pinAndPivotInParent, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(8, child, parent, pinAndPivotInChild) - ,m_angle(ndFloat32(0.0f)) - ,m_omega(ndFloat32(0.0f)) - ,m_springKAngle(ndFloat32(0.0f)) - ,m_damperCAngle(ndFloat32(0.0f)) - ,m_minLimitAngle(ndFloat32(-1.0e10f)) - ,m_maxLimitAngle(ndFloat32(1.0e10f)) - ,m_offsetAngle(ndFloat32(0.0f)) - ,m_springDamperRegularizerAngle(ndFloat32(0.1f)) - ,m_posit(ndFloat32(0.0f)) - ,m_speed(ndFloat32(0.0f)) - ,m_springKPosit(ndFloat32(0.0f)) - ,m_damperCPosit(ndFloat32(0.0f)) - ,m_minLimitPosit(ndFloat32(-1.0e10f)) - ,m_maxLimitPosit(ndFloat32(1.0e10f)) - ,m_offsetPosit(ndFloat32(0.0f)) - ,m_springDamperRegularizerPosit(ndFloat32(0.1f)) - ,m_limitStatePosit(0) - ,m_limitStateAngle(0) -{ - ndMatrix tmp; - CalculateLocalMatrix(pinAndPivotInChild, m_localMatrix0, tmp); - CalculateLocalMatrix(pinAndPivotInParent, tmp, m_localMatrix1); -} - -ndJointRoller::~ndJointRoller() -{ -} - -ndFloat32 ndJointRoller::GetAngle() const -{ - return m_angle; -} - -ndFloat32 ndJointRoller::GetOmega() const -{ - return m_omega; -} - -bool ndJointRoller::GetLimitStateAngle() const -{ - return m_limitStateAngle ? true : false; -} - -void ndJointRoller::SetLimitStateAngle(bool state) -{ - m_limitStateAngle = state ? 1 : 0; - if (m_limitStateAngle) - { - SetLimitsAngle(m_minLimitAngle, m_maxLimitAngle); - } -} - -void ndJointRoller::SetLimitsAngle(ndFloat32 minLimit, ndFloat32 maxLimit) -{ -#ifdef _DEBUG - if (minLimit > 0.0f) - { - ndTrace(("warning: %s minLimit %f larger than zero\n", __FUNCTION__, minLimit)) - } - if (maxLimit < 0.0f) - { - ndTrace(("warning: %s m_maxLimit %f smaller than zero\n", __FUNCTION__, maxLimit)) - } -#endif - - ndAssert(minLimit <= 0.0f); - ndAssert(maxLimit >= 0.0f); - m_minLimitAngle = minLimit; - m_maxLimitAngle = maxLimit; - - if (m_angle > m_maxLimitAngle) - { - //const ndFloat32 deltaAngle = ndAnglesAdd(m_angle, -m_maxLimitAngle); - //m_angle = m_maxLimitAngle + deltaAngle; - m_angle = m_maxLimitAngle; - } - else if (m_angle < m_minLimitAngle) - { - //const ndFloat32 deltaAngle = ndAnglesAdd(m_angle, -m_minLimitAngle); - //m_angle = m_minLimitAngle + deltaAngle; - m_angle = m_minLimitAngle; - } -} - -void ndJointRoller::GetLimitsAngle(ndFloat32& minLimit, ndFloat32& maxLimit) const -{ - minLimit = m_minLimitAngle; - maxLimit = m_maxLimitAngle; -} - -ndFloat32 ndJointRoller::GetOffsetAngle() const -{ - return m_offsetAngle; -} - -void ndJointRoller::SetOffsetAngle(ndFloat32 angle) -{ - m_offsetAngle = angle; -} - -void ndJointRoller::SetAsSpringDamperAngle(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_springKAngle = ndAbs(spring); - m_damperCAngle = ndAbs(damper); - m_springDamperRegularizerAngle = ndClamp(regularizer, ndFloat32(1.0e-2f), ndFloat32(0.99f)); -} - -void ndJointRoller::GetSpringDamperAngle(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_springKAngle; - damper = m_damperCAngle; - regularizer = m_springDamperRegularizerAngle; -} - -ndFloat32 ndJointRoller::GetPosit() const -{ - return m_posit; -} - -ndFloat32 ndJointRoller::GetOffsetPosit() const -{ - return m_offsetPosit; -} - -void ndJointRoller::SetOffsetPosit(ndFloat32 offset) -{ - m_offsetPosit = offset; -} - -bool ndJointRoller::GetLimitStatePosit() const -{ - return m_limitStatePosit ? true : false; -} - -void ndJointRoller::SetLimitStatePosit(bool state) -{ - m_limitStatePosit = state ? 1 : 0; - if (m_limitStatePosit) - { - SetLimitsPosit(m_minLimitPosit, m_maxLimitPosit); - } -} - -void ndJointRoller::SetLimitsPosit(ndFloat32 minLimit, ndFloat32 maxLimit) -{ - ndAssert(minLimit <= 0.0f); - ndAssert(maxLimit >= 0.0f); -#ifdef _DEBUG - if (minLimit > 0.0f) - { - ndTrace(("warning: %s minLimit %f larger than zero\n", __FUNCTION__, minLimit)) - } - if (maxLimit < 0.0f) - { - ndTrace(("warning: %s m_maxLimit %f smaller than zero\n", __FUNCTION__, maxLimit)) - } -#endif - - m_minLimitPosit = minLimit; - m_maxLimitPosit = maxLimit; - if (m_posit > m_maxLimitPosit) - { - m_posit = m_maxLimitPosit; - } - else if (m_posit < m_minLimitPosit) - { - m_posit = m_minLimitPosit; - } -} - -void ndJointRoller::GetLimitsPosit(ndFloat32& minLimit, ndFloat32& maxLimit) const -{ - minLimit = m_minLimitPosit; - maxLimit = m_maxLimitPosit; -} - -void ndJointRoller::SetAsSpringDamperPosit(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_springKPosit = ndAbs(spring); - m_damperCPosit = ndAbs(damper); - m_springDamperRegularizerPosit = ndClamp(regularizer, ndFloat32(1.0e-2f), ndFloat32(0.99f)); -} - -void ndJointRoller::GetSpringDamperPosit(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_springKPosit; - damper = m_damperCPosit; - regularizer = m_springDamperRegularizerPosit; -} - -void ndJointRoller::DebugJoint(ndConstraintDebugCallback& debugCallback) const -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - debugCallback.DrawFrame(matrix0); - debugCallback.DrawFrame(matrix1); - - const ndInt32 subdiv = 8; - const ndFloat32 radius = debugCallback.m_debugScale; - ndVector arch[subdiv + 1]; - - ndFloat32 deltaTwist = m_maxLimitAngle - m_minLimitAngle; - if ((deltaTwist > ndFloat32(1.0e-3f)) && (deltaTwist <= ndFloat32(2.0f) * ndPi)) - { - ndMatrix pitchMatrix(matrix1); - pitchMatrix.m_posit = matrix1.m_posit; - - ndVector point(ndFloat32(0.0f), ndFloat32(radius), ndFloat32(0.0f), ndFloat32(0.0f)); - - ndFloat32 angleStep = ndMin(deltaTwist, ndFloat32(2.0f * ndPi)) / subdiv; - ndFloat32 angle0 = m_minLimitAngle; - - ndVector color(ndFloat32(0.4f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - for (ndInt32 i = 0; i <= subdiv; ++i) - { - arch[i] = pitchMatrix.TransformVector(ndPitchMatrix(angle0).RotateVector(point)); - debugCallback.DrawLine(pitchMatrix.m_posit, arch[i], color); - angle0 += angleStep; - } - - for (ndInt32 i = 0; i < subdiv; ++i) - { - debugCallback.DrawLine(arch[i], arch[i + 1], color); - } - } -} - -void ndJointRoller::SubmitSpringDamperAngle(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& ) -{ - // add spring damper row - AddAngularRowJacobian(desc, matrix0.m_front, m_offsetAngle - m_angle); - SetMassSpringDamperAcceleration(desc, m_springDamperRegularizerAngle, m_springKAngle, m_damperCAngle); -} - -void ndJointRoller::SubmitSpringDamperPosit(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - // add spring damper row - const ndVector p1(matrix1.m_posit + matrix1.m_up.Scale(m_offsetPosit)); - AddLinearRowJacobian(desc, matrix0.m_posit, p1, matrix1.m_up); - SetMassSpringDamperAcceleration(desc, m_springDamperRegularizerPosit, m_springKPosit, m_damperCPosit); -} - -void ndJointRoller::ApplyBaseRows(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - const ndVector veloc0(m_body0->GetVelocityAtPoint(matrix0.m_posit)); - const ndVector veloc1(m_body1->GetVelocityAtPoint(matrix1.m_posit)); - - const ndVector& pin = matrix1[0]; - const ndVector& p0 = matrix0.m_posit; - const ndVector& p1 = matrix1.m_posit; - const ndVector prel(p0 - p1); - const ndVector vrel(veloc0 - veloc1); - - m_speed = vrel.DotProduct(matrix1.m_up).GetScalar(); - m_posit = prel.DotProduct(matrix1.m_up).GetScalar(); - const ndVector projectedPoint = p1 + pin.Scale(pin.DotProduct(prel).GetScalar()); - - AddLinearRowJacobian(desc, p0, projectedPoint, matrix1[0]); - AddLinearRowJacobian(desc, p0, projectedPoint, matrix1[2]); - - //const ndFloat32 angle0 = CalculateAngle(matrix0.m_up, matrix1.m_up, matrix1.m_front); - //AddAngularRowJacobian(desc, matrix1.m_front, angle0); - - const ndFloat32 angle1 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up); - AddAngularRowJacobian(desc, matrix1.m_up, angle1); - - const ndFloat32 angle2 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - AddAngularRowJacobian(desc, matrix1.m_right, angle2); - - // save the current joint Omega - const ndVector omega0(m_body0->GetOmega()); - const ndVector omega1(m_body1->GetOmega()); - - // the joint angle can be determined by getting the angle between any two non parallel vectors - const ndFloat32 deltaAngle = ndAnglesAdd(-CalculateAngle(matrix0.m_up, matrix1.m_up, matrix1.m_front), -m_angle); - m_angle += deltaAngle; - m_omega = matrix1.m_front.DotProduct(omega0 - omega1).GetScalar(); -} - -ndFloat32 ndJointRoller::PenetrationOmega(ndFloat32 penetration) const -{ - ndFloat32 param = ndClamp(penetration, ndFloat32(0.0f), D_MAX_HINGE_PENETRATION) / D_MAX_HINGE_PENETRATION; - ndFloat32 omega = D_MAX_HINGE_RECOVERY_SPEED * param; - return omega; -} - -void ndJointRoller::SubmitLimitsAngle(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - if (m_limitStateAngle) - { - if ((m_minLimitAngle > (ndFloat32(-1.0f) * ndDegreeToRad)) && (m_maxLimitAngle < (ndFloat32(1.0f) * ndDegreeToRad))) - { - AddAngularRowJacobian(desc, &matrix1.m_front[0], -m_angle); - } - else - { - const ndFloat32 angle = m_angle + m_omega * desc.m_timestep; - if (angle < m_minLimitAngle) - { - AddAngularRowJacobian(desc, &matrix0.m_front[0], ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_minLimitAngle; - const ndFloat32 recoveringAceel = -desc.m_invTimestep * PenetrationOmega(-penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetLowerFriction(desc, ndFloat32(0.0f)); - } - else if (angle > m_maxLimitAngle) - { - AddAngularRowJacobian(desc, &matrix0.m_front[0], ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_maxLimitAngle; - const ndFloat32 recoveringAceel = desc.m_invTimestep * PenetrationOmega(penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetHighFriction(desc, ndFloat32(0.0f)); - } - } - } -} - -ndFloat32 ndJointRoller::PenetrationSpeed(ndFloat32 penetration) const -{ - ndFloat32 param = ndClamp(penetration, ndFloat32(0.0f), D_MAX_SLIDER_PENETRATION) / D_MAX_SLIDER_PENETRATION; - ndFloat32 speed = D_MAX_SLIDER_RECOVERY_SPEED * param; - return speed; -} - -void ndJointRoller::SubmitLimitsPosit(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - if (m_limitStatePosit) - { - if ((m_minLimitPosit == ndFloat32(0.0f)) && (m_maxLimitPosit == ndFloat32(0.0f))) - { - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1.m_up); - } - else - { - ndFloat32 x = m_posit + m_speed * desc.m_timestep; - if (x < m_minLimitPosit) - { - const ndVector p1(matrix1.m_posit + matrix1.m_up.Scale(m_minLimitPosit)); - AddLinearRowJacobian(desc, matrix0.m_posit, p1, matrix1.m_up); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = x - m_minLimitPosit; - const ndFloat32 recoveringAceel = -desc.m_invTimestep * PenetrationSpeed(-penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetLowerFriction(desc, ndFloat32(0.0f)); - } - else if (x > m_maxLimitPosit) - { - AddLinearRowJacobian(desc, matrix0.m_posit, matrix0.m_posit, matrix1.m_up); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = x - m_maxLimitPosit; - const ndFloat32 recoveringAceel = desc.m_invTimestep * PenetrationSpeed(penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetHighFriction(desc, ndFloat32(0.0f)); - } - } - } -} - -void ndJointRoller::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - ApplyBaseRows(desc, matrix0, matrix1); - - if (m_springDamperRegularizerAngle && ((m_springKAngle > ndFloat32(0.0f)) || (m_damperCAngle > ndFloat32(0.0f)))) - { - // spring damper with limits - SubmitSpringDamperAngle(desc, matrix0, matrix1); - } - - if (m_springDamperRegularizerPosit && ((m_springKPosit > ndFloat32(0.0f)) || (m_damperCPosit > ndFloat32(0.0f)))) - { - // spring damper with limits - SubmitSpringDamperPosit(desc, matrix0, matrix1); - } - - SubmitLimitsPosit(desc, matrix0, matrix1); - SubmitLimitsAngle(desc, matrix0, matrix1); -} - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointRoller.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointRoller.h deleted file mode 100644 index 17b9c80e7c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointRoller.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_ROLLER_H__ -#define __ND_JOINT_ROLLER_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndJointRoller: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointRoller, ndJointBilateralConstraint) - - D_NEWTON_API ndJointRoller(); - D_NEWTON_API ndJointRoller(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API ndJointRoller(const ndMatrix& pinAndPivotInChild, const ndMatrix& pinAndPivotInParent, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndJointRoller(); - - D_NEWTON_API ndFloat32 GetAngle() const; - D_NEWTON_API ndFloat32 GetOmega() const; - D_NEWTON_API ndFloat32 GetOffsetAngle() const; - D_NEWTON_API void SetOffsetAngle(ndFloat32 angle); - D_NEWTON_API bool GetLimitStateAngle() const; - D_NEWTON_API void SetLimitStateAngle(bool state); - D_NEWTON_API void SetLimitsAngle(ndFloat32 minLimit, ndFloat32 maxLimit); - D_NEWTON_API void GetLimitsAngle(ndFloat32& minLimit, ndFloat32& maxLimit) const; - D_NEWTON_API void SetAsSpringDamperAngle(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); - D_NEWTON_API void GetSpringDamperAngle(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const; - - D_NEWTON_API ndFloat32 GetPosit() const; - D_NEWTON_API ndFloat32 GetOffsetPosit() const; - D_NEWTON_API void SetOffsetPosit(ndFloat32 offset); - D_NEWTON_API bool GetLimitStatePosit() const; - D_NEWTON_API void SetLimitStatePosit(bool state); - D_NEWTON_API void SetLimitsPosit(ndFloat32 minLimit, ndFloat32 maxLimit); - D_NEWTON_API void GetLimitsPosit(ndFloat32& minLimit, ndFloat32& maxLimit) const; - D_NEWTON_API void SetAsSpringDamperPosit(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); - D_NEWTON_API void GetSpringDamperPosit(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const; - D_NEWTON_API void DebugJoint(ndConstraintDebugCallback& debugCallback) const; - - protected: - D_NEWTON_API ndFloat32 PenetrationOmega(ndFloat32 penetartion) const; - D_NEWTON_API void SubmitLimitsAngle(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - D_NEWTON_API void SubmitSpringDamperAngle(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - D_NEWTON_API ndFloat32 PenetrationSpeed(ndFloat32 penetration) const; - D_NEWTON_API void SubmitLimitsPosit(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - D_NEWTON_API void SubmitSpringDamperPosit(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - D_NEWTON_API void ApplyBaseRows(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - ndFloat32 m_angle; - ndFloat32 m_omega; - ndFloat32 m_springKAngle; - ndFloat32 m_damperCAngle; - ndFloat32 m_minLimitAngle; - ndFloat32 m_maxLimitAngle; - ndFloat32 m_offsetAngle; - ndFloat32 m_springDamperRegularizerAngle; - - ndFloat32 m_posit; - ndFloat32 m_speed; - ndFloat32 m_springKPosit; - ndFloat32 m_damperCPosit; - ndFloat32 m_minLimitPosit; - ndFloat32 m_maxLimitPosit; - ndFloat32 m_offsetPosit; - ndFloat32 m_springDamperRegularizerPosit; - - ndInt8 m_limitStatePosit; - ndInt8 m_limitStateAngle; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSlider.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSlider.cpp deleted file mode 100644 index 1c0593c7dc..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSlider.cpp +++ /dev/null @@ -1,281 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointSlider.h" - -#define D_MAX_SLIDER_RECOVERY_SPEED ndFloat32 (0.5f) -#define D_MAX_SLIDER_PENETRATION ndFloat32 (0.05f) - -ndJointSlider::ndJointSlider() - :ndJointBilateralConstraint() - ,m_posit(ndFloat32(0.0f)) - ,m_speed(ndFloat32(0.0f)) - ,m_springK(ndFloat32(0.0f)) - ,m_damperC(ndFloat32(0.0f)) - ,m_minLimit(ndFloat32(-1.0e10f)) - ,m_maxLimit(ndFloat32(1.0e10f)) - ,m_positOffset(ndFloat32(0.0f)) - ,m_springDamperRegularizer(ndFloat32(0.1f)) - ,m_limitState(0) -{ - m_maxDof = 7; -} - -ndJointSlider::ndJointSlider(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(7, child, parent, pinAndPivotFrame) - ,m_posit(ndFloat32 (0.0f)) - ,m_speed(ndFloat32(0.0f)) - ,m_springK(ndFloat32(0.0f)) - ,m_damperC(ndFloat32(0.0f)) - ,m_minLimit(ndFloat32(-1.0e10f)) - ,m_maxLimit(ndFloat32(1.0e10f)) - ,m_positOffset(ndFloat32(0.0f)) - ,m_springDamperRegularizer(ndFloat32(0.1f)) - ,m_limitState(0) -{ -} - -ndJointSlider::ndJointSlider(const ndMatrix& pinAndPivotInChild, const ndMatrix& pinAndPivotInParent, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(7, child, parent, pinAndPivotInChild) - ,m_posit(ndFloat32(0.0f)) - ,m_speed(ndFloat32(0.0f)) - ,m_springK(ndFloat32(0.0f)) - ,m_damperC(ndFloat32(0.0f)) - ,m_minLimit(ndFloat32(-1.0e10f)) - ,m_maxLimit(ndFloat32(1.0e10f)) - ,m_positOffset(ndFloat32(0.0f)) - ,m_springDamperRegularizer(ndFloat32(0.1f)) - ,m_limitState(0) -{ - ndMatrix tmp; - CalculateLocalMatrix(pinAndPivotInChild, m_localMatrix0, tmp); - CalculateLocalMatrix(pinAndPivotInParent, tmp, m_localMatrix1); -} - -ndJointSlider::~ndJointSlider() -{ -} - -ndFloat32 ndJointSlider::GetSpeed() const -{ - return m_speed; -} - -ndFloat32 ndJointSlider::GetPosit() const -{ - return m_posit; -} - -ndFloat32 ndJointSlider::GetOffsetPosit() const -{ - return m_positOffset; -} - -void ndJointSlider::SetOffsetPosit(ndFloat32 offset) -{ - m_positOffset = offset; -} - -bool ndJointSlider::GetLimitState() const -{ - return m_limitState ? true : false; -} - -void ndJointSlider::SetLimitState(bool state) -{ - m_limitState = state ? 1 : 0; - if (m_limitState) - { - SetLimits(m_minLimit, m_maxLimit); - } -} - -void ndJointSlider::SetLimits(ndFloat32 minLimit, ndFloat32 maxLimit) -{ -#ifdef _DEBUG - if (minLimit > 0.0f) - { - ndTrace(("warning: %s minLimit %f larger than zero\n", __FUNCTION__, minLimit)) - } - if (maxLimit < 0.0f) - { - ndTrace(("warning: %s m_maxLimit %f smaller than zero\n", __FUNCTION__, maxLimit)) - } -#endif - - m_minLimit = minLimit; - m_maxLimit = maxLimit; - if (m_posit > m_maxLimit) - { - m_posit = m_maxLimit; - } - else if (m_posit < m_minLimit) - { - m_posit = m_minLimit; - } -} - -void ndJointSlider::GetLimits(ndFloat32& minLimit, ndFloat32& maxLimit) const -{ - minLimit = m_minLimit; - maxLimit = m_maxLimit; -} - -void ndJointSlider::SetAsSpringDamper(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_springK = ndAbs(spring); - m_damperC = ndAbs(damper); - m_springDamperRegularizer = ndClamp(regularizer, ND_SPRING_DAMP_MIN_REG, ndFloat32(0.99f)); -} - -void ndJointSlider::GetSpringDamper(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_springK; - damper = m_damperC; - regularizer = m_springDamperRegularizer; -} - -void ndJointSlider::DebugJoint(ndConstraintDebugCallback& debugCallback) const -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - debugCallback.DrawFrame(matrix0); - debugCallback.DrawFrame(matrix1, 0.5f); - -} - -ndFloat32 ndJointSlider::PenetrationSpeed(ndFloat32 penetration) const -{ - ndFloat32 param = ndClamp(penetration, ndFloat32(0.0f), D_MAX_SLIDER_PENETRATION) / D_MAX_SLIDER_PENETRATION; - ndFloat32 speed = D_MAX_SLIDER_RECOVERY_SPEED * param; - return speed; -} - -ndInt32 ndJointSlider::GetKinematicState(ndKinematicState* const state) const -{ - state->m_posit = m_posit; - state->m_velocity = m_speed; - return 1; -} - -//#pragma optimize( "", off ) -void ndJointSlider::ClearMemory() -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - ndJointBilateralConstraint::ClearMemory(); - - const ndVector& p0 = matrix0.m_posit; - const ndVector& p1 = matrix1.m_posit; - const ndVector veloc0(m_body0->GetVelocityAtPoint(matrix0.m_posit)); - const ndVector veloc1(m_body1->GetVelocityAtPoint(matrix1.m_posit)); - - const ndVector prel(p0 - p1); - const ndVector vrel(veloc0 - veloc1); - - m_speed = vrel.DotProduct(matrix1.m_front).GetScalar(); - m_posit = prel.DotProduct(matrix1.m_front).GetScalar(); - m_positOffset = m_posit; -} - -void ndJointSlider::SubmitLimits(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - if (m_limitState) - { - if ((m_minLimit == ndFloat32(0.0f)) && (m_maxLimit == ndFloat32(0.0f))) - { - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1.m_front); - } - else - { - ndFloat32 x = m_posit + m_speed * desc.m_timestep; - if (x < m_minLimit) - { - ndVector p1(matrix1.m_posit + matrix1.m_front.Scale(m_minLimit)); - AddLinearRowJacobian(desc, matrix0.m_posit, p1, matrix1.m_front); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = x - m_minLimit; - const ndFloat32 recoveringAceel = -desc.m_invTimestep * PenetrationSpeed(-penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetLowerFriction(desc, ndFloat32(0.0f)); - } - else if (x > m_maxLimit) - { - AddLinearRowJacobian(desc, matrix0.m_posit, matrix0.m_posit, matrix1.m_front); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = x - m_maxLimit; - const ndFloat32 recoveringAceel = desc.m_invTimestep * PenetrationSpeed(penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAceel); - SetHighFriction(desc, ndFloat32(0.0f)); - } - } - } -} - -void ndJointSlider::SubmitSpringDamper(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - // add spring damper row - const ndVector p1(matrix1.m_posit + matrix1.m_front.Scale(m_positOffset)); - AddLinearRowJacobian(desc, matrix0.m_posit, p1, matrix1.m_front); - SetMassSpringDamperAcceleration(desc, m_springDamperRegularizer, m_springK, m_damperC); -} - -void ndJointSlider::ApplyBaseRows(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1) -{ - const ndVector veloc0(m_body0->GetVelocityAtPoint(matrix0.m_posit)); - const ndVector veloc1(m_body1->GetVelocityAtPoint(matrix1.m_posit)); - - const ndVector& pin = matrix1[0]; - const ndVector& p0 = matrix0.m_posit; - const ndVector& p1 = matrix1.m_posit; - const ndVector prel(p0 - p1); - const ndVector vrel(veloc0 - veloc1); - - m_speed = vrel.DotProduct(matrix1.m_front).GetScalar(); - m_posit = prel.DotProduct(matrix1.m_front).GetScalar(); - const ndVector projectedPoint = p1 + pin.Scale(pin.DotProduct(prel).GetScalar()); - - AddLinearRowJacobian(desc, p0, projectedPoint, matrix1[1]); - AddLinearRowJacobian(desc, p0, projectedPoint, matrix1[2]); - - const ndFloat32 angle0 = CalculateAngle(matrix0.m_up, matrix1.m_up, matrix1.m_front); - AddAngularRowJacobian(desc, matrix1.m_front, angle0); - - const ndFloat32 angle1 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up); - AddAngularRowJacobian(desc, matrix1.m_up, angle1); - - const ndFloat32 angle2 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - AddAngularRowJacobian(desc, matrix1.m_right, angle2); -} - -void ndJointSlider::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - - // calculate the position of the pivot point and the Jacobian direction vectors, in global space. - CalculateGlobalMatrix(matrix0, matrix1); - - ApplyBaseRows(desc, matrix0, matrix1); - - if (m_springDamperRegularizer && ((m_springK > ndFloat32(0.0f)) || (m_damperC > ndFloat32(0.0f)))) - { - SubmitSpringDamper(desc, matrix0, matrix1); - } - - SubmitLimits(desc, matrix0, matrix1); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSlider.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSlider.h deleted file mode 100644 index 0ad5eeb7c9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSlider.h +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_SLIDER_H__ -#define __ND_JOINT_SLIDER_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndJointSlider: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointSlider, ndJointBilateralConstraint) - - D_NEWTON_API ndJointSlider(); - D_NEWTON_API ndJointSlider(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API ndJointSlider(const ndMatrix& pinAndPivotInChild, const ndMatrix& pinAndPivotInParent, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndJointSlider(); - - D_NEWTON_API ndFloat32 GetSpeed() const; - D_NEWTON_API ndFloat32 GetPosit() const; - D_NEWTON_API ndFloat32 GetOffsetPosit() const; - D_NEWTON_API void SetOffsetPosit(ndFloat32 offset); - D_NEWTON_API bool GetLimitState() const; - D_NEWTON_API void SetLimitState(bool state); - D_NEWTON_API void SetLimits(ndFloat32 minLimit, ndFloat32 maxLimit); - D_NEWTON_API void GetLimits(ndFloat32& minLimit, ndFloat32& maxLimit) const; - D_NEWTON_API virtual void SetAsSpringDamper(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); - D_NEWTON_API void GetSpringDamper(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const; - D_NEWTON_API void DebugJoint(ndConstraintDebugCallback& debugCallback) const; - - protected: - D_NEWTON_API void ClearMemory(); - D_NEWTON_API ndFloat32 PenetrationSpeed(ndFloat32 penetration) const; - D_NEWTON_API void SubmitLimits(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - D_NEWTON_API void SubmitSpringDamper(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - D_NEWTON_API ndInt32 GetKinematicState(ndKinematicState* const state) const; - D_NEWTON_API void ApplyBaseRows(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); - - ndFloat32 m_posit; - ndFloat32 m_speed; - ndFloat32 m_springK; - ndFloat32 m_damperC; - ndFloat32 m_minLimit; - ndFloat32 m_maxLimit; - ndFloat32 m_positOffset; - ndFloat32 m_springDamperRegularizer; - ndInt8 m_limitState; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSpherical.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSpherical.cpp deleted file mode 100644 index f95789a596..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSpherical.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointSpherical.h" - -ndJointSpherical::ndJointSpherical() - :ndJointBilateralConstraint() - ,m_rotation(ndGetIdentityMatrix()) - ,m_springK(ndFloat32(0.0f)) - ,m_damperC(ndFloat32(0.0f)) - ,m_maxConeAngle(ndFloat32(1.0e10f)) - ,m_minTwistAngle(-ndFloat32(1.0e10f)) - ,m_maxTwistAngle(ndFloat32(1.0e10f)) - ,m_springDamperRegularizer(ndFloat32(0.0f)) -{ - m_maxDof = 9; -} - -ndJointSpherical::ndJointSpherical(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(9, child, parent, pinAndPivotFrame) - ,m_rotation(ndGetIdentityMatrix()) - ,m_springK(ndFloat32(0.0f)) - ,m_damperC(ndFloat32(0.0f)) - ,m_maxConeAngle(ndFloat32(1.0e10f)) - ,m_minTwistAngle(-ndFloat32(1.0e10f)) - ,m_maxTwistAngle(ndFloat32(1.0e10f)) - ,m_springDamperRegularizer(ndFloat32(0.0f)) -{ -} - -ndJointSpherical::~ndJointSpherical() -{ -} - -ndFloat32 ndJointSpherical::PenetrationOmega(ndFloat32 penetration) const -{ - ndFloat32 param = ndClamp(penetration, ndFloat32(0.0f), D_MAX_SPHERICAL_PENETRATION) / D_MAX_SPHERICAL_PENETRATION; - ndFloat32 omega = D_MAX_SPHERICAL_RECOVERY_SPEED * param; - return omega; -} - -ndMatrix ndJointSpherical::GetOffsetRotation() const -{ - return m_rotation; -} - -void ndJointSpherical::SetOffsetRotation(const ndMatrix& rotation) -{ - m_rotation = rotation; -} - -void ndJointSpherical::SetAsSpringDamper(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper) -{ - m_springK = ndAbs(spring); - m_damperC = ndAbs(damper); - m_springDamperRegularizer = ndClamp(regularizer, ndFloat32(1.0e-3f), ndFloat32(0.99f)); -} - -void ndJointSpherical::GetSpringDamper(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const -{ - spring = m_springK; - damper = m_damperC; - regularizer = m_springDamperRegularizer; -} - -void ndJointSpherical::SetTwistLimits(ndFloat32 minAngle, ndFloat32 maxAngle) -{ - m_minTwistAngle = ndMin(minAngle, ndFloat32 (0.0f)); - m_maxTwistAngle = ndMax(maxAngle, ndFloat32(0.0f)); -} - -void ndJointSpherical::GetTwistLimits(ndFloat32& minAngle, ndFloat32& maxAngle) const -{ - minAngle = m_minTwistAngle; - maxAngle = m_maxTwistAngle; -} - -ndFloat32 ndJointSpherical::GetConeLimit() const -{ - return m_maxConeAngle; -} - -void ndJointSpherical::SetConeLimit(ndFloat32 maxConeAngle) -{ - //m_maxConeAngle = ndClamp (maxConeAngle, ndFloat32 (0.0f), D_BALL_AND_SOCKED_MAX_ANGLE); - m_maxConeAngle = ndClamp(maxConeAngle, ndFloat32(0.0f), ndFloat32(1.0e10f)); -} - -void ndJointSpherical::DebugJoint(ndConstraintDebugCallback& debugCallback) const -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - debugCallback.DrawFrame(matrix0); - debugCallback.DrawFrame(matrix1); - - const ndInt32 subdiv = 8; - const ndVector& coneDir0 = matrix0.m_front; - const ndVector& coneDir1 = matrix1.m_front; - ndFloat32 cosAngleCos = coneDir0.DotProduct(coneDir1).GetScalar(); - ndMatrix coneRotation(ndGetIdentityMatrix()); - if (cosAngleCos < ndFloat32(0.9999f)) - { - ndVector lateralDir(coneDir1.CrossProduct(coneDir0)); - ndFloat32 mag2 = lateralDir.DotProduct(lateralDir).GetScalar(); - if (mag2 > ndFloat32 (1.0e-4f)) - { - lateralDir = lateralDir.Scale(ndFloat32 (1.0f) / ndSqrt(mag2)); - coneRotation = ndCalculateMatrix(ndQuaternion(lateralDir, ndAcos(ndClamp(cosAngleCos, ndFloat32(-1.0f), ndFloat32(1.0f)))), matrix1.m_posit); - } - else - { - lateralDir = matrix0.m_up.Scale(-ndFloat32 (1.0f)); - coneRotation = ndCalculateMatrix(ndQuaternion(matrix0.m_up, ndFloat32 (180.0f) * ndDegreeToRad), matrix1.m_posit); - } - } - else if (cosAngleCos < -ndFloat32 (0.9999f)) - { - coneRotation[0][0] = ndFloat32(-1.0f); - coneRotation[1][1] = ndFloat32(-1.0f); - } - - const ndFloat32 radius = debugCallback.m_debugScale; - ndVector arch[subdiv + 1]; - - // show twist angle limits - ndFloat32 deltaTwist = m_maxTwistAngle - m_minTwistAngle; - if ((deltaTwist > ndFloat32(1.0e-3f)) && (deltaTwist < ndFloat32 (2.0f) * ndPi)) - { - ndMatrix pitchMatrix(matrix1 * coneRotation); - pitchMatrix.m_posit = matrix1.m_posit; - - ndVector point(ndFloat32(0.0f), ndFloat32(radius), ndFloat32(0.0f), ndFloat32(0.0f)); - - ndFloat32 angleStep = ndMin(m_maxTwistAngle - m_minTwistAngle, ndFloat32(2.0f * ndPi)) / subdiv; - ndFloat32 angle0 = m_minTwistAngle; - - ndVector color(ndFloat32 (0.4f), ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - for (ndInt32 i = 0; i <= subdiv; ++i) - { - arch[i] = pitchMatrix.TransformVector(ndPitchMatrix(angle0).RotateVector(point)); - debugCallback.DrawLine(pitchMatrix.m_posit, arch[i], color); - angle0 += angleStep; - } - - for (ndInt32 i = 0; i < subdiv; ++i) - { - debugCallback.DrawLine(arch[i], arch[i + 1], color); - } - } - - // show cone angle limits - if ((m_maxConeAngle > ndFloat32 (0.0f)) && (m_maxConeAngle < D_MAX_SPHERICAL_CONE_ANGLE)) - { - ndVector color(ndFloat32(0.3f), ndFloat32(0.8f), ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector point(radius * ndCos(m_maxConeAngle), radius * ndSin(m_maxConeAngle), ndFloat32 (0.0f), ndFloat32(0.0f)); - ndFloat32 angleStep = ndPi * ndFloat32(2.0f) / subdiv; - - ndFloat32 angle0 = ndFloat32 (0.0f); - for (ndInt32 i = 0; i <= subdiv; ++i) - { - ndVector conePoint(ndPitchMatrix(angle0).RotateVector(point)); - ndVector p(matrix1.TransformVector(conePoint)); - arch[i] = p; - debugCallback.DrawLine(matrix1.m_posit, p, color); - angle0 += angleStep; - } - - for (ndInt32 i = 0; i < subdiv; ++i) - { - debugCallback.DrawLine(arch[i], arch[i + 1], color); - } - } -} - -void ndJointSpherical::SubmitTwistAngle(const ndVector& pin, ndFloat32 angle, ndConstraintDescritor& desc) -{ - if ((m_maxTwistAngle - m_minTwistAngle) < (2.0f * ndDegreeToRad)) - { - AddAngularRowJacobian(desc, pin, -angle); - SetLowerFriction(desc, -D_LCP_MAX_VALUE * ndFloat32(0.1f)); - SetHighFriction(desc, D_LCP_MAX_VALUE * ndFloat32(0.1f)); - } - else - { - if (angle < m_minTwistAngle) - { - AddAngularRowJacobian(desc, pin, ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_minTwistAngle; - const ndFloat32 recoveringAccel = -desc.m_invTimestep * PenetrationOmega(-penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAccel); - SetLowerFriction(desc, ndFloat32(0.0f)); - } - else if (angle >= m_maxTwistAngle) - { - AddAngularRowJacobian(desc, pin, ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = angle - m_maxTwistAngle; - const ndFloat32 recoveringAccel = desc.m_invTimestep * PenetrationOmega(penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAccel); - SetHighFriction(desc, ndFloat32(0.0f)); - } - } -} - -void ndJointSpherical::SubmitAngularAxisCartesianApproximation(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc) -{ - if (m_maxConeAngle < (ndFloat32 (1.0f) * ndDegreeToRad)) - { - // two rows to restrict rotation around around the parent coordinate system - ndFloat32 angle0 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up); - AddAngularRowJacobian(desc, matrix1.m_up, angle0); - SetLowerFriction(desc, -D_LCP_MAX_VALUE * ndFloat32(0.1f)); - SetHighFriction(desc, D_LCP_MAX_VALUE * ndFloat32(0.1f)); - - ndFloat32 angle1 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - AddAngularRowJacobian(desc, matrix1.m_right, angle1); - SetLowerFriction(desc, -D_LCP_MAX_VALUE * ndFloat32(0.1f)); - SetHighFriction(desc, D_LCP_MAX_VALUE * ndFloat32(0.1f)); - } - - ndFloat32 pitchAngle = -CalculateAngle(matrix0[1], matrix1[1], matrix1[0]); - SubmitTwistAngle(matrix0.m_front, pitchAngle, desc); -} - -void ndJointSpherical::SubmitAngularAxis(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc) -{ - if (m_maxConeAngle < D_MAX_SPHERICAL_CONE_ANGLE) - { - ndVector lateralDir(matrix1[0].CrossProduct(matrix0[0])); - ndAssert(lateralDir.DotProduct(lateralDir).GetScalar() > 1.0e-6f); - lateralDir = lateralDir.Normalize(); - const ndFloat32 coneAngle = ndAcos(ndClamp(matrix1.m_front.DotProduct(matrix0.m_front).GetScalar(), ndFloat32(-1.0f), ndFloat32(1.0f))); - const ndMatrix coneRotation(ndCalculateMatrix(ndQuaternion(lateralDir, coneAngle), matrix1.m_posit)); - if (coneAngle > m_maxConeAngle) - { - if (m_maxConeAngle > (ndFloat32(1.0f) * ndDegreeToRad)) - { - AddAngularRowJacobian(desc, lateralDir, ndFloat32(0.0f)); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - const ndFloat32 penetration = coneAngle - m_maxConeAngle; - const ndFloat32 recoveringAccel = desc.m_invTimestep * PenetrationOmega(penetration); - SetMotorAcceleration(desc, stopAccel - recoveringAccel); - SetHighFriction(desc, ndFloat32(0.0f)); - } - else - { - // two rows to restrict rotation around around the parent coordinate system - ndFloat32 angle0 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up); - AddAngularRowJacobian(desc, matrix1.m_up, angle0); - SetLowerFriction(desc, -D_LCP_MAX_VALUE * ndFloat32(0.1f)); - SetHighFriction(desc, D_LCP_MAX_VALUE * ndFloat32(0.1f)); - - ndFloat32 angle1 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - AddAngularRowJacobian(desc, matrix1.m_right, angle1); - SetLowerFriction(desc, -D_LCP_MAX_VALUE * ndFloat32(0.1f)); - SetHighFriction(desc, D_LCP_MAX_VALUE * ndFloat32(0.1f)); - } - } - - const ndMatrix pitchMatrix(matrix1 * coneRotation * matrix0.OrthoInverse()); - const ndFloat32 pitchAngle = -ndAtan2(pitchMatrix[1][2], pitchMatrix[1][1]); - SubmitTwistAngle(matrix0.m_front, pitchAngle, desc); - } -} - -void ndJointSpherical::ApplyBaseRows(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc) -{ - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1[0]); - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1[1]); - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1[2]); -} - -void ndJointSpherical::SubmitSpringDamper(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc) -{ - const ndMatrix matrix11(m_rotation * matrix1); - const ndQuaternion rotation(matrix0.OrthoInverse() * matrix11); - const ndVector pin(rotation & ndVector::m_triplexMask); - const ndFloat32 dirMag2 = pin.DotProduct(pin).GetScalar(); - const ndFloat32 tol = ndFloat32(3.0f * ndPi / 180.0f); - if (dirMag2 > (tol * tol)) - { - const ndMatrix basis(ndGramSchmidtMatrix(pin)); - const ndFloat32 dirMag = ndSqrt(dirMag2); - const ndFloat32 angle = ndFloat32(2.0f) * ndAtan2(dirMag, rotation.m_w); - - AddAngularRowJacobian(desc, basis[0], angle); - SetMassSpringDamperAcceleration(desc, m_springDamperRegularizer, m_springK, m_damperC); - AddAngularRowJacobian(desc, basis[1], ndFloat32(0.0f)); - AddAngularRowJacobian(desc, basis[2], ndFloat32(0.0f)); - } - else - { - const ndFloat32 pitchAngle = CalculateAngle(matrix0[1], matrix11[1], matrix11[0]); - AddAngularRowJacobian(desc, matrix11[0], pitchAngle); - SetMassSpringDamperAcceleration(desc, m_springDamperRegularizer, m_springK, m_damperC); - - const ndFloat32 yawAngle = CalculateAngle(matrix0[0], matrix11[0], matrix11[1]); - AddAngularRowJacobian(desc, matrix11[1], yawAngle); - SetMassSpringDamperAcceleration(desc, m_springDamperRegularizer, m_springK, m_damperC); - - const ndFloat32 rollAngle = CalculateAngle(matrix0[0], matrix11[0], matrix11[2]); - AddAngularRowJacobian(desc, matrix11[2], rollAngle); - SetMassSpringDamperAcceleration(desc, m_springDamperRegularizer, m_springK, m_damperC); - } -} - -void ndJointSpherical::SubmitLimits(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc) -{ - ndFloat32 cosAngleCos = matrix1.m_front.DotProduct(matrix0.m_front).GetScalar(); - if (cosAngleCos >= ndFloat32(0.998f)) - { - // special case where the front axis are almost aligned - // solve by using Cartesian approximation - SubmitAngularAxisCartesianApproximation(matrix0, matrix1, desc); - } - else - { - SubmitAngularAxis(matrix0, matrix1, desc); - } -} - -void ndJointSpherical::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - ApplyBaseRows(matrix0, matrix1, desc); - if (m_springDamperRegularizer && ((m_springK > ndFloat32(0.0f)) || (m_damperC > ndFloat32(0.0f)))) - { - SubmitSpringDamper(matrix0, matrix1, desc); - } - SubmitLimits(matrix0, matrix1, desc); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSpherical.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSpherical.h deleted file mode 100644 index bd78245511..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointSpherical.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_SPHERICAL_H__ -#define __ND_JOINT_SPHERICAL_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -#define D_MAX_SPHERICAL_RECOVERY_SPEED ndFloat32 (0.25f) -#define D_MAX_SPHERICAL_PENETRATION (ndFloat32 (4.0f) * ndDegreeToRad) -#define D_MAX_SPHERICAL_CONE_ANGLE (ndFloat32 (150.0f) * ndDegreeToRad) - -class ndJointSpherical: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointSpherical, ndJointBilateralConstraint) - D_NEWTON_API ndJointSpherical(); - D_NEWTON_API ndJointSpherical(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndJointSpherical(); - - D_NEWTON_API ndFloat32 GetConeLimit() const; - D_NEWTON_API ndMatrix GetOffsetRotation() const; - D_NEWTON_API void SetConeLimit(ndFloat32 maxConeAngle); - D_NEWTON_API void SetOffsetRotation(const ndMatrix& rotation); - D_NEWTON_API void SetTwistLimits(ndFloat32 minAngle, ndFloat32 maxAngle); - D_NEWTON_API void GetTwistLimits(ndFloat32& minAngle, ndFloat32& maxAngle) const; - D_NEWTON_API void SetAsSpringDamper(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); - D_NEWTON_API void GetSpringDamper(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const; - D_NEWTON_API void DebugJoint(ndConstraintDebugCallback& debugCallback) const; - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - D_NEWTON_API ndFloat32 PenetrationOmega(ndFloat32 penetartion) const; - D_NEWTON_API void ApplyBaseRows(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc); - D_NEWTON_API void SubmitSpringDamper(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc); - D_NEWTON_API void SubmitAngularAxis(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc); - D_NEWTON_API void SubmitTwistAngle(const ndVector& pin, ndFloat32 angle, ndConstraintDescritor& desc); - D_NEWTON_API void SubmitLimits(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc); - D_NEWTON_API void SubmitAngularAxisCartesianApproximation(const ndMatrix& matrix0, const ndMatrix& matrix1, ndConstraintDescritor& desc); - - ndMatrix m_rotation; - ndFloat32 m_springK; - ndFloat32 m_damperC; - ndFloat32 m_maxConeAngle; - ndFloat32 m_minTwistAngle; - ndFloat32 m_maxTwistAngle; - ndFloat32 m_springDamperRegularizer; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointUpVector.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointUpVector.cpp deleted file mode 100644 index ff72920e6c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointUpVector.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointUpVector.h" - -ndJointUpVector::ndJointUpVector() - :ndJointBilateralConstraint() -{ - m_maxDof = 2; -} - -ndJointUpVector::ndJointUpVector(const ndVector& normal, ndBodyKinematic* const child, ndBodyKinematic* const parent) - :ndJointBilateralConstraint(2, child, parent, ndGetIdentityMatrix()) -{ - ndMatrix matrix(ndGramSchmidtMatrix(normal)); - matrix.m_posit = child->GetMatrix().m_posit; - - CalculateLocalMatrix (matrix, m_localMatrix0, m_localMatrix1); -} - -ndJointUpVector::~ndJointUpVector() -{ -} - -// by animating the orientation of the pin vector the application can change the orientation of the picked object -void ndJointUpVector::SetPinDir (const ndVector& pin) -{ - m_localMatrix1 = ndGramSchmidtMatrix(pin); -} - -void ndJointUpVector::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - - // calculate the position of the pivot point and the Jacobian direction vectors, in global space. - CalculateGlobalMatrix (matrix0, matrix1); - - // if the body has rotated by some amount, the there will be a plane of rotation - ndVector lateralDir (matrix0.m_front.CrossProduct(matrix1.m_front)); - ndAssert(lateralDir.m_w == ndFloat32(0.0f)); - ndFloat32 mag = lateralDir.DotProduct(lateralDir).GetScalar(); - if (mag > 1.0e-6f) - { - // if the side vector is not zero, it means the body has rotated - mag = ndSqrt (mag); - lateralDir = lateralDir.Scale (1.0f / mag); - ndFloat32 angle = ndAsin (mag); - - // add an angular constraint to correct the error angle - //NewtonUserJointAddAngularRow (m_joint, angle, &lateralDir[0]); - AddAngularRowJacobian(desc, lateralDir, angle); - - // in theory only one correction is needed, but this produces instability as the body may move sideway. - // a lateral correction prevent this from happening. - ndVector frontDir (lateralDir.CrossProduct(matrix1.m_front)); - //NewtonUserJointAddAngularRow (m_joint, 0.0f, &frontDir[0]); - AddAngularRowJacobian(desc, frontDir, ndFloat32 (0.0f)); - } - else - { - // if the angle error is very small then two angular correction along the plane axis do the trick - //NewtonUserJointAddAngularRow (m_joint, 0.0f, &matrix0.m_up[0]); - AddAngularRowJacobian(desc, matrix0.m_up, ndFloat32(0.0f)); - //NewtonUserJointAddAngularRow (m_joint, 0.0f, &matrix0.m_right[0]); - AddAngularRowJacobian(desc, matrix0.m_right, ndFloat32(0.0f)); - } -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointUpVector.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointUpVector.h deleted file mode 100644 index aa52d357be..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointUpVector.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_UPVECTOR_H__ -#define __ND_JOINT_UPVECTOR_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -// This joint is useful to for implementing simple character controllers -class ndJointUpVector: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointUpVector, ndJointBilateralConstraint) - - D_NEWTON_API ndJointUpVector(); - D_NEWTON_API ndJointUpVector(const ndVector& normal, ndBodyKinematic* const child, ndBodyKinematic* const parent); - D_NEWTON_API virtual ~ndJointUpVector(); - - D_NEWTON_API void SetPinDir (const ndVector& pin); - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointWheel.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointWheel.cpp deleted file mode 100644 index c2b9cc5886..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointWheel.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndJointWheel.h" - -ndJointWheel::ndJointWheel() - :ndJointBilateralConstraint() - ,m_baseFrame(m_localMatrix1) - ,m_info() - ,m_posit(ndFloat32(0.0f)) - ,m_speed(ndFloat32(0.0f)) - ,m_regularizer(m_info.m_regularizer) - ,m_normalizedBrake(ndFloat32(0.0f)) - ,m_normalidedSteering(ndFloat32(0.0f)) - ,m_normalizedHandBrake(ndFloat32(0.0f)) - ,m_vcdMode(false) -{ - m_maxDof = 7; -} - -ndJointWheel::ndJointWheel(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent, const ndWheelDescriptor& info) - :ndJointBilateralConstraint(7, child, parent, pinAndPivotFrame) - //,ndJointBilateralConstraint::ndIkInterface() - ,m_baseFrame(m_localMatrix1) - ,m_info(info) - ,m_posit(ndFloat32 (0.0f)) - ,m_speed(ndFloat32(0.0f)) - ,m_regularizer(info.m_regularizer) - ,m_normalizedBrake(ndFloat32(0.0f)) - ,m_normalidedSteering(ndFloat32(0.0f)) - ,m_normalizedHandBrake(ndFloat32(0.0f)) - ,m_vcdMode(false) -{ -} - -ndJointWheel::~ndJointWheel() -{ -} - -const ndWheelDescriptor& ndJointWheel::GetInfo() const -{ - return m_info; -} - -void ndJointWheel::SetInfo(const ndWheelDescriptor& info) -{ - m_info = info; -} - -void ndJointWheel::SetBrake(ndFloat32 normalizedBrake) -{ - m_normalizedBrake = ndClamp (normalizedBrake, ndFloat32 (0.0f), ndFloat32 (1.0f)); -} - -void ndJointWheel::SetHandBrake(ndFloat32 normalizedBrake) -{ - m_normalizedHandBrake = ndClamp(normalizedBrake, ndFloat32(0.0f), ndFloat32(1.0f)); -} - -void ndJointWheel::SetSteering(ndFloat32 normalidedSteering) -{ - m_normalidedSteering = ndClamp(normalidedSteering, ndFloat32(-1.0f), ndFloat32(1.0f)); -} - -void ndJointWheel::UpdateTireSteeringAngleMatrix() -{ - ndMatrix tireMatrix; - ndMatrix chassisMatrix; - m_localMatrix1 = ndYawMatrix(m_normalidedSteering * m_info.m_steeringAngle) * m_baseFrame; - - CalculateGlobalMatrix(tireMatrix, chassisMatrix); - const ndVector localRelPosit(chassisMatrix.UntransformVector(tireMatrix.m_posit)); - const ndFloat32 distance = ndClamp(localRelPosit.m_y, m_info.m_upperStop, m_info.m_lowerStop); - - const ndFloat32 spinAngle = -CalculateAngle(tireMatrix.m_up, chassisMatrix.m_up, chassisMatrix.m_front); - ndMatrix newTireMatrix(ndPitchMatrix(spinAngle) * chassisMatrix); - newTireMatrix.m_posit = chassisMatrix.m_posit + chassisMatrix.m_up.Scale(distance); - - const ndMatrix tireBodyMatrix(m_localMatrix0.OrthoInverse() * newTireMatrix); - m_body0->SetMatrix(tireBodyMatrix); -} - -ndMatrix ndJointWheel::CalculateBaseFrame() const -{ - return m_localMatrix1 * m_body1->GetMatrix(); -} - -ndMatrix ndJointWheel::CalculateUpperBumperMatrix() const -{ - ndMatrix matrix(m_localMatrix1 * m_body1->GetMatrix()); - matrix.m_posit += matrix.m_up.Scale(m_info.m_lowerStop); - return matrix; -} - -void ndJointWheel::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - - // calculate the position of the pivot point and the Jacobian direction vectors, in global space. - CalculateGlobalMatrix(matrix0, matrix1); - - // calculate position and speed - const ndVector veloc0(m_body0->GetVelocityAtPoint(matrix0.m_posit)); - const ndVector veloc1(m_body1->GetVelocityAtPoint(matrix1.m_posit)); - - const ndVector& pin = matrix1[0]; - const ndVector& p0 = matrix0.m_posit; - const ndVector& p1 = matrix1.m_posit; - const ndVector prel(p0 - p1); - const ndVector vrel(veloc0 - veloc1); - - m_speed = vrel.DotProduct(matrix1.m_up).GetScalar(); - m_posit = prel.DotProduct(matrix1.m_up).GetScalar(); - const ndVector projectedPoint = p1 + pin.Scale(pin.DotProduct(prel).GetScalar()); - - const ndFloat32 angle0 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up); - const ndFloat32 angle1 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - - AddLinearRowJacobian(desc, p0, projectedPoint, matrix1[0]); - AddLinearRowJacobian(desc, p0, projectedPoint, matrix1[2]); - AddAngularRowJacobian(desc, matrix1.m_up, angle0); - AddAngularRowJacobian(desc, matrix1.m_right, angle1); - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1.m_up); - SetMassSpringDamperAcceleration(desc, m_regularizer, m_info.m_springK, m_info.m_damperC); - - const ndFloat32 brakeFrictionTorque = ndMax(m_normalizedBrake * m_info.m_brakeTorque, m_normalizedHandBrake * m_info.m_handBrakeTorque); - if (brakeFrictionTorque > ndFloat32(0.0f)) - { - const ndFloat32 brakesToChassisInfluence = ndFloat32 (0.125f); - - AddAngularRowJacobian(desc, matrix1.m_front, ndFloat32(0.0f)); - const ndVector tireOmega(m_body0->GetOmega()); - const ndVector chassisOmega(m_body1->GetOmega()); - - ndJacobian& jacobian0 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM0; - ndJacobian& jacobian1 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM1; - jacobian1.m_angular = jacobian1.m_angular.Scale(brakesToChassisInfluence); - - ndFloat32 w0 = tireOmega.DotProduct(jacobian0.m_angular).GetScalar(); - ndFloat32 w1 = chassisOmega.DotProduct(jacobian1.m_angular).GetScalar(); - ndFloat32 wRel = (w0 + w1) * ndFloat32 (0.35f); - //ndTrace(("(%d: %f)\n", m_body0->GetId(), wRel)); - SetMotorAcceleration(desc, -wRel * desc.m_invTimestep); - SetHighFriction(desc, brakeFrictionTorque); - SetLowerFriction(desc, -brakeFrictionTorque); - } - else if (m_vcdMode) - { - ndAssert(0); - } - - // add suspension limits alone the vertical axis - const ndFloat32 x = m_posit + m_speed * desc.m_timestep; - if (x < m_info.m_upperStop) - { - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1.m_up); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - SetMotorAcceleration(desc, stopAccel); - SetLowerFriction(desc, ndFloat32(0.0f)); - } - else if (x > m_info.m_lowerStop) - { - AddLinearRowJacobian(desc, matrix0.m_posit, matrix1.m_posit, matrix1.m_up); - const ndFloat32 stopAccel = GetMotorZeroAcceleration(desc); - SetMotorAcceleration(desc, stopAccel); - SetHighFriction(desc, ndFloat32(0.0f)); - } -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointWheel.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointWheel.h deleted file mode 100644 index e8f6e29e22..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dJoints/ndJointWheel.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_JOINT_WHEEL_H__ -#define __ND_JOINT_WHEEL_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndWheelDescriptor -{ - public: - ndWheelDescriptor() - :m_radios(ndFloat32(0.5f)) - ,m_springK(ndFloat32(1.0f)) - ,m_damperC(ndFloat32(0.0f)) - ,m_upperStop(ndFloat32(-0.1f)) - ,m_lowerStop(ndFloat32(0.2f)) - ,m_regularizer(ndFloat32(0.1f)) - ,m_brakeTorque(ndFloat32(0.0f)) - ,m_handBrakeTorque(ndFloat32(0.0f)) - ,m_steeringAngle(ndFloat32(0.0f)) - { - } - - ndFloat32 m_radios; - ndFloat32 m_springK; - ndFloat32 m_damperC; - ndFloat32 m_upperStop; - ndFloat32 m_lowerStop; - ndFloat32 m_regularizer; - ndFloat32 m_brakeTorque; - ndFloat32 m_handBrakeTorque; - ndFloat32 m_steeringAngle; -}; - -//class ndJointWheel: public ndJointBilateralConstraint, public ndJointBilateralConstraint::ndIkInterface -class ndJointWheel : public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndJointWheel, ndJointBilateralConstraint) - - D_NEWTON_API ndJointWheel(); - D_NEWTON_API ndJointWheel(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent, const ndWheelDescriptor& desc); - D_NEWTON_API virtual ~ndJointWheel(); - - D_NEWTON_API void SetBrake(ndFloat32 normalizedTorque); - D_NEWTON_API void SetHandBrake(ndFloat32 normalizedTorque); - D_NEWTON_API void SetSteering(ndFloat32 normalidedSteering); - - D_NEWTON_API void UpdateTireSteeringAngleMatrix(); - - D_NEWTON_API ndMatrix CalculateBaseFrame() const; - D_NEWTON_API ndMatrix CalculateUpperBumperMatrix() const; - - D_NEWTON_API const ndWheelDescriptor& GetInfo() const; - D_NEWTON_API void SetInfo(const ndWheelDescriptor& info); - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - - ndMatrix m_baseFrame; - ndWheelDescriptor m_info; - ndFloat32 m_posit; - ndFloat32 m_speed; - ndFloat32 m_regularizer; - ndFloat32 m_normalizedBrake; - ndFloat32 m_normalidedSteering; - ndFloat32 m_normalizedHandBrake; - bool m_vcdMode; - friend class ndMultiBodyVehicle; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicle.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicle.cpp deleted file mode 100644 index 9d37d948e5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicle.cpp +++ /dev/null @@ -1,1040 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndBodyDynamic.h" -#include "ndBodyKinematic.h" -#include "ndMultiBodyVehicle.h" -#include "dJoints/ndJointHinge.h" -#include "ndMultiBodyVehicleMotor.h" -#include "ndMultiBodyVehicleGearBox.h" -#include "ndMultiBodyVehicleTireJoint.h" -#include "ndMultiBodyVehicleTorsionBar.h" -#include "ndMultiBodyVehicleDifferential.h" -#include "ndMultiBodyVehicleDifferentialAxle.h" - -#define D_MAX_CONTACT_SPEED_TRESHOLD ndFloat32 (0.25f) -#define D_MAX_CONTACT_PENETRATION ndFloat32 (1.0e-2f) -#define D_MIN_CONTACT_CLOSE_DISTANCE2 ndFloat32 (5.0e-2f * 5.0e-2f) - -ndMultiBodyVehicle::ndMultiBodyVehicle(const ndVector& frontDir, const ndVector& upDir) - :ndModel() - ,m_localFrame(ndGetIdentityMatrix()) - ,m_chassis(nullptr) - ,m_invDynamicsSolver() - ,m_tireShape(new ndShapeChamferCylinder(ndFloat32(0.75f), ndFloat32(0.5f))) - //,m_internalBodies() - //,m_motor() - //,m_gearBox() - //,m_torsionBar() - //,m_tireList() - //,m_axleList() - //,m_differentialList() - ,m_downForce() -{ - ndAssert(0); - m_tireShape->AddRef(); - m_localFrame.m_front = frontDir & ndVector::m_triplexMask; - m_localFrame.m_up = upDir & ndVector::m_triplexMask; - m_localFrame.m_right = m_localFrame.m_front.CrossProduct(m_localFrame.m_up).Normalize(); - m_localFrame.m_up = m_localFrame.m_right.CrossProduct(m_localFrame.m_front).Normalize(); -} - -ndMultiBodyVehicle::~ndMultiBodyVehicle() -{ - m_tireShape->Release(); -} - -ndFloat32 ndMultiBodyVehicle::ndDownForce::CalculateFactor(const ndSpeedForcePair* const entry0) const -{ - const ndSpeedForcePair* const entry1 = entry0 + 1; - ndFloat32 num = ndMax(entry1->m_forceFactor - entry0->m_forceFactor, ndFloat32(0.0f)); - ndFloat32 den = ndMax(ndAbs(entry1->m_speed - entry0->m_speed), ndFloat32(1.0f)); - return num / (den * den); -} - -ndFloat32 ndMultiBodyVehicle::ndDownForce::GetDownforceFactor(ndFloat32 speed) const -{ - ndAssert(speed >= ndFloat32(0.0f)); - ndInt32 index = 0; - for (ndInt32 i = sizeof(m_downForceTable) / sizeof(m_downForceTable[0]) - 1; i; i--) - { - if (m_downForceTable[i].m_speed <= speed) - { - index = i; - break; - } - } - - ndFloat32 deltaSpeed = speed - m_downForceTable[index].m_speed; - ndFloat32 downForceFactor = m_downForceTable[index].m_forceFactor + m_downForceTable[index + 1].m_aerodynamicDownforceConstant * deltaSpeed * deltaSpeed; - return downForceFactor * m_gravity; -} - -ndMultiBodyVehicle* ndMultiBodyVehicle::GetAsMultiBodyVehicle() -{ - return this; -} - -ndFloat32 ndMultiBodyVehicle::GetSpeed() const -{ - //const ndBodyKinematic* const chassis = *m_chassis; - const ndVector dir(m_chassis->GetMatrix().RotateVector(m_localFrame.m_front)); - const ndFloat32 speed = ndAbs(m_chassis->GetVelocity().DotProduct(dir).GetScalar()); - return speed; -} - -void ndMultiBodyVehicle::AddChassis(ndBodyKinematic* const chassis) -{ - m_chassis = chassis; -} - -//ndMultiBodyVehicleTireJoint* ndMultiBodyVehicle::AddAxleTire(const ndMultiBodyVehicleTireJointInfo& desc, ndBodyKinematic* const tire, ndBodyKinematic* const axleBody) -ndMultiBodyVehicleTireJoint* ndMultiBodyVehicle::AddAxleTire(const ndMultiBodyVehicleTireJointInfo&, ndBodyKinematic* const, ndBodyKinematic* const) -{ - ndAssert(0); - return nullptr; - //ndMatrix tireFrame(ndGetIdentityMatrix()); - //tireFrame.m_front = ndVector(0.0f, 0.0f, 1.0f, 0.0f); - //tireFrame.m_up = ndVector(0.0f, 1.0f, 0.0f, 0.0f); - //tireFrame.m_right = ndVector(-1.0f, 0.0f, 0.0f, 0.0f); - //ndMatrix matrix(tireFrame * m_localFrame * axleBody->GetMatrix()); - //matrix.m_posit = tire->GetMatrix().m_posit; - // - //// make tire inertia spherical - //ndVector inertia(tire->GetMassMatrix()); - //ndFloat32 maxInertia(ndMax(ndMax(inertia.m_x, inertia.m_y), inertia.m_z)); - //inertia.m_x = maxInertia; - //inertia.m_y = maxInertia; - //inertia.m_z = maxInertia; - //tire->SetMassMatrix(inertia); - // - //ndSharedPtr tireJoint (new ndMultiBodyVehicleTireJoint(matrix, tire, axleBody, desc, this)); - ////ndSharedPtr& xxxx = (ndSharedPtr&)tireJointPtr; - //m_tireList.Append(tireJoint); - // - //tire->SetDebugMaxLinearAndAngularIntegrationStep(ndFloat32(2.0f * 360.0f) * ndDegreeToRad, ndFloat32(10.0f)); - //return *tireJoint; -} - -ndMultiBodyVehicleTireJoint* ndMultiBodyVehicle::AddTire(const ndMultiBodyVehicleTireJointInfo& desc, ndBodyKinematic* const tire) -{ - ndAssert(m_chassis); - return AddAxleTire(desc, tire, m_chassis); -} - -ndBodyKinematic* ndMultiBodyVehicle::CreateInternalBodyPart(ndFloat32 mass, ndFloat32 radius) const -{ - ndShapeInstance diffCollision(new ndShapeSphere(radius)); - diffCollision.SetCollisionMode(false); - - ndBodyDynamic* const body = new ndBodyDynamic(); - ndAssert(m_chassis); - body->SetMatrix(m_localFrame * m_chassis->GetMatrix()); - body->SetCollisionShape(diffCollision); - body->SetMassMatrix(mass, diffCollision); - //body->SetDebugMaxAngularIntegrationSteepAndLinearSpeed(ndFloat32(2.0f * 360.0f) * ndDegreeToRad, ndFloat32(100.0f)); - body->SetDebugMaxLinearAndAngularIntegrationStep(ndFloat32(2.0f * 360.0f) * ndDegreeToRad, ndFloat32(10.0f)); - return body; -} - -//ndMultiBodyVehicleDifferential* ndMultiBodyVehicle::AddDifferential(ndFloat32 mass, ndFloat32 radius, ndMultiBodyVehicleTireJoint* const leftTire, ndMultiBodyVehicleTireJoint* const rightTire, ndFloat32 slipOmegaLock) -ndMultiBodyVehicleDifferential* ndMultiBodyVehicle::AddDifferential(ndFloat32, ndFloat32, ndMultiBodyVehicleTireJoint* const, ndMultiBodyVehicleTireJoint* const, ndFloat32) -{ - ndAssert(0); - return nullptr; - - //ndAssert(m_chassis); - //ndSharedPtr differentialBody (CreateInternalBodyPart(mass, radius)); - //m_internalBodies.Append(differentialBody); - // - //ndSharedPtr differential(new ndMultiBodyVehicleDifferential(differentialBody->GetAsBodyKinematic(), m_chassis, slipOmegaLock)); - //m_differentialList.Append(differential); - // - //ndVector pin0(differentialBody->GetMatrix().RotateVector(differential->GetLocalMatrix0().m_front)); - //ndVector upPin(differentialBody->GetMatrix().RotateVector(differential->GetLocalMatrix0().m_up)); - //ndVector leftPin1(leftTire->GetBody0()->GetMatrix().RotateVector(leftTire->GetLocalMatrix0().m_front)); - // - //ndSharedPtr leftAxle (new ndMultiBodyVehicleDifferentialAxle(pin0, upPin, differentialBody->GetAsBodyKinematic(), leftPin1, leftTire->GetBody0())); - //m_axleList.Append(leftAxle); - // - //ndSharedPtr rightAxle (new ndMultiBodyVehicleDifferentialAxle(pin0, upPin.Scale(ndFloat32(-1.0f)), differentialBody->GetAsBodyKinematic(), leftPin1, rightTire->GetBody0())); - //m_axleList.Append(rightAxle); - // - //return *differential; -} - -//ndMultiBodyVehicleDifferential* ndMultiBodyVehicle::AddDifferential(ndFloat32 mass, ndFloat32 radius, ndMultiBodyVehicleDifferential* const leftDifferential, ndMultiBodyVehicleDifferential* const rightDifferential, ndFloat32 slipOmegaLock) -ndMultiBodyVehicleDifferential* ndMultiBodyVehicle::AddDifferential(ndFloat32, ndFloat32, ndMultiBodyVehicleDifferential* const, ndMultiBodyVehicleDifferential* const, ndFloat32) -{ - ndAssert(0); - return nullptr; - - //ndAssert(m_chassis); - //ndSharedPtr differentialBody(CreateInternalBodyPart(mass, radius)); - //m_internalBodies.Append(differentialBody); - // - //ndSharedPtr differential(new ndMultiBodyVehicleDifferential(differentialBody->GetAsBodyKinematic(), m_chassis, slipOmegaLock)); - //m_differentialList.Append(differential); - // - //ndVector pin0(differentialBody->GetMatrix().RotateVector(differential->GetLocalMatrix0().m_front)); - //ndVector upPin(differentialBody->GetMatrix().RotateVector(differential->GetLocalMatrix0().m_up)); - //ndVector leftPin1(leftDifferential->GetBody0()->GetMatrix().RotateVector(leftDifferential->GetLocalMatrix0().m_front)); - //leftPin1 = leftPin1.Scale(ndFloat32(-1.0f)); - // - //ndSharedPtr leftAxle (new ndMultiBodyVehicleDifferentialAxle(pin0, upPin, differentialBody->GetAsBodyKinematic(), leftPin1, leftDifferential->GetBody0())); - //m_axleList.Append(leftAxle); - // - //ndSharedPtr rightAxle (new ndMultiBodyVehicleDifferentialAxle(pin0, upPin.Scale(ndFloat32(-1.0f)), differentialBody->GetAsBodyKinematic(), leftPin1, rightDifferential->GetBody0())); - //m_axleList.Append(rightAxle); - // - //return *differential; -} - -//ndMultiBodyVehicleMotor* ndMultiBodyVehicle::AddMotor(ndFloat32 mass, ndFloat32 radius) -ndMultiBodyVehicleMotor* ndMultiBodyVehicle::AddMotor(ndFloat32, ndFloat32) -{ - ndAssert(0); - return nullptr; - - //ndAssert(m_chassis); - //ndSharedPtr motorBody (CreateInternalBodyPart(mass, radius)); - //m_internalBodies.Append(motorBody); - //m_motor = ndSharedPtr(new ndMultiBodyVehicleMotor(motorBody->GetAsBodyKinematic(), this)); - //return *m_motor; -} - -//ndMultiBodyVehicleGearBox* ndMultiBodyVehicle::AddGearBox(ndMultiBodyVehicleDifferential* const differential) -ndMultiBodyVehicleGearBox* ndMultiBodyVehicle::AddGearBox(ndMultiBodyVehicleDifferential* const) -{ - ndAssert(0); - return nullptr; - - //ndAssert(*m_motor); - //m_gearBox = ndSharedPtr(new ndMultiBodyVehicleGearBox(m_motor->GetBody0(), differential->GetBody0(), this)); - //return *m_gearBox; -} - -//ndMultiBodyVehicleTorsionBar* ndMultiBodyVehicle::AddTorsionBar(ndBodyKinematic* const sentinel) -ndMultiBodyVehicleTorsionBar* ndMultiBodyVehicle::AddTorsionBar(ndBodyKinematic* const) -{ - ndAssert(0); - return nullptr; - - //m_torsionBar = ndSharedPtr(new ndMultiBodyVehicleTorsionBar(this, sentinel)); - //return *m_torsionBar; -} - -ndShapeInstance ndMultiBodyVehicle::CreateTireShape(ndFloat32 radius, ndFloat32 width) const -{ - ndShapeInstance tireCollision(m_tireShape); - ndVector scale(2.0f * width, radius, radius, 0.0f); - tireCollision.SetScale(scale); - return tireCollision; -} - -void ndMultiBodyVehicle::ApplyAerodynamics() -{ - ndAssert(0); - - //m_downForce.m_suspensionStiffnessModifier = ndFloat32(1.0f); - //ndFloat32 gravity = m_downForce.GetDownforceFactor(GetSpeed()); - //if (ndAbs (gravity) > ndFloat32(1.0e-2f)) - //{ - // const ndVector up(m_chassis->GetMatrix().RotateVector(m_localFrame.m_up)); - // const ndVector weight(m_chassis->GetForce()); - // const ndVector downForce(up.Scale(gravity * m_chassis->GetMassMatrix().m_w)); - // m_chassis->SetForce(weight + downForce); - // m_downForce.m_suspensionStiffnessModifier = up.DotProduct(weight).GetScalar() / up.DotProduct(weight + downForce.Scale (0.5f)).GetScalar(); - // //dTrace(("%f\n", m_suspensionStiffnessModifier)); - // - // for (ndReferencedObjects::ndNode* node = m_tireList.GetFirst(); node; node = node->GetNext()) - // { - // ndMultiBodyVehicleTireJoint* const tire = *node->GetInfo(); - // ndBodyKinematic* const tireBody = tire->GetBody0(); - // const ndVector tireWeight(tireBody->GetForce()); - // const ndVector tireDownForce(up.Scale(gravity * tireBody->GetMassMatrix().m_w)); - // tireBody->SetForce(tireWeight + tireDownForce); - // } - //} -} - -//void ndMultiBodyVehicle::SetVehicleSolverModel(bool hardJoint) -void ndMultiBodyVehicle::SetVehicleSolverModel(bool) -{ - ndAssert(0); - - //ndJointBilateralSolverModel openLoopMode = hardJoint ? m_jointkinematicOpenLoop : m_jointIterativeSoft; - // - //ndAssert(m_chassis); - //const ndBodyKinematic::ndJointList& chassisJoints = m_chassis->GetJointList(); - //for (ndBodyKinematic::ndJointList::ndNode* node = chassisJoints.GetFirst(); node; node = node->GetNext()) - //{ - // ndJointBilateralConstraint* const joint = node->GetInfo(); - // const char* const className = joint->ClassName(); - // if (!strcmp(className, "ndMultiBodyVehicleTireJoint") || - // !strcmp(className, "ndMultiBodyVehicleDifferential") || - // !strcmp(className, "ndMultiBodyVehicleMotor")) - // { - // joint->SetSolverModel(openLoopMode); - // } - //} - // - //ndJointBilateralSolverModel driveTrainMode = hardJoint ? m_jointkinematicCloseLoop : m_jointIterativeSoft; - //for (ndReferencedObjects::ndNode* node = m_differentialList.GetFirst(); node; node = node->GetNext()) - //{ - // ndJointBilateralConstraint* const joint = *node->GetInfo(); - // const ndBodyKinematic::ndJointList& jointList = joint->GetBody0()->GetJointList(); - // for (ndBodyKinematic::ndJointList::ndNode* node1 = jointList.GetFirst(); node1; node1 = node1->GetNext()) - // { - // ndJointBilateralConstraint* const axle = node1->GetInfo(); - // const char* const clasName = axle->ClassName(); - // if (strcmp(clasName, "ndMultiBodyVehicleDifferential")) - // { - // axle->SetSolverModel(driveTrainMode); - // } - // } - //} - // - //if (*m_torsionBar) - //{ - // m_torsionBar->SetSolverModel(driveTrainMode); - //} -} - -void ndMultiBodyVehicle::ApplyAligmentAndBalancing() -{ - ndAssert(0); - //for (ndReferencedObjects::ndNode* node = m_tireList.GetFirst(); node; node = node->GetNext()) - //{ - // ndMultiBodyVehicleTireJoint* const tire = *node->GetInfo(); - // ndBodyKinematic* const tireBody = tire->GetBody0()->GetAsBodyDynamic(); - // ndBodyKinematic* const chassisBody = tire->GetBody1()->GetAsBodyDynamic(); - // - // bool savedSleepState = tireBody->GetSleepState(); - // tire->UpdateTireSteeringAngleMatrix(); - // - // ndMatrix tireMatrix; - // ndMatrix chassisMatrix; - // tire->CalculateGlobalMatrix(tireMatrix, chassisMatrix); - // - // // align tire velocity - // const ndVector chassisVelocity(chassisBody->GetVelocityAtPoint(tireMatrix.m_posit)); - // const ndVector relVeloc(tireBody->GetVelocity() - chassisVelocity); - // ndVector localVeloc(chassisMatrix.UnrotateVector(relVeloc)); - // bool applyProjection = (localVeloc.m_x * localVeloc.m_x + localVeloc.m_z * localVeloc.m_z) > (ndFloat32(0.05f) * ndFloat32(0.05f)); - // localVeloc.m_x *= ndFloat32(0.3f); - // localVeloc.m_z *= ndFloat32(0.3f); - // const ndVector tireVelocity(chassisVelocity + chassisMatrix.RotateVector(localVeloc)); - // - // // align tire angular velocity - // const ndVector chassisOmega(chassisBody->GetOmega()); - // const ndVector relOmega(tireBody->GetOmega() - chassisOmega); - // ndVector localOmega(chassisMatrix.UnrotateVector(relOmega)); - // applyProjection = applyProjection || (localOmega.m_y * localOmega.m_y + localOmega.m_z * localOmega.m_z) > (ndFloat32(0.05f) * ndFloat32(0.05f)); - // localOmega.m_y *= ndFloat32(0.3f); - // localOmega.m_z *= ndFloat32(0.3f); - // const ndVector tireOmega(chassisOmega + chassisMatrix.RotateVector(localOmega)); - // - // if (applyProjection) - // { - // tireBody->SetOmega(tireOmega); - // tireBody->SetVelocity(tireVelocity); - // } - // tireBody->RestoreSleepState(savedSleepState); - //} - // - //for (ndReferencedObjects::ndNode* node = m_differentialList.GetFirst(); node; node = node->GetNext()) - //{ - // ndMultiBodyVehicleDifferential* const diff = *node->GetInfo(); - // diff->AlignMatrix(); - //} - // - //if (*m_motor) - //{ - // m_motor->AlignMatrix(); - //} -} - -//void ndMultiBodyVehicle::Debug(ndConstraintDebugCallback& context) const -void ndMultiBodyVehicle::Debug(ndConstraintDebugCallback&) const -{ - ndAssert(0); - //// draw vehicle cordinade system; - //const ndBodyKinematic* const chassis = m_chassis; - //ndAssert(chassis); - //ndMatrix chassisMatrix(chassis->GetMatrix()); - //chassisMatrix.m_posit = chassisMatrix.TransformVector(chassis->GetCentreOfMass()); - ////context.DrawFrame(chassisMatrix); - // - //ndFloat32 totalMass = chassis->GetMassMatrix().m_w; - //ndVector effectiveCom(chassisMatrix.m_posit.Scale(totalMass)); - // - //// draw front direction for side slip angle reference - // - //// draw velocity vector - //ndVector veloc(chassis->GetVelocity()); - //ndVector p0(chassisMatrix.m_posit + m_localFrame.m_up.Scale(1.0f)); - //ndVector p1(p0 + chassisMatrix.RotateVector(m_localFrame.m_front).Scale(2.0f)); - //ndVector p2(p0 + veloc.Scale (0.25f)); - // - //context.DrawLine(p0, p2, ndVector(1.0f, 1.0f, 0.0f, 0.0f)); - //context.DrawLine(p0, p1, ndVector(1.0f, 0.0f, 0.0f, 0.0f)); - // - //// draw body acceleration - ////ndVector accel(m_chassis->GetAccel()); - ////ndVector p3(p0 + accel.Scale(0.5f)); - ////context.DrawLine(p0, p3, ndVector(0.0f, 1.0f, 1.0f, 0.0f)); - // - //ndFloat32 scale = ndFloat32 (3.0f); - //ndVector weight(chassis->GetForce().Scale (scale * chassis->GetInvMass() / m_downForce.m_gravity)); - // - //// draw vehicle weight; - //ndVector forceColor(ndFloat32 (0.8f), ndFloat32(0.8f), ndFloat32(0.8f), ndFloat32(0.0f)); - //ndVector lateralColor(ndFloat32(0.3f), ndFloat32(0.7f), ndFloat32(0.0f), ndFloat32(0.0f)); - //ndVector longitudinalColor(ndFloat32(0.7f), ndFloat32(0.3f), ndFloat32(0.0f), ndFloat32(0.0f)); - //context.DrawLine(chassisMatrix.m_posit, chassisMatrix.m_posit + weight, forceColor); - // - //for (ndReferencedObjects::ndNode* node = m_tireList.GetFirst(); node; node = node->GetNext()) - //{ - // ndMultiBodyVehicleTireJoint* const tireJoint = *node->GetInfo(); - // ndBodyKinematic* const tireBody = tireJoint->GetBody0()->GetAsBodyDynamic(); - // ndMatrix tireFrame(tireBody->GetMatrix()); - // totalMass += tireBody->GetMassMatrix().m_w; - // effectiveCom += tireFrame.m_posit.Scale(tireBody->GetMassMatrix().m_w); - //} - // - //for (ndReferencedObjects::ndNode* node = m_tireList.GetFirst(); node; node = node->GetNext()) - //{ - // ndMultiBodyVehicleTireJoint* const tireJoint = *node->GetInfo(); - // ndBodyKinematic* const tireBody = tireJoint->GetBody0()->GetAsBodyDynamic(); - // - // // draw upper bumper - // ndMatrix upperBumberMatrix(tireJoint->CalculateUpperBumperMatrix()); - // //context.DrawFrame(tireJoint->CalculateUpperBumperMatrix()); - // - // ndMatrix tireBaseFrame(tireJoint->CalculateBaseFrame()); - // //context.DrawFrame(tireBaseFrame); - // - // // show tire center of mass; - // ndMatrix tireFrame(tireBody->GetMatrix()); - // //context.DrawFrame(tireFrame); - // upperBumberMatrix.m_posit = tireFrame.m_posit; - // //context.DrawFrame(upperBumberMatrix); - // - // // draw tire forces - // const ndBodyKinematic::ndContactMap& contactMap = tireBody->GetContactMap(); - // ndFloat32 tireGravities = scale /(totalMass * m_downForce.m_gravity); - // ndBodyKinematic::ndContactMap::Iterator it(contactMap); - // for (it.Begin(); it; it++) - // { - // ndContact* const contact = *it; - // if (contact->IsActive()) - // { - // const ndContactPointList& contactPoints = contact->GetContactPoints(); - // for (ndContactPointList::ndNode* contactNode = contactPoints.GetFirst(); contactNode; contactNode = contactNode->GetNext()) - // { - // const ndContactMaterial& contactPoint = contactNode->GetInfo(); - // ndMatrix frame(contactPoint.m_normal, contactPoint.m_dir0, contactPoint.m_dir1, contactPoint.m_point); - // - // ndVector localPosit(m_localFrame.UntransformVector(chassisMatrix.UntransformVector(contactPoint.m_point))); - // ndFloat32 offset = (localPosit.m_z > ndFloat32(0.0f)) ? ndFloat32(0.2f) : ndFloat32(-0.2f); - // frame.m_posit += contactPoint.m_dir0.Scale(offset); - // frame.m_posit += contactPoint.m_normal.Scale(0.1f); - // - // // normal force - // ndFloat32 normalForce = -tireGravities * contactPoint.m_normal_Force.m_force; - // context.DrawLine(frame.m_posit, frame.m_posit + contactPoint.m_normal.Scale (normalForce), forceColor); - // - // // lateral force - // ndFloat32 lateralForce = -tireGravities * contactPoint.m_dir0_Force.m_force; - // context.DrawLine(frame.m_posit, frame.m_posit + contactPoint.m_dir0.Scale(lateralForce), lateralColor); - // - // // longitudinal force - // ndFloat32 longitudinalForce = tireGravities * contactPoint.m_dir1_Force.m_force; - // context.DrawLine(frame.m_posit, frame.m_posit + contactPoint.m_dir1.Scale(longitudinalForce), longitudinalColor); - // } - // } - // } - //} - // - //effectiveCom = effectiveCom.Scale(ndFloat32(1.0f) / totalMass); - //chassisMatrix.m_posit = effectiveCom; - //chassisMatrix.m_posit.m_w = ndFloat32(1.0f); - //context.DrawFrame(chassisMatrix); -} - -ndMultiBodyVehicle::ndDownForce::ndDownForce() - :m_gravity(ndFloat32(-10.0f)) - ,m_suspensionStiffnessModifier(ndFloat32(1.0f)) -{ - m_downForceTable[0].m_speed = ndFloat32(0.0f) * ndFloat32(0.27f); - m_downForceTable[0].m_forceFactor = 0.0f; - m_downForceTable[0].m_aerodynamicDownforceConstant = ndFloat32(0.0f); - - m_downForceTable[1].m_speed = ndFloat32(30.0f) * ndFloat32(0.27f); - m_downForceTable[1].m_forceFactor = 1.0f; - m_downForceTable[1].m_aerodynamicDownforceConstant = CalculateFactor(&m_downForceTable[0]); - - m_downForceTable[2].m_speed = ndFloat32(60.0f) * ndFloat32(0.27f); - m_downForceTable[2].m_forceFactor = 1.6f; - m_downForceTable[2].m_aerodynamicDownforceConstant = CalculateFactor(&m_downForceTable[1]); - - m_downForceTable[3].m_speed = ndFloat32(140.0f) * ndFloat32(0.27f); - m_downForceTable[3].m_forceFactor = 3.0f; - m_downForceTable[3].m_aerodynamicDownforceConstant = CalculateFactor(&m_downForceTable[2]); - - m_downForceTable[4].m_speed = ndFloat32(1000.0f) * ndFloat32(0.27f); - m_downForceTable[4].m_forceFactor = 3.0f; - m_downForceTable[4].m_aerodynamicDownforceConstant = CalculateFactor(&m_downForceTable[3]); -} - -//void ndMultiBodyVehicle::CoulombTireModel(ndMultiBodyVehicleTireJoint* const tire, ndContactMaterial& contactPoint) const -void ndMultiBodyVehicle::CoulombTireModel(ndMultiBodyVehicleTireJoint* const, ndContactMaterial& contactPoint, ndFloat32) const -{ - const ndFloat32 frictionCoefficient = contactPoint.m_material.m_staticFriction0; - const ndFloat32 normalForce = contactPoint.m_normal_Force.GetInitialGuess() + ndFloat32(1.0f); - const ndFloat32 maxForceForce = frictionCoefficient * normalForce; - - contactPoint.m_material.m_staticFriction0 = maxForceForce; - contactPoint.m_material.m_dynamicFriction0 = maxForceForce; - contactPoint.m_material.m_staticFriction1 = maxForceForce; - contactPoint.m_material.m_dynamicFriction1 = maxForceForce; - contactPoint.m_material.m_flags = contactPoint.m_material.m_flags | m_override0Friction | m_override1Friction; -} - -//void ndMultiBodyVehicle::CalculateNormalizedAlgningTorque(ndMultiBodyVehicleTireJoint* const tire, ndFloat32 sideSlipTangent) const -void ndMultiBodyVehicle::CalculateNormalizedAlgningTorque(ndMultiBodyVehicleTireJoint* const, ndFloat32 sideSlipTangent) const -{ - //I need to calculate the integration of the align torque - //using the calculate contact patch, form the standard brush model. - //for now just set the torque to zero. - ndFloat32 angle = ndAtan(sideSlipTangent); - ndFloat32 a = ndFloat32(0.1f); - - ndFloat32 slipCos(ndCos(angle)); - ndFloat32 slipSin(ndSin(angle)); - ndFloat32 y1 = ndFloat32(2.0f) * slipSin * slipCos; - ndFloat32 x1 = -a + ndFloat32(2.0f) * slipCos * slipCos; - - ndVector p1(x1, y1, ndFloat32(0.0f), ndFloat32(0.0f)); - ndVector p0(-a, ndFloat32(0.0f), ndFloat32(0.0f), ndFloat32(0.0f)); - - static int xxxx; - xxxx++; - if (xxxx % 1000 == 0) - { - ndTrace(("aligning torque\n")); - } - //ndFloat32 alignTorque = ndFloat32(0.0f); - //ndFloat32 sign = ndSign(alignTorque); - //tire->m_normalizedAligningTorque = sign * ndMax(ndAbs(alignTorque), ndAbs(tire->m_normalizedAligningTorque)); -} - -void ndMultiBodyVehicle::BrushTireModel(ndMultiBodyVehicleTireJoint* const tire, ndContactMaterial& contactPoint, ndFloat32 timestep) const -{ - // calculate longitudinal slip ratio - const ndBodyKinematic* const chassis = m_chassis; - ndAssert(chassis); - const ndBodyKinematic* const tireBody = tire->GetBody0()->GetAsBodyDynamic(); - const ndBodyKinematic* const otherBody = (contactPoint.m_body0 == tireBody) ? ((ndBodyKinematic*)contactPoint.m_body1)->GetAsBodyDynamic() : ((ndBodyKinematic*)contactPoint.m_body0)->GetAsBodyDynamic(); - ndAssert(tireBody != otherBody); - ndAssert((tireBody == contactPoint.m_body0) || (tireBody == contactPoint.m_body1)); - - //tire non linear brush model is only considered - //when is moving faster than 0.5 m/s (approximately 1.0 miles / hours) - //this is just an arbitrary limit, based of the model - //not been defined for stationary tires. - const ndVector contactVeloc0(tireBody->GetVelocity()); - const ndVector contactVeloc1(otherBody->GetVelocityAtPoint(contactPoint.m_point)); - const ndVector relVeloc(contactVeloc0 - contactVeloc1); - const ndVector lateralDir = contactPoint.m_dir1; - const ndVector longitudDir = contactPoint.m_dir0; - const ndFloat32 relSpeed = ndAbs(relVeloc.DotProduct(longitudDir).GetScalar()); - if (relSpeed > D_MAX_CONTACT_SPEED_TRESHOLD) - { - // tire is in breaking and traction mode. - const ndVector contactVeloc(tireBody->GetVelocityAtPoint(contactPoint.m_point) - contactVeloc1); - - //const ndVector tireVeloc(tireBody->GetVelocity()); - const ndFloat32 vr = contactVeloc.DotProduct(longitudDir).GetScalar(); - const ndFloat32 longitudialSlip = ndAbs(vr) / relSpeed; - - //const ndFloat32 sideSpeed = ndAbs(relVeloc.DotProduct(lateralDir).GetScalar()); - const ndFloat32 sideSpeed = relVeloc.DotProduct(lateralDir).GetScalar(); - const ndFloat32 signedLateralSlip = sideSpeed / (relSpeed + ndFloat32 (1.0f)); - CalculateNormalizedAlgningTorque(tire, signedLateralSlip); - - const ndFloat32 lateralSlip = ndAbs(signedLateralSlip); - - ndAssert(longitudialSlip >= ndFloat32(0.0f)); - - CalculateNormalizedAlgningTorque(tire, lateralSlip); - - tire->m_lateralSlip = ndMax(tire->m_lateralSlip, lateralSlip); - tire->m_longitudinalSlip = ndMax(tire->m_longitudinalSlip, longitudialSlip); - - const ndFloat32 den = ndFloat32(1.0f) / (longitudialSlip + ndFloat32(1.0f)); - const ndFloat32 v = lateralSlip * den; - const ndFloat32 u = longitudialSlip * den; - - const ndTireFrictionModel& info = tire->m_frictionModel; - const ndFloat32 vehicleMass = chassis->GetMassMatrix().m_w; - const ndFloat32 cz = vehicleMass * info.m_laterialStiffness * v; - const ndFloat32 cx = vehicleMass * info.m_longitudinalStiffness * u; - - const ndFloat32 gamma = ndMax(ndSqrt(cx * cx + cz * cz), ndFloat32(1.0e-8f)); - const ndFloat32 frictionCoefficient = contactPoint.m_material.m_staticFriction0; - const ndFloat32 normalForce = contactPoint.m_normal_Force.GetInitialGuess() + ndFloat32(1.0f); - - const ndFloat32 maxForceForce = frictionCoefficient * normalForce; - ndFloat32 f = maxForceForce; - if (gamma < (ndFloat32(3.0f) * maxForceForce)) - { - const ndFloat32 b = ndFloat32(1.0f) / (ndFloat32(3.0f) * maxForceForce); - const ndFloat32 c = ndFloat32(1.0f) / (ndFloat32(27.0f) * maxForceForce * maxForceForce); - f = gamma * (ndFloat32(1.0f) - b * gamma + c * gamma * gamma); - } - - const ndFloat32 lateralForce = f * cz / gamma; - const ndFloat32 longitudinalForce = f * cx / gamma; - //ndTrace(("(%d: %f %f) ", tireBody->GetId(), longitudinalForce, lateralForce)); - - contactPoint.OverrideFriction0Accel(-vr / timestep); - contactPoint.m_material.m_staticFriction0 = longitudinalForce; - contactPoint.m_material.m_dynamicFriction0 = longitudinalForce; - contactPoint.m_material.m_staticFriction1 = lateralForce; - contactPoint.m_material.m_dynamicFriction1 = lateralForce; - contactPoint.m_material.m_flags = contactPoint.m_material.m_flags | m_override0Friction | m_override1Friction; - } - else - { - CoulombTireModel(tire, contactPoint, timestep); - } -} - -void ndMultiBodyVehicle::PacejkaTireModel(ndMultiBodyVehicleTireJoint* const tire, ndContactMaterial& contactPoint, ndFloat32 timestep) const -{ - BrushTireModel(tire, contactPoint, timestep); -} - -void ndMultiBodyVehicle::CoulombFrictionCircleTireModel(ndMultiBodyVehicleTireJoint* const tire, ndContactMaterial& contactPoint, ndFloat32 timestep) const -{ - BrushTireModel(tire, contactPoint, timestep); -} - -//void ndMultiBodyVehicle::ApplyVehicleDynamicControl(ndFloat32 timestep, ndTireContactPair* const tireContacts, ndInt32 contactCount) -void ndMultiBodyVehicle::ApplyVehicleDynamicControl(ndFloat32, ndTireContactPair* const, ndInt32) -{ - //contactCount = 0; - //for (ndInt32 i = contactCount - 1; i >= 0; --i) - //{ - // ndContact* const contact = tireContacts[i].m_contact; - // ndMultiBodyVehicleTireJoint* const tire = tireContacts[i].m_tireJoint; - // ndContactPointList& contactPoints = contact->GetContactPoints(); - // ndMatrix tireBasisMatrix(tire->GetLocalMatrix1() * tire->GetBody1()->GetMatrix()); - // tireBasisMatrix.m_posit = tire->GetBody0()->GetMatrix().m_posit; - // for (ndContactPointList::ndNode* contactNode = contactPoints.GetFirst(); contactNode; contactNode = contactNode->GetNext()) - // { - // ndContactMaterial& contactPoint = contactNode->GetInfo(); - // ndFloat32 contactPathLocation = ndAbs(contactPoint.m_normal.DotProduct(tireBasisMatrix.m_front).GetScalar()); - // // contact are consider on the contact patch strip only if the are less than - // // 45 degree angle from the tire axle - // if (contactPathLocation < ndFloat32(0.71f)) - // { - // // align tire friction direction - // const ndVector longitudinalDir(contactPoint.m_normal.CrossProduct(tireBasisMatrix.m_front).Normalize()); - // const ndVector lateralDir(longitudinalDir.CrossProduct(contactPoint.m_normal)); - // - // contactPoint.m_dir1 = lateralDir; - // contactPoint.m_dir0 = longitudinalDir; - // - // // check if the contact is in the contact patch, - // // the is the 45 degree point around the tire vehicle axis. - // ndVector dir(contactPoint.m_point - tireBasisMatrix.m_posit); - // ndAssert(dir.DotProduct(dir).GetScalar() > ndFloat32(0.0f)); - // ndFloat32 contactPatch = tireBasisMatrix.m_up.DotProduct(dir.Normalize()).GetScalar(); - // if (contactPatch < ndFloat32(-0.71f)) - // { - // switch (tire->m_frictionModel.m_frictionModel) - // { - // case ndTireFrictionModel::m_brushModel: - // { - // BrushTireModel(tire, contactPoint, timestep); - // break; - // } - // - // case ndTireFrictionModel::m_pacejka: - // { - // PacejkaTireModel(tire, contactPoint, timestep); - // break; - // } - // - // case ndTireFrictionModel::m_coulombCicleOfFriction: - // { - // CoulombFrictionCircleTireModel(tire, contactPoint, timestep); - // break; - // } - // - // case ndTireFrictionModel::m_coulomb: - // default: - // { - // CoulombTireModel(tire, contactPoint, timestep); - // break; - // } - // } - // } - // } - // } - //} -} - -#if 0 -void ndMultiBodyVehicle::ApplyTireModel(ndFloat32 timestep, ndTireContactPair* const tireContacts, ndInt32 tireCount) -{ - for (ndInt32 i = tireCount - 1; i >= 0; --i) - { - ndContact* const contact = tireContacts[i].m_contact; - ndMultiBodyVehicleTireJoint* const tire = tireContacts[i].m_tireJoint; - ndContactPointList& contactPoints = contact->GetContactPoints(); - ndMatrix tireBasisMatrix(tire->GetLocalMatrix1() * tire->GetBody1()->GetMatrix()); - tireBasisMatrix.m_posit = tire->GetBody0()->GetMatrix().m_posit; - for (ndContactPointList::ndNode* contactNode = contactPoints.GetFirst(); contactNode; contactNode = contactNode->GetNext()) - { - ndContactMaterial& contactPoint = contactNode->GetInfo(); - ndFloat32 contactPathLocation = ndAbs(contactPoint.m_normal.DotProduct(tireBasisMatrix.m_front).GetScalar()); - // contact are consider on the contact patch strip only if the are less than - // 45 degree angle from the tire axle - if (contactPathLocation < ndFloat32(0.71f)) - { - // align tire friction direction - const ndVector longitudinalDir(contactPoint.m_normal.CrossProduct(tireBasisMatrix.m_front).Normalize()); - const ndVector lateralDir(longitudinalDir.CrossProduct(contactPoint.m_normal)); - - contactPoint.m_dir1 = lateralDir; - contactPoint.m_dir0 = longitudinalDir; - - // check if the contact is in the contact patch, - // the is the 45 degree point around the tire vehicle axis. - ndVector dir(contactPoint.m_point - tireBasisMatrix.m_posit); - ndAssert(dir.DotProduct(dir).GetScalar() > ndFloat32(0.0f)); - ndFloat32 contactPatch = tireBasisMatrix.m_up.DotProduct(dir.Normalize()).GetScalar(); - if (contactPatch < ndFloat32(-0.71f)) - { - switch (tire->m_frictionModel.m_frictionModel) - { - case ndTireFrictionModel::m_brushModel: - { - BrushTireModel(tire, contactPoint, timestep); - break; - } - - case ndTireFrictionModel::m_pacejka: - { - PacejkaTireModel(tire, contactPoint, timestep); - break; - } - - case ndTireFrictionModel::m_coulombCicleOfFriction: - { - CoulombFrictionCircleTireModel(tire, contactPoint, timestep); - break; - } - - case ndTireFrictionModel::m_coulomb: - default: - { - CoulombTireModel(tire, contactPoint, timestep); - break; - } - } - } - } - } - } -} - -#else -void ndMultiBodyVehicle::ApplyTireModel(ndFloat32 timestep, ndTireContactPair* const tireContacts, ndInt32 contactCount) -{ - ndInt32 oldCount = contactCount; - for (ndInt32 i = contactCount - 1; i >= 0; --i) - { - ndContact* const contact = tireContacts[i].m_contact; - ndMultiBodyVehicleTireJoint* const tire = tireContacts[i].m_tireJoint; - ndContactPointList& contactPoints = contact->GetContactPoints(); - ndMatrix tireBasisMatrix(tire->GetLocalMatrix1() * tire->GetBody1()->GetMatrix()); - tireBasisMatrix.m_posit = tire->GetBody0()->GetMatrix().m_posit; - const ndMaterial* const material = contact->GetMaterial(); - bool useCoulombModel = (material->m_flags & m_useBrushTireModel) ? false : true; - for (ndContactPointList::ndNode* contactNode = contactPoints.GetFirst(); contactNode; contactNode = contactNode->GetNext()) - { - ndContactMaterial& contactPoint = contactNode->GetInfo(); - ndFloat32 contactPathLocation = ndAbs(contactPoint.m_normal.DotProduct(tireBasisMatrix.m_front).GetScalar()); - // contact are consider on the contact patch strip only if the are less than - // 45 degree angle from the tire axle - if (contactPathLocation < ndFloat32(0.71f)) - { - // align tire friction direction - const ndVector longitudinalDir(contactPoint.m_normal.CrossProduct(tireBasisMatrix.m_front).Normalize()); - const ndVector lateralDir(longitudinalDir.CrossProduct(contactPoint.m_normal)); - - contactPoint.m_dir1 = lateralDir; - contactPoint.m_dir0 = longitudinalDir; - - // check if the contact is in the contact patch, - // the is the 45 degree point around the tire vehicle axis. - ndVector dir(contactPoint.m_point - tireBasisMatrix.m_posit); - ndAssert(dir.DotProduct(dir).GetScalar() > ndFloat32(0.0f)); - ndFloat32 contactPatch = tireBasisMatrix.m_up.DotProduct(dir.Normalize()).GetScalar(); - if (useCoulombModel || (contactPatch > ndFloat32(-0.71f))) - { - contactCount--; - tireContacts[i] = tireContacts[contactCount]; - } - } - } - } - - if (contactCount == oldCount) - { - for (ndInt32 i = contactCount - 1; i >= 0; --i) - { - ndContact* const contact = tireContacts[i].m_contact; - ndMultiBodyVehicleTireJoint* const tire = tireContacts[i].m_tireJoint; - ndContactPointList& contactPoints = contact->GetContactPoints(); - for (ndContactPointList::ndNode* contactNode = contactPoints.GetFirst(); contactNode; contactNode = contactNode->GetNext()) - { - ndContactMaterial& contactPoint = contactNode->GetInfo(); - switch (tire->m_frictionModel.m_frictionModel) - { - case ndTireFrictionModel::m_brushModel: - { - BrushTireModel(tire, contactPoint, timestep); - break; - } - - case ndTireFrictionModel::m_pacejka: - { - PacejkaTireModel(tire, contactPoint, timestep); - break; - } - - case ndTireFrictionModel::m_coulombCicleOfFriction: - { - CoulombFrictionCircleTireModel(tire, contactPoint, timestep); - break; - } - - case ndTireFrictionModel::m_coulomb: - default: - { - CoulombTireModel(tire, contactPoint, timestep); - break; - } - } - } - } - } -} -#endif - -//void ndMultiBodyVehicle::ApplyTireModel(ndFloat32 timestep) -void ndMultiBodyVehicle::ApplyTireModel(ndFloat32) -{ - ndAssert(0); - //ndFixSizeArray tireContacts; - //for (ndReferencedObjects::ndNode* node = m_tireList.GetFirst(); node; node = node->GetNext()) - //{ - // ndMultiBodyVehicleTireJoint* const tire = *node->GetInfo(); - // ndAssert(((ndShape*)tire->GetBody0()->GetCollisionShape().GetShape())->GetAsShapeChamferCylinder()); - // - // tire->m_lateralSlip = ndFloat32(0.0f); - // tire->m_longitudinalSlip = ndFloat32(0.0f); - // tire->m_normalizedAligningTorque = ndFloat32(0.0f); - // - // const ndBodyKinematic::ndContactMap& contactMap = tire->GetBody0()->GetContactMap(); - // ndBodyKinematic::ndContactMap::Iterator it(contactMap); - // for (it.Begin(); it; it++) - // { - // ndContact* const contact = *it; - // if (contact->IsActive()) - // { - // ndContactPointList& contactPoints = contact->GetContactPoints(); - // // for mesh collision we need to remove contact duplicates, - // // these are contact produced by two or more polygons, - // // that can produce two contact so are close that they can generate - // // ill formed rows in the solver mass matrix - // for (ndContactPointList::ndNode* contactNode0 = contactPoints.GetFirst(); contactNode0; contactNode0 = contactNode0->GetNext()) - // { - // const ndContactPoint& contactPoint0 = contactNode0->GetInfo(); - // for (ndContactPointList::ndNode* contactNode1 = contactNode0->GetNext(); contactNode1; contactNode1 = contactNode1->GetNext()) - // { - // const ndContactPoint& contactPoint1 = contactNode1->GetInfo(); - // const ndVector error(contactPoint1.m_point - contactPoint0.m_point); - // ndFloat32 err2 = error.DotProduct(error).GetScalar(); - // if (err2 < D_MIN_CONTACT_CLOSE_DISTANCE2) - // { - // contactPoints.Remove(contactNode1); - // break; - // } - // } - // } - // ndTireContactPair pair; - // pair.m_contact = contact; - // pair.m_tireJoint = tire; - // tireContacts.PushBack(pair); - // } - // } - //} - // - ////ApplyVehicleDynamicControl(timestep, &tireContacts[0], tireContacts.GetCount()); - //ApplyTireModel(timestep, &tireContacts[0], tireContacts.GetCount()); -} - -//void ndMultiBodyVehicle::RemoveFromToWorld() -//{ -// if (m_world) -// { -// if (*m_motor) -// { -// m_world->RemoveJoint(*m_motor); -// } -// if (*m_gearBox) -// { -// m_world->RemoveJoint(*m_gearBox); -// } -// if (*m_torsionBar) -// { -// m_world->RemoveJoint(*m_torsionBar); -// } -// -// for (ndReferencedObjects::ndNode* node = m_internalBodies.GetFirst(); node; node = node->GetNext()) -// { -// ndSharedPtr& ptr = node->GetInfo(); -// m_world->RemoveBody(*ptr); -// } -// -// for (ndReferencedObjects::ndNode* node = m_tireList.GetFirst(); node; node = node->GetNext()) -// { -// ndJointBilateralConstraint* const joint = *node->GetInfo(); -// m_world->RemoveJoint(joint); -// } -// -// for (ndReferencedObjects::ndNode* node = m_axleList.GetFirst(); node; node = node->GetNext()) -// { -// ndJointBilateralConstraint* const joint = *node->GetInfo(); -// m_world->RemoveJoint(joint); -// } -// -// for (ndReferencedObjects::ndNode* node = m_differentialList.GetFirst(); node; node = node->GetNext()) -// { -// ndJointBilateralConstraint* const joint = *node->GetInfo(); -// m_world->RemoveJoint(joint); -// } -// } -// -// ndModel::RemoveFromToWorld(); -//} -// -//void ndMultiBodyVehicle::AddToWorld(ndWorld* const world) -//{ -// ndAssert(0); -// ndModel::AddToWorld(world); -// -// if (*m_motor) -// { -// ndSharedPtr& motor = (ndSharedPtr&)m_motor; -// world->AddJoint(motor); -// } -// if (*m_gearBox) -// { -// ndSharedPtr& gearBox = (ndSharedPtr&)m_gearBox; -// world->AddJoint(gearBox); -// } -// if (*m_torsionBar) -// { -// ndSharedPtr& torsionBar = (ndSharedPtr&)m_torsionBar; -// world->AddJoint(torsionBar); -// } -// -// for (ndReferencedObjects::ndNode* node = m_internalBodies.GetFirst(); node; node = node->GetNext()) -// { -// ndSharedPtr& ptr = node->GetInfo(); -// world->AddBody(ptr); -// } -// -// for (ndReferencedObjects::ndNode* node = m_tireList.GetFirst(); node; node = node->GetNext()) -// { -// ndSharedPtr& joint = (ndSharedPtr&)node->GetInfo(); -// world->AddJoint(joint); -// } -// -// for (ndReferencedObjects::ndNode* node = m_axleList.GetFirst(); node; node = node->GetNext()) -// { -// ndSharedPtr& joint = (ndSharedPtr&)node->GetInfo(); -// world->AddJoint(joint); -// } -// -// for (ndReferencedObjects::ndNode* node = m_differentialList.GetFirst(); node; node = node->GetNext()) -// { -// ndSharedPtr& joint = (ndSharedPtr&)node->GetInfo(); -// world->AddJoint(joint); -// } -//} - -bool ndMultiBodyVehicle::isActive() const -{ - ndAssert(0); - return false; - //bool active = m_chassis->GetScene() ? true : false; - //for (ndReferencedObjects::ndNode* node = m_tireList.GetFirst(); active && node; node = node->GetNext()) - //{ - // ndBodyKinematic* const body = node->GetInfo()->GetBody0(); - // active = active && (body->GetScene() ? true : false); - //} - // - //return active; -} - -void ndMultiBodyVehicle::PostUpdate(ndWorld* const, ndFloat32) -{ - if (isActive()) - { - ApplyAligmentAndBalancing(); - } -} - -void ndMultiBodyVehicle::Update(ndWorld* const world, ndFloat32 timestep) -{ - if (isActive()) - { - ApplyInputs(world, timestep); - - // apply down force - ApplyAerodynamics(); - // apply tire model - ApplyTireModel(timestep); - } -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicle.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicle.h deleted file mode 100644 index 36eea96cca..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicle.h +++ /dev/null @@ -1,145 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MULTIBODY_VEHICLE_H__ -#define __ND_MULTIBODY_VEHICLE_H__ - -#include "ndNewtonStdafx.h" -#include "dModels/ndModel.h" -#include "dIkSolver/ndIkSolver.h" - -class ndWorld; -class ndMultiBodyVehicleMotor; -class ndMultiBodyVehicleGearBox; -class ndMultiBodyVehicleTireJoint; -class ndMultiBodyVehicleTorsionBar; -class ndMultiBodyVehicleDifferential; -class ndMultiBodyVehicleTireJointInfo; -class ndMultiBodyVehicleDifferentialAxle; - -#define dRadPerSecToRpm ndFloat32(9.55f) - -class ndMultiBodyVehicle: public ndModel -{ - public: - class ndTireContactPair - { - public: - ndContact* m_contact; - ndMultiBodyVehicleTireJoint* m_tireJoint; - }; - - class ndDownForce - { - public: - class ndSpeedForcePair - { - public: - ndFloat32 m_speed; - ndFloat32 m_forceFactor; - ndFloat32 m_aerodynamicDownforceConstant; - friend class ndDownForce; - }; - - ndDownForce(); - ndFloat32 GetDownforceFactor(ndFloat32 speed) const; - - private: - ndFloat32 CalculateFactor(const ndSpeedForcePair* const entry) const; - - ndFloat32 m_gravity; - ndFloat32 m_suspensionStiffnessModifier; - ndSpeedForcePair m_downForceTable[5]; - friend class ndMultiBodyVehicle; - friend class ndMultiBodyVehicleTireJoint; - }; - - D_CLASS_REFLECTION(ndMultiBodyVehicle, ndModel) - D_NEWTON_API ndMultiBodyVehicle(const ndVector& frontDir, const ndVector& upDir); - D_NEWTON_API virtual ~ndMultiBodyVehicle (); - - virtual void OnAddToWorld() { ndAssert(0); } - virtual void OnRemoveFromToWorld() { ndAssert(0); } - - D_NEWTON_API ndFloat32 GetSpeed() const; - D_NEWTON_API ndShapeInstance CreateTireShape(ndFloat32 radius, ndFloat32 width) const; - - D_NEWTON_API void AddChassis(ndBodyKinematic* const chassis); - D_NEWTON_API ndMultiBodyVehicleMotor* AddMotor(ndFloat32 mass, ndFloat32 radius); - D_NEWTON_API ndMultiBodyVehicleGearBox* AddGearBox(ndMultiBodyVehicleDifferential* const differential); - D_NEWTON_API ndMultiBodyVehicleTireJoint* AddTire(const ndMultiBodyVehicleTireJointInfo& desc, ndBodyKinematic* const tire); - D_NEWTON_API ndMultiBodyVehicleTireJoint* AddAxleTire(const ndMultiBodyVehicleTireJointInfo& desc, ndBodyKinematic* const tire, ndBodyKinematic* const axleBody); - D_NEWTON_API ndMultiBodyVehicleDifferential* AddDifferential(ndFloat32 mass, ndFloat32 radius, ndMultiBodyVehicleTireJoint* const leftTire, ndMultiBodyVehicleTireJoint* const rightTire, ndFloat32 slipOmegaLock); - D_NEWTON_API ndMultiBodyVehicleDifferential* AddDifferential(ndFloat32 mass, ndFloat32 radius, ndMultiBodyVehicleDifferential* const leftDifferential, ndMultiBodyVehicleDifferential* const rightDifferential, ndFloat32 slipOmegaLock); - D_NEWTON_API ndMultiBodyVehicleTorsionBar* AddTorsionBar(ndBodyKinematic* const sentinel); - - D_NEWTON_API void SetVehicleSolverModel(bool hardJoint); - - D_NEWTON_API ndMultiBodyVehicle* GetAsMultiBodyVehicle(); - - private: - void ApplyAerodynamics(); - void ApplyAligmentAndBalancing(); - void ApplyTireModel(ndFloat32 timestep); - ndBodyKinematic* CreateInternalBodyPart(ndFloat32 mass, ndFloat32 radius) const; - void ApplyTireModel(ndFloat32 timestep, ndTireContactPair* const tires, ndInt32 tireCount); - void ApplyVehicleDynamicControl(ndFloat32 timestep, ndTireContactPair* const tires, ndInt32 tireCount); - - void CalculateNormalizedAlgningTorque(ndMultiBodyVehicleTireJoint* const tire, ndFloat32 sideSlipTangent) const; - void CoulombTireModel(ndMultiBodyVehicleTireJoint* const tire, ndContactMaterial& contactPoint, ndFloat32 timestep) const; - void BrushTireModel(ndMultiBodyVehicleTireJoint* const tire, ndContactMaterial& contactPoint, ndFloat32 timestep) const; - void PacejkaTireModel(ndMultiBodyVehicleTireJoint* const tire, ndContactMaterial& contactPoint, ndFloat32 timestep) const; - void CoulombFrictionCircleTireModel(ndMultiBodyVehicleTireJoint* const tire, ndContactMaterial& contactPoint, ndFloat32 timestep) const; - - protected: - bool isActive() const; - virtual void ApplyInputs(ndWorld* const world, ndFloat32 timestep); - //D_NEWTON_API virtual void RemoveFromToWorld(); - //D_NEWTON_API virtual void AddToWorld(ndWorld* const world); - - D_NEWTON_API virtual void Debug(ndConstraintDebugCallback& context) const; - D_NEWTON_API virtual void Update(ndWorld* const world, ndFloat32 timestep); - D_NEWTON_API virtual void PostUpdate(ndWorld* const world, ndFloat32 timestep); - - ndMatrix m_localFrame; - ndBodyKinematic* m_chassis; - ndIkSolver m_invDynamicsSolver; - ndShapeChamferCylinder* m_tireShape; - //ndReferencedObjects m_internalBodies; - //ndSharedPtr m_motor; - //ndSharedPtr m_gearBox; - //ndSharedPtr m_torsionBar; - //ndReferencedObjects m_tireList; - //ndReferencedObjects m_axleList; - //ndReferencedObjects m_differentialList; - ndDownForce m_downForce; - - friend class ndMultiBodyVehicleMotor; - friend class ndMultiBodyVehicleGearBox; - friend class ndMultiBodyVehicleTireJoint; - friend class ndMultiBodyVehicleTorsionBar; -}; - -inline void ndMultiBodyVehicle::ApplyInputs(ndWorld* const, ndFloat32) -{ -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferential.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferential.cpp deleted file mode 100644 index f814ca89f8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferential.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndMultiBodyVehicleDifferential.h" - -ndMultiBodyVehicleDifferential::ndMultiBodyVehicleDifferential() - :ndJointBilateralConstraint() - ,m_limitedSlipOmega(0.0f) -{ - m_maxDof = 2; -} - -ndMultiBodyVehicleDifferential::ndMultiBodyVehicleDifferential(ndBodyKinematic* const differential, ndBodyKinematic* const chassis, ndFloat32 slipOmegaLock) - :ndJointBilateralConstraint(2, differential, chassis, differential->GetMatrix()) - ,m_limitedSlipOmega(slipOmegaLock) -{ - ndAssert(slipOmegaLock >= 0.0f); -} - -void ndMultiBodyVehicleDifferential::AlignMatrix() -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - //matrix1.m_posit += matrix1.m_up.Scale(1.0f); - - m_body0->SetMatrixNoSleep(matrix1); - m_body0->SetVelocityNoSleep(m_body1->GetVelocity()); - - ndVector omega0(m_body0->GetOmega()); - ndVector omega1(m_body1->GetOmega()); - ndVector omega( - matrix1.m_front.Scale(matrix1.m_front.DotProduct(omega0).GetScalar()) + - matrix1.m_up.Scale(matrix1.m_up.DotProduct(omega0).GetScalar()) + - matrix1.m_right.Scale(matrix1.m_right.DotProduct(omega1).GetScalar())); - - m_body0->SetOmegaNoSleep(omega); -} - -void ndMultiBodyVehicleDifferential::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - //one rows to restrict rotation around around the parent coordinate system - const ndFloat32 angle = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - AddAngularRowJacobian(desc, matrix1.m_right, angle); - - const ndVector omega0(m_body0->GetOmega()); - const ndVector omega1(m_body1->GetOmega()); - - ndFloat32 slipOmega = matrix1.m_up.DotProduct(omega0 - omega1).GetScalar(); - if (ndAbs(slipOmega) > m_limitedSlipOmega) - { - AddAngularRowJacobian(desc, matrix1.m_up, ndFloat32 (0.0f)); - ndJacobian& jacobian = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM1; - jacobian.m_angular = ndVector::m_zero; - if (slipOmega > m_limitedSlipOmega) - { - slipOmega -= m_limitedSlipOmega; - ndFloat32 alpha = slipOmega * desc.m_invTimestep; - SetMotorAcceleration(desc, -alpha); - SetHighFriction(desc, ndFloat32(0.0f)); - } - else - { - ndAssert(slipOmega < -m_limitedSlipOmega); - slipOmega += m_limitedSlipOmega; - ndFloat32 alpha = slipOmega * desc.m_invTimestep; - SetMotorAcceleration(desc, -alpha); - SetLowerFriction(desc, ndFloat32(0.0f)); - } - } -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferential.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferential.h deleted file mode 100644 index fd08441fee..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferential.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MULTIBODY_VEHICLE_DIFFERENTIAL_H__ -#define __ND_MULTIBODY_VEHICLE_DIFFERENTIAL_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -#define D_MINIMUM_SLIP_OMEGA ndFloat32 (2.0f) - -class ndMultiBodyVehicleDifferential : public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndMultiBodyVehicleDifferential, ndJointBilateralConstraint) - - D_NEWTON_API ndMultiBodyVehicleDifferential(); - D_NEWTON_API ndMultiBodyVehicleDifferential(ndBodyKinematic* const differential, ndBodyKinematic* const chassis, ndFloat32 slipOmegaLock); - - ndFloat32 GetSlipOmega() const; - void SetSlipOmega(ndFloat32 speed); - - protected: - void AlignMatrix(); - void DebugJoint(ndConstraintDebugCallback&) const {} - void JacobianDerivative(ndConstraintDescritor& desc); - - friend class ndMultiBodyVehicle; - ndFloat32 m_limitedSlipOmega; -}; - -inline ndFloat32 ndMultiBodyVehicleDifferential::GetSlipOmega() const -{ - return m_limitedSlipOmega; -} - -inline void ndMultiBodyVehicleDifferential::SetSlipOmega(ndFloat32 omega) -{ - m_limitedSlipOmega = ndMax(D_MINIMUM_SLIP_OMEGA, ndAbs(omega)); -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferentialAxle.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferentialAxle.cpp deleted file mode 100644 index 9ca9ee12f4..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferentialAxle.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndMultiBodyVehicleDifferentialAxle.h" - -ndMultiBodyVehicleDifferentialAxle::ndMultiBodyVehicleDifferentialAxle() - :ndJointBilateralConstraint() -{ - m_maxDof = 1; -} - -ndMultiBodyVehicleDifferentialAxle::ndMultiBodyVehicleDifferentialAxle( - const ndVector& pin0, const ndVector& upPin, ndBodyKinematic* const differentialBody0, - const ndVector& pin1, ndBodyKinematic* const body1) - :ndJointBilateralConstraint(1, differentialBody0, body1, ndGetIdentityMatrix()) -{ - ndMatrix temp; - ndMatrix matrix0(pin0, upPin, pin0.CrossProduct(upPin), ndVector::m_wOne); - ndMatrix matrix1(ndGramSchmidtMatrix(pin1)); - CalculateLocalMatrix(matrix0, m_localMatrix0, temp); - CalculateLocalMatrix(matrix1, temp, m_localMatrix1); - SetSolverModel(m_jointkinematicCloseLoop); -} - -void ndMultiBodyVehicleDifferentialAxle::JacobianDerivative(ndConstraintDescritor& desc) -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - AddAngularRowJacobian(desc, matrix1.m_right, ndFloat32(0.0f)); - - ndJacobian& jacobian0 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM0; - ndJacobian& jacobian1 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM1; - - jacobian0.m_angular = matrix0.m_front + matrix0.m_up; - jacobian1.m_angular = matrix1.m_front; - - const ndVector& omega0 = m_body0->GetOmega(); - const ndVector& omega1 = m_body1->GetOmega(); - - const ndVector relOmega(omega0 * jacobian0.m_angular + omega1 * jacobian1.m_angular); - ndFloat32 w = (relOmega.m_x + relOmega.m_y + relOmega.m_z) * ndFloat32(0.5f); - SetMotorAcceleration(desc, -w * desc.m_invTimestep); -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferentialAxle.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferentialAxle.h deleted file mode 100644 index 007138be75..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleDifferentialAxle.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MULTIBODY_VEHICLE_DIFFERENTIAL_AXLE_H__ -#define __ND_MULTIBODY_VEHICLE_DIFFERENTIAL_AXLE_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndMultiBodyVehicleDifferentialAxle : public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndMultiBodyVehicleDifferentialAxle, ndJointBilateralConstraint) - - D_NEWTON_API ndMultiBodyVehicleDifferentialAxle(); - D_NEWTON_API ndMultiBodyVehicleDifferentialAxle( - const ndVector& pin0, const ndVector& upPin, ndBodyKinematic* const differentialBody0, - const ndVector& pin1, ndBodyKinematic* const body1); - - protected: - void JacobianDerivative(ndConstraintDescritor& desc); - void DebugJoint(ndConstraintDebugCallback&) const {} -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleGearBox.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleGearBox.cpp deleted file mode 100644 index 86338dc5f2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleGearBox.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" - -#include "ndMultiBodyVehicle.h" -#include "dJoints/ndJointWheel.h" -#include "ndMultiBodyVehicleMotor.h" -#include "ndMultiBodyVehicleGearBox.h" - -ndMultiBodyVehicleGearBox::ndMultiBodyVehicleGearBox() - :ndJointGear() - ,m_idleOmega(ndFloat32(1.0f)) - ,m_clutchTorque(ndFloat32(1.0e5f)) - ,m_driveTrainResistanceTorque(ndFloat32(1000.0f)) -{ -} - -//ndMultiBodyVehicleGearBox::ndMultiBodyVehicleGearBox(ndBodyKinematic* const motor, ndBodyKinematic* const differential, ndMultiBodyVehicle* const chassis) -ndMultiBodyVehicleGearBox::ndMultiBodyVehicleGearBox(ndBodyKinematic* const motor, ndBodyKinematic* const differential, ndMultiBodyVehicle* const) - :ndJointGear(ndFloat32 (1.0f), motor->GetMatrix().m_front, differential, motor->GetMatrix().m_front, motor) - ,m_idleOmega(ndFloat32(1.0f)) - ,m_clutchTorque(ndFloat32 (1.0e5f)) - ,m_driveTrainResistanceTorque(ndFloat32(1000.0f)) -{ - SetRatio(ndFloat32(0.0f)); - SetSolverModel(m_jointkinematicCloseLoop); -} - -void ndMultiBodyVehicleGearBox::SetIdleOmega(ndFloat32 rpm) -{ - m_idleOmega = ndMax(rpm / dRadPerSecToRpm, ndFloat32(0.0f)); -} - -void ndMultiBodyVehicleGearBox::SetClutchTorque(ndFloat32 torqueInNewtonMeters) -{ - m_clutchTorque = ndAbs(torqueInNewtonMeters); -} - -void ndMultiBodyVehicleGearBox::SetInternalTorqueLoss(ndFloat32 torqueInNewtonMeters) -{ - m_driveTrainResistanceTorque = ndAbs(torqueInNewtonMeters); -} - -ndFloat32 ndMultiBodyVehicleGearBox::GetIdleOmega() const -{ - return m_idleOmega; -} - -ndFloat32 ndMultiBodyVehicleGearBox::GetClutchTorque() const -{ - return m_clutchTorque; -} - -ndFloat32 ndMultiBodyVehicleGearBox::GetInternalTorqueLoss() const -{ - return m_driveTrainResistanceTorque; -} - -void ndMultiBodyVehicleGearBox::JacobianDerivative(ndConstraintDescritor& desc) -{ - if (ndAbs(m_gearRatio) > ndFloat32(1.0e-2f)) - { - ndMatrix matrix0; - ndMatrix matrix1; - - // calculate the position of the pivot point and the Jacobian direction vectors, in global space. - CalculateGlobalMatrix(matrix0, matrix1); - - AddAngularRowJacobian(desc, matrix0.m_front, ndFloat32(0.0f)); - - ndJacobian& jacobian0 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM0; - ndJacobian& jacobian1 = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM1; - - ndFloat32 gearRatio = ndFloat32(1.0f) / m_gearRatio; - - jacobian0.m_angular = matrix0.m_front; - jacobian1.m_angular = matrix1.m_front.Scale(gearRatio); - - const ndVector& omega0 = m_body0->GetOmega(); - const ndVector& omega1 = m_body1->GetOmega(); - const ndFloat32 idleOmega = m_idleOmega * gearRatio * ndFloat32(0.95f); - - ndFloat32 w0 = omega0.DotProduct(jacobian0.m_angular).GetScalar(); - ndFloat32 w1 = omega1.DotProduct(jacobian1.m_angular).GetScalar() + idleOmega; - w1 = (gearRatio > ndFloat32(0.0f)) ? ndMin(w1, ndFloat32(0.0f)) : ndMax(w1, ndFloat32(0.0f)); - - const ndFloat32 w = (w0 + w1) * ndFloat32(0.5f); - SetMotorAcceleration(desc, -w * desc.m_invTimestep); - - if (m_gearRatio > ndFloat32 (0.0f)) - { - SetHighFriction(desc, m_clutchTorque); - SetLowerFriction(desc, -m_driveTrainResistanceTorque); - } - else - { - SetHighFriction(desc, m_driveTrainResistanceTorque); - SetLowerFriction(desc, -m_clutchTorque); - } - } -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleGearBox.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleGearBox.h deleted file mode 100644 index b36b52091d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleGearBox.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MULTIBODY_VEHICLE_GEAR_BOX_H__ -#define __ND_MULTIBODY_VEHICLE_GEAR_BOX_H__ - -#include "ndNewtonStdafx.h" -#include "dJoints/ndJointGear.h" - -class ndMultiBodyVehicle; - -class ndMultiBodyVehicleGearBox : public ndJointGear -{ - public: - D_CLASS_REFLECTION(ndMultiBodyVehicleGearBox, ndJointGear) - - D_NEWTON_API ndMultiBodyVehicleGearBox(); - D_NEWTON_API ndMultiBodyVehicleGearBox(ndBodyKinematic* const motor, ndBodyKinematic* const differential, ndMultiBodyVehicle* const chassis); - - D_NEWTON_API void SetIdleOmega(ndFloat32 rpm); - D_NEWTON_API void SetClutchTorque(ndFloat32 torqueInNewtonMeters); - D_NEWTON_API void SetInternalTorqueLoss(ndFloat32 torqueInNewtonMeters); - - D_NEWTON_API ndFloat32 GetIdleOmega() const; - D_NEWTON_API ndFloat32 GetClutchTorque() const; - D_NEWTON_API ndFloat32 GetInternalTorqueLoss() const; - void DebugJoint(ndConstraintDebugCallback&) const {} - - protected: - - void JacobianDerivative(ndConstraintDescritor& desc); - - ndFloat32 m_idleOmega; - ndFloat32 m_clutchTorque; - ndFloat32 m_driveTrainResistanceTorque; - friend class ndMultiBodyVehicle; -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleMotor.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleMotor.cpp deleted file mode 100644 index 5942e5d035..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleMotor.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndBodyDynamic.h" -#include "ndMultiBodyVehicle.h" -#include "dJoints/ndJointWheel.h" -#include "ndMultiBodyVehicleMotor.h" -#include "ndMultiBodyVehicleGearBox.h" - -ndMultiBodyVehicleMotor::ndMultiBodyVehicleMotor() - :ndJointBilateralConstraint() - ,m_omega(ndFloat32(0.0f)) - ,m_maxOmega(ndFloat32(100.0f)) - ,m_omegaStep(ndFloat32(16.0f)) - ,m_targetOmega(ndFloat32(0.0f)) - ,m_engineTorque(ndFloat32(0.0f)) - ,m_internalFriction(ndFloat32(100.0f)) - //,m_vehicelModel(vehicelModel) - ,m_vehicelModel(nullptr) -{ - m_maxDof = 3; - ndAssert(0); -} - -ndMultiBodyVehicleMotor::ndMultiBodyVehicleMotor(ndBodyKinematic* const motor, ndMultiBodyVehicle* const vehicelModel) - :ndJointBilateralConstraint(3, motor, vehicelModel->m_chassis, motor->GetMatrix()) - ,m_omega(ndFloat32(0.0f)) - ,m_maxOmega(ndFloat32(100.0f)) - ,m_omegaStep(ndFloat32(16.0f)) - ,m_targetOmega(ndFloat32(0.0f)) - ,m_engineTorque(ndFloat32(0.0f)) - ,m_internalFriction(ndFloat32(100.0f)) - ,m_vehicelModel(vehicelModel) -{ -} - -void ndMultiBodyVehicleMotor::AlignMatrix() -{ - ndMatrix matrix0; - ndMatrix matrix1; - CalculateGlobalMatrix(matrix0, matrix1); - - m_body0->SetMatrixNoSleep(matrix1); - m_body0->SetVelocityNoSleep(m_body1->GetVelocity()); - - const ndVector omega0(m_body0->GetOmega()); - const ndVector omega1(m_body1->GetOmega()); - - const ndVector wx(matrix1.m_front.Scale(matrix1.m_front.DotProduct(omega0).GetScalar())); - const ndVector wy(matrix1.m_up.Scale(matrix1.m_up.DotProduct(omega1).GetScalar())); - const ndVector wz(matrix1.m_right.Scale (matrix1.m_right.DotProduct(omega1).GetScalar())); - const ndVector omega(wx + wy + wz); - m_body0->SetOmegaNoSleep(omega); -} - -void ndMultiBodyVehicleMotor::SetFrictionLoss(ndFloat32 newtonMeters) -{ - m_internalFriction = ndAbs(newtonMeters); -} - -void ndMultiBodyVehicleMotor::SetMaxRpm(ndFloat32 redLineRpm) -{ - m_maxOmega = ndMax(redLineRpm / dRadPerSecToRpm, ndFloat32 (0.0f)); -} - -void ndMultiBodyVehicleMotor::SetOmegaAccel(ndFloat32 rpmStep) -{ - m_omegaStep = ndAbs(rpmStep / dRadPerSecToRpm); -} - -void ndMultiBodyVehicleMotor::SetTorqueAndRpm(ndFloat32 newtonMeters, ndFloat32 rpm) -{ - m_engineTorque = ndMax(newtonMeters, ndFloat32(0.0f)); - m_targetOmega = ndClamp(rpm / dRadPerSecToRpm, ndFloat32(0.0f), m_maxOmega); -} - -ndFloat32 ndMultiBodyVehicleMotor::GetRpm() const -{ - return m_omega * dRadPerSecToRpm; -} - -ndFloat32 ndMultiBodyVehicleMotor::CalculateAcceleration(ndConstraintDescritor& desc) -{ - const ndVector& motorOmega = m_body0->GetOmega(); - const ndJacobian& motorJacobian = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM0; - const ndVector relOmega(motorOmega * motorJacobian.m_angular); - - ndFloat32 currentOmega = relOmega.AddHorizontal().GetScalar(); - if (currentOmega < ndFloat32(0.0f)) - { - const ndVector clippedOmega(motorOmega - motorJacobian.m_angular * relOmega); - m_body0->SetOmega(clippedOmega); - currentOmega = 0; - } - - m_omega = currentOmega; - ndFloat32 omegaStep = ndClamp(m_targetOmega - m_omega, -m_omegaStep, m_omegaStep); - ndFloat32 accel = omegaStep * desc.m_invTimestep; - return accel; -} - -//void ndMultiBodyVehicleMotor::JacobianDerivative(ndConstraintDescritor& desc) -void ndMultiBodyVehicleMotor::JacobianDerivative(ndConstraintDescritor&) -{ - ndAssert(0); - //ndMatrix matrix0; - //ndMatrix matrix1; - //CalculateGlobalMatrix(matrix0, matrix1); - // - //// two rows to restrict rotation around around the parent coordinate system - //const ndFloat32 angle0 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_up); - //const ndFloat32 angle1 = CalculateAngle(matrix0.m_front, matrix1.m_front, matrix1.m_right); - // - //AddAngularRowJacobian(desc, matrix1.m_up, angle0); - //AddAngularRowJacobian(desc, matrix1.m_right, angle1); - // - //// add rotor joint acceleration - //AddAngularRowJacobian(desc, matrix0.m_front * ndVector::m_negOne, ndFloat32(0.0f)); - // - //const ndFloat32 accel = CalculateAcceleration(desc); - //const ndFloat32 torque = ndMax(m_engineTorque, m_internalFriction); - //SetMotorAcceleration(desc, accel); - //SetHighFriction(desc, torque); - //SetLowerFriction(desc, -m_internalFriction); - //SetDiagonalRegularizer(desc, ndFloat32(0.1f)); - // - //// add torque coupling to chassis. - //const ndMultiBodyVehicleGearBox* const gearBox = *m_vehicelModel->m_gearBox; - //ndAssert(gearBox); - //if (gearBox && ndAbs(gearBox->GetRatio()) > ndFloat32(0.0f)) - //{ - // ndJacobian& chassisJacobian = desc.m_jacobian[desc.m_rowsCount - 1].m_jacobianM1; - // chassisJacobian.m_angular = ndVector::m_zero; - //} -} - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleMotor.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleMotor.h deleted file mode 100644 index 0eea98777f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleMotor.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MULTIBODY_VEHICLE_MOTOR_H__ -#define __ND_MULTIBODY_VEHICLE_MOTOR_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointBilateralConstraint.h" - -class ndMultiBodyVehicle; - -class ndMultiBodyVehicleMotor: public ndJointBilateralConstraint -{ - public: - D_CLASS_REFLECTION(ndMultiBodyVehicleMotor, ndJointBilateralConstraint) - - D_NEWTON_API ndMultiBodyVehicleMotor(); - D_NEWTON_API ndMultiBodyVehicleMotor(ndBodyKinematic* const motor, ndMultiBodyVehicle* const vehicelModel); - - D_NEWTON_API ndFloat32 GetRpm() const; - D_NEWTON_API void SetMaxRpm(ndFloat32 redLineRpm); - D_NEWTON_API void SetOmegaAccel(ndFloat32 rpmStep); - D_NEWTON_API void SetFrictionLoss(ndFloat32 newtonMeters); - D_NEWTON_API void SetTorqueAndRpm(ndFloat32 rpm, ndFloat32 newtonMeters); - void DebugJoint(ndConstraintDebugCallback&) const {} - - private: - void AlignMatrix(); - void JacobianDerivative(ndConstraintDescritor& desc); - ndFloat32 CalculateAcceleration(ndConstraintDescritor& desc); - - protected: - ndFloat32 m_omega; - ndFloat32 m_maxOmega; - ndFloat32 m_omegaStep; - ndFloat32 m_targetOmega; - ndFloat32 m_engineTorque; - ndFloat32 m_internalFriction; - - ndMultiBodyVehicle* m_vehicelModel; - friend class ndMultiBodyVehicle; - friend class ndMultiBodyVehicleGearBox; -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTireJoint.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTireJoint.cpp deleted file mode 100644 index 9fde2fa956..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTireJoint.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndMultiBodyVehicle.h" -#include "ndMultiBodyVehicleTireJoint.h" - -ndMultiBodyVehicleTireJoint::ndMultiBodyVehicleTireJoint() - :ndJointWheel() - ,m_vehicle(nullptr) - ,m_frictionModel() - ,m_lateralSlip(ndFloat32(0.0f)) - ,m_longitudinalSlip(ndFloat32(0.0f)) - ,m_normalizedAligningTorque(ndFloat32(0.0f)) -{ - ndAssert(0); -} - -ndMultiBodyVehicleTireJoint::ndMultiBodyVehicleTireJoint(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent, const ndMultiBodyVehicleTireJointInfo& info, ndMultiBodyVehicle* const vehicle) - :ndJointWheel(pinAndPivotFrame, child, parent, info) - ,m_vehicle(vehicle) - ,m_frictionModel(info) - ,m_lateralSlip(ndFloat32 (0.0f)) - ,m_longitudinalSlip(ndFloat32(0.0f)) - ,m_normalizedAligningTorque(ndFloat32(0.0f)) -{ - m_frictionModel.m_laterialStiffness = ndMax(ndAbs(m_frictionModel.m_laterialStiffness), ndFloat32(1.0f)); - m_frictionModel.m_longitudinalStiffness = ndMax(ndAbs(m_frictionModel.m_longitudinalStiffness), ndFloat32(1.0f)); -} - -ndMultiBodyVehicleTireJoint::~ndMultiBodyVehicleTireJoint() -{ -} - -ndFloat32 ndMultiBodyVehicleTireJoint::GetSideSlip() const -{ - return m_lateralSlip; -} - -ndFloat32 ndMultiBodyVehicleTireJoint::GetLongitudinalSlip() const -{ - return m_longitudinalSlip; -} - -const ndTireFrictionModel& ndMultiBodyVehicleTireJoint::GetFrictionModel() const -{ - return m_frictionModel; -} - -void ndMultiBodyVehicleTireJoint::JacobianDerivative(ndConstraintDescritor& desc) -{ - m_regularizer = m_info.m_regularizer * m_vehicle->m_downForce.m_suspensionStiffnessModifier; - ndJointWheel::JacobianDerivative(desc); -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTireJoint.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTireJoint.h deleted file mode 100644 index 81673b6db3..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTireJoint.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef __ND_MULTIBODY_VEHICLE_TIRE_JOINT_H__ -#define __ND_MULTIBODY_VEHICLE_TIRE_JOINT_H__ - -#include "ndNewtonStdafx.h" -#include "dJoints/ndJointWheel.h" - -class ndTireFrictionModel -{ - public: - enum ndFrictionModel - { - m_coulomb, - m_brushModel, - m_pacejka, - m_coulombCicleOfFriction, - }; - - ndTireFrictionModel() - :m_laterialStiffness(ndFloat32(10.0f)) - ,m_longitudinalStiffness(ndFloat32(10.0f)) - ,m_frictionModel(m_brushModel) - { - } - - ndFloat32 m_laterialStiffness; - ndFloat32 m_longitudinalStiffness; - ndFrictionModel m_frictionModel; -}; - -class ndMultiBodyVehicleTireJointInfo : public ndWheelDescriptor, public ndTireFrictionModel -{ - public: - ndMultiBodyVehicleTireJointInfo() - :ndWheelDescriptor() - ,ndTireFrictionModel() - { - } -}; - -class ndMultiBodyVehicleTireJoint: public ndJointWheel -{ - public: - D_CLASS_REFLECTION(ndMultiBodyVehicleTireJoint, ndJointWheel) - - D_NEWTON_API ndMultiBodyVehicleTireJoint(); - D_NEWTON_API ndMultiBodyVehicleTireJoint(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent, const ndMultiBodyVehicleTireJointInfo& desc, ndMultiBodyVehicle* const vehicle); - D_NEWTON_API virtual ~ndMultiBodyVehicleTireJoint(); - - D_NEWTON_API ndFloat32 GetSideSlip() const; - D_NEWTON_API ndFloat32 GetLongitudinalSlip() const; - - D_NEWTON_API const ndTireFrictionModel& GetFrictionModel() const; - - protected: - D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); - - ndMultiBodyVehicle* m_vehicle; - ndTireFrictionModel m_frictionModel; - ndFloat32 m_lateralSlip; - ndFloat32 m_longitudinalSlip; - ndFloat32 m_normalizedAligningTorque; - friend class ndMultiBodyVehicle; -}; - - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTorsionBar.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTorsionBar.cpp deleted file mode 100644 index 2f9469ce58..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTorsionBar.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndBodyDynamic.h" -#include "ndMultiBodyVehicle.h" -#include "ndMultiBodyVehicleMotor.h" -#include "ndMultiBodyVehicleTorsionBar.h" - -ndMultiBodyVehicleTorsionBar::ndMultiBodyVehicleTorsionBar() - :ndJointBilateralConstraint() - ,m_axles() - ,m_springK(ndFloat32(10.0f)) - ,m_damperC(ndFloat32(1.0f)) - ,m_springDamperRegularizer(ndFloat32(0.1f)) -{ - m_maxDof = 1; - //const ndBodyKinematic* const chassis = vehicle->m_chassis; - //ndAssert(chassis); - //const ndMatrix worldMatrix(vehicle->m_localFrame * chassis->GetMatrix()); - //CalculateLocalMatrix(worldMatrix, m_localMatrix0, m_localMatrix1); - SetSolverModel(m_jointkinematicCloseLoop); -} - - -ndMultiBodyVehicleTorsionBar::ndMultiBodyVehicleTorsionBar(const ndMultiBodyVehicle* const vehicle, ndBodyKinematic* const fixedbody) - :ndJointBilateralConstraint(1, vehicle->m_chassis->GetAsBodyKinematic(), fixedbody, ndGetIdentityMatrix()) - ,m_axles() - ,m_springK(ndFloat32 (10.0f)) - ,m_damperC(ndFloat32(1.0f)) - ,m_springDamperRegularizer(ndFloat32(0.1f)) -{ - const ndBodyKinematic* const chassis = vehicle->m_chassis; - ndAssert(chassis); - const ndMatrix worldMatrix (vehicle->m_localFrame * chassis->GetMatrix()); - CalculateLocalMatrix(worldMatrix, m_localMatrix0, m_localMatrix1); - SetSolverModel(m_jointkinematicCloseLoop); -} - -void ndMultiBodyVehicleTorsionBar::SetTorsionTorque(ndFloat32 springK, ndFloat32 damperC, ndFloat32 springDamperRegularizer) -{ - m_springK = ndAbs(springK); - m_damperC = ndAbs(damperC); - m_springDamperRegularizer = ndClamp (springDamperRegularizer, ND_SPRING_DAMP_MIN_REG, ndFloat32(0.99f)); -} - -void ndMultiBodyVehicleTorsionBar::GetTorsionTorque(ndFloat32& springK, ndFloat32& damperC, ndFloat32& springDamperRegularizer) const -{ - springK = m_springK; - damperC = m_damperC; - springDamperRegularizer = m_springDamperRegularizer; -} - -void ndMultiBodyVehicleTorsionBar::AddAxel(const ndBodyKinematic* const leftTire, const ndBodyKinematic* const rightTire) -{ - if (m_axles.GetCount() < m_axles.GetCapacity()) - { - ndAxles axle; - axle.m_axleAngle = ndFloat32(0.0f); - axle.m_leftTire = leftTire; - axle.m_rightTire = rightTire; - m_axles.PushBack(axle); - } -} - -const ndFixSizeArray& ndMultiBodyVehicleTorsionBar::GetAxels() const -{ - return m_axles; -} - -void ndMultiBodyVehicleTorsionBar::JacobianDerivative(ndConstraintDescritor& desc) -{ - if (m_axles.GetCount()) - { - ndMatrix matrix0; - ndMatrix matrix1; - - // calculate the position of the pivot point and the Jacobian direction vectors, in global space. - CalculateGlobalMatrix(matrix0, matrix1); - - ndFloat32 angle = ndFloat32(0.0f); - ndFloat32 omega = ndFloat32(0.0f); - for (ndInt32 i = 0; i < m_axles.GetCount(); ++i) - { - ndVector dir(m_axles[i].m_rightTire->GetMatrix().m_posit - m_axles[i].m_leftTire->GetMatrix().m_posit); - dir = dir.Normalize(); - angle += matrix0.m_right.CrossProduct(dir).DotProduct(matrix0.m_front).GetScalar(); - omega += (angle - m_axles[i].m_axleAngle) * desc.m_invTimestep; - m_axles[i].m_axleAngle = angle; - } - angle = angle / (ndFloat32)m_axles.GetCount(); - omega = omega / (ndFloat32)m_axles.GetCount(); - //dTrace(("%f\n", angle * dRadToDegree)); - AddAngularRowJacobian(desc, matrix0.m_front, ndFloat32(0.0f)); - ndFloat32 accel = -CalculateSpringDamperAcceleration(desc.m_timestep, 300.0f, angle, ndFloat32(10.0f), omega); - SetMotorAcceleration(desc, accel); - SetDiagonalRegularizer(desc, ndFloat32 (0.2f)); - } -} - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTorsionBar.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTorsionBar.h deleted file mode 100644 index e5309194e5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/ndMultiBodyVehicleTorsionBar.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MULTIBODY_VEHICLE_TORSION_BAR_H__ -#define __ND_MULTIBODY_VEHICLE_TORSION_BAR_H__ - -#include "ndNewtonStdafx.h" -#include "dJoints/ndJointGear.h" - -class ndMultiBodyVehicle; - -class ndMultiBodyVehicleTorsionBar : public ndJointBilateralConstraint -{ - public: - class ndAxles - { - public: - ndAxles() - :m_leftTire(nullptr) - ,m_rightTire(nullptr) - ,m_axleAngle(ndFloat32(0.0f)) - { - } - const ndBodyKinematic* m_leftTire; - const ndBodyKinematic* m_rightTire; - ndFloat32 m_axleAngle; - }; - - D_CLASS_REFLECTION(ndMultiBodyVehicleTorsionBar, ndJointBilateralConstraint) - D_NEWTON_API ndMultiBodyVehicleTorsionBar(); - D_NEWTON_API ndMultiBodyVehicleTorsionBar(const ndMultiBodyVehicle* const chassis, ndBodyKinematic* const fixedbody); - - D_NEWTON_API const ndFixSizeArray& GetAxels() const; - D_NEWTON_API void AddAxel(const ndBodyKinematic* const leftTire, const ndBodyKinematic* const rightTire); - - D_NEWTON_API void SetTorsionTorque(ndFloat32 springK, ndFloat32 damperC, ndFloat32 springDamperRegularizer); - D_NEWTON_API void GetTorsionTorque(ndFloat32& springK, ndFloat32& damperC, ndFloat32& springDamperRegularizer) const; - void DebugJoint(ndConstraintDebugCallback&) const {} - - protected: - void JacobianDerivative(ndConstraintDescritor& desc); - - ndFixSizeArray m_axles; - ndFloat32 m_springK; - ndFloat32 m_damperC; - ndFloat32 m_springDamperRegularizer; - friend class ndMultiBodyVehicle; -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModel.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModel.cpp deleted file mode 100644 index 340306d36b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModel.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndModel.h" -#include "ndModelNotify.h" - -ndModel::ndModel() - :ndContainersFreeListAlloc() - ,m_world(nullptr) - ,m_worldNode(nullptr) - ,m_deletedNode(nullptr) - ,m_notifyCallback() -{ -} - -ndModel::ndModel(const ndModel& src) - :ndContainersFreeListAlloc() - ,m_world(nullptr) - ,m_worldNode(nullptr) - ,m_deletedNode(nullptr) - ,m_notifyCallback(*src.m_notifyCallback ? src.m_notifyCallback->Clone() : nullptr) -{ -} - -ndModel::~ndModel() -{ - ndAssert(!m_worldNode); - ndAssert(!m_deletedNode); -} - -ndModel* ndModel::Clone() const -{ - ndAssert(0); - return nullptr; -} - -ndModel* ndModel::GetAsModel() -{ - return this; -} - -ndModelBase* ndModel::GetAsModelBase() -{ - return nullptr; -} - -ndMultiBodyVehicle* ndModel::GetAsMultiBodyVehicle() -{ - return nullptr; -} - -ndModelArticulation* ndModel::GetAsModelArticulation() -{ - return nullptr; -} - -ndSharedPtr& ndModel::GetNotifyCallback() -{ - return m_notifyCallback; -} - -void ndModel::SetNotifyCallback(const ndSharedPtr& notifyCallback) -{ - if (*m_notifyCallback) - { - m_notifyCallback->m_model = nullptr; - } - - m_notifyCallback = notifyCallback; - - if (*m_notifyCallback) - { - m_notifyCallback->m_model = this; - } -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModel.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModel.h deleted file mode 100644 index 2680ed901d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModel.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MODEL_H__ -#define __ND_MODEL_H__ - -#include "ndNewtonStdafx.h" -#include "ndModelList.h" - -class ndModelBase; -class ndModelNotify; -class ndMultiBodyVehicle; -class ndModelArticulation; -class ndConstraintDebugCallback; - -D_MSV_NEWTON_ALIGN_32 -class ndModel: public ndContainersFreeListAlloc -{ - public: - D_BASE_CLASS_REFLECTION(ndModel) - - D_NEWTON_API ndModel(); - D_NEWTON_API ndModel(const ndModel& src); - - D_NEWTON_API virtual ~ndModel (); - D_NEWTON_API virtual ndModel* Clone() const; - - D_NEWTON_API virtual ndModel* GetAsModel(); - D_NEWTON_API virtual ndModelBase* GetAsModelBase(); - D_NEWTON_API virtual ndMultiBodyVehicle* GetAsMultiBodyVehicle(); - D_NEWTON_API virtual ndModelArticulation* GetAsModelArticulation(); - - D_NEWTON_API ndSharedPtr& GetNotifyCallback(); - D_NEWTON_API void SetNotifyCallback(const ndSharedPtr& notifyCallback); - - protected: - virtual void OnAddToWorld() {} - virtual void OnRemoveFromToWorld() {} - - ndWorld* m_world; - - private: - ndModelList::ndNode* m_worldNode; - ndSpecialList::ndNode* m_deletedNode; - ndSharedPtr m_notifyCallback; - - friend class ndWorld; - friend class ndLoadSave; - friend class ndModelList; -} D_GCC_NEWTON_ALIGN_32; - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelArticulation.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelArticulation.cpp deleted file mode 100644 index 771a6dc748..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelArticulation.cpp +++ /dev/null @@ -1,496 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndModel.h" -#include "ndUrdfFile.h" -#include "ndBodyDynamic.h" -#include "ndModelArticulation.h" - -ndModelArticulation::ndNode::ndNode(const ndSharedPtr& body, const ndSharedPtr& joint, ndNode* const parent) - :ndNodeHierarchy() - ,m_body(body) - ,m_joint(joint) - ,m_name("") -{ - if (parent) - { - Attach(parent); - } -} - -ndModelArticulation::ndNode::ndNode(const ndNode& src) - :ndNodeHierarchy(src) - ,m_body(src.m_body) - ,m_joint(src.m_joint) - ,m_name(src.m_name) -{ -} - -ndModelArticulation::ndNode::~ndNode() -{ -} - -ndModelArticulation::ndModelArticulation() - :ndModel() - ,m_name("") - ,m_rootNode(nullptr) - ,m_closeLoops() -{ -} - -ndModelArticulation::ndModelArticulation(const ndModelArticulation& src) - :ndModel(src) - ,m_name(src.m_name) - ,m_rootNode(nullptr) - ,m_closeLoops() -{ - ndAssert(0); - ndAssert(src.GetRoot()->m_body->GetAsBodyDynamic()); - - ndFixSizeArray stack; - stack.PushBack(src.GetRoot()); - while (stack.GetCount()) - { - ndNode* const node = stack.Pop(); - //ndBodyDynamic* xxx = node->m_body->GetAsBodyDynamic(); - //ndBodyDynamic* xxx1 = new ndBodyDynamic(*xxx); - AddRootBody(new ndBodyDynamic(*node->m_body->GetAsBodyDynamic())); - if (*node->m_joint) - { - - } - - for (ndNode* child = node->GetFirstChild(); child; child = child->GetNext()) - { - stack.PushBack(child); - } - } -} - -ndModelArticulation::~ndModelArticulation() -{ - if (m_rootNode) - { - delete m_rootNode; - } -} - -ndModel* ndModelArticulation::Clone() const -{ - return new ndModelArticulation(*this); -} - -ndModelArticulation* ndModelArticulation::GetAsModelArticulation() -{ - return this; -} - -const ndString& ndModelArticulation::GetName() const -{ - return m_name; -} - -void ndModelArticulation::SetName(const ndString& name) -{ - m_name = name; -} - -ndModelArticulation::ndNode* ndModelArticulation::GetRoot() const -{ - return m_rootNode; -} - -void ndModelArticulation::ClearMemory() -{ - for (ndNode* node = m_rootNode->GetFirstIterator(); node; node = node->GetNextIterator()) - { - ndBodyKinematic* const body = node->m_body->GetAsBodyKinematic(); - - ndBodyKinematic::ndJointList& jointList = body->GetJointList(); - for (ndBodyKinematic::ndJointList::ndNode* jointNode = jointList.GetFirst(); jointNode; jointNode = jointNode->GetNext()) - { - jointNode->GetInfo()->ClearMemory(); - } - - ndBodyKinematic::ndContactMap& contactMap = body->GetContactMap(); - ndBodyKinematic::ndContactMap::Iterator it(contactMap); - for (it.Begin(); it; it++) - { - ndContact* const contact = it.GetNode()->GetInfo(); - contact->ClearMemory(); - } - } - - for (ndList::ndNode* node = m_closeLoops.GetFirst(); node; node = node->GetNext()) - { - ndAssert(0); - ndBodyKinematic* const body = node->GetInfo().m_body->GetAsBodyKinematic(); - ndBodyKinematic::ndJointList& jointList = body->GetJointList(); - - for (ndBodyKinematic::ndJointList::ndNode* jointNode = jointList.GetFirst(); jointNode; jointNode = jointNode->GetNext()) - { - jointNode->GetInfo()->ClearMemory(); - } - - //ndBodyKinematic::ndContactMap& contactMap = body->GetContactMap(); - //ndBodyKinematic::ndContactMap::Iterator it(contactMap); - //for (it.Begin(); it; it++) - //{ - // ndContact* const contact = it.GetNode()->GetInfo(); - // contact->ClearMemory(); - //} - - } - -} - -ndModelArticulation::ndNode* ndModelArticulation::AddRootBody(const ndSharedPtr& rootBody) -{ - ndAssert(!m_rootNode); - ndSharedPtr dommyJoint; - m_rootNode = new ndNode(rootBody, dommyJoint, nullptr); - return m_rootNode; -} - -ndModelArticulation::ndNode* ndModelArticulation::AddLimb(ndNode* const parent, const ndSharedPtr& body, const ndSharedPtr& joint) -{ - ndAssert(m_rootNode); - ndAssert(joint->GetBody0() == body->GetAsBodyKinematic()); - ndAssert(joint->GetBody1() == parent->m_body->GetAsBodyKinematic()); - return new ndNode(body, joint, parent); -} - -void ndModelArticulation::OnAddToWorld() -{ - ndAssert(m_world); - ndFixSizeArray stack; - if (m_rootNode) - { - stack.PushBack(m_rootNode); - while (stack.GetCount()) - { - ndInt32 index = stack.GetCount() - 1; - ndNode* const node = stack[index]; - stack.SetCount(index); - m_world->AddBody(node->m_body); - if (node->m_joint) - { - m_world->AddJoint(node->m_joint); - } - - for (ndNode* child = node->GetFirstChild(); child; child = child->GetNext()) - { - stack.PushBack(child); - } - } - } - - for (ndList::ndNode* node = m_closeLoops.GetFirst(); node; node = node->GetNext()) - { - //ndNode* const node = *node->GetInfo(); - m_world->AddJoint(node->GetInfo().m_joint); - } -} - -void ndModelArticulation::OnRemoveFromToWorld() -{ - ndAssert(m_world); - ndFixSizeArray stack; - if (m_rootNode) - { - //for (ndSharedList::ndNode* node = m_closeLoops.GetFirst(); node; node = node->GetNext()) - for (ndList::ndNode* node = m_closeLoops.GetFirst(); node; node = node->GetNext()) - { - if (node->GetInfo().m_joint->m_worldNode) - { - //m_world->RemoveJoint(node->GetInfo()); - m_world->RemoveJoint(node->GetInfo().m_joint); - } - } - - stack.PushBack(m_rootNode); - while (stack.GetCount()) - { - ndInt32 index = stack.GetCount() - 1; - ndNode* const node = stack[index]; - stack.SetCount(index); - if (node->m_joint) - { - if (node->m_joint->m_worldNode) - { - m_world->RemoveJoint(node->m_joint); - } - } - if (node->m_body->GetAsBodyKinematic()->m_sceneNode) - { - m_world->RemoveBody(node->m_body); - } - - for (ndNode* child = node->GetFirstChild(); child; child = child->GetNext()) - { - stack.PushBack(child); - } - } - } -} - -void ndModelArticulation::AddCloseLoop(const ndSharedPtr& joint, const char* const name) -{ - #ifdef _DEBUG - - auto Check = [&](const ndBodyKinematic* const body) - { - if (body->GetInvMass() == ndFloat32(0.0f)) - { - return false; - } - ndFixSizeArray stack; - stack.PushBack(m_rootNode); - while (stack.GetCount()) - { - ndInt32 index = stack.GetCount() - 1; - ndNode* const node = stack[index]; - stack.SetCount(index); - if (node->m_body->GetAsBodyKinematic() == body) - { - return true; - } - - for (ndNode* child = node->GetFirstChild(); child; child = child->GetNext()) - { - stack.PushBack(child); - } - } - - return false; - }; - - ndAssert(Check(joint->GetBody0()) || Check(joint->GetBody1())); - #endif - - //for (ndSharedList::ndNode* node = m_closeLoops.GetFirst(); node; node = node->GetNext()) - for (ndList::ndNode* node = m_closeLoops.GetFirst(); node; node = node->GetNext()) - { - //if (*node->GetInfo() == *joint) - if (*node->GetInfo().m_joint == *joint) - { - return; - } - } - - char loopName[256]; - snprintf(loopName, sizeof (loopName), "loop_%d", m_closeLoops.GetCount()); - if (name) - { - snprintf(loopName, sizeof(loopName), name); - } - - ndSharedPtr body; - ndList::ndNode* const node = m_closeLoops.Append(ndNode(body, joint, nullptr)); - node->GetInfo().m_name = loopName; -} - -void ndModelArticulation::AddToWorld(ndWorld* const world) -{ - for (ndModelArticulation::ndNode* node = m_rootNode->GetFirstIterator(); node; node = node->GetNextIterator()) - { - world->AddBody(node->m_body); - if (node->m_joint) - { - world->AddJoint(node->m_joint); - } - } - world->AddModel(this); -} - -ndModelArticulation::ndNode* ndModelArticulation::FindByName(const char* const name) const -{ - for (ndModelArticulation::ndNode* node = m_rootNode->GetFirstIterator(); node; node = node->GetNextIterator()) - { - if (strcmp(node->m_name.GetStr(), name) == 0) - { - return node; - } - } - - return nullptr; -} - -ndModelArticulation::ndNode* ndModelArticulation::FindLoopByName(const char* const name) const -{ - for (ndList::ndNode* node = m_closeLoops.GetFirst(); node; node = node->GetNext()) - { - if (strcmp(node->GetInfo().m_name.GetStr(), name) == 0) - { - return &node->GetInfo(); - } - } - - return nullptr; -} - -void ndModelArticulation::SetTransform(const ndMatrix& matrix) -{ - const ndMatrix offset(m_rootNode->m_body->GetMatrix().OrthoInverse() * matrix); - for (ndModelArticulation::ndNode* node = m_rootNode->GetFirstIterator(); node; node = node->GetNextIterator()) - { - ndSharedPtr body(node->m_body); - body->SetMatrix(body->GetMatrix() * offset); - } -} - -void ndModelArticulation::ConvertToUrdf() -{ - class BodyInfo - { - public: - ndVector m_centerOfMass; - ndMatrix m_bodyMatrix; - ndMatrix m_visualMatrix; - ndMatrix m_collisionMatrix; - ndMatrix m_jointMatrix0; - ndMatrix m_jointMatrix1; - ndJointBilateralConstraint* m_joint; - }; - - ndTree map; - for (ndModelArticulation::ndNode* node = m_rootNode->GetFirstIterator(); node; node = node->GetNextIterator()) - { - if (*node->m_joint) - { - BodyInfo info; - ndBodyKinematic* const body = node->m_body->GetAsBodyKinematic(); - info.m_bodyMatrix = body->GetMatrix(); - info.m_centerOfMass = info.m_bodyMatrix.TransformVector(body->GetCentreOfMass()); - info.m_collisionMatrix = body->GetCollisionShape().GetLocalMatrix() * info.m_bodyMatrix; - info.m_visualMatrix = ndGetIdentityMatrix(); - ndUrdfBodyNotify* const notify = body->GetNotifyCallback()->GetAsUrdfBodyNotify(); - if (notify) - { - info.m_visualMatrix = notify->m_offset * info.m_bodyMatrix; - } - - info.m_joint = *node->m_joint; - info.m_joint->CalculateGlobalMatrix(info.m_jointMatrix0, info.m_jointMatrix1); - map.Insert(info, node); - } - } - - ndFixSizeArray saved; - for (ndModelArticulation::ndNode* child = m_rootNode->GetFirstChild(); child; child = child->GetNext()) - { - BodyInfo info; - ndBodyKinematic* const body = child->m_body->GetAsBodyKinematic(); - info.m_bodyMatrix = body->GetMatrix(); - info.m_centerOfMass = info.m_bodyMatrix.TransformVector(body->GetCentreOfMass()); - info.m_collisionMatrix = body->GetCollisionShape().GetLocalMatrix() * info.m_bodyMatrix; - ndUrdfBodyNotify* const notify = body->GetNotifyCallback()->GetAsUrdfBodyNotify(); - if (notify) - { - info.m_visualMatrix = notify->m_offset * info.m_bodyMatrix; - } - - info.m_joint = *child->m_joint; - info.m_joint->CalculateGlobalMatrix(info.m_jointMatrix0, info.m_jointMatrix1); - saved.PushBack(info); - } - - BodyInfo rootBodyInfo; - ndBodyKinematic* const rootBody = m_rootNode->m_body->GetAsBodyKinematic(); - ndShapeInstance& rootCollision = rootBody->GetCollisionShape(); - - rootBodyInfo.m_bodyMatrix = rootBody->GetMatrix(); - rootBodyInfo.m_centerOfMass = rootBodyInfo.m_bodyMatrix.TransformVector(rootBody->GetCentreOfMass()); - rootBodyInfo.m_collisionMatrix = rootCollision.GetLocalMatrix() * rootBodyInfo.m_bodyMatrix; - ndUrdfBodyNotify* const rootNotify = rootBody->GetNotifyCallback()->GetAsUrdfBodyNotify(); - if (rootNotify) - { - rootBodyInfo.m_visualMatrix = rootNotify->m_offset * rootBodyInfo.m_bodyMatrix; - } - - rootBody->SetMatrix(ndGetIdentityMatrix()); - rootCollision.SetLocalMatrix(rootBodyInfo.m_collisionMatrix); - rootBody->SetCentreOfMass(rootBodyInfo.m_centerOfMass); - if (rootNotify) - { - rootNotify->m_offset = rootBodyInfo.m_visualMatrix; - } - - for (ndInt32 i = 0; i < saved.GetCount(); ++i) - { - const BodyInfo& info = saved[i]; - info.m_joint->SetLocalMatrix1(info.m_jointMatrix1); - } - - ndFixSizeArray stack; - stack.PushBack(m_rootNode); - while (stack.GetCount()) - { - ndModelArticulation::ndNode* const node = stack.Pop(); - if (*node->m_joint) - { - const BodyInfo& info = map.Find(node)->GetInfo(); - ndBodyKinematic* const body = node->m_body->GetAsBodyKinematic(); - ndShapeInstance& collision = body->GetCollisionShape(); - - body->SetMatrix(info.m_jointMatrix0); - collision.SetLocalMatrix(info.m_collisionMatrix* info.m_jointMatrix0.OrthoInverse()); - body->SetCentreOfMass(info.m_jointMatrix0.UntransformVector(info.m_centerOfMass)); - - ndUrdfBodyNotify* const notify = body->GetNotifyCallback()->GetAsUrdfBodyNotify(); - if (notify) - { - notify->m_offset = info.m_visualMatrix * info.m_jointMatrix0.OrthoInverse(); - } - } - - for (ndModelArticulation::ndNode* child = node->GetFirstChild(); child; child = child->GetNext()) - { - stack.PushBack(child); - } - } - - stack.PushBack(m_rootNode); - while (stack.GetCount()) - { - ndModelArticulation::ndNode* const node = stack.Pop(); - ndJointBilateralConstraint* const joint = *node->m_joint; - if (joint) - { - const BodyInfo& info = map.Find(node)->GetInfo(); - ndBodyKinematic* const body0 = joint->GetBody0(); - ndBodyKinematic* const body1 = joint->GetBody1(); - - ndMatrix localMatrix0(info.m_jointMatrix0 * body0->GetMatrix().OrthoInverse()); - ndMatrix localMatrix1(info.m_jointMatrix1 * body1->GetMatrix().OrthoInverse()); - joint->SetLocalMatrix0(localMatrix0); - joint->SetLocalMatrix1(localMatrix1); - } - - for (ndModelArticulation::ndNode* child = node->GetFirstChild(); child; child = child->GetNext()) - { - stack.PushBack(child); - } - } -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelArticulation.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelArticulation.h deleted file mode 100644 index 5e119ba132..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelArticulation.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef _ND_MODEL_ARTICULATION_H__ -#define _ND_MODEL_ARTICULATION_H__ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndModel.h" -#include "dIkSolver/ndIkSolver.h" - -class ndModelArticulation: public ndModel -{ - public: - D_CLASS_REFLECTION(ndModelArticulation, ndModelBase) - - class ndNode : public ndNodeHierarchy - { - public: - D_NEWTON_API ndNode(const ndNode& src); - D_NEWTON_API ndNode(const ndSharedPtr& body, const ndSharedPtr& joint, ndNode* const parent); - D_NEWTON_API virtual ~ndNode(); - - ndSharedPtr m_body; - ndSharedPtr m_joint; - ndString m_name; - }; - - D_NEWTON_API ndModelArticulation(); - D_NEWTON_API ndModelArticulation(const ndModelArticulation& src); - D_NEWTON_API virtual ~ndModelArticulation(); - D_NEWTON_API virtual ndModel* Clone() const; - - D_NEWTON_API virtual ndModelArticulation* GetAsModelArticulation(); - - D_NEWTON_API ndNode* GetRoot() const; - D_NEWTON_API ndNode* AddRootBody(const ndSharedPtr& rootBody); - D_NEWTON_API ndNode* AddLimb(ndNode* const parent, const ndSharedPtr& body, const ndSharedPtr& joint); - - D_NEWTON_API void AddCloseLoop(const ndSharedPtr& joint, const char* const name = nullptr); - - D_NEWTON_API virtual void OnAddToWorld(); - D_NEWTON_API virtual void OnRemoveFromToWorld(); - - D_NEWTON_API const ndString& GetName() const; - D_NEWTON_API void SetName(const ndString& name); - D_NEWTON_API ndNode* FindByName(const char* const name) const; - D_NEWTON_API ndNode* FindLoopByName(const char* const name) const; - - D_NEWTON_API void ClearMemory(); - D_NEWTON_API void AddToWorld(ndWorld* const world); - D_NEWTON_API void SetTransform(const ndMatrix& matrix); - - private: - D_NEWTON_API void ConvertToUrdf(); - - ndString m_name; - ndNode* m_rootNode; - ndList m_closeLoops; - - friend class ndUrdfFile; -}; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelList.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelList.cpp deleted file mode 100644 index ab1d36ff2f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelList.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndModel.h" - -ndModelList::ndModelList() - :ndList, ndContainersFreeListAlloc*>>() - ,m_updateArray() - ,m_dirty(true) -{ -} - -ndArray& ndModelList::GetUpdateList() -{ - return m_updateArray; -} - -void ndModelList::UpdateDirtyList() -{ - if (m_dirty) - { - m_dirty = false; - m_updateArray.SetCount(0); - for (ndNode* node = GetFirst(); node; node = node->GetNext()) - { - m_updateArray.PushBack(*node->GetInfo()); - } - } -} - -void ndModelList::AddModel(const ndSharedPtr& model, ndWorld* const world) -{ - ndAssert(!model->m_worldNode); - if (!model->m_worldNode) - { - m_dirty = true; - model->m_world = world; - model->m_worldNode = Append(model); - model->OnAddToWorld(); - } -} - -void ndModelList::RemoveModel(const ndSharedPtr& model) -{ - ndNode* const node = model->m_worldNode; - if (node) - { - m_dirty = true; - model->OnRemoveFromToWorld(); - model->m_world = nullptr; - model->m_worldNode = nullptr; - Remove(node); - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelList.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelList.h deleted file mode 100644 index 4190d9bdb8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelList.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MODEL_LIST_H__ -#define __ND_MODEL_LIST_H__ - -#include "ndNewtonStdafx.h" - -class ndModel; - -class ndModelList : public ndList, ndContainersFreeListAlloc*>> -{ - ndModelList(); - - void UpdateDirtyList(); - ndArray& GetUpdateList(); - void RemoveModel(const ndSharedPtr& model); - void AddModel(const ndSharedPtr& model, ndWorld* const world); - - ndArray m_updateArray; - bool m_dirty; - friend class ndWorld; - friend class ndLoadSave; -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelNotify.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelNotify.cpp deleted file mode 100644 index 21f89e7975..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelNotify.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndModelNotify.h" - -ndModelNotify::ndModelNotify(const ndModelNotify& src) - :ndContainersFreeListAlloc() - ,m_model(src.m_model) -{ -} - -ndModelNotify::ndModelNotify() - :ndContainersFreeListAlloc() - ,m_model(nullptr) -{ -} - -ndModelNotify* ndModelNotify::Clone() const -{ - ndAssert(0); - return new ndModelNotify(); -} - -ndModelNotify::~ndModelNotify() -{ -} - -ndModel* ndModelNotify::GetModel() const -{ - return m_model; -} - -void ndModelNotify::Debug(ndConstraintDebugCallback&) const -{ -} - - -void ndModelNotify::Update(ndWorld* const, ndFloat32) -{ -} - -void ndModelNotify::PostUpdate(ndWorld* const, ndFloat32) -{ -} - -void ndModelNotify::PostTransformUpdate(ndWorld* const, ndFloat32) -{ -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelNotify.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelNotify.h deleted file mode 100644 index 036a91e2d5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndModelNotify.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_MODEL_NOTIFY_H__ -#define __ND_MODEL_NOTIFY_H__ - -#include "ndNewtonStdafx.h" - -D_MSV_NEWTON_ALIGN_32 -class ndModelNotify : public ndContainersFreeListAlloc -{ - public: - D_BASE_CLASS_REFLECTION(ndModelNotify) - - D_NEWTON_API ndModelNotify(); - D_NEWTON_API ndModelNotify(const ndModelNotify& src); - - D_NEWTON_API virtual ~ndModelNotify(); - - D_NEWTON_API ndModel* GetModel() const; - - D_NEWTON_API virtual ndModelNotify* Clone() const; - D_NEWTON_API virtual void Update(ndWorld* const world, ndFloat32 timestep); - D_NEWTON_API virtual void PostUpdate(ndWorld* const world, ndFloat32 timestep); - D_NEWTON_API virtual void PostTransformUpdate(ndWorld* const world, ndFloat32 timestep); - - D_NEWTON_API virtual void Debug(ndConstraintDebugCallback& context) const; - - private: - ndModel* m_model; - friend class ndModel; -} D_GCC_NEWTON_ALIGN_32; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndUrdfFile.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndUrdfFile.cpp deleted file mode 100644 index 607446650c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndUrdfFile.cpp +++ /dev/null @@ -1,1434 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndUrdfFile.h" -#include "ndBodyDynamic.h" -#include "dJoints/ndJointHinge.h" -#include "dJoints/ndJointSlider.h" -#include "dJoints/ndJointFix6dof.h" -#include "dIkSolver/ndIkJointHinge.h" -#include "dIkSolver/ndIkJointSpherical.h" - -ndUrdfFile::ndUrdfFile() - :ndClassAlloc() -{ -} - -ndUrdfFile::~ndUrdfFile() -{ -} - -// ******************************************************************************* -// -// ******************************************************************************* -void ndUrdfFile::ImportMaterials(const nd::TiXmlNode* const rootNode) -{ - m_materials.SetCount(0); - m_materialMap.RemoveAll(); - m_materials.PushBack(Material()); - snprintf(m_materials[0].m_texture, sizeof (m_materials[0].m_texture), "wood_0.png"); - for (const nd::TiXmlNode* node = rootNode->FirstChild("material"); node; node = node->NextSibling("material")) - { - const nd::TiXmlElement* const materialNode = (nd::TiXmlElement*)node; - - const char* const name = materialNode->Attribute("name"); - m_materialMap.Insert(ndInt32(m_materials.GetCount()), name); - - Material material; - const nd::TiXmlElement* const color = (nd::TiXmlElement*)node->FirstChild("color"); - if (color) - { - ndReal r; - ndReal g; - ndReal b; - ndReal a; - ndInt32 ret = 0; - const char* const rgba = color->Attribute("rgba"); - ret = sscanf(rgba, "%f %f %f %f", &r, &g, &b, &a); - material.m_color.m_x = r; - material.m_color.m_y = g; - material.m_color.m_z = b; - material.m_color.m_w = a; - } - const nd::TiXmlElement* const texture = (nd::TiXmlElement*)node->FirstChild("texture"); - if (texture) - { - const char* const texName = texture->Attribute("filename"); - snprintf(material.m_texture, sizeof (material.m_texture), "%s", texName); - } - else - { - snprintf(material.m_texture, sizeof(material.m_texture), "default.png"); - } - m_materials.PushBack(material); - } -} - -// ******************************************************************************* -// -// ******************************************************************************* -void ndUrdfFile::ExportMakeNamesUnique(ndModelArticulation* const model) -{ - ndTree < ndModelArticulation::ndNode*, ndString> filter; - - if (model->GetName() == "") - { - model->SetName("robot_model"); - } - //model->GetRoot()->m_name = "base_link"; - - ndString baseName("node_"); - - ndFixSizeArray stack; - stack.PushBack(model->GetRoot()); - - while (stack.GetCount()) - { - ndModelArticulation::ndNode* const childNode = stack.Pop(); - if (childNode->m_name == "") - { - if (childNode->GetParent()) - { - childNode->m_name = baseName + "0" + "_link"; - } - else - { - childNode->m_name = "base_link"; - } - } - ndInt32 count = 1; - while (filter.Find(childNode->m_name)) - { - childNode->m_name = baseName + count + "_link";; - count++; - } - filter.Insert(childNode, childNode->m_name); - - for (ndModelArticulation::ndNode* child = childNode->GetFirstChild(); child; child = child->GetNext()) - { - stack.PushBack(child); - } - } -} - -void ndUrdfFile::ExportMaterials(nd::TiXmlElement* const rootNode, const Surrogate* const) -{ - nd::TiXmlElement* const material = new nd::TiXmlElement("material"); - rootNode->LinkEndChild(material); - material->SetAttribute("name", "material_0"); - - nd::TiXmlElement* const color = new nd::TiXmlElement("color"); - material->LinkEndChild(color); - //color->SetAttribute("rgba", "1.0 0.0 0.0 1.0"); - color->SetAttribute("rgba", "1.0 1.0 1.0 1.0"); - - nd::TiXmlElement* const texture = new nd::TiXmlElement("texture"); - material->LinkEndChild(texture); - //texture->SetAttribute("filename", "default.png"); - texture->SetAttribute("filename", "wood_0.png"); -} - -void ndUrdfFile::ExportOrigin(nd::TiXmlElement* const parentNode, const ndMatrix& pose) -{ - char buffer[256]; - nd::TiXmlElement* const origin = new nd::TiXmlElement("origin"); - parentNode->LinkEndChild(origin); - - ndVector euler1; - ndVector euler(pose.CalcPitchYawRoll(euler1)); - //ret = sscanf(rpy, "%f %f %f", &pitch, &yaw, &roll); - snprintf(buffer, sizeof(buffer), "%g %g %g", euler.m_x, euler.m_y, euler.m_z); - origin->SetAttribute("rpy", buffer); - - snprintf(buffer, sizeof(buffer), "%g %g %g", pose.m_posit.m_x, pose.m_posit.m_y, pose.m_posit.m_z); - origin->SetAttribute("xyz", buffer); -} - -void ndUrdfFile::ExportVisual(nd::TiXmlElement* const linkNode, const Surrogate* const surroratelink) -{ - char buffer[256]; - - nd::TiXmlElement* const visualNode = new nd::TiXmlElement("visual"); - linkNode->LinkEndChild(visualNode); - const ndModelArticulation::ndNode* const link = surroratelink->m_articulation; - - // add position and orientation - const ndBodyKinematic* const body = link->m_body->GetAsBodyKinematic(); - const ndShapeInstance& collision = body->GetCollisionShape(); - - // add geometry node - nd::TiXmlElement* const geometry = new nd::TiXmlElement("geometry"); - visualNode->LinkEndChild(geometry); - const ndShape* const collisionShape = collision.GetShape(); - const char* const className = collisionShape->ClassName(); - - ndMatrix aligment(ndGetIdentityMatrix()); - if (!strcmp(className, "ndShapeBox")) - { - ndShapeInfo info(collisionShape->GetShapeInfo()); - snprintf(buffer, sizeof(buffer), "%g %g %g", info.m_box.m_x, info.m_box.m_y, info.m_box.m_z); - - nd::TiXmlElement* const shape = new nd::TiXmlElement("box"); - geometry->LinkEndChild(shape); - shape->SetAttribute("size", buffer); - } - else if (!strcmp(className, "ndShapeCapsule")) - { - ndShapeInfo info(collisionShape->GetShapeInfo()); - - nd::TiXmlElement* const shape = new nd::TiXmlElement("cylinder"); - geometry->LinkEndChild(shape); - - snprintf(buffer, sizeof(buffer), "%g", info.m_capsule.m_height + info.m_capsule.m_radio0 * 2.0f); - shape->SetAttribute("length", buffer); - - snprintf(buffer, sizeof(buffer), "%g", info.m_capsule.m_radio0); - shape->SetAttribute("radius", buffer); - aligment = ndYawMatrix(-ndPi * ndFloat32(0.5f)); - - nd::TiXmlElement* const newtonExt = new nd::TiXmlElement("newton"); - geometry->LinkEndChild(newtonExt); - newtonExt->SetAttribute("replaceWith", "capsule"); - } - else if (!strcmp(className, "ndShapeCylinder")) - { - ndShapeInfo info(collisionShape->GetShapeInfo()); - - nd::TiXmlElement* const shape = new nd::TiXmlElement("cylinder"); - geometry->LinkEndChild(shape); - - snprintf(buffer, sizeof(buffer), "%g", info.m_cylinder.m_height); - shape->SetAttribute("length", buffer); - - snprintf(buffer, sizeof(buffer), "%g", info.m_cylinder.m_radio0); - shape->SetAttribute("radius", buffer); - aligment = ndYawMatrix(-ndPi * ndFloat32(0.5f)); - } - else if (!strcmp(className, "ndShapeSphere")) - { - ndShapeInfo info(collisionShape->GetShapeInfo()); - - nd::TiXmlElement* const shape = new nd::TiXmlElement("sphere"); - geometry->LinkEndChild(shape); - - snprintf(buffer, sizeof(buffer), "%g", info.m_sphere.m_radius); - shape->SetAttribute("radius", buffer); - } - else - { - ndTrace((" export convex hull stl mesh\n")); - snprintf(buffer, sizeof(buffer), "%g %g %g", 0.1f, 0.1f, 0.1f); - - nd::TiXmlElement* const shape = new nd::TiXmlElement("box"); - geometry->LinkEndChild(shape); - shape->SetAttribute("size", buffer); - } - - //ndMatrix matrix(aligment * surroratelink->m_shapeMatrixMatrix); - ndMatrix matrix(aligment * surroratelink->m_shapeLocalMatrix); - ExportOrigin(visualNode, matrix); - - // add material node - nd::TiXmlElement* const material = new nd::TiXmlElement("material"); - visualNode->LinkEndChild(material); - material->SetAttribute("name", "material_0"); -} - -void ndUrdfFile::ExportCollision(nd::TiXmlElement* const linkNode, const Surrogate* const surroratelink) -{ - char buffer[256]; - const ndModelArticulation::ndNode* const link = surroratelink->m_articulation; - const ndBodyKinematic* const body = link->m_body->GetAsBodyKinematic(); - - const ndShapeInstance& collision = body->GetCollisionShape(); - const ndShape* const collisionShape = collision.GetShape(); - - nd::TiXmlElement* const collisionNode = new nd::TiXmlElement("collision"); - linkNode->LinkEndChild(collisionNode); - - nd::TiXmlElement* const geometry = new nd::TiXmlElement("geometry"); - collisionNode->LinkEndChild(geometry); - - ndMatrix aligment(ndGetIdentityMatrix()); - const char* const className = collisionShape->ClassName(); - if (!strcmp(className, "ndShapeBox")) - { - ndShapeInfo info(collisionShape->GetShapeInfo()); - snprintf(buffer, sizeof(buffer), "%g %g %g", info.m_box.m_x, info.m_box.m_y, info.m_box.m_z); - - nd::TiXmlElement* const shape = new nd::TiXmlElement("box"); - geometry->LinkEndChild(shape); - shape->SetAttribute("size", buffer); - } - else if (!strcmp(className, "ndShapeCapsule")) - { - ndShapeInfo info(collisionShape->GetShapeInfo()); - - nd::TiXmlElement* const shape = new nd::TiXmlElement("cylinder"); - geometry->LinkEndChild(shape); - - snprintf(buffer, sizeof(buffer), "%g", info.m_capsule.m_height + info.m_capsule.m_radio0 * 2.0f); - shape->SetAttribute("length", buffer); - - snprintf(buffer, sizeof(buffer), "%g", info.m_capsule.m_radio0); - shape->SetAttribute("radius", buffer); - aligment = ndYawMatrix(-ndPi * ndFloat32(0.5f)); - - nd::TiXmlElement* const newtonExt = new nd::TiXmlElement("newton"); - geometry->LinkEndChild(newtonExt); - newtonExt->SetAttribute("replaceWith", "capsule"); - } - else if (!strcmp(className, "ndShapeCylinder")) - { - ndShapeInfo info(collisionShape->GetShapeInfo()); - - nd::TiXmlElement* const shape = new nd::TiXmlElement("cylinder"); - geometry->LinkEndChild(shape); - - snprintf(buffer, sizeof(buffer), "%g", info.m_cylinder.m_height); - shape->SetAttribute("length", buffer); - - snprintf(buffer, sizeof(buffer), "%g", info.m_cylinder.m_radio0); - shape->SetAttribute("radius", buffer); - aligment = ndYawMatrix(-ndPi * ndFloat32(0.5f)); - } - else if (!strcmp(className, "ndShapeSphere")) - { - ndShapeInfo info(collisionShape->GetShapeInfo()); - - nd::TiXmlElement* const shape = new nd::TiXmlElement("sphere"); - geometry->LinkEndChild(shape); - - snprintf(buffer, sizeof(buffer), "%g", info.m_sphere.m_radius); - shape->SetAttribute("radius", buffer); - } - else - { - ndTrace((" export convex hull stl mesh\n")); - snprintf(buffer, sizeof(buffer), "%g %g %g", 0.1f, 0.1f, 0.1f); - - nd::TiXmlElement* const shape = new nd::TiXmlElement("box"); - geometry->LinkEndChild(shape); - shape->SetAttribute("size", buffer); - } - - ndMatrix matrix(aligment * surroratelink->m_shapeLocalMatrix); - ExportOrigin(collisionNode, matrix); -} - -void ndUrdfFile::ExportInertia(nd::TiXmlElement* const linkNode, const Surrogate* const surroratelink) -{ - char buffer[256]; - nd::TiXmlElement* const inertial = new nd::TiXmlElement("inertial"); - linkNode->LinkEndChild(inertial); - const ndModelArticulation::ndNode* const link = surroratelink->m_articulation; - - const ndBodyKinematic* const body = link->m_body->GetAsBodyKinematic(); - ndMatrix comMatrix(ndGetIdentityMatrix()); - comMatrix.m_posit = surroratelink->m_com; - ExportOrigin(inertial, comMatrix); - - nd::TiXmlElement* const mass = new nd::TiXmlElement("mass"); - inertial->LinkEndChild(mass); - ndVector massMatrix(body->GetMassMatrix()); - snprintf(buffer, sizeof(buffer), "%g", massMatrix.m_w); - mass->SetAttribute("value", buffer); - - nd::TiXmlElement* const inertia = new nd::TiXmlElement("inertia"); - inertial->LinkEndChild(inertia); - - ndMatrix inertiaMatrix(surroratelink->m_bodyInertia); - snprintf(buffer, sizeof(buffer), "%g", inertiaMatrix[0][0]); - inertia->SetAttribute("xx", buffer); - - snprintf(buffer, sizeof(buffer), "%g", inertiaMatrix[0][1]); - inertia->SetAttribute("xy", buffer); - - snprintf(buffer, sizeof(buffer), "%g", inertiaMatrix[0][2]); - inertia->SetAttribute("xz", buffer); - - snprintf(buffer, sizeof(buffer), "%g", inertiaMatrix[1][1]); - inertia->SetAttribute("yy", buffer); - - snprintf(buffer, sizeof(buffer), "%g", inertiaMatrix[1][2]); - inertia->SetAttribute("yz", buffer); - - snprintf(buffer, sizeof(buffer), "%g", inertiaMatrix[2][2]); - inertia->SetAttribute("zz", buffer); -} - -void ndUrdfFile::ExportLink(nd::TiXmlElement* const rootNode, const Surrogate* const surroratelink) -{ - char name[256]; - nd::TiXmlElement* const linkNode = new nd::TiXmlElement("link"); - rootNode->LinkEndChild(linkNode); - const ndModelArticulation::ndNode* const link = surroratelink->m_articulation; - - snprintf(name, sizeof (name), "%s", link->m_name.GetStr()); - linkNode->SetAttribute("name", name); - - ExportVisual(linkNode, surroratelink); - ExportCollision(linkNode, surroratelink); - ExportInertia(linkNode, surroratelink); -} - -void ndUrdfFile::ExportJoint(nd::TiXmlElement* const rootNode, const Surrogate* const surroratelink) -{ - char buffer[256]; - const ndModelArticulation::ndNode* const link = surroratelink->m_articulation; - - snprintf(buffer, sizeof(buffer), "%s_to_%s", link->m_name.GetStr(), link->GetParent()->m_name.GetStr()); - - nd::TiXmlElement* const jointNode = new nd::TiXmlElement("joint"); - rootNode->LinkEndChild(jointNode); - jointNode->SetAttribute("name", buffer); - - nd::TiXmlElement* const parent = new nd::TiXmlElement("parent"); - jointNode->LinkEndChild(parent); - snprintf(buffer, sizeof(buffer), "%s", link->GetParent()->m_name.GetStr()); - parent->SetAttribute("link", buffer); - - nd::TiXmlElement* const child = new nd::TiXmlElement("child"); - jointNode->LinkEndChild(child); - snprintf(buffer, sizeof(buffer), "%s", link->m_name.GetStr()); - child->SetAttribute("link", buffer); - - const ndJointBilateralConstraint* const joint = *link->m_joint; - const char* const className = joint->ClassName(); - - ndMatrix localMatrix(surroratelink->m_jointLocalMatrix1); - if (!strcmp(className, "ndJointFix6dof")) - { - jointNode->SetAttribute("type", "fixed"); - } - else if (!strcmp(className, "ndJointHinge")) - { - const ndJointHinge* const hinge = (ndJointHinge*)joint; - if (hinge->GetLimitState()) - { - ndFloat32 minLimit; - ndFloat32 maxLimit; - jointNode->SetAttribute("type", "revolute"); - - nd::TiXmlElement* const limit = new nd::TiXmlElement("limit"); - jointNode->LinkEndChild(limit); - hinge->GetLimits(minLimit, maxLimit); - limit->SetDoubleAttribute("effort", 1000); - limit->SetDoubleAttribute("lower", minLimit); - limit->SetDoubleAttribute("upper", maxLimit); - limit->SetDoubleAttribute("velocity", 0.5f); - } - else - { - jointNode->SetAttribute("type", "continuous"); - } - - - ndFloat32 spring; - ndFloat32 damper; - ndFloat32 regularizer; - hinge->GetSpringDamper(regularizer, spring, damper); - if ((spring != ndFloat32(0.0f)) || (damper != ndFloat32(0.0f))) - { - nd::TiXmlElement* const newtonExt = new nd::TiXmlElement("newton"); - jointNode->LinkEndChild(newtonExt); - newtonExt->SetDoubleAttribute("springPD", spring); - newtonExt->SetDoubleAttribute("damperPD", damper); - newtonExt->SetDoubleAttribute("regularizer", regularizer); - } - - //const ndMatrix pinMatrix(ndGramSchmidtMatrix(surroratelink->m_jointBodyMatrix0[0])); - const ndMatrix pinMatrix(ndGetIdentityMatrix()); - localMatrix = pinMatrix.OrthoInverse() * localMatrix; - - //snprintf(buffer, "%g %g %g", pinMatrix[0].m_x, pinMatrix[0].m_y, pinMatrix[0].m_z); - //nd::TiXmlElement* const axis = new nd::TiXmlElement("axis"); - //jointNode->LinkEndChild(axis); - //axis->SetAttribute("xyz", buffer); - } - else if (!strcmp(className, "ndJointSlider")) - { - const ndJointSlider* const slider = (ndJointSlider*)joint; - - jointNode->SetAttribute("type", "prismatic"); - //const ndMatrix pinMatrix(ndGramSchmidtMatrix(surroratelink->m_jointBodyMatrix0[0])); - const ndMatrix pinMatrix(ndGetIdentityMatrix()); - localMatrix = pinMatrix.OrthoInverse() * localMatrix; - - //snprintf(buffer, "%g %g %g", pinMatrix[0].m_x, pinMatrix[0].m_y, pinMatrix[0].m_z); - //nd::TiXmlElement* const axis = new nd::TiXmlElement("axis"); - //jointNode->LinkEndChild(axis); - //axis->SetAttribute("xyz", buffer); - - nd::TiXmlElement* const limit = new nd::TiXmlElement("limit"); - jointNode->LinkEndChild(limit); - - ndFloat32 minLimit; - ndFloat32 maxLimit; - slider->GetLimits(minLimit, maxLimit); - limit->SetDoubleAttribute("effort", 1000); - limit->SetDoubleAttribute("lower", minLimit); - limit->SetDoubleAttribute("upper", maxLimit); - limit->SetDoubleAttribute("velocity", 0.5f); - } - else if (!strcmp(className, "ndIkJointSpherical")) - { - //const ndIkJointSpherical* const ikJoint = (ndIkJointSpherical*)joint; - jointNode->SetAttribute("type", "floating"); - - nd::TiXmlElement* const newtonExt = new nd::TiXmlElement("newton"); - jointNode->LinkEndChild(newtonExt); - newtonExt->SetAttribute("replaceWith", "ndIkJointSpherical"); - } - else if (!strcmp(className, "ndIkJointHinge")) - { - //jointNode->SetAttribute("type", "floating"); - const ndJointHinge* const hinge = (ndJointHinge*)joint; - if (hinge->GetLimitState()) - { - ndFloat32 minLimit; - ndFloat32 maxLimit; - jointNode->SetAttribute("type", "revolute"); - - nd::TiXmlElement* const limit = new nd::TiXmlElement("limit"); - jointNode->LinkEndChild(limit); - hinge->GetLimits(minLimit, maxLimit); - limit->SetDoubleAttribute("effort", 1000); - limit->SetDoubleAttribute("lower", minLimit); - limit->SetDoubleAttribute("upper", maxLimit); - limit->SetDoubleAttribute("velocity", 0.5f); - } - else - { - jointNode->SetAttribute("type", "continuous"); - } - - nd::TiXmlElement* const newtonExt = new nd::TiXmlElement("newton"); - jointNode->LinkEndChild(newtonExt); - newtonExt->SetAttribute("replaceWith", "ndIkJointHinge"); - } - else - { - //ndAssert(0); - ndTrace(("xxxxxxxxxxxx\n")); - jointNode->SetAttribute("type", "fixed"); - } - - //ExportOrigin(jointNode, surroratelink->m_jointBodyMatrix1); - ExportOrigin(jointNode, localMatrix); -} - -ndUrdfFile::Surrogate* ndUrdfFile::ExportMakeSurrogate(ndModelArticulation* const model) -{ - Surrogate* surrogateRoot = nullptr; - ndFixSizeArray surrogateStack; - ndFixSizeArray stack; - - stack.PushBack(model->GetRoot()); - surrogateStack.PushBack(nullptr); - - while (stack.GetCount()) - { - Surrogate* const surrogateParent = surrogateStack.Pop(); - ndModelArticulation::ndNode* const node = stack.Pop(); - - Surrogate* const surrogateNode = new Surrogate; - if (surrogateParent) - { - surrogateNode->Attach(surrogateParent); - - ndMatrix matrix0; - ndMatrix matrix1; - surrogateNode->m_jointLocalMatrix0 = node->m_joint->GetLocalMatrix0(); - surrogateNode->m_jointLocalMatrix1 = node->m_joint->GetLocalMatrix1(); - } - - const ndBodyKinematic* const body = node->m_body->GetAsBodyKinematic(); - surrogateNode->m_com = body->GetCentreOfMass(); - surrogateNode->m_bodyMatrix = body->GetMatrix(); - surrogateNode->m_shapeLocalMatrix = body->GetCollisionShape().GetLocalMatrix(); - surrogateNode->m_bodyInertia = body->CalculateInertiaMatrix(); - - surrogateNode->m_articulation = node; - - if (surrogateRoot == nullptr) - { - surrogateRoot = surrogateNode; - } - - for (ndModelArticulation::ndNode* child = node->GetFirstChild(); child; child = child->GetNext()) - { - stack.PushBack(child); - surrogateStack.PushBack(surrogateNode); - } - } - - return surrogateRoot; -} - -// ******************************************************************************* -// -// ******************************************************************************* -ndMatrix ndUrdfFile::ImportOrigin(const nd::TiXmlNode* const parentNode) const -{ - const nd::TiXmlElement* const origin = (nd::TiXmlElement*)parentNode->FirstChild("origin"); - - ndMatrix matrix(ndGetIdentityMatrix()); - if (origin) - { - ndReal x = ndFloat32(0.0f); - ndReal y = ndFloat32(0.0f); - ndReal z = ndFloat32(0.0f); - ndReal yaw = ndFloat32(0.0f); - ndReal roll = ndFloat32(0.0f); - ndReal pitch = ndFloat32(0.0f); - - const char* const xyz = origin->Attribute("xyz"); - if (xyz) - { - ndInt32 ret = 0; - ret = sscanf(xyz, "%f %f %f", &x, &y, &z); - } - const char* const rpy = origin->Attribute("rpy"); - if (rpy) - { - ndInt32 ret = 0; - ret = sscanf(rpy, "%f %f %f", &pitch, &yaw, &roll); - } - - matrix = ndPitchMatrix(pitch) * ndYawMatrix(yaw) * ndRollMatrix(roll); - matrix.m_posit.m_x = x; - matrix.m_posit.m_y = y; - matrix.m_posit.m_z = z; - } - return matrix; -} - -void ndUrdfFile::ImportStlMesh(const char* const pathName, ndMeshEffect* const meshEffect) const -{ - char meshFile[256]; - char meshPath[1024]; - - const char* meshName = strrchr(pathName, '/'); - if (!meshName) - { - meshName = strrchr(pathName, '\\'); - } - snprintf(meshFile, sizeof (meshFile), "%s", meshName + 1); - char* ptr = strrchr(meshFile, '.'); - snprintf(ptr, 32, ".stl"); - - snprintf(meshPath, sizeof (meshPath), "%s/%s", m_path.GetStr(), meshFile); - - FILE* const file = fopen(meshPath, "rb"); - ndAssert(file); - if (file) - { - char buffer[256]; - for (ndInt32 i = 0; i < 80; ++i) - { - buffer[i] = char(fgetc(file)); - } - - ndInt32 numberOfTriangles; - size_t ret = 0; - ret = fread(&numberOfTriangles, 1, 4, file); - ndFloat32 inchToMeters = 0.0254f; - - ndReal normal[3]; - ndReal triangle[3][3]; - short flags; - - for (ndInt32 i = 0; i < numberOfTriangles; ++i) - { - ret = fread(normal, 1, sizeof(normal), file); - ret = fread(triangle, 1, sizeof(triangle), file); - ret = fread(&flags, 1, sizeof(flags), file); - - meshEffect->BeginBuildFace(); - for (ndInt32 j = 0; j < 3; ++j) - { - meshEffect->AddMaterial(0); - meshEffect->AddPoint(triangle[j][0] * inchToMeters, triangle[j][1] * inchToMeters, triangle[j][2] * inchToMeters); - meshEffect->AddNormal(normal[0], normal[1], normal[2]); - } - meshEffect->EndBuildFace(); - } - - fclose(file); - } -} - -void ndUrdfFile::ImportVisual(const nd::TiXmlNode* const linkNode, ndBodyDynamic* const body) -{ - ndMeshEffect* meshEffect = new ndMeshEffect; - for (ndInt32 i = 0; i < ndInt32(m_materials.GetCount()); ++i) - { - ndMeshEffect::ndMaterial meshMaterial; - meshMaterial.m_diffuse = m_materials[i].m_color; - //meshMaterial.m_ambient = materials[i].m_color; - //strcpy(meshMaterial.m_textureName, "wood_0.png"); - snprintf(meshMaterial.m_textureName, sizeof (meshMaterial.m_textureName), "%s", m_materials[i].m_texture); - meshEffect->GetMaterials().PushBack(meshMaterial); - } - - auto AddMeshShape = [this, meshEffect](const nd::TiXmlNode* const node) - { - const nd::TiXmlNode* const geometryNode = node->FirstChild("geometry"); - const nd::TiXmlElement* const shapeNode = (nd::TiXmlElement*)geometryNode->FirstChild(); - const char* const name = shapeNode->Value(); - - ndShape* shape = nullptr; - ndMatrix localMatrix(ndGetIdentityMatrix()); - if (strcmp(name, "sphere") == 0) - { - ndFloat64 radius; - shapeNode->Attribute("radius", &radius); - shape = new ndShapeSphere(ndFloat32(radius)); - } - else if (strcmp(name, "cylinder") == 0) - { - ndFloat64 length; - ndFloat64 radius; - shapeNode->Attribute("length", &length); - shapeNode->Attribute("radius", &radius); - - nd::TiXmlElement* const newtonExt = (nd::TiXmlElement*)geometryNode->FirstChild("newton"); - ndInt32 cylinderKind = 0; - if (newtonExt) - { - const char* const surrogateShape = newtonExt->Attribute("replaceWith"); - if (strcmp(surrogateShape, "capsule") == 0) - { - cylinderKind = 1; - } - else if (strcmp(surrogateShape, "wheel") == 0) - { - cylinderKind = 2; - } - } - - //shape = new ndShapeCylinder(ndFloat32(radius), ndFloat32(radius), ndFloat32(length)); - switch (cylinderKind) - { - case 0: - shape = new ndShapeCylinder(ndFloat32(radius), ndFloat32(radius), ndFloat32(length)); - break; - case 1: - length = length - 2.0f * radius; - shape = new ndShapeCapsule(ndFloat32(radius), ndFloat32(radius), ndFloat32(length)); - break; - default: - ndAssert(0); - shape = new ndShapeCylinder(ndFloat32(radius), ndFloat32(radius), ndFloat32(length)); - } - localMatrix = ndYawMatrix(ndPi * ndFloat32(0.5f)); - } - else if (strcmp(name, "box") == 0) - { - ndReal x; - ndReal y; - ndReal z; - ndInt32 ret = 0; - const char* const size = shapeNode->Attribute("size"); - ret = sscanf(size, "%f %f %f", &x, &y, &z); - shape = new ndShapeBox(x, y, z); - } - else - { - const char* const meshPathName = shapeNode->Attribute("filename"); - ImportStlMesh(meshPathName, meshEffect); - ndMatrix matrix(ImportOrigin(node)); - meshEffect->ApplyTransform(localMatrix * matrix); - } - - if (shape) - { - ndShapeInstance collision(shape); - ndMatrix matrix(ImportOrigin(node)); - collision.SetLocalMatrix(localMatrix * matrix); - - class PolygonizeMesh : public ndShapeDebugNotify - { - public: - PolygonizeMesh(ndMeshEffect* const meshEffect, ndInt32 materialIndex) - :ndShapeDebugNotify() - ,m_meshEffect(meshEffect) - ,m_materialIndex(materialIndex) - { - } - - void DrawPolygon(ndInt32 vertexCount, const ndVector* const faceArray, const ndEdgeType* const) - { - ndVector normal(ndVector::m_zero); - for (ndInt32 i = 2; i < vertexCount; ++i) - { - ndVector e0(faceArray[i - 1] - faceArray[0]); - ndVector e1(faceArray[i - 0] - faceArray[0]); - normal += e0.CrossProduct(e1); - } - normal = normal & ndVector::m_triplexMask; - normal = normal.Normalize(); - - m_meshEffect->BeginBuildFace(); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - m_meshEffect->AddMaterial(m_materialIndex); - m_meshEffect->AddPoint(faceArray[i].m_x, faceArray[i].m_y, faceArray[i].m_z); - m_meshEffect->AddNormal(normal.m_x, normal.m_y, normal.m_z); - m_meshEffect->AddUV0(0.0f, 0.0f); - } - m_meshEffect->EndBuildFace(); - } - - ndMeshEffect* m_meshEffect; - ndInt32 m_materialIndex; - }; - - ndInt32 materialIndex = 0; - const nd::TiXmlElement* const materialNode = (nd::TiXmlElement*)node->FirstChild("material"); - if (materialNode) - { - const char* const materialName = materialNode->Attribute("name"); - const ndTree::ndNode* const materialNameNode = m_materialMap.Find(materialName); - materialIndex = materialNameNode->GetInfo(); - } - - PolygonizeMesh polygonize(meshEffect, materialIndex); - collision.DebugShape(ndGetIdentityMatrix(), polygonize); - } - }; - - meshEffect->BeginBuild(); - ndInt32 count = 0; - for (const nd::TiXmlNode* node = linkNode->FirstChild("visual"); node; node = node->NextSibling("visual")) - { - count++; - AddMeshShape(node); - } - meshEffect->EndBuild(); - - if (count == 1) - { - const nd::TiXmlNode* node = linkNode->FirstChild("visual"); - const nd::TiXmlNode* const geometryNode = node->FirstChild("geometry"); - const nd::TiXmlElement* const shapeNode = (nd::TiXmlElement*)geometryNode->FirstChild(); - const char* const name = shapeNode->Value(); - - ndInt32 materialIndex = 0; - const nd::TiXmlElement* const materialNode = (nd::TiXmlElement*)node->FirstChild("material"); - if (materialNode) - { - const char* const materialName = materialNode->Attribute("name"); - const ndTree::ndNode* const materialNameNode = m_materialMap.Find(materialName); - materialIndex = materialNameNode->GetInfo(); - } - - ndMatrix uvMatrix(ndGetIdentityMatrix()); - if (strcmp(name, "sphere") == 0) - { - ndMatrix flipMatrix(ndGetIdentityMatrix()); - flipMatrix[0][0] = ndFloat32(-1.0f); - ndMatrix aligmentUV(flipMatrix * uvMatrix); - meshEffect->SphericalMapping(materialIndex, aligmentUV); - } - else if (strcmp(name, "cylinder") == 0) - { - ndMatrix flipMatrix(ndGetIdentityMatrix()); - flipMatrix[0][0] = ndFloat32(-1.0f); - ndMatrix aligmentUV(flipMatrix * uvMatrix); - meshEffect->SphericalMapping(materialIndex, aligmentUV); - //meshEffect->BoxMapping(materialIndex, materialIndex, materialIndex, aligmentUV); - } - else if (strcmp(name, "box") == 0) - { - meshEffect->BoxMapping(materialIndex, materialIndex, materialIndex, uvMatrix); - } - } - - body->SetNotifyCallback(new ndUrdfBodyNotify(meshEffect)); -} - -void ndUrdfFile::ImportCollision(const nd::TiXmlNode* const linkNode, ndBodyDynamic* const body) -{ - ndArray collisions; - for (const nd::TiXmlNode* node = linkNode->FirstChild("collision"); node; node = node->NextSibling("collision")) - { - collisions.PushBack(node); - } - - ndShapeInstance collision(new ndShapeNull()); - auto GetCollisionShape = [this, &collision](const nd::TiXmlNode* const node) - { - const nd::TiXmlNode* const geometryNode = node->FirstChild("geometry"); - const nd::TiXmlElement* const shapeNode = (nd::TiXmlElement*)geometryNode->FirstChild(); - const char* const name = shapeNode->Value(); - - ndShape* shape = nullptr; - - if (strcmp(name, "sphere") == 0) - { - ndFloat64 radius; - shapeNode->Attribute("radius", &radius); - shape = new ndShapeSphere(ndFloat32(radius)); - } - else if (strcmp(name, "cylinder") == 0) - { - ndFloat64 length; - ndFloat64 radius; - shapeNode->Attribute("length", &length); - shapeNode->Attribute("radius", &radius); - - nd::TiXmlElement* const newtonExt = (nd::TiXmlElement*)geometryNode->FirstChild("newton"); - ndInt32 cylinderKind = 0; - if (newtonExt) - { - const char* const surrogateShape = newtonExt->Attribute("replaceWith"); - if (strcmp(surrogateShape, "capsule") == 0) - { - cylinderKind = 1; - } - else if (strcmp(surrogateShape, "wheel") == 0) - { - cylinderKind = 2; - } - } - - switch (cylinderKind) - { - case 0: - shape = new ndShapeCylinder(ndFloat32(radius), ndFloat32(radius), ndFloat32(length)); - break; - case 1: - length = length - 2.0f * radius; - shape = new ndShapeCapsule(ndFloat32(radius), ndFloat32(radius), ndFloat32(length)); - break; - default: - ndAssert(0); - shape = new ndShapeCylinder(ndFloat32(radius), ndFloat32(radius), ndFloat32(length)); - } - ndMatrix matrix(ndYawMatrix(ndPi * ndFloat32(0.5f))); - collision.SetLocalMatrix(matrix); - } - else if (strcmp(name, "box") == 0) - { - ndReal x; - ndReal y; - ndReal z; - ndInt32 ret = 0; - const char* const size = shapeNode->Attribute("size"); - ret = sscanf(size, "%f %f %f", &x, &y, &z); - shape = new ndShapeBox(x, y, z); - } - else - { - const char* const meshPathName = shapeNode->Attribute("filename"); - - ndMeshEffect meshEffect; - meshEffect.BeginBuild(); - ImportStlMesh(meshPathName, &meshEffect); - meshEffect.EndBuild(); - - ndArray hull; - ndInt32 vertexCount = meshEffect.GetVertexCount(); - ndInt32 stride = meshEffect.GetVertexStrideInByte(); - const char* vertexPoolBytes = (char*)meshEffect.GetVertexPool(); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - const ndFloat64* const vertexPoolFloat = (ndFloat64*)vertexPoolBytes; - ndVector point(vertexPoolFloat[0], vertexPoolFloat[1], vertexPoolFloat[2], ndFloat64(0.0f)); - hull.PushBack(point); - vertexPoolBytes += stride; - } - - shape = new ndShapeConvexHull(vertexCount, ndInt32(sizeof(ndVector)), 1.0e-6f, &hull[0].m_x, 64); - } - return shape; - }; - - if (collisions.GetCount() == 1) - { - const nd::TiXmlNode* const node = collisions[0]; - collision.SetShape(GetCollisionShape(node)); - ndMatrix matrix(ImportOrigin(node)); - collision.SetLocalMatrix(collision.GetLocalMatrix() * matrix); - } - else - { - ndAssert(0); - } - - body->SetCollisionShape(collision); -} - -void ndUrdfFile::ImportInertia(const nd::TiXmlNode* const linkNode, ndBodyDynamic* const body) -{ - const nd::TiXmlNode* const inertialNode = linkNode->FirstChild("inertial"); - const nd::TiXmlElement* const massNode = (nd::TiXmlElement*)inertialNode->FirstChild("mass"); - const nd::TiXmlElement* const inertiaNode = (nd::TiXmlElement*)inertialNode->FirstChild("inertia"); - - ndFloat64 xx; - ndFloat64 xy; - ndFloat64 xz; - ndFloat64 yy; - ndFloat64 yz; - ndFloat64 zz; - ndFloat64 mass; - - massNode->Attribute("value", &mass); - inertiaNode->Attribute("ixx", &xx); - inertiaNode->Attribute("ixy", &xy); - inertiaNode->Attribute("ixz", &xz); - inertiaNode->Attribute("iyy", &yy); - inertiaNode->Attribute("iyz", &yz); - inertiaNode->Attribute("izz", &zz); - - ndMatrix inertiaMatrix(ndGetIdentityMatrix()); - inertiaMatrix[0][0] = ndFloat32(xx); - inertiaMatrix[1][1] = ndFloat32(yy); - inertiaMatrix[2][2] = ndFloat32(zz); - - inertiaMatrix[0][1] = ndFloat32(xy); - inertiaMatrix[1][0] = ndFloat32(xy); - - inertiaMatrix[0][2] = ndFloat32(xz); - inertiaMatrix[2][0] = ndFloat32(xz); - - inertiaMatrix[1][2] = ndFloat32(yz); - inertiaMatrix[2][1] = ndFloat32(yz); - - body->SetMassMatrix(ndFloat32(mass), body->GetCollisionShape()); -} - -ndBodyDynamic* ndUrdfFile::ImportLink(const nd::TiXmlNode* const linkNode) -{ - ndBodyDynamic* const body = new ndBodyDynamic(); - - ImportVisual(linkNode, body); - ImportCollision(linkNode, body); - ImportInertia(linkNode, body); - return body; -} - -ndJointBilateralConstraint* ndUrdfFile::ImportJoint(const nd::TiXmlNode* const jointNode, ndBodyDynamic* const childBody, ndBodyDynamic* const parentBody) -{ - ndJointBilateralConstraint* joint = nullptr; - ndMatrix childMatrix(ImportOrigin(jointNode)); - childBody->SetMatrix(childMatrix * parentBody->GetMatrix()); - ndMatrix pivotMatrix(childBody->GetMatrix()); - - const char* const jointType = ((nd::TiXmlElement*)jointNode)->Attribute("type"); - if (strcmp(jointType, "fixed") == 0) - { - joint = new ndJointFix6dof(pivotMatrix, childBody, parentBody); - } - else if (strcmp(jointType, "continuous") == 0) - { - const nd::TiXmlElement* const axisNode = (nd::TiXmlElement*)jointNode->FirstChild("axis"); - if (axisNode) - { - ndReal x = ndFloat32(0.0f); - ndReal y = ndFloat32(0.0f); - ndReal z = ndFloat32(0.0f); - const char* const axisPin = axisNode->Attribute("xyz"); - ndInt32 ret = 0; - ret = sscanf(axisPin, "%f %f %f", &x, &y, &z); - - ndMatrix matrix(ndGramSchmidtMatrix(ndVector(x, y, z, ndFloat32(0.0f)))); - pivotMatrix = matrix * pivotMatrix; - } - joint = new ndJointHinge(pivotMatrix, childBody, parentBody); - const nd::TiXmlElement* const newtonEx = (nd::TiXmlElement*)jointNode->FirstChild("newton"); - if (newtonEx) - { - ndInt32 ret = 0; - ndReal springPD; - ndReal damperPD; - ndReal regularizerPD; - - const char* const spring = newtonEx->Attribute("springPD"); - const char* const damper = newtonEx->Attribute("damperPD"); - const char* const regularizer = newtonEx->Attribute("regularizer"); - ret = sscanf(spring, "%f", &springPD); - ret = sscanf(damper, "%f", &damperPD); - ret = sscanf(regularizer, "%f", ®ularizerPD); - - ndJointHinge* const hinge = (ndJointHinge*)joint; - hinge->SetAsSpringDamper(regularizerPD, springPD, damperPD); - } - } - else if (strcmp(jointType, "prismatic") == 0) - { - const nd::TiXmlElement* const axisNode = (nd::TiXmlElement*)jointNode->FirstChild("axis"); - if (axisNode) - { - ndReal x = ndFloat32(0.0f); - ndReal y = ndFloat32(0.0f); - ndReal z = ndFloat32(0.0f); - const char* const axisPin = axisNode->Attribute("xyz"); - ndInt32 ret = 0; - ret = sscanf(axisPin, "%f %f %f", &x, &y, &z); - - ndMatrix matrix(ndGramSchmidtMatrix(ndVector(x, y, z, ndFloat32(0.0f)))); - pivotMatrix = matrix * pivotMatrix; - } - joint = new ndJointSlider(pivotMatrix, childBody, parentBody); - - const nd::TiXmlElement* const limit = (nd::TiXmlElement*)jointNode->FirstChild("limit"); - if (limit) - { - ndFloat64 effort = 0.0f; - ndFloat64 lower = 0.0f; - ndFloat64 upper = 0.0f; - limit->Attribute("effort", &effort); - limit->Attribute("lower", &lower); - limit->Attribute("upper", &upper); - - ndJointSlider* const slider = (ndJointSlider*)joint; - slider->SetLimits(ndFloat32(lower), ndFloat32(upper)); - slider->SetLimitState(true); - } - } - else if (strcmp(jointType, "revolute") == 0) - { - const nd::TiXmlElement* const axisNode = (nd::TiXmlElement*)jointNode->FirstChild("axis"); - if (axisNode) - { - ndReal x = ndFloat32(0.0f); - ndReal y = ndFloat32(0.0f); - ndReal z = ndFloat32(0.0f); - const char* const axisPin = axisNode->Attribute("xyz"); - ndInt32 ret = 0; - ret = sscanf(axisPin, "%f %f %f", &x, &y, &z); - - ndMatrix matrix(ndGramSchmidtMatrix(ndVector(x, y, z, ndFloat32(0.0f)))); - pivotMatrix = matrix * pivotMatrix; - } - - const nd::TiXmlElement* const newtonEx = (nd::TiXmlElement*)jointNode->FirstChild("newton"); - if (newtonEx) - { - const char* const subJointType = newtonEx->Attribute("replaceWith"); - if (strcmp(subJointType, "ndIkJointHinge") == 0) - { - joint = new ndIkJointHinge(pivotMatrix, childBody, parentBody); - } - else - { - joint = new ndJointHinge(pivotMatrix, childBody, parentBody); - } - } - - const nd::TiXmlElement* const limit = (nd::TiXmlElement*)jointNode->FirstChild("limit"); - if (limit) - { - ndFloat64 effort = 0.0f; - ndFloat64 lower = 0.0f; - ndFloat64 upper = 0.0f; - limit->Attribute("effort", &effort); - limit->Attribute("lower", &lower); - limit->Attribute("upper", &upper); - - ndJointHinge* const hinge = (ndJointHinge*)joint; - hinge->SetLimits(ndFloat32(lower), ndFloat32(upper)); - hinge->SetLimitState(true); - } - - //const nd::TiXmlElement* const newtonEx = (nd::TiXmlElement*)jointNode->FirstChild("newton"); - if (newtonEx) - { - ndInt32 ret = 0; - const char* const spring = newtonEx->Attribute("springPD"); - const char* const damper = newtonEx->Attribute("damperPD"); - const char* const regularizer = newtonEx->Attribute("regularizer"); - if (regularizer || damper || spring) - { - ndReal springPD = 0.0f; - ndReal damperPD = 0.0f; - ndReal regularizerPD = 0.0f; - if (spring) - { - ret = sscanf(spring, "%f", &springPD); - } - if (damperPD) - { - ret = sscanf(damper, "%f", &damperPD); - } - if (regularizerPD) - { - ret = sscanf(regularizer, "%f", ®ularizerPD); - } - ndJointHinge* const hinge = (ndJointHinge*)joint; - hinge->SetAsSpringDamper(regularizerPD, springPD, damperPD); - } - } - } - else if (strcmp(jointType, "floating") == 0) - { - const nd::TiXmlElement* const newtonEx = (nd::TiXmlElement*)jointNode->FirstChild("newton"); - if (newtonEx) - { - const char* const subJointType = newtonEx->Attribute("replaceWith"); - if (strcmp(subJointType, "ndIkJointSpherical") == 0) - { - joint = new ndIkJointSpherical(pivotMatrix, childBody, parentBody); - } - else - { - ndAssert(0); - } - } - else - { - ndAssert(0); - } - - } - else - { - ndTrace(("FIX ME urdf load jointType %s\n", jointType)); - } - - return joint; -} - -//void ndUrdfFile::ApplyCoordinadeRotation(ndModelArticulation* const model, const ndMatrix& rotation) -//{ -// //const ndMatrix rotation(ndPitchMatrix(-ndPi * 0.5f)); -// const ndMatrix rotationInv(rotation.OrthoInverse()); -// -// ndArray jointsGlobalMatrix; -// ndArray joints; -// ndFixSizeArray stack; -// -// stack.PushBack(model->GetRoot()); -// while (stack.GetCount()) -// { -// ndModelArticulation::ndNode* node = stack.Pop(); -// ndJointBilateralConstraint* const joint = *node->m_joint; -// if (joint) -// { -// ndMatrix pivotMatrix0; -// ndMatrix pivotMatrix1; -// joint->CalculateGlobalMatrix(pivotMatrix0, pivotMatrix1); -// -// ndAssert((pivotMatrix0 * pivotMatrix1.OrthoInverse()).TestIdentity()); -// joints.PushBack(joint); -// jointsGlobalMatrix.PushBack(pivotMatrix0 * rotation); -// } -// -// for (ndModelArticulation::ndNode* child = node->GetFirstChild(); child; child = child->GetNext()) -// { -// stack.PushBack(child); -// } -// } -// -// // rotate bodies. -// stack.PushBack(model->GetRoot()); -// while (stack.GetCount()) -// { -// ndModelArticulation::ndNode* node = stack.Pop(); -// ndBodyKinematic* const body = node->m_body->GetAsBodyKinematic(); -// ndShapeInstance& shape = body->GetCollisionShape(); -// -// const ndMatrix bodyMatrix(body->GetMatrix() * rotation); -// const ndMatrix shapeMatrix(shape.GetLocalMatrix() * bodyMatrix); -// -// body->SetCentreOfMass(rotation.RotateVector(body->GetCentreOfMass())); -// body->SetMatrix(rotationInv * bodyMatrix); -// shape.SetLocalMatrix(shapeMatrix * body->GetMatrix().OrthoInverse()); -// -// ndUrdfBodyNotify* const notify = (ndUrdfBodyNotify*)body->GetNotifyCallback(); -// notify->m_mesh->ApplyTransform(rotation); -// -// for (ndModelArticulation::ndNode* child = node->GetFirstChild(); child; child = child->GetNext()) -// { -// stack.PushBack(child); -// } -// } -// -// // rotate joints. -// for (ndInt32 i = 0; i < joints.GetCount(); ++i) -// { -// ndBodyKinematic* const body0 = joints[i]->GetBody0(); -// ndBodyKinematic* const body1 = joints[i]->GetBody1(); -// ndMatrix localMatrix0(jointsGlobalMatrix[i] * body0->GetMatrix().OrthoInverse()); -// ndMatrix localMatrix1(jointsGlobalMatrix[i] * body1->GetMatrix().OrthoInverse()); -// joints[i]->SetLocalMatrix0(localMatrix0); -// joints[i]->SetLocalMatrix1(localMatrix1); -// } -//} - -// ******************************************************************************* -// -// ******************************************************************************* -ndModelArticulation* ndUrdfFile::Import(const char* const filePathName) -{ - ndAssert(strstr(filePathName, ".urdf")); - - m_path = filePathName; - const char* ptr = strrchr(filePathName, '/'); - if (!ptr) - { - ptr = strrchr(filePathName, '\\'); - } - m_path = m_path.SubString(0, ndInt32(ptr - filePathName)); - - ndString oldloc = setlocale(LC_ALL, 0); - setlocale(LC_ALL, "C"); - - nd::TiXmlDocument doc(filePathName); - doc.LoadFile(); - if (doc.Error()) - { - setlocale(LC_ALL, oldloc.GetStr()); - return nullptr; - } - - m_materials.SetCount(0); - m_bodyLinks.RemoveAll(); - m_materialMap.RemoveAll(); - - const nd::TiXmlElement* const rootNode = doc.RootElement(); - - for (const nd::TiXmlNode* node = rootNode->FirstChild("link"); node; node = node->NextSibling("link")) - { - const nd::TiXmlElement* const linkNode = (nd::TiXmlElement*)node; - const char* const name = linkNode->Attribute("name"); - m_bodyLinks.Insert(Hierarchy(node), name); - } - - for (const nd::TiXmlNode* node = rootNode->FirstChild("joint"); node; node = node->NextSibling("joint")) - { - const nd::TiXmlElement* const jointNode = (nd::TiXmlElement*)node; - const nd::TiXmlElement* const childNode = (nd::TiXmlElement*)jointNode->FirstChild("child"); - const nd::TiXmlElement* const parentNode = (nd::TiXmlElement*)jointNode->FirstChild("parent"); - - const char* const childName = childNode->Attribute("link"); - const char* const parentName = parentNode->Attribute("link"); - - ndTree::ndNode* const hierarchyChildNode = m_bodyLinks.Find(childName); - ndTree::ndNode* const hierarchyParentNode = m_bodyLinks.Find(parentName); - - Hierarchy& hierachyChild = hierarchyChildNode->GetInfo(); - Hierarchy& hierachyParent = hierarchyParentNode->GetInfo(); - - hierachyChild.m_joint = node; - hierachyChild.m_parent = &hierachyParent; - hierachyChild.m_parentLink = hierachyParent.m_link; - } - - Hierarchy* root = nullptr; - ndTree::Iterator iter(m_bodyLinks); - for (iter.Begin(); iter; iter++) - { - Hierarchy& link = iter.GetNode()->GetInfo(); - if (link.m_parentLink == nullptr) - { - root = &link; - break; - } - } - - ImportMaterials(rootNode); - ndBodyDynamic* const rootBody = ImportLink(root->m_link); - - ndModelArticulation* const model = new ndModelArticulation; - root->m_articulation = model->AddRootBody(rootBody); - root->m_articulation->m_name = ((nd::TiXmlElement*)root->m_link)->Attribute("name"); - - ndFixSizeArray stack; - stack.PushBack(root); - - while (stack.GetCount()) - { - Hierarchy* const parent = stack.Pop(); - - if (parent->m_parentLink) - { - ndBodyDynamic* const childBody = ImportLink(parent->m_link); - ndJointBilateralConstraint* const joint = ImportJoint(parent->m_joint, childBody, parent->m_parentArticulation->m_body->GetAsBodyDynamic()); - parent->m_articulation = model->AddLimb(parent->m_parentArticulation, joint->GetBody0(), joint); - parent->m_articulation->m_name = ((nd::TiXmlElement*)parent->m_link)->Attribute("name"); - } - - for (iter.Begin(); iter; iter++) - { - Hierarchy& link = iter.GetNode()->GetInfo(); - if (link.m_parentLink == parent->m_link) - { - link.m_parentArticulation = parent->m_articulation; - stack.PushBack(&link); - } - } - } - - model->SetTransform(ndPitchMatrix(-ndPi * 0.5f)); - model->ConvertToUrdf(); - - setlocale(LC_ALL, oldloc.GetStr()); - return model; -} - -// ******************************************************************************* -// -// ******************************************************************************* -void ndUrdfFile::Export(const char* const filePathName, ndModelArticulation* const model) -{ - ndAssert(strstr(filePathName, ".urdf")); - - nd::TiXmlDocument* const doc = new nd::TiXmlDocument(""); - nd::TiXmlDeclaration* const decl = new nd::TiXmlDeclaration("1.0", "", ""); - doc->LinkEndChild(decl); - ndString oldloc(setlocale(LC_ALL, 0)); - - nd::TiXmlElement* const rootNode = new nd::TiXmlElement("robot"); - doc->LinkEndChild(rootNode); - - ExportMakeNamesUnique(model); - rootNode->SetAttribute("name", model->GetName().GetStr()); - - const ndMatrix modelMatrix(model->GetRoot()->m_body->GetMatrix()); - model->SetTransform(ndPitchMatrix(ndPi * 0.5f)); - model->ConvertToUrdf(); - - Surrogate* const surrogate = ExportMakeSurrogate(model); - ndAssert(surrogate); - - ExportMaterials(rootNode, surrogate); - - ndFixSizeArray stack; - stack.PushBack(surrogate); - - while (stack.GetCount()) - { - const Surrogate* const node = stack.Pop(); - ExportLink(rootNode, node); - if (node->GetParent()) - { - ExportJoint(rootNode, node); - } - - for (Surrogate* child = node->GetFirstChild(); child; child = child->GetNext()) - { - stack.PushBack(child); - } - } - - model->SetTransform(modelMatrix); - - delete surrogate; - doc->SaveFile(filePathName); - setlocale(LC_ALL, oldloc.GetStr()); - delete doc; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndUrdfFile.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndUrdfFile.h deleted file mode 100644 index eb3b221284..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/dModels/ndUrdfFile.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely -*/ - -#ifndef _ND_URDF_FILE_H_ -#define _ND_URDF_FILE_H_ - -#include "ndModelArticulation.h" - -class ndUrdfBodyNotify : public ndBodyNotify -{ - public: - ndUrdfBodyNotify(ndMeshEffect* const mesh) - :ndBodyNotify(ndVector::m_zero) - ,m_offset(ndGetIdentityMatrix()) - ,m_mesh(mesh) - { - } - - ndUrdfBodyNotify(const ndUrdfBodyNotify& src) - :ndBodyNotify(src) - ,m_offset(src.m_offset) - ,m_mesh(src.m_mesh) - { - } - - ndBodyNotify* Clone() const - { - return new ndUrdfBodyNotify(*this); - } - - ndUrdfBodyNotify* GetAsUrdfBodyNotify() - { - return this; - } - - ndMatrix m_offset; - ndSharedPtr m_mesh; -}; - -class ndUrdfFile : public ndClassAlloc -{ - class Material - { - public: - Material() - :m_color(1.0f, 1.0f, 1.0f, 1.0f) - { - m_texture[0] = 0; - } - ndVector m_color; - char m_texture[256]; - }; - - public: - D_NEWTON_API ndUrdfFile(); - D_NEWTON_API virtual ~ndUrdfFile(); - - D_NEWTON_API virtual ndModelArticulation* Import(const char* const fileName); - D_NEWTON_API virtual void Export(const char* const fileName, ndModelArticulation* const model); - - private: - class Hierarchy - { - public: - Hierarchy(const nd::TiXmlNode* const link) - :m_parent(nullptr) - ,m_link(link) - ,m_joint(link) - ,m_parentLink(nullptr) - ,m_articulation(nullptr) - ,m_parentArticulation(nullptr) - { - } - - Hierarchy* m_parent; - const nd::TiXmlNode* m_link; - const nd::TiXmlNode* m_joint; - const nd::TiXmlNode* m_parentLink; - ndModelArticulation::ndNode* m_articulation; - ndModelArticulation::ndNode* m_parentArticulation; - }; - - class Surrogate: public ndNodeHierarchy - { - public: - ndVector m_com; - ndMatrix m_bodyMatrix; - ndMatrix m_shapeLocalMatrix; - ndMatrix m_bodyInertia; - ndMatrix m_jointLocalMatrix0; - ndMatrix m_jointLocalMatrix1; - ndModelArticulation::ndNode* m_articulation; - }; - - void ExportMakeNamesUnique(ndModelArticulation* const model); - Surrogate* ExportMakeSurrogate(ndModelArticulation* const model); - void ExportCollectTransforms(Surrogate* const surrogateRoot); - void ExportOrigin(nd::TiXmlElement* const linkNode, const ndMatrix& pose); - void ExportLink(nd::TiXmlElement* const rootNode, const Surrogate* const link); - void ExportJoint(nd::TiXmlElement* const rootNode, const Surrogate* const link); - void ExportVisual(nd::TiXmlElement* const linkNode, const Surrogate* const link); - void ExportInertia(nd::TiXmlElement* const linkNode, const Surrogate* const link); - void ExportMaterials(nd::TiXmlElement* const rootNode, const Surrogate* const link); - void ExportCollision(nd::TiXmlElement* const linkNode, const Surrogate* const link); - - void ImportMaterials(const nd::TiXmlNode* const rootNode); - ndBodyDynamic* ImportLink(const nd::TiXmlNode* const linkNode); - ndMatrix ImportOrigin(const nd::TiXmlNode* const parentNode) const; - void ImportVisual(const nd::TiXmlNode* const linkNode, ndBodyDynamic* const body); - void ImportInertia(const nd::TiXmlNode* const linkNode, ndBodyDynamic* const body); - void ImportCollision(const nd::TiXmlNode* const linkNode, ndBodyDynamic* const body); - void ImportStlMesh(const char* const pathName, ndMeshEffect* const meshEffect) const; - ndJointBilateralConstraint* ImportJoint(const nd::TiXmlNode* const jointNode, ndBodyDynamic* const child, ndBodyDynamic* const parent); - - ndString m_path; - ndArray m_materials; - ndTree m_bodyLinks; - ndTree m_materialMap; -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndBodyDynamic.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndBodyDynamic.cpp deleted file mode 100644 index 60435ab560..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndBodyDynamic.cpp +++ /dev/null @@ -1,439 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndBodyDynamic.h" - -ndVector ndBodyDynamic::m_sleepAccelTestScale2(ndFloat32 (0.0625f)); - -ndBodyDynamic::ndBodyDynamic() - :ndBodyKinematic() - ,m_externalForce(ndVector::m_zero) - ,m_externalTorque(ndVector::m_zero) - ,m_impulseForce(ndVector::m_zero) - ,m_impulseTorque(ndVector::m_zero) - ,m_savedExternalForce(ndVector::m_zero) - ,m_savedExternalTorque(ndVector::m_zero) - ,m_dampCoef(ndVector::m_zero) - ,m_cachedDampCoef(ndVector::m_one) - ,m_sleepAccelTest2(D_SOLVER_MAX_ACCEL_ERROR * D_SOLVER_MAX_ACCEL_ERROR) - ,m_cachedTimeStep(ndFloat32 (0.0f)) -{ - m_isDynamics = 1; -} - -ndBodyDynamic::ndBodyDynamic(const ndBodyDynamic& src) - :ndBodyKinematic(src) -{ - m_isDynamics = 1; -} - -ndBodyDynamic::~ndBodyDynamic() -{ -} - -void ndBodyDynamic::SetForce(const ndVector& force) -{ - m_externalForce = force & ndVector::m_triplexMask; - if (m_invMass.m_w == ndFloat32(0.0f)) - { - m_externalForce = ndVector::m_zero; - } - - if (m_equilibrium) - { - ndVector deltaAccel((m_externalForce - m_savedExternalForce).Scale(m_invMass.m_w)); - ndAssert(deltaAccel.m_w == ndFloat32(0.0f)); - ndFloat32 deltaAccel2 = deltaAccel.DotProduct(deltaAccel).GetScalar(); - m_equilibrium = ndUnsigned8(deltaAccel2 < D_ERR_TOLERANCE2); - } -} - -void ndBodyDynamic::SetTorque(const ndVector& torque) -{ - m_externalTorque = torque & ndVector::m_triplexMask; - if (m_invMass.m_w == ndFloat32(0.0f)) - { - m_externalTorque = ndVector::m_zero; - } - - if (m_equilibrium) - { - ndVector deltaAlpha(m_matrix.UnrotateVector(m_externalTorque - m_savedExternalTorque) * m_invMass); - ndAssert(deltaAlpha.m_w == ndFloat32(0.0f)); - ndFloat32 deltaAlpha2 = deltaAlpha.DotProduct(deltaAlpha).GetScalar(); - m_equilibrium = ndUnsigned8(deltaAlpha2 < D_ERR_TOLERANCE2); - } -} - -void ndBodyDynamic::ApplyExternalForces(ndInt32 threadIndex, ndFloat32 timestep) -{ - m_externalForce = ndVector::m_zero; - m_externalTorque = ndVector::m_zero; - if (m_notifyCallback) - { - m_notifyCallback->OnApplyExternalForce(threadIndex, timestep); - ndAssert(m_externalForce.m_w == ndFloat32(0.0f)); - ndAssert(m_externalTorque.m_w == ndFloat32(0.0f)); - } - - m_externalForce += m_impulseForce; - m_externalTorque += m_impulseTorque; - m_impulseForce = ndVector::m_zero; - m_impulseTorque = ndVector::m_zero; -} - -void ndBodyDynamic::AddImpulse(const ndVector& pointDeltaVeloc, const ndVector& pointPosit, ndFloat32 timestep) -{ - ndMatrix invInertia(CalculateInvInertiaMatrix()); - - // get contact matrix - ndMatrix tmp; - ndVector globalContact(pointPosit - m_globalCentreOfMass); - - tmp[0][0] = ndFloat32(0.0f); - tmp[0][1] = +globalContact[2]; - tmp[0][2] = -globalContact[1]; - tmp[0][3] = ndFloat32(0.0f); - - tmp[1][0] = -globalContact[2]; - tmp[1][1] = ndFloat32(0.0f); - tmp[1][2] = +globalContact[0]; - tmp[1][3] = ndFloat32(0.0f); - - tmp[2][0] = +globalContact[1]; - tmp[2][1] = -globalContact[0]; - tmp[2][2] = ndFloat32(0.0f); - tmp[2][3] = ndFloat32(0.0f); - - tmp[3][0] = ndFloat32(0.0f); - tmp[3][1] = ndFloat32(0.0f); - tmp[3][2] = ndFloat32(0.0f); - tmp[3][3] = ndFloat32(1.0f); - - ndMatrix contactMatrix(tmp * invInertia * tmp); - //for (ndInt32 i = 0; i < 3; ++i) - //{ - // for (ndInt32 j = 0; j < 3; ++j) - // { - // contactMatrix[i][j] *= -ndFloat32(1.0f); - // } - //} - contactMatrix[0] = contactMatrix[0] * ndVector::m_negOne; - contactMatrix[1] = contactMatrix[1] * ndVector::m_negOne; - contactMatrix[2] = contactMatrix[2] * ndVector::m_negOne; - contactMatrix[0][0] += m_invMass.m_w; - contactMatrix[1][1] += m_invMass.m_w; - contactMatrix[2][2] += m_invMass.m_w; - - contactMatrix = contactMatrix.Inverse4x4(); - - // change of momentum - ndVector changeOfMomentum(contactMatrix.RotateVector(pointDeltaVeloc)); - - if (changeOfMomentum.DotProduct(changeOfMomentum).GetScalar() > ndFloat32(1.0e-6f)) - { - m_impulseForce += changeOfMomentum.Scale(1.0f / timestep); - m_impulseTorque += globalContact.CrossProduct(m_impulseForce); - - m_equilibrium = false; - //Unfreeze(); - } -} - -void ndBodyDynamic::ApplyImpulsePair(const ndVector& linearImpulseIn, const ndVector& angularImpulseIn, ndFloat32 timestep) -{ - ndVector linearImpulse(linearImpulseIn & ndVector::m_triplexMask); - ndVector angularImpulse(angularImpulseIn & ndVector::m_triplexMask); - ndAssert(linearImpulse.m_w == ndFloat32(0.0f)); - ndAssert(angularImpulse.m_w == ndFloat32(0.0f)); - if ((linearImpulse.DotProduct(linearImpulse).GetScalar() > ndFloat32(1.0e-6f)) || - (angularImpulse.DotProduct(angularImpulse).GetScalar() > ndFloat32(1.0e-6f))) - { - m_impulseForce += linearImpulse.Scale(1.0f / timestep); - m_impulseTorque += angularImpulse.Scale(1.0f / timestep); - - m_equilibrium = false; - } -} - -void ndBodyDynamic::ApplyImpulsesAtPoint(ndInt32 count, const ndVector* const impulseArray, const ndVector* const pointArray, ndFloat32 timestep) -{ - ndVector impulse(ndVector::m_zero); - ndVector angularImpulse(ndVector::m_zero); - - ndVector com(m_globalCentreOfMass); - for (ndInt32 i = 0; i < count; ++i) - { - ndVector r(pointArray[i]); - ndVector L(impulseArray[i]); - ndVector Q((r - com).CrossProduct(L)); - - impulse += L; - angularImpulse += Q; - } - - impulse = impulse & ndVector::m_triplexMask; - angularImpulse = angularImpulse & ndVector::m_triplexMask; - - if ((impulse.DotProduct(impulse).GetScalar() > ndFloat32(1.0e-6f)) || - (angularImpulse.DotProduct(angularImpulse).GetScalar() > ndFloat32(1.0e-6f))) - { - m_impulseForce += impulse.Scale(1.0f / timestep); - m_impulseTorque += angularImpulse.Scale(1.0f / timestep); - - m_equilibrium = false; - } -} - -void ndBodyDynamic::SetLinearDamping(ndFloat32 linearDamp) -{ - linearDamp = ndClamp(linearDamp, ndFloat32(0.0f), ndFloat32(1.0f)); - m_dampCoef.m_w = D_MAX_SPEED_ATT * linearDamp; - m_cachedTimeStep = ndFloat32(0.0f); -} - -ndFloat32 ndBodyDynamic::GetLinearDamping() const -{ - return m_dampCoef.m_w / D_MAX_SPEED_ATT; -} - -ndVector ndBodyDynamic::GetAngularDamping() const -{ - return ndVector(m_dampCoef.m_x / D_MAX_SPEED_ATT, - m_dampCoef.m_y / D_MAX_SPEED_ATT, - m_dampCoef.m_z / D_MAX_SPEED_ATT, ndFloat32(0.0f)); -} - -void ndBodyDynamic::SetAngularDamping(const ndVector& angularDamp) -{ - ndFloat32 tmp = ndClamp(angularDamp.m_x, ndFloat32(0.0f), ndFloat32(1.0f)); - m_dampCoef.m_x = D_MAX_SPEED_ATT * tmp; - - tmp = ndClamp(angularDamp.m_y, ndFloat32(0.0f), ndFloat32(1.0f)); - m_dampCoef.m_y = D_MAX_SPEED_ATT * tmp; - - tmp = ndClamp(angularDamp.m_z, ndFloat32(0.0f), ndFloat32(1.0f)); - m_dampCoef.m_z = D_MAX_SPEED_ATT * tmp; - - m_cachedTimeStep = ndFloat32(0.0f); -} - -void ndBodyDynamic::AddDampingAcceleration(ndFloat32 timestep) -{ - if (ndAbs(m_cachedTimeStep - timestep) > ndFloat32(1.0e-6f)) - { - m_cachedTimeStep = timestep; - // assume a nominal 60 frame seconds time step. - ndFloat32 tau = ndFloat32(60.0f) * timestep; - // recalculate damping to match the time independent drag - m_cachedDampCoef.m_x = ndPow(ndFloat32(1.0f) - m_dampCoef.m_x, tau); - m_cachedDampCoef.m_y = ndPow(ndFloat32(1.0f) - m_dampCoef.m_y, tau); - m_cachedDampCoef.m_z = ndPow(ndFloat32(1.0f) - m_dampCoef.m_z, tau); - m_cachedDampCoef.m_w = ndPow(ndFloat32(1.0f) - m_dampCoef.m_w, tau); - } - - const ndVector omegaDamp(m_cachedDampCoef & ndVector::m_triplexMask); - const ndVector omega(omegaDamp * m_inertiaPrincipalAxis.UnrotateVector(m_matrix.UnrotateVector(m_omega))); - m_omega = m_matrix.RotateVector(m_inertiaPrincipalAxis.RotateVector(omega)); - m_veloc = m_veloc.Scale(m_cachedDampCoef.m_w); -} - -ndFloat32 ndBodyDynamic::GetSleepAccel() const -{ - return m_sleepAccelTest2.m_x; -} - -void ndBodyDynamic::SetSleepAccel(ndFloat32 accelMag2) -{ - m_sleepAccelTest2 = ndVector(accelMag2); -} - -void ndBodyDynamic::IntegrateVelocity(ndFloat32 timestep) -{ - ndBodyKinematic::IntegrateVelocity(timestep); - SaveExternalForces(); -} - -//#pragma optimize( "", off ) -ndJacobian ndBodyDynamic::IntegrateForceAndToque(const ndVector& force, const ndVector& torque, const ndVector& timestep) const -{ - ndJacobian velocStep; - - const ndMatrix matrix(ndCalculateMatrix(m_gyroRotation, ndVector::m_wOne)); - const ndVector localOmega(m_inertiaPrincipalAxis.UnrotateVector(matrix.UnrotateVector(m_omega))); - const ndVector localTorque(m_inertiaPrincipalAxis.UnrotateVector(matrix.UnrotateVector(torque))); - - // derivative at half time step. (similar to midpoint Euler so that it does not loses too much energy) - const ndVector dw(localOmega * timestep); - const ndMatrix jacobianMatrix( - ndVector(m_mass.m_x, (m_mass.m_z - m_mass.m_y) * dw.m_z, (m_mass.m_z - m_mass.m_y) * dw.m_y, ndFloat32(0.0f)), - ndVector((m_mass.m_x - m_mass.m_z) * dw.m_z, m_mass.m_y, (m_mass.m_x - m_mass.m_z) * dw.m_x, ndFloat32(0.0f)), - ndVector((m_mass.m_y - m_mass.m_x) * dw.m_y, (m_mass.m_y - m_mass.m_x) * dw.m_x, m_mass.m_z, ndFloat32(0.0f)), - ndVector::m_wOne); - - // and solving for alpha we get the angular acceleration at t + dt - // calculate gradient at a full time step - const ndVector gradientStep(jacobianMatrix.SolveByGaussianElimination(localTorque * timestep)); - - velocStep.m_angular = matrix.RotateVector(m_inertiaPrincipalAxis.RotateVector(gradientStep)); - velocStep.m_linear = force.Scale(m_invMass.m_w) * timestep; - -#ifdef _DEBUG - const ndFloat32 maxLinear2 = m_maxLinearStep * m_maxLinearStep; - const ndFloat32 maxAngular2 = m_maxAngleStep * m_maxAngleStep; - - const ndFloat32 linear2 = velocStep.m_linear.DotProduct(velocStep.m_linear).GetScalar() * timestep.m_x * timestep.m_x; - const ndFloat32 angular2 = velocStep.m_angular.DotProduct(velocStep.m_angular).GetScalar() * timestep.m_x * timestep.m_x; - if ((angular2 > maxAngular2) || (linear2 > maxLinear2)) - { - ndTrace(("warning IntegrateForceAndToque %d w(%f %f %f) v(%f %f %f) with very high velocity or angular velocity, may be unstable\n", - m_uniqueId, - velocStep.m_angular.m_x, velocStep.m_angular.m_y, velocStep.m_angular.m_z, - velocStep.m_linear.m_x, velocStep.m_linear.m_y, velocStep.m_linear.m_z)); - //ndAssert(0); - } -#endif - - return velocStep; -} - -void ndBodyDynamic::IntegrateGyroSubstep(const ndVector& timestep) -{ - const ndFloat32 omegaMag2 = m_omega.DotProduct(m_omega).GetScalar(); - const ndFloat32 tol = (ndFloat32(0.0125f) * ndDegreeToRad); - if (omegaMag2 > (tol * tol)) - { - const ndFloat32 omegaAngle = ndSqrt(omegaMag2); - const ndVector omegaAxis(m_omega.Scale(ndFloat32(1.0f) / omegaAngle)); - const ndQuaternion rotationStep(omegaAxis, omegaAngle * timestep.GetScalar()); - m_gyroRotation = m_gyroRotation * rotationStep; - ndAssert((m_gyroRotation.DotProduct(m_gyroRotation).GetScalar() - ndFloat32(1.0f)) < ndFloat32(1.0e-5f)); - - // calculate new Gyro torque and Gyro acceleration - const ndMatrix matrix(ndCalculateMatrix(m_gyroRotation, ndVector::m_wOne)); - - const ndVector localOmega(m_inertiaPrincipalAxis.UnrotateVector(matrix.UnrotateVector(m_omega))); - const ndVector localGyroTorque(localOmega.CrossProduct(m_mass * localOmega)); - m_gyroTorque = matrix.RotateVector(m_inertiaPrincipalAxis.RotateVector(localGyroTorque)); - m_gyroAlpha = matrix.RotateVector(m_inertiaPrincipalAxis.RotateVector(localGyroTorque * m_invMass)); - } - else - { - m_gyroAlpha = ndVector::m_zero; - m_gyroTorque = ndVector::m_zero; - } -} - -void ndBodyDynamic::EvaluateSleepState(ndFloat32 freezeSpeed2, ndFloat32 freezeAccel2) -{ - m_isJointFence0 = 1; - if (m_isStatic) - { - m_equilibrium = 1; - } - else - { - ndAssert(m_accel.m_w == ndFloat32(0.0f)); - ndAssert(m_alpha.m_w == ndFloat32(0.0f)); - ndAssert(m_veloc.m_w == ndFloat32(0.0f)); - ndAssert(m_omega.m_w == ndFloat32(0.0f)); - - ndInt32 count = ndInt32(m_weigh); - ndAssert((!m_isConstrained && !m_weigh) || (m_isConstrained && m_weigh)); - - #ifdef _DEBUG - ndInt32 checkConnection = 0; - for (ndJointList::ndNode* node = m_jointList.GetFirst(); node; node = node->GetNext()) - { - checkConnection += node->GetInfo()->IsActive() ? 1 : 0; - } - - ndContactMap::Iterator it(m_contactList); - for (it.Begin(); it; it++) - { - ndContact* const contact = it.GetNode()->GetInfo(); - if (contact->IsActive() && !contact->IsTestOnly()) - { - checkConnection++; - } - } - ndAssert(count == checkConnection); - #endif - - //const ndFloat32 acc2 = D_SOLVER_MAX_ACCEL_ERROR * D_SOLVER_MAX_ACCEL_ERROR; - //const ndFloat32 maxAccNorm2 = (count > 1) ? acc2 : acc2 * ndFloat32(0.0625f); - //const ndFloat32 maxAccNorm2 = m_autoSleep ? ((count > 1) ? acc2 : acc2 * ndFloat32(0.0625f)) : ndFloat32((1.0e-3f)); - const ndVector maxAccNorm2 ((count > 1) ? m_sleepAccelTest2 : m_sleepAccelTest2 * m_sleepAccelTestScale2); - - ndVector accelTest((m_accel.DotProduct(m_accel) > maxAccNorm2) | (m_alpha.DotProduct(m_alpha) > maxAccNorm2)); - m_accel = m_accel & accelTest; - m_alpha = m_alpha & accelTest; - - ndUnsigned8 equilibrium = ndUnsigned8(m_isStatic | m_autoSleep); - ndAssert(equilibrium == ((m_invMass.m_w == ndFloat32(0.0f)) ? 1 : m_autoSleep)); - const ndVector isMovingMask(m_veloc + m_omega + m_accel + m_alpha); - const ndVector mask(isMovingMask.TestZero()); - const ndInt32 test = mask.GetSignMask() & 7; - if (test != 7) - { - const ndFloat32 accelFreeze2 = freezeAccel2 * ((count <= 1) ? ndFloat32(0.01f) : ndFloat32(1.0f)); - const ndFloat32 accel2 = m_accel.DotProduct(m_accel).GetScalar(); - const ndFloat32 alpha2 = m_alpha.DotProduct(m_alpha).GetScalar(); - const ndFloat32 speed2 = m_veloc.DotProduct(m_veloc).GetScalar(); - const ndFloat32 omega2 = m_omega.DotProduct(m_omega).GetScalar(); - ndUnsigned32 equilibriumTest = ndUnsigned32((accel2 < accelFreeze2) && (alpha2 < accelFreeze2) && (speed2 < freezeSpeed2) && (omega2 < freezeSpeed2)); - - if (equilibriumTest) - { - const ndFloat32 velocityDragCoeff = (count <= 1) ? D_FREEZZING_VELOCITY_DRAG : ndFloat32(0.9999f); - const ndVector velocDragVect(velocityDragCoeff, velocityDragCoeff, velocityDragCoeff, ndFloat32(0.0f)); - const ndVector veloc(m_veloc * velocDragVect); - const ndVector omega(m_omega * velocDragVect); - const ndVector velocMask(veloc.DotProduct(veloc) > m_velocTol); - const ndVector omegaMask(omega.DotProduct(omega) > m_velocTol); - m_veloc = velocMask & veloc; - m_omega = omegaMask & omega; - } - equilibrium &= equilibriumTest; - } - m_isJointFence0 = equilibrium; - if (equilibrium & ~m_isConstrained) - { - m_equilibrium = equilibrium; - } - } -} - -void ndBodyDynamic::InitSurrogateBody(ndBodyKinematic* const surrogate) const -{ - ndBodyKinematic::InitSurrogateBody(surrogate); - ndBodyDynamic* const dst = ((ndBodyDynamic*)surrogate)->GetAsBodyDynamic(); - - dst->m_externalForce = m_externalForce; - dst->m_externalTorque = m_externalTorque; - dst->m_impulseForce = m_impulseForce; - dst->m_impulseTorque = m_impulseTorque; - dst->m_savedExternalForce = m_savedExternalForce; - dst->m_savedExternalTorque = m_savedExternalTorque; -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndBodyDynamic.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndBodyDynamic.h deleted file mode 100644 index 9d3b97af7c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndBodyDynamic.h +++ /dev/null @@ -1,130 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_BODY_DYNAMIC_BODY_H__ -#define __ND_BODY_DYNAMIC_BODY_H__ - -#include "ndNewtonStdafx.h" - -#define D_MAX_SPEED_ATT ndFloat32(0.02f) -#define D_FREEZE_ACCEL ndFloat32(1.0f) -#define D_FREEZE_SPEED ndFloat32(0.032f) - -#define D_FREEZE_ACCEL2 (D_FREEZE_ACCEL * D_FREEZE_ACCEL) -#define D_FREEZE_SPEED2 (D_FREEZE_SPEED * D_FREEZE_SPEED) - -#define D_FREEZE_MAG D_FREEZE_ACCEL -#define D_FREEZE_MAG2 (D_FREEZE_MAG * D_FREEZE_MAG) - -#define D_ERR_TOLERANCE ndFloat32(1.0e-2f) -#define D_ERR_TOLERANCE2 (D_ERR_TOLERANCE * D_ERR_TOLERANCE) - -D_MSV_NEWTON_ALIGN_32 -class ndBodyDynamic: public ndBodyKinematic -{ - public: - D_CLASS_REFLECTION(ndBodyDynamic, ndBodyKinematic) - D_NEWTON_API ndBodyDynamic(); - D_NEWTON_API ndBodyDynamic(const ndBodyDynamic& src); - D_NEWTON_API virtual ~ndBodyDynamic (); - - D_NEWTON_API virtual ndBodyDynamic* GetAsBodyDynamic() { return this; } - D_NEWTON_API virtual void ApplyExternalForces(ndInt32 threadIndex, ndFloat32 timestep); - D_NEWTON_API virtual void AddDampingAcceleration(ndFloat32 timestep); - D_NEWTON_API virtual void IntegrateVelocity(ndFloat32 timestep); - D_NEWTON_API virtual void InitSurrogateBody(ndBodyKinematic* const surrogate) const; - - D_NEWTON_API void SetForce(const ndVector& force); - D_NEWTON_API void SetTorque(const ndVector& torque); - - D_NEWTON_API void AddImpulse(const ndVector& pointVeloc, const ndVector& pointPosit, ndFloat32 timestep); - D_NEWTON_API void ApplyImpulsePair(const ndVector& linearImpulse, const ndVector& angularImpulse, ndFloat32 timestep); - D_NEWTON_API void ApplyImpulsesAtPoint(ndInt32 count, const ndVector* const impulseArray, const ndVector* const pointArray, ndFloat32 timestep); - - D_NEWTON_API ndFloat32 GetLinearDamping() const; - D_NEWTON_API void SetLinearDamping(ndFloat32 linearDamp); - - D_NEWTON_API ndVector GetCachedDamping() const; - D_NEWTON_API ndVector GetAngularDamping() const; - D_NEWTON_API void SetAngularDamping(const ndVector& angularDamp); - - D_NEWTON_API ndFloat32 GetSleepAccel() const; - D_NEWTON_API void SetSleepAccel(ndFloat32 accelMag2); - - virtual ndVector GetForce() const; - virtual ndVector GetTorque() const; - - private: - void SaveExternalForces(); - void SetAcceleration(const ndVector& accel, const ndVector& alpha); - D_NEWTON_API virtual void IntegrateGyroSubstep(const ndVector& timestep); - D_NEWTON_API virtual ndJacobian IntegrateForceAndToque(const ndVector& force, const ndVector& torque, const ndVector& timestep) const; - D_NEWTON_API virtual void EvaluateSleepState(ndFloat32 freezeSpeed2, ndFloat32 freezeAccel2); - - ndVector m_externalForce; - ndVector m_externalTorque; - ndVector m_impulseForce; - ndVector m_impulseTorque; - ndVector m_savedExternalForce; - ndVector m_savedExternalTorque; - ndVector m_dampCoef; - ndVector m_cachedDampCoef; - ndVector m_sleepAccelTest2; - ndFloat32 m_cachedTimeStep; - static ndVector m_sleepAccelTestScale2; - - friend class ndDynamicsUpdate; - friend class ndDynamicsUpdateSoa; - friend class ndDynamicsUpdateAvx2; - friend class ndDynamicsUpdateSycl; - friend class ndDynamicsUpdateCuda; -} D_GCC_NEWTON_ALIGN_32 ; - -inline ndVector ndBodyDynamic::GetForce() const -{ - return m_externalForce; -} - -inline ndVector ndBodyDynamic::GetTorque() const -{ - return m_externalTorque; -} - -inline void ndBodyDynamic::SaveExternalForces() -{ - m_savedExternalForce = m_externalForce; - m_savedExternalTorque = m_externalTorque; -} - -inline ndVector ndBodyDynamic::GetCachedDamping() const -{ - return m_cachedDampCoef; -} - -inline void ndBodyDynamic::SetAcceleration(const ndVector& accel, const ndVector& alpha) -{ - m_accel = accel; - m_alpha = alpha; -} - -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdate.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdate.cpp deleted file mode 100644 index fbc6e38d25..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdate.cpp +++ /dev/null @@ -1,1529 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndBodyDynamic.h" -#include "ndSkeletonList.h" -#include "ndDynamicsUpdate.h" -#include "ndJointBilateralConstraint.h" - -#define D_MAX_BODY_RADIX_BIT 9 -#define D_DEFAULT_BUFFER_SIZE 1024 - -ndDynamicsUpdate::ndDynamicsUpdate(ndWorld* const world) - :m_velocTol(ndFloat32(1.0e-8f)) - ,m_islands(D_DEFAULT_BUFFER_SIZE) - ,m_jointForcesIndex(D_DEFAULT_BUFFER_SIZE) - ,m_internalForces(D_DEFAULT_BUFFER_SIZE) - ,m_leftHandSide(D_DEFAULT_BUFFER_SIZE * 4) - ,m_rightHandSide(D_DEFAULT_BUFFER_SIZE) - ,m_tempInternalForces(D_DEFAULT_BUFFER_SIZE) - ,m_bodyIslandOrder(D_DEFAULT_BUFFER_SIZE) - ,m_jointBodyPairIndexBuffer(D_DEFAULT_BUFFER_SIZE) - ,m_world(world) - ,m_timestep(ndFloat32(0.0f)) - ,m_invTimestep(ndFloat32(0.0f)) - ,m_firstPassCoef(ndFloat32(0.0f)) - ,m_invStepRK(ndFloat32(0.0f)) - ,m_timestepRK(ndFloat32(0.0f)) - ,m_invTimestepRK(ndFloat32(0.0f)) - ,m_solverPasses(0) - ,m_activeJointCount(0) - ,m_unConstrainedBodyCount(0) -{ -} - -ndDynamicsUpdate::~ndDynamicsUpdate() -{ - Clear(); -} - -const char* ndDynamicsUpdate::GetStringId() const -{ - return "default"; -} - -void ndDynamicsUpdate::Clear() -{ - m_islands.Resize(D_DEFAULT_BUFFER_SIZE); - m_rightHandSide.Resize(D_DEFAULT_BUFFER_SIZE); - m_internalForces.Resize(D_DEFAULT_BUFFER_SIZE); - m_bodyIslandOrder.Resize(D_DEFAULT_BUFFER_SIZE); - m_leftHandSide.Resize(D_DEFAULT_BUFFER_SIZE * 4); - m_tempInternalForces.Resize(D_DEFAULT_BUFFER_SIZE); - m_jointForcesIndex.Resize(D_DEFAULT_BUFFER_SIZE); - m_jointBodyPairIndexBuffer.Resize(D_DEFAULT_BUFFER_SIZE); -} - -void ndDynamicsUpdate::SortBodyJointScan() -{ - D_TRACKTIME(); - class ndEvaluateKey0 - { - public: - ndEvaluateKey0(void* const) - { - } - - ndInt32 GetKey(const ndDynamicsUpdate::ndJointBodyPairIndex& entry) const - { - return ndInt32(entry.m_body & ((1 << D_MAX_BODY_RADIX_BIT) - 1)); - } - }; - - class ndEvaluateKey1 - { - public: - ndEvaluateKey1(void* const) - { - } - - ndInt32 GetKey(const ndDynamicsUpdate::ndJointBodyPairIndex& entry) const - { - ndInt32 key = ndInt32(entry.m_body >> D_MAX_BODY_RADIX_BIT); - return key & ((1 << D_MAX_BODY_RADIX_BIT) - 1); - } - }; - - ndScene* const scene = m_world->GetScene(); - ndArray& jointArray = scene->GetActiveContactArray(); - ndArray& bodyJointPairs = GetJointBodyPairIndexBuffer(); - - bodyJointPairs.SetCount(jointArray.GetCount() * 2); - GetTempInternalForces().SetCount(jointArray.GetCount() * 2); - - ndAtomic iterator(0); - auto EnumerateJointBodyPairs = ndMakeObject::ndFunction([this, &iterator, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(EnumerateJointBodyPairs); - ndJointBodyPairIndex* const jointBodyBuffer = &GetJointBodyPairIndexBuffer()[0]; - - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < jointCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((jointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : jointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 index = i + j; - const ndConstraint* const joint = jointArray[index]; - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - - const ndInt32 m0 = body0->m_index; - const ndInt32 m1 = body1->m_index; - jointBodyBuffer[index * 2 + 0].m_body = m0; - jointBodyBuffer[index * 2 + 0].m_joint = index * 2 + 0; - jointBodyBuffer[index * 2 + 1].m_body = m1; - jointBodyBuffer[index * 2 + 1].m_joint = index * 2 + 1; - } - } - }); - scene->ParallelExecute(EnumerateJointBodyPairs); - - scene->GetScratchBuffer().SetCount(bodyJointPairs.GetCount() * ndInt32 (sizeof (ndJointBodyPairIndex))); - ndJointBodyPairIndex* const tempBuffer = (ndJointBodyPairIndex*)&scene->GetScratchBuffer()[0]; - - ndCountingSort(*scene, &bodyJointPairs[0], tempBuffer, ndInt32 (bodyJointPairs.GetCount()), nullptr, nullptr); - ndCountingSort(*scene, tempBuffer, &bodyJointPairs[0], ndInt32 (bodyJointPairs.GetCount()), nullptr, nullptr); - -#ifdef _DEBUG - for (int i = 1; i < bodyJointPairs.GetCount(); ++i) - { - ndInt32 key0 = bodyJointPairs[i - 1].m_body; - ndInt32 key1 = bodyJointPairs[i + 0].m_body; - ndAssert(key0 <= key1); - } -#endif - - bodyJointPairs.SetCount(bodyJointPairs.GetCount() + 1); - bodyJointPairs[bodyJointPairs.GetCount() - 1] = bodyJointPairs[bodyJointPairs.GetCount() - 2]; - - ndArray& bodyJointIndex = GetJointForceIndexBuffer(); - const ndInt32 bodyJointIndexCount = ndInt32 (scene->GetActiveBodyArray().GetCount()) + 1; - bodyJointIndex.SetCount(bodyJointIndexCount); - ndMemSet(&bodyJointIndex[0], 0, bodyJointIndexCount); - - for (ndInt32 i = 0; i < ndInt32 (jointArray.GetCount()); ++i) - { - const ndConstraint* const joint = jointArray[i]; - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - const ndInt32 m0 = body0->m_index; - const ndInt32 m1 = body1->m_index; - bodyJointIndex[m0] ++; - bodyJointIndex[m1] ++; - } - - ndInt32 bodyJointIndexAcc = 0; - for (ndInt32 i = 0; i < bodyJointIndexCount; ++i) - { - ndInt32 count = bodyJointIndex[i]; - bodyJointIndex[i] = bodyJointIndexAcc; - bodyJointIndexAcc += count; - } - -#ifdef _DEBUG - const ndArray& jointBodyPairIndexBuffer = GetJointBodyPairIndexBuffer(); - for (ndInt32 i = 0; i < scene->GetActiveBodyArray().GetCount(); ++i) - { - ndInt32 startIndex = bodyJointIndex[i]; - ndInt32 count = bodyJointIndex[i + 1] - startIndex; - for (ndInt32 j = 0; j < count; ++j) - { - ndInt32 bodyIndex = jointBodyPairIndexBuffer[startIndex + j].m_body; - ndAssert(bodyIndex == i); - } - } -#endif -} - -void ndDynamicsUpdate::SortJointsScan() -{ - D_TRACKTIME(); - class ndEvaluateCountRows - { - public: - class ndSortKey - { - public: - ndSortKey(ndInt32 sleep, ndInt32 rows) - :m_value(0) - { - ndAssert(rows > 0); - m_upperBit = ndUnsigned32(sleep); - m_lowerBit = ndUnsigned32((1 << 6) - rows - 1); - } - - union - { - ndInt32 m_value; - struct - { - ndUnsigned32 m_lowerBit : 6; - ndUnsigned32 m_upperBit : 1; - }; - }; - }; - - ndEvaluateCountRows(void* const) {} - ndInt32 GetKey(const ndConstraint* const joint) const - { - const ndSortKey key(joint->m_resting, joint->m_rowCount); - return key.m_value; - } - }; - - ndScene* const scene = m_world->GetScene(); - - for (ndSkeletonList::ndNode* node = m_world->GetSkeletonList().GetFirst(); node; node = node->GetNext()) - { - ndSkeletonContainer* const skeleton = &node->GetInfo(); - skeleton->CheckSleepState(); - } - - const ndJointList& jointList = m_world->GetJointList(); - ndArray& jointArray = scene->GetActiveContactArray(); - - ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - jointArray.SetCount(jointCount + jointList.GetCount()); - - for (ndJointList::ndNode* node = jointList.GetFirst(); node; node = node->GetNext()) - { - ndJointBilateralConstraint* const joint = *node->GetInfo(); - if (joint->IsActive()) - { - jointArray[jointCount] = joint; - jointCount++; - } - } - jointArray.SetCount(jointCount); - - m_leftHandSide.SetCount(jointArray.GetCount() + 32); - - ndInt32 histogram[D_MAX_THREADS_COUNT][2]; - ndInt32 movingJoints[D_MAX_THREADS_COUNT]; - const ndInt32 threadCount = scene->GetThreadCount(); - - ndAtomic iterator(0); - auto MarkFence0 = ndMakeObject::ndFunction([this, &iterator, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(MarkFence0); - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < jointCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((jointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : jointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndConstraint* const joint = jointArray[i + j]; - ndBodyKinematic* const body0 = joint->GetBody0(); - ndBodyKinematic* const body1 = joint->GetBody1(); - const ndInt32 rows = ndInt32(joint->GetRowsCount()); - joint->m_rowCount = rows; - - const ndInt32 equilibrium = body0->m_equilibrium & body1->m_equilibrium; - if (!equilibrium) - { - body0->m_isJointFence0 = 0; - body1->m_isJointFence0 = body1->m_isStatic; - ndAssert((body1->m_invMass.m_w == ndFloat32(0.0f)) == body1->m_isStatic); - } - - body0->m_isConstrained = 1; - body0->m_equilibrium0 = ndUnsigned8(body0->m_equilibrium0 & equilibrium); - if (!body1->m_isStatic) - { - body1->m_isConstrained = 1; - body1->m_equilibrium0 = ndUnsigned8(body1->m_equilibrium0 & equilibrium); - } - } - } - }); - - auto MarkFence1 = ndMakeObject::ndFunction([this, &jointArray, &movingJoints](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(MarkFence1); - ndInt32 activeJointCount = 0; - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - const ndStartEnd startEnd(jointCount, threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndConstraint* const joint = jointArray[i]; - ndBodyKinematic* const body0 = joint->GetBody0(); - ndBodyKinematic* const body1 = joint->GetBody1(); - - const ndInt8 resting = body0->m_equilibrium0 & body1->m_equilibrium0; - activeJointCount += (1 - resting); - joint->m_resting = ndUnsigned8(resting); - - const ndInt32 solverSleep0 = body0->m_isJointFence0 & body1->m_isJointFence0; - if (!solverSleep0) - { - body0->m_isJointFence1 = 0; - body1->m_isJointFence1 = body1->m_isStatic; - ndAssert((body1->m_invMass.m_w == ndFloat32(0.0f)) == body1->m_isStatic); - } - } - movingJoints[threadIndex] = activeJointCount; - }); - - auto Scan0 = ndMakeObject::ndFunction([&jointArray, &histogram, scene](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(Scan0); - ndInt32* const hist = &histogram[threadIndex][0]; - ndAssert(scene->GetScratchBuffer().GetCount() >= ndInt32 (jointArray.GetCount() * sizeof(ndConstraint*))); - ndConstraint** const dstBuffer = (ndConstraint**)&scene->GetScratchBuffer()[0]; - - hist[0] = 0; - hist[1] = 0; - - const ndStartEnd startEnd(ndInt32 (jointArray.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndConstraint* const joint = jointArray[i]; - ndBodyKinematic* const body0 = joint->GetBody0(); - ndBodyKinematic* const body1 = joint->GetBody1(); - const ndInt32 key = body0->m_isJointFence1 & body1->m_isJointFence1; - const ndInt32 entry = hist[key]; - dstBuffer[entry] = joint; - hist[key] = entry + 1; - } - }); - - auto Sort0 = ndMakeObject::ndFunction([&jointArray, &histogram, scene](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(Sort0); - ndInt32* const hist = &histogram[threadIndex][0]; - ndAssert(scene->GetScratchBuffer().GetCount() >= ndInt32 (jointArray.GetCount() * sizeof (ndConstraint*))); - ndConstraint** const dstBuffer = (ndConstraint**)&scene->GetScratchBuffer()[0]; - - const ndStartEnd startEnd(ndInt32 (jointArray.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndConstraint* const joint = jointArray[i]; - ndBodyKinematic* const body0 = joint->GetBody0(); - ndBodyKinematic* const body1 = joint->GetBody1(); - const ndInt32 key = body0->m_isJointFence1 & body1->m_isJointFence1; - const ndInt32 entry = hist[key]; - dstBuffer[entry] = joint; - hist[key] = entry + 1; - } - }); - - scene->GetScratchBuffer().SetCount((jointArray.GetCount() + 32) * ndInt32 (sizeof (ndConstraint*))); - ndConstraint** const tempJointBuffer = (ndConstraint**)&scene->GetScratchBuffer()[0]; - - scene->ParallelExecute(MarkFence0); - scene->ParallelExecute(MarkFence1); - scene->ParallelExecute(Scan0); - - ndInt32 scan[2]; - scan[0] = 0; - scan[1] = 0; - ndInt32 movingJointCount = 0; - for (ndInt32 i = 0; i < threadCount; ++i) - { - scan[0] += histogram[i][0]; - scan[1] += histogram[i][1]; - movingJointCount += movingJoints[i]; - } - - m_activeJointCount = scan[0]; - ndAssert(m_activeJointCount <= jointArray.GetCount()); - if (!m_activeJointCount) - { - jointArray.SetCount(0); - return; - } - - ndInt32 sum = 0; - for (ndInt32 i = 0; i < 2; ++i) - { - for (ndInt32 j = 0; j < threadCount; ++j) - { - ndInt32 partialSum = histogram[j][i]; - histogram[j][i] = sum; - sum += partialSum; - } - } - - scene->ParallelExecute(Sort0); - - #ifdef _DEBUG - for (ndInt32 i = 0; i < (jointArray.GetCount() - 1); ++i) - { - const ndConstraint* const joint0 = tempJointBuffer[i]; - const ndConstraint* const joint1 = tempJointBuffer[i + 1]; - const ndInt32 key0 = (joint0->GetBody0()->m_isJointFence1 & joint0->GetBody1()->m_isJointFence1) ? 1 : 0; - const ndInt32 key1 = (joint1->GetBody0()->m_isJointFence1 & joint1->GetBody1()->m_isJointFence1) ? 1 : 0; - ndAssert(key0 <= key1); - } - #endif - - ndAssert(m_activeJointCount <= jointArray.GetCount()); - jointArray.SetCount(m_activeJointCount); - - m_activeJointCount = movingJointCount; - GetTempInternalForces().SetCount(jointArray.GetCount() * 2); - GetJointBodyPairIndexBuffer().SetCount(jointArray.GetCount() * 2); - ndCountingSort(*scene, tempJointBuffer, &jointArray[0], ndInt32 (jointArray.GetCount()), nullptr, nullptr); -} - -void ndDynamicsUpdate::SortJoints() -{ - D_TRACKTIME(); - SortJointsScan(); - if (!m_activeJointCount) - { - return; - } - - ndScene* const scene = m_world->GetScene(); - ndArray& jointArray = scene->GetActiveContactArray(); - - ndInt32 rowCount = 1; - for (ndInt32 i = 0; i < ndInt32 (jointArray.GetCount()); ++i) - { - ndConstraint* const joint = jointArray[i]; - joint->m_rowStart = rowCount; - rowCount += joint->m_rowCount; - } - - m_leftHandSide.SetCount(rowCount); - m_rightHandSide.SetCount(rowCount); - -#ifdef _DEBUG - ndAssert(m_activeJointCount <= jointArray.GetCount()); - for (ndInt32 i = 0; i < ndInt32 (jointArray.GetCount()); ++i) - { - ndConstraint* const joint = jointArray[i]; - ndAssert(joint->m_rowStart < m_leftHandSide.GetCount()); - ndAssert((joint->m_rowStart + joint->m_rowCount) <= rowCount); - } - - for (ndInt32 i = 1; i < m_activeJointCount; ++i) - { - ndConstraint* const joint0 = jointArray[i - 1]; - ndConstraint* const joint1 = jointArray[i - 0]; - ndAssert(!joint0->m_resting); - ndAssert(!joint1->m_resting); - ndAssert(joint0->m_rowCount >= joint1->m_rowCount); - ndAssert(!(joint0->GetBody0()->m_equilibrium0 & joint0->GetBody1()->m_equilibrium0)); - ndAssert(!(joint1->GetBody0()->m_equilibrium0 & joint1->GetBody1()->m_equilibrium0)); - } - - for (ndInt32 i = m_activeJointCount + 1; i < ndInt32 (jointArray.GetCount()); ++i) - { - ndConstraint* const joint0 = jointArray[i - 1]; - ndConstraint* const joint1 = jointArray[i - 0]; - ndAssert(joint0->m_resting); - ndAssert(joint1->m_resting); - ndAssert(joint0->m_rowCount >= joint1->m_rowCount); - ndAssert(joint0->GetBody0()->m_equilibrium0 & joint0->GetBody1()->m_equilibrium0); - ndAssert(joint1->GetBody0()->m_equilibrium0 & joint1->GetBody1()->m_equilibrium0); - } -#endif - - SortBodyJointScan(); -} - -void ndDynamicsUpdate::SortIslands() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyArray = scene->GetActiveBodyArray(); - ndArray& activeBodyArray = GetBodyIslandOrder(); - GetInternalForces().SetCount(bodyArray.GetCount()); - activeBodyArray.SetCount(bodyArray.GetCount()); - - ndInt32 histogram[D_MAX_THREADS_COUNT][3]; - auto Scan0 = ndMakeObject::ndFunction([&bodyArray, &histogram](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(Scan0); - ndInt32* const hist = &histogram[threadIndex][0]; - hist[0] = 0; - hist[1] = 0; - hist[2] = 0; - - ndInt32 map[4]; - map[0] = 0; - map[1] = 1; - map[2] = 2; - map[3] = 2; - - const ndStartEnd startEnd(ndInt32 (bodyArray.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndBodyKinematic* const body = bodyArray[i]; - ndInt32 key = map[body->m_equilibrium0 * 2 + 1 - body->m_isConstrained]; - ndAssert(key < 3); - hist[key] = hist[key] + 1; - } - }); - - auto Sort0 = ndMakeObject::ndFunction([&bodyArray, &activeBodyArray, &histogram](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(Sort0); - ndInt32* const hist = &histogram[threadIndex][0]; - ndInt32 map[4]; - map[0] = 0; - map[1] = 1; - map[2] = 2; - map[3] = 2; - - const ndStartEnd startEnd(ndInt32 (bodyArray.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndBodyKinematic* const body = bodyArray[i]; - ndInt32 key = map[body->m_equilibrium0 * 2 + 1 - body->m_isConstrained]; - ndAssert(key < 3); - const ndInt32 entry = hist[key]; - activeBodyArray[entry] = body; - hist[key] = entry + 1; - } - }); - scene->ParallelExecute(Scan0); - - ndInt32 scan[3]; - scan[0] = 0; - scan[1] = 0; - scan[2] = 0; - const ndInt32 threadCount = scene->GetThreadCount(); - - ndInt32 sum = 0; - for (ndInt32 i = 0; i < 3; ++i) - { - for (ndInt32 j = 0; j < threadCount; ++j) - { - ndInt32 partialSum = histogram[j][i]; - histogram[j][i] = sum; - sum += partialSum; - } - scan[i] = sum; - } - - scene->ParallelExecute(Sort0); - activeBodyArray.SetCount(scan[1]); - m_unConstrainedBodyCount = scan[1] - scan[0]; -} - -void ndDynamicsUpdate::BuildIsland() -{ - m_unConstrainedBodyCount = 0; - GetBodyIslandOrder().SetCount(0); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyArray = scene->GetActiveBodyArray(); - ndAssert(bodyArray.GetCount() >= 1); - if (bodyArray.GetCount() - 1) - { - D_TRACKTIME(); - SortJoints(); - SortIslands(); - } -} - -void ndDynamicsUpdate::IntegrateUnconstrainedBodies() -{ - ndScene* const scene = m_world->GetScene(); - - ndAtomic iterator(0); - auto IntegrateUnconstrainedBodies = ndMakeObject::ndFunction([this, &iterator, &scene](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(IntegrateUnconstrainedBodies); - ndArray& bodyArray = GetBodyIslandOrder(); - - const ndFloat32 timestep = scene->GetTimestep(); - const ndInt32 base = ndInt32 (bodyArray.GetCount() - GetUnconstrainedBodyCount()); - - const ndInt32 count = GetUnconstrainedBodyCount(); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[base + i + j]; - ndAssert(body); - body->UpdateInvInertiaMatrix(); - body->AddDampingAcceleration(timestep); - body->IntegrateExternalForce(timestep); - } - } - }); - - if (GetUnconstrainedBodyCount()) - { - D_TRACKTIME(); - scene->ParallelExecute(IntegrateUnconstrainedBodies); - } -} - -void ndDynamicsUpdate::InitWeights() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - m_invTimestep = ndFloat32(1.0f) / m_timestep; - m_invStepRK = ndFloat32(0.25f); - m_timestepRK = m_timestep * m_invStepRK; - m_invTimestepRK = m_invTimestep * ndFloat32(4.0f); - - const ndArray& bodyArray = scene->GetActiveBodyArray(); - const ndInt32 bodyCount = ndInt32 (bodyArray.GetCount()); - GetInternalForces().SetCount(bodyCount); - - ndInt32 extraPassesArray[D_MAX_THREADS_COUNT]; - - ndAtomic iterator(0); - auto InitWeights = ndMakeObject::ndFunction([this, &iterator, &bodyArray, &extraPassesArray](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(InitWeights); - const ndArray& jointForceIndexBuffer = GetJointForceIndexBuffer(); - const ndArray& jointBodyPairIndex = GetJointBodyPairIndexBuffer(); - - ndInt32 maxExtraPasses = 1; - const ndInt32 jointCount = ndInt32 (jointForceIndexBuffer.GetCount()) - 1; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < jointCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((jointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : jointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 index = jointForceIndexBuffer[i + j]; - const ndJointBodyPairIndex& scan = jointBodyPairIndex[index]; - ndBodyKinematic* const body = bodyArray[scan.m_body]; - ndAssert(body->m_index == scan.m_body); - ndAssert(body->m_isConstrained <= 1); - const ndInt32 count = jointForceIndexBuffer[i + j + 1] - index - 1; - const ndInt32 mask = -ndInt32(body->m_isConstrained & ~body->m_isStatic); - const ndInt32 weigh = 1 + (mask & count); - ndAssert(weigh >= 0); - if (weigh) - { - body->m_weigh = ndFloat32(weigh); - } - maxExtraPasses = ndMax(weigh, maxExtraPasses); - } - } - extraPassesArray[threadIndex] = maxExtraPasses; - }); - - if (scene->GetActiveContactArray().GetCount()) - { - scene->ParallelExecute(InitWeights); - - ndInt32 extraPasses = 0; - const ndInt32 threadCount = scene->GetThreadCount(); - for (ndInt32 i = 0; i < threadCount; ++i) - { - extraPasses = ndMax(extraPasses, extraPassesArray[i]); - } - - const ndInt32 conectivity = 7; - m_solverPasses = ndUnsigned32(m_world->GetSolverIterations() + 2 * extraPasses / conectivity + 2); - } -} - -void ndDynamicsUpdate::InitBodyArray() -{ - D_TRACKTIME(); - - ndScene* const scene = m_world->GetScene(); - const ndFloat32 timestep = scene->GetTimestep(); - - ndAtomic iterator(0); - auto InitBodyArray = ndMakeObject::ndFunction([this, &iterator, timestep](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitBodyArray); - const ndArray& bodyArray = GetBodyIslandOrder(); - - const ndInt32 count = ndInt32 (bodyArray.GetCount() - GetUnconstrainedBodyCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - ndAssert(body); - ndAssert(body->m_isConstrained | body->m_isStatic); - - body->UpdateInvInertiaMatrix(); - body->AddDampingAcceleration(timestep); - const ndVector angularMomentum(body->CalculateAngularMomentum()); - body->m_gyroTorque = body->m_omega.CrossProduct(angularMomentum); - body->m_gyroAlpha = body->m_invWorldInertiaMatrix.RotateVector(body->m_gyroTorque); - - body->m_accel = body->m_veloc; - body->m_alpha = body->m_omega; - body->m_gyroRotation = body->m_rotation; - } - } - }); - scene->ParallelExecute(InitBodyArray); -} - -void ndDynamicsUpdate::GetJacobianDerivatives(ndConstraint* const joint) -{ - ndConstraintDescritor constraintParam; - ndAssert(joint->GetRowsCount() <= D_CONSTRAINT_MAX_ROWS); - for (ndInt32 i = ndInt32(joint->GetRowsCount() - 1); i >= 0; i--) - { - constraintParam.m_forceBounds[i].m_low = D_MIN_BOUND; - constraintParam.m_forceBounds[i].m_upper = D_MAX_BOUND; - constraintParam.m_forceBounds[i].m_jointForce = nullptr; - constraintParam.m_forceBounds[i].m_normalIndex = D_INDEPENDENT_ROW; - } - - constraintParam.m_rowsCount = 0; - constraintParam.m_timestep = m_timestep; - constraintParam.m_invTimestep = m_invTimestep; - joint->JacobianDerivative(constraintParam); - const ndInt32 dof = constraintParam.m_rowsCount; - ndAssert(dof <= joint->m_rowCount); - - if (joint->GetAsContact()) - { - ndContact* const contactJoint = joint->GetAsContact(); - contactJoint->m_isInSkeletonLoop = 0; - ndSkeletonContainer* const skeleton0 = contactJoint->GetBody0()->GetSkeleton(); - ndSkeletonContainer* const skeleton1 = contactJoint->GetBody1()->GetSkeleton(); - if (skeleton0 && (skeleton0 == skeleton1)) - { - if (contactJoint->IsSkeletonSelftCollision()) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(contactJoint); - } - } - else - { - if (skeleton0 && !skeleton1) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(contactJoint); - } - else if (skeleton1 && !skeleton0) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton1->AddCloseLoopJoint(contactJoint); - } - } - } - else - { - ndJointBilateralConstraint* const bilareral = joint->GetAsBilateral(); - ndAssert(bilareral); - if (!bilareral->m_isInSkeleton && (bilareral->GetSolverModel() == m_jointkinematicAttachment)) - { - ndSkeletonContainer* const skeleton0 = bilareral->m_body0->GetSkeleton(); - ndSkeletonContainer* const skeleton1 = bilareral->m_body1->GetSkeleton(); - if (skeleton0 || skeleton1) - { - if (skeleton0 && !skeleton1) - { - bilareral->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(bilareral); - } - else if (skeleton1 && !skeleton0) - { - bilareral->m_isInSkeletonLoop = 1; - skeleton1->AddCloseLoopJoint(bilareral); - } - } - } - } - - joint->m_rowCount = dof; - const ndInt32 baseIndex = joint->m_rowStart; - for (ndInt32 i = 0; i < dof; ++i) - { - ndAssert(constraintParam.m_forceBounds[i].m_jointForce); - - ndLeftHandSide* const row = &m_leftHandSide[baseIndex + i]; - ndRightHandSide* const rhs = &m_rightHandSide[baseIndex + i]; - - row->m_Jt = constraintParam.m_jacobian[i]; - rhs->m_diagDamp = ndFloat32(0.0f); - rhs->m_diagonalRegularizer = ndMax(constraintParam.m_diagonalRegularizer[i], ndFloat32(1.0e-5f)); - - rhs->m_coordenateAccel = constraintParam.m_jointAccel[i]; - rhs->m_restitution = constraintParam.m_restitution[i]; - rhs->m_penetration = constraintParam.m_penetration[i]; - rhs->m_penetrationStiffness = constraintParam.m_penetrationStiffness[i]; - rhs->m_lowerBoundFrictionCoefficent = constraintParam.m_forceBounds[i].m_low; - rhs->m_upperBoundFrictionCoefficent = constraintParam.m_forceBounds[i].m_upper; - rhs->m_jointFeebackForce = constraintParam.m_forceBounds[i].m_jointForce; - - ndAssert(constraintParam.m_forceBounds[i].m_normalIndex >= -1); - const ndInt32 frictionIndex = constraintParam.m_forceBounds[i].m_normalIndex; - const ndInt32 mask = frictionIndex >> 31; - rhs->m_normalForceIndex = frictionIndex; - rhs->m_normalForceIndexFlat = ~mask & (frictionIndex + baseIndex); - } -} - -void ndDynamicsUpdate::InitJacobianMatrix() -{ - ndScene* const scene = m_world->GetScene(); - ndBodyKinematic** const bodyArray = &scene->GetActiveBodyArray()[0]; - ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator(0); - auto InitJacobianMatrix = ndMakeObject::ndFunction([this, &iterator, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitJacobianMatrix); - ndJacobian* const internalForces = &GetTempInternalForces()[0]; - auto BuildJacobianMatrix = [this, &internalForces](ndConstraint* const joint, ndInt32 jointIndex) - { - ndAssert(joint->GetBody0()); - ndAssert(joint->GetBody1()); - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - - const ndVector force0(body0->GetForce()); - const ndVector torque0(body0->GetTorque()); - const ndVector force1(body1->GetForce()); - const ndVector torque1(body1->GetTorque()); - - const ndInt32 index = joint->m_rowStart; - const ndInt32 count = joint->m_rowCount; - const ndMatrix& invInertia0 = body0->m_invWorldInertiaMatrix; - const ndMatrix& invInertia1 = body1->m_invWorldInertiaMatrix; - const ndVector invMass0(body0->m_invMass[3]); - const ndVector invMass1(body1->m_invMass[3]); - - const ndVector zero(ndVector::m_zero); - ndVector forceAcc0(zero); - ndVector torqueAcc0(zero); - ndVector forceAcc1(zero); - ndVector torqueAcc1(zero); - - const ndVector weigh0(body0->m_weigh); - const ndVector weigh1(body1->m_weigh); - - const bool isBilateral = joint->IsBilateral(); - for (ndInt32 i = 0; i < count; ++i) - { - ndLeftHandSide* const row = &m_leftHandSide[index + i]; - ndRightHandSide* const rhs = &m_rightHandSide[index + i]; - - row->m_JMinv.m_jacobianM0.m_linear = row->m_Jt.m_jacobianM0.m_linear * invMass0; - row->m_JMinv.m_jacobianM0.m_angular = invInertia0.RotateVector(row->m_Jt.m_jacobianM0.m_angular); - row->m_JMinv.m_jacobianM1.m_linear = row->m_Jt.m_jacobianM1.m_linear * invMass1; - row->m_JMinv.m_jacobianM1.m_angular = invInertia1.RotateVector(row->m_Jt.m_jacobianM1.m_angular); - - const ndJacobian& JMinvM0 = row->m_JMinv.m_jacobianM0; - const ndJacobian& JMinvM1 = row->m_JMinv.m_jacobianM1; - const ndVector tmpAccel( - JMinvM0.m_linear * force0 + JMinvM0.m_angular * torque0 + - JMinvM1.m_linear * force1 + JMinvM1.m_angular * torque1); - - const ndFloat32 extenalAcceleration = -tmpAccel.AddHorizontal().GetScalar(); - rhs->m_deltaAccel = extenalAcceleration; - rhs->m_coordenateAccel += extenalAcceleration; - ndAssert(rhs->m_jointFeebackForce); - const ndFloat32 force = rhs->m_jointFeebackForce->GetInitialGuess(); - - rhs->m_force = isBilateral ? ndClamp(force, rhs->m_lowerBoundFrictionCoefficent, rhs->m_upperBoundFrictionCoefficent) : force; - rhs->m_maxImpact = ndFloat32(0.0f); - - const ndJacobian& JtM0 = row->m_Jt.m_jacobianM0; - const ndJacobian& JtM1 = row->m_Jt.m_jacobianM1; - const ndVector tmpDiag( - weigh0 * (JMinvM0.m_linear * JtM0.m_linear + JMinvM0.m_angular * JtM0.m_angular) + - weigh1 * (JMinvM1.m_linear * JtM1.m_linear + JMinvM1.m_angular * JtM1.m_angular)); - - ndFloat32 diag = tmpDiag.AddHorizontal().GetScalar(); - ndAssert(diag > ndFloat32(0.0f)); - rhs->m_diagDamp = diag * rhs->m_diagonalRegularizer; - - diag *= (ndFloat32(1.0f) + rhs->m_diagonalRegularizer); - rhs->m_invJinvMJt = ndFloat32(1.0f) / diag; - - const ndVector f(rhs->m_force); - forceAcc0 = forceAcc0 + JtM0.m_linear * f; - torqueAcc0 = torqueAcc0 + JtM0.m_angular * f; - forceAcc1 = forceAcc1 + JtM1.m_linear * f; - torqueAcc1 = torqueAcc1 + JtM1.m_angular * f; - } - - const ndInt32 index0 = jointIndex * 2 + 0; - ndJacobian& outBody0 = internalForces[index0]; - outBody0.m_linear = forceAcc0; - outBody0.m_angular = torqueAcc0; - - const ndInt32 index1 = jointIndex * 2 + 1; - ndJacobian& outBody1 = internalForces[index1]; - outBody1.m_linear = forceAcc1; - outBody1.m_angular = torqueAcc1; - }; - - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < jointCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((jointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : jointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndConstraint* const joint = jointArray[i + j]; - GetJacobianDerivatives(joint); - BuildJacobianMatrix(joint, i + j); - } - } - }); - - ndAtomic iterator1(0); - auto InitJacobianAccumulatePartialForces = ndMakeObject::ndFunction([this, &iterator1, &bodyArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitJacobianAccumulatePartialForces); - const ndVector zero(ndVector::m_zero); - ndJacobian* const internalForces = &GetInternalForces()[0]; - const ndArray& bodyIndex = GetJointForceIndexBuffer(); - - const ndJacobian* const jointInternalForces = &GetTempInternalForces()[0]; - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - - const ndInt32 bodyCount = ndInt32 (bodyIndex.GetCount()) - 1; - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < bodyCount; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((bodyCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : bodyCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndVector force(zero); - ndVector torque(zero); - - const ndInt32 index = bodyIndex[i + j]; - const ndJointBodyPairIndex& scan = jointBodyPairIndexBuffer[index]; - ndBodyKinematic* const body = bodyArray[scan.m_body]; - - ndAssert(body->m_isStatic <= 1); - ndAssert(body->m_index == scan.m_body); - const ndInt32 mask = ndInt32(body->m_isStatic) - 1; - const ndInt32 count = mask & (bodyIndex[i + j + 1] - index); - - for (ndInt32 k = 0; k < count; ++k) - { - const ndInt32 jointIndex = jointBodyPairIndexBuffer[index + k].m_joint; - force += jointInternalForces[jointIndex].m_linear; - torque += jointInternalForces[jointIndex].m_angular; - } - internalForces[i + j].m_linear = force; - internalForces[i + j].m_angular = torque; - } - } - }); - - if (scene->GetActiveContactArray().GetCount()) - { - D_TRACKTIME(); - m_rightHandSide[0].m_force = ndFloat32(1.0f); - - scene->ParallelExecute(InitJacobianMatrix); - scene->ParallelExecute(InitJacobianAccumulatePartialForces); - } -} - -void ndDynamicsUpdate::CalculateJointsAcceleration() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator(0); - auto CalculateJointsAcceleration = ndMakeObject::ndFunction([this, &iterator, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CalculateJointsAcceleration); - ndJointAccelerationDecriptor joindDesc; - joindDesc.m_timestep = m_timestepRK; - joindDesc.m_invTimestep = m_invTimestepRK; - joindDesc.m_firstPassCoefFlag = m_firstPassCoef; - ndArray& leftHandSide = m_leftHandSide; - ndArray& rightHandSide = m_rightHandSide; - - const ndInt32 count = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndConstraint* const joint = jointArray[i + j]; - const ndInt32 pairStart = joint->m_rowStart; - joindDesc.m_rowsCount = joint->m_rowCount; - joindDesc.m_leftHandSide = &leftHandSide[pairStart]; - joindDesc.m_rightHandSide = &rightHandSide[pairStart]; - joint->JointAccelerations(&joindDesc); - } - } - }); - - scene->ParallelExecute(CalculateJointsAcceleration); - m_firstPassCoef = ndFloat32(1.0f); -} - -void ndDynamicsUpdate::IntegrateBodiesVelocity() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - - ndAtomic iterator(0); - auto IntegrateBodiesVelocity = ndMakeObject::ndFunction([this, &iterator](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(IntegrateBodiesVelocity); - ndArray& bodyArray = GetBodyIslandOrder(); - const ndArray& internalForces = GetInternalForces(); - - const ndVector timestep4(GetTimestepRK()); - const ndVector speedFreeze2(m_world->m_freezeSpeed2 * ndFloat32(0.1f)); - - const ndInt32 count = ndInt32 (bodyArray.GetCount() - GetUnconstrainedBodyCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - - ndAssert(body); - ndAssert(body->m_isConstrained); - // no necessary anymore because the virtual function handle it. - //ndAssert(body->GetAsBodyDynamic()); - - const ndInt32 index = body->m_index; - const ndJacobian& forceAndTorque = internalForces[index]; - const ndVector force(body->GetForce() + forceAndTorque.m_linear); - const ndVector torque(body->GetTorque() + forceAndTorque.m_angular - body->GetGyroTorque()); - const ndJacobian velocStep(body->IntegrateForceAndToque(force, torque, timestep4)); - - if (!body->m_equilibrium0) - { - body->m_veloc += velocStep.m_linear; - body->m_omega += velocStep.m_angular; - body->IntegrateGyroSubstep(timestep4); - } - else - { - const ndVector velocStep2(velocStep.m_linear.DotProduct(velocStep.m_linear)); - const ndVector omegaStep2(velocStep.m_angular.DotProduct(velocStep.m_angular)); - const ndVector test(((velocStep2 > speedFreeze2) | (omegaStep2 > speedFreeze2)) & ndVector::m_negOne); - const ndInt8 equilibrium = test.GetSignMask() ? 0 : 1; - body->m_equilibrium0 = ndUnsigned8(equilibrium); - } - ndAssert(body->m_veloc.m_w == ndFloat32(0.0f)); - ndAssert(body->m_omega.m_w == ndFloat32(0.0f)); - } - } - }); - - scene->ParallelExecute(IntegrateBodiesVelocity); -} - -void ndDynamicsUpdate::UpdateForceFeedback() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator(0); - auto UpdateForceFeedback = ndMakeObject::ndFunction([this, &iterator, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(UpdateForceFeedback); - ndArray& rightHandSide = m_rightHandSide; - const ndArray& leftHandSide = m_leftHandSide; - - const ndVector zero(ndVector::m_zero); - const ndFloat32 timestepRK = GetTimestepRK(); - - const ndInt32 count = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndConstraint* const joint = jointArray[i + j]; - const ndInt32 rows = joint->m_rowCount; - const ndInt32 first = joint->m_rowStart; - - for (ndInt32 k = 0; k < rows; ++k) - { - const ndRightHandSide* const rhs = &rightHandSide[k + first]; - ndAssert(ndCheckFloat(rhs->m_force)); - rhs->m_jointFeebackForce->Push(rhs->m_force); - rhs->m_jointFeebackForce->m_force = rhs->m_force; - rhs->m_jointFeebackForce->m_impact = rhs->m_maxImpact * timestepRK; - } - - //if (joint->GetAsBilateral()) - { - ndVector force0(zero); - ndVector force1(zero); - ndVector torque0(zero); - ndVector torque1(zero); - - for (ndInt32 k = 0; k < rows; ++k) - { - const ndRightHandSide* const rhs = &rightHandSide[k + first]; - const ndLeftHandSide* const lhs = &leftHandSide[k + first]; - const ndVector f(rhs->m_force); - force0 += lhs->m_Jt.m_jacobianM0.m_linear * f; - torque0 += lhs->m_Jt.m_jacobianM0.m_angular * f; - force1 += lhs->m_Jt.m_jacobianM1.m_linear * f; - torque1 += lhs->m_Jt.m_jacobianM1.m_angular * f; - } - //ndJointBilateralConstraint* const bilateral = (ndJointBilateralConstraint*)joint; - joint->m_forceBody0 = force0; - joint->m_torqueBody0 = torque0; - joint->m_forceBody1 = force1; - joint->m_torqueBody1 = torque1; - } - } - } - }); - - scene->ParallelExecute(UpdateForceFeedback); -} - -void ndDynamicsUpdate::IntegrateBodies() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndVector invTime(m_invTimestep); - const ndFloat32 timestep = scene->GetTimestep(); - - ndAtomic iterator(0); - auto IntegrateBodies = ndMakeObject::ndFunction([this, &iterator, timestep, invTime](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(IntegrateBodies); - const ndWorld* const world = m_world; - const ndArray& bodyArray = GetBodyIslandOrder(); - - const ndFloat32 speedFreeze2 = world->m_freezeSpeed2; - const ndFloat32 accelFreeze2 = world->m_freezeAccel2; - - const ndInt32 count = ndInt32 (bodyArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - if (!body->m_equilibrium) - { - body->SetAcceleration(invTime * (body->m_veloc - body->m_accel), invTime * (body->m_omega - body->m_alpha)); - body->IntegrateVelocity(timestep); - } - body->EvaluateSleepState(speedFreeze2, accelFreeze2); - } - } - }); - - scene->ParallelExecute(IntegrateBodies); -} - -void ndDynamicsUpdate::DetermineSleepStates() -{ - D_TRACKTIME(); - - ndAtomic iterator(0); - auto CalculateSleepState = ndMakeObject::ndFunction([this, &iterator](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CalculateSleepState); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyIndex = GetJointForceIndexBuffer(); - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - ndConstraint** const jointArray = &scene->GetActiveContactArray()[0]; - ndBodyKinematic** const bodyArray = &scene->GetActiveBodyArray()[0]; - - const ndVector zero(ndVector::m_zero); - const ndInt32 bodyCount = ndInt32 (bodyIndex.GetCount()) - 1; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < bodyCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((bodyCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : bodyCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 m = i + j; - const ndInt32 index = bodyIndex[m]; - ndBodyKinematic* const body = bodyArray[jointBodyPairIndexBuffer[index].m_body]; - ndAssert(body->m_isStatic <= 1); - ndAssert(body->m_index == jointBodyPairIndexBuffer[index].m_body); - const ndInt32 mask = ndInt32(body->m_isStatic) - 1; - const ndInt32 count = mask & (bodyIndex[m + 1] - index); - if (count) - { - ndUnsigned8 equilibrium = body->m_isJointFence0; - if (equilibrium & body->m_autoSleep) - { - for (ndInt32 k = 0; k < count; ++k) - { - const ndJointBodyPairIndex& scan = jointBodyPairIndexBuffer[index + k]; - ndConstraint* const joint = jointArray[scan.m_joint >> 1]; - ndBodyKinematic* const body1 = (joint->GetBody0() == body) ? joint->GetBody1() : joint->GetBody0(); - ndAssert(body1 != body); - equilibrium = ndUnsigned8(equilibrium & body1->m_isJointFence0); - } - } - body->m_equilibrium = ndUnsigned8(equilibrium & body->m_autoSleep); - if (body->m_equilibrium) - { - body->m_veloc = zero; - body->m_omega = zero; - } - } - } - } - }); - - ndScene* const scene = m_world->GetScene(); - if (scene->GetActiveContactArray().GetCount()) - { - scene->ParallelExecute(CalculateSleepState); - } -} - -void ndDynamicsUpdate::InitSkeletons() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& activeSkeletons = m_world->m_activeSkeletons; - - ndAtomic iterator(0); - auto InitSkeletons = ndMakeObject::ndFunction([this, &iterator, &activeSkeletons](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitSkeletons); - ndArray& rightHandSide = m_rightHandSide; - const ndArray& leftHandSide = m_leftHandSide; - - const ndInt32 count = ndInt32 (activeSkeletons.GetCount()); - for (ndInt32 i = iterator++; i < count; i = iterator++) - { - ndSkeletonContainer* const skeleton = activeSkeletons[i]; - skeleton->InitMassMatrix(&leftHandSide[0], &rightHandSide[0]); - } - }); - - if (activeSkeletons.GetCount()) - { - scene->ParallelExecute(InitSkeletons); - } -} - -void ndDynamicsUpdate::UpdateSkeletons() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& activeSkeletons = m_world->m_activeSkeletons; - - ndAtomic iterator(0); - auto UpdateSkeletons = ndMakeObject::ndFunction([this, &iterator, &activeSkeletons](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(UpdateSkeletons); - ndJacobian* const internalForces = &GetInternalForces()[0]; - - const ndInt32 count = ndInt32 (activeSkeletons.GetCount()); - for (ndInt32 i = iterator++; i < count; i = iterator++) - { - ndSkeletonContainer* const skeleton = activeSkeletons[i]; - skeleton->CalculateReactionForces(internalForces); - } - }); - - if (activeSkeletons.GetCount()) - { - scene->ParallelExecute(UpdateSkeletons); - } -} - -void ndDynamicsUpdate::CalculateJointsForce() -{ - D_TRACKTIME(); - const ndUnsigned32 passes = m_solverPasses; - ndScene* const scene = m_world->GetScene(); - - ndArray& bodyArray = scene->GetActiveBodyArray(); - ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator0(0); - auto CalculateJointsForce = ndMakeObject::ndFunction([this, &iterator0, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CalculateJointsForce); - ndJacobian* const jointPartialForces = &GetTempInternalForces()[0]; - - auto JointForce = [this, &jointPartialForces](ndConstraint* const joint, ndInt32 jointIndex) - { - D_TRACKTIME_NAMED(JointForce); - const ndVector zero(ndVector::m_zero); - ndVector accNorm(zero); - ndBodyKinematic* const body0 = joint->GetBody0(); - ndBodyKinematic* const body1 = joint->GetBody1(); - ndAssert(body0); - ndAssert(body1); - - const ndInt32 m0 = body0->m_index; - const ndInt32 m1 = body1->m_index; - const ndInt32 rowStart = joint->m_rowStart; - const ndInt32 rowsCount = joint->m_rowCount; - - const ndInt32 resting = body0->m_equilibrium0 & body1->m_equilibrium0; - if (!resting) - { - const ndVector preconditioner0(body0->m_weigh); - const ndVector preconditioner1(body1->m_weigh); - - ndVector forceM0(m_internalForces[m0].m_linear); - ndVector torqueM0(m_internalForces[m0].m_angular); - ndVector forceM1(m_internalForces[m1].m_linear); - ndVector torqueM1(m_internalForces[m1].m_angular); - - for (ndInt32 j = 0; j < rowsCount; ++j) - { - ndRightHandSide* const rhs = &m_rightHandSide[rowStart + j]; - const ndLeftHandSide* const lhs = &m_leftHandSide[rowStart + j]; - const ndVector force(rhs->m_force); - - ndVector a(lhs->m_JMinv.m_jacobianM0.m_linear * forceM0); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM0.m_angular, torqueM0); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM1.m_linear, forceM1); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM1.m_angular, torqueM1); - a = ndVector(rhs->m_coordenateAccel - rhs->m_force * rhs->m_diagDamp) - a.AddHorizontal(); - - ndAssert(rhs->m_normalForceIndexFlat >= 0); - ndVector f(force + a.Scale(rhs->m_invJinvMJt)); - const ndInt32 frictionIndex = rhs->m_normalForceIndexFlat; - const ndFloat32 frictionNormal = m_rightHandSide[frictionIndex].m_force; - const ndVector lowerFrictionForce(frictionNormal * rhs->m_lowerBoundFrictionCoefficent); - const ndVector upperFrictionForce(frictionNormal * rhs->m_upperBoundFrictionCoefficent); - - a = a & (f < upperFrictionForce) & (f > lowerFrictionForce); - accNorm = accNorm.MulAdd(a, a); - - f = f.GetMax(lowerFrictionForce).GetMin(upperFrictionForce); - rhs->m_force = f.GetScalar(); - - const ndVector deltaForce(f - force); - const ndVector deltaForce0(deltaForce * preconditioner0); - const ndVector deltaForce1(deltaForce * preconditioner1); - forceM0 = forceM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_linear, deltaForce0); - torqueM0 = torqueM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_angular, deltaForce0); - forceM1 = forceM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_linear, deltaForce1); - torqueM1 = torqueM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_angular, deltaForce1); - } - - const ndFloat32 tol = ndFloat32(0.125f); - const ndFloat32 tol2 = tol * tol; - - ndVector maxAccel(accNorm); - for (ndInt32 k = 0; (k < 4) && (maxAccel.GetScalar() > tol2); ++k) - { - maxAccel = zero; - for (ndInt32 j = 0; j < rowsCount; ++j) - { - ndRightHandSide* const rhs = &m_rightHandSide[rowStart + j]; - const ndLeftHandSide* const lhs = &m_leftHandSide[rowStart + j]; - const ndVector force(rhs->m_force); - - ndVector a(lhs->m_JMinv.m_jacobianM0.m_linear * forceM0); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM0.m_angular, torqueM0); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM1.m_linear, forceM1); - a = a.MulAdd(lhs->m_JMinv.m_jacobianM1.m_angular, torqueM1); - a = ndVector(rhs->m_coordenateAccel - rhs->m_force * rhs->m_diagDamp) - a.AddHorizontal(); - - ndVector f(force + a.Scale(rhs->m_invJinvMJt)); - ndAssert(rhs->m_normalForceIndexFlat >= 0); - const ndInt32 frictionIndex = rhs->m_normalForceIndexFlat; - const ndFloat32 frictionNormal = m_rightHandSide[frictionIndex].m_force; - - const ndVector lowerFrictionForce(frictionNormal * rhs->m_lowerBoundFrictionCoefficent); - const ndVector upperFrictionForce(frictionNormal * rhs->m_upperBoundFrictionCoefficent); - - a = a & (f < upperFrictionForce) & (f > lowerFrictionForce); - maxAccel = maxAccel.MulAdd(a, a); - - f = f.GetMax(lowerFrictionForce).GetMin(upperFrictionForce); - rhs->m_force = f.GetScalar(); - - const ndVector deltaForce(f - force); - const ndVector deltaForce0(deltaForce * preconditioner0); - const ndVector deltaForce1(deltaForce * preconditioner1); - forceM0 = forceM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_linear, deltaForce0); - torqueM0 = torqueM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_angular, deltaForce0); - forceM1 = forceM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_linear, deltaForce1); - torqueM1 = torqueM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_angular, deltaForce1); - } - } - } - - ndVector forceM0(zero); - ndVector torqueM0(zero); - ndVector forceM1(zero); - ndVector torqueM1(zero); - - for (ndInt32 j = 0; j < rowsCount; ++j) - { - ndRightHandSide* const rhs = &m_rightHandSide[rowStart + j]; - const ndLeftHandSide* const lhs = &m_leftHandSide[rowStart + j]; - - const ndVector f(rhs->m_force); - forceM0 = forceM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_linear, f); - torqueM0 = torqueM0.MulAdd(lhs->m_Jt.m_jacobianM0.m_angular, f); - forceM1 = forceM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_linear, f); - torqueM1 = torqueM1.MulAdd(lhs->m_Jt.m_jacobianM1.m_angular, f); - rhs->m_maxImpact = ndMax(ndAbs(f.GetScalar()), rhs->m_maxImpact); - } - - const ndInt32 index0 = jointIndex * 2 + 0; - ndJacobian& outBody0 = jointPartialForces[index0]; - outBody0.m_linear = forceM0; - outBody0.m_angular = torqueM0; - - const ndInt32 index1 = jointIndex * 2 + 1; - ndJacobian& outBody1 = jointPartialForces[index1]; - outBody1.m_linear = forceM1; - outBody1.m_angular = torqueM1; - }; - - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator0.fetch_add(D_WORKER_BATCH_SIZE); i < jointCount; i = iterator0.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((jointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : jointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndConstraint* const joint = jointArray[i + j]; - JointForce(joint, i + j); - } - } - }); - - ndAtomic iterator1(0); - auto ApplyJacobianAccumulatePartialForces = ndMakeObject::ndFunction([this, &iterator1, &bodyArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(ApplyJacobianAccumulatePartialForces); - const ndVector zero(ndVector::m_zero); - - ndJacobian* const internalForces = &GetInternalForces()[0]; - const ndInt32* const bodyIndex = &GetJointForceIndexBuffer()[0]; - - const ndJacobian* const jointInternalForces = &GetTempInternalForces()[0]; - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - - const ndInt32 bodyCount = ndInt32 (bodyArray.GetCount()); - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < bodyCount; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((bodyCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : bodyCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndVector force(zero); - ndVector torque(zero); - const ndInt32 m = i + j; - const ndBodyKinematic* const body = bodyArray[m]; - - const ndInt32 startIndex = bodyIndex[m]; - const ndInt32 mask = body->m_isStatic - 1; - const ndInt32 count = mask & (bodyIndex[m + 1] - startIndex); - for (ndInt32 k = 0; k < count; ++k) - { - const ndInt32 index = jointBodyPairIndexBuffer[startIndex + k].m_joint; - force += jointInternalForces[index].m_linear; - torque += jointInternalForces[index].m_angular; - } - internalForces[m].m_linear = force; - internalForces[m].m_angular = torque; - } - } - }); - - for (ndInt32 i = 0; i < ndInt32(passes); ++i) - { - iterator0 = 0; - iterator1 = 0; - scene->ParallelExecute(CalculateJointsForce); - scene->ParallelExecute(ApplyJacobianAccumulatePartialForces); - } -} - -void ndDynamicsUpdate::CalculateForces() -{ - D_TRACKTIME(); - if (m_world->GetScene()->GetActiveContactArray().GetCount()) - { - m_firstPassCoef = ndFloat32(0.0f); - - InitSkeletons(); - for (ndInt32 step = 0; step < 4; step++) - { - CalculateJointsAcceleration(); - CalculateJointsForce(); - UpdateSkeletons(); - IntegrateBodiesVelocity(); - } - UpdateForceFeedback(); - } -} - -void ndDynamicsUpdate::Update() -{ - D_TRACKTIME(); - m_timestep = m_world->GetScene()->GetTimestep(); - - BuildIsland(); - IntegrateUnconstrainedBodies(); - InitWeights(); - InitBodyArray(); - InitJacobianMatrix(); - CalculateForces(); - IntegrateBodies(); - DetermineSleepStates(); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdate.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdate.h deleted file mode 100644 index afebc6cb53..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdate.h +++ /dev/null @@ -1,214 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_WORLD_DYNAMICS_UPDATE_H__ -#define __ND_WORLD_DYNAMICS_UPDATE_H__ - -#include "ndNewtonStdafx.h" - -#define D_MAX_BODY_RADIX_BIT 9 - -// the solver is a RK order 4, but instead of weighting the intermediate derivative by the usual 1/6, 1/3, 1/3, 1/6 coefficients -// I am using 1/4, 1/4, 1/4, 1/4. -// This is correct.The weighting coefficients of any RK method comes from an arbitrary criteria -// solving for a set of linear equation on the coefficients. -// The standard coefficients just happen to lead to an accurate result because they are optimal -// with respect to a second order solution.For differential equations of higher order, then is not -// clear if the traditional weigh factors are any better than any other set of weighting factors. -// A different set of coefficient generates results that are not much different than the optimal set, -// but it allows for simpler calculation of the intermediate derivatives and also for less intermediate memory. -// For more detail on the derivation of the Runge Kutta coefficients you can go to: -// http://pathfinder.scar.utoronto.ca/~dyer/csca57/book_P/node51.html - -class ndWorld; - -D_MSV_NEWTON_ALIGN_32 -class ndDynamicsUpdate : public ndClassAlloc -{ - public: - class ndJointBodyPairIndex - { - public: - ndInt32 m_body; - ndInt32 m_joint; - }; - - class ndBodyIndexPair - { - public: - ndBodyKinematic* m_body; - ndBodyKinematic* m_root; - }; - - class ndIsland - { - public: - ndIsland(ndBodyKinematic* const root) - :m_start(0) - , m_count(0) - , m_root(root) - { - } - - ndInt32 m_start; - ndInt32 m_count; - ndBodyKinematic* m_root; - }; - - public: - ndDynamicsUpdate(ndWorld* const world); - virtual ~ndDynamicsUpdate(); - - virtual const char* GetStringId() const; - ndInt32 GetUnconstrainedBodyCount() const; - - ndVector GetVelocTol() const; - ndFloat32 GetTimestepRK() const; - ndArray& GetIslands(); - ndArray& GetInternalForces(); - ndArray& GetLeftHandSide(); - ndArray& GetJointForceIndexBuffer(); - ndArray& GetRightHandSide(); - ndArray& GetTempInternalForces(); - ndArray& GetBodyIslandOrder(); - ndArray& GetJointBodyPairIndexBuffer(); - - private: - void SortJoints(); - void SortIslands(); - void BuildIsland(); - void InitWeights(); - void InitBodyArray(); - void InitSkeletons(); - void CalculateForces(); - void IntegrateBodies(); - void UpdateSkeletons(); - void InitJacobianMatrix(); - void UpdateForceFeedback(); - void CalculateJointsForce(); - void IntegrateBodiesVelocity(); - void CalculateJointsAcceleration(); - void IntegrateUnconstrainedBodies(); - - void DetermineSleepStates(); - void GetJacobianDerivatives(ndConstraint* const joint); - - protected: - void Clear(); - virtual void Update(); - void SortJointsScan(); - void SortBodyJointScan(); - ndBodyKinematic* FindRootAndSplit(ndBodyKinematic* const body); - - ndVector m_velocTol; - ndArray m_islands; - ndArray m_jointForcesIndex; - ndArray m_internalForces; - ndArray m_leftHandSide; - ndArray m_rightHandSide; - ndArray m_tempInternalForces; - ndArray m_bodyIslandOrder; - ndArray m_jointBodyPairIndexBuffer; - - ndWorld* m_world; - ndFloat32 m_timestep; - ndFloat32 m_invTimestep; - ndFloat32 m_firstPassCoef; - ndFloat32 m_invStepRK; - ndFloat32 m_timestepRK; - ndFloat32 m_invTimestepRK; - ndUnsigned32 m_solverPasses; - ndInt32 m_activeJointCount; - ndInt32 m_unConstrainedBodyCount; - - friend class ndWorld; - friend class ndSkeletonContainer; -} D_GCC_NEWTON_ALIGN_32; - -inline ndVector ndDynamicsUpdate::GetVelocTol() const -{ - return m_velocTol; -} - -inline ndFloat32 ndDynamicsUpdate::GetTimestepRK() const -{ - return m_timestepRK; -} - -inline ndArray& ndDynamicsUpdate::GetIslands() -{ - return m_islands; -} - -inline ndArray& ndDynamicsUpdate::GetInternalForces() -{ - return m_internalForces; -} - -inline ndArray& ndDynamicsUpdate::GetTempInternalForces() -{ - return m_tempInternalForces; -} - -inline ndArray& ndDynamicsUpdate::GetLeftHandSide() -{ - return m_leftHandSide; -} - -inline ndArray& ndDynamicsUpdate::GetRightHandSide() -{ - return m_rightHandSide; -} - -inline ndArray& ndDynamicsUpdate::GetBodyIslandOrder() -{ - return m_bodyIslandOrder; -} - -inline ndInt32 ndDynamicsUpdate::GetUnconstrainedBodyCount() const -{ - return m_unConstrainedBodyCount; -} - -inline ndArray& ndDynamicsUpdate::GetJointBodyPairIndexBuffer() -{ - return m_jointBodyPairIndexBuffer; -} - -inline ndArray& ndDynamicsUpdate::GetJointForceIndexBuffer() -{ - return m_jointForcesIndex; -} - -inline ndBodyKinematic* ndDynamicsUpdate::FindRootAndSplit(ndBodyKinematic* const body) -{ - ndBodyKinematic* node = body; - while (node->m_islandParent != node) - { - ndBodyKinematic* const prev = node; - node = node->m_islandParent; - prev->m_islandParent = node->m_islandParent; - } - return node; -} - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdateSoa.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdateSoa.cpp deleted file mode 100644 index 0445b3faa8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdateSoa.cpp +++ /dev/null @@ -1,1745 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndBodyDynamic.h" -#include "ndSkeletonList.h" -#include "ndDynamicsUpdateSoa.h" -#include "ndJointBilateralConstraint.h" - -#define D_SSE_WORK_GROUP 4 -#define D_SSE_DEFAULT_BUFFER_SIZE 1024 -using namespace ndSoa; - -ndDynamicsUpdateSoa::ndDynamicsUpdateSoa(ndWorld* const world) - :ndDynamicsUpdate(world) - ,m_ordinals(0, 1, 2, 3) - ,m_groupType(D_SSE_DEFAULT_BUFFER_SIZE) - ,m_jointMask(D_SSE_DEFAULT_BUFFER_SIZE) - ,m_soaJointRows(D_SSE_DEFAULT_BUFFER_SIZE) - ,m_soaMassMatrix(D_SSE_DEFAULT_BUFFER_SIZE * 4) -{ -} - -ndDynamicsUpdateSoa::~ndDynamicsUpdateSoa() -{ - Clear(); - - m_jointMask.Resize(D_SSE_DEFAULT_BUFFER_SIZE); - m_groupType.Resize(D_SSE_DEFAULT_BUFFER_SIZE); - m_soaJointRows.Resize(D_SSE_DEFAULT_BUFFER_SIZE); - m_soaMassMatrix.Resize(D_SSE_DEFAULT_BUFFER_SIZE * 4); -} - -const char* ndDynamicsUpdateSoa::GetStringId() const -{ - return "sse soa"; -} - -void ndDynamicsUpdateSoa::DetermineSleepStates() -{ - D_TRACKTIME(); - - ndAtomic iterator(0); - auto CalculateSleepState = ndMakeObject::ndFunction([this, &iterator](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CalculateSleepState); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyIndex = GetJointForceIndexBuffer(); - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - ndConstraint** const jointArray = &scene->GetActiveContactArray()[0]; - ndBodyKinematic** const bodyArray = &scene->GetActiveBodyArray()[0]; - - const ndVector zero(ndVector::m_zero); - const ndInt32 bodyCount = ndInt32(bodyIndex.GetCount()) - 1; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < bodyCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((bodyCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : bodyCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 m = i + j; - const ndInt32 index = bodyIndex[m]; - ndBodyKinematic* const body = bodyArray[jointBodyPairIndexBuffer[index].m_body]; - ndAssert(body->m_isStatic <= 1); - ndAssert(body->m_index == jointBodyPairIndexBuffer[index].m_body); - const ndInt32 mask = ndInt32(body->m_isStatic) - 1; - const ndInt32 count = mask & (bodyIndex[m + 1] - index); - if (count) - { - ndUnsigned8 equilibrium = body->m_isJointFence0; - if (equilibrium & body->m_autoSleep) - { - for (ndInt32 k = 0; k < count; ++k) - { - const ndJointBodyPairIndex& scan = jointBodyPairIndexBuffer[index + k]; - ndConstraint* const joint = jointArray[scan.m_joint >> 1]; - ndBodyKinematic* const body1 = (joint->GetBody0() == body) ? joint->GetBody1() : joint->GetBody0(); - ndAssert(body1 != body); - equilibrium = ndUnsigned8(equilibrium & body1->m_isJointFence0); - } - } - body->m_equilibrium = ndUnsigned8(equilibrium & body->m_autoSleep); - if (body->m_equilibrium) - { - body->m_veloc = zero; - body->m_omega = zero; - } - } - } - } - }); - - ndScene* const scene = m_world->GetScene(); - if (scene->GetActiveContactArray().GetCount()) - { - scene->ParallelExecute(CalculateSleepState); - } -} - -void ndDynamicsUpdateSoa::SortJoints() -{ - D_TRACKTIME(); - - SortJointsScan(); - if (!m_activeJointCount) - { - return; - } - - ndScene* const scene = m_world->GetScene(); - ndArray& jointArray = scene->GetActiveContactArray(); - - const ndInt32 mask = -ndInt32(D_SSE_WORK_GROUP); - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - const ndInt32 soaJointCount = (jointCount + D_SSE_WORK_GROUP - 1) & mask; - ndAssert(jointArray.GetCapacity() > soaJointCount); - ndConstraint** const jointArrayPtr = &jointArray[0]; - for (ndInt32 i = jointCount; i < soaJointCount; ++i) - { - jointArrayPtr[i] = nullptr; - } - - if (m_activeJointCount - jointArray.GetCount()) - { - const ndInt32 base = m_activeJointCount & mask; - const ndInt32 count = jointArrayPtr[base + D_SSE_WORK_GROUP - 1] ? D_SSE_WORK_GROUP : ndInt32 (jointArray.GetCount()) - base; - ndAssert(count <= D_SSE_WORK_GROUP); - ndConstraint** const array = &jointArrayPtr[base]; - for (ndInt32 j = 1; j < count; ++j) - { - ndInt32 slot = j; - ndConstraint* const joint = array[slot]; - for (; (slot > 0) && (array[slot - 1]->m_rowCount < joint->m_rowCount); slot--) - { - array[slot] = array[slot - 1]; - } - array[slot] = joint; - } - } - - const ndInt32 soaJointCountBatches = soaJointCount / D_SSE_WORK_GROUP; - m_jointMask.SetCount(soaJointCountBatches); - m_groupType.SetCount(soaJointCountBatches); - m_soaJointRows.SetCount(soaJointCountBatches); - - ndInt32 rowsCount = 0; - ndInt32 soaJointRowCount = 0; - auto SetRowStarts = ndMakeObject::ndFunction([this, &jointArray, &rowsCount, &soaJointRowCount](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(SetRowStarts); - auto SetRowsCount = [&jointArray, &rowsCount]() - { - ndInt32 rowCount = 1; - const ndInt32 count = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = 0; i < count; ++i) - { - ndConstraint* const joint = jointArray[i]; - joint->m_rowStart = rowCount; - rowCount += joint->m_rowCount; - } - rowsCount = rowCount; - }; - - auto SetSoaRowsCount = [this, &jointArray, &soaJointRowCount]() - { - ndInt32 rowCount = 0; - ndArray& soaJointRows = m_soaJointRows; - const ndInt32 count = ndInt32 (soaJointRows.GetCount()); - for (ndInt32 i = 0; i < count; ++i) - { - const ndConstraint* const joint = jointArray[i * D_SSE_WORK_GROUP]; - soaJointRows[i] = rowCount; - rowCount += joint->m_rowCount; - } - soaJointRowCount = rowCount; - }; - - if (threadCount == 1) - { - SetRowsCount(); - SetSoaRowsCount(); - } - else if (threadIndex == 0) - { - SetRowsCount(); - } - //else if (threadIndex == (threadCount - 1)) - else if (threadIndex == 1) - { - SetSoaRowsCount(); - } - }); - - scene->ParallelExecute(SetRowStarts); - m_leftHandSide.SetCount(rowsCount); - m_rightHandSide.SetCount(rowsCount); - m_soaMassMatrix.SetCount(soaJointRowCount); - - #ifdef _DEBUG - ndAssert(m_activeJointCount <= jointArray.GetCount()); - const ndInt32 maxRowCount = ndInt32 (m_leftHandSide.GetCount()); - for (ndInt32 i = 0; i < ndInt32 (jointArray.GetCount()); ++i) - { - ndConstraint* const joint = jointArray[i]; - ndAssert(joint->m_rowStart < ndInt32 (m_leftHandSide.GetCount())); - ndAssert((joint->m_rowStart + joint->m_rowCount) <= maxRowCount); - } - - for (ndInt32 i = 0; i < jointCount; i += D_SSE_WORK_GROUP) - { - const ndInt32 count = jointArrayPtr[i + D_SSE_WORK_GROUP - 1] ? D_SSE_WORK_GROUP : jointCount - i; - for (ndInt32 j = 1; j < count; ++j) - { - ndConstraint* const joint0 = jointArrayPtr[i + j - 1]; - ndConstraint* const joint1 = jointArrayPtr[i + j - 0]; - ndAssert(joint0->m_rowCount >= joint1->m_rowCount); - } - } - #endif - - SortBodyJointScan(); -} - -void ndDynamicsUpdateSoa::SortIslands() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyArray = scene->GetActiveBodyArray(); - ndArray& activeBodyArray = GetBodyIslandOrder(); - GetInternalForces().SetCount(bodyArray.GetCount()); - activeBodyArray.SetCount(bodyArray.GetCount()); - - ndInt32 histogram[D_MAX_THREADS_COUNT][3]; - auto Scan0 = ndMakeObject::ndFunction([&bodyArray, &histogram](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(Scan0); - ndInt32* const hist = &histogram[threadIndex][0]; - hist[0] = 0; - hist[1] = 0; - hist[2] = 0; - - ndInt32 map[4]; - map[0] = 0; - map[1] = 1; - map[2] = 2; - map[3] = 2; - const ndStartEnd startEnd(ndInt32 (bodyArray.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndBodyKinematic* const body = bodyArray[i]; - ndInt32 key = map[body->m_equilibrium0 * 2 + 1 - body->m_isConstrained]; - ndAssert(key < 3); - hist[key] = hist[key] + 1; - } - }); - - auto Sort0 = ndMakeObject::ndFunction([&bodyArray, &activeBodyArray, &histogram](ndInt32 threadIndex, ndInt32 threadCount) - { - D_TRACKTIME_NAMED(Sort0); - ndInt32* const hist = &histogram[threadIndex][0]; - - ndInt32 map[4]; - map[0] = 0; - map[1] = 1; - map[2] = 2; - map[3] = 2; - - const ndStartEnd startEnd(ndInt32 (bodyArray.GetCount()), threadIndex, threadCount); - for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i) - { - ndBodyKinematic* const body = bodyArray[i]; - ndInt32 key = map[body->m_equilibrium0 * 2 + 1 - body->m_isConstrained]; - ndAssert(key < 3); - const ndInt32 entry = hist[key]; - activeBodyArray[entry] = body; - hist[key] = entry + 1; - } - }); - - scene->ParallelExecute(Scan0); - - ndInt32 scan[3]; - scan[0] = 0; - scan[1] = 0; - scan[2] = 0; - const ndInt32 threadCount = scene->GetThreadCount(); - - ndInt32 sum = 0; - for (ndInt32 i = 0; i < 3; ++i) - { - for (ndInt32 j = 0; j < threadCount; ++j) - { - ndInt32 partialSum = histogram[j][i]; - histogram[j][i] = sum; - sum += partialSum; - } - scan[i] = sum; - } - - scene->ParallelExecute(Sort0); - activeBodyArray.SetCount(scan[1]); - m_unConstrainedBodyCount = scan[1] - scan[0]; -} - -void ndDynamicsUpdateSoa::BuildIsland() -{ - m_unConstrainedBodyCount = 0; - GetBodyIslandOrder().SetCount(0); - ndScene* const scene = m_world->GetScene(); - const ndArray& bodyArray = scene->GetActiveBodyArray(); - ndAssert(bodyArray.GetCount() >= 1); - if (bodyArray.GetCount() - 1) - { - D_TRACKTIME(); - SortJoints(); - SortIslands(); - } -} - -void ndDynamicsUpdateSoa::IntegrateUnconstrainedBodies() -{ - ndScene* const scene = m_world->GetScene(); - ndAtomic iterator(0); - auto IntegrateUnconstrainedBodies = ndMakeObject::ndFunction([this, &iterator, &scene](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(IntegrateUnconstrainedBodies); - ndArray& bodyArray = GetBodyIslandOrder(); - - const ndFloat32 timestep = scene->GetTimestep(); - const ndInt32 base = ndInt32 (bodyArray.GetCount() - GetUnconstrainedBodyCount()); - - const ndInt32 count = GetUnconstrainedBodyCount(); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[base + i + j]; - ndAssert(body); - body->UpdateInvInertiaMatrix(); - body->AddDampingAcceleration(timestep); - body->IntegrateExternalForce(timestep); - } - } - }); - - if (GetUnconstrainedBodyCount()) - { - D_TRACKTIME(); - scene->ParallelExecute(IntegrateUnconstrainedBodies); - } -} - -void ndDynamicsUpdateSoa::InitWeights() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - m_invTimestep = ndFloat32(1.0f) / m_timestep; - m_invStepRK = ndFloat32(0.25f); - m_timestepRK = m_timestep * m_invStepRK; - m_invTimestepRK = m_invTimestep * ndFloat32(4.0f); - - const ndArray& bodyArray = scene->GetActiveBodyArray(); - const ndInt32 bodyCount = ndInt32 (bodyArray.GetCount()); - GetInternalForces().SetCount(bodyCount); - - ndInt32 extraPassesArray[D_MAX_THREADS_COUNT]; - - ndAtomic iterator(0); - auto InitWeights = ndMakeObject::ndFunction([this, &iterator, &bodyArray, &extraPassesArray](ndInt32 threadIndex, ndInt32) - { - D_TRACKTIME_NAMED(InitWeights); - const ndArray& jointForceIndexBuffer = GetJointForceIndexBuffer(); - const ndArray& jointBodyPairIndex = GetJointBodyPairIndexBuffer(); - - ndInt32 maxExtraPasses = 1; - const ndInt32 jointCount = ndInt32 (jointForceIndexBuffer.GetCount()) - 1; - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < jointCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((jointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : jointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 index = jointForceIndexBuffer[i + j]; - const ndJointBodyPairIndex& scan = jointBodyPairIndex[index]; - ndBodyKinematic* const body = bodyArray[scan.m_body]; - ndAssert(body->m_index == scan.m_body); - ndAssert(body->m_isConstrained <= 1); - const ndInt32 count = jointForceIndexBuffer[i + j + 1] - index - 1; - const ndInt32 mask = -ndInt32(body->m_isConstrained & ~body->m_isStatic); - const ndInt32 weigh = 1 + (mask & count); - ndAssert(weigh >= 0); - if (weigh) - { - body->m_weigh = ndFloat32(weigh); - } - maxExtraPasses = ndMax(weigh, maxExtraPasses); - } - } - extraPassesArray[threadIndex] = maxExtraPasses; - }); - - if (scene->GetActiveContactArray().GetCount()) - { - scene->ParallelExecute(InitWeights); - - ndInt32 extraPasses = 0; - const ndInt32 threadCount = scene->GetThreadCount(); - for (ndInt32 i = 0; i < threadCount; ++i) - { - extraPasses = ndMax(extraPasses, extraPassesArray[i]); - } - - const ndInt32 conectivity = 7; - m_solverPasses = ndUnsigned32 (m_world->GetSolverIterations() + 2 * extraPasses / conectivity + 2); - } -} - -void ndDynamicsUpdateSoa::IntegrateBodies() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndVector invTime(m_invTimestep); - const ndFloat32 timestep = scene->GetTimestep(); - - ndAtomic iterator(0); - auto IntegrateBodies = ndMakeObject::ndFunction([this, &iterator, timestep, invTime](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(IntegrateBodies); - const ndWorld* const world = m_world; - const ndArray& bodyArray = GetBodyIslandOrder(); - - const ndFloat32 speedFreeze2 = world->m_freezeSpeed2; - const ndFloat32 accelFreeze2 = world->m_freezeAccel2; - - const ndInt32 count = ndInt32 (bodyArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - if (!body->m_equilibrium) - { - body->SetAcceleration(invTime * (body->m_veloc - body->m_accel), invTime * (body->m_omega - body->m_alpha)); - body->IntegrateVelocity(timestep); - } - body->EvaluateSleepState(speedFreeze2, accelFreeze2); - } - } - }); - scene->ParallelExecute(IntegrateBodies); -} - -void ndDynamicsUpdateSoa::InitBodyArray() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndFloat32 timestep = scene->GetTimestep(); - - ndAtomic iterator(0); - auto InitBodyArray = ndMakeObject::ndFunction([this, &iterator, timestep](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitBodyArray); - const ndArray& bodyArray = GetBodyIslandOrder(); - const ndInt32 count = ndInt32 (bodyArray.GetCount() - GetUnconstrainedBodyCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - ndAssert(body); - ndAssert(body->m_isConstrained | body->m_isStatic); - - body->UpdateInvInertiaMatrix(); - body->AddDampingAcceleration(timestep); - const ndVector angularMomentum(body->CalculateAngularMomentum()); - body->m_gyroTorque = body->m_omega.CrossProduct(angularMomentum); - body->m_gyroAlpha = body->m_invWorldInertiaMatrix.RotateVector(body->m_gyroTorque); - - body->m_accel = body->m_veloc; - body->m_alpha = body->m_omega; - body->m_gyroRotation = body->m_rotation; - } - } - }); - scene->ParallelExecute(InitBodyArray); -} - -void ndDynamicsUpdateSoa::GetJacobianDerivatives(ndConstraint* const joint) -{ - ndConstraintDescritor constraintParam; - ndAssert(joint->GetRowsCount() <= D_CONSTRAINT_MAX_ROWS); - for (ndInt32 i = ndInt32(joint->GetRowsCount() - 1); i >= 0; --i) - { - constraintParam.m_forceBounds[i].m_low = D_MIN_BOUND; - constraintParam.m_forceBounds[i].m_upper = D_MAX_BOUND; - constraintParam.m_forceBounds[i].m_jointForce = nullptr; - constraintParam.m_forceBounds[i].m_normalIndex = D_INDEPENDENT_ROW; - } - - constraintParam.m_rowsCount = 0; - constraintParam.m_timestep = m_timestep; - constraintParam.m_invTimestep = m_invTimestep; - joint->JacobianDerivative(constraintParam); - const ndInt32 dof = constraintParam.m_rowsCount; - ndAssert(dof <= joint->m_rowCount); - - if (joint->GetAsContact()) - { - ndContact* const contactJoint = joint->GetAsContact(); - contactJoint->m_isInSkeletonLoop = 0; - ndSkeletonContainer* const skeleton0 = contactJoint->GetBody0()->GetSkeleton(); - ndSkeletonContainer* const skeleton1 = contactJoint->GetBody1()->GetSkeleton(); - if (skeleton0 && (skeleton0 == skeleton1)) - { - if (contactJoint->IsSkeletonSelftCollision()) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(contactJoint); - } - } - else - { - if (skeleton0 && !skeleton1) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(contactJoint); - } - else if (skeleton1 && !skeleton0) - { - contactJoint->m_isInSkeletonLoop = 1; - skeleton1->AddCloseLoopJoint(contactJoint); - } - } - } - else - { - ndJointBilateralConstraint* const bilareral = joint->GetAsBilateral(); - ndAssert(bilareral); - if (!bilareral->m_isInSkeleton && (bilareral->GetSolverModel() == m_jointkinematicAttachment)) - { - ndSkeletonContainer* const skeleton0 = bilareral->m_body0->GetSkeleton(); - ndSkeletonContainer* const skeleton1 = bilareral->m_body1->GetSkeleton(); - if (skeleton0 || skeleton1) - { - if (skeleton0 && !skeleton1) - { - bilareral->m_isInSkeletonLoop = 1; - skeleton0->AddCloseLoopJoint(bilareral); - } - else if (skeleton1 && !skeleton0) - { - bilareral->m_isInSkeletonLoop = 1; - skeleton1->AddCloseLoopJoint(bilareral); - } - } - } - } - - joint->m_rowCount = dof; - const ndInt32 baseIndex = joint->m_rowStart; - for (ndInt32 i = 0; i < dof; ++i) - { - ndAssert(constraintParam.m_forceBounds[i].m_jointForce); - - ndLeftHandSide* const row = &m_leftHandSide[baseIndex + i]; - ndRightHandSide* const rhs = &m_rightHandSide[baseIndex + i]; - - row->m_Jt = constraintParam.m_jacobian[i]; - rhs->m_diagDamp = ndFloat32(0.0f); - rhs->m_diagonalRegularizer = ndMax(constraintParam.m_diagonalRegularizer[i], ndFloat32(1.0e-5f)); - - rhs->m_coordenateAccel = constraintParam.m_jointAccel[i]; - rhs->m_restitution = constraintParam.m_restitution[i]; - rhs->m_penetration = constraintParam.m_penetration[i]; - rhs->m_penetrationStiffness = constraintParam.m_penetrationStiffness[i]; - rhs->m_lowerBoundFrictionCoefficent = constraintParam.m_forceBounds[i].m_low; - rhs->m_upperBoundFrictionCoefficent = constraintParam.m_forceBounds[i].m_upper; - rhs->m_jointFeebackForce = constraintParam.m_forceBounds[i].m_jointForce; - - ndAssert(constraintParam.m_forceBounds[i].m_normalIndex >= -1); - rhs->m_normalForceIndex = constraintParam.m_forceBounds[i].m_normalIndex; - } -} - -void ndDynamicsUpdateSoa::InitJacobianMatrix() -{ - ndScene* const scene = m_world->GetScene(); - ndBodyKinematic** const bodyArray = &scene->GetActiveBodyArray()[0]; - ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator(0); - auto InitJacobianMatrix = ndMakeObject::ndFunction([this, &iterator, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitJacobianMatrix); - ndJacobian* const internalForces = &GetTempInternalForces()[0]; - auto BuildJacobianMatrix = [this, &internalForces](ndConstraint* const joint, ndInt32 jointIndex) - { - ndAssert(joint->GetBody0()); - ndAssert(joint->GetBody1()); - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - - const ndVector force0(body0->GetForce()); - const ndVector torque0(body0->GetTorque()); - const ndVector force1(body1->GetForce()); - const ndVector torque1(body1->GetTorque()); - - const ndInt32 index = joint->m_rowStart; - const ndInt32 count = joint->m_rowCount; - const ndMatrix& invInertia0 = body0->m_invWorldInertiaMatrix; - const ndMatrix& invInertia1 = body1->m_invWorldInertiaMatrix; - const ndVector invMass0(body0->m_invMass[3]); - const ndVector invMass1(body1->m_invMass[3]); - - const ndVector zero(ndVector::m_zero); - ndVector forceAcc0(zero); - ndVector torqueAcc0(zero); - ndVector forceAcc1(zero); - ndVector torqueAcc1(zero); - const ndVector weigh0(body0->m_weigh); - const ndVector weigh1(body1->m_weigh); - - const bool isBilateral = joint->IsBilateral(); - for (ndInt32 i = 0; i < count; ++i) - { - ndLeftHandSide* const row = &m_leftHandSide[index + i]; - ndRightHandSide* const rhs = &m_rightHandSide[index + i]; - - row->m_JMinv.m_jacobianM0.m_linear = row->m_Jt.m_jacobianM0.m_linear * invMass0; - row->m_JMinv.m_jacobianM0.m_angular = invInertia0.RotateVector(row->m_Jt.m_jacobianM0.m_angular); - row->m_JMinv.m_jacobianM1.m_linear = row->m_Jt.m_jacobianM1.m_linear * invMass1; - row->m_JMinv.m_jacobianM1.m_angular = invInertia1.RotateVector(row->m_Jt.m_jacobianM1.m_angular); - - const ndJacobian& JMinvM0 = row->m_JMinv.m_jacobianM0; - const ndJacobian& JMinvM1 = row->m_JMinv.m_jacobianM1; - const ndVector tmpAccel( - JMinvM0.m_linear * force0 + JMinvM0.m_angular * torque0 + - JMinvM1.m_linear * force1 + JMinvM1.m_angular * torque1); - - const ndFloat32 extenalAcceleration = -tmpAccel.AddHorizontal().GetScalar(); - rhs->m_deltaAccel = extenalAcceleration; - rhs->m_coordenateAccel += extenalAcceleration; - ndAssert(rhs->m_jointFeebackForce); - const ndFloat32 force = rhs->m_jointFeebackForce->GetInitialGuess(); - - rhs->m_force = isBilateral ? ndClamp(force, rhs->m_lowerBoundFrictionCoefficent, rhs->m_upperBoundFrictionCoefficent) : force; - rhs->m_maxImpact = ndFloat32(0.0f); - - const ndJacobian& JtM0 = row->m_Jt.m_jacobianM0; - const ndJacobian& JtM1 = row->m_Jt.m_jacobianM1; - const ndVector tmpDiag( - weigh0 * (JMinvM0.m_linear * JtM0.m_linear + JMinvM0.m_angular * JtM0.m_angular) + - weigh1 * (JMinvM1.m_linear * JtM1.m_linear + JMinvM1.m_angular * JtM1.m_angular)); - - ndFloat32 diag = tmpDiag.AddHorizontal().GetScalar(); - ndAssert(diag > ndFloat32(0.0f)); - rhs->m_diagDamp = diag * rhs->m_diagonalRegularizer; - - diag *= (ndFloat32(1.0f) + rhs->m_diagonalRegularizer); - rhs->m_invJinvMJt = ndFloat32(1.0f) / diag; - - const ndVector f(rhs->m_force); - forceAcc0 = forceAcc0 + JtM0.m_linear * f; - torqueAcc0 = torqueAcc0 + JtM0.m_angular * f; - forceAcc1 = forceAcc1 + JtM1.m_linear * f; - torqueAcc1 = torqueAcc1 + JtM1.m_angular * f; - } - - const ndInt32 index0 = jointIndex * 2 + 0; - ndJacobian& outBody0 = internalForces[index0]; - outBody0.m_linear = forceAcc0; - outBody0.m_angular = torqueAcc0; - - const ndInt32 index1 = jointIndex * 2 + 1; - ndJacobian& outBody1 = internalForces[index1]; - outBody1.m_linear = forceAcc1; - outBody1.m_angular = torqueAcc1; - }; - - - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < jointCount; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((jointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : jointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndConstraint* const joint = jointArray[i + j]; - GetJacobianDerivatives(joint); - BuildJacobianMatrix(joint, i + j); - } - } - }); - - ndAtomic iterator1(0); - auto InitJacobianAccumulatePartialForces = ndMakeObject::ndFunction([this, &iterator1, &bodyArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitJacobianAccumulatePartialForces); - const ndVector zero(ndVector::m_zero); - ndJacobian* const internalForces = &GetInternalForces()[0]; - const ndArray& bodyIndex = GetJointForceIndexBuffer(); - - const ndJacobian* const jointInternalForces = &GetTempInternalForces()[0]; - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - - const ndInt32 bodyCount = ndInt32 (bodyIndex.GetCount()) - 1; - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < bodyCount; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((bodyCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : bodyCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndVector force(zero); - ndVector torque(zero); - - const ndInt32 m = i + j; - const ndInt32 index = bodyIndex[m]; - const ndJointBodyPairIndex& scan = jointBodyPairIndexBuffer[index]; - ndBodyKinematic* const body = bodyArray[scan.m_body]; - - ndAssert(body->m_isStatic <= 1); - ndAssert(body->m_index == scan.m_body); - const ndInt32 mask = ndInt32(body->m_isStatic) - 1; - const ndInt32 count = mask & (bodyIndex[m + 1] - index); - - for (ndInt32 k = 0; k < count; ++k) - { - const ndInt32 jointIndex = jointBodyPairIndexBuffer[index + k].m_joint; - force += jointInternalForces[jointIndex].m_linear; - torque += jointInternalForces[jointIndex].m_angular; - } - internalForces[m].m_linear = force; - internalForces[m].m_angular = torque; - } - } - }); - - ndAtomic iterator2(0); - auto TransposeMassMatrix = ndMakeObject::ndFunction([this, &iterator2, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(TransposeMassMatrix); - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - - const ndLeftHandSide* const leftHandSide = &GetLeftHandSide()[0]; - const ndRightHandSide* const rightHandSide = &GetRightHandSide()[0]; - ndArray& massMatrix = m_soaMassMatrix; - - const ndVector zero(ndVector::m_zero); - const ndVector ordinals(m_ordinals); - const ndInt32 mask = -ndInt32(D_SSE_WORK_GROUP); - const ndInt32 soaJointCount = ((jointCount + D_SSE_WORK_GROUP - 1) & mask) / D_SSE_WORK_GROUP; - - ndInt8* const groupType = &m_groupType[0]; - ndVector* const jointMask = &m_jointMask[0]; - const ndInt32* const soaJointRows = &m_soaJointRows[0]; - - ndConstraint** const jointsPtr = &jointArray[0]; - - for (ndInt32 i = iterator2.fetch_add(D_WORKER_BATCH_SIZE); i < soaJointCount; i = iterator2.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((soaJointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : soaJointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 m = i + j; - const ndInt32 index = m * D_SSE_WORK_GROUP; - ndInt32 maxRow = 0; - ndInt32 minRow = 255; - ndVector selectMask(ndVector::m_xyzwMask); - for (ndInt32 k = 0; k < D_SSE_WORK_GROUP; ++k) - { - ndConstraint* const joint = jointsPtr[index + k]; - if (joint) - { - const ndInt32 maxMask = (maxRow - joint->m_rowCount) >> 8; - const ndInt32 minMask = (minRow - joint->m_rowCount) >> 8; - maxRow = ( maxMask & joint->m_rowCount) | (~maxMask & maxRow); - minRow = (~minMask & joint->m_rowCount) | ( minMask & minRow); - if (!joint->m_rowCount) - { - selectMask[k] = ndFloat32(0.0f); - } - } - else - { - minRow = 0; - selectMask[k] = ndFloat32(0.0f); - } - } - ndAssert(maxRow >= 0); - ndAssert(minRow < 255); - jointMask[m] = selectMask; - - const ndInt8 isUniformGroup = (maxRow == minRow) & (maxRow > 0); - groupType[m] = isUniformGroup; - - const ndInt32 soaRowBase = soaJointRows[m]; - if (isUniformGroup) - { - const ndConstraint* const joint0 = jointsPtr[index + 0]; - const ndConstraint* const joint1 = jointsPtr[index + 1]; - const ndConstraint* const joint2 = jointsPtr[index + 2]; - const ndConstraint* const joint3 = jointsPtr[index + 3]; - - const ndInt32 rowCount = joint0->m_rowCount; - for (ndInt32 k = 0; k < rowCount; ++k) - { - ndVector tmp; - const ndLeftHandSide* const row0 = &leftHandSide[joint0->m_rowStart + k]; - const ndLeftHandSide* const row1 = &leftHandSide[joint1->m_rowStart + k]; - const ndLeftHandSide* const row2 = &leftHandSide[joint2->m_rowStart + k]; - const ndLeftHandSide* const row3 = &leftHandSide[joint3->m_rowStart + k]; - - ndSoa::ndSoaMatrixElement& row = massMatrix[soaRowBase + k]; - ndVector::Transpose4x4( - row.m_Jt.m_jacobianM0.m_linear.m_x, - row.m_Jt.m_jacobianM0.m_linear.m_y, - row.m_Jt.m_jacobianM0.m_linear.m_z, - tmp, - row0->m_Jt.m_jacobianM0.m_linear, - row1->m_Jt.m_jacobianM0.m_linear, - row2->m_Jt.m_jacobianM0.m_linear, - row3->m_Jt.m_jacobianM0.m_linear); - ndVector::Transpose4x4( - row.m_Jt.m_jacobianM0.m_angular.m_x, - row.m_Jt.m_jacobianM0.m_angular.m_y, - row.m_Jt.m_jacobianM0.m_angular.m_z, - tmp, - row0->m_Jt.m_jacobianM0.m_angular, - row1->m_Jt.m_jacobianM0.m_angular, - row2->m_Jt.m_jacobianM0.m_angular, - row3->m_Jt.m_jacobianM0.m_angular); - - ndVector::Transpose4x4( - row.m_Jt.m_jacobianM1.m_linear.m_x, - row.m_Jt.m_jacobianM1.m_linear.m_y, - row.m_Jt.m_jacobianM1.m_linear.m_z, - tmp, - row0->m_Jt.m_jacobianM1.m_linear, - row1->m_Jt.m_jacobianM1.m_linear, - row2->m_Jt.m_jacobianM1.m_linear, - row3->m_Jt.m_jacobianM1.m_linear); - ndVector::Transpose4x4( - row.m_Jt.m_jacobianM1.m_angular.m_x, - row.m_Jt.m_jacobianM1.m_angular.m_y, - row.m_Jt.m_jacobianM1.m_angular.m_z, - tmp, - row0->m_Jt.m_jacobianM1.m_angular, - row1->m_Jt.m_jacobianM1.m_angular, - row2->m_Jt.m_jacobianM1.m_angular, - row3->m_Jt.m_jacobianM1.m_angular); - - ndVector::Transpose4x4( - row.m_JMinv.m_jacobianM0.m_linear.m_x, - row.m_JMinv.m_jacobianM0.m_linear.m_y, - row.m_JMinv.m_jacobianM0.m_linear.m_z, - tmp, - row0->m_JMinv.m_jacobianM0.m_linear, - row1->m_JMinv.m_jacobianM0.m_linear, - row2->m_JMinv.m_jacobianM0.m_linear, - row3->m_JMinv.m_jacobianM0.m_linear); - ndVector::Transpose4x4( - row.m_JMinv.m_jacobianM0.m_angular.m_x, - row.m_JMinv.m_jacobianM0.m_angular.m_y, - row.m_JMinv.m_jacobianM0.m_angular.m_z, - tmp, - row0->m_JMinv.m_jacobianM0.m_angular, - row1->m_JMinv.m_jacobianM0.m_angular, - row2->m_JMinv.m_jacobianM0.m_angular, - row3->m_JMinv.m_jacobianM0.m_angular); - - ndVector::Transpose4x4( - row.m_JMinv.m_jacobianM1.m_linear.m_x, - row.m_JMinv.m_jacobianM1.m_linear.m_y, - row.m_JMinv.m_jacobianM1.m_linear.m_z, - tmp, - row0->m_JMinv.m_jacobianM1.m_linear, - row1->m_JMinv.m_jacobianM1.m_linear, - row2->m_JMinv.m_jacobianM1.m_linear, - row3->m_JMinv.m_jacobianM1.m_linear); - ndVector::Transpose4x4( - row.m_JMinv.m_jacobianM1.m_angular.m_x, - row.m_JMinv.m_jacobianM1.m_angular.m_y, - row.m_JMinv.m_jacobianM1.m_angular.m_z, - tmp, - row0->m_JMinv.m_jacobianM1.m_angular, - row1->m_JMinv.m_jacobianM1.m_angular, - row2->m_JMinv.m_jacobianM1.m_angular, - row3->m_JMinv.m_jacobianM1.m_angular); - - #ifdef D_NEWTON_USE_DOUBLE - ndInt64* const normalIndex = (ndInt64*)&row.m_normalForceIndex[0]; - #else - ndInt32* const normalIndex = (ndInt32*)&row.m_normalForceIndex[0]; - #endif - for (ndInt32 n = 0; n < D_SSE_WORK_GROUP; ++n) - { - const ndConstraint* const soaJoint = jointsPtr[index + n]; - const ndRightHandSide* const rhs = &rightHandSide[soaJoint->m_rowStart + k]; - row.m_force[n] = rhs->m_force; - row.m_diagDamp[n] = rhs->m_diagDamp; - row.m_invJinvMJt[n] = rhs->m_invJinvMJt; - row.m_coordenateAccel[n] = rhs->m_coordenateAccel; - normalIndex[n] = (rhs->m_normalForceIndex + 1) * D_SSE_WORK_GROUP + n; - row.m_lowerBoundFrictionCoefficent[n] = rhs->m_lowerBoundFrictionCoefficent; - row.m_upperBoundFrictionCoefficent[n] = rhs->m_upperBoundFrictionCoefficent; - } - } - } - else - { - for (ndInt32 k = 0; k < maxRow; ++k) - { - ndSoa::ndSoaMatrixElement& row = massMatrix[soaRowBase + k]; - row.m_Jt.m_jacobianM0.m_linear.m_x = zero; - row.m_Jt.m_jacobianM0.m_linear.m_y = zero; - row.m_Jt.m_jacobianM0.m_linear.m_z = zero; - row.m_Jt.m_jacobianM0.m_angular.m_x = zero; - row.m_Jt.m_jacobianM0.m_angular.m_y = zero; - row.m_Jt.m_jacobianM0.m_angular.m_z = zero; - row.m_Jt.m_jacobianM1.m_linear.m_x = zero; - row.m_Jt.m_jacobianM1.m_linear.m_y = zero; - row.m_Jt.m_jacobianM1.m_linear.m_z = zero; - row.m_Jt.m_jacobianM1.m_angular.m_x = zero; - row.m_Jt.m_jacobianM1.m_angular.m_y = zero; - row.m_Jt.m_jacobianM1.m_angular.m_z = zero; - - row.m_JMinv.m_jacobianM0.m_linear.m_x = zero; - row.m_JMinv.m_jacobianM0.m_linear.m_y = zero; - row.m_JMinv.m_jacobianM0.m_linear.m_z = zero; - row.m_JMinv.m_jacobianM0.m_angular.m_x = zero; - row.m_JMinv.m_jacobianM0.m_angular.m_y = zero; - row.m_JMinv.m_jacobianM0.m_angular.m_z = zero; - row.m_JMinv.m_jacobianM1.m_linear.m_x = zero; - row.m_JMinv.m_jacobianM1.m_linear.m_y = zero; - row.m_JMinv.m_jacobianM1.m_linear.m_z = zero; - row.m_JMinv.m_jacobianM1.m_angular.m_x = zero; - row.m_JMinv.m_jacobianM1.m_angular.m_y = zero; - row.m_JMinv.m_jacobianM1.m_angular.m_z = zero; - - row.m_force = zero; - row.m_diagDamp = zero; - row.m_invJinvMJt = zero; - row.m_coordenateAccel = zero; - row.m_normalForceIndex = ordinals; - row.m_lowerBoundFrictionCoefficent = zero; - row.m_upperBoundFrictionCoefficent = zero; - } - - for (ndInt32 k = 0; k < D_SSE_WORK_GROUP; ++k) - { - const ndConstraint* const joint = jointsPtr[index + k]; - if (joint) - { - for (ndInt32 n = 0; n < joint->m_rowCount; ++n) - { - ndSoa::ndSoaMatrixElement& row = massMatrix[soaRowBase + n]; - const ndLeftHandSide* const lhs = &leftHandSide[joint->m_rowStart + n]; - - row.m_Jt.m_jacobianM0.m_linear.m_x[k] = lhs->m_Jt.m_jacobianM0.m_linear.m_x; - row.m_Jt.m_jacobianM0.m_linear.m_y[k] = lhs->m_Jt.m_jacobianM0.m_linear.m_y; - row.m_Jt.m_jacobianM0.m_linear.m_z[k] = lhs->m_Jt.m_jacobianM0.m_linear.m_z; - row.m_Jt.m_jacobianM0.m_angular.m_x[k] = lhs->m_Jt.m_jacobianM0.m_angular.m_x; - row.m_Jt.m_jacobianM0.m_angular.m_y[k] = lhs->m_Jt.m_jacobianM0.m_angular.m_y; - row.m_Jt.m_jacobianM0.m_angular.m_z[k] = lhs->m_Jt.m_jacobianM0.m_angular.m_z; - row.m_Jt.m_jacobianM1.m_linear.m_x[k] = lhs->m_Jt.m_jacobianM1.m_linear.m_x; - row.m_Jt.m_jacobianM1.m_linear.m_y[k] = lhs->m_Jt.m_jacobianM1.m_linear.m_y; - row.m_Jt.m_jacobianM1.m_linear.m_z[k] = lhs->m_Jt.m_jacobianM1.m_linear.m_z; - row.m_Jt.m_jacobianM1.m_angular.m_x[k] = lhs->m_Jt.m_jacobianM1.m_angular.m_x; - row.m_Jt.m_jacobianM1.m_angular.m_y[k] = lhs->m_Jt.m_jacobianM1.m_angular.m_y; - row.m_Jt.m_jacobianM1.m_angular.m_z[k] = lhs->m_Jt.m_jacobianM1.m_angular.m_z; - - row.m_JMinv.m_jacobianM0.m_linear.m_x[k] = lhs->m_JMinv.m_jacobianM0.m_linear.m_x; - row.m_JMinv.m_jacobianM0.m_linear.m_y[k] = lhs->m_JMinv.m_jacobianM0.m_linear.m_y; - row.m_JMinv.m_jacobianM0.m_linear.m_z[k] = lhs->m_JMinv.m_jacobianM0.m_linear.m_z; - row.m_JMinv.m_jacobianM0.m_angular.m_x[k] = lhs->m_JMinv.m_jacobianM0.m_angular.m_x; - row.m_JMinv.m_jacobianM0.m_angular.m_y[k] = lhs->m_JMinv.m_jacobianM0.m_angular.m_y; - row.m_JMinv.m_jacobianM0.m_angular.m_z[k] = lhs->m_JMinv.m_jacobianM0.m_angular.m_z; - row.m_JMinv.m_jacobianM1.m_linear.m_x[k] = lhs->m_JMinv.m_jacobianM1.m_linear.m_x; - row.m_JMinv.m_jacobianM1.m_linear.m_y[k] = lhs->m_JMinv.m_jacobianM1.m_linear.m_y; - row.m_JMinv.m_jacobianM1.m_linear.m_z[k] = lhs->m_JMinv.m_jacobianM1.m_linear.m_z; - row.m_JMinv.m_jacobianM1.m_angular.m_x[k] = lhs->m_JMinv.m_jacobianM1.m_angular.m_x; - row.m_JMinv.m_jacobianM1.m_angular.m_y[k] = lhs->m_JMinv.m_jacobianM1.m_angular.m_y; - row.m_JMinv.m_jacobianM1.m_angular.m_z[k] = lhs->m_JMinv.m_jacobianM1.m_angular.m_z; - - const ndRightHandSide* const rhs = &rightHandSide[joint->m_rowStart + n]; - row.m_force[k] = rhs->m_force; - row.m_diagDamp[k] = rhs->m_diagDamp; - row.m_invJinvMJt[k] = rhs->m_invJinvMJt; - row.m_coordenateAccel[k] = rhs->m_coordenateAccel; - - #ifdef D_NEWTON_USE_DOUBLE - ndInt64* const normalIndex = (ndInt64*)&row.m_normalForceIndex[0]; - #else - ndInt32* const normalIndex = (ndInt32*)&row.m_normalForceIndex[0]; - #endif - normalIndex[k] = (rhs->m_normalForceIndex + 1) * D_SSE_WORK_GROUP + k; - row.m_lowerBoundFrictionCoefficent[k] = rhs->m_lowerBoundFrictionCoefficent; - row.m_upperBoundFrictionCoefficent[k] = rhs->m_upperBoundFrictionCoefficent; - } - } - } - } - } - } - }); - - if (scene->GetActiveContactArray().GetCount()) - { - D_TRACKTIME(); - m_rightHandSide[0].m_force = ndFloat32(1.0f); - - scene->ParallelExecute(InitJacobianMatrix); - scene->ParallelExecute(InitJacobianAccumulatePartialForces); - scene->ParallelExecute(TransposeMassMatrix); - } -} - -void ndDynamicsUpdateSoa::UpdateForceFeedback() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator(0); - auto UpdateForceFeedback = ndMakeObject::ndFunction([this, &iterator, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(UpdateForceFeedback); - ndArray& rightHandSide = m_rightHandSide; - const ndArray& leftHandSide = m_leftHandSide; - - const ndVector zero(ndVector::m_zero); - const ndFloat32 timestepRK = GetTimestepRK(); - - const ndInt32 count = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndConstraint* const joint = jointArray[i + j]; - const ndInt32 rows = joint->m_rowCount; - const ndInt32 first = joint->m_rowStart; - - for (ndInt32 k = 0; k < rows; ++k) - { - const ndRightHandSide* const rhs = &rightHandSide[k + first]; - ndAssert(ndCheckFloat(rhs->m_force)); - rhs->m_jointFeebackForce->Push(rhs->m_force); - rhs->m_jointFeebackForce->m_force = rhs->m_force; - rhs->m_jointFeebackForce->m_impact = rhs->m_maxImpact * timestepRK; - } - - //if (joint->GetAsBilateral()) - { - ndVector force0(zero); - ndVector force1(zero); - ndVector torque0(zero); - ndVector torque1(zero); - - for (ndInt32 k = 0; k < rows; ++k) - { - const ndRightHandSide* const rhs = &rightHandSide[k + first]; - const ndLeftHandSide* const lhs = &leftHandSide[k + first]; - const ndVector f(rhs->m_force); - force0 += lhs->m_Jt.m_jacobianM0.m_linear * f; - torque0 += lhs->m_Jt.m_jacobianM0.m_angular * f; - force1 += lhs->m_Jt.m_jacobianM1.m_linear * f; - torque1 += lhs->m_Jt.m_jacobianM1.m_angular * f; - } - //ndJointBilateralConstraint* const bilateral = (ndJointBilateralConstraint*)joint; - joint->m_forceBody0 = force0; - joint->m_torqueBody0 = torque0; - joint->m_forceBody1 = force1; - joint->m_torqueBody1 = torque1; - } - } - } - }); - - scene->ParallelExecute(UpdateForceFeedback); -} - -void ndDynamicsUpdateSoa::InitSkeletons() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& activeSkeletons = m_world->m_activeSkeletons; - - ndAtomic iterator(0); - auto InitSkeletons = ndMakeObject::ndFunction([this, &iterator, &activeSkeletons](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(InitSkeletons); - ndArray& rightHandSide = m_rightHandSide; - const ndArray& leftHandSide = m_leftHandSide; - - const ndInt32 count = ndInt32 (activeSkeletons.GetCount()); - for (ndInt32 i = iterator++; i < count; i = iterator++) - { - ndSkeletonContainer* const skeleton = activeSkeletons[i]; - skeleton->InitMassMatrix(&leftHandSide[0], &rightHandSide[0]); - } - }); - - if (activeSkeletons.GetCount()) - { - scene->ParallelExecute(InitSkeletons); - } -} - -void ndDynamicsUpdateSoa::UpdateSkeletons() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& activeSkeletons = m_world->m_activeSkeletons; - - ndAtomic iterator(0); - auto UpdateSkeletons = ndMakeObject::ndFunction([this, &iterator, &activeSkeletons](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(UpdateSkeletons); - ndJacobian* const internalForces = &GetInternalForces()[0]; - - const ndInt32 count = ndInt32 (activeSkeletons.GetCount()); - for (ndInt32 i = iterator++; i < count; i = iterator++) - { - ndSkeletonContainer* const skeleton = activeSkeletons[i]; - skeleton->CalculateReactionForces(internalForces); - } - }); - - if (activeSkeletons.GetCount()) - { - scene->ParallelExecute(UpdateSkeletons); - } -} - -void ndDynamicsUpdateSoa::CalculateJointsAcceleration() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - const ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator(0); - auto CalculateJointsAcceleration = ndMakeObject::ndFunction([this, &iterator, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CalculateJointsAcceleration); - ndJointAccelerationDecriptor joindDesc; - joindDesc.m_timestep = m_timestepRK; - joindDesc.m_invTimestep = m_invTimestepRK; - joindDesc.m_firstPassCoefFlag = m_firstPassCoef; - ndArray& leftHandSide = m_leftHandSide; - ndArray& rightHandSide = m_rightHandSide; - - const ndInt32 count = ndInt32 (jointArray.GetCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndConstraint* const joint = jointArray[i + j]; - const ndInt32 pairStart = joint->m_rowStart; - joindDesc.m_rowsCount = joint->m_rowCount; - joindDesc.m_leftHandSide = &leftHandSide[pairStart]; - joindDesc.m_rightHandSide = &rightHandSide[pairStart]; - joint->JointAccelerations(&joindDesc); - } - } - }); - - ndAtomic iterator1(0); - auto UpdateAcceleration = ndMakeObject::ndFunction([this, &iterator1, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(UpdateAcceleration); - const ndArray& rightHandSide = m_rightHandSide; - - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - const ndInt32 mask = -ndInt32(D_SSE_WORK_GROUP); - const ndInt32* const soaJointRows = &m_soaJointRows[0]; - const ndInt32 soaJointCountBatches = ((jointCount + D_SSE_WORK_GROUP - 1) & mask) / D_SSE_WORK_GROUP; - const ndInt8* const groupType = &m_groupType[0]; - - const ndConstraint* const * jointArrayPtr = &jointArray[0]; - ndSoaMatrixElement* const massMatrix = &m_soaMassMatrix[0]; - - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < soaJointCountBatches; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((soaJointCountBatches - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : soaJointCountBatches - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 m = i + j; - if (groupType[m]) - { - const ndInt32 soaRowStartBase = soaJointRows[m]; - const ndConstraint* const* jointGroup = &jointArrayPtr[m * D_SSE_WORK_GROUP]; - const ndConstraint* const firstJoint = jointGroup[0]; - const ndInt32 rowCount = firstJoint->m_rowCount; - for (ndInt32 k = 0; k < D_SSE_WORK_GROUP; ++k) - { - const ndConstraint* const Joint = jointGroup[k]; - const ndInt32 base = Joint->m_rowStart; - for (ndInt32 n = 0; n < rowCount; ++n) - { - ndSoaMatrixElement* const row = &massMatrix[soaRowStartBase + n]; - row->m_coordenateAccel[k] = rightHandSide[base + n].m_coordenateAccel; - } - } - } - else - { - const ndInt32 soaRowStartBase = soaJointRows[m]; - const ndConstraint* const* jointGroup = &jointArrayPtr[m * D_SSE_WORK_GROUP]; - for (ndInt32 k = 0; k < D_SSE_WORK_GROUP; ++k) - { - const ndConstraint* const Joint = jointGroup[k]; - if (Joint) - { - const ndInt32 base = Joint->m_rowStart; - const ndInt32 rowCount = Joint->m_rowCount; - for (ndInt32 n = 0; n < rowCount; ++n) - { - ndSoaMatrixElement* const row = &massMatrix[soaRowStartBase + n]; - row->m_coordenateAccel[k] = rightHandSide[base + n].m_coordenateAccel; - } - } - } - } - } - } - }); - - scene->ParallelExecute(CalculateJointsAcceleration); - - m_firstPassCoef = ndFloat32(1.0f); - scene->ParallelExecute(UpdateAcceleration); -} - -void ndDynamicsUpdateSoa::IntegrateBodiesVelocity() -{ - D_TRACKTIME(); - ndScene* const scene = m_world->GetScene(); - ndAtomic iterator(0); - auto IntegrateBodiesVelocity = ndMakeObject::ndFunction([this, &iterator](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(IntegrateBodiesVelocity); - ndArray& bodyArray = GetBodyIslandOrder(); - const ndArray& internalForces = GetInternalForces(); - - const ndVector timestep4(GetTimestepRK()); - const ndVector speedFreeze2(m_world->m_freezeSpeed2 * ndFloat32(0.1f)); - - const ndInt32 count = ndInt32 (bodyArray.GetCount() - GetUnconstrainedBodyCount()); - for (ndInt32 i = iterator.fetch_add(D_WORKER_BATCH_SIZE); i < count; i = iterator.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((count - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : count - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndBodyKinematic* const body = bodyArray[i + j]; - - ndAssert(body); - ndAssert(body->m_isConstrained); - // no necessary anymore because the virtual function handle it. - //ndAssert(body->GetAsBodyDynamic()); - - const ndInt32 index = body->m_index; - const ndJacobian& forceAndTorque = internalForces[index]; - const ndVector force(body->GetForce() + forceAndTorque.m_linear); - const ndVector torque(body->GetTorque() + forceAndTorque.m_angular - body->GetGyroTorque()); - const ndJacobian velocStep(body->IntegrateForceAndToque(force, torque, timestep4)); - - if (!body->m_equilibrium0) - { - body->m_veloc += velocStep.m_linear; - body->m_omega += velocStep.m_angular; - body->IntegrateGyroSubstep(timestep4); - } - else - { - const ndVector velocStep2(velocStep.m_linear.DotProduct(velocStep.m_linear)); - const ndVector omegaStep2(velocStep.m_angular.DotProduct(velocStep.m_angular)); - const ndVector test(((velocStep2 > speedFreeze2) | (omegaStep2 > speedFreeze2)) & ndVector::m_negOne); - const ndInt8 equilibrium = test.GetSignMask() ? 0 : 1; - body->m_equilibrium0 = ndUnsigned8(equilibrium); - } - ndAssert(body->m_veloc.m_w == ndFloat32(0.0f)); - ndAssert(body->m_omega.m_w == ndFloat32(0.0f)); - } - } - }); - scene->ParallelExecute(IntegrateBodiesVelocity); -} - -void ndDynamicsUpdateSoa::CalculateJointsForce() -{ - D_TRACKTIME(); - const ndUnsigned32 passes = m_solverPasses; - ndScene* const scene = m_world->GetScene(); - - ndArray& bodyArray = scene->GetActiveBodyArray(); - ndArray& jointArray = scene->GetActiveContactArray(); - - ndAtomic iterator0(0); - auto CalculateJointsForce = ndMakeObject::ndFunction([this, &iterator0, &jointArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(CalculateJointsForce); - const ndInt32 jointCount = ndInt32 (jointArray.GetCount()); - ndJacobian* const jointPartialForces = &GetTempInternalForces()[0]; - - const ndInt32* const soaJointRows = &m_soaJointRows[0]; - ndSoaMatrixElement* const soaMassMatrix = &m_soaMassMatrix[0]; - - auto JointForce = [this, &jointArray, jointPartialForces](ndInt32 group, ndSoaMatrixElement* const massMatrix) - { - ndSoaVector6 forceM0; - ndSoaVector6 forceM1; - ndVector preconditioner0; - ndVector preconditioner1; - ndVector normalForce[D_CONSTRAINT_MAX_ROWS + 1]; - - const ndInt32 block = group * D_SSE_WORK_GROUP; - ndConstraint** const jointGroup = &jointArray[block]; - - const ndVector zero(ndVector::m_zero); - const ndInt8 isUniformGruop = m_groupType[group]; - if (isUniformGruop) - { - for (ndInt32 i = 0; i < D_SSE_WORK_GROUP; ++i) - { - const ndConstraint* const joint = jointGroup[i]; - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - - const ndInt32 m0 = body0->m_index; - const ndInt32 m1 = body1->m_index; - - preconditioner0[i] = body0->m_weigh; - preconditioner1[i] = body1->m_weigh; - - forceM0.m_linear.m_x[i] = m_internalForces[m0].m_linear.m_x; - forceM0.m_linear.m_y[i] = m_internalForces[m0].m_linear.m_y; - forceM0.m_linear.m_z[i] = m_internalForces[m0].m_linear.m_z; - forceM0.m_angular.m_x[i] = m_internalForces[m0].m_angular.m_x; - forceM0.m_angular.m_y[i] = m_internalForces[m0].m_angular.m_y; - forceM0.m_angular.m_z[i] = m_internalForces[m0].m_angular.m_z; - - forceM1.m_linear.m_x[i] = m_internalForces[m1].m_linear.m_x; - forceM1.m_linear.m_y[i] = m_internalForces[m1].m_linear.m_y; - forceM1.m_linear.m_z[i] = m_internalForces[m1].m_linear.m_z; - forceM1.m_angular.m_x[i] = m_internalForces[m1].m_angular.m_x; - forceM1.m_angular.m_y[i] = m_internalForces[m1].m_angular.m_y; - forceM1.m_angular.m_z[i] = m_internalForces[m1].m_angular.m_z; - } - } - else - { - preconditioner0 = zero; - preconditioner1 = zero; - - forceM0.m_linear.m_x = zero; - forceM0.m_linear.m_y = zero; - forceM0.m_linear.m_z = zero; - forceM0.m_angular.m_x = zero; - forceM0.m_angular.m_y = zero; - forceM0.m_angular.m_z = zero; - - forceM1.m_linear.m_x = zero; - forceM1.m_linear.m_y = zero; - forceM1.m_linear.m_z = zero; - forceM1.m_angular.m_x = zero; - forceM1.m_angular.m_y = zero; - forceM1.m_angular.m_z = zero; - for (ndInt32 i = 0; i < D_SSE_WORK_GROUP; ++i) - { - const ndConstraint* const joint = jointGroup[i]; - if (joint && joint->m_rowCount) - { - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - - const ndInt32 m0 = body0->m_index; - const ndInt32 m1 = body1->m_index; - - preconditioner0[i] = body0->m_weigh; - preconditioner1[i] = body1->m_weigh; - - forceM0.m_linear.m_x[i] = m_internalForces[m0].m_linear.m_x; - forceM0.m_linear.m_y[i] = m_internalForces[m0].m_linear.m_y; - forceM0.m_linear.m_z[i] = m_internalForces[m0].m_linear.m_z; - forceM0.m_angular.m_x[i] = m_internalForces[m0].m_angular.m_x; - forceM0.m_angular.m_y[i] = m_internalForces[m0].m_angular.m_y; - forceM0.m_angular.m_z[i] = m_internalForces[m0].m_angular.m_z; - - forceM1.m_linear.m_x[i] = m_internalForces[m1].m_linear.m_x; - forceM1.m_linear.m_y[i] = m_internalForces[m1].m_linear.m_y; - forceM1.m_linear.m_z[i] = m_internalForces[m1].m_linear.m_z; - forceM1.m_angular.m_x[i] = m_internalForces[m1].m_angular.m_x; - forceM1.m_angular.m_y[i] = m_internalForces[m1].m_angular.m_y; - forceM1.m_angular.m_z[i] = m_internalForces[m1].m_angular.m_z; - } - } - } - - ndVector accNorm(zero); - normalForce[0] = ndVector::m_one; - const ndInt32 rowsCount = jointGroup[0]->m_rowCount; - - for (ndInt32 j = 0; j < rowsCount; ++j) - { - const ndSoaMatrixElement* const row = &massMatrix[j]; - - ndVector a(row->m_JMinv.m_jacobianM0.m_linear.m_x * forceM0.m_linear.m_x); - a = a.MulAdd(row->m_JMinv.m_jacobianM0.m_linear.m_y, forceM0.m_linear.m_y); - a = a.MulAdd(row->m_JMinv.m_jacobianM0.m_linear.m_z, forceM0.m_linear.m_z); - - a = a.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_x, forceM0.m_angular.m_x); - a = a.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_y, forceM0.m_angular.m_y); - a = a.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_z, forceM0.m_angular.m_z); - - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_linear.m_x, forceM1.m_linear.m_x); - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_linear.m_y, forceM1.m_linear.m_y); - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_linear.m_z, forceM1.m_linear.m_z); - - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_x, forceM1.m_angular.m_x); - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_y, forceM1.m_angular.m_y); - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_z, forceM1.m_angular.m_z); - - a = row->m_coordenateAccel.MulSub(row->m_force, row->m_diagDamp) - a; - ndVector f(row->m_force.MulAdd(row->m_invJinvMJt, a)); - - const ndVector frictionNormal(&normalForce[0].m_x, row->m_normalForceIndex.m_i); - const ndVector lowerFrictionForce(frictionNormal * row->m_lowerBoundFrictionCoefficent); - const ndVector upperFrictionForce(frictionNormal * row->m_upperBoundFrictionCoefficent); - - a = a & (f < upperFrictionForce) & (f > lowerFrictionForce); - accNorm = accNorm.MulAdd(a, a); - - f = f.GetMax(lowerFrictionForce).GetMin(upperFrictionForce); - normalForce[j + 1] = f; - - const ndVector deltaForce(f - row->m_force); - const ndVector deltaForce0(deltaForce * preconditioner0); - const ndVector deltaForce1(deltaForce * preconditioner1); - - forceM0.m_linear.m_x = forceM0.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_x, deltaForce0); - forceM0.m_linear.m_y = forceM0.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_y, deltaForce0); - forceM0.m_linear.m_z = forceM0.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_z, deltaForce0); - forceM0.m_angular.m_x = forceM0.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_x, deltaForce0); - forceM0.m_angular.m_y = forceM0.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_y, deltaForce0); - forceM0.m_angular.m_z = forceM0.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_z, deltaForce0); - - forceM1.m_linear.m_x = forceM1.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_x, deltaForce1); - forceM1.m_linear.m_y = forceM1.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_y, deltaForce1); - forceM1.m_linear.m_z = forceM1.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_z, deltaForce1); - forceM1.m_angular.m_x = forceM1.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_x, deltaForce1); - forceM1.m_angular.m_y = forceM1.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_y, deltaForce1); - forceM1.m_angular.m_z = forceM1.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_z, deltaForce1); - } - - const ndFloat32 tol = ndFloat32(0.125f); - const ndFloat32 tol2 = tol * tol; - - ndVector maxAccel(accNorm); - for (ndInt32 k = 0; (k < 4) && (maxAccel.GetMax().GetScalar() > tol2); ++k) - { - maxAccel = zero; - for (ndInt32 j = 0; j < rowsCount; ++j) - { - const ndSoaMatrixElement* const row = &massMatrix[j]; - - ndVector a(row->m_JMinv.m_jacobianM0.m_linear.m_x * forceM0.m_linear.m_x); - a = a.MulAdd(row->m_JMinv.m_jacobianM0.m_linear.m_y, forceM0.m_linear.m_y); - a = a.MulAdd(row->m_JMinv.m_jacobianM0.m_linear.m_z, forceM0.m_linear.m_z); - - a = a.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_x, forceM0.m_angular.m_x); - a = a.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_y, forceM0.m_angular.m_y); - a = a.MulAdd(row->m_JMinv.m_jacobianM0.m_angular.m_z, forceM0.m_angular.m_z); - - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_linear.m_x, forceM1.m_linear.m_x); - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_linear.m_y, forceM1.m_linear.m_y); - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_linear.m_z, forceM1.m_linear.m_z); - - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_x, forceM1.m_angular.m_x); - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_y, forceM1.m_angular.m_y); - a = a.MulAdd(row->m_JMinv.m_jacobianM1.m_angular.m_z, forceM1.m_angular.m_z); - - const ndVector force(normalForce[j + 1]); - a = row->m_coordenateAccel.MulSub(force, row->m_diagDamp) - a; - ndVector f(force.MulAdd(row->m_invJinvMJt, a)); - - const ndVector frictionNormal(&normalForce[0].m_x, row->m_normalForceIndex.m_i); - const ndVector lowerFrictionForce(frictionNormal * row->m_lowerBoundFrictionCoefficent); - const ndVector upperFrictionForce(frictionNormal * row->m_upperBoundFrictionCoefficent); - - a = a & (f < upperFrictionForce) & (f > lowerFrictionForce); - maxAccel = maxAccel.MulAdd(a, a); - - f = f.GetMax(lowerFrictionForce).GetMin(upperFrictionForce); - normalForce[j + 1] = f; - - const ndVector deltaForce(f - force); - const ndVector deltaForce0(deltaForce * preconditioner0); - const ndVector deltaForce1(deltaForce * preconditioner1); - - forceM0.m_linear.m_x = forceM0.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_x, deltaForce0); - forceM0.m_linear.m_y = forceM0.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_y, deltaForce0); - forceM0.m_linear.m_z = forceM0.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_z, deltaForce0); - forceM0.m_angular.m_x = forceM0.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_x, deltaForce0); - forceM0.m_angular.m_y = forceM0.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_y, deltaForce0); - forceM0.m_angular.m_z = forceM0.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_z, deltaForce0); - - forceM1.m_linear.m_x = forceM1.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_x, deltaForce1); - forceM1.m_linear.m_y = forceM1.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_y, deltaForce1); - forceM1.m_linear.m_z = forceM1.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_z, deltaForce1); - forceM1.m_angular.m_x = forceM1.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_x, deltaForce1); - forceM1.m_angular.m_y = forceM1.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_y, deltaForce1); - forceM1.m_angular.m_z = forceM1.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_z, deltaForce1); - } - } - - ndVector mask(m_jointMask[group]); - for (ndInt32 i = 0; i < D_SSE_WORK_GROUP; ++i) - { - const ndConstraint* const joint = jointGroup[i]; - if (joint && joint->m_rowCount) - { - const ndBodyKinematic* const body0 = joint->GetBody0(); - const ndBodyKinematic* const body1 = joint->GetBody1(); - ndAssert(body0); - ndAssert(body1); - const ndInt32 resting = body0->m_equilibrium0 & body1->m_equilibrium0; - if (resting) - { - mask[i] = ndFloat32(0.0f); - } - } - } - - forceM0.m_linear.m_x = zero; - forceM0.m_linear.m_y = zero; - forceM0.m_linear.m_z = zero; - forceM0.m_angular.m_x = zero; - forceM0.m_angular.m_y = zero; - forceM0.m_angular.m_z = zero; - - forceM1.m_linear.m_x = zero; - forceM1.m_linear.m_y = zero; - forceM1.m_linear.m_z = zero; - forceM1.m_angular.m_x = zero; - forceM1.m_angular.m_y = zero; - forceM1.m_angular.m_z = zero; - for (ndInt32 i = 0; i < rowsCount; ++i) - { - ndSoaMatrixElement* const row = &massMatrix[i]; - const ndVector force(row->m_force.Select(normalForce[i + 1], mask)); - row->m_force = force; - - forceM0.m_linear.m_x = forceM0.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_x, force); - forceM0.m_linear.m_y = forceM0.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_y, force); - forceM0.m_linear.m_z = forceM0.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_linear.m_z, force); - forceM0.m_angular.m_x = forceM0.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_x, force); - forceM0.m_angular.m_y = forceM0.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_y, force); - forceM0.m_angular.m_z = forceM0.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM0.m_angular.m_z, force); - - forceM1.m_linear.m_x = forceM1.m_linear.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_x, force); - forceM1.m_linear.m_y = forceM1.m_linear.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_y, force); - forceM1.m_linear.m_z = forceM1.m_linear.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_linear.m_z, force); - forceM1.m_angular.m_x = forceM1.m_angular.m_x.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_x, force); - forceM1.m_angular.m_y = forceM1.m_angular.m_y.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_y, force); - forceM1.m_angular.m_z = forceM1.m_angular.m_z.MulAdd(row->m_Jt.m_jacobianM1.m_angular.m_z, force); - } - - ndJacobian force0[4]; - ndJacobian force1[4]; - ndVector::Transpose4x4( - force0[0].m_linear, - force0[1].m_linear, - force0[2].m_linear, - force0[3].m_linear, - forceM0.m_linear.m_x, - forceM0.m_linear.m_y, - forceM0.m_linear.m_z, ndVector::m_zero); - ndVector::Transpose4x4( - force0[0].m_angular, - force0[1].m_angular, - force0[2].m_angular, - force0[3].m_angular, - forceM0.m_angular.m_x, - forceM0.m_angular.m_y, - forceM0.m_angular.m_z, ndVector::m_zero); - - ndVector::Transpose4x4( - force1[0].m_linear, - force1[1].m_linear, - force1[2].m_linear, - force1[3].m_linear, - forceM1.m_linear.m_x, - forceM1.m_linear.m_y, - forceM1.m_linear.m_z, ndVector::m_zero); - ndVector::Transpose4x4( - force1[0].m_angular, - force1[1].m_angular, - force1[2].m_angular, - force1[3].m_angular, - forceM1.m_angular.m_x, - forceM1.m_angular.m_y, - forceM1.m_angular.m_z, ndVector::m_zero); - - ndRightHandSide* const rightHandSide = &m_rightHandSide[0]; - for (ndInt32 i = 0; i < D_SSE_WORK_GROUP; ++i) - { - const ndConstraint* const joint = jointGroup[i]; - if (joint) - { - const ndInt32 rowCount = joint->m_rowCount; - const ndInt32 rowStartBase = joint->m_rowStart; - for (ndInt32 j = 0; j < rowCount; ++j) - { - const ndSoaMatrixElement* const row = &massMatrix[j]; - rightHandSide[j + rowStartBase].m_force = row->m_force[i]; - rightHandSide[j + rowStartBase].m_maxImpact = ndMax(ndAbs(row->m_force[i]), rightHandSide[j + rowStartBase].m_maxImpact); - } - - const ndInt32 index0 = (block + i) * 2 + 0; - ndJacobian& outBody0 = jointPartialForces[index0]; - outBody0.m_linear = force0[i].m_linear; - outBody0.m_angular = force0[i].m_angular; - - const ndInt32 index1 = (block + i) * 2 + 1; - ndJacobian& outBody1 = jointPartialForces[index1]; - outBody1.m_linear = force1[i].m_linear; - outBody1.m_angular = force1[i].m_angular; - } - } - }; - - const ndInt32 mask = -ndInt32(D_SSE_WORK_GROUP); - const ndInt32 soaJointCount = ((jointCount + D_SSE_WORK_GROUP - 1) & mask) / D_SSE_WORK_GROUP; - for (ndInt32 i = iterator0.fetch_add(D_WORKER_BATCH_SIZE); i < soaJointCount; i = iterator0.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((soaJointCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : soaJointCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - const ndInt32 m = i + j; - JointForce(m, &soaMassMatrix[soaJointRows[m]]); - } - } - }); - - ndAtomic iterator1(0); - auto ApplyJacobianAccumulatePartialForces = ndMakeObject::ndFunction([this, &iterator1, &bodyArray](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(ApplyJacobianAccumulatePartialForces); - const ndVector zero(ndVector::m_zero); - - ndJacobian* const internalForces = &GetInternalForces()[0]; - const ndInt32* const bodyIndex = &GetJointForceIndexBuffer()[0]; - const ndJacobian* const jointInternalForces = &GetTempInternalForces()[0]; - const ndJointBodyPairIndex* const jointBodyPairIndexBuffer = &GetJointBodyPairIndexBuffer()[0]; - - const ndInt32 bodyCount = ndInt32 (bodyArray.GetCount()); - for (ndInt32 i = iterator1.fetch_add(D_WORKER_BATCH_SIZE); i < bodyCount; i = iterator1.fetch_add(D_WORKER_BATCH_SIZE)) - { - const ndInt32 maxSpan = ((bodyCount - i) >= D_WORKER_BATCH_SIZE) ? D_WORKER_BATCH_SIZE : bodyCount - i; - for (ndInt32 j = 0; j < maxSpan; ++j) - { - ndVector force(zero); - ndVector torque(zero); - const ndInt32 m = i + j; - const ndBodyKinematic* const body = bodyArray[m]; - - const ndInt32 startIndex = bodyIndex[m]; - const ndInt32 mask = body->m_isStatic - 1; - const ndInt32 count = mask & (bodyIndex[m + 1] - startIndex); - for (ndInt32 k = 0; k < count; ++k) - { - const ndInt32 index = jointBodyPairIndexBuffer[startIndex + k].m_joint; - force += jointInternalForces[index].m_linear; - torque += jointInternalForces[index].m_angular; - } - internalForces[m].m_linear = force; - internalForces[m].m_angular = torque; - } - } - }); - - for (ndUnsigned32 i = 0; i < passes; ++i) - { - iterator0 = 0; - iterator1 = 0; - scene->ParallelExecute(CalculateJointsForce); - scene->ParallelExecute(ApplyJacobianAccumulatePartialForces); - } -} - -void ndDynamicsUpdateSoa::CalculateForces() -{ - D_TRACKTIME(); - if (m_world->GetScene()->GetActiveContactArray().GetCount()) - { - m_firstPassCoef = ndFloat32(0.0f); - - InitSkeletons(); - for (ndInt32 step = 0; step < 4; step++) - { - CalculateJointsAcceleration(); - CalculateJointsForce(); - UpdateSkeletons(); - IntegrateBodiesVelocity(); - } - - UpdateForceFeedback(); - } -} - -void ndDynamicsUpdateSoa::Update() -{ - D_TRACKTIME(); - m_timestep = m_world->GetScene()->GetTimestep(); - - BuildIsland(); - IntegrateUnconstrainedBodies(); - InitWeights(); - InitBodyArray(); - InitJacobianMatrix(); - CalculateForces(); - IntegrateBodies(); - DetermineSleepStates(); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdateSoa.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdateSoa.h deleted file mode 100644 index 3f1a86a55e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndDynamicsUpdateSoa.h +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_WORLD_DYNAMICS_UPDATE_SOA_H__ -#define __ND_WORLD_DYNAMICS_UPDATE_SOA_H__ - -#include "ndNewtonStdafx.h" -#include "ndDynamicsUpdate.h" - -namespace ndSoa -{ - class ndSoaVector3 - { - public: - ndVector m_x; - ndVector m_y; - ndVector m_z; - }; - - class ndSoaVector6 - { - public: - ndSoaVector3 m_linear; - ndSoaVector3 m_angular; - }; - - class ndSoaJacobianPair - { - public: - ndSoaVector6 m_jacobianM0; - ndSoaVector6 m_jacobianM1; - }; - - class ndSoaMatrixElement - { - public: - ndSoaJacobianPair m_Jt; - ndSoaJacobianPair m_JMinv; - - ndVector m_force; - ndVector m_diagDamp; - ndVector m_invJinvMJt; - ndVector m_coordenateAccel; - ndVector m_normalForceIndex; - ndVector m_lowerBoundFrictionCoefficent; - ndVector m_upperBoundFrictionCoefficent; - }; -} - -D_MSV_NEWTON_ALIGN_32 -class ndDynamicsUpdateSoa: public ndDynamicsUpdate -{ - public: - ndDynamicsUpdateSoa(ndWorld* const world); - virtual ~ndDynamicsUpdateSoa(); - - virtual const char* GetStringId() const; - - protected: - virtual void Update(); - - private: - void SortJoints(); - void SortIslands(); - void BuildIsland(); - void InitWeights(); - void InitBodyArray(); - void InitSkeletons(); - void CalculateForces(); - void IntegrateBodies(); - void UpdateSkeletons(); - void InitJacobianMatrix(); - void UpdateForceFeedback(); - void CalculateJointsForce(); - void IntegrateBodiesVelocity(); - void CalculateJointsAcceleration(); - void IntegrateUnconstrainedBodies(); - - void DetermineSleepStates(); - void GetJacobianDerivatives(ndConstraint* const joint); - - ndVector m_ordinals; - ndArray m_groupType; - ndArray m_jointMask; - ndArray m_soaJointRows; - ndArray m_soaMassMatrix; - -} D_GCC_NEWTON_ALIGN_32; - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h deleted file mode 100644 index e6db95c2d6..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#ifndef __ND_NEWTON_H__ -#define __ND_NEWTON_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndNewtonStdafx.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndNewtonStdafx.cpp deleted file mode 100644 index f92bb8f6f2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndNewtonStdafx.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" - -#if defined (_D_NEWTON_DLL) && !defined (_D_SINGLE_LIBRARY) - - #ifndef D_USE_DEFAULT_NEW_AND_DELETE - void *operator new (size_t size) - { - // this should not happens on this test - // newton should never use global operator new and delete. - return ndMemory::Malloc(size); - } - - void operator delete (void* ptr) - { - ndMemory::Free(ptr); - } - #endif - -#if (defined(WIN32) || defined(_WIN32)) - BOOL APIENTRY DllMain(HMODULE, DWORD ul_reason_for_call, LPVOID ) - { - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; - } -#endif -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndNewtonStdafx.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndNewtonStdafx.h deleted file mode 100644 index 4369ee5a94..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndNewtonStdafx.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#ifndef __ND_NEWTON_STDAFX_H__ -#define __ND_NEWTON_STDAFX_H__ - -#include -#include - -#ifdef _D_NEWTON_DLL - #ifdef _D_NEWTON_EXPORT_DLL - #define D_NEWTON_API D_LIBRARY_EXPORT - #else - #define D_NEWTON_API D_LIBRARY_IMPORT - #endif -#else - #define D_NEWTON_API -#endif - -#endif - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndSkeletonContainer.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndSkeletonContainer.cpp deleted file mode 100644 index 26b426e752..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndSkeletonContainer.cpp +++ /dev/null @@ -1,1660 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndBodyDynamic.h" -#include "ndDynamicsUpdate.h" -#include "ndSkeletonContainer.h" -#include "dIkSolver/ndIkSolver.h" -#include "ndJointBilateralConstraint.h" - -#define D_MAX_SKELETON_LCP_VALUE (D_LCP_MAX_VALUE * ndFloat32 (0.25f)) - -ndSkeletonContainer::ndNode::ndNode() - :m_body(nullptr) - ,m_joint(nullptr) - ,m_parent(nullptr) - ,m_child(nullptr) - ,m_sibling(nullptr) - ,m_index(0) - ,m_ordinal() - ,m_dof(0) - ,m_swapJacobianBodiesIndex(0) -{ -} - -ndSkeletonContainer::ndNode::~ndNode() -{ - m_body->SetSkeleton(nullptr); -} - -ndInt32 ndSkeletonContainer::ndNode::GetAuxiliaryRows(const ndRightHandSide* const rightHandSide) const -{ - ndInt32 rowCount = 0; - if (m_joint) - { - ndAssert(m_parent); - const ndInt32 count = m_joint->m_rowCount; - const ndInt32 first = m_joint->m_rowStart; - for (ndInt32 i = 0; i < count; ++i) - { - const ndRightHandSide* const rhs = &rightHandSide[i + first]; - if (!((rhs->m_lowerBoundFrictionCoefficent <= ndFloat32(-D_MAX_SKELETON_LCP_VALUE)) && (rhs->m_upperBoundFrictionCoefficent >= ndFloat32(D_MAX_SKELETON_LCP_VALUE)))) - { - rowCount++; - } - } - } - return rowCount; -} - -void ndSkeletonContainer::ndNode::CalculateInertiaMatrix(ndSpatialMatrix* const bodyMassArray) const -{ - ndSpatialMatrix& bodyMass = bodyMassArray[m_index]; - - bodyMass = ndSpatialMatrix(ndFloat32(0.0f)); - if (m_body->GetInvMass() != ndFloat32(0.0f)) - { - const ndFloat32 mass = m_body->GetMassMatrix().m_w; - ndMatrix inertia (m_body->CalculateInertiaMatrix()); - for (ndInt32 i = 0; i < 3; ++i) - { - bodyMass[i][i] = mass; - for (ndInt32 j = 0; j < 3; ++j) - { - bodyMass[i + 3][j + 3] = inertia[i][j]; - } - } - } -} - -void ndSkeletonContainer::ndNode::GetJacobians(const ndLeftHandSide* const leftHandSide, const ndRightHandSide* const rightHandSide, ndSpatialMatrix* const jointMassArray) -{ - ndAssert(m_parent); - - ndSpatialMatrix& bodyJt = m_data.m_body.m_jt; - ndSpatialMatrix& jointJ = m_data.m_joint.m_jt; - ndSpatialMatrix& jointMass = jointMassArray[m_index]; - - const ndVector negOne(ndVector::m_negOne); - const ndInt32 start = m_joint->m_rowStart; - const ndSpatialVector zero(ndSpatialVector::m_zero); - if (!m_swapJacobianBodiesIndex) - { - for (ndInt32 i = 0; i < m_dof; ++i) - { - const ndInt32 k = m_ordinal.m_sourceJacobianIndex[i]; - const ndRightHandSide* const rhs = &rightHandSide[start + k]; - const ndLeftHandSide* const row = &leftHandSide[start + k]; - jointMass[i] = zero; - jointMass[i][i] = -rhs->m_diagDamp; - - bodyJt[i] = ndSpatialVector(row->m_Jt.m_jacobianM0.m_linear * negOne, row->m_Jt.m_jacobianM0.m_angular * negOne); - jointJ[i] = ndSpatialVector(row->m_Jt.m_jacobianM1.m_linear * negOne, row->m_Jt.m_jacobianM1.m_angular * negOne); - for (ndInt32 j = 0; j < 4; ++j) - { - bodyJt[i][3 + j] = bodyJt[i][4 + j]; - jointJ[i][3 + j] = jointJ[i][4 + j]; - } - } - } - else - { - for (ndInt32 i = 0; i < m_dof; ++i) - { - const ndInt32 k = m_ordinal.m_sourceJacobianIndex[i]; - const ndRightHandSide* const rhs = &rightHandSide[start + k]; - const ndLeftHandSide* const row = &leftHandSide[start + k]; - jointMass[i] = zero; - jointMass[i][i] = -rhs->m_diagDamp; - - jointJ[i] = ndSpatialVector(row->m_Jt.m_jacobianM0.m_linear * negOne, row->m_Jt.m_jacobianM0.m_angular * negOne); - bodyJt[i] = ndSpatialVector(row->m_Jt.m_jacobianM1.m_linear * negOne, row->m_Jt.m_jacobianM1.m_angular * negOne); - for (ndInt32 j = 0; j < 4; ++j) - { - bodyJt[i][3 + j] = bodyJt[i][4 + j]; - jointJ[i][3 + j] = jointJ[i][4 + j]; - } - } - } -} - -void ndSkeletonContainer::ndNode::CalculateBodyDiagonal(ndNode* const child, ndSpatialMatrix* const bodyMassArray, const ndSpatialMatrix* const jointMassArray) -{ - ndAssert(child->m_joint); - - ndSpatialMatrix copy(ndFloat32(0.0f)); - const ndInt32 dof = child->m_dof; - const ndSpatialMatrix& jacobianMatrix = child->m_data.m_joint.m_jt; - const ndSpatialMatrix& childDiagonal = jointMassArray[child->m_index]; - for (ndInt32 i = 0; i < dof; ++i) - { - const ndSpatialVector& jacobian = jacobianMatrix[i]; - for (ndInt32 j = 0; j < dof; ++j) - { - ndAssert(ndAreEqual(childDiagonal[i][j], childDiagonal[j][i], ndFloat64(1.0e-5f))); - ndFloat64 val = childDiagonal[i][j]; - copy[j] = copy[j] + jacobian.Scale(val); - } - } - - ndSpatialMatrix& bodyMass = bodyMassArray[m_index]; - for (ndInt32 i = 0; i < dof; ++i) - { - const ndSpatialVector& Jacobian = copy[i]; - const ndSpatialVector& JacobianTranspose = jacobianMatrix[i]; - for (ndInt32 j = 0; j < 6; ++j) - { - ndFloat64 val = -Jacobian[j]; - bodyMass[j] = bodyMass[j] + JacobianTranspose.Scale(val); - } - } -} - -void ndSkeletonContainer::ndNode::CalculateJointDiagonal(const ndSpatialMatrix* const bodyMassArray, ndSpatialMatrix* const jointMassArray) -{ - const ndSpatialMatrix& bodyMass = bodyMassArray[m_index]; - const ndSpatialMatrix& bodyJt = m_data.m_body.m_jt; - - ndSpatialMatrix tmp; - for (ndInt32 i = 0; i < m_dof; ++i) - { - tmp[i] = bodyMass.VectorTimeMatrix(bodyJt[i]); - } - - ndSpatialMatrix& jointMass = jointMassArray[m_index]; - for (ndInt32 i = 0; i < m_dof; ++i) - { - ndFloat64 a = bodyJt[i].DotProduct(tmp[i]); - jointMass[i][i] -= a; - for (ndInt32 j = i + 1; j < m_dof; ++j) - { - a = -bodyJt[i].DotProduct(tmp[j]); - jointMass[i][j] = a; - jointMass[j][i] = a; - } - } - - ndSpatialMatrix& jointInvMass = m_data.m_joint.m_invMass; - jointInvMass = jointMass.Inverse(m_dof); -} - -void ndSkeletonContainer::ndNode::CalculateJacobianBlock() -{ - ndSpatialMatrix& jointJ = m_data.m_joint.m_jt; - - ndSpatialMatrix copy; - const ndSpatialVector zero(ndSpatialVector::m_zero); - for (ndInt32 i = 0; i < m_dof; ++i) - { - copy[i] = jointJ[i]; - jointJ[i] = zero; - } - - const ndSpatialMatrix& jointInvMass = m_data.m_joint.m_invMass; - for (ndInt32 i = 0; i < m_dof; ++i) - { - const ndSpatialVector& jacobian = copy[i]; - const ndSpatialVector& invDiagonalRow = jointInvMass[i]; - for (ndInt32 j = 0; j < m_dof; ++j) - { - ndFloat64 val = invDiagonalRow[j]; - jointJ[j] = jointJ[j] + jacobian.Scale(val); - } - } -} - -ndInt32 ndSkeletonContainer::ndNode::Factorize(const ndLeftHandSide* const leftHandSide, const ndRightHandSide* const rightHandSide, ndSpatialMatrix* const bodyMassArray, ndSpatialMatrix* const jointMassArray) -{ - CalculateInertiaMatrix(bodyMassArray); - - ndInt32 boundedDof = 0; - m_ordinal = ndOrdinal(); - - if (m_joint) - { - m_dof = 0; - ndAssert(m_parent); - ndInt32 count = m_joint->m_rowCount; - const ndInt32 first = m_joint->m_rowStart; - for (ndInt32 i = 0; i < count; ++i) - { - ndInt32 k = m_ordinal.m_sourceJacobianIndex[i]; - const ndRightHandSide* const rhs = &rightHandSide[k + first]; - if ((rhs->m_lowerBoundFrictionCoefficent <= ndFloat32(-D_MAX_SKELETON_LCP_VALUE)) && (rhs->m_upperBoundFrictionCoefficent >= ndFloat32(D_MAX_SKELETON_LCP_VALUE))) - { - m_dof++; - } - else - { - ndSwap(m_ordinal.m_sourceJacobianIndex[i], m_ordinal.m_sourceJacobianIndex[count - 1]); - i--; - count--; - } - } - ndAssert(m_dof >= 0); - ndAssert(m_dof <= 6); - boundedDof += m_joint->m_rowCount - count; - GetJacobians(leftHandSide, rightHandSide, jointMassArray); - } - - ndSpatialMatrix& bodyInvMass = m_data.m_body.m_invMass; - const ndSpatialMatrix& bodyMass = bodyMassArray[m_index]; - if (m_body->GetInvMass() != ndFloat32(0.0f)) - { - for (ndNode* child = m_child; child; child = child->m_sibling) - { - CalculateBodyDiagonal(child, bodyMassArray, jointMassArray); - } - bodyInvMass = bodyMass.Inverse(6); - } - else - { - bodyInvMass = ndSpatialMatrix(ndFloat32(0.0f)); - } - - if (m_joint) - { - ndSpatialMatrix& bodyJt = m_data.m_body.m_jt; - ndAssert(m_parent); - for (ndInt32 i = 0; i < m_dof; ++i) - { - bodyJt[i] = bodyInvMass.VectorTimeMatrix(bodyJt[i]); - } - CalculateJointDiagonal(bodyMassArray, jointMassArray); - CalculateJacobianBlock(); - } - return boundedDof; -} - -void ndSkeletonContainer::ndNode::BodyJacobianTimeSolutionBackward(ndForcePair& force) const -{ - const ndSpatialMatrix& bodyJt = m_data.m_body.m_jt; - for (ndInt32 i = 0; i < m_dof; ++i) - { - force.m_body = force.m_body + bodyJt[i].Scale(-force.m_joint[i]); - } -} - -void ndSkeletonContainer::ndNode::JointJacobianTimeSolutionBackward(ndForcePair& force, const ndForcePair& parentForce) const -{ - const ndSpatialMatrix& jointJ = m_data.m_joint.m_jt; - const ndSpatialVector& f = parentForce.m_body; - for (ndInt32 i = 0; i < m_dof; ++i) - { - force.m_joint[i] -= f.DotProduct(jointJ[i]); - } -} - -void ndSkeletonContainer::ndNode::JointDiagInvTimeSolution(ndForcePair& force) -{ - const ndSpatialMatrix& jointInvMass = m_data.m_joint.m_invMass; - force.m_joint = jointInvMass.VectorTimeMatrix(force.m_joint, m_dof); -} - -void ndSkeletonContainer::ndNode::BodyDiagInvTimeSolution(ndForcePair& force) -{ - const ndSpatialMatrix& bodyInvMass = m_data.m_body.m_invMass; - force.m_body = bodyInvMass.VectorTimeMatrix(force.m_body); -} - -void ndSkeletonContainer::ndNode::JointJacobianTimeMassForward(ndForcePair& force) -{ - const ndSpatialMatrix& bodyJt = m_data.m_body.m_jt; - for (ndInt32 i = 0; i < m_dof; ++i) - { - force.m_joint[i] -= bodyJt[i].DotProduct(force.m_body); - } -} - -void ndSkeletonContainer::ndNode::BodyJacobianTimeMassForward(const ndForcePair& force, ndForcePair& parentForce) const -{ - const ndSpatialMatrix& jointJ = m_data.m_joint.m_jt; - for (ndInt32 i = 0; i < m_dof; ++i) - { - parentForce.m_body = parentForce.m_body + jointJ[i].Scale(-force.m_joint[i]); - } -} - -ndSkeletonContainer::ndSkeletonContainer() - :m_skeleton(nullptr) - ,m_nodesOrder(nullptr) - ,m_rightHandSide(nullptr) - ,m_leftHandSide(nullptr) - ,m_pairs(nullptr) - ,m_frictionIndex(nullptr) - ,m_matrixRowsIndex(nullptr) - ,m_massMatrix11(nullptr) - ,m_massMatrix10(nullptr) - ,m_deltaForce(nullptr) - ,m_nodeList() - ,m_loopingJoints(32) - ,m_auxiliaryMemoryBuffer(1024 * 8) - ,m_lock() - ,m_id(0) - ,m_blockSize(0) - ,m_rowCount(0) - ,m_loopRowCount(0) - ,m_auxiliaryRowCount(0) - ,m_loopCount(0) - ,m_dynamicsLoopCount(0) - ,m_isResting(0) -{ -} - -ndSkeletonContainer::~ndSkeletonContainer() -{ - for (ndInt32 i = 0; i < m_loopCount; ++i) - { - ndJointBilateralConstraint* const joint = m_loopingJoints[i]->GetAsBilateral(); - if (joint) - { - joint->m_isInSkeleton = false; - } - } - - for (ndInt32 i = m_nodeList.GetCount() - 2; i >= 0; i--) - { - m_nodesOrder[i]->m_joint->m_isInSkeleton = false; - } - - if (m_nodesOrder) - { - ndMemory::Free(m_nodesOrder); - } - - m_nodeList.RemoveAll(); -} - -void ndSkeletonContainer::Clear() -{ - for (ndInt32 i = 0; i < m_loopCount; ++i) - { - ndJointBilateralConstraint* const joint = m_loopingJoints[i]->GetAsBilateral(); - if (joint) - { - joint->m_isInSkeleton = false; - } - } - - m_loopCount = 0; - m_dynamicsLoopCount = 0; -} - -void ndSkeletonContainer::Init(ndBodyKinematic* const rootBody, ndInt32 id) -{ - m_id = id; - m_skeleton = &m_nodeList.Append()->GetInfo(); - m_skeleton->m_body = rootBody; - if (rootBody->GetInvMass() != ndFloat32(0.0f)) - { - m_skeleton->m_body->SetSkeleton(this); - } -} - -ndSkeletonContainer::ndNode* ndSkeletonContainer::AddChild(ndJointBilateralConstraint* const joint, ndNode* const parent) -{ - ndNode* const node = &m_nodeList.Append()->GetInfo(); - node->m_body = (joint->GetBody0() == parent->m_body) ? joint->GetBody1() : joint->GetBody0(); - node->m_joint = joint; - node->m_parent = parent; - node->m_swapJacobianBodiesIndex = (joint->GetBody0() == parent->m_body); - - ndAssert(node->m_parent); -#ifdef _DEBUG - if (node->m_body->GetInvMass() == ndFloat32(0.0f)) - { - ndTrace(("%s (%d %f) (%d %f)\n", joint->ClassName(), - joint->GetBody0()->GetId(), joint->GetBody0()->GetInvMass(), - joint->GetBody1()->GetId(), joint->GetBody1()->GetInvMass())); - } -#endif - ndAssert(node->m_body->GetInvMass() != ndFloat32(0.0f)); - - if (node->m_parent->m_child) - { - node->m_sibling = node->m_parent->m_child; - } - node->m_parent->m_child = node; - - joint->SetSkeletonFlag(true); - ndAssert(node->m_body->GetScene()->GetWorld()->GetSentinelBody()->GetAsBodyKinematic() != node->m_body); - node->m_body->SetSkeleton(this); - return node; -} - -void ndSkeletonContainer::SortGraph(ndNode* const root, ndInt32& index) -{ - for (ndNode* node = root->m_child; node; node = node->m_sibling) - { - SortGraph(node, index); - } - - ndAssert((m_nodeList.GetCount() - index - 1) >= 0); - m_nodesOrder[index] = root; - root->m_index = index; - ++index; - ndAssert(index <= m_nodeList.GetCount()); -} - -void ndSkeletonContainer::Finalize(ndInt32 loopJointsCount, ndJointBilateralConstraint** const loopJointArray) -{ - ndAssert(m_nodeList.GetCount() >= 1); - m_nodesOrder = (ndNode**)ndMemory::Malloc(m_nodeList.GetCount() * sizeof(ndNode*)); - - ndInt32 index = 0; - SortGraph(m_skeleton, index); - ndAssert(index == m_nodeList.GetCount()); - - for (ndInt32 i = 0; i < loopJointsCount; ++i) - { - ndJointBilateralConstraint* const joint = loopJointArray[i]; - joint->m_isInSkeleton = true; - m_loopingJoints.PushBack(joint); - m_loopCount++; - } -} - -void ndSkeletonContainer::ClearCloseLoopJoints() -{ - m_dynamicsLoopCount = 0; -} - -void ndSkeletonContainer::AddCloseLoopJoint(ndConstraint* const joint) -{ - ndScopeSpinLock lock(m_lock); - if (m_loopingJoints.GetCount() < (m_loopCount + m_dynamicsLoopCount + 1)) - { - m_loopingJoints.SetCount(2 * (m_loopCount + m_dynamicsLoopCount + 1)); - } - m_loopingJoints[m_loopCount + m_dynamicsLoopCount] = joint; - m_dynamicsLoopCount++; -} - -void ndSkeletonContainer::CheckSleepState() -{ - ndUnsigned8 equilibrium = 1; - for (ndInt32 i = m_nodeList.GetCount() - 1; i >= 0; --i) - { - ndNode* const node = m_nodesOrder[i]; - ndAssert(node->m_body); - equilibrium &= node->m_body->m_equilibrium; - } - - if (equilibrium) - { - const ndInt32 loopCount = m_loopCount + m_dynamicsLoopCount; - for (ndInt32 i = 0; i < loopCount; ++i) - { - const ndConstraint* const joint = m_loopingJoints[i]; - ndBodyKinematic* const body0 = joint->GetBody0(); - ndBodyKinematic* const body1 = joint->GetBody1(); - equilibrium &= body0->m_equilibrium; - equilibrium &= body1->m_equilibrium; - } - } - - if (!equilibrium) - { - for (ndInt32 i = m_nodeList.GetCount() - 1; i >= 0; --i) - { - ndNode* const node = m_nodesOrder[i]; - if (node->m_body->GetInvMass() > ndFloat32(0.0f)) - { - node->m_body->m_equilibrium = 0; - } - } - - const ndInt32 loopCount = m_loopCount + m_dynamicsLoopCount; - for (ndInt32 i = 0; i < loopCount; ++i) - { - const ndConstraint* const joint = m_loopingJoints[i]; - ndBodyKinematic* const body0 = joint->GetBody0(); - ndBodyKinematic* const body1 = joint->GetBody1(); - body0->m_equilibrium = 0; - if (body1->GetInvMass() > ndFloat32(0.0f)) - { - body1->m_equilibrium = 0; - } - } - } - m_isResting = equilibrium; -} - -void ndSkeletonContainer::CalculateBufferSizeInBytes() -{ - ndInt32 rowCount = 0; - ndInt32 auxiliaryRowCount = 0; - if (m_nodesOrder) - { - const ndInt32 nodeCount = m_nodeList.GetCount() - 1; - for (ndInt32 i = 0; i < nodeCount; ++i) - { - ndNode* const node = m_nodesOrder[i]; - rowCount += node->m_joint->m_rowCount; - auxiliaryRowCount += node->GetAuxiliaryRows(m_rightHandSide); - } - } - - ndInt32 extraAuxiliaryRows = 0; - const ndInt32 loopCount = m_loopCount + m_dynamicsLoopCount; - for (ndInt32 j = 0; j < loopCount; ++j) - { - const ndConstraint* const joint = m_loopingJoints[j]; - extraAuxiliaryRows += joint->m_rowCount; - } - rowCount += extraAuxiliaryRows; - auxiliaryRowCount += extraAuxiliaryRows; - - ndInt32 size = ndInt32(sizeof(ndInt32) * rowCount); - size += sizeof(ndInt32) * rowCount; - size += sizeof(ndNodePair) * rowCount; - size += sizeof(ndFloat32) * auxiliaryRowCount * auxiliaryRowCount; - size += sizeof(ndFloat32) * auxiliaryRowCount * (rowCount - auxiliaryRowCount); - size += sizeof(ndFloat32) * auxiliaryRowCount * (rowCount - auxiliaryRowCount); - size = (size + 1024) & -0x10; - m_auxiliaryMemoryBuffer.SetCount((size + 1024) & -0x10); -} - -void ndSkeletonContainer::CalculateLoopMassMatrixCoefficients(ndFloat32* const diagDamp) -{ - D_TRACKTIME(); - const ndInt32 primaryCount = m_rowCount - m_auxiliaryRowCount; - - ndJacobian tempArray[3]; - tempArray[0].m_linear = ndVector::m_zero; - tempArray[0].m_angular = ndVector::m_zero; - for (ndInt32 index = 0; index < m_auxiliaryRowCount; ++index) - { - const ndInt32 ii = m_matrixRowsIndex[primaryCount + index]; - const ndLeftHandSide* const row_i = &m_leftHandSide[ii]; - const ndRightHandSide* const rhs_i = &m_rightHandSide[ii]; - const ndJacobian JMinvM0(row_i->m_JMinv.m_jacobianM0); - const ndJacobian JMinvM1(row_i->m_JMinv.m_jacobianM1); - const ndVector element( - JMinvM0.m_linear * row_i->m_Jt.m_jacobianM0.m_linear + JMinvM0.m_angular * row_i->m_Jt.m_jacobianM0.m_angular + - JMinvM1.m_linear * row_i->m_Jt.m_jacobianM1.m_linear + JMinvM1.m_angular * row_i->m_Jt.m_jacobianM1.m_angular); - - // I know I am doubling the matrix regularizer, but this makes the solution more robust. - ndFloat32* const matrixRow11 = &m_massMatrix11[m_auxiliaryRowCount * index]; - ndFloat32 diagonal = element.AddHorizontal().GetScalar() + rhs_i->m_diagDamp; - matrixRow11[index] = diagonal + rhs_i->m_diagDamp; - diagDamp[index] = matrixRow11[index] * ndFloat32(4.0e-3f); - - const ndInt32 m0_i = m_pairs[primaryCount + index].m_m0; - const ndInt32 m1_i = m_pairs[primaryCount + index].m_m1; - - tempArray[1] = row_i->m_JMinv.m_jacobianM0; - tempArray[2] = row_i->m_JMinv.m_jacobianM1; - for (ndInt32 j = index + 1; j < m_auxiliaryRowCount; ++j) - { - const ndInt32 jj = m_matrixRowsIndex[primaryCount + j]; - const ndLeftHandSide* const row_j = &m_leftHandSide[jj]; - - const ndInt32 k = primaryCount + j; - const ndInt32 m0_j = m_pairs[k].m_m0; - const ndInt32 m1_j = m_pairs[k].m_m1; - - const ndInt32 index_m0_j_m0_i_mask = -(m0_j == m0_i); - const ndInt32 index_m0_j_m1_i_mask = -(m0_j == m1_i); - const ndInt32 index_m1_j_m0_i_mask = -(m1_j == m0_i); - const ndInt32 index_m1_j_m1_i_mask = -(m1_j == m1_i); - - const ndInt32 index_m0_j = (index_m0_j_m0_i_mask & 1) | (index_m0_j_m1_i_mask & 2); - const ndInt32 index_m1_j = (index_m1_j_m0_i_mask & 1) | (index_m1_j_m1_i_mask & 2); - - ndVector acc(row_j->m_Jt.m_jacobianM0.m_linear * tempArray[index_m0_j].m_linear); - acc = acc.MulAdd(row_j->m_Jt.m_jacobianM0.m_angular, tempArray[index_m0_j].m_angular); - acc = acc.MulAdd(row_j->m_Jt.m_jacobianM1.m_linear, tempArray[index_m1_j].m_linear); - acc = acc.MulAdd(row_j->m_Jt.m_jacobianM1.m_angular, tempArray[index_m1_j].m_angular); - acc = acc.AddHorizontal(); - - ndFloat32 offDiagValue = acc.GetScalar(); - matrixRow11[j] = offDiagValue; - m_massMatrix11[j * m_auxiliaryRowCount + index] = offDiagValue; - } - - ndFloat32* const matrixRow10 = &m_massMatrix10[primaryCount * index]; - for (ndInt32 j = 0; j < primaryCount; ++j) - { - const ndInt32 jj = m_matrixRowsIndex[j]; - const ndLeftHandSide* const row_j = &m_leftHandSide[jj]; - - const ndInt32 m0_j = m_pairs[j].m_m0; - const ndInt32 m1_j = m_pairs[j].m_m1; - - const ndInt32 index_m0_j_m0_i_mask = -(m0_j == m0_i); - const ndInt32 index_m0_j_m1_i_mask = -(m0_j == m1_i); - const ndInt32 index_m1_j_m0_i_mask = -(m1_j == m0_i); - const ndInt32 index_m1_j_m1_i_mask = -(m1_j == m1_i); - - const ndInt32 index_m0_j = (index_m0_j_m0_i_mask & 1) | (index_m0_j_m1_i_mask & 2); - const ndInt32 index_m1_j = (index_m1_j_m0_i_mask & 1) | (index_m1_j_m1_i_mask & 2); - - ndVector acc(row_j->m_Jt.m_jacobianM0.m_linear * tempArray[index_m0_j].m_linear); - acc = acc.MulAdd(row_j->m_Jt.m_jacobianM0.m_angular, tempArray[index_m0_j].m_angular); - acc = acc.MulAdd(row_j->m_Jt.m_jacobianM1.m_linear, tempArray[index_m1_j].m_linear); - acc = acc.MulAdd(row_j->m_Jt.m_jacobianM1.m_angular, tempArray[index_m1_j].m_angular); - acc = acc.AddHorizontal(); - matrixRow10[j] = acc.GetScalar(); - } - } -} - -void ndSkeletonContainer::SolveForward(ndForcePair* const force, const ndForcePair* const accel, ndInt32 startNode) const -{ - ndSpatialVector zero(ndSpatialVector::m_zero); - for (ndInt32 i = 0; i < startNode; ++i) - { - force[i].m_body = zero; - force[i].m_joint = zero; - } - - const ndInt32 nodeCount = m_nodeList.GetCount(); - for (ndInt32 i = startNode; i < nodeCount - 1; ++i) - { - ndNode* const node = m_nodesOrder[i]; - ndAssert(node->m_joint); - ndAssert(node->m_index == i); - ndForcePair& f = force[i]; - const ndForcePair& a = accel[i]; - f.m_body = a.m_body; - f.m_joint = a.m_joint; - for (ndNode* child = node->m_child; child; child = child->m_sibling) - { - ndAssert(child->m_joint); - ndAssert(child->m_parent->m_index == i); - child->BodyJacobianTimeMassForward(force[child->m_index], f); - } - node->JointJacobianTimeMassForward(f); - } - - force[nodeCount - 1] = accel[nodeCount - 1]; - for (ndNode* child = m_nodesOrder[nodeCount - 1]->m_child; child; child = child->m_sibling) - { - child->BodyJacobianTimeMassForward(force[child->m_index], force[child->m_parent->m_index]); - } - - for (ndInt32 i = startNode; i < nodeCount - 1; ++i) - { - ndNode* const node = m_nodesOrder[i]; - ndForcePair& f = force[i]; - node->BodyDiagInvTimeSolution(f); - node->JointDiagInvTimeSolution(f); - } - m_nodesOrder[nodeCount - 1]->BodyDiagInvTimeSolution(force[nodeCount - 1]); -} - -void ndSkeletonContainer::SolveBackward(ndForcePair* const force) const -{ - const ndInt32 nodeCount = m_nodeList.GetCount(); - for (ndInt32 i = nodeCount - 2; i >= 0; i--) - { - ndNode* const node = m_nodesOrder[i]; - ndAssert(node->m_index == i); - ndForcePair& f = force[i]; - node->JointJacobianTimeSolutionBackward(f, force[node->m_parent->m_index]); - node->BodyJacobianTimeSolutionBackward(f); - } -} - -void ndSkeletonContainer::ConditionMassMatrix() const -{ - D_TRACKTIME(); - const ndInt32 nodeCount = m_nodeList.GetCount(); - ndForcePair* const forcePair = ndAlloca(ndForcePair, nodeCount); - const ndSpatialVector zero(ndSpatialVector::m_zero); - - const ndInt32 primaryCount = m_rowCount - m_auxiliaryRowCount; - for (ndInt32 i = 0; i < m_auxiliaryRowCount; ++i) - { - ndInt32 entry0 = 0; - ndInt32 startjoint = nodeCount; - const ndFloat32* const matrixRow10 = &m_massMatrix10[i * primaryCount]; - for (ndInt32 j = 0; j < nodeCount - 1; ++j) - { - const ndNode* const node = m_nodesOrder[j]; - const ndInt32 index = node->m_index; - forcePair[index].m_body = zero; - ndSpatialVector& a = forcePair[index].m_joint; - - const ndInt32 count = node->m_dof; - for (ndInt32 k = 0; k < count; ++k) - { - const ndFloat32 value = matrixRow10[entry0]; - a[k] = value; - startjoint = (value == 0.0f) ? startjoint : ndMin(startjoint, index); - entry0++; - } - } - - startjoint = (startjoint == nodeCount) ? 0 : startjoint; - ndAssert(startjoint < nodeCount); - forcePair[nodeCount - 1].m_body = zero; - forcePair[nodeCount - 1].m_joint = zero; - SolveForward(forcePair, forcePair, startjoint); - SolveBackward(forcePair); - - ndInt32 entry1 = 0; - ndFloat32* const deltaForcePtr = &m_deltaForce[i * primaryCount]; - for (ndInt32 j = 0; j < nodeCount - 1; ++j) - { - const ndNode* const node = m_nodesOrder[j]; - const ndInt32 index = node->m_index; - const ndSpatialVector& f = forcePair[index].m_joint; - const ndInt32 count = node->m_dof; - for (ndInt32 k = 0; k < count; ++k) - { - deltaForcePtr[entry1] = ndFloat32(f[k]); - entry1++; - } - } - } -} - -void ndSkeletonContainer::RebuildMassMatrix(const ndFloat32* const diagDamp) const -{ - D_TRACKTIME(); - const ndInt32 primaryCount = m_rowCount - m_auxiliaryRowCount; - ndInt16* const indexList = ndAlloca(ndInt16, primaryCount); - for (ndInt32 i = 0; i < m_auxiliaryRowCount; ++i) - { - const ndFloat32* const matrixRow10 = &m_massMatrix10[i * primaryCount]; - ndFloat32* const matrixRow11 = &m_massMatrix11[i * m_auxiliaryRowCount]; - - ndInt32 indexCount = 0; - for (ndInt32 k = 0; k < primaryCount; ++k) - { - indexList[indexCount] = ndInt16(k); - indexCount += (matrixRow10[k] != ndFloat32(0.0f)) ? 1 : 0; - } - - for (ndInt32 j = i; j < m_auxiliaryRowCount; ++j) - { - ndFloat32 offDiagonal = matrixRow11[j]; - const ndFloat32* const row10 = &m_deltaForce[j * primaryCount]; - for (ndInt32 k = 0; k < indexCount; ++k) - { - ndInt32 index = indexList[k]; - offDiagonal += matrixRow10[index] * row10[index]; - } - matrixRow11[j] = offDiagonal; - m_massMatrix11[j * m_auxiliaryRowCount + i] = offDiagonal; - } - - matrixRow11[i] = ndMax(matrixRow11[i], diagDamp[i]); - } -} - -void ndSkeletonContainer::FactorizeMatrix(ndInt32 size, ndInt32 stride, ndFloat32* const matrix, ndFloat32* const diagDamp) const -{ - D_TRACKTIME(); - // save the matrix - ndInt32 srcLine = 0; - ndInt32 dstLine = 0; - ndFloat32* const backupMatrix = ndAlloca(ndFloat32, size * stride); - for (ndInt32 i = 0; i < size; ++i) - { - ndMemCpy(&backupMatrix[dstLine], &matrix[srcLine], size); - dstLine += size; - srcLine += stride; - } - - while (!ndCholeskyFactorization(size, stride, matrix)) - { - srcLine = 0; - dstLine = 0; - for (ndInt32 i = 0; i < size; ++i) - { - ndMemCpy(&matrix[dstLine], &backupMatrix[srcLine], size); - diagDamp[i] *= ndFloat32(4.0f); - matrix[dstLine + i] += diagDamp[i]; - dstLine += stride; - srcLine += size; - } - } -} - -void ndSkeletonContainer::InitLoopMassMatrix() -{ - CalculateBufferSizeInBytes(); - ndInt8* const memoryBuffer = &m_auxiliaryMemoryBuffer[0]; - const ndInt32 primaryCount = m_rowCount - m_auxiliaryRowCount; - - m_frictionIndex = (ndInt32*)memoryBuffer; - m_matrixRowsIndex = (ndInt32*)&m_frictionIndex[m_rowCount]; - m_pairs = (ndNodePair*)&m_matrixRowsIndex[m_rowCount]; - m_massMatrix11 = (ndFloat32*)&m_pairs[m_rowCount]; - m_massMatrix10 = (ndFloat32*)&m_massMatrix11[m_auxiliaryRowCount * m_auxiliaryRowCount]; - m_deltaForce = &m_massMatrix10[m_auxiliaryRowCount * primaryCount]; - - ndInt32* const boundRow = ndAlloca(ndInt32, m_auxiliaryRowCount); - - m_blockSize = 0; - ndInt32 primaryIndex = 0; - ndInt32 auxiliaryIndex = 0; - const ndInt32 nodeCount = m_nodeList.GetCount() - 1; - for (ndInt32 i = 0; i < nodeCount; ++i) - { - const ndNode* const node = m_nodesOrder[i]; - ndJointBilateralConstraint* const joint = node->m_joint; - const ndInt32 m0 = joint->GetBody0()->m_index; - const ndInt32 m1 = joint->GetBody1()->m_index; - const ndInt32 primaryDof = node->m_dof; - const ndInt32 first = joint->m_rowStart; - for (ndInt32 j = 0; j < primaryDof; ++j) - { - const ndInt32 index = node->m_ordinal.m_sourceJacobianIndex[j]; - m_pairs[primaryIndex].m_m0 = m0; - m_pairs[primaryIndex].m_m1 = m1; - m_pairs[primaryIndex].m_joint = joint; - m_frictionIndex[primaryIndex] = 0; - m_matrixRowsIndex[primaryIndex] = first + index; - primaryIndex++; - } - - const ndInt32 auxiliaryDof = joint->m_rowCount - primaryDof; - for (ndInt32 j = 0; j < auxiliaryDof; ++j) - { - const ndInt32 index = node->m_ordinal.m_sourceJacobianIndex[primaryDof + j]; - const ndRightHandSide* const rhs = &m_rightHandSide[first + index]; - - m_pairs[auxiliaryIndex + primaryCount].m_m0 = m0; - m_pairs[auxiliaryIndex + primaryCount].m_m1 = m1; - m_pairs[auxiliaryIndex + primaryCount].m_joint = joint; - m_frictionIndex[auxiliaryIndex + primaryCount] = 0; - m_matrixRowsIndex[auxiliaryIndex + primaryCount] = first + index; - const ndInt32 boundIndex = (rhs->m_lowerBoundFrictionCoefficent <= ndFloat32(-D_MAX_SKELETON_LCP_VALUE)) && (rhs->m_upperBoundFrictionCoefficent >= ndFloat32(D_MAX_SKELETON_LCP_VALUE)) ? 1 : 0; - boundRow[auxiliaryIndex] = boundIndex; - m_blockSize += boundIndex; - auxiliaryIndex++; - } - } - ndAssert(m_loopRowCount == (m_auxiliaryRowCount - auxiliaryIndex)); - - const ndInt32 loopCount = m_loopCount + m_dynamicsLoopCount; - for (ndInt32 j = 0; j < loopCount; ++j) - { - const ndConstraint* const joint = m_loopingJoints[j]; - const ndInt32 m0 = joint->GetBody0()->m_index; - const ndInt32 m1 = joint->GetBody1()->m_index; - - const ndInt32 first = joint->m_rowStart; - const ndInt32 auxiliaryDof = joint->m_rowCount; - for (ndInt32 i = 0; i < auxiliaryDof; ++i) - { - const ndRightHandSide* const rhs = &m_rightHandSide[first + i]; - m_pairs[auxiliaryIndex + primaryCount].m_m0 = m0; - m_pairs[auxiliaryIndex + primaryCount].m_m1 = m1; - m_pairs[auxiliaryIndex + primaryCount].m_joint = joint; - m_frictionIndex[auxiliaryIndex + primaryCount] = (rhs->m_normalForceIndex < 0) ? 0 : rhs->m_normalForceIndex - i; - m_matrixRowsIndex[auxiliaryIndex + primaryCount] = first + i; - const ndInt32 boundIndex = (rhs->m_lowerBoundFrictionCoefficent <= ndFloat32(-D_MAX_SKELETON_LCP_VALUE)) && (rhs->m_upperBoundFrictionCoefficent >= ndFloat32(D_MAX_SKELETON_LCP_VALUE)) ? 1 : 0; - boundRow[auxiliaryIndex] = boundIndex; - m_blockSize += boundIndex; - auxiliaryIndex++; - } - } - - ndAssert(primaryIndex == primaryCount); - ndAssert(auxiliaryIndex == m_auxiliaryRowCount); - - for (ndInt32 i = 1; i < auxiliaryIndex; ++i) - { - ndInt32 tmpBoundRow = boundRow[i]; - ndNodePair tmpPair(m_pairs[primaryCount + i]); - ndInt32 tmpFrictionIndex = m_frictionIndex[primaryCount + i]; - ndInt32 tmpMatrixRowsIndex = m_matrixRowsIndex[primaryCount + i]; - - ndInt32 j = i; - for (; j && (boundRow[j - 1] < tmpBoundRow); j--) - { - ndAssert(j > 0); - boundRow[j] = boundRow[j - 1]; - m_pairs[primaryCount + j] = m_pairs[primaryCount + j - 1]; - m_frictionIndex[primaryCount + j] = m_frictionIndex[primaryCount + j - 1]; - m_matrixRowsIndex[primaryCount + j] = m_matrixRowsIndex[primaryCount + j - 1]; - } - boundRow[j] = tmpBoundRow; - m_pairs[primaryCount + j] = tmpPair; - m_frictionIndex[primaryCount + j] = tmpFrictionIndex; - m_matrixRowsIndex[primaryCount + j] = tmpMatrixRowsIndex; - } - - ndFloat32* const diagDamp = ndAlloca(ndFloat32, m_auxiliaryRowCount); - ndMemSet(m_massMatrix10, ndFloat32(0.0f), primaryCount * m_auxiliaryRowCount); - ndMemSet(m_massMatrix11, ndFloat32(0.0f), m_auxiliaryRowCount * m_auxiliaryRowCount); - - CalculateLoopMassMatrixCoefficients(diagDamp); - ConditionMassMatrix(); - RebuildMassMatrix(diagDamp); - - if (m_blockSize) - { - FactorizeMatrix(m_blockSize, m_auxiliaryRowCount, m_massMatrix11, diagDamp); - - ndInt32 rowStart = 0; - const ndInt32 boundedSize = m_auxiliaryRowCount - m_blockSize; - ndFloat32* const acc = ndAlloca(ndFloat32, m_auxiliaryRowCount); - for (ndInt32 i = 0; i < m_blockSize; ++i) - { - ndMemSet(acc, ndFloat32(0.0f), boundedSize); - const ndFloat32* const row = &m_massMatrix11[rowStart]; - for (ndInt32 j = 0; j < i; ++j) - { - const ndFloat32 s = row[j]; - const ndFloat32* const x = &m_massMatrix11[j * m_auxiliaryRowCount + m_blockSize]; - for (ndInt32 k = 0; k < boundedSize; ++k) - { - acc[k] += s * x[k]; - } - } - - ndFloat32* const x = &m_massMatrix11[rowStart + m_blockSize]; - const ndFloat32 den = -ndFloat32(1.0f) / row[i]; - for (ndInt32 j = 0; j < boundedSize; ++j) - { - x[j] = (x[j] + acc[j]) * den; - } - rowStart += m_auxiliaryRowCount; - } - - for (ndInt32 i = m_blockSize - 1; i >= 0; i--) - { - ndMemSet(acc, ndFloat32(0.0f), boundedSize); - for (ndInt32 j = i + 1; j < m_blockSize; ++j) - { - const ndFloat32 s = m_massMatrix11[j * m_auxiliaryRowCount + i]; - const ndFloat32* const x = &m_massMatrix11[j * m_auxiliaryRowCount + m_blockSize]; - for (ndInt32 k = 0; k < boundedSize; ++k) - { - acc[k] += s * x[k]; - } - } - - ndFloat32* const x = &m_massMatrix11[i * m_auxiliaryRowCount + m_blockSize]; - const ndFloat32 den = ndFloat32(1.0f) / m_massMatrix11[i * m_auxiliaryRowCount + i]; - for (ndInt32 j = 0; j < boundedSize; ++j) - { - x[j] = (x[j] - acc[j]) * den; - } - } - - for (ndInt32 i = 0; i < boundedSize; ++i) - { - for (ndInt32 j = 0; j < m_blockSize; ++j) - { - acc[j] = m_massMatrix11[j * m_auxiliaryRowCount + m_blockSize + i]; - } - - ndFloat32* const arow = &m_massMatrix11[(m_blockSize + i) * m_auxiliaryRowCount + m_blockSize]; - for (ndInt32 j = i; j < boundedSize; ++j) - { - const ndFloat32* const row1 = &m_massMatrix11[(m_blockSize + j) * m_auxiliaryRowCount]; - ndFloat32 elem = row1[m_blockSize + i] + ndDotProduct(m_blockSize, acc, row1); - arow[j] = elem; - m_massMatrix11[(m_blockSize + j) * m_auxiliaryRowCount + m_blockSize + i] = elem; - } - arow[i] += diagDamp[m_blockSize + i]; - } - ndAssert(!boundedSize || ndTestPSDmatrix(m_auxiliaryRowCount - m_blockSize, m_auxiliaryRowCount, &m_massMatrix11[m_auxiliaryRowCount * m_blockSize + m_blockSize])); - } -} - -void ndSkeletonContainer::CalculateJointAccel(const ndJacobian* const internalForces, ndForcePair* const accel) const -{ - const ndSpatialVector zero(ndSpatialVector::m_zero); - const ndInt32 nodeCount = m_nodeList.GetCount(); - for (ndInt32 i = 0; i < nodeCount - 1; ++i) - { - ndNode* const node = m_nodesOrder[i]; - ndAssert(i == node->m_index); - - ndForcePair& a = accel[i]; - ndAssert(node->m_body); - a.m_body = zero; - a.m_joint = zero; - - ndAssert(node->m_joint); - ndJointBilateralConstraint* const joint = node->m_joint; - - const ndInt32 first = joint->m_rowStart; - const ndInt32 dof = joint->m_rowCount; - const ndInt32 m0 = joint->GetBody0()->m_index; - const ndInt32 m1 = joint->GetBody1()->m_index; - const ndJacobian& y0 = internalForces[m0]; - const ndJacobian& y1 = internalForces[m1]; - - for (ndInt32 j = 0; j < dof; ++j) - { - const ndInt32 k = node->m_ordinal.m_sourceJacobianIndex[j]; - const ndLeftHandSide* const row = &m_leftHandSide[first + k]; - const ndRightHandSide* const rhs = &m_rightHandSide[first + k]; - ndVector diag( - row->m_JMinv.m_jacobianM0.m_linear * y0.m_linear + row->m_JMinv.m_jacobianM0.m_angular * y0.m_angular + - row->m_JMinv.m_jacobianM1.m_linear * y1.m_linear + row->m_JMinv.m_jacobianM1.m_angular * y1.m_angular); - a.m_joint[j] = -(rhs->m_coordenateAccel - rhs->m_force * rhs->m_diagDamp - diag.AddHorizontal().GetScalar()); - } - } - ndAssert((nodeCount - 1) == m_nodesOrder[nodeCount - 1]->m_index); - accel[nodeCount - 1].m_body = zero; - accel[nodeCount - 1].m_joint = zero; -} - -void ndSkeletonContainer::CalculateForce(ndForcePair* const force, const ndForcePair* const accel) const -{ - SolveForward(force, accel, 0); - SolveBackward(force); -} - -void ndSkeletonContainer::UpdateForces(ndJacobian* const internalForces, const ndForcePair* const force) const -{ - const ndVector zero(ndVector::m_zero); - const ndInt32 nodeCount = m_nodeList.GetCount(); - for (ndInt32 i = 0; i < (nodeCount - 1); ++i) - { - ndNode* const node = m_nodesOrder[i]; - ndJointBilateralConstraint* const joint = node->m_joint; - - ndJacobian y0; - ndJacobian y1; - y0.m_linear = zero; - y0.m_angular = zero; - y1.m_linear = zero; - y1.m_angular = zero; - ndAssert(i == node->m_index); - - const ndSpatialVector& f = force[i].m_joint; - const ndInt32 first = joint->m_rowStart; - const ndInt32 count = node->m_dof; - for (ndInt32 j = 0; j < count; ++j) - { - const ndInt32 k = node->m_ordinal.m_sourceJacobianIndex[j]; - const ndLeftHandSide* const row = &m_leftHandSide[first + k]; - - ndVector jointForce = ndFloat32(f[j]); - y0.m_linear += row->m_Jt.m_jacobianM0.m_linear * jointForce; - y0.m_angular += row->m_Jt.m_jacobianM0.m_angular * jointForce; - y1.m_linear += row->m_Jt.m_jacobianM1.m_linear * jointForce; - y1.m_angular += row->m_Jt.m_jacobianM1.m_angular * jointForce; - } - - const ndInt32 m0 = joint->GetBody0()->m_index; - const ndInt32 m1 = joint->GetBody1()->m_index; - internalForces[m0].m_linear += y0.m_linear; - internalForces[m0].m_angular += y0.m_angular; - internalForces[m1].m_linear += y1.m_linear; - internalForces[m1].m_angular += y1.m_angular; - } -} - -/* -void ndSkeletonContainer::SolveLcp0(ndInt32 stride, ndInt32 size, const ndFloat32* const matrix, const ndFloat32* const x0, ndFloat32* const x, const ndFloat32* const b, const ndFloat32* const low, const ndFloat32* const high, const ndInt32* const normalIndex) const -{ - D_TRACKTIME(); - const ndFloat32 sor = ndFloat32(1.125f); - const ndFloat32 tol2 = ndFloat32(0.25f); - const ndInt32 maxIterCount = 64; - - ndFloat32* const invDiag1 = ndAlloca(ndFloat32, size); - ndFloat32* const residual = ndAlloca(ndFloat32, size); - - ndInt32 base = 0; - for (ndInt32 i = 0; i < size; ++i) - { - const ndInt32 index = normalIndex[i]; - const ndInt32 mask = index >> 31; - const ndInt32 index0 = i + index; - const ndInt32 index1 = (~mask & size) | (mask & index0); - const ndFloat32 coefficient = x[index1] + x0[index1]; - - const ndFloat32 l = low[i] * coefficient - x0[i]; - const ndFloat32 h = high[i] * coefficient - x0[i]; - x[i] = ndClamp(ndFloat32(0.0f), l, h); - invDiag1[i] = ndFloat32(1.0f) / matrix[base + i]; - base += stride; - } - - base = 0; - for (ndInt32 i = 0; i < size; ++i) - { - const ndFloat32* const row = &matrix[base]; - residual[i] = b[i] - dDotProduct(size, row, x); - base += stride; - } - - ndInt32 iterCount = 0; - ndFloat32 tolerance(tol2 * ndFloat32(2.0f)); - const ndFloat32* const invDiag = invDiag1; - for (ndInt32 k = 0; (k < maxIterCount) && (tolerance > tol2); ++k) - { - base = 0; - iterCount++; - tolerance = ndFloat32(0.0f); - for (ndInt32 i = 0; i < size; ++i) - { - const ndFloat32 r = residual[i]; - const ndInt32 index = normalIndex[i]; - - const ndInt32 mask = index >> 31; - const ndInt32 index0 = i + index; - const ndInt32 index1 = (~mask & size) | (mask & index0); - const ndFloat32 coefficient = x[index1] + x0[index1]; - - const ndFloat32 l = low[i] * coefficient - x0[i]; - const ndFloat32 h = high[i] * coefficient - x0[i]; - - const ndFloat32* const row = &matrix[base]; -#if 0 - ndFloat32 f = x[i] + ((r + row[i] * x[i]) * invDiag[i] - x[i]) * sor; - if (f > h) - { - f = h; - } - else if (f < l) - { - f = l; - } - else - { - tolerance += r * r; - } - const ndFloat32 dx = f - x[i]; -#else - const ndFloat32 f = ndClamp(x[i] + ((r + row[i] * x[i]) * invDiag[i] - x[i]) * sor, l, h); - const ndFloat32 dx = f - x[i]; - const ndFloat32 dr = dx * row[i]; - tolerance += dr * dr; -#endif - x[i] = f; - if (ndAbs(dx) > ndFloat32(1.0e-6f)) - { - for (ndInt32 j = 0; j < size; ++j) - { - residual[j] -= row[j] * dx; - } - } - base += stride; - } - } -} -*/ - -void ndSkeletonContainer::SolveLcp(ndInt32 stride, ndInt32 size, const ndFloat32* const matrix, const ndFloat32* const x0, ndFloat32* const x, const ndFloat32* const b, const ndFloat32* const low, const ndFloat32* const high, const ndInt32* const normalIndex, ndFloat32 accelTol) const -{ - D_TRACKTIME(); - const ndInt32 maxIterCount = 64; - const ndFloat32 sor = ndFloat32(1.125f); - const ndFloat32 tol2 = accelTol * accelTol; - - ndFloat32* const invDiag1 = ndAlloca(ndFloat32, size); - ndFloat32* const residual = ndAlloca(ndFloat32, size); - ndInt32* const tempNormalIndex = ndAlloca(ndInt32, size); - - ndInt32 base = 0; - for (ndInt32 i = 0; i < size; ++i) - { - const ndInt32 index = normalIndex[i]; - const ndInt32 mask = index >> 31; - const ndInt32 index0 = i + index; - const ndInt32 index1 = (~mask & size) | (mask & index0); - tempNormalIndex[i] = index1; - const ndFloat32 coefficient = x[index1] + x0[index1]; - - const ndFloat32 l = low[i] * coefficient - x0[i]; - const ndFloat32 h = high[i] * coefficient - x0[i]; - x[i] = ndClamp(ndFloat32(0.0f), l, h); - invDiag1[i] = ndFloat32(1.0f) / matrix[base + i]; - base += stride; - } - - base = 0; - for (ndInt32 i = 0; i < size; ++i) - { - const ndFloat32* const row = &matrix[base]; - residual[i] = b[i] - ndDotProduct(size, row, x); - base += stride; - } - - ndInt32 iterCount = 0; - ndFloat32 tolerance(tol2 * ndFloat32(2.0f)); - const ndFloat32* const invDiag = invDiag1; - for (ndInt32 k = 0; (k < maxIterCount) && (tolerance > tol2); ++k) - { - base = 0; - iterCount++; - tolerance = ndFloat32(0.0f); - for (ndInt32 i = 0; i < size; ++i) - { - const ndFloat32 r = residual[i]; - const ndInt32 index = tempNormalIndex[i]; - const ndFloat32 coefficient = x[index] + x0[index]; - - const ndFloat32 l = low[i] * coefficient - x0[i]; - const ndFloat32 h = high[i] * coefficient - x0[i]; - - const ndFloat32* const row = &matrix[base]; - const ndFloat32 f = ndClamp(x[i] + ((r + row[i] * x[i]) * invDiag[i] - x[i]) * sor, l, h); - const ndFloat32 dx = f - x[i]; - const ndFloat32 dr = dx * row[i]; - tolerance += dr * dr; - - x[i] = f; - if (ndAbs(dx) > ndFloat32(1.0e-6f)) - { - for (ndInt32 j = 0; j < size; ++j) - { - residual[j] -= row[j] * dx; - } - } - base += stride; - } - } -} - -void ndSkeletonContainer::SolveBlockLcp(ndInt32 size, ndInt32 blockSize, const ndFloat32* const x0, ndFloat32* const x, ndFloat32* const b, const ndFloat32* const low, const ndFloat32* const high, const ndInt32* const normalIndex, ndFloat32 accelTol) const -{ - if (blockSize) - { - ndSolveCholesky(blockSize, size, m_massMatrix11, x, b); - if (blockSize != size) - { - ndInt32 base = blockSize * size; - for (ndInt32 i = blockSize; i < size; ++i) - { - b[i] -= ndDotProduct(blockSize, &m_massMatrix11[base], x); - base += size; - } - - const ndInt32 boundedSize = size - blockSize; - SolveLcp( - size, boundedSize, &m_massMatrix11[blockSize * size + blockSize], - &x0[blockSize], &x[blockSize], &b[blockSize], &low[blockSize], &high[blockSize], &normalIndex[blockSize], accelTol); - - for (ndInt32 j = 0; j < blockSize; ++j) - { - const ndFloat32* const row = &m_massMatrix11[j * size + blockSize]; - ndFloat32 acc = ndFloat32(0.0f); - for (ndInt32 i = 0; i < boundedSize; ++i) - { - acc += x[blockSize + i] * row[i]; - } - x[j] += acc; - } - } - } - else - { - SolveLcp(size, size, m_massMatrix11, x0, x, b, low, high, normalIndex, accelTol); - } -} - -void ndSkeletonContainer::SolveAuxiliary(ndJacobian* const internalForces, const ndForcePair* const, ndForcePair* const force) const -{ - ndFloat32* const f = ndAlloca(ndFloat32, m_rowCount); - ndFloat32* const b = ndAlloca(ndFloat32, m_auxiliaryRowCount); - ndFloat32* const low = ndAlloca(ndFloat32, m_auxiliaryRowCount); - ndFloat32* const high = ndAlloca(ndFloat32, m_auxiliaryRowCount); - ndFloat32* const u = ndAlloca(ndFloat32, m_auxiliaryRowCount + 1); - ndFloat32* const u0 = ndAlloca(ndFloat32, m_auxiliaryRowCount + 1); - - ndInt32 primaryIndex = 0; - const ndInt32 primaryCount = m_rowCount - m_auxiliaryRowCount; - - const ndInt32 nodeCount = m_nodeList.GetCount(); - for (ndInt32 i = 0; i < nodeCount - 1; ++i) - { - const ndNode* const node = m_nodesOrder[i]; - const ndInt32 primaryDof = node->m_dof; - const ndSpatialVector& forceSpatial = force[i].m_joint; - - for (ndInt32 j = 0; j < primaryDof; ++j) - { - f[primaryIndex] = ndFloat32(forceSpatial[j]); - primaryIndex++; - } - } - - ndAssert(primaryIndex == primaryCount); - for (ndInt32 i = 0; i < m_auxiliaryRowCount; ++i) - { - const ndInt32 index = m_matrixRowsIndex[primaryCount + i]; - const ndLeftHandSide* const row = &m_leftHandSide[index]; - const ndRightHandSide* const rhs = &m_rightHandSide[index]; - - const ndInt32 m0 = m_pairs[primaryCount + i].m_m0; - const ndInt32 m1 = m_pairs[primaryCount + i].m_m1; - - const ndJacobian& y0 = internalForces[m0]; - const ndJacobian& y1 = internalForces[m1]; - - ndVector acc( - row->m_JMinv.m_jacobianM0.m_linear * y0.m_linear + row->m_JMinv.m_jacobianM0.m_angular * y0.m_angular + - row->m_JMinv.m_jacobianM1.m_linear * y1.m_linear + row->m_JMinv.m_jacobianM1.m_angular * y1.m_angular); - b[i] = rhs->m_coordenateAccel - acc.AddHorizontal().GetScalar(); - - u0[i] = rhs->m_force; - low[i] = rhs->m_lowerBoundFrictionCoefficent; - high[i] = rhs->m_upperBoundFrictionCoefficent; - } - - for (ndInt32 i = 0; i < m_auxiliaryRowCount; ++i) - { - ndFloat32* const matrixRow10 = &m_massMatrix10[i * primaryCount]; - b[i] -= ndDotProduct(primaryCount, matrixRow10, f); - } - - const ndInt32* const normalIndex = &m_frictionIndex[primaryCount]; - u[m_auxiliaryRowCount] = ndFloat32(1.0f); - u0[m_auxiliaryRowCount] = ndFloat32(0.0f); - SolveBlockLcp(m_auxiliaryRowCount, m_blockSize, u0, u, b, low, high, normalIndex, ndFloat32 (0.5f)); - - for (ndInt32 i = 0; i < m_auxiliaryRowCount; ++i) - { - const ndFloat32 s = u[i]; - f[primaryCount + i] = s; - ndScaleAdd(primaryCount, f, &m_deltaForce[i * primaryCount], s); - } - - for (ndInt32 i = 0; i < m_rowCount; ++i) - { - ndInt32 index = m_matrixRowsIndex[i]; - const ndLeftHandSide* const row = &m_leftHandSide[index]; - const ndVector jointForce(f[i]); - const ndInt32 m0 = m_pairs[i].m_m0; - const ndInt32 m1 = m_pairs[i].m_m1; - internalForces[m0].m_linear += row->m_Jt.m_jacobianM0.m_linear * jointForce; - internalForces[m0].m_angular += row->m_Jt.m_jacobianM0.m_angular * jointForce; - internalForces[m1].m_linear += row->m_Jt.m_jacobianM1.m_linear * jointForce; - internalForces[m1].m_angular += row->m_Jt.m_jacobianM1.m_angular * jointForce; - } -} - -void ndSkeletonContainer::InitMassMatrix(const ndLeftHandSide* const leftHandSide, ndRightHandSide* const rightHandSide) -{ - D_TRACKTIME(); - if (m_isResting) - { - return; - } - ndInt32 rowCount = 0; - ndInt32 auxiliaryCount = 0; - m_leftHandSide = leftHandSide; - m_rightHandSide = rightHandSide; - - const ndInt32 nodeCount = m_nodeList.GetCount(); - ndSpatialMatrix* const bodyMassArray = ndAlloca(ndSpatialMatrix, nodeCount); - ndSpatialMatrix* const jointMassArray = ndAlloca(ndSpatialMatrix, nodeCount); - if (m_nodesOrder) - { - for (ndInt32 i = 0; i < nodeCount - 1; ++i) - { - ndNode* const node = m_nodesOrder[i]; - rowCount += node->m_joint->m_rowCount; - auxiliaryCount += node->Factorize(leftHandSide, rightHandSide, bodyMassArray, jointMassArray); - } - m_nodesOrder[nodeCount - 1]->Factorize(leftHandSide, rightHandSide, bodyMassArray, jointMassArray); - } - - m_rowCount = rowCount; - m_auxiliaryRowCount = auxiliaryCount; - - ndInt32 loopRowCount = 0; - const ndInt32 loopCount = m_loopCount + m_dynamicsLoopCount; - for (ndInt32 j = 0; j < loopCount; ++j) - { - const ndConstraint* const joint = m_loopingJoints[j]; - loopRowCount += joint->m_rowCount; - } - - m_loopRowCount = loopRowCount; - m_rowCount += m_loopRowCount; - m_auxiliaryRowCount += m_loopRowCount; - - if (m_auxiliaryRowCount) - { - InitLoopMassMatrix(); - } -} - -void ndSkeletonContainer::CalculateReactionForces(ndJacobian* const internalForces) -{ - if (!m_isResting) - { - D_TRACKTIME(); - const ndInt32 nodeCount = m_nodeList.GetCount(); - ndForcePair* const force = ndAlloca(ndForcePair, nodeCount); - ndForcePair* const accel = ndAlloca(ndForcePair, nodeCount); - - CalculateJointAccel(internalForces, accel); - CalculateForce(force, accel); - if (m_auxiliaryRowCount) - { - SolveAuxiliary(internalForces, accel, force); - } - else - { - UpdateForces(internalForces, force); - } - } -} - -void ndSkeletonContainer::CalculateJointAccelImmediate(ndForcePair* const accel) const -{ - const ndSpatialVector zero(ndSpatialVector::m_zero); - const ndInt32 nodeCount = m_nodeList.GetCount(); - for (ndInt32 i = 0; i < nodeCount - 1; ++i) - { - ndNode* const node = m_nodesOrder[i]; - ndAssert(i == node->m_index); - - ndForcePair& a = accel[i]; - ndAssert(node->m_body); - ndBodyKinematic* const body = node->m_body; - - const ndVector& force = body->m_accel; - const ndVector& torque = body->m_alpha; - - a.m_body.m_f[0] = force.m_x; - a.m_body.m_f[1] = force.m_y; - a.m_body.m_f[2] = force.m_z; - a.m_body.m_f[3] = torque.m_x; - a.m_body.m_f[4] = torque.m_y; - a.m_body.m_f[5] = torque.m_z; - a.m_body.m_f[6] = ndFloat64(0.0f); - a.m_body.m_f[7] = ndFloat64(0.0f); - - ndAssert(node->m_joint); - ndJointBilateralConstraint* const joint = node->m_joint; - - const ndInt32 first = joint->m_rowStart; - const ndInt32 dof = joint->m_rowCount; - - a.m_joint = zero; - for (ndInt32 j = 0; j < dof; ++j) - { - const ndInt32 k = node->m_ordinal.m_sourceJacobianIndex[j]; - const ndRightHandSide* const rhs = &m_rightHandSide[first + k]; - a.m_joint[j] = -rhs->m_coordenateAccel; - } - } - - ndAssert((nodeCount - 1) == m_nodesOrder[nodeCount - 1]->m_index); - ndForcePair& a = accel[nodeCount - 1]; - a.m_joint = zero; - - ndNode* const node = m_nodesOrder[nodeCount - 1]; - ndAssert(node->m_body); - ndBodyKinematic* const body = node->m_body; - const ndVector& force = body->m_accel; - const ndVector& torque = body->m_alpha; - - a.m_body.m_f[0] = force.m_x; - a.m_body.m_f[1] = force.m_y; - a.m_body.m_f[2] = force.m_z; - a.m_body.m_f[3] = torque.m_x; - a.m_body.m_f[4] = torque.m_y; - a.m_body.m_f[5] = torque.m_z; - a.m_body.m_f[6] = ndFloat64(0.0f); - a.m_body.m_f[7] = ndFloat64(0.0f); -} - -void ndSkeletonContainer::UpdateForcesImmediate(const ndForcePair* const force) const -{ - const ndInt32 nodeCount = m_nodeList.GetCount(); - for (ndInt32 i = 0; i < nodeCount; ++i) - { - ndNode* const node = m_nodesOrder[i]; - ndBodyKinematic* const body = node->m_body; - ndAssert(body); - const ndSpatialVector& spatialAccel = force[i].m_body; - body->m_accel = ndVector (ndFloat32(spatialAccel.m_f[0]), ndFloat32(spatialAccel.m_f[1]), ndFloat32(spatialAccel.m_f[2]), ndFloat32(0.0f)); - body->m_alpha = ndVector(ndFloat32(spatialAccel.m_f[3]), ndFloat32(spatialAccel.m_f[4]), ndFloat32(spatialAccel.m_f[5]), ndFloat32(0.0f)); - } -} - -void ndSkeletonContainer::SolveAuxiliaryImmediate(ndArray& bodyArray, ndForcePair* const force) const -{ - ndFloat32* const f = ndAlloca(ndFloat32, m_rowCount); - ndFloat32* const b = ndAlloca(ndFloat32, m_auxiliaryRowCount); - ndFloat32* const low = ndAlloca(ndFloat32, m_auxiliaryRowCount); - ndFloat32* const high = ndAlloca(ndFloat32, m_auxiliaryRowCount); - ndFloat32* const u = ndAlloca(ndFloat32, m_auxiliaryRowCount + 1); - ndFloat32* const u0 = ndAlloca(ndFloat32, m_auxiliaryRowCount + 1); - - ndInt32 primaryIndex = 0; - const ndInt32 primaryCount = m_rowCount - m_auxiliaryRowCount; - - const ndVector zero(ndVector::m_zero); - const ndInt32 nodeCount = m_nodeList.GetCount(); - for (ndInt32 i = 0; i < nodeCount - 1; ++i) - { - const ndNode* const node = m_nodesOrder[i]; - const ndInt32 primaryDof = node->m_dof; - const ndSpatialVector& forceSpatial = force[i].m_joint; - - for (ndInt32 j = 0; j < primaryDof; ++j) - { - f[primaryIndex] = ndFloat32(forceSpatial[j]); - primaryIndex++; - } - } - - ndAssert(primaryIndex == primaryCount); - for (ndInt32 i = 0; i < m_auxiliaryRowCount; ++i) - { - const ndInt32 index = m_matrixRowsIndex[primaryCount + i]; - const ndLeftHandSide* const row = &m_leftHandSide[index]; - const ndRightHandSide* const rhs = &m_rightHandSide[index]; - - const ndInt32 m0 = m_pairs[primaryCount + i].m_m0; - const ndInt32 m1 = m_pairs[primaryCount + i].m_m1; - - const ndBodyKinematic* const body0 = bodyArray[m0]; - const ndBodyKinematic* const body1 = bodyArray[m1]; - - const ndVector& force0 = body0->m_accel; - const ndVector& torque0 = body0->m_alpha; - const ndVector& force1 = body1->m_accel; - const ndVector& torque1 = body1->m_alpha; - ndAssert((primaryCount + i) < m_rowCount); - - const ndVector acc( - row->m_JMinv.m_jacobianM0.m_linear * force0 + row->m_JMinv.m_jacobianM0.m_angular * torque0 + - row->m_JMinv.m_jacobianM1.m_linear * force1 + row->m_JMinv.m_jacobianM1.m_angular * torque1); - b[i] = rhs->m_coordenateAccel - acc.AddHorizontal().GetScalar(); - - u0[i] = rhs->m_force; - low[i] = rhs->m_lowerBoundFrictionCoefficent; - high[i] = rhs->m_upperBoundFrictionCoefficent; - } - - for (ndInt32 i = 0; i < m_auxiliaryRowCount; ++i) - { - ndFloat32* const matrixRow10 = &m_massMatrix10[i * primaryCount]; - b[i] -= ndDotProduct(primaryCount, matrixRow10, f); - } - - u[m_auxiliaryRowCount] = ndFloat32(1.0f); - u0[m_auxiliaryRowCount] = ndFloat32(0.0f); - const ndInt32* const normalIndex = &m_frictionIndex[primaryCount]; - SolveBlockLcp(m_auxiliaryRowCount, m_blockSize, u0, u, b, low, high, normalIndex, ndFloat32 (0.1f)); - - for (ndInt32 i = 0; i < m_auxiliaryRowCount; ++i) - { - const ndFloat32 s = u[i]; - f[primaryCount + i] = s; - ndScaleAdd(primaryCount, f, &m_deltaForce[i * primaryCount], s); - } - - for (ndInt32 i = 0; i < m_rowCount; ++i) - { - ndConstraint* const joint = (ndConstraint*)m_pairs[i].m_joint; - - ndInt32 index = m_matrixRowsIndex[i]; - const ndLeftHandSide* const row = &m_leftHandSide[index]; - const ndVector jointForce(f[i]); - - const ndVector force0(row->m_Jt.m_jacobianM0.m_linear * jointForce); - const ndVector torque0(row->m_Jt.m_jacobianM0.m_angular * jointForce); - const ndVector force1(row->m_Jt.m_jacobianM1.m_linear * jointForce); - const ndVector torque1(row->m_Jt.m_jacobianM1.m_angular * jointForce); - - const ndInt32 m0 = (joint->GetBody0()->GetInvMass() > ndFloat32(0.0f)) ? joint->GetBody0()->m_index : 0; - const ndInt32 m1 = (joint->GetBody1()->GetInvMass() > ndFloat32(0.0f)) ? joint->GetBody1()->m_index : 0; - ndBodyKinematic* const body0 = bodyArray[m0]; - ndBodyKinematic* const body1 = bodyArray[m1]; - - body0->m_accel += force0; - body0->m_alpha += torque0; - body1->m_accel += force1; - body1->m_alpha += torque1; - } - - for (ndInt32 i = ndInt32(bodyArray.GetCount()) - 1; i >= 0; --i) - { - ndBodyKinematic* const body = bodyArray[i]; - const ndMatrix& invInertia = body->GetInvInertiaMatrix(); - body->m_alpha = invInertia.RotateVector(body->m_alpha); - body->m_accel = body->m_accel.Scale (body->GetInvMass()); - } -} - -void ndSkeletonContainer::SolveImmediate(ndIkSolver& solverInfo) -{ - D_TRACKTIME(); - const ndInt32 nodeCount = m_nodeList.GetCount(); - ndForcePair* const x = ndAlloca(ndForcePair, nodeCount); - ndForcePair* const b = ndAlloca(ndForcePair, nodeCount); - - CalculateJointAccelImmediate(b); - CalculateForce(x, b); - if (m_auxiliaryRowCount) - { - SolveAuxiliaryImmediate(solverInfo.m_bodies, x); - } - else - { - UpdateForcesImmediate(x); - } -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndSkeletonContainer.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndSkeletonContainer.h deleted file mode 100644 index 26ea7a0ba9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndSkeletonContainer.h +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SKELETON_CONTAINER_H__ -#define __ND_SKELETON_CONTAINER_H__ - -#include "ndNewtonStdafx.h" - -class ndIkSolver; -class ndJointBilateralConstraint; - -class ndSkeletonContainer -{ - public: - class ndNodeList; - - ndSkeletonContainer(); - ~ndSkeletonContainer(); - ndInt32 GetId() const; - - const ndNodeList& GetNodeList() const; - - protected: - class ndOrdinal - { - public: - ndOrdinal() - { - for (ndInt32 i = 0; i < ndInt32(sizeof(m_sourceJacobianIndex)); ++i) - { - m_sourceJacobianIndex[i] = ndInt8(i); - } - } - - ndInt8 m_sourceJacobianIndex[12]; - }; - - class ndNodePair - { - public: - const ndConstraint* m_joint; - ndInt32 m_m0; - ndInt32 m_m1; - }; - - D_MSV_NEWTON_ALIGN_32 - class ndForcePair - { - public: - ndSpatialVector m_body; - ndSpatialVector m_joint; - } D_GCC_NEWTON_ALIGN_32; - - D_MSV_NEWTON_ALIGN_32 - class ndMatriData - { - public: - ndSpatialMatrix m_jt; - ndSpatialMatrix m_invMass; - } D_GCC_NEWTON_ALIGN_32; - - D_MSV_NEWTON_ALIGN_32 - class ndBodyJointMatrixDataPair - { - public: - ndMatriData m_body; - ndMatriData m_joint; - } D_GCC_NEWTON_ALIGN_32; - - public: - class ndNode - { - public: - ndNode(); - ~ndNode(); - ndInt32 Factorize(const ndLeftHandSide* const leftHandSide, const ndRightHandSide* const rightHandSide, ndSpatialMatrix* const bodyMassArray, ndSpatialMatrix* const jointMassArray); - - inline void CalculateJacobianBlock(); - inline void CalculateInertiaMatrix(ndSpatialMatrix* const bodyMassArray) const; - inline void CalculateJointDiagonal(const ndSpatialMatrix* const bodyMassArray, ndSpatialMatrix* const jointMassArray); - inline void CalculateBodyDiagonal(ndNode* const child, ndSpatialMatrix* const bodyMassArray, const ndSpatialMatrix* const jointMassArray); - inline void GetJacobians(const ndLeftHandSide* const leftHandSide, const ndRightHandSide* const rightHandSide, ndSpatialMatrix* const jointMassArray); - - inline void BodyDiagInvTimeSolution(ndForcePair& force); - inline void JointDiagInvTimeSolution(ndForcePair& force); - inline void JointJacobianTimeMassForward(ndForcePair& force); - inline void BodyJacobianTimeSolutionBackward(ndForcePair& force) const; - inline ndInt32 GetAuxiliaryRows(const ndRightHandSide* const rightHandSide) const; - inline void BodyJacobianTimeMassForward(const ndForcePair& force, ndForcePair& parentForce) const; - inline void JointJacobianTimeSolutionBackward(ndForcePair& force, const ndForcePair& parentForce) const; - - ndBodyJointMatrixDataPair m_data; - ndBodyKinematic* m_body; - ndJointBilateralConstraint* m_joint; - ndNode* m_parent; - ndNode* m_child; - ndNode* m_sibling; - ndInt32 m_index; - ndOrdinal m_ordinal; - ndInt8 m_dof; - ndInt8 m_swapJacobianBodiesIndex; - }; - - class ndNodeList : public ndList > - { - public: - ndNodeList() - :ndList >() - { - } - - const ndSkeletonContainer::ndNode* FindNode(const ndBody* const body) const - { - const ndSkeletonContainer::ndNode* node = nullptr; - for (ndNodeList::ndNode* ptr = GetFirst(); ptr; ptr = ptr->GetNext()) - { - if (ptr->GetInfo().m_body == body) - { - node = &ptr->GetInfo(); - break; - } - } - return node; - } - }; - - private: - ndNode* GetRoot() const; - - void Clear(); - void CheckSleepState(); - void Init(ndBodyKinematic* const rootBody, ndInt32 id); - ndNode* AddChild(ndJointBilateralConstraint* const joint, ndNode* const parent); - void Finalize(ndInt32 loopJoints, ndJointBilateralConstraint** const loopJointArray); - - void InitLoopMassMatrix(); - void ClearCloseLoopJoints(); - void AddCloseLoopJoint(ndConstraint* const joint); - void CalculateReactionForces(ndJacobian* const internalForces); - void InitMassMatrix(const ndLeftHandSide* const matrixRow, ndRightHandSide* const rightHandSide); - void CalculateBufferSizeInBytes(); - void ConditionMassMatrix() const; - void SortGraph(ndNode* const root, ndInt32& index); - void RebuildMassMatrix(const ndFloat32* const diagDamp) const; - void CalculateLoopMassMatrixCoefficients(ndFloat32* const diagDamp); - void FactorizeMatrix(ndInt32 size, ndInt32 stride, ndFloat32* const matrix, ndFloat32* const diagDamp) const; - void SolveAuxiliary(ndJacobian* const internalForces, const ndForcePair* const accel, ndForcePair* const force) const; - void SolveBlockLcp(ndInt32 size, ndInt32 blockSize, const ndFloat32* const x0, ndFloat32* const x, ndFloat32* const b, const ndFloat32* const low, const ndFloat32* const high, const ndInt32* const normalIndex, ndFloat32 accelTol) const; - void SolveLcp(ndInt32 stride, ndInt32 size, const ndFloat32* const matrix, const ndFloat32* const x0, ndFloat32* const x, const ndFloat32* const b, const ndFloat32* const low, const ndFloat32* const high, const ndInt32* const normalIndex, ndFloat32 accelTol) const; - - inline void SolveBackward(ndForcePair* const force) const; - inline void CalculateForce(ndForcePair* const force, const ndForcePair* const accel) const; - inline void UpdateForces(ndJacobian* const internalForces, const ndForcePair* const force) const; - inline void CalculateJointAccel(const ndJacobian* const internalForces, ndForcePair* const accel) const; - inline void SolveForward(ndForcePair* const force, const ndForcePair* const accel, ndInt32 startNode) const; - - void SolveImmediate(ndIkSolver& solverInfo); - void UpdateForcesImmediate(const ndForcePair* const force) const; - void CalculateJointAccelImmediate(ndForcePair* const accel) const; - void SolveAuxiliaryImmediate(ndArray& bodyArray, ndForcePair* const force) const; - - ndNode* m_skeleton; - ndNode** m_nodesOrder; - ndRightHandSide* m_rightHandSide; - const ndLeftHandSide* m_leftHandSide; - ndNodePair* m_pairs; - ndInt32* m_frictionIndex; - ndInt32* m_matrixRowsIndex; - ndFloat32* m_massMatrix11; - ndFloat32* m_massMatrix10; - ndFloat32* m_deltaForce; - - ndNodeList m_nodeList; - ndArray m_loopingJoints; - ndArray m_auxiliaryMemoryBuffer; - ndSpinLock m_lock; - ndInt32 m_id; - ndInt32 m_blockSize; - ndInt32 m_rowCount; - ndInt32 m_loopRowCount; - ndInt32 m_auxiliaryRowCount; - ndInt32 m_loopCount; - ndInt32 m_dynamicsLoopCount; - ndUnsigned8 m_isResting; - - friend class ndWorld; - friend class ndIkSolver; - friend class ndSkeletonList; - friend class ndSkeletonQueue; - friend class ndDynamicsUpdate; - friend class ndDynamicsUpdateSoa; - friend class ndDynamicsUpdateAvx2; - friend class ndDynamicsUpdateSycl; - friend class ndDynamicsUpdateCuda; -}; - -inline ndInt32 ndSkeletonContainer::GetId() const -{ - return m_id; -} - -inline ndSkeletonContainer::ndNode* ndSkeletonContainer::GetRoot() const -{ - return m_skeleton; -} - -inline const ndSkeletonContainer::ndNodeList& ndSkeletonContainer::GetNodeList() const -{ - return m_nodeList; -} -#endif - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndSkeletonList.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndSkeletonList.h deleted file mode 100644 index f75cec3670..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndSkeletonList.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_SKELETON_LIST_H__ -#define __ND_SKELETON_LIST_H__ - -#include "ndNewtonStdafx.h" -#include "ndSkeletonContainer.h" - -class ndBodyKinematic; - -class ndSkeletonList: public ndList > -{ - public: - ndSkeletonList() - :ndList>() - ,m_skelListIsDirty(false) - { - } - - ndSkeletonContainer* CreateContatiner(ndBodyKinematic* const rootBody, ndInt32 id) - { - ndNode* const node = Append(); - ndSkeletonContainer* const container = &node->GetInfo(); - container->Init(rootBody, id); - return container; - } - - bool m_skelListIsDirty; -}; - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorld.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorld.cpp deleted file mode 100644 index 69de99e0ac..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorld.cpp +++ /dev/null @@ -1,1158 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorld.h" -#include "ndWorldScene.h" -#include "ndBodyDynamic.h" -#include "ndSkeletonList.h" -#include "dModels/ndModel.h" -#include "ndDynamicsUpdate.h" -#include "ndDynamicsUpdateSoa.h" -#include "dModels/ndModelNotify.h" -#include "ndJointBilateralConstraint.h" - -#ifdef _D_USE_AVX2_SOLVER - #include "ndWorldSceneAvx2.h" - #include "ndDynamicsUpdateAvx2.h" -#endif - -#ifdef _D_NEWTON_CUDA - #include "ndCudaUtils.h" - #include "ndWorldSceneCuda.h" - #include "ndDynamicsUpdateCuda.h" -#endif - -class ndSkeletonQueue : public ndFixSizeArray -{ - public: - ndSkeletonQueue() - :ndFixSizeArray() - ,m_mod(sizeof(m_array) / sizeof(m_array[0])) - { - m_lastIndex = 0; - m_firstIndex = 0; - } - - void Push(ndSkeletonContainer::ndNode* const node) - { - m_firstIndex++; - if (node->m_joint->GetSolverModel() != m_jointkinematicOpenLoop) - { - m_array[m_firstIndex-1] = node; - } - else - { - const ndInt32 count = m_firstIndex - m_lastIndex; - ndInt32 slot = count - 1; - for (; (slot > 0) && (m_array[m_lastIndex + slot - 1]->m_joint->GetSolverModel() != m_jointkinematicOpenLoop); slot--) - { - m_array[m_lastIndex + slot] = m_array[m_lastIndex + slot - 1]; - } - m_array[m_lastIndex + slot] = node; - } - - if (m_firstIndex >= m_mod) - { - m_firstIndex = 0; - } - ndAssert(m_firstIndex != m_lastIndex); - } - - void Reset() - { - m_lastIndex = m_firstIndex; - } - - bool IsEmpty() const - { - return (m_firstIndex == m_lastIndex); - } - - ndInt32 m_lastIndex; - ndInt32 m_firstIndex; - ndInt32 m_mod; -}; - -ndWorld::ndWorld() - :ndClassAlloc() - ,m_scene(nullptr) - ,m_solver(nullptr) - ,m_jointList() - ,m_modelList() - ,m_skeletonList() - ,m_deletedBodies() - ,m_deletedModels() - ,m_deletedJoints() - ,m_activeSkeletons(256) - ,m_deletedLock() - ,m_timestep(ndFloat32 (0.0f)) - ,m_freezeAccel2(D_FREEZE_ACCEL2) - ,m_freezeSpeed2(D_FREEZE_SPEED2) - ,m_averageUpdateTime(ndFloat32(0.0f)) - ,m_averageTimestepAcc(ndFloat32(0.0f)) - ,m_averageFramesCount(ndFloat32(0.0f)) - ,m_lastExecutionTime(ndFloat32(0.0f)) - ,m_subSteps(1) - ,m_solverMode(ndStandardSolver) - ,m_solverIterations(4) - ,m_inUpdate(false) -{ - // start the engine thread; - ndBody::m_uniqueIdCount = 0; - m_solver = new ndDynamicsUpdate(this); - m_scene = new ndWorldScene(this); - - ndInt32 steps = 1; - ndFloat32 freezeAccel2 = m_freezeAccel2; - //ndFloat32 freezeAlpha2 = m_freezeAlpha2; - ndFloat32 freezeSpeed2 = m_freezeSpeed2; - //ndFloat32 freezeOmega2 = m_freezeOmega2; - for (ndInt32 i = 0; i < D_SLEEP_ENTRIES; ++i) - { - m_sleepTable[i].m_maxAccel = freezeAccel2; - //m_sleepTable[i].m_maxAlpha = freezeAlpha2; - m_sleepTable[i].m_maxVeloc = freezeSpeed2; - //m_sleepTable[i].m_maxOmega = freezeOmega2; - m_sleepTable[i].m_steps = steps; - steps += 7; - freezeAccel2 *= ndFloat32(1.5f); - //freezeAlpha2 *= ndFloat32(1.5f); - freezeSpeed2 *= ndFloat32(1.5f); - //freezeOmega2 *= ndFloat32(1.5f); - } - - m_sleepTable[0].m_maxAccel *= ndFloat32(0.009f); - //m_sleepTable[0].m_maxAlpha *= ndFloat32(0.009f); - - steps += 300; - m_sleepTable[D_SLEEP_ENTRIES - 1].m_maxAccel *= ndFloat32(100.0f); - //m_sleepTable[D_SLEEP_ENTRIES - 1].m_maxAlpha *= ndFloat32(100.0f); - m_sleepTable[D_SLEEP_ENTRIES - 1].m_maxVeloc = 0.25f; - //m_sleepTable[D_SLEEP_ENTRIES - 1].m_maxOmega = 0.1f; - m_sleepTable[D_SLEEP_ENTRIES - 1].m_steps = steps; -} - -ndWorld::~ndWorld() -{ - CleanUp(); - - delete m_scene; - delete m_solver; - ClearCache(); -} - -void ndWorld::CleanUp() -{ - Sync(); - m_scene->m_backgroundThread.Terminate(); - m_scene->PrepareCleanup(); - - m_activeSkeletons.Resize(256); - while (m_skeletonList.GetFirst()) - { - m_skeletonList.Remove(m_skeletonList.GetFirst()); - } - - while (m_jointList.GetFirst()) - { - ndSharedPtr& joint = m_jointList.GetFirst()->GetInfo(); - RemoveJoint(joint); - } - - while (m_modelList.GetFirst()) - { - ndSharedPtr& model = m_modelList.GetFirst()->GetInfo(); - m_modelList.RemoveModel(model); - } - - while (m_scene->m_particleSetList.GetFirst()) - { - ndSharedPtr& body = m_scene->m_particleSetList.GetFirst()->GetInfo(); - RemoveBody(body); - } - - while (m_scene->m_bodyList.GetFirst()) - { - ndSharedPtr& body = m_scene->m_bodyList.GetFirst()->GetInfo(); - RemoveBody(body); - } - - ndBody::m_uniqueIdCount = 1; - m_scene->Cleanup(); -} - -const char* ndWorld::GetSolverString() const -{ - return m_solver->GetStringId(); -} - -bool ndWorld::IsHighPerformanceCompute() const -{ - return m_scene->IsHighPerformanceCompute(); -} - -void ndWorld::ClearCache() -{ - ndFreeListAlloc::Flush(); -} - -void ndWorld::Sync() const -{ - m_scene->Sync(); -} - -ndInt32 ndWorld::GetThreadCount() const -{ - return m_scene->GetThreadCount(); -} - -void ndWorld::SetThreadCount(ndInt32 count) -{ - m_scene->SetThreadCount(count); - m_scene->m_backgroundThread.SetThreadCount(count); -} - -ndInt32 ndWorld::GetSubSteps() const -{ - return m_subSteps; -} - -void ndWorld::SetSubSteps(ndInt32 subSteps) -{ - m_subSteps = ndClamp(subSteps, 1, 16); -} - -ndScene* ndWorld::GetScene() const -{ - return m_scene; -} - -ndInt32 ndWorld::GetSolverIterations() const -{ - return m_solverIterations; -} - -void ndWorld::SetSolverIterations(ndInt32 iterations) -{ - m_solverIterations = ndInt32(ndMax(4, iterations)); -} - -ndContactNotify* ndWorld::GetContactNotify() const -{ - return m_scene->GetContactNotify(); -} - -void ndWorld::SetContactNotify(ndContactNotify* const notify) -{ - m_scene->SetContactNotify(notify); -} - -ndBodyKinematic* ndWorld::GetSentinelBody() const -{ - return m_scene->GetSentinelBody(); -} - -const ndBodyListView& ndWorld::GetBodyList() const -{ - return m_scene->GetBodyList(); -} - -const ndJointList& ndWorld::GetJointList() const -{ - return m_jointList; -} - -const ndContactArray& ndWorld::GetContactList() const -{ - return m_scene->GetContactArray(); -} - -const ndSkeletonList& ndWorld::GetSkeletonList() const -{ - return m_skeletonList; -} - -const ndBodyList& ndWorld::GetParticleList() const -{ - return m_scene->m_particleSetList; -} - -const ndModelList& ndWorld::GetModelList() const -{ - return m_modelList; -} - -ndFloat32 ndWorld::GetUpdateTime() const -{ - return m_lastExecutionTime; -} - -ndFloat32 ndWorld::GetAverageUpdateTime() const -{ - return m_averageUpdateTime; -} - -ndUnsigned32 ndWorld::GetFrameNumber() const -{ - return m_scene->m_frameNumber; -} - -ndUnsigned32 ndWorld::GetSubFrameNumber() const -{ - return m_scene->m_subStepNumber; -} - -void ndWorld::DebugScene(ndSceneTreeNotiFy* const notify) -{ - m_scene->DebugScene(notify); -} - -ndWorld::ndSolverModes ndWorld::GetSelectedSolver() const -{ - return m_solverMode; -} - -ndInt32 ndWorld::GetEngineVersion() const -{ - return D_NEWTON_ENGINE_MAJOR_VERSION * 100 + D_NEWTON_ENGINE_MINOR_VERSION; -} - -void ndWorld::SendBackgroundTask(ndBackgroundTask* const job) -{ - m_scene->SendBackgroundTask(job); -} - -void ndWorld::UpdateTransforms() -{ - m_scene->UpdateTransform(); -} - -void ndWorld::PreUpdate(ndFloat32) -{ -} - -void ndWorld::PostUpdate(ndFloat32) -{ -} - -void ndWorld::OnSubStepPreUpdate(ndFloat32) -{ -} - -void ndWorld::OnSubStepPostUpdate(ndFloat32) -{ -} - -bool ndWorld::AddBody(const ndSharedPtr& body) -{ - ndAssert(GetSentinelBody() != body->GetAsBodyKinematic()); - return m_scene->AddBody(body); -} - -ndSharedPtr ndWorld::GetBody(ndBody* const body) const -{ - return m_scene->GetBody(body); -} - -void ndWorld::AddJoint(const ndSharedPtr& joint) -{ - // if the second body is nullPtr, replace it the sentinel - ndAssert(joint->m_body0); - ndAssert(joint->m_body1); - ndAssert(joint->IsActive()); - if (joint->m_worldNode == nullptr) - { - ndAssert(joint->m_body0Node == nullptr); - ndAssert(joint->m_body1Node == nullptr); - if (joint->IsSkeleton()) - { - m_skeletonList.m_skelListIsDirty = true; - } - joint->m_worldNode = m_jointList.Append(joint); - joint->m_body0Node = joint->GetBody0()->AttachJoint((ndJointBilateralConstraint*)*joint); - joint->m_body1Node = joint->GetBody1()->AttachJoint((ndJointBilateralConstraint*)*joint); - } -} - -void ndWorld::AddModel(const ndSharedPtr& model) -{ - m_modelList.AddModel(model, this); -} - -ndInt32 ndWorld::CompareJointByInvMass(const ndJointBilateralConstraint* const jointA, const ndJointBilateralConstraint* const jointB, void*) -{ - ndInt32 modeA = jointA->GetSolverModel(); - ndInt32 modeB = jointB->GetSolverModel(); - - if (modeA < modeB) - { - return -1; - } - else if (modeA > modeB) - { - return 1; - } - else - { - ndFloat32 invMassA = ndMin(jointA->GetBody0()->GetInvMass(), jointA->GetBody1()->GetInvMass()); - ndFloat32 invMassB = ndMin(jointB->GetBody0()->GetInvMass(), jointB->GetBody1()->GetInvMass()); - if (invMassA < invMassB) - { - return -1; - } - else if (invMassA > invMassB) - { - return 1; - } - } - return 0; -} - -void ndWorld::ThreadFunction() -{ - D_TRACKTIME(); - ndUnsigned64 timeAcc = ndGetTimeInMicroseconds(); - - m_inUpdate = true; - m_scene->Begin(); - - // clean up all batched deletd objects, before update - while (m_deletedModels.GetCount()) - { - D_TRACKTIME(); - ndAssert(0); - ndModel* const model = m_deletedModels.GetFirst()->GetInfo(); - m_deletedModels.Remove(m_deletedModels.GetFirst()); - model->m_deletedNode = nullptr; - - ndModelList::ndNode* const worldNode = model->m_worldNode; - m_modelList.RemoveModel(worldNode->GetInfo()); - } - - // remove joints bodies dependencies first - for (ndSpecialList::ndNode* node = m_deletedBodies.GetFirst(); node; node = node->GetNext()) - { - D_TRACKTIME(); - ndBodyKinematic* const kinematicBody = node->GetInfo()->GetAsBodyKinematic(); - //ndTrace(("body: %s %d\n", kinematicBody->ClassName(), kinematicBody->m_uniqueId)); - ndAssert(kinematicBody != GetSentinelBody()); - for (ndBodyKinematic::ndJointList::ndNode* jointNode = kinematicBody->GetJointList().GetFirst(); jointNode; jointNode = jointNode->GetNext()) - { - ndJointBilateralConstraint* const joint = jointNode->GetInfo(); - RemoveJoint(joint); - } - } - - while (m_deletedJoints.GetCount()) - { - D_TRACKTIME(); - ndJointBilateralConstraint* const joint = m_deletedJoints.GetFirst()->GetInfo(); - m_deletedJoints.Remove(m_deletedJoints.GetFirst()); - - ndJointList::ndNode* const worldNode = joint->m_worldNode; - if (worldNode != nullptr) - { - RemoveJoint(worldNode->GetInfo()); - } - } - - while (m_deletedBodies.GetCount()) - { - D_TRACKTIME(); - ndBody* const body = m_deletedBodies.GetFirst()->GetInfo(); - m_deletedBodies.Remove(m_deletedBodies.GetFirst()); - - body->m_deletedNode = nullptr; - ndSharedPtr sharedBody(GetBody(body)); - RemoveBody(sharedBody); - } - - //m_inUpdate = true; - //m_scene->Begin(); - - m_scene->SetTimestep(m_timestep); - - PreUpdate(m_timestep); - - ndInt32 const steps = m_subSteps; - ndFloat32 timestep = m_timestep / (ndFloat32)steps; - for (ndInt32 i = 0; i < steps; ++i) - { - SubStepUpdate(timestep); - } - - m_scene->SetTimestep(m_timestep); - - ParticleUpdate(m_timestep); - - UpdateTransforms(); - PostModelTransform(); - PostUpdate(m_timestep); - m_inUpdate = false; - - m_scene->End(); - - m_lastExecutionTime = (ndFloat32)(ndGetTimeInMicroseconds() - timeAcc) * ndFloat32(1.0e-6f); - CalculateAverageUpdateTime(); -} - -void ndWorld::CalculateAverageUpdateTime() -{ - m_averageFramesCount += ndFloat32 (1.0f); - m_averageTimestepAcc += m_lastExecutionTime; - - ndAssert(m_averageTimestepAcc >= ndFloat32(0.0f)); - const ndFloat32 movingAverageFrames = ndFloat32 (16); - if (m_averageFramesCount >= movingAverageFrames) - { - m_averageUpdateTime = m_averageTimestepAcc/m_averageFramesCount; - m_averageTimestepAcc = ndFloat32 (0.0f); - - m_averageFramesCount -= movingAverageFrames; - } -} - -void ndWorld::SubStepUpdate(ndFloat32 timestep) -{ - D_TRACKTIME(); - - // do physics step - OnSubStepPreUpdate(timestep); - - m_scene->m_lru = m_scene->m_lru + 1; - m_scene->SetTimestep(timestep); - - m_scene->BalanceScene(); - m_scene->ApplyExtForce(); - m_scene->InitBodyArray(); - - // update the collision system - m_scene->FindCollidingPairs(); - m_scene->CreateNewContacts(); - m_scene->CalculateContacts(); - m_scene->DeleteDeadContacts(); - - // update all special bodies. - m_scene->UpdateSpecial(); - - // Update Particle base physics - //ParticleUpdate(); - - // update skeletons topologies - UpdateSkeletons(); - - // Update all models - ModelUpdate(); - - // calculate internal forces, integrate bodies and update matrices. - ndAssert(m_solver); - m_solver->Update(); - - // second pass on models - ModelPostUpdate(); - - - OnSubStepPostUpdate(timestep); - - m_scene->m_subStepNumber++; -} - -void ndWorld::ParticleUpdate(ndFloat32 timestep) -{ - D_TRACKTIME(); - m_scene->ParticleUpdate(timestep); -} - -void ndWorld::ModelUpdate() -{ - D_TRACKTIME(); - ndAtomic iterator(0); - auto ModelUpdate = ndMakeObject::ndFunction([this, &iterator](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(ModelUpdate); - const ndFloat32 timestep = m_scene->GetTimestep(); - const ndArray& modelList = m_modelList.GetUpdateList(); - - const ndInt32 modelCount = ndInt32(modelList.GetCount()); - for (ndInt32 i = iterator++; i < modelCount; i = iterator++) - { - D_TRACKTIME_NAMED(ModelUpdate); - ndModel* const model = modelList[i]; - if (*model->m_notifyCallback) - { - model->m_notifyCallback->Update(this, timestep); - } - } - }); - - m_modelList.UpdateDirtyList(); - m_scene->ParallelExecute(ModelUpdate); -} - -void ndWorld::ModelPostUpdate() -{ - D_TRACKTIME(); - ndAtomic iterator(0); - auto ModelPostUpdate = ndMakeObject::ndFunction([this, &iterator](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(ModelPostUpdate); - const ndFloat32 timestep = m_scene->GetTimestep(); - const ndArray& modelList = m_modelList.GetUpdateList(); - - const ndInt32 modelCount = ndInt32(modelList.GetCount()); - for (ndInt32 i = iterator++; i < modelCount; i = iterator++) - { - ndModel* const model = modelList[i]; - if (*model->m_notifyCallback) - { - model->m_notifyCallback->PostUpdate(this, timestep); - } - } - }); - m_scene->ParallelExecute(ModelPostUpdate); -} - -void ndWorld::PostModelTransform() -{ - D_TRACKTIME(); - ndAtomic iterator(0); - auto PostModelTransform = ndMakeObject::ndFunction([this, &iterator](ndInt32, ndInt32) - { - D_TRACKTIME_NAMED(PostModelTransform); - const ndFloat32 timestep = m_scene->GetTimestep(); - const ndArray& modelList = m_modelList.GetUpdateList(); - - const ndInt32 modelCount = ndInt32(modelList.GetCount()); - for (ndInt32 i = iterator++; i < modelCount; i = iterator++) - { - ndModel* const model = modelList[i]; - if (*model->m_notifyCallback) - { - model->m_notifyCallback->PostTransformUpdate(this, timestep); - } - } - }); - m_scene->ParallelExecute(PostModelTransform); -} - -bool ndWorld::SkeletonJointTest(ndJointBilateralConstraint* const constraint) const -{ - bool test = true; - ndAssert(constraint && constraint->GetAsBilateral()); - test = test && (constraint->GetRowsCount() > 0); - test = test && (constraint->IsSkeleton()); - return test; -} - -void ndWorld::UpdateSkeletons() -{ - D_TRACKTIME(); - if (m_skeletonList.m_skelListIsDirty) - { - m_skeletonList.m_skelListIsDirty = false; - while (m_skeletonList.GetFirst()) - { - m_skeletonList.Remove(m_skeletonList.GetFirst()); - } - - // reset of all bodies dirty state - const ndArray& bodyArray = m_scene->GetActiveBodyArray(); - for (ndInt32 i = ndInt32(bodyArray.GetCount()) - 1; i >= 0; i--) - { - ndBodyKinematic* const body = bodyArray[i]; - body->m_index = -1; - body->m_skeletonMark = 0; - body->m_skeletonMark0 = 0; - body->m_skeletonMark1 = 0; - body->m_islandParent = body; - } - - // build connectivity graph and reset of all joint dirty state - ndDynamicsUpdate& solverUpdate = *m_solver; - for (ndJointList::ndNode* node = m_jointList.GetFirst(); node; node = node->GetNext()) - { - ndJointBilateralConstraint* const constraint = *node->GetInfo(); - const bool test = SkeletonJointTest(constraint); - constraint->m_mark0 = 0; - constraint->m_mark1 = 0; - if (test) - { - ndBodyKinematic* const body0 = constraint->GetBody0(); - ndBodyKinematic* const body1 = constraint->GetBody1(); - if (body1->GetInvMass() > ndFloat32(0.0f)) - { - ndBodyKinematic* root0 = solverUpdate.FindRootAndSplit(body0); - ndBodyKinematic* root1 = solverUpdate.FindRootAndSplit(body1); - if (root0 != root1) - { - if (root0->m_buildSkelIndex > root1->m_buildSkelIndex) - { - ndSwap(root0, root1); - } - root0->m_islandParent = root1; - if (root0->m_buildSkelIndex == root1->m_buildSkelIndex) - { - root1->m_buildSkelIndex += 1; - ndAssert(root1->m_buildSkelIndex <= 6); - } - } - } - } - } - - //// reset of all bodies dirty state - //const ndArray& bodyArray = m_scene->GetActiveBodyArray(); - //for (ndInt32 i = ndInt32(bodyArray.GetCount()) - 1; i >= 0; i--) - //{ - // ndBodyKinematic* const body = bodyArray[i]; - // body->m_index = -1; - // body->m_skeletonMark = 0; - // body->m_skeletonMark0 = 0; - // body->m_skeletonMark1 = 0; - //} - - // find all root nodes for all independent joint arrangements - ndInt32 inslandCount = 0; - solverUpdate.m_leftHandSide.SetCount(ndMax(ndInt32 (bodyArray.GetCount()) + 256, 1024)); - ndIslandMember* const islands = (ndIslandMember*)&solverUpdate.m_leftHandSide[0]; - for (ndInt32 i = 0; i < bodyArray.GetCount(); ++i) - { - ndBodyKinematic* const body = bodyArray[i]; - if (body->GetInvMass() > ndFloat32(0.0f)) - { - ndBodyKinematic* const root = solverUpdate.FindRootAndSplit(body); - if (root->m_index == -1) - { - ndIslandMember& entry = islands[inslandCount]; - entry.m_body = body; - entry.m_root = body; - root->m_index = inslandCount; - inslandCount++; - } - ndInt32 index = root->m_index; - ndAssert(index != -1); - ndIslandMember& entry = islands[index]; - if (body->GetInvMass() < entry.m_body->GetInvMass()) - { - entry.m_body = body; - } - } - } - - // build the root node - ndInt32 skeletonsId = 0; - for (ndInt32 i = 0; i < inslandCount; ++i) - { - ndSkeletonQueue queuePool; - ndFixSizeArray stack; - - stack.PushBack(islands[i].m_body); - ndSkeletonContainer* skeleton = nullptr; - - // find if this root node is connected to static bodies - // if so, them make that static body the root node and add all the children - while (stack.GetCount()) - { - ndBodyKinematic* const rootBody = stack.Pop(); - if (!rootBody->m_skeletonMark1) - { - rootBody->m_skeletonMark1 = 1; - for (ndBodyKinematic::ndJointList::ndNode* jointNode = rootBody->m_jointList.GetFirst(); jointNode; jointNode = jointNode->GetNext()) - { - ndJointBilateralConstraint* const constraint = jointNode->GetInfo(); - ndAssert(constraint && constraint->GetAsBilateral()); - if (!constraint->m_mark1) - { - constraint->m_mark1 = 1; - const bool test = SkeletonJointTest(constraint); - if (test && (constraint->GetSolverModel() != m_jointkinematicCloseLoop)) - { - ndBodyKinematic* const childBody = (constraint->GetBody0() != rootBody) ? constraint->GetBody0() : constraint->GetBody1(); - if (childBody->GetInvMass() == ndFloat32(0.0f)) - { - if (!skeleton) - { - skeleton = m_skeletonList.CreateContatiner(childBody, skeletonsId); - skeletonsId++; - } - - //dTrace(("%s %d %d\n", constraint->GetClassName(), constraint->GetBody0()->GetId(), constraint->GetBody1()->GetId())); - constraint->m_mark0 = 1; - ndAssert(childBody == skeleton->GetRoot()->m_body); - ndSkeletonContainer::ndNode* const node = skeleton->AddChild((ndJointBilateralConstraint*)constraint, skeleton->GetRoot()); - node->m_body->m_skeletonMark = 1; - ndAssert(node->m_body != childBody); - queuePool.Push(node); - } - else if (!childBody->m_skeletonMark1) - { - stack.PushBack(childBody); - } - } - } - } - } - } - - if (queuePool.IsEmpty()) - { - // if this root node is not static, - // them add the first children to this root - bool hasJoints = false; - ndBodyKinematic* const rootBody = islands[i].m_body; - rootBody->m_skeletonMark0 = 1; - for (ndBodyKinematic::ndJointList::ndNode* jointNode = rootBody->m_jointList.GetFirst(); jointNode; jointNode = jointNode->GetNext()) - { - ndJointBilateralConstraint* const constraint = jointNode->GetInfo(); - - const bool test = SkeletonJointTest(constraint); - if (test && (constraint->GetSolverModel() != m_jointkinematicCloseLoop)) - { - ndBodyKinematic* const childBody = (constraint->GetBody0() != rootBody) ? constraint->GetBody0() : constraint->GetBody1(); - if (childBody->GetInvMass()) - { - hasJoints = true; - break; - } - } - } - - if (hasJoints) - { - // the root node is not static and has children, - // them add the first children to this root - skeleton = m_skeletonList.CreateContatiner(rootBody, skeletonsId); - skeletonsId++; - - for (ndBodyKinematic::ndJointList::ndNode* jointNode = rootBody->m_jointList.GetFirst(); jointNode; jointNode = jointNode->GetNext()) - { - ndJointBilateralConstraint* const constraint = jointNode->GetInfo(); - //ndTrace(("%s %d %d\n", constraint->ClassName(), constraint->GetBody0()->GetId(), constraint->GetBody1()->GetId())); - const bool test = SkeletonJointTest(constraint); - if (test && (constraint->GetSolverModel() != m_jointkinematicCloseLoop)) - { - constraint->m_mark0 = 1; - ndAssert(skeleton->GetRoot()->m_body != ((constraint->GetBody0() != rootBody) ? constraint->GetBody0() : constraint->GetBody1())); - ndSkeletonContainer::ndNode* const node = skeleton->AddChild((ndJointBilateralConstraint*)constraint, skeleton->GetRoot()); - node->m_body->m_skeletonMark = 1; - ndAssert(node->m_body == ((constraint->GetBody0() != rootBody) ? constraint->GetBody0() : constraint->GetBody1())); - queuePool.Push(node); - } - } - } - } - - if (skeleton) - { - // add the rest of the children to this skeleton - ndInt32 loopCount = 0; - ndJointBilateralConstraint* loopJoints[128]; - - while (!queuePool.IsEmpty()) - { - ndInt32 count = queuePool.m_firstIndex - queuePool.m_lastIndex; - if (count < 0) - { - count += queuePool.m_mod; - } - - ndInt32 index = queuePool.m_lastIndex; - queuePool.Reset(); - - for (ndInt32 j = 0; j < count; ++j) - { - ndSkeletonContainer::ndNode* const parentNode = queuePool[index]; - ndBodyKinematic* const parentBody = parentNode->m_body; - if (!parentBody->m_skeletonMark0) - { - parentBody->m_skeletonMark0 = 1; - for (ndBodyKinematic::ndJointList::ndNode* jointNode = parentBody->m_jointList.GetFirst(); jointNode; jointNode = jointNode->GetNext()) - { - ndJointBilateralConstraint* const constraint = jointNode->GetInfo(); - if (!constraint->m_mark0) - { - //ndTrace(("%s %d %d\n", constraint->ClassName(), constraint->GetBody0()->GetId(), constraint->GetBody1()->GetId())); - constraint->m_mark0 = 1; - if (SkeletonJointTest(constraint)) - { - ndBodyKinematic* const childBody = (constraint->GetBody0() == parentBody) ? constraint->GetBody1() : constraint->GetBody0(); - if (!childBody->m_skeletonMark && (childBody->GetInvMass() != ndFloat32(0.0f)) && (constraint->GetSolverModel() != m_jointkinematicCloseLoop)) - { - childBody->m_skeletonMark = 1; - ndSkeletonContainer::ndNode* const childNode = skeleton->AddChild(constraint, parentNode); - queuePool.Push(childNode); - } - else if (loopCount < ndInt32 ((sizeof(loopJoints) / sizeof(loopJoints[0])))) - { - loopJoints[loopCount] = (ndJointBilateralConstraint*)constraint; - loopCount++; - } - } - } - } - } - - index++; - if (index >= queuePool.m_mod) - { - index = 0; - } - } - } - skeleton->Finalize(loopCount, loopJoints); - //ndTrace(("\n")); - } - } - - for (ndInt32 i = ndInt32(bodyArray.GetCount()) - 1; i >= 0; i--) - { - ndBodyKinematic* const body = bodyArray[i]; - body->PrepareStep(i); - ndAssert (bodyArray[i] == body); - } - - m_activeSkeletons.SetCount(0); - ndSkeletonList::Iterator iter(m_skeletonList); - for (iter.Begin(); iter; iter++) - { - ndSkeletonContainer* const skeleton = &iter.GetNode()->GetInfo(); - m_activeSkeletons.PushBack(skeleton); - } - } - - for (ndInt32 i = 0; i < m_activeSkeletons.GetCount(); ++i) - { - ndSkeletonContainer* const skeleton = m_activeSkeletons[i]; - skeleton->ClearCloseLoopJoints(); - } -} - -bool ndWorld::RayCast(ndRayCastNotify& callback, const ndVector& globalOrigin, const ndVector& globalDest) const -{ - return m_scene->RayCast(callback, globalOrigin, globalDest); -} - -bool ndWorld::ConvexCast(ndConvexCastNotify& callback, const ndShapeInstance& convexShape, const ndMatrix& globalOrigin, const ndVector& globalDest) const -{ - return m_scene->ConvexCast(callback, convexShape, globalOrigin, globalDest); -} - -void ndWorld::BodiesInAabb(ndBodiesInAabbNotify& callback, const ndVector& minBox, const ndVector& maxBox) const -{ - m_scene->BodiesInAabb(callback, minBox, maxBox); -} - -void ndWorld::SelectSolver(ndSolverModes solverMode) -{ - if (solverMode != m_solverMode) - { - Sync(); - delete m_solver; - switch (solverMode) - { - case ndSimdSoaSolver: - { - ndWorldScene* const newScene = new ndWorldScene(*((ndWorldScene*)m_scene)); - delete m_scene; - m_scene = newScene; - - m_solverMode = solverMode; - m_solver = new ndDynamicsUpdateSoa(this); - break; - } - - case ndSimdAvx2Solver: - { - #ifdef _D_USE_AVX2_SOLVER - ndWorldScene* const newScene = new ndWorldSceneAvx2(*((ndWorldScene*)m_scene)); - delete m_scene; - m_scene = newScene; - - m_solverMode = solverMode; - m_solver = new ndDynamicsUpdateAvx2(this); - #else - ndWorldScene* const newScene = new ndWorldScene(*((ndWorldScene*)m_scene)); - delete m_scene; - m_scene = newScene; - - m_solverMode = ndSimdSoaSolver; - m_solver = new ndDynamicsUpdateSoa(this); - #endif - break; - } - - case ndCudaSolver: - { - #ifdef _D_NEWTON_CUDA - ndMemFreeCallback freeMemory; - ndMemAllocCallback allocMemory; - ndMemory::GetMemoryAllocators(allocMemory, freeMemory); - ndCudaContext::SetMemoryAllocators(allocMemory, freeMemory); - ndWorldScene* const newScene = new ndWorldSceneCuda(*((ndWorldScene*)m_scene)); - delete m_scene; - m_scene = newScene; - m_solverMode = solverMode; - m_solver = new ndDynamicsUpdateCuda(this); - if (!newScene->IsValid()) - { - delete m_solver; - ndWorldScene* const defaultScene = new ndWorldScene(*((ndWorldScene*)m_scene)); - delete m_scene; - m_scene = defaultScene; - - m_solverMode = ndSimdSoaSolver; - m_solver = new ndDynamicsUpdateSoa(this); - } - #else - ndWorldScene* const newScene = new ndWorldScene(*((ndWorldScene*)m_scene)); - delete m_scene; - m_scene = newScene; - m_solverMode = ndSimdSoaSolver; - m_solver = new ndDynamicsUpdateSoa(this); - #endif - break; - } - - case ndStandardSolver: - default: - { - ndWorldScene* const newScene = new ndWorldScene(*((ndWorldScene*)m_scene)); - delete m_scene; - m_scene = newScene; - - m_solverMode = ndStandardSolver; - m_solver = new ndDynamicsUpdate(this); - break; - } - } - - #ifdef _DEBUG - for (ndBodyListView::ndNode* node = m_scene->GetBodyList().GetFirst(); node; node = node->GetNext()) - { - ndBodyKinematic* const body = node->GetInfo()->GetAsBodyKinematic(); - ndAssert(body->GetContactMap().SanityCheck()); - } - #endif - } -} - -void ndWorld::CollisionUpdate(ndFloat32 timestep) -{ - // wait until previous update complete. - Sync(); - m_timestep = timestep; - - // update the next frame asynchronous - m_scene->TickOne(); -} - -void ndWorld::Update(ndFloat32 timestep) -{ - // wait until previous update complete. - Sync(); - - // save time state for use by the update callback - m_timestep = timestep; - - // update the next frame asynchronous - m_scene->TickOne(); -} - -void ndWorld::RemoveBody(ndSharedPtr& body) -{ - m_scene->RemoveBody(body); -} - -void ndWorld::RemoveJoint(ndSharedPtr& joint) -{ - ndJointList::ndNode* const worldNode = joint->m_worldNode; - if (worldNode != nullptr) - { - //ndTrace((" joint %s %d %d\n", joint->ClassName(), joint->GetBody0()->m_uniqueId, joint->GetBody1()->m_uniqueId)); - ndAssert(joint->m_body0Node != nullptr); - ndAssert(joint->m_body1Node != nullptr); - joint->GetBody0()->DetachJoint(joint->m_body0Node); - joint->GetBody1()->DetachJoint(joint->m_body1Node); - - if (joint->IsSkeleton()) - { - m_skeletonList.m_skelListIsDirty = true; - ndSkeletonContainer* const skeleton = joint->GetBody0()->GetSkeleton(); - if (skeleton) - { - skeleton->Clear(); - } - } - - joint->SetActive(true); - joint->m_worldNode = nullptr; - joint->m_body0Node = nullptr; - joint->m_body1Node = nullptr; - joint->m_deletedNode = nullptr; - m_jointList.Remove(worldNode); - } -} - -void ndWorld::RemoveBody(ndBody* const body) -{ - ndScopeSpinLock lock(m_deletedLock); - if (!body->m_deletedNode) - { - body->m_deletedNode = m_deletedBodies.Append(body); - } -} - -void ndWorld::RemoveJoint(ndJointBilateralConstraint* const joint) -{ - ndScopeSpinLock lock(m_deletedLock); - if (!joint->m_deletedNode) - { - if (joint->m_worldNode) - { - joint->SetActive(false); - joint->m_deletedNode = m_deletedJoints.Append(joint); - } - } -} - -void ndWorld::RemoveModel(ndModel* const model) -{ - ndScopeSpinLock lock(m_deletedLock); - if (!model->m_deletedNode) - { - if (model->m_worldNode) - { - model->m_deletedNode = m_deletedModels.Append(model); - } - } -} - -void ndWorld::CalculateJointContacts(ndContact* const contact) -{ - ndBodyKinematic* const body0 = contact->GetBody0(); - ndBodyKinematic* const body1 = contact->GetBody1(); - body0->UpdateCollisionMatrix(); - body1->UpdateCollisionMatrix(); - - m_scene->CalculateJointContacts(0, contact); -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorld.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorld.h deleted file mode 100644 index 615ea9c3cc..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorld.h +++ /dev/null @@ -1,203 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_WORLD_H__ -#define __ND_WORLD_H__ - -#include "ndNewtonStdafx.h" -#include "ndJointList.h" -#include "ndSkeletonList.h" -#include "dModels/ndModelList.h" - -class ndWorld; -class ndModel; -class ndJointList; -class ndBodyDynamic; -class ndRayCastNotify; -class ndDynamicsUpdate; -class ndConvexCastNotify; -class ndBodiesInAabbNotify; -class ndJointBilateralConstraint; - -#define D_NEWTON_ENGINE_MAJOR_VERSION 4 -#define D_NEWTON_ENGINE_MINOR_VERSION 00 - -#define D_SLEEP_ENTRIES 8 - -D_MSV_NEWTON_ALIGN_32 -class ndWorld: public ndClassAlloc -{ - public: - enum ndSolverModes - { - ndStandardSolver, - ndSimdSoaSolver, - ndSimdAvx2Solver, - ndCudaSolver, - }; - - D_BASE_CLASS_REFLECTION(ndWorld) - D_NEWTON_API ndWorld(); - D_NEWTON_API virtual ~ndWorld(); - - D_NEWTON_API virtual void CleanUp(); - - D_NEWTON_API ndInt32 GetEngineVersion() const; - - D_NEWTON_API void Sync() const; - D_NEWTON_API void Update(ndFloat32 timestep); - D_NEWTON_API void CollisionUpdate(ndFloat32 timestep); - - D_NEWTON_API ndInt32 GetThreadCount() const; - D_NEWTON_API void SetThreadCount(ndInt32 count); - - D_NEWTON_API ndInt32 GetSubSteps() const; - D_NEWTON_API void SetSubSteps(ndInt32 subSteps); - - D_NEWTON_API ndSolverModes GetSelectedSolver() const; - D_NEWTON_API void SelectSolver(ndSolverModes solverMode); - - D_NEWTON_API ndScene* GetScene() const; - D_NEWTON_API bool IsHighPerformanceCompute() const; - D_NEWTON_API const char* GetSolverString() const; - D_NEWTON_API ndBodyKinematic* GetSentinelBody() const; - - D_NEWTON_API virtual bool AddBody(const ndSharedPtr& body); - D_NEWTON_API virtual void AddModel(const ndSharedPtr& model); - D_NEWTON_API virtual void AddJoint(const ndSharedPtr& joint); - - D_NEWTON_API ndSharedPtr GetBody(ndBody* const body) const; - //D_NEWTON_API virtual void GetModel(ndSharedPtr& model); - //D_NEWTON_API virtual void GetJoint(ndSharedPtr& joint); - - D_NEWTON_API virtual void RemoveBody(ndBody* const body); - D_NEWTON_API virtual void RemoveModel(ndModel* const model); - D_NEWTON_API virtual void RemoveJoint(ndJointBilateralConstraint* const joint); - - D_NEWTON_API const ndJointList& GetJointList() const; - D_NEWTON_API const ndModelList& GetModelList() const; - D_NEWTON_API const ndBodyListView& GetBodyList() const; - D_NEWTON_API const ndBodyList& GetParticleList() const; - D_NEWTON_API const ndContactArray& GetContactList() const; - D_NEWTON_API const ndSkeletonList& GetSkeletonList() const; - - D_NEWTON_API ndInt32 GetSolverIterations() const; - D_NEWTON_API void SetSolverIterations(ndInt32 iterations); - - D_NEWTON_API ndFloat32 GetUpdateTime() const; - D_NEWTON_API ndUnsigned32 GetFrameNumber() const; - D_NEWTON_API ndUnsigned32 GetSubFrameNumber() const; - D_NEWTON_API ndFloat32 GetAverageUpdateTime() const; - - D_NEWTON_API ndContactNotify* GetContactNotify() const; - D_NEWTON_API void SetContactNotify(ndContactNotify* const notify); - - D_NEWTON_API void DebugScene(ndSceneTreeNotiFy* const notify); - D_NEWTON_API void SendBackgroundTask(ndBackgroundTask* const job); - - D_NEWTON_API void ClearCache(); - D_NEWTON_API void BodiesInAabb(ndBodiesInAabbNotify& callback, const ndVector& minBox, const ndVector& maxBox) const; - D_NEWTON_API bool RayCast(ndRayCastNotify& callback, const ndVector& globalOrigin, const ndVector& globalDest) const; - D_NEWTON_API bool ConvexCast(ndConvexCastNotify& callback, const ndShapeInstance& convexShape, const ndMatrix& globalOrigin, const ndVector& globalDest) const; - - D_NEWTON_API void CalculateJointContacts(ndContact* const contact); - - private: - void ThreadFunction(); - - protected: - D_NEWTON_API virtual void UpdateSkeletons(); - D_NEWTON_API virtual void UpdateTransforms(); - D_NEWTON_API virtual void PostModelTransform(); - - D_NEWTON_API virtual void PreUpdate(ndFloat32 timestep); - D_NEWTON_API virtual void PostUpdate(ndFloat32 timestep); - - D_NEWTON_API virtual void OnSubStepPreUpdate(ndFloat32 timestep); - D_NEWTON_API virtual void OnSubStepPostUpdate(ndFloat32 timestep); - - private: - //void RemoveModel(ndSharedPtr& model); - void RemoveBody(ndSharedPtr& body); - void RemoveJoint(ndSharedPtr& joint); - - class dgSolverProgressiveSleepEntry - { - public: - ndFloat32 m_maxAccel; - ndFloat32 m_maxVeloc; - ndInt32 m_steps; - }; - - class ndIslandMember - { - public: - ndBodyKinematic* m_root; - ndBodyKinematic* m_body; - }; - - void ModelUpdate(); - void ModelPostUpdate(); - void CalculateAverageUpdateTime(); - void SubStepUpdate(ndFloat32 timestep); - void ParticleUpdate(ndFloat32 timestep); - - bool SkeletonJointTest(ndJointBilateralConstraint* const jointA) const; - static ndInt32 CompareJointByInvMass(const ndJointBilateralConstraint* const jointA, const ndJointBilateralConstraint* const jointB, void* notUsed); - - ndScene* m_scene; - ndDynamicsUpdate* m_solver; - ndJointList m_jointList; - ndModelList m_modelList; - ndSkeletonList m_skeletonList; - ndSpecialList m_deletedBodies; - ndSpecialList m_deletedModels; - ndSpecialList m_deletedJoints; - ndArray m_activeSkeletons; - ndSpinLock m_deletedLock; - - ndFloat32 m_timestep; - ndFloat32 m_freezeAccel2; - ndFloat32 m_freezeSpeed2; - ndFloat32 m_averageUpdateTime; - ndFloat32 m_averageTimestepAcc; - ndFloat32 m_averageFramesCount; - ndFloat32 m_lastExecutionTime; - dgSolverProgressiveSleepEntry m_sleepTable[D_SLEEP_ENTRIES]; - - ndInt32 m_subSteps; - ndSolverModes m_solverMode; - ndInt32 m_solverIterations; - bool m_inUpdate; - - friend class ndScene; - friend class ndIkSolver; - friend class ndWorldScene; - friend class ndBodyDynamic; - friend class ndDynamicsUpdate; - friend class ndSkeletonContainer; - friend class ndModelArticulation; - friend class ndDynamicsUpdateSoa; - friend class ndDynamicsUpdateAvx2; - friend class ndDynamicsUpdateCuda; -} D_GCC_NEWTON_ALIGN_32; - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorldScene.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorldScene.cpp deleted file mode 100644 index b91e1d3119..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorldScene.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "ndNewtonStdafx.h" -#include "ndWorldScene.h" - -ndWorldScene::ndWorldScene(ndWorld* const world) - :ndScene() - ,m_world(world) -{ -} - -ndWorldScene::ndWorldScene(const ndWorldScene& src) - :ndScene(src) - ,m_world(src.m_world) -{ -} - -ndWorldScene::~ndWorldScene() -{ -} - -void ndWorldScene::ThreadFunction() -{ - m_world->ThreadFunction(); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorldScene.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorldScene.h deleted file mode 100644 index b7d52d558e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/dNewton/ndWorldScene.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_WORLD_SCENE_H__ -#define __ND_WORLD_SCENE_H__ - -#include "ndNewtonStdafx.h" -#include "ndWorld.h" - -class ndWorldScene : public ndScene -{ - public: - D_NEWTON_API ndWorldScene(ndWorld* const world); - D_NEWTON_API ndWorldScene(const ndWorldScene& src); - D_NEWTON_API virtual ~ndWorldScene(); - - protected: - virtual void ThreadFunction(); - - virtual ndWorld* GetWorld() const; - - ndWorld* m_world; -}; - -inline ndWorld* ndWorldScene::GetWorld() const -{ - return m_world; -} - -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/LICENSE b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/LICENSE deleted file mode 100644 index efc7f64399..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2011, Khaled Mamou (kmamou at gmail dot com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/README.md b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/README.md deleted file mode 100644 index afdb66e8e7..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# The V-HACD library decomposes a 3D surface into a set of "near" convex parts. - -![Approximate convex decomposition of "Camel"](https://github.com/kmammou/v-hacd/raw/master/doc/acd.png) - -# Why do we need approximate convex decomposition? - -Collision detection is essential for [realistic physical interactions](https://www.youtube.com/watch?v=oyjE5L4-1lQ) in video games and computer animation. In order to ensure real-time interactivity with the player/user, video game and 3D modeling software developers usually approximate the 3D models composing the scene (e.g. animated characters, static objects...) by a set of simple convex shapes such as ellipsoids, capsules or convex-hulls. In practice, these simple shapes provide poor approximations for concave surfaces and generate false collision detection. - -![Convex-hull vs. ACD](https://raw.githubusercontent.com/kmammou/v-hacd/master/doc/chvsacd.png) - -A second approach consists in computing an exact convex decomposition of a surface S, which consists in partitioning it into a minimal set of convex sub-surfaces. Exact convex decomposition algorithms are NP-hard and non-practical since they produce a high number of clusters. To overcome these limitations, the exact convexity constraint is relaxed and an approximate convex decomposition of S is instead computed. Here, the goal is to determine a partition of the mesh triangles with a minimal number of clusters, while ensuring that each cluster has a concavity lower than a user defined threshold. - -![ACD vs. ECD](https://raw.githubusercontent.com/kmammou/v-hacd/master/doc/ecdvsacd.png) - -# Installing the Package - -## Blender 2.8x - -A 2.8x port of the blender addon tool can be found here: https://github.com/andyp123/blender_vhacd, please go there and follow the instructions provided in that repository. -The in-repo included 2.7x version of the tool will not function for Blender 2.8+. - -## Blender 2.7x - -1. Clone this Github repository -1. You may either rebuild the binaries for your machine or use the provided binaries. Here we will assume that you will use the provided binaries in the v-hacd/bin directory. -1. Copy the Python script in v-hacd/add-ons/blender/object_vhacd.py to your Blender addons directory. For Blender 2.78 this directory will be "Blender Foundation/Blender/2.78/scripts/addons/". You're at the right place if you see other scripts prefixed with object\_. -1. The addon must be enabled before use. After copying the script to the addons directory, open Blender and navigate to File > User Preferences > Add-ons. Object: V-HACD will be featured on the list. Check its mark to enable the addon and save user settings. - -# Using the Addon - -1. After you have enabled the addon, the V-HACD menu will appear in the object menu when an object is selected. -1. Go to this menu and select a preset (or leave the path presets). -1. Select your VHACD path by selecting the "Open File" button next to the VHACD path, which should currently be blank. - 1. Navigate to the directory in which you cloned this repository and find the appropriate executable in the bin folder for your operating systme. - 1. If you have a video card that supports OpenCL, this will be bin. - 1. If you don't have a video card or your video card does not support OpenCL, the appropriate executable for you will be bin-no-ocl (no OpenCL). -1. Select the V-HACD button at the button of the panel. You will be presented with some options. -1. Modify the options as desired and select "OK." -1. Note that the processing may take some time. Increasing voxel resolution will particularly increase runtime. - -# Parameters -| Parameter name | Description | Default value | Range | -| ------------- | ------------- | ------------- | ---- | -| resolution | maximum number of voxels generated during the voxelization stage | 100,000 | 10,000-64,000,000 | -| depth | maximum number of clipping stages. During each split stage, all the model parts (with a concavity higher than the user defined threshold) are clipped according the "best" clipping plane | 20 | 1-32 | -| concavity | maximum concavity | 0.0025 | 0.0-1.0 | -| planeDownsampling | controls the granularity of the search for the "best" clipping plane | 4 | 1-16 | -| convexhullDownsampling | controls the precision of the convex-hull generation process during the clipping plane selection stage | 4 | 1-16 | -| alpha | controls the bias toward clipping along symmetry planes | 0.05 | 0.0-1.0 | -| beta | controls the bias toward clipping along revolution axes | 0.05 | 0.0-1.0 | -| gamma | maximum allowed concavity during the merge stage | 0.00125 | 0.0-1.0 | -| pca | enable/disable normalizing the mesh before applying the convex decomposition | 0 | 0-1 | -| mode | 0: voxel-based approximate convex decomposition, 1: tetrahedron-based approximate convex decomposition | 0 | 0-1 | -| maxNumVerticesPerCH | controls the maximum number of triangles per convex-hull | 64 | 4-1024 | -| minVolumePerCH | controls the adaptive sampling of the generated convex-hulls | 0.0001 | 0.0-0.01 | - -# Using V-HACD inside PyBullet - -[PyBullet](https://docs.google.com/document/d/10sXEhzFRSnvFcl3XxNGhnD4N2SedqwdAvK3dsihxVUA) is an easy to use Python module for physics simulation for robotics, games, visual effects and machine learning, with a focus on sim-to-real transfer. From version 2.6.7, PyBullet includes V-HACD embedded: - -``` -pip3 install pybullet --upgrade --user - -#now in a script you can use - -import pybullet as p -import pybullet_data as pd -import os - -p.connect(p.DIRECT) -name_in = os.path.join(pd.getDataPath(), "duck.obj") -name_out = "duck_vhacd2.obj" -name_log = "log.txt" -p.vhacd(name_in, name_out, name_log, alpha=0.04,resolution=50000 ) -``` - -# More approximate convex decomposition results -![V-HACD Results (1/4)](https://raw.githubusercontent.com/kmammou/v-hacd/master/doc/snapshots_1.png) -![V-HACD Results (2/4)](https://raw.githubusercontent.com/kmammou/v-hacd/master/doc/snapshots_2.png) -![V-HACD Results (3/4)](https://raw.githubusercontent.com/kmammou/v-hacd/master/doc/snapshots_3.png) -![V-HACD Results (4/4)](https://raw.githubusercontent.com/kmammou/v-hacd/master/doc/snapshots_4.png) - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/hacd.vcxproj b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/hacd.vcxproj deleted file mode 100644 index fe9c27b933..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/hacd.vcxproj +++ /dev/null @@ -1,197 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 17.0 - Win32Proj - {57eaf94c-1149-4125-8427-fba4050b9b71} - hacd - 10.0 - - - - StaticLibrary - true - v143 - Unicode - - - StaticLibrary - false - v143 - true - Unicode - - - StaticLibrary - true - v143 - Unicode - - - StaticLibrary - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - ../../../ExampleLibrary/$(Platform)\$(ProjectName)/Release\ - $(SolutionDir)$(Platform)\Release\ - - - ../../../ExampleLibrary/$(Platform)\$(ProjectName)/Release\ - $(SolutionDir)$(Platform)\Release\ - - - ../../../ExampleLibrary/$(Platform)\$(ProjectName)/Release\ - $(SolutionDir)$(Platform)\Release\ - - - ../../../ExampleLibrary/$(Platform)\$(ProjectName)/Release\ - $(SolutionDir)$(Platform)\Release\ - - - - Level3 - true - WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - NotUsing - pch.h - src/VHACD_Lib/inc;src/VHACD_Lib/public;%(AdditionalIncludeDirectories) - - - - - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - NotUsing - pch.h - src/VHACD_Lib/inc;src/VHACD_Lib/public;%(AdditionalIncludeDirectories) - - - - - true - true - true - - - - - Level3 - true - _DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - NotUsing - pch.h - src/VHACD_Lib/inc;src/VHACD_Lib/public;%(AdditionalIncludeDirectories) - - - - - true - - - - - Level3 - true - true - true - NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - NotUsing - pch.h - src/VHACD_Lib/inc;src/VHACD_Lib/public;%(AdditionalIncludeDirectories) - - - - - true - true - true - - - - - - \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/hacd.vcxproj.filters b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/hacd.vcxproj.filters deleted file mode 100644 index 5170bdcb76..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/hacd.vcxproj.filters +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/FloatMath.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/FloatMath.h deleted file mode 100644 index 5cc6fb826d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/FloatMath.h +++ /dev/null @@ -1,528 +0,0 @@ -#ifndef ND_FLOAT_MATH_LIB_H -#define ND_FLOAT_MATH_LIB_H - -#include "vhacdDefines.h" - -namespace nd_ -{ - namespace FLOAT_MATH - { - - enum FM_ClipState - { - FMCS_XMIN = (1 << 0), - FMCS_XMAX = (1 << 1), - FMCS_YMIN = (1 << 2), - FMCS_YMAX = (1 << 3), - FMCS_ZMIN = (1 << 4), - FMCS_ZMAX = (1 << 5), - }; - - enum FM_Axis - { - FM_XAXIS = (1 << 0), - FM_YAXIS = (1 << 1), - FM_ZAXIS = (1 << 2) - }; - - enum LineSegmentType - { - LS_START, - LS_MIDDLE, - LS_END - }; - - - const float FM_PI = 3.1415926535897932384626433832795028841971693993751f; - const float FM_DEG_TO_RAD = ((2.0f * FM_PI) / 360.0f); - const float FM_RAD_TO_DEG = (360.0f / (2.0f * FM_PI)); - - //***************** Float versions - //*** - //*** vectors are assumed to be 3 floats or 3 doubles representing X, Y, Z - //*** quaternions are assumed to be 4 floats or 4 doubles representing X,Y,Z,W - //*** matrices are assumed to be 16 floats or 16 doubles representing a standard D3D or OpenGL style 4x4 matrix - //*** bounding volumes are expressed as two sets of 3 floats/double representing bmin(x,y,z) and bmax(x,y,z) - //*** Plane equations are assumed to be 4 floats or 4 doubles representing Ax,By,Cz,D - - FM_Axis fm_getDominantAxis(const float normal[3]); - FM_Axis fm_getDominantAxis(const double normal[3]); - - void fm_decomposeTransform(const float local_transform[16], float trans[3], float rot[4], float scale[3]); - void fm_decomposeTransform(const double local_transform[16], double trans[3], double rot[4], double scale[3]); - - void fm_multiplyTransform(const float *pA, const float *pB, float *pM); - void fm_multiplyTransform(const double *pA, const double *pB, double *pM); - - void fm_inverseTransform(const float matrix[16], float inverse_matrix[16]); - void fm_inverseTransform(const double matrix[16], double inverse_matrix[16]); - - void fm_identity(float matrix[16]); // set 4x4 matrix to identity. - void fm_identity(double matrix[16]); // set 4x4 matrix to identity. - - void fm_inverseRT(const float matrix[16], const float pos[3], float t[3]); // inverse rotate translate the point. - void fm_inverseRT(const double matrix[16], const double pos[3], double t[3]); // inverse rotate translate the point. - - void fm_transform(const float matrix[16], const float pos[3], float t[3]); // rotate and translate this point. - void fm_transform(const double matrix[16], const double pos[3], double t[3]); // rotate and translate this point. - - float fm_getDeterminant(const float matrix[16]); - double fm_getDeterminant(const double matrix[16]); - - void fm_getSubMatrix(int32_t ki, int32_t kj, float pDst[16], const float matrix[16]); - void fm_getSubMatrix(int32_t ki, int32_t kj, double pDst[16], const float matrix[16]); - - void fm_rotate(const float matrix[16], const float pos[3], float t[3]); // only rotate the point by a 4x4 matrix, don't translate. - void fm_rotate(const double matri[16], const double pos[3], double t[3]); // only rotate the point by a 4x4 matrix, don't translate. - - void fm_eulerToMatrix(float ax, float ay, float az, float matrix[16]); // convert euler (in radians) to a dest 4x4 matrix (translation set to zero) - void fm_eulerToMatrix(double ax, double ay, double az, double matrix[16]); // convert euler (in radians) to a dest 4x4 matrix (translation set to zero) - - void fm_getAABB(uint32_t vcount, const float *points, uint32_t pstride, float bmin[3], float bmax[3]); - void fm_getAABB(uint32_t vcount, const double *points, uint32_t pstride, double bmin[3], double bmax[3]); - - void fm_getAABBCenter(const float bmin[3], const float bmax[3], float center[3]); - void fm_getAABBCenter(const double bmin[3], const double bmax[3], double center[3]); - - void fm_transformAABB(const float bmin[3], const float bmax[3], const float matrix[16], float tbmin[3], float tbmax[3]); - void fm_transformAABB(const double bmin[3], const double bmax[3], const double matrix[16], double tbmin[3], double tbmax[3]); - - void fm_eulerToQuat(float x, float y, float z, float quat[4]); // convert euler angles to quaternion. - void fm_eulerToQuat(double x, double y, double z, double quat[4]); // convert euler angles to quaternion. - - void fm_quatToEuler(const float quat[4], float &ax, float &ay, float &az); - void fm_quatToEuler(const double quat[4], double &ax, double &ay, double &az); - - void fm_eulerToQuat(const float euler[3], float quat[4]); // convert euler angles to quaternion. Angles must be radians not degrees! - void fm_eulerToQuat(const double euler[3], double quat[4]); // convert euler angles to quaternion. - - void fm_scale(float x, float y, float z, float matrix[16]); // apply scale to the matrix. - void fm_scale(double x, double y, double z, double matrix[16]); // apply scale to the matrix. - - void fm_eulerToQuatDX(float x, float y, float z, float quat[4]); // convert euler angles to quaternion using the fucked up DirectX method - void fm_eulerToQuatDX(double x, double y, double z, double quat[4]); // convert euler angles to quaternion using the fucked up DirectX method - - void fm_eulerToMatrixDX(float x, float y, float z, float matrix[16]); // convert euler angles to quaternion using the fucked up DirectX method. - void fm_eulerToMatrixDX(double x, double y, double z, double matrix[16]); // convert euler angles to quaternion using the fucked up DirectX method. - - void fm_quatToMatrix(const float quat[4], float matrix[16]); // convert quaterinion rotation to matrix, translation set to zero. - void fm_quatToMatrix(const double quat[4], double matrix[16]); // convert quaterinion rotation to matrix, translation set to zero. - - void fm_quatRotate(const float quat[4], const float v[3], float r[3]); // rotate a vector directly by a quaternion. - void fm_quatRotate(const double quat[4], const double v[3], double r[3]); // rotate a vector directly by a quaternion. - - void fm_getTranslation(const float matrix[16], float t[3]); - void fm_getTranslation(const double matrix[16], double t[3]); - - void fm_setTranslation(const float *translation, float matrix[16]); - void fm_setTranslation(const double *translation, double matrix[16]); - - void fm_multiplyQuat(const float *qa, const float *qb, float *quat); - void fm_multiplyQuat(const double *qa, const double *qb, double *quat); - - void fm_matrixToQuat(const float matrix[16], float quat[4]); // convert the 3x3 portion of a 4x4 matrix into a quaterion as x,y,z,w - void fm_matrixToQuat(const double matrix[16], double quat[4]); // convert the 3x3 portion of a 4x4 matrix into a quaterion as x,y,z,w - - float fm_sphereVolume(float radius); // return's the volume of a sphere of this radius (4/3 PI * R cubed ) - double fm_sphereVolume(double radius); // return's the volume of a sphere of this radius (4/3 PI * R cubed ) - - float fm_cylinderVolume(float radius, float h); - double fm_cylinderVolume(double radius, double h); - - float fm_capsuleVolume(float radius, float h); - double fm_capsuleVolume(double radius, double h); - - float fm_distance(const float p1[3], const float p2[3]); - double fm_distance(const double p1[3], const double p2[3]); - - float fm_distanceSquared(const float p1[3], const float p2[3]); - double fm_distanceSquared(const double p1[3], const double p2[3]); - - float fm_distanceSquaredXZ(const float p1[3], const float p2[3]); - double fm_distanceSquaredXZ(const double p1[3], const double p2[3]); - - float fm_computePlane(const float p1[3], const float p2[3], const float p3[3], float *n); // return D - double fm_computePlane(const double p1[3], const double p2[3], const double p3[3], double *n); // return D - - float fm_distToPlane(const float plane[4], const float pos[3]); // computes the distance of this point from the plane. - double fm_distToPlane(const double plane[4], const double pos[3]); // computes the distance of this point from the plane. - - float fm_dot(const float p1[3], const float p2[3]); - double fm_dot(const double p1[3], const double p2[3]); - - void fm_cross(float cross[3], const float a[3], const float b[3]); - void fm_cross(double cross[3], const double a[3], const double b[3]); - - float fm_computeNormalVector(float n[3], const float p1[3], const float p2[3]); // as P2-P1 normalized. - double fm_computeNormalVector(double n[3], const double p1[3], const double p2[3]); // as P2-P1 normalized. - - bool fm_computeWindingOrder(const float p1[3], const float p2[3], const float p3[3]); // returns true if the triangle is clockwise. - bool fm_computeWindingOrder(const double p1[3], const double p2[3], const double p3[3]); // returns true if the triangle is clockwise. - - float fm_normalize(float n[3]); // normalize this vector and return the distance - double fm_normalize(double n[3]); // normalize this vector and return the distance - - float fm_normalizeQuat(float n[4]); // normalize this quat - double fm_normalizeQuat(double n[4]); // normalize this quat - - void fm_matrixMultiply(const float A[16], const float B[16], float dest[16]); - void fm_matrixMultiply(const double A[16], const double B[16], double dest[16]); - - void fm_composeTransform(const float position[3], const float quat[4], const float scale[3], float matrix[16]); - void fm_composeTransform(const double position[3], const double quat[4], const double scale[3], double matrix[16]); - - float fm_computeArea(const float p1[3], const float p2[3], const float p3[3]); - double fm_computeArea(const double p1[3], const double p2[3], const double p3[3]); - - void fm_lerp(const float p1[3], const float p2[3], float dest[3], float lerpValue); - void fm_lerp(const double p1[3], const double p2[3], double dest[3], double lerpValue); - - bool fm_insideTriangleXZ(const float test[3], const float p1[3], const float p2[3], const float p3[3]); - bool fm_insideTriangleXZ(const double test[3], const double p1[3], const double p2[3], const double p3[3]); - - bool fm_insideAABB(const float pos[3], const float bmin[3], const float bmax[3]); - bool fm_insideAABB(const double pos[3], const double bmin[3], const double bmax[3]); - - bool fm_insideAABB(const float obmin[3], const float obmax[3], const float tbmin[3], const float tbmax[3]); // test if bounding box tbmin/tmbax is fully inside obmin/obmax - bool fm_insideAABB(const double obmin[3], const double obmax[3], const double tbmin[3], const double tbmax[3]); // test if bounding box tbmin/tmbax is fully inside obmin/obmax - - uint32_t fm_clipTestPoint(const float bmin[3], const float bmax[3], const float pos[3]); - uint32_t fm_clipTestPoint(const double bmin[3], const double bmax[3], const double pos[3]); - - uint32_t fm_clipTestPointXZ(const float bmin[3], const float bmax[3], const float pos[3]); // only tests X and Z, not Y - uint32_t fm_clipTestPointXZ(const double bmin[3], const double bmax[3], const double pos[3]); // only tests X and Z, not Y - - - uint32_t fm_clipTestAABB(const float bmin[3], const float bmax[3], const float p1[3], const float p2[3], const float p3[3], uint32_t &andCode); - uint32_t fm_clipTestAABB(const double bmin[3], const double bmax[3], const double p1[3], const double p2[3], const double p3[3], uint32_t &andCode); - - - bool fm_lineTestAABBXZ(const float p1[3], const float p2[3], const float bmin[3], const float bmax[3], float &time); - bool fm_lineTestAABBXZ(const double p1[3], const double p2[3], const double bmin[3], const double bmax[3], double &time); - - bool fm_lineTestAABB(const float p1[3], const float p2[3], const float bmin[3], const float bmax[3], float &time); - bool fm_lineTestAABB(const double p1[3], const double p2[3], const double bmin[3], const double bmax[3], double &time); - - - void fm_initMinMax(const float p[3], float bmin[3], float bmax[3]); - void fm_initMinMax(const double p[3], double bmin[3], double bmax[3]); - - void fm_initMinMax(float bmin[3], float bmax[3]); - void fm_initMinMax(double bmin[3], double bmax[3]); - - void fm_minmax(const float p[3], float bmin[3], float bmax[3]); // accumulate to a min-max value - void fm_minmax(const double p[3], double bmin[3], double bmax[3]); // accumulate to a min-max value - - // Computes the diagonal length of the bounding box and then inflates the bounding box on all sides - // by the ratio provided. - void fm_inflateMinMax(float bmin[3], float bmax[3], float ratio); - void fm_inflateMinMax(double bmin[3], double bmax[3], double ratio); - - float fm_solveX(const float plane[4], float y, float z); // solve for X given this plane equation and the other two components. - double fm_solveX(const double plane[4], double y, double z); // solve for X given this plane equation and the other two components. - - float fm_solveY(const float plane[4], float x, float z); // solve for Y given this plane equation and the other two components. - double fm_solveY(const double plane[4], double x, double z); // solve for Y given this plane equation and the other two components. - - float fm_solveZ(const float plane[4], float x, float y); // solve for Z given this plane equation and the other two components. - double fm_solveZ(const double plane[4], double x, double y); // solve for Z given this plane equation and the other two components. - - bool fm_computeBestFitPlane(uint32_t vcount, // number of input data points - const float *points, // starting address of points array. - uint32_t vstride, // stride between input points. - const float *weights, // *optional point weighting values. - uint32_t wstride, // weight stride for each vertex. - float plane[4], // Best fit plane equation - float center[3]); // Best fit weighted center of input points - - bool fm_computeBestFitPlane(uint32_t vcount, // number of input data points - const double *points, // starting address of points array. - uint32_t vstride, // stride between input points. - const double *weights, // *optional point weighting values. - uint32_t wstride, // weight stride for each vertex. - double plane[4], - double center[3]); - - // Computes the average center of a set of data points - bool fm_computeCentroid(uint32_t vcount, // number of input data points - const float *points, // starting address of points array. - float *center); - - bool fm_computeCentroid(uint32_t vcount, // number of input data points - const double *points, // starting address of points array. - double *center); - - // Compute centroid of a triangle mesh; takes area of each triangle into account - // weighted average - bool fm_computeCentroid(uint32_t vcount, // number of input data points - const float *points, // starting address of points array. - uint32_t triangleCount, - const uint32_t *indices, - float *center); - - // Compute centroid of a triangle mesh; takes area of each triangle into account - // weighted average - bool fm_computeCentroid(uint32_t vcount, // number of input data points - const double *points, // starting address of points array. - uint32_t triangleCount, - const uint32_t *indices, - double *center); - - - float fm_computeBestFitAABB(uint32_t vcount, const float *points, uint32_t pstride, float bmin[3], float bmax[3]); // returns the diagonal distance - double fm_computeBestFitAABB(uint32_t vcount, const double *points, uint32_t pstride, double bmin[3], double bmax[3]); // returns the diagonal distance - - float fm_computeBestFitSphere(uint32_t vcount, const float *points, uint32_t pstride, float center[3]); - double fm_computeBestFitSphere(uint32_t vcount, const double *points, uint32_t pstride, double center[3]); - - bool fm_lineSphereIntersect(const float center[3], float radius, const float p1[3], const float p2[3], float intersect[3]); - bool fm_lineSphereIntersect(const double center[3], double radius, const double p1[3], const double p2[3], double intersect[3]); - - bool fm_intersectRayAABB(const float bmin[3], const float bmax[3], const float pos[3], const float dir[3], float intersect[3]); - bool fm_intersectLineSegmentAABB(const float bmin[3], const float bmax[3], const float p1[3], const float p2[3], float intersect[3]); - - bool fm_lineIntersectsTriangle(const float rayStart[3], const float rayEnd[3], const float p1[3], const float p2[3], const float p3[3], float sect[3]); - bool fm_lineIntersectsTriangle(const double rayStart[3], const double rayEnd[3], const double p1[3], const double p2[3], const double p3[3], double sect[3]); - - bool fm_rayIntersectsTriangle(const float origin[3], const float dir[3], const float v0[3], const float v1[3], const float v2[3], float &t); - bool fm_rayIntersectsTriangle(const double origin[3], const double dir[3], const double v0[3], const double v1[3], const double v2[3], double &t); - - bool fm_raySphereIntersect(const float center[3], float radius, const float pos[3], const float dir[3], float distance, float intersect[3]); - bool fm_raySphereIntersect(const double center[3], double radius, const double pos[3], const double dir[3], double distance, double intersect[3]); - - void fm_catmullRom(float out_vector[3], const float p1[3], const float p2[3], const float p3[3], const float *p4, const float s); - void fm_catmullRom(double out_vector[3], const double p1[3], const double p2[3], const double p3[3], const double *p4, const double s); - - bool fm_intersectAABB(const float bmin1[3], const float bmax1[3], const float bmin2[3], const float bmax2[3]); - bool fm_intersectAABB(const double bmin1[3], const double bmax1[3], const double bmin2[3], const double bmax2[3]); - - - // computes the rotation quaternion to go from unit-vector v0 to unit-vector v1 - void fm_rotationArc(const float v0[3], const float v1[3], float quat[4]); - void fm_rotationArc(const double v0[3], const double v1[3], double quat[4]); - - float fm_distancePointLineSegment(const float Point[3], const float LineStart[3], const float LineEnd[3], float intersection[3], LineSegmentType &type, float epsilon); - double fm_distancePointLineSegment(const double Point[3], const double LineStart[3], const double LineEnd[3], double intersection[3], LineSegmentType &type, double epsilon); - - - bool fm_colinear(const double p1[3], const double p2[3], const double p3[3], double epsilon = 0.999); // true if these three points in a row are co-linear - bool fm_colinear(const float p1[3], const float p2[3], const float p3[3], float epsilon = 0.999f); - - bool fm_colinear(const float a1[3], const float a2[3], const float b1[3], const float b2[3], float epsilon = 0.999f); // true if these two line segments are co-linear. - bool fm_colinear(const double a1[3], const double a2[3], const double b1[3], const double b2[3], double epsilon = 0.999); // true if these two line segments are co-linear. - - enum IntersectResult - { - IR_DONT_INTERSECT, - IR_DO_INTERSECT, - IR_COINCIDENT, - IR_PARALLEL, - }; - - IntersectResult fm_intersectLineSegments2d(const float a1[3], const float a2[3], const float b1[3], const float b2[3], float intersectionPoint[3]); - IntersectResult fm_intersectLineSegments2d(const double a1[3], const double a2[3], const double b1[3], const double b2[3], double intersectionPoint[3]); - - IntersectResult fm_intersectLineSegments2dTime(const float a1[3], const float a2[3], const float b1[3], const float b2[3], float &t1, float &t2); - IntersectResult fm_intersectLineSegments2dTime(const double a1[3], const double a2[3], const double b1[3], const double b2[3], double &t1, double &t2); - - // Plane-Triangle splitting - - enum PlaneTriResult - { - PTR_ON_PLANE, - PTR_FRONT, - PTR_BACK, - PTR_SPLIT, - }; - - PlaneTriResult fm_planeTriIntersection(const float plane[4], // the plane equation in Ax+By+Cz+D format - const float *triangle, // the source triangle. - uint32_t tstride, // stride in bytes of the input and output *vertices* - float epsilon, // the co-planer epsilon value. - float *front, // the triangle in front of the - uint32_t &fcount, // number of vertices in the 'front' triangle - float *back, // the triangle in back of the plane - uint32_t &bcount); // the number of vertices in the 'back' triangle. - - - PlaneTriResult fm_planeTriIntersection(const double plane[4], // the plane equation in Ax+By+Cz+D format - const double *triangle, // the source triangle. - uint32_t tstride, // stride in bytes of the input and output *vertices* - double epsilon, // the co-planer epsilon value. - double *front, // the triangle in front of the - uint32_t &fcount, // number of vertices in the 'front' triangle - double *back, // the triangle in back of the plane - uint32_t &bcount); // the number of vertices in the 'back' triangle. - - - bool fm_intersectPointPlane(const float p1[3], const float p2[3], float *split, const float plane[4]); - bool fm_intersectPointPlane(const double p1[3], const double p2[3], double *split, const double plane[4]); - - PlaneTriResult fm_getSidePlane(const float p[3], const float plane[4], float epsilon); - PlaneTriResult fm_getSidePlane(const double p[3], const double plane[4], double epsilon); - - - void fm_computeBestFitOBB(uint32_t vcount, const float *points, uint32_t pstride, float *sides, float matrix[16], bool bruteForce = true); - void fm_computeBestFitOBB(uint32_t vcount, const double *points, uint32_t pstride, double *sides, double matrix[16], bool bruteForce = true); - - void fm_computeBestFitOBB(uint32_t vcount, const float *points, uint32_t pstride, float *sides, float pos[3], float quat[4], bool bruteForce = true); - void fm_computeBestFitOBB(uint32_t vcount, const double *points, uint32_t pstride, double *sides, double pos[3], double quat[4], bool bruteForce = true); - - void fm_computeBestFitABB(uint32_t vcount, const float *points, uint32_t pstride, float *sides, float pos[3]); - void fm_computeBestFitABB(uint32_t vcount, const double *points, uint32_t pstride, double *sides, double pos[3]); - - - //** Note, if the returned capsule height is less than zero, then you must represent it is a sphere of size radius. - void fm_computeBestFitCapsule(uint32_t vcount, const float *points, uint32_t pstride, float &radius, float &height, float matrix[16], bool bruteForce = true); - void fm_computeBestFitCapsule(uint32_t vcount, const double *points, uint32_t pstride, float &radius, float &height, double matrix[16], bool bruteForce = true); - - - void fm_planeToMatrix(const float plane[4], float matrix[16]); // convert a plane equation to a 4x4 rotation matrix. Reference vector is 0,1,0 - void fm_planeToQuat(const float plane[4], float quat[4], float pos[3]); // convert a plane equation to a quaternion and translation - - void fm_planeToMatrix(const double plane[4], double matrix[16]); // convert a plane equation to a 4x4 rotation matrix - void fm_planeToQuat(const double plane[4], double quat[4], double pos[3]); // convert a plane equation to a quaternion and translation - - inline void fm_doubleToFloat3(const double p[3], float t[3]) { t[0] = (float)p[0]; t[1] = (float)p[1]; t[2] = (float)p[2]; } - inline void fm_floatToDouble3(const float p[3], double t[3]) { t[0] = (double)p[0]; t[1] = (double)p[1]; t[2] = (double)p[2]; } - - - void fm_eulerMatrix(float ax, float ay, float az, float matrix[16]); // convert euler (in radians) to a dest 4x4 matrix (translation set to zero) - void fm_eulerMatrix(double ax, double ay, double az, double matrix[16]); // convert euler (in radians) to a dest 4x4 matrix (translation set to zero) - - - float fm_computeMeshVolume(const float *vertices, uint32_t tcount, const uint32_t *indices); - double fm_computeMeshVolume(const double *vertices, uint32_t tcount, const uint32_t *indices); - - -#define FM_DEFAULT_GRANULARITY 0.001f // 1 millimeter is the default granularity - - class fm_VertexIndex - { - public: - virtual ~fm_VertexIndex() {} - virtual uint32_t getIndex(const float pos[3], bool &newPos) = 0; // get welded index for this float vector[3] - virtual uint32_t getIndex(const double pos[3], bool &newPos) = 0; // get welded index for this double vector[3] - virtual const float * getVerticesFloat(void) const = 0; - virtual const double * getVerticesDouble(void) const = 0; - virtual const float * getVertexFloat(uint32_t index) const = 0; - virtual const double * getVertexDouble(uint32_t index) const = 0; - virtual uint32_t getVcount(void) const = 0; - virtual bool isDouble(void) const = 0; - virtual bool saveAsObj(const char *fname, uint32_t tcount, uint32_t *indices) = 0; - }; - - fm_VertexIndex * fm_createVertexIndex(double granularity, bool snapToGrid); // create an indexed vertex system for doubles - fm_VertexIndex * fm_createVertexIndex(float granularity, bool snapToGrid); // create an indexed vertext system for floats - void fm_releaseVertexIndex(fm_VertexIndex *vindex); - - - class fm_Triangulate - { - public: - virtual ~fm_Triangulate() {} - virtual const double * triangulate3d(uint32_t pcount, - const double *points, - uint32_t vstride, - uint32_t &tcount, - bool consolidate, - double epsilon) = 0; - - virtual const float * triangulate3d(uint32_t pcount, - const float *points, - uint32_t vstride, - uint32_t &tcount, - bool consolidate, - float epsilon) = 0; - }; - - fm_Triangulate * fm_createTriangulate(void); - void fm_releaseTriangulate(fm_Triangulate *t); - - - const float * fm_getPoint(const float *points, uint32_t pstride, uint32_t index); - const double * fm_getPoint(const double *points, uint32_t pstride, uint32_t index); - - bool fm_insideTriangle(float Ax, float Ay, float Bx, float By, float Cx, float Cy, float Px, float Py); - bool fm_insideTriangle(double Ax, double Ay, double Bx, double By, double Cx, double Cy, double Px, double Py); - float fm_areaPolygon2d(uint32_t pcount, const float *points, uint32_t pstride); - double fm_areaPolygon2d(uint32_t pcount, const double *points, uint32_t pstride); - - bool fm_pointInsidePolygon2d(uint32_t pcount, const float *points, uint32_t pstride, const float *point, uint32_t xindex = 0, uint32_t yindex = 1); - bool fm_pointInsidePolygon2d(uint32_t pcount, const double *points, uint32_t pstride, const double *point, uint32_t xindex = 0, uint32_t yindex = 1); - - uint32_t fm_consolidatePolygon(uint32_t pcount, const float *points, uint32_t pstride, float *dest, float epsilon = 0.999999f); // collapses co-linear edges. - uint32_t fm_consolidatePolygon(uint32_t pcount, const double *points, uint32_t pstride, double *dest, double epsilon = 0.999999); // collapses co-linear edges. - - - bool fm_computeSplitPlane(uint32_t vcount, const double *vertices, uint32_t tcount, const uint32_t *indices, double *plane); - bool fm_computeSplitPlane(uint32_t vcount, const float *vertices, uint32_t tcount, const uint32_t *indices, float *plane); - - void fm_nearestPointInTriangle(const float *pos, const float *p1, const float *p2, const float *p3, float *nearest); - void fm_nearestPointInTriangle(const double *pos, const double *p1, const double *p2, const double *p3, double *nearest); - - float fm_areaTriangle(const float *p1, const float *p2, const float *p3); - double fm_areaTriangle(const double *p1, const double *p2, const double *p3); - - void fm_subtract(const float *A, const float *B, float *diff); // compute A-B and store the result in 'diff' - void fm_subtract(const double *A, const double *B, double *diff); // compute A-B and store the result in 'diff' - - void fm_multiply(float *A, float scaler); - void fm_multiply(double *A, double scaler); - - void fm_add(const float *A, const float *B, float *sum); - void fm_add(const double *A, const double *B, double *sum); - - void fm_copy3(const float *source, float *dest); - void fm_copy3(const double *source, double *dest); - - // re-indexes an indexed triangle mesh but drops unused vertices. The output_indices can be the same pointer as the input indices. - // the output_vertices can point to the input vertices if you desire. The output_vertices buffer should be at least the same size - // is the input buffer. The routine returns the new vertex count after re-indexing. - uint32_t fm_copyUniqueVertices(uint32_t vcount, const float *input_vertices, float *output_vertices, uint32_t tcount, const uint32_t *input_indices, uint32_t *output_indices); - uint32_t fm_copyUniqueVertices(uint32_t vcount, const double *input_vertices, double *output_vertices, uint32_t tcount, const uint32_t *input_indices, uint32_t *output_indices); - - bool fm_isMeshCoplanar(uint32_t tcount, const uint32_t *indices, const float *vertices, bool doubleSided); // returns true if this collection of indexed triangles are co-planar! - bool fm_isMeshCoplanar(uint32_t tcount, const uint32_t *indices, const double *vertices, bool doubleSided); // returns true if this collection of indexed triangles are co-planar! - - bool fm_samePlane(const float p1[4], const float p2[4], float normalEpsilon = 0.01f, float dEpsilon = 0.001f, bool doubleSided = false); // returns true if these two plane equations are identical within an epsilon - bool fm_samePlane(const double p1[4], const double p2[4], double normalEpsilon = 0.01, double dEpsilon = 0.001, bool doubleSided = false); - - void fm_OBBtoAABB(const float obmin[3], const float obmax[3], const float matrix[16], float abmin[3], float abmax[3]); - - // a utility class that will tessellate a mesh. - class fm_Tesselate - { - public: - virtual ~fm_Tesselate() {} - virtual const uint32_t * tesselate(fm_VertexIndex *vindex, uint32_t tcount, const uint32_t *indices, float longEdge, uint32_t maxDepth, uint32_t &outcount) = 0; - }; - - fm_Tesselate * fm_createTesselate(void); - void fm_releaseTesselate(fm_Tesselate *t); - - void fm_computeMeanNormals(uint32_t vcount, // the number of vertices - const float *vertices, // the base address of the vertex position data. - uint32_t vstride, // the stride between position data. - float *normals, // the base address of the destination for mean vector normals - uint32_t nstride, // the stride between normals - uint32_t tcount, // the number of triangles - const uint32_t *indices); // the triangle indices - - void fm_computeMeanNormals(uint32_t vcount, // the number of vertices - const double *vertices, // the base address of the vertex position data. - uint32_t vstride, // the stride between position data. - double *normals, // the base address of the destination for mean vector normals - uint32_t nstride, // the stride between normals - uint32_t tcount, // the number of triangles - const uint32_t *indices); // the triangle indices - - - bool fm_isValidTriangle(const float *p1, const float *p2, const float *p3, float epsilon = 0.00001f); - bool fm_isValidTriangle(const double *p1, const double *p2, const double *p3, double epsilon = 0.00001f); - - - } // end of namespace -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdCircularList.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdCircularList.h deleted file mode 100644 index 575881f216..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdCircularList.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#pragma once -#ifndef ND_VHACD_CIRCULAR_LIST_H -#define ND_VHACD_CIRCULAR_LIST_H -#include "vhacdDefines.h" - -namespace nd_ -{ - namespace VHACD - { - //! CircularListElement class. - template - class CircularListElement { - public: - T& GetData() { return m_data; } - const T& GetData() const { return m_data; } - CircularListElement*& GetNext() { return m_next; } - CircularListElement*& GetPrev() { return m_prev; } - const CircularListElement*& GetNext() const { return m_next; } - const CircularListElement*& GetPrev() const { return m_prev; } - //! Constructor - CircularListElement(const T& data) { m_data = data; } - CircularListElement(void) {} - //! Destructor - ~CircularListElement(void) {} - private: - T m_data; - CircularListElement* m_next; - CircularListElement* m_prev; - - CircularListElement(const CircularListElement& rhs); - }; - //! CircularList class. - template - class CircularList { - public: - CircularListElement*& GetHead() { return m_head; } - const CircularListElement* GetHead() const { return m_head; } - bool IsEmpty() const { return (m_size == 0); } - size_t GetSize() const { return m_size; } - const T& GetData() const { return m_head->GetData(); } - T& GetData() { return m_head->GetData(); } - bool Delete(); - bool Delete(CircularListElement* element); - CircularListElement* Add(const T* data = 0); - CircularListElement* Add(const T& data); - bool Next(); - bool Prev(); - void Clear() - { - while (Delete()) - ; - } - const CircularList& operator=(const CircularList& rhs); - //! Constructor - CircularList() - { - m_head = 0; - m_size = 0; - } - CircularList(const CircularList& rhs); - //! Destructor - ~CircularList(void) { Clear(); } - private: - CircularListElement* m_head; //!< a pointer to the head of the circular list - size_t m_size; //!< number of element in the circular list - }; - } -} -#include "vhacdCircularList.inl" -#endif // VHACD_CIRCULAR_LIST_H diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdCircularList.inl b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdCircularList.inl deleted file mode 100644 index f5b44179c9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdCircularList.inl +++ /dev/null @@ -1,162 +0,0 @@ -#pragma once -#ifndef ND_HACD_CIRCULAR_LIST_INL -#define ND_HACD_CIRCULAR_LIST_INL -namespace nd_ -{ - namespace VHACD - { - template < typename T > - inline bool CircularList::Delete(CircularListElement * element) - { - if (!element) - { - return false; - } - if (m_size > 1) - { - CircularListElement * next = element->GetNext(); - CircularListElement * prev = element->GetPrev(); - delete element; - m_size--; - if (element == m_head) - { - m_head = next; - } - next->GetPrev() = prev; - prev->GetNext() = next; - return true; - } - else if (m_size == 1) - { - delete m_head; - m_size--; - m_head = 0; - return true; - } - else - { - return false; - } - } - - template < typename T > - inline bool CircularList::Delete() - { - if (m_size > 1) - { - CircularListElement * next = m_head->GetNext(); - CircularListElement * prev = m_head->GetPrev(); - delete m_head; - m_size--; - m_head = next; - next->GetPrev() = prev; - prev->GetNext() = next; - return true; - } - else if (m_size == 1) - { - delete m_head; - m_size--; - m_head = 0; - return true; - } - else - { - return false; - } - } - template < typename T > - inline CircularListElement * CircularList::Add(const T * data) - { - if (m_size == 0) - { - if (data) - { - m_head = new CircularListElement(*data); - } - else - { - m_head = new CircularListElement(); - } - m_head->GetNext() = m_head->GetPrev() = m_head; - } - else - { - CircularListElement * next = m_head->GetNext(); - CircularListElement * element = m_head; - if (data) - { - m_head = new CircularListElement(*data); - } - else - { - m_head = new CircularListElement(); - } - m_head->GetNext() = next; - m_head->GetPrev() = element; - element->GetNext() = m_head; - next->GetPrev() = m_head; - } - m_size++; - return m_head; - } - template < typename T > - inline CircularListElement * CircularList::Add(const T & data) - { - const T * pData = &data; - return Add(pData); - } - template < typename T > - inline bool CircularList::Next() - { - if (m_size == 0) - { - return false; - } - m_head = m_head->GetNext(); - return true; - } - template < typename T > - inline bool CircularList::Prev() - { - if (m_size == 0) - { - return false; - } - m_head = m_head->GetPrev(); - return true; - } - template < typename T > - inline CircularList::CircularList(const CircularList& rhs) - { - if (rhs.m_size > 0) - { - CircularListElement * current = rhs.m_head; - do - { - current = current->GetNext(); - Add(current->GetData()); - } while (current != rhs.m_head); - } - } - template < typename T > - inline const CircularList& CircularList::operator=(const CircularList& rhs) - { - if (&rhs != this) - { - Clear(); - if (rhs.m_size > 0) - { - CircularListElement * current = rhs.m_head; - do - { - current = current->GetNext(); - Add(current->GetData()); - } while (current != rhs.m_head); - } - } - return (*this); - } - } -} -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdConvexHull.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdConvexHull.h deleted file mode 100644 index e630cb87f9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdConvexHull.h +++ /dev/null @@ -1,139 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONVEXHULL_3D__ -#define __ND_CONVEXHULL_3D__ - -#include "vhacdDefines.h" -#include "vhacdConvexHullUtils.h" - -namespace nd_ -{ - namespace VHACD - { - #define VHACD_CONVEXHULL_3D_VERTEX_CLUSTER_SIZE 16 - - class ConvexHullVertex : public hullVector - { - public: - int m_mark; - }; - - class ConvexHullAABBTreeNode - { - public: - ConvexHullAABBTreeNode() - :m_left(nullptr) - ,m_right(nullptr) - ,m_parent(nullptr) - { - } - - ConvexHullAABBTreeNode(ConvexHullAABBTreeNode* const parent) - :m_left(nullptr) - ,m_right(nullptr) - ,m_parent(parent) - { - } - - hullVector m_box[2]; - ConvexHullAABBTreeNode* m_left; - ConvexHullAABBTreeNode* m_right; - ConvexHullAABBTreeNode* m_parent; - }; - - class ConvexHull3dPointCluster : public ConvexHullAABBTreeNode - { - public: - ConvexHull3dPointCluster() - :ConvexHullAABBTreeNode() - { - } - - ConvexHull3dPointCluster(ConvexHullAABBTreeNode* const parent) - :ConvexHullAABBTreeNode(parent) - { - } - - int m_count; - int m_indices[VHACD_CONVEXHULL_3D_VERTEX_CLUSTER_SIZE]; - }; - - class ConvexHull3dPointSet: public std::vector - { - public: - ConvexHull3dPointSet(); - ConvexHull3dPointSet(const double* const vertexCloud, int strideInBytes, int count); - ConvexHullAABBTreeNode* BuildAccelerator(); - - private: - ConvexHullAABBTreeNode* BuildRecurse(ConvexHullAABBTreeNode* const parent, ConvexHullVertex* const points, int count, int baseIndex, size_t& memoryPool); - std::vector m_treeBuffer; - //ConvexHullAABBTreeNode* m_tree; - }; - - class ConvexHullFace - { - public: - ConvexHullFace(); - double Evalue(const hullVector* const pointArray, const hullVector& point) const; - hullPlane GetPlaneEquation(const hullVector* const pointArray, bool& isValid) const; - - public: - int m_index[3]; - - private: - int m_mark; - List::ndNode* m_twin[3]; - - friend class ConvexHull; - }; - - class ConvexHull : public List - { - class ndNormalMap; - - public: - ConvexHull(ConvexHull3dPointSet& accelerator, double distTol, int maxVertexCount = 0x7fffffff); - ConvexHull(const double* const vertexCloud, int strideInBytes, int count, double distTol, int maxVertexCount = 0x7fffffff); - ~ConvexHull(); - - const std::vector& GetVertexPool() const; - - private: - ConvexHullAABBTreeNode* InitVertexArray(ConvexHull3dPointSet& accelerator); - void BuildHull(ConvexHull3dPointSet& accelerator, double distTol, int maxVertexCount); - - ndNode* AddFace(int i0, int i1, int i2); - - void CalculateConvexHull3d(ConvexHullAABBTreeNode* vertexTree, std::vector& points, int count, double distTol, int maxVertexCount); - - size_t SupportVertex(ConvexHullAABBTreeNode** const tree, const std::vector& points, const hullVector& dir, const bool removeEntry = true) const; - double TetrahedrumVolume(const hullVector& p0, const hullVector& p1, const hullVector& p2, const hullVector& p3) const; - - hullVector m_aabbP0; - hullVector m_aabbP1; - double m_diag; - std::vector m_points; - }; - } -} -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdConvexHullUtils.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdConvexHullUtils.h deleted file mode 100644 index f919d92ec5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdConvexHullUtils.h +++ /dev/null @@ -1,1020 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __ND_CONVEXHULL_3D_UTILS__ -#define __ND_CONVEXHULL_3D_UTILS__ - -#include "vhacdDefines.h" -#include "vhacdVector.h" - -#ifndef _ASSERT -#define _ASSERT(x) -#endif - -namespace nd_ -{ - namespace VHACD - { - #define VHACD_GOOGOL_SIZE 4 - #define VHACD_WORKERS_THREADS 4 - //#define VHACD_WORKERS_THREADS 1 - - class Googol; - Googol Determinant2x2(const Googol matrix[2][2]); - Googol Determinant3x3(const Googol matrix[3][3]); - double Determinant2x2(const double matrix[2][2], double* const error); - double Determinant3x3(const double matrix[3][3], double* const error); - - inline int dExp2(int x) - { - int exp; - for (exp = -1; x; x >>= 1) - { - exp++; - } - return exp; - } - - inline int dBitReversal(int v, int base) - { - int x = 0; - int power = dExp2(base) - 1; - do - { - x += (v & 1) << power; - v >>= 1; - power--; - } while (v); - return x; - } - - template - inline T Min(T A, T B) - { - return (A < B) ? A : B; - } - - template - inline T Max(T A, T B) - { - return (A > B) ? A : B; - } - - template - inline void Swap(T& A, T& B) - { - T tmp(A); - A = B; - B = tmp; - } - - - template - class ndHeap - { - public: - ndHeap(int maxElements); - ndHeap(const void* const buffer, int sizeInBytes); - ~ndHeap(); - - void Flush(); - dKey MaxValue() const; - dKey Value(int i = 0) const; - int GetCount() const; - int GetMaxCount() const; - const dItem& operator[] (int i) const; - int Find(dItem& obj); - int Find(dKey key); - - void Pop(); - void Sort(); - void Remove(int Index); - void Push(dItem& obj, dKey key); - - protected: - struct dRecord - { - dRecord() - { - } - - dRecord(dKey key, const dItem& obj) - :m_key(key) - ,m_obj(obj) - { - } - - dKey m_key; - dItem m_obj; - }; - - dRecord* m_pool; - int m_curCount; - int m_maxCount; - bool m_bufferIsOwnned; - }; - - - // ************************* - // - // implementation - // - // ************************* - - template - ndHeap::ndHeap(int maxElements) - :m_pool(new dRecord[size_t(maxElements)]) - ,m_curCount(0) - ,m_maxCount(maxElements) - ,m_bufferIsOwnned(true) - { - Flush(); - } - - template - ndHeap::ndHeap(const void* const buffer, int sizeInBytes) - :m_pool((dRecord*)buffer) - ,m_curCount(0) - ,m_maxCount(int(sizeInBytes / sizeof(dRecord))) - ,m_bufferIsOwnned(false) - { - Flush(); - } - - template - ndHeap::~ndHeap() - { - if (m_bufferIsOwnned) - { - //ndMemory::Free(m_pool); - delete[] m_pool; - } - } - - template - dKey ndHeap::Value(int i) const - { - return m_pool[i].m_key; - } - - template - int ndHeap::GetCount() const - { - return m_curCount; - } - - template - void ndHeap::Flush() - { - m_curCount = 0; - } - - template - dKey ndHeap::MaxValue() const - { - return m_pool[0].m_key; - } - - template - int ndHeap::GetMaxCount() const - { - return m_maxCount; - } - - template - int ndHeap::Find(dItem& obj) - { - // For now let perform a linear search - // this is efficient if the size of the heap is small - // ex: m_curCount < 32 - // this will be change to a binary search in the heap should the - // the size of the heap get larger than 32 - for (int i = 0; i < m_curCount; i++) - { - if (m_pool[i].obj == obj) - { - return i; - } - } - return -1; - } - - template - int ndHeap::Find(dKey key) - { - // ex: m_curCount < 32 - // this will be change to a binary search in the heap should the - // the size of the heap get larger than 32 - for (int i = 0; i < m_curCount; i++) - { - if (m_pool[i].m_key == key) - { - return i; - } - } - return -1; - } - - template - const dItem& ndHeap::operator[] (int i) const - { - return m_pool[i].m_obj; - } - - template - void ndHeap::Push(dItem& obj, dKey key) - { - ndHeap::m_curCount++; - - int i = ndHeap::m_curCount; - for (int j = 0; i; i = j) - { - j = i >> 1; - if (!j || (ndHeap::m_pool[j - 1].m_key > key)) - { - break; - } - ndHeap::m_pool[i - 1] = ndHeap::m_pool[j - 1]; - } - ndHeap::m_pool[i - 1].m_key = key; - ndHeap::m_pool[i - 1].m_obj = obj; - } - - template - void ndHeap::Pop() - { - Remove(0); - } - - template - void ndHeap::Remove(int index) - { - ndHeap::m_curCount--; - ndHeap::m_pool[index] = ndHeap::m_pool[ndHeap::m_curCount]; - while (index && ndHeap::m_pool[(index - 1) >> 1].m_key < ndHeap::m_pool[index].m_key) - { - Swap(ndHeap::m_pool[(index - 1) >> 1], ndHeap::m_pool[index]); - index = (index - 1) >> 1; - } - - while ((2 * index + 1) < ndHeap::m_curCount) - { - int i0 = 2 * index + 1; - int i1 = 2 * index + 2; - if (i1 < ndHeap::m_curCount) - { - i0 = (ndHeap::m_pool[i0].m_key > ndHeap::m_pool[i1].m_key) ? i0 : i1; - if (ndHeap::m_pool[i0].m_key <= ndHeap::m_pool[index].m_key) - { - break; - } - Swap(ndHeap::m_pool[i0], ndHeap::m_pool[index]); - index = i0; - } - else - { - if (ndHeap::m_pool[i0].m_key > ndHeap::m_pool[index].m_key) - { - Swap(ndHeap::m_pool[i0], ndHeap::m_pool[index]); - } - index = i0; - } - } - } - - template - void ndHeap::Sort() - { - int count = ndHeap::m_curCount; - for (int i = 1; i < count; i++) - { - dKey key(ndHeap::m_pool[0].m_key); - dItem obj(ndHeap::m_pool[0].m_obj); - - Pop(); - - ndHeap::m_pool[ndHeap::m_curCount].m_key = key; - ndHeap::m_pool[ndHeap::m_curCount].m_obj = obj; - } - - ndHeap::m_curCount = count; - for (int i = 0; i < count / 2; i++) - { - dKey key(ndHeap::m_pool[i].m_key); - dItem obj(ndHeap::m_pool[i].m_obj); - - ndHeap::m_pool[i].m_key = ndHeap::m_pool[count - i - 1].m_key; - ndHeap::m_pool[i].m_obj = ndHeap::m_pool[count - i - 1].m_obj; - - ndHeap::m_pool[count - i - 1].m_key = key; - ndHeap::m_pool[count - i - 1].m_obj = obj; - } - } - - // ***************************************** - // - // two typical instances of heaps, up and down. - // - // ***************************************** - template - class ndDownHeapCompare - { - public: - ndDownHeapCompare() - { - } - - ndDownHeapCompare(dKey key) - :m_key(key) - { - } - - bool operator> (const ndDownHeapCompare& key) const - { - return m_key > key.m_key; - } - - bool operator< (const ndDownHeapCompare& key) const - { - return m_key < key.m_key; - } - - bool operator<= (const ndDownHeapCompare& key) const - { - return m_key <= key.m_key; - } - - dKey m_key; - }; - - template - class ndDownHeap : public ndHeap > - { - public: - ndDownHeap(int maxElements) - :ndHeap>(maxElements) - { - } - - ndDownHeap(const void* const buffer, int sizeInBytes) - :ndHeap>(buffer, sizeInBytes) - { - } - - dKey Value(int i = 0) const - { - const ndDownHeapCompare key(ndHeap>::Value(i)); - return key.m_key; - } - }; - - - template - class ndUpHeapCompare - { - public: - ndUpHeapCompare() - { - } - - ndUpHeapCompare(dKey key) - :m_key(key) - { - } - - bool operator> (const ndUpHeapCompare& key) const - { - return m_key < key.m_key; - } - - bool operator< (const ndUpHeapCompare& key) const - { - return m_key > key.m_key; - } - - bool operator<= (const ndUpHeapCompare& key) const - { - return m_key >= key.m_key; - } - - dKey m_key; - }; - - template - class ndUpHeap : public ndHeap > - { - public: - ndUpHeap(int maxElements) - :ndHeap>(maxElements) - { - } - - ndUpHeap(const void* const buffer, int sizeInBytes) - :ndHeap>(buffer, sizeInBytes) - { - } - - dKey Value(int i = 0) const - { - const ndUpHeapCompare key(ndHeap>::Value(i)); - return key.m_key; - } - }; - - - template - class List - { - public: - class ndNode - { - ndNode(ndNode* const prev, ndNode* const next) - :m_info() - , m_next(next) - , m_prev(prev) - { - if (m_prev) - { - m_prev->m_next = this; - } - if (m_next) - { - m_next->m_prev = this; - } - } - - ndNode(const T &info, ndNode* const prev, ndNode* const next) - :m_info(info) - ,m_next(next) - ,m_prev(prev) - { - if (m_prev) - { - m_prev->m_next = this; - } - if (m_next) - { - m_next->m_prev = this; - } - } - - ~ndNode() - { - } - - void Unlink() - { - if (m_prev) - { - m_prev->m_next = m_next; - } - if (m_next) - { - m_next->m_prev = m_prev; - } - m_prev = nullptr; - m_next = nullptr; - } - - void AddLast(ndNode* const node) - { - m_next = node; - node->m_prev = this; - } - - void AddFirst(ndNode* const node) - { - m_prev = node; - node->m_next = this; - } - - public: - T& GetInfo() - { - return m_info; - } - - ndNode *GetNext() const - { - return m_next; - } - - ndNode *GetPrev() const - { - return m_prev; - } - - private: - T m_info; - ndNode *m_next; - ndNode *m_prev; - friend class List; - }; - - public: - List() - :m_first(nullptr) - , m_last(nullptr) - , m_count(0) - { - } - - ~List() - { - RemoveAll(); - } - - void RemoveAll() - { - for (ndNode *node = m_first; node; node = m_first) - { - m_count--; - m_first = node->GetNext(); - node->Unlink(); - delete node; - } - m_last = nullptr; - m_first = nullptr; - } - - ndNode* Append() - { - m_count++; - if (m_first == nullptr) - { - m_first = new ndNode(nullptr, nullptr); - m_last = m_first; - } - else - { - m_last = new ndNode(m_last, nullptr); - } - return m_last; - } - - ndNode* Append(const T &element) - { - m_count++; - if (m_first == nullptr) - { - m_first = new ndNode(element, nullptr, nullptr); - m_last = m_first; - } - else - { - m_last = new ndNode(element, m_last, nullptr); - } - return m_last; - } - - ndNode* Addtop(const T &element) - { - m_count++; - if (m_last == nullptr) - { - m_last = new ndNode(element, nullptr, nullptr); - m_first = m_last; - } - else - { - m_first = new ndNode(element, nullptr, m_first); - } - return m_first; - } - - int GetCount() const - { - return m_count; - } - - //operator int() const; - - ndNode* GetLast() const - { - return m_last; - } - - ndNode* GetFirst() const - { - return m_first; - } - - void Remove(ndNode* const node) - { - Unlink(node); - delete node; - } - - void Unlink(ndNode* const node) - { - m_count--; - if (node == m_first) - { - m_first = m_first->GetNext(); - } - if (node == m_last) - { - m_last = m_last->GetPrev(); - } - node->Unlink(); - } - - void Remove(const T &element) - { - ndNode *const node = Find(element); - if (node) - { - Remove(node); - } - } - - ndNode* Find(const T &element) const - { - ndNode *node; - for (node = m_first; node; node = node->GetNext()) - { - if (element == node->m_info) - { - break; - } - } - return node; - } - - private: - ndNode* m_first; - ndNode* m_last; - int m_count; - friend class ndNode; - }; - - class hullVector : public VHACD::Vec3 - { - public: - hullVector() - :Vec3(0, 0, 0) - { - } - - hullVector(double x) - :Vec3(x, x, x) - { - } - - hullVector(const hullVector& x) - :Vec3(x.X(), x.Y(), x.Z()) - { - } - - hullVector(double x, double y, double z, double) - :Vec3(x, y, z) - { - } - - hullVector GetMin(const hullVector& p) const - { - return hullVector( - X() < p.X() ? X() : p.X(), - Y() < p.Y() ? Y() : p.Y(), - Z() < p.Z() ? Z() : p.Z(), 0.0); - } - - hullVector GetMax(const hullVector& p) const - { - return hullVector( - X() > p.X() ? X() : p.X(), - Y() > p.Y() ? Y() : p.Y(), - Z() > p.Z() ? Z() : p.Z(), 0.0); - } - - hullVector Scale(double s) const - { - return hullVector(X() * s, Y() * s, Z() * s, 0.0); - } - - inline hullVector operator+(const hullVector & rhs) const - { - return hullVector(X() + rhs.X(), Y() + rhs.Y(), Z() + rhs.Z(), 0.0f); - } - - inline hullVector operator-(const hullVector & rhs) const - { - return hullVector(X() - rhs.X(), Y() - rhs.Y(), Z() - rhs.Z(), 0.0f); - } - - inline hullVector operator*(const hullVector & rhs) const - { - return hullVector(X() * rhs.X(), Y() * rhs.Y(), Z() * rhs.Z(), 0.0f); - } - - inline double DotProduct(const hullVector & rhs) const - { - return X() * rhs.X() + Y() * rhs.Y() + Z() * rhs.Z(); - } - - inline hullVector CrossProduct(const hullVector & rhs) const - { - return hullVector(Y() * rhs.Z() - Z() * rhs.Y(), Z() * rhs.X() - X() * rhs.Z(), X() * rhs.Y() - Y() * rhs.X(), 0.0); - } - - inline hullVector operator= (const Vec3 & rhs) - { - X() = rhs.X(); - Y() = rhs.Y(); - Z() = rhs.Z(); - return *this; - } - - inline hullVector& operator= (const hullVector& rhs) - { - X() = rhs.X(); - Y() = rhs.Y(); - Z() = rhs.Z(); - return *this; - } - - }; - - class hullPlane : public hullVector - { - public: - hullPlane(const hullPlane& src) - :hullVector(src) - ,m_w(src.m_w) - { - } - - hullPlane(double x, double y, double z, double w) - :hullVector(x, y, z, 0.0) - , m_w(w) - { - } - - hullPlane(const hullVector &P0, const hullVector &P1, const hullVector &P2) - :hullVector((P1 - P0).CrossProduct(P2 - P0)) - { - m_w = -DotProduct(P0); - } - - hullPlane Scale(double s) const - { - return hullPlane(X() * s, Y() * s, Z() * s, m_w * s); - } - - inline hullPlane operator= (const hullPlane &rhs) - { - X() = rhs.X(); - Y() = rhs.Y(); - Z() = rhs.Z(); - m_w = rhs.m_w; - return *this; - } - - inline hullVector operator*(const hullVector & rhs) const - { - return hullVector(X() * rhs.X(), Y() * rhs.Y(), Z() * rhs.Z(), 0.0f); - } - - double Evalue(const hullVector &point) const - { - return DotProduct(point) + m_w; - } - - double m_w; - }; - - class Googol - { - public: - Googol(void); - Googol(double value); - - operator double() const; - Googol operator+ (const Googol &A) const; - Googol operator- (const Googol &A) const; - Googol operator* (const Googol &A) const; - Googol operator/ (const Googol &A) const; - - Googol operator+= (const Googol &A); - Googol operator-= (const Googol &A); - - bool operator> (const Googol &A) const; - bool operator>= (const Googol &A) const; - bool operator< (const Googol &A) const; - bool operator<= (const Googol &A) const; - bool operator== (const Googol &A) const; - bool operator!= (const Googol &A) const; - - Googol Abs() const; - Googol Sqrt() const; - Googol InvSqrt() const; - Googol Floor() const; - - void Trace() const; - void ToString(char* const string) const; - - private: - void InitFloatFloat(double value); - void NegateMantissa(uint64_t* const mantissa) const; - void CopySignedMantissa(uint64_t* const mantissa) const; - int NormalizeMantissa(uint64_t* const mantissa) const; - uint64_t CheckCarrier(uint64_t a, uint64_t b) const; - void ShiftRightMantissa(uint64_t* const mantissa, int bits) const; - - int LeadingZeros(uint64_t a) const; - void ExtendeMultiply(uint64_t a, uint64_t b, uint64_t& high, uint64_t& low) const; - void ScaleMantissa(uint64_t* const out, uint64_t scale) const; - - int m_sign; - int m_exponent; - uint64_t m_mantissa[VHACD_GOOGOL_SIZE]; - - public: - static Googol m_zero; - static Googol m_one; - static Googol m_two; - static Googol m_three; - static Googol m_half; - }; - - template - void Sort(T* const array, int elements) - { - const int batchSize = 8; - int stack[1024][2]; - - stack[0][0] = 0; - stack[0][1] = elements - 1; - int stackIndex = 1; - const dCompareKey comparator; - while (stackIndex) - { - stackIndex--; - int lo = stack[stackIndex][0]; - int hi = stack[stackIndex][1]; - if ((hi - lo) > batchSize) - { - int mid = (lo + hi) >> 1; - if (comparator.Compare(array[lo], array[mid]) > 0) - { - Swap(array[lo], array[mid]); - } - if (comparator.Compare(array[mid], array[hi]) > 0) - { - Swap(array[mid], array[hi]); - } - if (comparator.Compare(array[lo], array[mid]) > 0) - { - Swap(array[lo], array[mid]); - } - int i = lo + 1; - int j = hi - 1; - const T pivot(array[mid]); - do - { - while (comparator.Compare(array[i], pivot) < 0) - { - i++; - } - while (comparator.Compare(array[j], pivot) > 0) - { - j--; - } - - if (i <= j) - { - Swap(array[i], array[j]); - i++; - j--; - } - } while (i <= j); - - if (i < hi) - { - stack[stackIndex][0] = i; - stack[stackIndex][1] = hi; - stackIndex++; - } - if (lo < j) - { - stack[stackIndex][0] = lo; - stack[stackIndex][1] = j; - stackIndex++; - } - _ASSERT(stackIndex < int(sizeof(stack) / (2 * sizeof(stack[0][0])))); - } - } - - int stride = batchSize + 1; - if (elements < stride) - { - stride = elements; - } - for (int i = 1; i < stride; ++i) - { - if (comparator.Compare(array[0], array[i]) > 0) - { - Swap(array[0], array[i]); - } - } - - for (int i = 1; i < elements; ++i) - { - int j = i; - const T tmp(array[i]); - for (; comparator.Compare(array[j - 1], tmp) > 0; --j) - { - _ASSERT(j > 0); - array[j] = array[j - 1]; - } - array[j] = tmp; - } - - #if 0 - for (int i = 0; i < (elements - 1); ++i) - { - _ASSERT(comparator.Compare(array[i], array[i + 1], context) <= 0); - } - #endif - } - - class Job - { - public: - Job() - { - } - - Job(const Job&) - { - } - - virtual ~Job() - { - } - - virtual void Execute(int threadId) = 0; - }; - - class Semaphore - { - public: - Semaphore(); - ~Semaphore(); - bool Wait(); - void Signal(); - void Terminate(); - - int m_count; - std::mutex m_mutex; - std::condition_variable m_condition; - std::atomic m_terminate; - }; - - class Queue; - class Thread : public Semaphore, public std::thread - { - public: - Thread(); - ~Thread(); - void ThreadFunctionCallback(); - - int m_threadID; - Queue* m_queue; - }; - - class Queue : public List - { - public: - Queue(); - ~Queue(); - - void Sync(); - Job* PopTask(); - void PushTask(Job* const job); - - std::mutex m_mutex; - std::atomic m_jobs; - Thread m_threads[VHACD_WORKERS_THREADS]; - }; - } -} -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdDefines.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdDefines.h deleted file mode 100644 index e08945bc27..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdDefines.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef ND_VHACD_DWEFINES_H -#define ND_VHACD_DWEFINES_H - - -#ifdef _WIN32 - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - #endif - #include -#elif __MACH__ - #include - #include -#else - #include - #include - #include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdICHull.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdICHull.h deleted file mode 100644 index 539d2f54df..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdICHull.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#pragma once -#ifndef ND_VHACD_ICHULL_H -#define ND_VHACD_ICHULL_H - -#include "vhacdDefines.h" -#include "vhacdManifoldMesh.h" -#include "vhacdVector.h" - -#if (defined (__linux__ ) || defined (__MINGW32__) || defined (__MINGW64__)) - #include -#endif - -namespace nd_ -{ - namespace VHACD - { - //! Incremental Convex Hull algorithm (cf. http://cs.smith.edu/~orourke/books/ftp.html ). - enum ICHullError { - ICHullErrorOK = 0, - ICHullErrorCoplanarPoints, - ICHullErrorNoVolume, - ICHullErrorInconsistent, - ICHullErrorNotEnoughPoints - }; - class ICHull { - public: - static const double sc_eps; - //! - bool IsFlat() { return m_isFlat; } - //! Returns the computed mesh - TMMesh& GetMesh() { return m_mesh; } - //! Add one point to the convex-hull - bool AddPoint(const Vec3& point) { return AddPoints(&point, 1); } - //! Add one point to the convex-hull - bool AddPoint(const Vec3& point, int32_t id); - //! Add points to the convex-hull - bool AddPoints(const Vec3* points, size_t nPoints); - //! - ICHullError Process(); - //! - ICHullError Process(const uint32_t nPointsCH, const double minVolume = 0.0); - //! - bool IsInside(const Vec3& pt0, const double eps = 0.0); - //! - const ICHull& operator=(ICHull& rhs); - - //! Constructor - ICHull(); - //! Destructor - ~ICHull(void) {} - - private: - //! DoubleTriangle builds the initial double triangle. It first finds 3 noncollinear points and makes two faces out of them, in opposite order. It then finds a fourth point that is not coplanar with that face. The vertices are stored in the face structure in counterclockwise order so that the volume between the face and the point is negative. Lastly, the 3 newfaces to the fourth point are constructed and the data structures are cleaned up. - ICHullError DoubleTriangle(); - //! MakeFace creates a new face structure from three vertices (in ccw order). It returns a pointer to the face. - CircularListElement* MakeFace(CircularListElement* v0, - CircularListElement* v1, - CircularListElement* v2, - CircularListElement* fold); - //! - CircularListElement* MakeConeFace(CircularListElement* e, CircularListElement* v); - //! - bool ProcessPoint(); - //! - bool ComputePointVolume(double& totalVolume, bool markVisibleFaces); - //! - bool FindMaxVolumePoint(const double minVolume = 0.0); - //! - bool CleanEdges(); - //! - bool CleanVertices(uint32_t& addedPoints); - //! - bool CleanTriangles(); - //! - bool CleanUp(uint32_t& addedPoints); - //! - bool MakeCCW(CircularListElement* f, - CircularListElement* e, - CircularListElement* v); - void Clear(); - - private: - static const int32_t sc_dummyIndex; - TMMesh m_mesh; - SArray*> m_edgesToDelete; - SArray*> m_edgesToUpdate; - SArray*> m_trianglesToDelete; - Vec3 m_normal; - bool m_isFlat; - ICHull(const ICHull& rhs); - }; - } -} -#endif // VHACD_ICHULL_H diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdManifoldMesh.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdManifoldMesh.h deleted file mode 100644 index acf0071325..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdManifoldMesh.h +++ /dev/null @@ -1,147 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) -All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#pragma once -#ifndef ND_VHACD_MANIFOLD_MESH_H -#define ND_VHACD_MANIFOLD_MESH_H - -#include "vhacdDefines.h" -#include "vhacdCircularList.h" -#include "vhacdSArray.h" -#include "vhacdVector.h" - -namespace nd_ -{ - namespace VHACD - { - class TMMTriangle; - class TMMEdge; - class TMMesh; - class ICHull; - - //! Vertex data structure used in a triangular manifold mesh (TMM). - class TMMVertex - { - public: - void Initialize(); - TMMVertex(void); - - private: - Vec3 m_pos; - int32_t m_name; - size_t m_id; - CircularListElement* m_duplicate; // pointer to incident cone edge (or NULL) - bool m_onHull; - bool m_tag; - - friend class ICHull; - friend class TMMesh; - friend class TMMTriangle; - friend class TMMEdge; - }; - - //! Edge data structure used in a triangular manifold mesh (TMM). - class TMMEdge { - public: - void Initialize(); - TMMEdge(void); - - private: - size_t m_id; - CircularListElement* m_triangles[2]; - CircularListElement* m_vertices[2]; - CircularListElement* m_newFace; - - friend class ICHull; - friend class TMMTriangle; - friend class TMMVertex; - friend class TMMesh; - }; - - //! Triangle data structure used in a triangular manifold mesh (TMM). - class TMMTriangle { - public: - void Initialize(); - TMMTriangle(void); - - private: - size_t m_id; - CircularListElement* m_edges[3]; - CircularListElement* m_vertices[3]; - bool m_visible; - - friend class ICHull; - friend class TMMesh; - friend class TMMVertex; - friend class TMMEdge; - }; - //! triangular manifold mesh data structure. - class TMMesh - { - public: - //! Returns the number of vertices> - inline size_t GetNVertices() const { return m_vertices.GetSize(); } - //! Returns the number of edges - inline size_t GetNEdges() const { return m_edges.GetSize(); } - //! Returns the number of triangles - inline size_t GetNTriangles() const { return m_triangles.GetSize(); } - //! Returns the vertices circular list - inline const CircularList& GetVertices() const { return m_vertices; } - //! Returns the edges circular list - inline const CircularList& GetEdges() const { return m_edges; } - //! Returns the triangles circular list - inline const CircularList& GetTriangles() const { return m_triangles; } - //! Returns the vertices circular list - inline CircularList& GetVertices() { return m_vertices; } - //! Returns the edges circular list - inline CircularList& GetEdges() { return m_edges; } - //! Returns the triangles circular list - inline CircularList& GetTriangles() { return m_triangles; } - //! Add vertex to the mesh - CircularListElement* AddVertex() { return m_vertices.Add(); } - //! Add vertex to the mesh - CircularListElement* AddEdge() { return m_edges.Add(); } - //! Add vertex to the mesh - CircularListElement* AddTriangle() { return m_triangles.Add(); } - //! Print mesh information - void Print(); - //! - void GetIFS(Vec3* const points, Vec3* const triangles); - //! - void Clear(); - //! - void Copy(TMMesh& mesh); - //! - bool CheckConsistancy(); - //! - bool Normalize(); - //! - bool Denormalize(); - //! Constructor - TMMesh(); - //! Destructor - virtual ~TMMesh(void); - - private: - CircularList m_vertices; - CircularList m_edges; - CircularList m_triangles; - - // not defined - TMMesh(const TMMesh& rhs); - friend class ICHull; - }; - } -} -#endif // VHACD_MANIFOLD_MESH_H \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdMesh.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdMesh.h deleted file mode 100644 index 4c18ba69d7..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdMesh.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#pragma once -#ifndef ND_VHACD_MESH_H -#define ND_VHACD_MESH_H - -#include "vhacdDefines.h" -#include "vhacdSArray.h" -#include "vhacdVector.h" - - -namespace nd_ -{ - //#define VHACD_DEBUG_MESH - - namespace VHACD - { - enum AXIS { - AXIS_X = 0, - AXIS_Y = 1, - AXIS_Z = 2 - }; - struct Plane { - double m_a; - double m_b; - double m_c; - double m_d; - AXIS m_axis; - short m_index; - }; - #ifdef VHACD_DEBUG_MESH - struct Material { - - Vec3 m_diffuseColor; - double m_ambientIntensity; - Vec3 m_specularColor; - Vec3 m_emissiveColor; - double m_shininess; - double m_transparency; - Material(void) - { - m_diffuseColor.X() = 0.5; - m_diffuseColor.Y() = 0.5; - m_diffuseColor.Z() = 0.5; - m_specularColor.X() = 0.5; - m_specularColor.Y() = 0.5; - m_specularColor.Z() = 0.5; - m_ambientIntensity = 0.4; - m_emissiveColor.X() = 0.0; - m_emissiveColor.Y() = 0.0; - m_emissiveColor.Z() = 0.0; - m_shininess = 0.4; - m_transparency = 0.0; - }; - }; - #endif // VHACD_DEBUG_MESH - - //! Triangular mesh data structure - class Mesh { - public: - void AddPoint(const Vec3& pt) { m_points.PushBack(pt); } - void SetPoint(size_t index, const Vec3& pt) { m_points[index] = pt; } - const Vec3& GetPoint(size_t index) const { return m_points[index]; } - Vec3& GetPoint(size_t index) { return m_points[index]; } - size_t GetNPoints() const { return m_points.Size(); } - double* GetPoints() { return (double*)m_points.Data(); } // ugly - const double* GetPoints() const { return (double*)m_points.Data(); } // ugly - const Vec3* GetPointsBuffer() const { return m_points.Data(); } // - Vec3* GetPointsBuffer() { return m_points.Data(); } // - void AddTriangle(const Vec3& tri) { m_triangles.PushBack(tri); } - void SetTriangle(size_t index, const Vec3& tri) { m_triangles[index] = tri; } - const Vec3& GetTriangle(size_t index) const { return m_triangles[index]; } - Vec3& GetTriangle(size_t index) { return m_triangles[index]; } - size_t GetNTriangles() const { return m_triangles.Size(); } - int32_t* GetTriangles() { return (int32_t*)m_triangles.Data(); } // ugly - const int32_t* GetTriangles() const { return (int32_t*)m_triangles.Data(); } // ugly - const Vec3* GetTrianglesBuffer() const { return m_triangles.Data(); } - Vec3* GetTrianglesBuffer() { return m_triangles.Data(); } - void ClearPoints() { m_points.Clear(); } - void ClearTriangles() { m_triangles.Clear(); } - void Clear() - { - ClearPoints(); - ClearTriangles(); - } - void ResizePoints(size_t nPts) { m_points.Resize(nPts); } - void ResizeTriangles(size_t nTri) { m_triangles.Resize(nTri); } - void CopyPoints(SArray >& points) const { points = m_points; } - double ComputeVolume() const; - void ComputeConvexHull(const double* const pts, const size_t nPts); - void Clip(const Plane& plane, - SArray >& positivePart, - SArray >& negativePart) const; - bool IsInside(const Vec3& pt) const; - void CalculateBoundingBox(Vec3& p0, Vec3& p1) const; - - #ifdef VHACD_DEBUG_MESH - bool LoadOFF(const std::string& fileName, bool invert); - bool SaveVRML2(const std::string& fileName) const; - bool SaveVRML2(std::ofstream& fout, const Material& material) const; - bool SaveOFF(const std::string& fileName) const; - #endif // VHACD_DEBUG_MESH - - //! Constructor. - Mesh(); - //! Destructor. - ~Mesh(void); - - Mesh(const Mesh& src); - - private: - SArray > m_points; - SArray > m_triangles; - }; - } -} -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdRaycastMesh.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdRaycastMesh.h deleted file mode 100644 index d3f68a56d5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdRaycastMesh.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ND_RAYCAST_MESH_H -#define ND_RAYCAST_MESH_H - -#include "vhacdDefines.h" - -namespace nd_ -{ - namespace VHACD - { - // Very simple brute force raycast against a triangle mesh. Tests every triangle; no hierachy. - // Does a deep copy, always does calculations with full double float precision - class RaycastMesh - { - public: - static RaycastMesh * createRaycastMesh(uint32_t vcount, // The number of vertices in the source triangle mesh - const double *vertices, // The array of vertex positions in the format x1,y1,z1..x2,y2,z2.. etc. - uint32_t tcount, // The number of triangles in the source triangle mesh - const uint32_t *indices); // The triangle indices in the format of i1,i2,i3 ... i4,i5,i6, ... - - static RaycastMesh * createRaycastMesh(uint32_t vcount, // The number of vertices in the source triangle mesh - const float *vertices, // The array of vertex positions in the format x1,y1,z1..x2,y2,z2.. etc. - uint32_t tcount, // The number of triangles in the source triangle mesh - const uint32_t *indices); // The triangle indices in the format of i1,i2,i3 ... i4,i5,i6, ... - - - virtual bool raycast(const double *from, // The starting point of the raycast - const double *to, // The ending point of the raycast - const double *closestToPoint, // The point to match the nearest hit location (can just be the 'from' location of no specific point) - double *hitLocation, // The point where the ray hit nearest to the 'closestToPoint' location - double *hitDistance) = 0; // The distance the ray traveled to the hit location - - virtual void release(void) = 0; - protected: - virtual ~RaycastMesh(void) { } - }; - - } // end of VHACD namespace -} - -#endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdSArray.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdSArray.h deleted file mode 100644 index 8db7da41df..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdSArray.h +++ /dev/null @@ -1,161 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#pragma once -#ifndef ND_VHACD_SARRAY_H -#define ND_VHACD_SARRAY_H - -#include "vhacdDefines.h" - -namespace nd_ -{ - #define SARRAY_DEFAULT_MIN_SIZE 16 - - namespace VHACD - { - //! SArray. - template - class SArray { - public: - T& operator[](size_t i) - { - T* const data = Data(); - return data[i]; - } - const T& operator[](size_t i) const - { - const T* const data = Data(); - return data[i]; - } - size_t Size() const - { - return m_size; - } - T* Data() - { - return (m_maxSize == N) ? m_data0 : m_data; - } - const T* Data() const - { - return (m_maxSize == N) ? m_data0 : m_data; - } - void Clear() - { - m_size = 0; - delete[] m_data; - m_data = 0; - m_maxSize = N; - } - void PopBack() - { - --m_size; - } - void Allocate(size_t size) - { - if (size > m_maxSize) { - T* temp = new T[size]; - memcpy(temp, Data(), m_size * sizeof(T)); - delete[] m_data; - m_data = temp; - m_maxSize = size; - } - } - void Resize(size_t size) - { - Allocate(size); - m_size = size; - } - - void PushBack(const T& value) - { - if (m_size == m_maxSize) { - size_t maxSize = (m_maxSize << 1); - T* temp = new T[maxSize]; - memcpy(temp, Data(), m_maxSize * sizeof(T)); - delete[] m_data; - m_data = temp; - m_maxSize = maxSize; - } - T* const data = Data(); - data[m_size++] = value; - } - bool Find(const T& value, size_t& pos) - { - T* const data = Data(); - for (pos = 0; pos < m_size; ++pos) - if (value == data[pos]) - return true; - return false; - } - bool Insert(const T& value) - { - size_t pos; - if (Find(value, pos)) - return false; - PushBack(value); - return true; - } - bool Erase(const T& value) - { - size_t pos; - T* const data = Data(); - if (Find(value, pos)) { - for (size_t j = pos + 1; j < m_size; ++j) - data[j - 1] = data[j]; - --m_size; - return true; - } - return false; - } - void operator=(const SArray& rhs) - { - if (m_maxSize < rhs.m_size) { - delete[] m_data; - m_maxSize = rhs.m_maxSize; - m_data = new T[m_maxSize]; - } - m_size = rhs.m_size; - memcpy(Data(), rhs.Data(), m_size * sizeof(T)); - } - void Initialize() - { - m_data = 0; - m_size = 0; - m_maxSize = N; - } - SArray(const SArray& rhs) - { - m_data = 0; - m_size = 0; - m_maxSize = N; - *this = rhs; - } - SArray() - { - Initialize(); - } - ~SArray() - { - delete[] m_data; - } - - private: - T m_data0[N]; - T* m_data; - size_t m_size; - size_t m_maxSize; - }; - } -} -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdTimer.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdTimer.h deleted file mode 100644 index 7ac4cd60a8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdTimer.h +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#pragma once -#ifndef ND_VHACD_TIMER_H -#define ND_VHACD_TIMER_H - -#include "vhacdDefines.h" - -namespace nd_ -{ - namespace VHACD - { - #ifdef _WIN32 - class Timer { - public: - Timer(void) - { - m_start.QuadPart = 0; - m_stop.QuadPart = 0; - QueryPerformanceFrequency(&m_freq); - } - ~Timer(void) {} - void Tic() - { - QueryPerformanceCounter(&m_start); - } - void Toc() - { - QueryPerformanceCounter(&m_stop); - } - double GetElapsedTime() // in ms - { - LARGE_INTEGER delta; - delta.QuadPart = m_stop.QuadPart - m_start.QuadPart; - return (1000.0 * (double)delta.QuadPart) / (double)m_freq.QuadPart; - } - - private: - LARGE_INTEGER m_start; - LARGE_INTEGER m_stop; - LARGE_INTEGER m_freq; - }; - - #elif __MACH__ - class Timer { - public: - Timer(void) - { - memset(this, 0, sizeof(Timer)); - host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &m_cclock); - }; - ~Timer(void) - { - mach_port_deallocate(mach_task_self(), m_cclock); - }; - void Tic() - { - clock_get_time(m_cclock, &m_start); - } - void Toc() - { - clock_get_time(m_cclock, &m_stop); - } - double GetElapsedTime() // in ms - { - return 1000.0 * (m_stop.tv_sec - m_start.tv_sec + (1.0E-9) * (m_stop.tv_nsec - m_start.tv_nsec)); - } - - private: - clock_serv_t m_cclock; - mach_timespec_t m_start; - mach_timespec_t m_stop; - }; - #else - class Timer { - public: - Timer(void) - { - memset(this, 0, sizeof(Timer)); - }; - ~Timer(void) {}; - void Tic() - { - clock_gettime(CLOCK_REALTIME, &m_start); - } - void Toc() - { - clock_gettime(CLOCK_REALTIME, &m_stop); - } - double GetElapsedTime() // in ms - { - return 1000.0 * (m_stop.tv_sec - m_start.tv_sec + (1.0E-9) * (m_stop.tv_nsec - m_start.tv_nsec)); - } - - private: - struct timespec m_start; - struct timespec m_stop; - }; - #endif - } -} -#endif // VHACD_TIMER_H diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVHACD.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVHACD.h deleted file mode 100644 index 0f92e15819..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVHACD.h +++ /dev/null @@ -1,313 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) -All rights reserved. - - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#pragma once -#ifndef ND_VHACD_VHACD_H -#define ND_VHACD_VHACD_H -#include "vhacdDefines.h" -#include "vhacdVolume.h" -#include "vhacdRaycastMesh.h" - -namespace nd_ -{ - #define CH_APP_MIN_NUM_PRIMITIVES 64000 - namespace VHACD - { - class VHACD : public IVHACD - { - public: - //! Constructor. - VHACD() - { - Init(); - } - //! Destructor. - ~VHACD(void) - { - } - uint32_t GetNConvexHulls() const - { - return (uint32_t)m_convexHulls.Size(); - } - void Cancel() - { - SetCancel(true); - } - void GetConvexHull(const uint32_t index, ConvexHull& ch) const - { - Mesh* mesh = m_convexHulls[index]; - ch.m_nPoints = (uint32_t)mesh->GetNPoints(); - ch.m_nTriangles = (uint32_t)mesh->GetNTriangles(); - ch.m_points = mesh->GetPoints(); - ch.m_triangles = (uint32_t *)mesh->GetTriangles(); - } - void Clean(void) - { - delete m_volume; - delete m_pset; - size_t nCH = m_convexHulls.Size(); - for (size_t p = 0; p < nCH; ++p) { - delete m_convexHulls[p]; - } - m_convexHulls.Clear(); - Init(); - } - void Release(void) - { - delete this; - } - bool Compute(const float* const points, - const uint32_t nPoints, - const uint32_t* const triangles, - const uint32_t nTriangles, - const Parameters& params); - bool Compute(const double* const points, - const uint32_t nPoints, - const uint32_t* const triangles, - const uint32_t nTriangles, - const Parameters& params); - - private: - void SetCancel(bool cancel) - { - m_cancel = cancel; - } - bool GetCancel() - { - bool cancel = m_cancel; - return cancel; - } - void Update(const double stageProgress, - const double operationProgress, - const Parameters& params) - { - m_stageProgress = stageProgress; - m_operationProgress = operationProgress; - if (params.m_callback) { - params.m_callback->Update(m_overallProgress, - m_stageProgress, - m_operationProgress, - m_stage.c_str(), - m_operation.c_str()); - } - } - void Init() - { - m_raycastMesh = nullptr; - memset(m_rot, 0, sizeof(double) * 9); - m_dim = 64; - m_volume = 0; - m_volumeCH0 = 0.0; - m_pset = 0; - m_overallProgress = 0.0; - m_stageProgress = 0.0; - m_operationProgress = 0.0; - m_stage = ""; - m_operation = ""; - m_barycenter[0] = m_barycenter[1] = m_barycenter[2] = 0.0; - m_rot[0][0] = m_rot[1][1] = m_rot[2][2] = 1.0; - SetCancel(false); - } - void ComputePrimitiveSet(const Parameters& params); - void ComputeACD(const Parameters& params); - void MergeConvexHulls(const Parameters& params); - void SimplifyConvexHull(Mesh* const ch, const size_t nvertices, const double minVolume); - void SimplifyConvexHulls(const Parameters& params); - void ComputeBestClippingPlane(const PrimitiveSet* inputPSet, - const double volume, - const SArray& planes, - const Vec3& preferredCuttingDirection, - const double w, - const double alpha, - const double beta, - const int32_t convexhullDownsampling, - const double progress0, - const double progress1, - Plane& bestPlane, - double& minConcavity, - const Parameters& params); - template - void AlignMesh(const T* const points, - const uint32_t stridePoints, - const uint32_t nPoints, - const int32_t* const triangles, - const uint32_t strideTriangles, - const uint32_t nTriangles, - const Parameters& params) - { - if (GetCancel() || !params.m_pca) { - return; - } - m_timer.Tic(); - - m_stage = "Align mesh"; - m_operation = "Voxelization"; - - std::ostringstream msg; - if (params.m_logger) { - msg << "+ " << m_stage << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - Update(0.0, 0.0, params); - if (GetCancel()) { - return; - } - m_dim = (size_t)(pow((double)params.m_resolution, 1.0 / 3.0) + 0.5); - Volume volume; - volume.Voxelize(points, stridePoints, nPoints, - triangles, strideTriangles, nTriangles, - m_dim, m_barycenter, m_rot); - size_t n = volume.GetNPrimitivesOnSurf() + volume.GetNPrimitivesInsideSurf(); - Update(50.0, 100.0, params); - - if (params.m_logger) { - msg.str(""); - msg << "\t dim = " << m_dim << "\t-> " << n << " voxels" << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - if (GetCancel()) { - return; - } - m_operation = "PCA"; - Update(50.0, 0.0, params); - volume.AlignToPrincipalAxes(m_rot); - m_overallProgress = 1.0; - Update(100.0, 100.0, params); - - m_timer.Toc(); - if (params.m_logger) { - msg.str(""); - msg << "\t time " << m_timer.GetElapsedTime() / 1000.0 << "s" << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - } - template - void VoxelizeMesh(const T* const points, - const uint32_t stridePoints, - const uint32_t nPoints, - const int32_t* const triangles, - const uint32_t strideTriangles, - const uint32_t nTriangles, - const Parameters& params) - { - if (GetCancel()) { - return; - } - - m_timer.Tic(); - m_stage = "Voxelization"; - - std::ostringstream msg; - if (params.m_logger) { - msg << "+ " << m_stage << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - delete m_volume; - m_volume = 0; - int32_t iteration = 0; - const int32_t maxIteration = 5; - double progress = 0.0; - while (iteration++ < maxIteration && !m_cancel) { - msg.str(""); - msg << "Iteration " << iteration; - m_operation = msg.str(); - - progress = iteration * 100.0 / maxIteration; - Update(progress, 0.0, params); - - m_volume = new Volume; - m_volume->Voxelize(points, stridePoints, nPoints, - triangles, strideTriangles, nTriangles, - m_dim, m_barycenter, m_rot); - - Update(progress, 100.0, params); - - size_t n = m_volume->GetNPrimitivesOnSurf() + m_volume->GetNPrimitivesInsideSurf(); - if (params.m_logger) { - msg.str(""); - msg << "\t dim = " << m_dim << "\t-> " << n << " voxels" << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - double a = pow(double(params.m_resolution) / double(n), 0.33); - size_t dim_next = (size_t)(double(m_dim) * a + 0.5); - if (n < params.m_resolution && iteration < maxIteration && m_volume->GetNPrimitivesOnSurf() < params.m_resolution / 8 && m_dim != dim_next) { - delete m_volume; - m_volume = 0; - m_dim = dim_next; - } - else { - break; - } - } - m_overallProgress = 10.0; - Update(100.0, 100.0, params); - - m_timer.Toc(); - if (params.m_logger) { - msg.str(""); - msg << "\t time " << m_timer.GetElapsedTime() / 1000.0 << "s" << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - } - template - bool ComputeACD(const T* const points, - const uint32_t nPoints, - const uint32_t* const triangles, - const uint32_t nTriangles, - const Parameters& params) - { - Init(); - AlignMesh(points, 3, nPoints, (int32_t *)triangles, 3, nTriangles, params); - VoxelizeMesh(points, 3, nPoints, (int32_t *)triangles, 3, nTriangles, params); - ComputePrimitiveSet(params); - ComputeACD(params); - MergeConvexHulls(params); - if (params.m_projectHullVertices) - { - m_raycastMesh = RaycastMesh::createRaycastMesh(nPoints, points, nTriangles, (const uint32_t *)triangles); - SimplifyConvexHulls(params); - m_raycastMesh->release(); - m_raycastMesh = nullptr; - } - if (GetCancel()) { - Clean(); - return false; - } - return true; - } - - private: - RaycastMesh* m_raycastMesh; - SArray m_convexHulls; - std::string m_stage; - std::string m_operation; - double m_overallProgress; - double m_stageProgress; - double m_operationProgress; - double m_rot[3][3]; - double m_volumeCH0; - Vec3 m_barycenter; - Timer m_timer; - size_t m_dim; - Volume* m_volume; - PrimitiveSet* m_pset; - bool m_cancel; - Queue m_parallelQueue; - }; - } -} -#endif // VHACD_VHACD_H diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVector.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVector.h deleted file mode 100644 index 716defc7a5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVector.h +++ /dev/null @@ -1,172 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#pragma once -#ifndef _ND_VHACD_VECTOR_H_ -#define _ND_VHACD_VECTOR_H_ - -#include "vhacdDefines.h" - -namespace nd_ -{ - namespace VHACD - { - //! Vector dim 3. - template - class Vec3 { - public: - T& operator[](size_t i) { return m_data[i]; } - const T& operator[](size_t i) const { return m_data[i]; } - T& X(); - T& Y(); - T& Z(); - const T& X() const; - const T& Y() const; - const T& Z() const; - void Normalize(); - T GetNorm() const; - void operator=(const Vec3& rhs); - void operator+=(const Vec3& rhs); - void operator-=(const Vec3& rhs); - void operator-=(T a); - void operator+=(T a); - void operator/=(T a); - void operator*=(T a); - Vec3 operator^(const Vec3& rhs) const; - T operator*(const Vec3& rhs) const; - Vec3 operator+(const Vec3& rhs) const; - Vec3 operator-(const Vec3& rhs) const; - Vec3 operator-() const; - Vec3 operator*(T rhs) const; - Vec3 operator/(T rhs) const; - bool operator<(const Vec3& rhs) const; - bool operator>(const Vec3& rhs) const; - Vec3(); - Vec3(T a); - Vec3(T x, T y, T z); - Vec3(const Vec3& rhs); - /*virtual*/ ~Vec3(void); - - // Compute the center of this bounding box and return the diagonal length - T GetCenter(const Vec3 &bmin, const Vec3 &bmax) - { - X() = (bmin.X() + bmax.X())*0.5; - Y() = (bmin.Y() + bmax.Y())*0.5; - Z() = (bmin.Z() + bmax.Z())*0.5; - T dx = bmax.X() - bmin.X(); - T dy = bmax.Y() - bmin.Y(); - T dz = bmax.Z() - bmin.Z(); - T diagonal = T(sqrt(dx*dx + dy*dy + dz*dz)); - return diagonal; - } - - // Update the min/max values relative to this point - void UpdateMinMax(Vec3 &bmin, Vec3 &bmax) const - { - if (X() < bmin.X()) - { - bmin.X() = X(); - } - if (Y() < bmin.Y()) - { - bmin.Y() = Y(); - } - if (Z() < bmin.Z()) - { - bmin.Z() = Z(); - } - if (X() > bmax.X()) - { - bmax.X() = X(); - } - if (X() > bmax.X()) - { - bmax.X() = X(); - } - if (Y() > bmax.Y()) - { - bmax.Y() = Y(); - } - if (Z() > bmax.Z()) - { - bmax.Z() = Z(); - } - } - - // Returns the squared distance between these two points - T GetDistanceSquared(const Vec3 &p) const - { - T dx = X() - p.X(); - T dy = Y() - p.Y(); - T dz = Z() - p.Z(); - return dx*dx + dy*dy + dz*dz; - } - - T GetDistance(const Vec3 &p) const - { - return sqrt(GetDistanceSquared(p)); - } - - // Returns the raw vector data as a pointer - T* GetData(void) - { - return m_data; - } - private: - T m_data[3]; - }; - //! Vector dim 2. - template - class Vec2 { - public: - T& operator[](size_t i) { return m_data[i]; } - const T& operator[](size_t i) const { return m_data[i]; } - T& X(); - T& Y(); - const T& X() const; - const T& Y() const; - void Normalize(); - T GetNorm() const; - void operator=(const Vec2& rhs); - void operator+=(const Vec2& rhs); - void operator-=(const Vec2& rhs); - void operator-=(T a); - void operator+=(T a); - void operator/=(T a); - void operator*=(T a); - T operator^(const Vec2& rhs) const; - T operator*(const Vec2& rhs) const; - Vec2 operator+(const Vec2& rhs) const; - Vec2 operator-(const Vec2& rhs) const; - Vec2 operator-() const; - Vec2 operator*(T rhs) const; - Vec2 operator/(T rhs) const; - Vec2(); - Vec2(T a); - Vec2(T x, T y); - Vec2(const Vec2& rhs); - /*virtual*/ ~Vec2(void); - - private: - T m_data[2]; - }; - - template - bool Colinear(const Vec3& a, const Vec3& b, const Vec3& c); - template - const T ComputeVolume4(const Vec3& a, const Vec3& b, const Vec3& c, const Vec3& d); - } -} -#include "vhacdVector.inl" // template implementation -#endif \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVector.inl b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVector.inl deleted file mode 100644 index 66b9596d70..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVector.inl +++ /dev/null @@ -1,365 +0,0 @@ -#pragma once -#ifndef _ND_VHACD_VECTOR_INL -#define _ND_VHACD_VECTOR_INL -namespace nd_ -{ - namespace VHACD - { - template - inline Vec3 operator*(T lhs, const Vec3 & rhs) - { - return Vec3(lhs * rhs.X(), lhs * rhs.Y(), lhs * rhs.Z()); - } - template - inline T & Vec3::X() - { - return m_data[0]; - } - template - inline T & Vec3::Y() - { - return m_data[1]; - } - template - inline T & Vec3::Z() - { - return m_data[2]; - } - template - inline const T & Vec3::X() const - { - return m_data[0]; - } - template - inline const T & Vec3::Y() const - { - return m_data[1]; - } - template - inline const T & Vec3::Z() const - { - return m_data[2]; - } - template - inline void Vec3::Normalize() - { - T n = sqrt(m_data[0] * m_data[0] + m_data[1] * m_data[1] + m_data[2] * m_data[2]); - if (n != 0.0) (*this) /= n; - } - template - inline T Vec3::GetNorm() const - { - return sqrt(m_data[0] * m_data[0] + m_data[1] * m_data[1] + m_data[2] * m_data[2]); - } - template - inline void Vec3::operator= (const Vec3 & rhs) - { - this->m_data[0] = rhs.m_data[0]; - this->m_data[1] = rhs.m_data[1]; - this->m_data[2] = rhs.m_data[2]; - } - template - inline void Vec3::operator+=(const Vec3 & rhs) - { - this->m_data[0] += rhs.m_data[0]; - this->m_data[1] += rhs.m_data[1]; - this->m_data[2] += rhs.m_data[2]; - } - template - inline void Vec3::operator-=(const Vec3 & rhs) - { - this->m_data[0] -= rhs.m_data[0]; - this->m_data[1] -= rhs.m_data[1]; - this->m_data[2] -= rhs.m_data[2]; - } - template - inline void Vec3::operator-=(T a) - { - this->m_data[0] -= a; - this->m_data[1] -= a; - this->m_data[2] -= a; - } - template - inline void Vec3::operator+=(T a) - { - this->m_data[0] += a; - this->m_data[1] += a; - this->m_data[2] += a; - } - template - inline void Vec3::operator/=(T a) - { - this->m_data[0] /= a; - this->m_data[1] /= a; - this->m_data[2] /= a; - } - template - inline void Vec3::operator*=(T a) - { - this->m_data[0] *= a; - this->m_data[1] *= a; - this->m_data[2] *= a; - } - template - inline Vec3 Vec3::operator^ (const Vec3 & rhs) const - { - return Vec3(m_data[1] * rhs.m_data[2] - m_data[2] * rhs.m_data[1], - m_data[2] * rhs.m_data[0] - m_data[0] * rhs.m_data[2], - m_data[0] * rhs.m_data[1] - m_data[1] * rhs.m_data[0]); - } - template - inline T Vec3::operator*(const Vec3 & rhs) const - { - return (m_data[0] * rhs.m_data[0] + m_data[1] * rhs.m_data[1] + m_data[2] * rhs.m_data[2]); - } - template - inline Vec3 Vec3::operator+(const Vec3 & rhs) const - { - return Vec3(m_data[0] + rhs.m_data[0], m_data[1] + rhs.m_data[1], m_data[2] + rhs.m_data[2]); - } - template - inline Vec3 Vec3::operator-(const Vec3 & rhs) const - { - return Vec3(m_data[0] - rhs.m_data[0], m_data[1] - rhs.m_data[1], m_data[2] - rhs.m_data[2]); - } - template - inline Vec3 Vec3::operator-() const - { - return Vec3(-m_data[0], -m_data[1], -m_data[2]); - } - - template - inline Vec3 Vec3::operator*(T rhs) const - { - return Vec3(rhs * this->m_data[0], rhs * this->m_data[1], rhs * this->m_data[2]); - } - template - inline Vec3 Vec3::operator/ (T rhs) const - { - return Vec3(m_data[0] / rhs, m_data[1] / rhs, m_data[2] / rhs); - } - template - inline Vec3::Vec3(T a) - { - m_data[0] = m_data[1] = m_data[2] = a; - } - template - inline Vec3::Vec3(T x, T y, T z) - { - m_data[0] = x; - m_data[1] = y; - m_data[2] = z; - } - template - inline Vec3::Vec3(const Vec3 & rhs) - { - m_data[0] = rhs.m_data[0]; - m_data[1] = rhs.m_data[1]; - m_data[2] = rhs.m_data[2]; - } - template - inline Vec3::~Vec3(void) {} - - template - inline Vec3::Vec3() {} - - template - inline bool Colinear(const Vec3 & a, const Vec3 & b, const Vec3 & c) - { - return ((c.Z() - a.Z()) * (b.Y() - a.Y()) - (b.Z() - a.Z()) * (c.Y() - a.Y()) == 0.0 /*EPS*/) && - ((b.Z() - a.Z()) * (c.X() - a.X()) - (b.X() - a.X()) * (c.Z() - a.Z()) == 0.0 /*EPS*/) && - ((b.X() - a.X()) * (c.Y() - a.Y()) - (b.Y() - a.Y()) * (c.X() - a.X()) == 0.0 /*EPS*/); - } - - template - inline const T ComputeVolume4(const Vec3 & a, const Vec3 & b, const Vec3 & c, const Vec3 & d) - { - return (a - d) * ((b - d) ^ (c - d)); - } - - template - inline bool Vec3::operator<(const Vec3 & rhs) const - { - if (X() == rhs[0]) - { - if (Y() == rhs[1]) - { - return (Z() < rhs[2]); - } - return (Y() < rhs[1]); - } - return (X() < rhs[0]); - } - template - inline bool Vec3::operator>(const Vec3 & rhs) const - { - if (X() == rhs[0]) - { - if (Y() == rhs[1]) - { - return (Z() > rhs[2]); - } - return (Y() > rhs[1]); - } - return (X() > rhs[0]); - } - template - inline Vec2 operator*(T lhs, const Vec2 & rhs) - { - return Vec2(lhs * rhs.X(), lhs * rhs.Y()); - } - template - inline T & Vec2::X() - { - return m_data[0]; - } - template - inline T & Vec2::Y() - { - return m_data[1]; - } - template - inline const T & Vec2::X() const - { - return m_data[0]; - } - template - inline const T & Vec2::Y() const - { - return m_data[1]; - } - template - inline void Vec2::Normalize() - { - T n = sqrt(m_data[0] * m_data[0] + m_data[1] * m_data[1]); - if (n != 0.0) (*this) /= n; - } - template - inline T Vec2::GetNorm() const - { - return sqrt(m_data[0] * m_data[0] + m_data[1] * m_data[1]); - } - template - inline void Vec2::operator= (const Vec2 & rhs) - { - this->m_data[0] = rhs.m_data[0]; - this->m_data[1] = rhs.m_data[1]; - } - template - inline void Vec2::operator+=(const Vec2 & rhs) - { - this->m_data[0] += rhs.m_data[0]; - this->m_data[1] += rhs.m_data[1]; - } - template - inline void Vec2::operator-=(const Vec2 & rhs) - { - this->m_data[0] -= rhs.m_data[0]; - this->m_data[1] -= rhs.m_data[1]; - } - template - inline void Vec2::operator-=(T a) - { - this->m_data[0] -= a; - this->m_data[1] -= a; - } - template - inline void Vec2::operator+=(T a) - { - this->m_data[0] += a; - this->m_data[1] += a; - } - template - inline void Vec2::operator/=(T a) - { - this->m_data[0] /= a; - this->m_data[1] /= a; - } - template - inline void Vec2::operator*=(T a) - { - this->m_data[0] *= a; - this->m_data[1] *= a; - } - template - inline T Vec2::operator^ (const Vec2 & rhs) const - { - return m_data[0] * rhs.m_data[1] - m_data[1] * rhs.m_data[0]; - } - template - inline T Vec2::operator*(const Vec2 & rhs) const - { - return (m_data[0] * rhs.m_data[0] + m_data[1] * rhs.m_data[1]); - } - template - inline Vec2 Vec2::operator+(const Vec2 & rhs) const - { - return Vec2(m_data[0] + rhs.m_data[0], m_data[1] + rhs.m_data[1]); - } - template - inline Vec2 Vec2::operator-(const Vec2 & rhs) const - { - return Vec2(m_data[0] - rhs.m_data[0], m_data[1] - rhs.m_data[1]); - } - template - inline Vec2 Vec2::operator-() const - { - return Vec2(-m_data[0], -m_data[1]); - } - - template - inline Vec2 Vec2::operator*(T rhs) const - { - return Vec2(rhs * this->m_data[0], rhs * this->m_data[1]); - } - template - inline Vec2 Vec2::operator/ (T rhs) const - { - return Vec2(m_data[0] / rhs, m_data[1] / rhs); - } - template - inline Vec2::Vec2(T a) - { - m_data[0] = m_data[1] = a; - } - template - inline Vec2::Vec2(T x, T y) - { - m_data[0] = x; - m_data[1] = y; - } - template - inline Vec2::Vec2(const Vec2 & rhs) - { - m_data[0] = rhs.m_data[0]; - m_data[1] = rhs.m_data[1]; - } - template - inline Vec2::~Vec2(void) {} - - template - inline Vec2::Vec2() {} - - /* - InsideTriangle decides if a point P is Inside of the triangle - defined by A, B, C. - */ - template - inline bool InsideTriangle(const Vec2 & a, const Vec2 & b, const Vec2 & c, const Vec2 & p) - { - T ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy; - T cCROSSap, bCROSScp, aCROSSbp; - ax = c.X() - b.X(); ay = c.Y() - b.Y(); - bx = a.X() - c.X(); by = a.Y() - c.Y(); - cx = b.X() - a.X(); cy = b.Y() - a.Y(); - apx = p.X() - a.X(); apy = p.Y() - a.Y(); - bpx = p.X() - b.X(); bpy = p.Y() - b.Y(); - cpx = p.X() - c.X(); cpy = p.Y() - c.Y(); - aCROSSbp = ax*bpy - ay*bpx; - cCROSSap = cx*apy - cy*apx; - bCROSScp = bx*cpy - by*cpx; - return ((aCROSSbp >= 0.0) && (bCROSScp >= 0.0) && (cCROSSap >= 0.0)); - } - } -} -#endif //VHACD_VECTOR_INL \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVolume.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVolume.h deleted file mode 100644 index f9fef83018..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/inc/vhacdVolume.h +++ /dev/null @@ -1,428 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#pragma once -#ifndef ND_VHACD_VOLUME_H -#define ND_VHACD_VOLUME_H -#include "vhacdDefines.h" -#include "vhacdMesh.h" -#include "vhacdVector.h" - -namespace nd_ -{ - namespace VHACD { - - enum VOXEL_VALUE { - PRIMITIVE_UNDEFINED = 0, - PRIMITIVE_OUTSIDE_SURFACE = 1, - PRIMITIVE_INSIDE_SURFACE = 2, - PRIMITIVE_ON_SURFACE = 3 - }; - - struct Voxel { - public: - short m_coord[3]; - short m_data; - }; - - class PrimitiveSet { - public: - virtual ~PrimitiveSet() {} - virtual PrimitiveSet* Create() const = 0; - virtual size_t GetNPrimitives() const = 0; - virtual size_t GetNPrimitivesOnSurf() const = 0; - virtual size_t GetNPrimitivesInsideSurf() const = 0; - virtual double GetEigenValue(AXIS axis) const = 0; - virtual double ComputeMaxVolumeError() const = 0; - virtual double ComputeVolume() const = 0; - virtual void Clip(const Plane& plane, PrimitiveSet* const positivePart, - PrimitiveSet* const negativePart) const = 0; - virtual void Intersect(const Plane& plane, SArray >* const positivePts, - SArray >* const negativePts, const size_t sampling) const = 0; - virtual void ComputeExteriorPoints(const Plane& plane, const Mesh& mesh, - SArray >* const exteriorPts) const = 0; - virtual void ComputeClippedVolumes(const Plane& plane, double& positiveVolume, - double& negativeVolume) const = 0; - virtual void SelectOnSurface(PrimitiveSet* const onSurfP) const = 0; - virtual void ComputeConvexHull(Mesh& meshCH, const size_t sampling = 1) const = 0; - virtual void ComputeBB() = 0; - virtual void ComputePrincipalAxes() = 0; - virtual void AlignToPrincipalAxes() = 0; - virtual void RevertAlignToPrincipalAxes() = 0; - virtual void Convert(Mesh& mesh, const VOXEL_VALUE value) const = 0; - virtual void GetPointArray(std::vector >& points) const = 0; - const Mesh& GetConvexHull() const { return m_convexHull; } - Mesh& GetConvexHull() { return m_convexHull; } - private: - Mesh m_convexHull; - }; - - //! - class VoxelSet : public PrimitiveSet { - friend class Volume; - - public: - //! Destructor. - ~VoxelSet(void); - //! Constructor. - VoxelSet(); - - size_t GetNPrimitives() const { return m_voxels.Size(); } - size_t GetNPrimitivesOnSurf() const { return m_numVoxelsOnSurface; } - size_t GetNPrimitivesInsideSurf() const { return m_numVoxelsInsideSurface; } - double GetEigenValue(AXIS axis) const { return m_D[axis][axis]; } - double ComputeVolume() const { return m_unitVolume * (double)m_voxels.Size(); } - double ComputeMaxVolumeError() const { return m_unitVolume * (double)m_numVoxelsOnSurface; } - const Vec3& GetMinBBVoxels() const { return m_minBBVoxels; } - const Vec3& GetMaxBBVoxels() const { return m_maxBBVoxels; } - const Vec3& GetMinBB() const { return m_minBB; } - const double& GetScale() const { return m_scale; } - const double& GetUnitVolume() const { return m_unitVolume; } - Vec3 GetPoint(Vec3 voxel) const - { - return Vec3(voxel[0] * m_scale + m_minBB[0], - voxel[1] * m_scale + m_minBB[1], - voxel[2] * m_scale + m_minBB[2]); - } - Vec3 GetPoint(const Voxel& voxel) const - { - return Vec3(voxel.m_coord[0] * m_scale + m_minBB[0], - voxel.m_coord[1] * m_scale + m_minBB[1], - voxel.m_coord[2] * m_scale + m_minBB[2]); - } - Vec3 GetPoint(Vec3 voxel) const - { - return Vec3(voxel[0] * m_scale + m_minBB[0], - voxel[1] * m_scale + m_minBB[1], - voxel[2] * m_scale + m_minBB[2]); - } - - void GetPointArray(std::vector>& points) const ; - - void GetPoints(const Voxel& voxel, Vec3* const pts) const; - void ComputeConvexHull(Mesh& meshCH, const size_t sampling = 1) const; - void Clip(const Plane& plane, PrimitiveSet* const positivePart, PrimitiveSet* const negativePart) const; - void Intersect(const Plane& plane, SArray >* const positivePts, - SArray >* const negativePts, const size_t sampling) const; - void ComputeExteriorPoints(const Plane& plane, const Mesh& mesh, - SArray >* const exteriorPts) const; - void ComputeClippedVolumes(const Plane& plane, double& positiveVolume, double& negativeVolume) const; - void SelectOnSurface(PrimitiveSet* const onSurfP) const; - void ComputeBB(); - void Convert(Mesh& mesh, const VOXEL_VALUE value) const; - void ComputePrincipalAxes(); - PrimitiveSet* Create() const - { - return new VoxelSet(); - } - void AlignToPrincipalAxes() {} - void RevertAlignToPrincipalAxes() {} - Voxel* GetVoxels() { return m_voxels.Data(); } - const Voxel* GetVoxels() const { return m_voxels.Data(); } - - private: - size_t m_numVoxelsOnSurface; - size_t m_numVoxelsInsideSurface; - Vec3 m_minBB; - double m_scale; - SArray m_voxels; - double m_unitVolume; - Vec3 m_minBBPts; - Vec3 m_maxBBPts; - Vec3 m_minBBVoxels; - Vec3 m_maxBBVoxels; - Vec3 m_barycenter; - double m_Q[3][3]; - double m_D[3][3]; - Vec3 m_barycenterPCA; - }; - - struct Tetrahedron { - public: - Vec3 m_pts[4]; - unsigned char m_data; - }; - - //! - class TetrahedronSet : public PrimitiveSet { - friend class Volume; - - public: - //! Destructor. - ~TetrahedronSet(void); - //! Constructor. - TetrahedronSet(); - - size_t GetNPrimitives() const { return m_tetrahedra.Size(); } - size_t GetNPrimitivesOnSurf() const { return m_numTetrahedraOnSurface; } - size_t GetNPrimitivesInsideSurf() const { return m_numTetrahedraInsideSurface; } - const Vec3& GetMinBB() const { return m_minBB; } - const Vec3& GetMaxBB() const { return m_maxBB; } - const Vec3& GetBarycenter() const { return m_barycenter; } - double GetEigenValue(AXIS axis) const { return m_D[axis][axis]; } - double GetSacle() const { return m_scale; } - double ComputeVolume() const; - double ComputeMaxVolumeError() const; - void ComputeConvexHull(Mesh& meshCH, const size_t sampling = 1) const; - void ComputePrincipalAxes(); - void AlignToPrincipalAxes(); - void RevertAlignToPrincipalAxes(); - void Clip(const Plane& plane, PrimitiveSet* const positivePart, PrimitiveSet* const negativePart) const; - void Intersect(const Plane& plane, SArray >* const positivePts, - SArray >* const negativePts, const size_t sampling) const; - void ComputeExteriorPoints(const Plane& plane, const Mesh& mesh, - SArray >* const exteriorPts) const; - void ComputeClippedVolumes(const Plane& plane, double& positiveVolume, double& negativeVolume) const; - void SelectOnSurface(PrimitiveSet* const onSurfP) const; - void ComputeBB(); - void Convert(Mesh& mesh, const VOXEL_VALUE value) const; - inline bool Add(Tetrahedron& tetrahedron); - PrimitiveSet* Create() const - { - return new TetrahedronSet(); - } - static const double EPS; - - private: - void GetPointArray(std::vector >& points) const; - void AddClippedTetrahedra(const Vec3(&pts)[10], const int32_t nPts); - - size_t m_numTetrahedraOnSurface; - size_t m_numTetrahedraInsideSurface; - double m_scale; - Vec3 m_minBB; - Vec3 m_maxBB; - Vec3 m_barycenter; - SArray m_tetrahedra; - double m_Q[3][3]; - double m_D[3][3]; - }; - - //! - class Volume { - public: - //! Destructor. - ~Volume(void); - - //! Constructor. - Volume(); - - //! Voxelize - template - void Voxelize(const T* const points, const uint32_t stridePoints, const uint32_t nPoints, - const int32_t* const triangles, const uint32_t strideTriangles, const uint32_t nTriangles, - const size_t dim, const Vec3& barycenter, const double(&rot)[3][3]); - unsigned char& GetVoxel(const size_t i, const size_t j, const size_t k) - { - //assert(i < m_dim[0] || i >= 0); - //assert(j < m_dim[0] || j >= 0); - //assert(k < m_dim[0] || k >= 0); - return m_data[i + j * m_dim[0] + k * m_dim[0] * m_dim[1]]; - } - const unsigned char& GetVoxel(const size_t i, const size_t j, const size_t k) const - { - //assert(i < m_dim[0] || i >= 0); - //assert(j < m_dim[0] || j >= 0); - //assert(k < m_dim[0] || k >= 0); - return m_data[i + j * m_dim[0] + k * m_dim[0] * m_dim[1]]; - } - size_t GetNPrimitivesOnSurf() const { return m_numVoxelsOnSurface; } - size_t GetNPrimitivesInsideSurf() const { return m_numVoxelsInsideSurface; } - void Convert(Mesh& mesh, const VOXEL_VALUE value) const; - void Convert(VoxelSet& vset) const; - void Convert(TetrahedronSet& tset) const; - void AlignToPrincipalAxes(double(&rot)[3][3]) const; - - private: - void FillOutsideSurface(const size_t i0, const size_t j0, const size_t k0, const size_t i1, - const size_t j1, const size_t k1); - void FillInsideSurface(); - template - void ComputeBB(const T* const points, const uint32_t stridePoints, const uint32_t nPoints, - const Vec3& barycenter, const double(&rot)[3][3]); - void Allocate(); - void Free(); - - Vec3 m_minBB; - Vec3 m_maxBB; - double m_scale; - size_t m_dim[3]; //>! dim - size_t m_numVoxelsOnSurface; - size_t m_numVoxelsInsideSurface; - size_t m_numVoxelsOutsideSurface; - unsigned char* m_data; - }; - int32_t TriBoxOverlap(const Vec3& boxcenter, const Vec3& boxhalfsize, const Vec3& triver0, - const Vec3& triver1, const Vec3& triver2); - template - inline void ComputeAlignedPoint(const T* const points, const uint32_t idx, const Vec3& barycenter, - const double(&rot)[3][3], Vec3& pt) {} - template <> - inline void ComputeAlignedPoint(const float* const points, const uint32_t idx, const Vec3& barycenter, const double(&rot)[3][3], Vec3& pt) - { - double x = points[idx + 0] - barycenter[0]; - double y = points[idx + 1] - barycenter[1]; - double z = points[idx + 2] - barycenter[2]; - pt[0] = rot[0][0] * x + rot[1][0] * y + rot[2][0] * z; - pt[1] = rot[0][1] * x + rot[1][1] * y + rot[2][1] * z; - pt[2] = rot[0][2] * x + rot[1][2] * y + rot[2][2] * z; - } - template <> - inline void ComputeAlignedPoint(const double* const points, const uint32_t idx, const Vec3& barycenter, const double(&rot)[3][3], Vec3& pt) - { - double x = points[idx + 0] - barycenter[0]; - double y = points[idx + 1] - barycenter[1]; - double z = points[idx + 2] - barycenter[2]; - pt[0] = rot[0][0] * x + rot[1][0] * y + rot[2][0] * z; - pt[1] = rot[0][1] * x + rot[1][1] * y + rot[2][1] * z; - pt[2] = rot[0][2] * x + rot[1][2] * y + rot[2][2] * z; - } - template - void Volume::ComputeBB(const T* const points, const uint32_t stridePoints, const uint32_t nPoints, - const Vec3& barycenter, const double(&rot)[3][3]) - { - Vec3 pt; - ComputeAlignedPoint(points, 0, barycenter, rot, pt); - m_maxBB = pt; - m_minBB = pt; - for (uint32_t v = 1; v < nPoints; ++v) { - ComputeAlignedPoint(points, v * stridePoints, barycenter, rot, pt); - for (size_t i = 0; i < 3; ++i) { - if (pt[i] < m_minBB[i]) - m_minBB[i] = pt[i]; - else if (pt[i] > m_maxBB[i]) - m_maxBB[i] = pt[i]; - } - } - } - template - void Volume::Voxelize(const T* const points, const uint32_t stridePoints, const uint32_t nPoints, - const int32_t* const triangles, const uint32_t strideTriangles, const uint32_t nTriangles, - const size_t dim, const Vec3& barycenter, const double(&rot)[3][3]) - { - if (nPoints == 0) { - return; - } - ComputeBB(points, stridePoints, nPoints, barycenter, rot); - - double d[3] = { m_maxBB[0] - m_minBB[0], m_maxBB[1] - m_minBB[1], m_maxBB[2] - m_minBB[2] }; - double r; - if (d[0] >= d[1] && d[0] >= d[2]) { - r = d[0]; - m_dim[0] = dim; - m_dim[1] = 2 + static_cast(double(dim) * d[1] / d[0]); - m_dim[2] = 2 + static_cast(double(dim) * d[2] / d[0]); - } - else if (d[1] >= d[0] && d[1] >= d[2]) { - r = d[1]; - m_dim[1] = dim; - m_dim[0] = 2 + static_cast(double(dim) * d[0] / d[1]); - m_dim[2] = 2 + static_cast(double(dim) * d[2] / d[1]); - } - else { - r = d[2]; - m_dim[2] = dim; - m_dim[0] = 2 + static_cast((double)dim * d[0] / d[2]); - m_dim[1] = 2 + static_cast((double)dim * d[1] / d[2]); - } - - m_scale = r / (double(dim) - 1); - double invScale = (double(dim) - 1) / r; - - Allocate(); - m_numVoxelsOnSurface = 0; - m_numVoxelsInsideSurface = 0; - m_numVoxelsOutsideSurface = 0; - - Vec3 p[3]; - size_t i_= 0, j_ = 0, k_ = 0; - size_t i0 = 0, j0 = 0, k0 = 0; - size_t i1 = 0, j1 = 0, k1 = 0; - Vec3 boxcenter; - Vec3 pt; - const Vec3 boxhalfsize(0.5, 0.5, 0.5); - for (size_t t = 0, ti = 0; t < nTriangles; ++t, ti += strideTriangles) { - Vec3 tri(triangles[ti + 0], - triangles[ti + 1], - triangles[ti + 2]); - for (size_t c = 0; c < 3; ++c) { - ComputeAlignedPoint(points, tri[c] * stridePoints, barycenter, rot, pt); - p[c][0] = (pt[0] - m_minBB[0]) * invScale; - p[c][1] = (pt[1] - m_minBB[1]) * invScale; - p[c][2] = (pt[2] - m_minBB[2]) * invScale; - i_ = static_cast(p[c][0] + 0.5); - j_ = static_cast(p[c][1] + 0.5); - k_ = static_cast(p[c][2] + 0.5); - assert(i_ < m_dim[0] && i_ >= 0 && j_ < m_dim[1] && j_ >= 0 && k_ < m_dim[2] && k_ >= 0); - - if (c == 0) { - i0 = i1 = i_; - j0 = j1 = j_; - k0 = k1 = k_; - } - else { - if (i_ < i0) - i0 = i_; - if (j_ < j0) - j0 = j_; - if (k_ < k0) - k0 = k_; - if (i_ > i1) - i1 = i_; - if (j_ > j1) - j1 = j_; - if (k_ > k1) - k1 = k_; - } - } - if (i0 > 0) - --i0; - if (j0 > 0) - --j0; - if (k0 > 0) - --k0; - if (i1 < m_dim[0]) - ++i1; - if (j1 < m_dim[1]) - ++j1; - if (k1 < m_dim[2]) - ++k1; - for (size_t i = i0; i < i1; ++i) { - boxcenter[0] = (double)i; - for (size_t j = j0; j < j1; ++j) { - boxcenter[1] = (double)j; - for (size_t k = k0; k < k1; ++k) { - boxcenter[2] = (double)k; - int32_t res = TriBoxOverlap(boxcenter, boxhalfsize, p[0], p[1], p[2]); - unsigned char& value = GetVoxel(i, j, k); - if (res == 1 && value == PRIMITIVE_UNDEFINED) { - value = PRIMITIVE_ON_SURFACE; - ++m_numVoxelsOnSurface; - } - } - } - } - } - FillOutsideSurface(0, 0, 0, m_dim[0], m_dim[1], 1); - FillOutsideSurface(0, 0, m_dim[2] - 1, m_dim[0], m_dim[1], m_dim[2]); - FillOutsideSurface(0, 0, 0, m_dim[0], 1, m_dim[2]); - FillOutsideSurface(0, m_dim[1] - 1, 0, m_dim[0], m_dim[1], m_dim[2]); - FillOutsideSurface(0, 0, 0, 1, m_dim[1], m_dim[2]); - FillOutsideSurface(m_dim[0] - 1, 0, 0, m_dim[0], m_dim[1], m_dim[2]); - FillInsideSurface(); - } - } -} - -#endif // VHACD_VOLUME_H diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/public/VHACD.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/public/VHACD.h deleted file mode 100644 index 325c0682d3..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/public/VHACD.h +++ /dev/null @@ -1,171 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#pragma once -#ifndef ND_VHACD_H -#define ND_VHACD_H - -#define ND_VHACD_VERSION_MAJOR 2 -#define ND_VHACD_VERSION_MINOR 3 - -// Changes for version 2.3 -// -// m_gamma : Has been removed. This used to control the error metric to merge convex hulls. Now it uses the 'm_maxConvexHulls' value instead. -// m_maxConvexHulls : This is the maximum number of convex hulls to produce from the merge operation; replaces 'm_gamma'. -// -// Note that decomposition depth is no longer a user provided value. It is now derived from the -// maximum number of hulls requested. -// -// As a convenience to the user, each convex hull produced now includes the volume of the hull as well as it's center. -// -// This version supports a convenience method to automatically make V-HACD run asynchronously in a background thread. -// To get a fully asynchronous version, call 'CreateVHACD_ASYNC' instead of 'CreateVHACD'. You get the same interface however, -// now when computing convex hulls, it is no longer a blocking operation. All callback messages are still returned -// in the application's thread so you don't need to worry about mutex locks or anything in that case. -// To tell if the operation is complete, the application should call 'IsReady'. This will return true if -// the last approximation operation is complete and will dispatch any pending messages. -// If you call 'Compute' while a previous operation was still running, it will automatically cancel the last request -// and begin a new one. To cancel a currently running approximation just call 'Cancel'. - -#ifdef _WIN32 - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - #endif - #include -#elif __MACH__ - #include - #include -#else - #include - #include - #include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -namespace nd_ -{ - namespace VHACD - { - class IVHACD - { - public: - class IUserCallback { - public: - virtual ~IUserCallback() {} - virtual void Update(const double overallProgress, - const double stageProgress, - const double operationProgress, - const char* const stage, - const char* const operation) - = 0; - }; - - class IUserLogger { - public: - virtual ~IUserLogger() {} - virtual void Log(const char* const msg) = 0; - }; - - class ConvexHull { - public: - double* m_points; - uint32_t* m_triangles; - uint32_t m_nPoints; - uint32_t m_nTriangles; - }; - - class Parameters { - public: - Parameters(void) { Init(); } - void Init(void) - { - m_resolution = 400000; - m_concavity = 0.001; - m_minMergeToleranace = 0.5e-3f; - m_concavityToVolumeWeigh = 1.0f; - m_planeDownsampling = 4; - m_convexhullDownsampling = 4; - m_alpha = 0.05; - m_beta = 0.05; - m_pca = 0; - m_mode = 0; // 0: voxel-based (recommended), 1: tetrahedron-based - m_maxNumVerticesPerCH = 64; - m_minVolumePerCH = 0.0001; - m_callback = 0; - m_logger = 0; - m_convexhullApproximation = true; - //m_maxConvexHulls = 1024; - m_maxConvexHulls = 128; - // This will project the output convex hull vertices onto the original source mesh to increase the floating point accuracy of the results - //m_projectHullVertices = true; - m_projectHullVertices = false; - } - double m_concavity; - double m_concavityToVolumeWeigh; - double m_alpha; - double m_beta; - double m_minVolumePerCH; - double m_minMergeToleranace; - IUserCallback* m_callback; - IUserLogger* m_logger; - uint32_t m_resolution; - uint32_t m_maxNumVerticesPerCH; - uint32_t m_planeDownsampling; - uint32_t m_convexhullDownsampling; - uint32_t m_pca; - uint32_t m_mode; - uint32_t m_convexhullApproximation; - uint32_t m_maxConvexHulls; - bool m_projectHullVertices; - }; - - virtual void Cancel() = 0; - virtual bool Compute(const float* const points, - const uint32_t countPoints, - const uint32_t* const triangles, - const uint32_t countTriangles, - const Parameters& params) - = 0; - virtual bool Compute(const double* const points, - const uint32_t countPoints, - const uint32_t* const triangles, - const uint32_t countTriangles, - const Parameters& params) - = 0; - virtual uint32_t GetNConvexHulls() const = 0; - virtual void GetConvexHull(const uint32_t index, ConvexHull& ch) const = 0; - virtual void Clean(void) = 0; // release internally allocated memory - virtual void Release(void) = 0; // release IVHACD - - protected: - virtual ~IVHACD(void) {} - }; - IVHACD* CreateVHACD(void); - } -} -#endif // VHACD_H diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/FloatMath.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/FloatMath.cpp deleted file mode 100644 index 24926072ea..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/FloatMath.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "FloatMath.h" -#include - -namespace nd_ -{ - namespace FLOAT_MATH - { - #ifdef REAL - #undef REAL - #endif - #define REAL double - } -} -#include "FloatMath.inl" diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/FloatMath.inl b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/FloatMath.inl deleted file mode 100644 index b2e58dd4a5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/FloatMath.inl +++ /dev/null @@ -1,5277 +0,0 @@ -// a set of routines that let you do common 3d math -// operations without any vector, matrix, or quaternion -// classes or templates. -// -// a vector (or point) is a 'float *' to 3 floating point numbers. -// a matrix is a 'float *' to an array of 16 floating point numbers representing a 4x4 transformation matrix compatible with D3D or OGL -// a quaternion is a 'float *' to 4 floats representing a quaternion x,y,z,w -// - -namespace nd_ -{ - namespace FLOAT_MATH - { - void fm_inverseRT(const REAL matrix[16],const REAL pos[3],REAL t[3]) // inverse rotate translate the point. - { - - REAL _x = pos[0] - matrix[3*4+0]; - REAL _y = pos[1] - matrix[3*4+1]; - REAL _z = pos[2] - matrix[3*4+2]; - - // Multiply inverse-translated source vector by inverted rotation transform - - t[0] = (matrix[0*4+0] * _x) + (matrix[0*4+1] * _y) + (matrix[0*4+2] * _z); - t[1] = (matrix[1*4+0] * _x) + (matrix[1*4+1] * _y) + (matrix[1*4+2] * _z); - t[2] = (matrix[2*4+0] * _x) + (matrix[2*4+1] * _y) + (matrix[2*4+2] * _z); - - } - - REAL fm_getDeterminant(const REAL matrix[16]) - { - REAL tempv[3]; - REAL p0[3]; - REAL p1[3]; - REAL p2[3]; - - - p0[0] = matrix[0*4+0]; - p0[1] = matrix[0*4+1]; - p0[2] = matrix[0*4+2]; - - p1[0] = matrix[1*4+0]; - p1[1] = matrix[1*4+1]; - p1[2] = matrix[1*4+2]; - - p2[0] = matrix[2*4+0]; - p2[1] = matrix[2*4+1]; - p2[2] = matrix[2*4+2]; - - fm_cross(tempv,p1,p2); - - return fm_dot(p0,tempv); - - } - - REAL fm_squared(REAL x) { return x*x; } - - void fm_decomposeTransform(const REAL local_transform[16],REAL trans[3],REAL rot[4],REAL scale[3]) - { - - trans[0] = local_transform[12]; - trans[1] = local_transform[13]; - trans[2] = local_transform[14]; - - scale[0] = (REAL)sqrt(fm_squared(local_transform[0*4+0]) + fm_squared(local_transform[0*4+1]) + fm_squared(local_transform[0*4+2])); - scale[1] = (REAL)sqrt(fm_squared(local_transform[1*4+0]) + fm_squared(local_transform[1*4+1]) + fm_squared(local_transform[1*4+2])); - scale[2] = (REAL)sqrt(fm_squared(local_transform[2*4+0]) + fm_squared(local_transform[2*4+1]) + fm_squared(local_transform[2*4+2])); - - REAL m[16]; - memcpy(m,local_transform,sizeof(REAL)*16); - - REAL sx = 1.0f / scale[0]; - REAL sy = 1.0f / scale[1]; - REAL sz = 1.0f / scale[2]; - - m[0*4+0]*=sx; - m[0*4+1]*=sx; - m[0*4+2]*=sx; - - m[1*4+0]*=sy; - m[1*4+1]*=sy; - m[1*4+2]*=sy; - - m[2*4+0]*=sz; - m[2*4+1]*=sz; - m[2*4+2]*=sz; - - fm_matrixToQuat(m,rot); - - } - - void fm_getSubMatrix(int32_t ki,int32_t kj,REAL pDst[16],const REAL matrix[16]) - { - int32_t row, col; - int32_t dstCol = 0, dstRow = 0; - - for ( col = 0; col < 4; col++ ) - { - if ( col == kj ) - { - continue; - } - for ( dstRow = 0, row = 0; row < 4; row++ ) - { - if ( row == ki ) - { - continue; - } - pDst[dstCol*4+dstRow] = matrix[col*4+row]; - dstRow++; - } - dstCol++; - } - } - - void fm_inverseTransform(const REAL matrix[16],REAL inverse_matrix[16]) - { - REAL determinant = fm_getDeterminant(matrix); - determinant = 1.0f / determinant; - for (int32_t i = 0; i < 4; i++ ) - { - for (int32_t j = 0; j < 4; j++ ) - { - int32_t sign = 1 - ( ( i + j ) % 2 ) * 2; - REAL subMat[16]; - fm_identity(subMat); - fm_getSubMatrix( i, j, subMat, matrix ); - REAL subDeterminant = fm_getDeterminant(subMat); - inverse_matrix[i*4+j] = ( subDeterminant * sign ) * determinant; - } - } - } - - void fm_identity(REAL matrix[16]) // set 4x4 matrix to identity. - { - matrix[0*4+0] = 1; - matrix[1*4+1] = 1; - matrix[2*4+2] = 1; - matrix[3*4+3] = 1; - - matrix[1*4+0] = 0; - matrix[2*4+0] = 0; - matrix[3*4+0] = 0; - - matrix[0*4+1] = 0; - matrix[2*4+1] = 0; - matrix[3*4+1] = 0; - - matrix[0*4+2] = 0; - matrix[1*4+2] = 0; - matrix[3*4+2] = 0; - - matrix[0*4+3] = 0; - matrix[1*4+3] = 0; - matrix[2*4+3] = 0; - - } - - void fm_quatToEuler(const REAL quat[4],REAL &ax,REAL &ay,REAL &az) - { - REAL x = quat[0]; - REAL y = quat[1]; - REAL z = quat[2]; - REAL w = quat[3]; - - REAL sint = (2.0f * w * y) - (2.0f * x * z); - REAL cost_temp = 1.0f - (sint * sint); - REAL cost = 0; - - if ( (REAL)fabs(cost_temp) > 0.001f ) - { - cost = (REAL)sqrt( cost_temp ); - } - - REAL sinv, cosv, sinf, cosf; - if ( (REAL)fabs(cost) > 0.001f ) - { - cost = 1.0f / cost; - sinv = ((2.0f * y * z) + (2.0f * w * x)) * cost; - cosv = (1.0f - (2.0f * x * x) - (2.0f * y * y)) * cost; - sinf = ((2.0f * x * y) + (2.0f * w * z)) * cost; - cosf = (1.0f - (2.0f * y * y) - (2.0f * z * z)) * cost; - } - else - { - sinv = (2.0f * w * x) - (2.0f * y * z); - cosv = 1.0f - (2.0f * x * x) - (2.0f * z * z); - sinf = 0; - cosf = 1.0f; - } - - // compute output rotations - ax = (REAL)atan2( sinv, cosv ); - ay = (REAL)atan2( sint, cost ); - az = (REAL)atan2( sinf, cosf ); - - } - - void fm_eulerToMatrix(REAL ax,REAL ay,REAL az,REAL *matrix) // convert euler (in radians) to a dest 4x4 matrix (translation set to zero) - { - REAL quat[4]; - fm_eulerToQuat(ax,ay,az,quat); - fm_quatToMatrix(quat,matrix); - } - - void fm_getAABB(uint32_t vcount,const REAL *points,uint32_t pstride,REAL *bmin,REAL *bmax) - { - - const uint8_t *source = (const uint8_t *) points; - - bmin[0] = points[0]; - bmin[1] = points[1]; - bmin[2] = points[2]; - - bmax[0] = points[0]; - bmax[1] = points[1]; - bmax[2] = points[2]; - - - for (uint32_t i=1; i bmax[0] ) bmax[0] = p[0]; - if ( p[1] > bmax[1] ) bmax[1] = p[1]; - if ( p[2] > bmax[2] ) bmax[2] = p[2]; - - } - } - - void fm_eulerToQuat(const REAL *euler,REAL *quat) // convert euler angles to quaternion. - { - fm_eulerToQuat(euler[0],euler[1],euler[2],quat); - } - - void fm_eulerToQuat(REAL roll,REAL pitch,REAL yaw,REAL *quat) // convert euler angles to quaternion. - { - roll *= 0.5f; - pitch *= 0.5f; - yaw *= 0.5f; - - REAL cr = (REAL)cos(roll); - REAL cp = (REAL)cos(pitch); - REAL cy = (REAL)cos(yaw); - - REAL sr = (REAL)sin(roll); - REAL sp = (REAL)sin(pitch); - REAL sy = (REAL)sin(yaw); - - REAL cpcy = cp * cy; - REAL spsy = sp * sy; - REAL spcy = sp * cy; - REAL cpsy = cp * sy; - - quat[0] = ( sr * cpcy - cr * spsy); - quat[1] = ( cr * spcy + sr * cpsy); - quat[2] = ( cr * cpsy - sr * spcy); - quat[3] = cr * cpcy + sr * spsy; - } - - void fm_quatToMatrix(const REAL *quat,REAL *matrix) // convert quaterinion rotation to matrix, zeros out the translation component. - { - - REAL xx = quat[0]*quat[0]; - REAL yy = quat[1]*quat[1]; - REAL zz = quat[2]*quat[2]; - REAL xy = quat[0]*quat[1]; - REAL xz = quat[0]*quat[2]; - REAL yz = quat[1]*quat[2]; - REAL wx = quat[3]*quat[0]; - REAL wy = quat[3]*quat[1]; - REAL wz = quat[3]*quat[2]; - - matrix[0*4+0] = 1 - 2 * ( yy + zz ); - matrix[1*4+0] = 2 * ( xy - wz ); - matrix[2*4+0] = 2 * ( xz + wy ); - - matrix[0*4+1] = 2 * ( xy + wz ); - matrix[1*4+1] = 1 - 2 * ( xx + zz ); - matrix[2*4+1] = 2 * ( yz - wx ); - - matrix[0*4+2] = 2 * ( xz - wy ); - matrix[1*4+2] = 2 * ( yz + wx ); - matrix[2*4+2] = 1 - 2 * ( xx + yy ); - - matrix[3*4+0] = matrix[3*4+1] = matrix[3*4+2] = (REAL) 0.0f; - matrix[0*4+3] = matrix[1*4+3] = matrix[2*4+3] = (REAL) 0.0f; - matrix[3*4+3] =(REAL) 1.0f; - - } - - - void fm_quatRotate(const REAL *quat,const REAL *v,REAL *r) // rotate a vector directly by a quaternion. - { - REAL left[4]; - - left[0] = quat[3]*v[0] + quat[1]*v[2] - v[1]*quat[2]; - left[1] = quat[3]*v[1] + quat[2]*v[0] - v[2]*quat[0]; - left[2] = quat[3]*v[2] + quat[0]*v[1] - v[0]*quat[1]; - left[3] = - quat[0]*v[0] - quat[1]*v[1] - quat[2]*v[2]; - - r[0] = (left[3]*-quat[0]) + (quat[3]*left[0]) + (left[1]*-quat[2]) - (-quat[1]*left[2]); - r[1] = (left[3]*-quat[1]) + (quat[3]*left[1]) + (left[2]*-quat[0]) - (-quat[2]*left[0]); - r[2] = (left[3]*-quat[2]) + (quat[3]*left[2]) + (left[0]*-quat[1]) - (-quat[0]*left[1]); - - } - - - void fm_getTranslation(const REAL *matrix,REAL *t) - { - t[0] = matrix[3*4+0]; - t[1] = matrix[3*4+1]; - t[2] = matrix[3*4+2]; - } - - void fm_matrixToQuat(const REAL *matrix,REAL *quat) // convert the 3x3 portion of a 4x4 matrix into a quaterion as x,y,z,w - { - - REAL tr = matrix[0*4+0] + matrix[1*4+1] + matrix[2*4+2]; - - // check the diagonal - - if (tr > 0.0f ) - { - REAL s = (REAL) sqrt ( (double) (tr + 1.0f) ); - quat[3] = s * 0.5f; - s = 0.5f / s; - quat[0] = (matrix[1*4+2] - matrix[2*4+1]) * s; - quat[1] = (matrix[2*4+0] - matrix[0*4+2]) * s; - quat[2] = (matrix[0*4+1] - matrix[1*4+0]) * s; - - } - else - { - // diagonal is negative - int32_t nxt[3] = {1, 2, 0}; - REAL qa[4]; - - int32_t i = 0; - - if (matrix[1*4+1] > matrix[0*4+0]) i = 1; - if (matrix[2*4+2] > matrix[i*4+i]) i = 2; - - int32_t j = nxt[i]; - int32_t k = nxt[j]; - - REAL s = (REAL)sqrt ( ((matrix[i*4+i] - (matrix[j*4+j] + matrix[k*4+k])) + 1.0f) ); - - qa[i] = s * 0.5f; - - if (s != 0.0f ) s = 0.5f / s; - - qa[3] = (matrix[j*4+k] - matrix[k*4+j]) * s; - qa[j] = (matrix[i*4+j] + matrix[j*4+i]) * s; - qa[k] = (matrix[i*4+k] + matrix[k*4+i]) * s; - - quat[0] = qa[0]; - quat[1] = qa[1]; - quat[2] = qa[2]; - quat[3] = qa[3]; - } - // fm_normalizeQuat(quat); - } - - - REAL fm_sphereVolume(REAL radius) // return's the volume of a sphere of this radius (4/3 PI * R cubed ) - { - return (4.0f / 3.0f ) * FM_PI * radius * radius * radius; - } - - - REAL fm_cylinderVolume(REAL radius,REAL h) - { - return FM_PI * radius * radius *h; - } - - REAL fm_capsuleVolume(REAL radius,REAL h) - { - REAL volume = fm_sphereVolume(radius); // volume of the sphere portion. - REAL ch = h-radius*2; // this is the cylinder length - if ( ch > 0 ) - { - volume+=fm_cylinderVolume(radius,ch); - } - return volume; - } - - void fm_transform(const REAL matrix[16],const REAL v[3],REAL t[3]) // rotate and translate this point - { - if ( matrix ) - { - REAL tx = (matrix[0*4+0] * v[0]) + (matrix[1*4+0] * v[1]) + (matrix[2*4+0] * v[2]) + matrix[3*4+0]; - REAL ty = (matrix[0*4+1] * v[0]) + (matrix[1*4+1] * v[1]) + (matrix[2*4+1] * v[2]) + matrix[3*4+1]; - REAL tz = (matrix[0*4+2] * v[0]) + (matrix[1*4+2] * v[1]) + (matrix[2*4+2] * v[2]) + matrix[3*4+2]; - t[0] = tx; - t[1] = ty; - t[2] = tz; - } - else - { - t[0] = v[0]; - t[1] = v[1]; - t[2] = v[2]; - } - } - - void fm_rotate(const REAL matrix[16],const REAL v[3],REAL t[3]) // rotate and translate this point - { - if ( matrix ) - { - REAL tx = (matrix[0*4+0] * v[0]) + (matrix[1*4+0] * v[1]) + (matrix[2*4+0] * v[2]); - REAL ty = (matrix[0*4+1] * v[0]) + (matrix[1*4+1] * v[1]) + (matrix[2*4+1] * v[2]); - REAL tz = (matrix[0*4+2] * v[0]) + (matrix[1*4+2] * v[1]) + (matrix[2*4+2] * v[2]); - t[0] = tx; - t[1] = ty; - t[2] = tz; - } - else - { - t[0] = v[0]; - t[1] = v[1]; - t[2] = v[2]; - } - } - - - REAL fm_distance(const REAL *p1,const REAL *p2) - { - REAL dx = p1[0] - p2[0]; - REAL dy = p1[1] - p2[1]; - REAL dz = p1[2] - p2[2]; - - return (REAL)sqrt( dx*dx + dy*dy + dz *dz ); - } - - REAL fm_distanceSquared(const REAL *p1,const REAL *p2) - { - REAL dx = p1[0] - p2[0]; - REAL dy = p1[1] - p2[1]; - REAL dz = p1[2] - p2[2]; - - return dx*dx + dy*dy + dz *dz; - } - - - REAL fm_distanceSquaredXZ(const REAL *p1,const REAL *p2) - { - REAL dx = p1[0] - p2[0]; - REAL dz = p1[2] - p2[2]; - - return dx*dx + dz *dz; - } - - - REAL fm_computePlane(const REAL *A,const REAL *B,const REAL *C,REAL *n) // returns D - { - REAL vx = (B[0] - C[0]); - REAL vy = (B[1] - C[1]); - REAL vz = (B[2] - C[2]); - - REAL wx = (A[0] - B[0]); - REAL wy = (A[1] - B[1]); - REAL wz = (A[2] - B[2]); - - REAL vw_x = vy * wz - vz * wy; - REAL vw_y = vz * wx - vx * wz; - REAL vw_z = vx * wy - vy * wx; - - REAL mag = (REAL)sqrt((vw_x * vw_x) + (vw_y * vw_y) + (vw_z * vw_z)); - - if ( mag < 0.000001f ) - { - mag = 0; - } - else - { - mag = 1.0f/mag; - } - - REAL x = vw_x * mag; - REAL y = vw_y * mag; - REAL z = vw_z * mag; - - - REAL D = 0.0f - ((x*A[0])+(y*A[1])+(z*A[2])); - - n[0] = x; - n[1] = y; - n[2] = z; - - return D; - } - - REAL fm_distToPlane(const REAL *plane,const REAL *p) // computes the distance of this point from the plane. - { - return p[0]*plane[0]+p[1]*plane[1]+p[2]*plane[2]+plane[3]; - } - - REAL fm_dot(const REAL *p1,const REAL *p2) - { - return p1[0]*p2[0]+p1[1]*p2[1]+p1[2]*p2[2]; - } - - void fm_cross(REAL *cross,const REAL *a,const REAL *b) - { - cross[0] = a[1]*b[2] - a[2]*b[1]; - cross[1] = a[2]*b[0] - a[0]*b[2]; - cross[2] = a[0]*b[1] - a[1]*b[0]; - } - - REAL fm_computeNormalVector(REAL *n,const REAL *p1,const REAL *p2) - { - n[0] = p2[0] - p1[0]; - n[1] = p2[1] - p1[1]; - n[2] = p2[2] - p1[2]; - return fm_normalize(n); - } - - bool fm_computeWindingOrder(const REAL *p1,const REAL *p2,const REAL *p3) // returns true if the triangle is clockwise. - { - bool ret = false; - - REAL v1[3]; - REAL v2[3]; - - fm_computeNormalVector(v1,p1,p2); // p2-p1 (as vector) and then normalized - fm_computeNormalVector(v2,p1,p3); // p3-p1 (as vector) and then normalized - - REAL cross[3]; - - fm_cross(cross, v1, v2 ); - REAL ref[3] = { 1, 0, 0 }; - - REAL d = fm_dot( cross, ref ); - - - if ( d <= 0 ) - ret = false; - else - ret = true; - - return ret; - } - - REAL fm_normalize(REAL *n) // normalize this vector - { - REAL dist = (REAL)sqrt(n[0]*n[0] + n[1]*n[1] + n[2]*n[2]); - if ( dist > 0.0000001f ) - { - REAL mag = 1.0f / dist; - n[0]*=mag; - n[1]*=mag; - n[2]*=mag; - } - else - { - n[0] = 1; - n[1] = 0; - n[2] = 0; - } - - return dist; - } - - - void fm_matrixMultiply(const REAL *pA,const REAL *pB,REAL *pM) - { - #if 1 - - REAL a = pA[0*4+0] * pB[0*4+0] + pA[0*4+1] * pB[1*4+0] + pA[0*4+2] * pB[2*4+0] + pA[0*4+3] * pB[3*4+0]; - REAL b = pA[0*4+0] * pB[0*4+1] + pA[0*4+1] * pB[1*4+1] + pA[0*4+2] * pB[2*4+1] + pA[0*4+3] * pB[3*4+1]; - REAL c = pA[0*4+0] * pB[0*4+2] + pA[0*4+1] * pB[1*4+2] + pA[0*4+2] * pB[2*4+2] + pA[0*4+3] * pB[3*4+2]; - REAL d = pA[0*4+0] * pB[0*4+3] + pA[0*4+1] * pB[1*4+3] + pA[0*4+2] * pB[2*4+3] + pA[0*4+3] * pB[3*4+3]; - - REAL e = pA[1*4+0] * pB[0*4+0] + pA[1*4+1] * pB[1*4+0] + pA[1*4+2] * pB[2*4+0] + pA[1*4+3] * pB[3*4+0]; - REAL f = pA[1*4+0] * pB[0*4+1] + pA[1*4+1] * pB[1*4+1] + pA[1*4+2] * pB[2*4+1] + pA[1*4+3] * pB[3*4+1]; - REAL g = pA[1*4+0] * pB[0*4+2] + pA[1*4+1] * pB[1*4+2] + pA[1*4+2] * pB[2*4+2] + pA[1*4+3] * pB[3*4+2]; - REAL h = pA[1*4+0] * pB[0*4+3] + pA[1*4+1] * pB[1*4+3] + pA[1*4+2] * pB[2*4+3] + pA[1*4+3] * pB[3*4+3]; - - REAL i = pA[2*4+0] * pB[0*4+0] + pA[2*4+1] * pB[1*4+0] + pA[2*4+2] * pB[2*4+0] + pA[2*4+3] * pB[3*4+0]; - REAL j = pA[2*4+0] * pB[0*4+1] + pA[2*4+1] * pB[1*4+1] + pA[2*4+2] * pB[2*4+1] + pA[2*4+3] * pB[3*4+1]; - REAL k = pA[2*4+0] * pB[0*4+2] + pA[2*4+1] * pB[1*4+2] + pA[2*4+2] * pB[2*4+2] + pA[2*4+3] * pB[3*4+2]; - REAL l = pA[2*4+0] * pB[0*4+3] + pA[2*4+1] * pB[1*4+3] + pA[2*4+2] * pB[2*4+3] + pA[2*4+3] * pB[3*4+3]; - - REAL m = pA[3*4+0] * pB[0*4+0] + pA[3*4+1] * pB[1*4+0] + pA[3*4+2] * pB[2*4+0] + pA[3*4+3] * pB[3*4+0]; - REAL n = pA[3*4+0] * pB[0*4+1] + pA[3*4+1] * pB[1*4+1] + pA[3*4+2] * pB[2*4+1] + pA[3*4+3] * pB[3*4+1]; - REAL o = pA[3*4+0] * pB[0*4+2] + pA[3*4+1] * pB[1*4+2] + pA[3*4+2] * pB[2*4+2] + pA[3*4+3] * pB[3*4+2]; - REAL p = pA[3*4+0] * pB[0*4+3] + pA[3*4+1] * pB[1*4+3] + pA[3*4+2] * pB[2*4+3] + pA[3*4+3] * pB[3*4+3]; - - pM[0] = a; - pM[1] = b; - pM[2] = c; - pM[3] = d; - - pM[4] = e; - pM[5] = f; - pM[6] = g; - pM[7] = h; - - pM[8] = i; - pM[9] = j; - pM[10] = k; - pM[11] = l; - - pM[12] = m; - pM[13] = n; - pM[14] = o; - pM[15] = p; - - - #else - memset(pM, 0, sizeof(REAL)*16); - for(int32_t i=0; i<4; i++ ) - for(int32_t j=0; j<4; j++ ) - for(int32_t k=0; k<4; k++ ) - pM[4*i+j] += pA[4*i+k] * pB[4*k+j]; - #endif - } - - - void fm_eulerToQuatDX(REAL x,REAL y,REAL z,REAL *quat) // convert euler angles to quaternion using the fucked up DirectX method - { - REAL matrix[16]; - fm_eulerToMatrix(x,y,z,matrix); - fm_matrixToQuat(matrix,quat); - } - - // implementation copied from: http://blogs.msdn.com/mikepelton/archive/2004/10/29/249501.aspx - void fm_eulerToMatrixDX(REAL x,REAL y,REAL z,REAL *matrix) // convert euler angles to quaternion using the fucked up DirectX method. - { - fm_identity(matrix); - matrix[0*4+0] = (REAL)(cos(z)*cos(y) + sin(z)*sin(x)*sin(y)); - matrix[0*4+1] = (REAL)(sin(z)*cos(x)); - matrix[0*4+2] = (REAL)(cos(z)*-sin(y) + sin(z)*sin(x)*cos(y)); - - matrix[1*4+0] = (REAL)(-sin(z)*cos(y)+cos(z)*sin(x)*sin(y)); - matrix[1*4+1] = (REAL)(cos(z)*cos(x)); - matrix[1*4+2] = (REAL)(sin(z)*sin(y) +cos(z)*sin(x)*cos(y)); - - matrix[2*4+0] = (REAL)(cos(x)*sin(y)); - matrix[2*4+1] = (REAL)(-sin(x)); - matrix[2*4+2] = (REAL)(cos(x)*cos(y)); - } - - - void fm_scale(REAL x,REAL y,REAL z,REAL *fscale) // apply scale to the matrix. - { - fscale[0*4+0] = x; - fscale[1*4+1] = y; - fscale[2*4+2] = z; - } - - - void fm_composeTransform(const REAL *position,const REAL *quat,const REAL *scale,REAL *matrix) - { - fm_identity(matrix); - fm_quatToMatrix(quat,matrix); - - if ( scale && ( scale[0] != 1 || scale[1] != 1 || scale[2] != 1 ) ) - { - REAL work[16]; - memcpy(work,matrix,sizeof(REAL)*16); - REAL mscale[16]; - fm_identity(mscale); - fm_scale(scale[0],scale[1],scale[2],mscale); - fm_matrixMultiply(work,mscale,matrix); - } - - matrix[12] = position[0]; - matrix[13] = position[1]; - matrix[14] = position[2]; - } - - - void fm_setTranslation(const REAL *translation,REAL *matrix) - { - matrix[12] = translation[0]; - matrix[13] = translation[1]; - matrix[14] = translation[2]; - } - - static REAL enorm0_3d ( REAL x0, REAL y0, REAL z0, REAL x1, REAL y1, REAL z1 ) - - /**********************************************************************/ - - /* - Purpose: - - ENORM0_3D computes the Euclidean norm of (P1-P0) in 3D. - - Modified: - - 18 April 1999 - - Author: - - John Burkardt - - Parameters: - - Input, REAL X0, Y0, Z0, X1, Y1, Z1, the coordinates of the points - P0 and P1. - - Output, REAL ENORM0_3D, the Euclidean norm of (P1-P0). - */ - { - REAL value; - - value = (REAL)sqrt ( - ( x1 - x0 ) * ( x1 - x0 ) + - ( y1 - y0 ) * ( y1 - y0 ) + - ( z1 - z0 ) * ( z1 - z0 ) ); - - return value; - } - - - static REAL triangle_area_3d ( REAL x1, REAL y1, REAL z1, REAL x2,REAL y2, REAL z2, REAL x3, REAL y3, REAL z3 ) - - /**********************************************************************/ - - /* - Purpose: - - TRIANGLE_AREA_3D computes the area of a triangle in 3D. - - Modified: - - 22 April 1999 - - Author: - - John Burkardt - - Parameters: - - Input, REAL X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, the (X,Y,Z) - coordinates of the corners of the triangle. - - Output, REAL TRIANGLE_AREA_3D, the area of the triangle. - */ - { - REAL a; - REAL alpha; - REAL area; - REAL b; - REAL base; - REAL c; - REAL dot; - REAL height; - /* - Find the projection of (P3-P1) onto (P2-P1). - */ - dot = - ( x2 - x1 ) * ( x3 - x1 ) + - ( y2 - y1 ) * ( y3 - y1 ) + - ( z2 - z1 ) * ( z3 - z1 ); - - base = enorm0_3d ( x1, y1, z1, x2, y2, z2 ); - /* - The height of the triangle is the length of (P3-P1) after its - projection onto (P2-P1) has been subtracted. - */ - if ( base == 0.0 ) { - - height = 0.0; - - } - else { - - alpha = dot / ( base * base ); - - a = x3 - x1 - alpha * ( x2 - x1 ); - b = y3 - y1 - alpha * ( y2 - y1 ); - c = z3 - z1 - alpha * ( z2 - z1 ); - - height = (REAL)sqrt ( a * a + b * b + c * c ); - - } - - area = 0.5f * base * height; - - return area; - } - - - REAL fm_computeArea(const REAL *p1,const REAL *p2,const REAL *p3) - { - REAL ret = 0; - - ret = triangle_area_3d(p1[0],p1[1],p1[2],p2[0],p2[1],p2[2],p3[0],p3[1],p3[2]); - - return ret; - } - - - void fm_lerp(const REAL *p1,const REAL *p2,REAL *dest,REAL lerpValue) - { - dest[0] = ((p2[0] - p1[0])*lerpValue) + p1[0]; - dest[1] = ((p2[1] - p1[1])*lerpValue) + p1[1]; - dest[2] = ((p2[2] - p1[2])*lerpValue) + p1[2]; - } - - bool fm_pointTestXZ(const REAL *p,const REAL *i,const REAL *j) - { - bool ret = false; - - if (((( i[2] <= p[2] ) && ( p[2] < j[2] )) || (( j[2] <= p[2] ) && ( p[2] < i[2] ))) && ( p[0] < (j[0] - i[0]) * (p[2] - i[2]) / (j[2] - i[2]) + i[0])) - ret = true; - - return ret; - } - - - bool fm_insideTriangleXZ(const REAL *p,const REAL *p1,const REAL *p2,const REAL *p3) - { - bool ret = false; - - int32_t c = 0; - if ( fm_pointTestXZ(p,p1,p2) ) c = !c; - if ( fm_pointTestXZ(p,p2,p3) ) c = !c; - if ( fm_pointTestXZ(p,p3,p1) ) c = !c; - if ( c ) ret = true; - - return ret; - } - - bool fm_insideAABB(const REAL *pos,const REAL *bmin,const REAL *bmax) - { - bool ret = false; - - if ( pos[0] >= bmin[0] && pos[0] <= bmax[0] && - pos[1] >= bmin[1] && pos[1] <= bmax[1] && - pos[2] >= bmin[2] && pos[2] <= bmax[2] ) - ret = true; - - return ret; - } - - - uint32_t fm_clipTestPoint(const REAL *bmin,const REAL *bmax,const REAL *pos) - { - uint32_t ret = 0; - - if ( pos[0] < bmin[0] ) - ret|=FMCS_XMIN; - else if ( pos[0] > bmax[0] ) - ret|=FMCS_XMAX; - - if ( pos[1] < bmin[1] ) - ret|=FMCS_YMIN; - else if ( pos[1] > bmax[1] ) - ret|=FMCS_YMAX; - - if ( pos[2] < bmin[2] ) - ret|=FMCS_ZMIN; - else if ( pos[2] > bmax[2] ) - ret|=FMCS_ZMAX; - - return ret; - } - - uint32_t fm_clipTestPointXZ(const REAL *bmin,const REAL *bmax,const REAL *pos) // only tests X and Z, not Y - { - uint32_t ret = 0; - - if ( pos[0] < bmin[0] ) - ret|=FMCS_XMIN; - else if ( pos[0] > bmax[0] ) - ret|=FMCS_XMAX; - - if ( pos[2] < bmin[2] ) - ret|=FMCS_ZMIN; - else if ( pos[2] > bmax[2] ) - ret|=FMCS_ZMAX; - - return ret; - } - - uint32_t fm_clipTestAABB(const REAL *bmin,const REAL *bmax,const REAL *p1,const REAL *p2,const REAL *p3,uint32_t &andCode) - { - uint32_t orCode = 0; - - andCode = FMCS_XMIN | FMCS_XMAX | FMCS_YMIN | FMCS_YMAX | FMCS_ZMIN | FMCS_ZMAX; - - uint32_t c = fm_clipTestPoint(bmin,bmax,p1); - orCode|=c; - andCode&=c; - - c = fm_clipTestPoint(bmin,bmax,p2); - orCode|=c; - andCode&=c; - - c = fm_clipTestPoint(bmin,bmax,p3); - orCode|=c; - andCode&=c; - - return orCode; - } - - bool intersect(const REAL *si,const REAL *ei,const REAL *bmin,const REAL *bmax,REAL *time) - { - REAL st,et,fst = 0,fet = 1; - - for (int32_t i = 0; i < 3; i++) - { - if (*si < *ei) - { - if (*si > *bmax || *ei < *bmin) - return false; - REAL di = *ei - *si; - st = (*si < *bmin)? (*bmin - *si) / di: 0; - et = (*ei > *bmax)? (*bmax - *si) / di: 1; - } - else - { - if (*ei > *bmax || *si < *bmin) - return false; - REAL di = *ei - *si; - st = (*si > *bmax)? (*bmax - *si) / di: 0; - et = (*ei < *bmin)? (*bmin - *si) / di: 1; - } - - if (st > fst) fst = st; - if (et < fet) fet = et; - if (fet < fst) - return false; - bmin++; bmax++; - si++; ei++; - } - - *time = fst; - return true; - } - - - - bool fm_lineTestAABB(const REAL *p1,const REAL *p2,const REAL *bmin,const REAL *bmax,REAL &time) - { - bool sect = intersect(p1,p2,bmin,bmax,&time); - return sect; - } - - - bool fm_lineTestAABBXZ(const REAL *p1,const REAL *p2,const REAL *bmin,const REAL *bmax,REAL &time) - { - REAL _bmin[3]; - REAL _bmax[3]; - - _bmin[0] = bmin[0]; - _bmin[1] = -1e9; - _bmin[2] = bmin[2]; - - _bmax[0] = bmax[0]; - _bmax[1] = 1e9; - _bmax[2] = bmax[2]; - - bool sect = intersect(p1,p2,_bmin,_bmax,&time); - - return sect; - } - - void fm_minmax(const REAL *p,REAL *bmin,REAL *bmax) // accmulate to a min-max value - { - - if ( p[0] < bmin[0] ) bmin[0] = p[0]; - if ( p[1] < bmin[1] ) bmin[1] = p[1]; - if ( p[2] < bmin[2] ) bmin[2] = p[2]; - - if ( p[0] > bmax[0] ) bmax[0] = p[0]; - if ( p[1] > bmax[1] ) bmax[1] = p[1]; - if ( p[2] > bmax[2] ) bmax[2] = p[2]; - - } - - REAL fm_solveX(const REAL *plane,REAL y,REAL z) // solve for X given this plane equation and the other two components. - { - REAL x = (y*plane[1]+z*plane[2]+plane[3]) / -plane[0]; - return x; - } - - REAL fm_solveY(const REAL *plane,REAL x,REAL z) // solve for Y given this plane equation and the other two components. - { - REAL y = (x*plane[0]+z*plane[2]+plane[3]) / -plane[1]; - return y; - } - - - REAL fm_solveZ(const REAL *plane,REAL x,REAL y) // solve for Y given this plane equation and the other two components. - { - REAL z = (x*plane[0]+y*plane[1]+plane[3]) / -plane[2]; - return z; - } - - - void fm_getAABBCenter(const REAL *bmin,const REAL *bmax,REAL *center) - { - center[0] = (bmax[0]-bmin[0])*0.5f+bmin[0]; - center[1] = (bmax[1]-bmin[1])*0.5f+bmin[1]; - center[2] = (bmax[2]-bmin[2])*0.5f+bmin[2]; - } - - FM_Axis fm_getDominantAxis(const REAL normal[3]) - { - FM_Axis ret = FM_XAXIS; - - REAL x = (REAL)fabs(normal[0]); - REAL y = (REAL)fabs(normal[1]); - REAL z = (REAL)fabs(normal[2]); - - if ( y > x && y > z ) - ret = FM_YAXIS; - else if ( z > x && z > y ) - ret = FM_ZAXIS; - - return ret; - } - - - bool fm_lineSphereIntersect(const REAL *center,REAL radius,const REAL *p1,const REAL *p2,REAL *intersect) - { - bool ret = false; - - REAL dir[3]; - - dir[0] = p2[0]-p1[0]; - dir[1] = p2[1]-p1[1]; - dir[2] = p2[2]-p1[2]; - - REAL distance = (REAL)sqrt( dir[0]*dir[0]+dir[1]*dir[1]+dir[2]*dir[2]); - - if ( distance > 0 ) - { - REAL recip = 1.0f / distance; - dir[0]*=recip; - dir[1]*=recip; - dir[2]*=recip; - ret = fm_raySphereIntersect(center,radius,p1,dir,distance,intersect); - } - else - { - dir[0] = center[0]-p1[0]; - dir[1] = center[1]-p1[1]; - dir[2] = center[2]-p1[2]; - REAL d2 = dir[0]*dir[0]+dir[1]*dir[1]+dir[2]*dir[2]; - REAL r2 = radius*radius; - if ( d2 < r2 ) - { - ret = true; - if ( intersect ) - { - intersect[0] = p1[0]; - intersect[1] = p1[1]; - intersect[2] = p1[2]; - } - } - } - return ret; - } - - #define DOT(p1,p2) (p1[0]*p2[0]+p1[1]*p2[1]+p1[2]*p2[2]) - - bool fm_raySphereIntersect(const REAL *center,REAL radius,const REAL *pos,const REAL *dir,REAL distance,REAL *intersect) - { - bool ret = false; - - REAL E0[3]; - - E0[0] = center[0] - pos[0]; - E0[1] = center[1] - pos[1]; - E0[2] = center[2] - pos[2]; - - REAL V[3]; - - V[0] = dir[0]; - V[1] = dir[1]; - V[2] = dir[2]; - - - REAL dist2 = E0[0]*E0[0] + E0[1]*E0[1] + E0[2] * E0[2]; - REAL radius2 = radius*radius; // radius squared.. - - // Bug Fix For Gem, if origin is *inside* the sphere, invert the - // direction vector so that we get a valid intersection location. - if ( dist2 < radius2 ) - { - V[0]*=-1; - V[1]*=-1; - V[2]*=-1; - } - - - REAL v = DOT(E0,V); - - REAL disc = radius2 - (dist2 - v*v); - - if (disc > 0.0f) - { - if ( intersect ) - { - REAL d = (REAL)sqrt(disc); - REAL diff = v-d; - if ( diff < distance ) - { - intersect[0] = pos[0]+V[0]*diff; - intersect[1] = pos[1]+V[1]*diff; - intersect[2] = pos[2]+V[2]*diff; - ret = true; - } - } - } - - return ret; - } - - - void fm_catmullRom(REAL *out_vector,const REAL *p1,const REAL *p2,const REAL *p3,const REAL *p4, const REAL s) - { - REAL s_squared = s * s; - REAL s_cubed = s_squared * s; - - REAL coefficient_p1 = -s_cubed + 2*s_squared - s; - REAL coefficient_p2 = 3 * s_cubed - 5 * s_squared + 2; - REAL coefficient_p3 = -3 * s_cubed +4 * s_squared + s; - REAL coefficient_p4 = s_cubed - s_squared; - - out_vector[0] = (coefficient_p1 * p1[0] + coefficient_p2 * p2[0] + coefficient_p3 * p3[0] + coefficient_p4 * p4[0])*0.5f; - out_vector[1] = (coefficient_p1 * p1[1] + coefficient_p2 * p2[1] + coefficient_p3 * p3[1] + coefficient_p4 * p4[1])*0.5f; - out_vector[2] = (coefficient_p1 * p1[2] + coefficient_p2 * p2[2] + coefficient_p3 * p3[2] + coefficient_p4 * p4[2])*0.5f; - } - - bool fm_intersectAABB(const REAL *bmin1,const REAL *bmax1,const REAL *bmin2,const REAL *bmax2) - { - if ((bmin1[0] > bmax2[0]) || (bmin2[0] > bmax1[0])) return false; - if ((bmin1[1] > bmax2[1]) || (bmin2[1] > bmax1[1])) return false; - if ((bmin1[2] > bmax2[2]) || (bmin2[2] > bmax1[2])) return false; - return true; - - } - - bool fm_insideAABB(const REAL *obmin,const REAL *obmax,const REAL *tbmin,const REAL *tbmax) // test if bounding box tbmin/tmbax is fully inside obmin/obmax - { - bool ret = false; - - if ( tbmax[0] <= obmax[0] && - tbmax[1] <= obmax[1] && - tbmax[2] <= obmax[2] && - tbmin[0] >= obmin[0] && - tbmin[1] >= obmin[1] && - tbmin[2] >= obmin[2] ) ret = true; - - return ret; - } - - - // Reference, from Stan Melax in Game Gems I - // Quaternion q; - // vector3 c = CrossProduct(v0,v1); - // REAL d = DotProduct(v0,v1); - // REAL s = (REAL)sqrt((1+d)*2); - // q.x = c.x / s; - // q.y = c.y / s; - // q.z = c.z / s; - // q.w = s /2.0f; - // return q; - void fm_rotationArc(const REAL *v0,const REAL *v1,REAL *quat) - { - REAL cross[3]; - - fm_cross(cross,v0,v1); - REAL d = fm_dot(v0,v1); - - if( d<= -0.99999f ) // 180 about x axis - { - if ( fabsf((float)v0[0]) < 0.1f ) - { - quat[0] = 0; - quat[1] = v0[2]; - quat[2] = -v0[1]; - quat[3] = 0; - } - else - { - quat[0] = v0[1]; - quat[1] = -v0[0]; - quat[2] = 0; - quat[3] = 0; - } - REAL magnitudeSquared = quat[0]*quat[0] + quat[1]*quat[1] + quat[2]*quat[2] + quat[3]*quat[3]; - REAL magnitude = sqrtf((float)magnitudeSquared); - REAL recip = 1.0f / magnitude; - quat[0]*=recip; - quat[1]*=recip; - quat[2]*=recip; - quat[3]*=recip; - } - else - { - REAL s = (REAL)sqrt((1+d)*2); - REAL recip = 1.0f / s; - - quat[0] = cross[0] * recip; - quat[1] = cross[1] * recip; - quat[2] = cross[2] * recip; - quat[3] = s * 0.5f; - } - } - - - REAL fm_distancePointLineSegment(const REAL *Point,const REAL *LineStart,const REAL *LineEnd,REAL *intersection,LineSegmentType &type,REAL epsilon) - { - REAL ret; - - REAL LineMag = fm_distance( LineEnd, LineStart ); - - if ( LineMag > 0 ) - { - REAL U = ( ( ( Point[0] - LineStart[0] ) * ( LineEnd[0] - LineStart[0] ) ) + ( ( Point[1] - LineStart[1] ) * ( LineEnd[1] - LineStart[1] ) ) + ( ( Point[2] - LineStart[2] ) * ( LineEnd[2] - LineStart[2] ) ) ) / ( LineMag * LineMag ); - if( U < 0.0f || U > 1.0f ) - { - REAL d1 = fm_distanceSquared(Point,LineStart); - REAL d2 = fm_distanceSquared(Point,LineEnd); - if ( d1 <= d2 ) - { - ret = (REAL)sqrt(d1); - intersection[0] = LineStart[0]; - intersection[1] = LineStart[1]; - intersection[2] = LineStart[2]; - type = LS_START; - } - else - { - ret = (REAL)sqrt(d2); - intersection[0] = LineEnd[0]; - intersection[1] = LineEnd[1]; - intersection[2] = LineEnd[2]; - type = LS_END; - } - } - else - { - intersection[0] = LineStart[0] + U * ( LineEnd[0] - LineStart[0] ); - intersection[1] = LineStart[1] + U * ( LineEnd[1] - LineStart[1] ); - intersection[2] = LineStart[2] + U * ( LineEnd[2] - LineStart[2] ); - - ret = fm_distance(Point,intersection); - - REAL d1 = fm_distanceSquared(intersection,LineStart); - REAL d2 = fm_distanceSquared(intersection,LineEnd); - REAL mag = (epsilon*2)*(epsilon*2); - - if ( d1 < mag ) // if less than 1/100th the total distance, treat is as the 'start' - { - type = LS_START; - } - else if ( d2 < mag ) - { - type = LS_END; - } - else - { - type = LS_MIDDLE; - } - - } - } - else - { - ret = LineMag; - intersection[0] = LineEnd[0]; - intersection[1] = LineEnd[1]; - intersection[2] = LineEnd[2]; - type = LS_END; - } - - return ret; - } - - - #ifndef BEST_FIT_PLANE_H - - #define BEST_FIT_PLANE_H - - template class Eigen - { - public: - - - void DecrSortEigenStuff(void) - { - Tridiagonal(); //diagonalize the matrix. - QLAlgorithm(); // - DecreasingSort(); - GuaranteeRotation(); - } - - void Tridiagonal(void) - { - Type fM00 = mElement[0][0]; - Type fM01 = mElement[0][1]; - Type fM02 = mElement[0][2]; - Type fM11 = mElement[1][1]; - Type fM12 = mElement[1][2]; - Type fM22 = mElement[2][2]; - - m_afDiag[0] = fM00; - m_afSubd[2] = 0; - if (fM02 != (Type)0.0) - { - Type fLength = (REAL)sqrt(fM01*fM01+fM02*fM02); - Type fInvLength = ((Type)1.0)/fLength; - fM01 *= fInvLength; - fM02 *= fInvLength; - Type fQ = ((Type)2.0)*fM01*fM12+fM02*(fM22-fM11); - m_afDiag[1] = fM11+fM02*fQ; - m_afDiag[2] = fM22-fM02*fQ; - m_afSubd[0] = fLength; - m_afSubd[1] = fM12-fM01*fQ; - mElement[0][0] = (Type)1.0; - mElement[0][1] = (Type)0.0; - mElement[0][2] = (Type)0.0; - mElement[1][0] = (Type)0.0; - mElement[1][1] = fM01; - mElement[1][2] = fM02; - mElement[2][0] = (Type)0.0; - mElement[2][1] = fM02; - mElement[2][2] = -fM01; - m_bIsRotation = false; - } - else - { - m_afDiag[1] = fM11; - m_afDiag[2] = fM22; - m_afSubd[0] = fM01; - m_afSubd[1] = fM12; - mElement[0][0] = (Type)1.0; - mElement[0][1] = (Type)0.0; - mElement[0][2] = (Type)0.0; - mElement[1][0] = (Type)0.0; - mElement[1][1] = (Type)1.0; - mElement[1][2] = (Type)0.0; - mElement[2][0] = (Type)0.0; - mElement[2][1] = (Type)0.0; - mElement[2][2] = (Type)1.0; - m_bIsRotation = true; - } - } - - bool QLAlgorithm(void) - { - const int32_t iMaxIter = 32; - - for (int32_t i0 = 0; i0 <3; i0++) - { - int32_t i1; - for (i1 = 0; i1 < iMaxIter; i1++) - { - int32_t i2; - for (i2 = i0; i2 <= (3-2); i2++) - { - Type fTmp = fabs(m_afDiag[i2]) + fabs(m_afDiag[i2+1]); - if ( fabs(m_afSubd[i2]) + fTmp == fTmp ) - break; - } - if (i2 == i0) - { - break; - } - - Type fG = (m_afDiag[i0+1] - m_afDiag[i0])/(((Type)2.0) * m_afSubd[i0]); - Type fR = (REAL)sqrt(fG*fG+(Type)1.0); - if (fG < (Type)0.0) - { - fG = m_afDiag[i2]-m_afDiag[i0]+m_afSubd[i0]/(fG-fR); - } - else - { - fG = m_afDiag[i2]-m_afDiag[i0]+m_afSubd[i0]/(fG+fR); - } - Type fSin = (Type)1.0, fCos = (Type)1.0, fP = (Type)0.0; - for (int32_t i3 = i2-1; i3 >= i0; i3--) - { - Type fF = fSin*m_afSubd[i3]; - Type fB = fCos*m_afSubd[i3]; - if (fabs(fF) >= fabs(fG)) - { - fCos = fG/fF; - fR = (REAL)sqrt(fCos*fCos+(Type)1.0); - m_afSubd[i3+1] = fF*fR; - fSin = ((Type)1.0)/fR; - fCos *= fSin; - } - else - { - fSin = fF/fG; - fR = (REAL)sqrt(fSin*fSin+(Type)1.0); - m_afSubd[i3+1] = fG*fR; - fCos = ((Type)1.0)/fR; - fSin *= fCos; - } - fG = m_afDiag[i3+1]-fP; - fR = (m_afDiag[i3]-fG)*fSin+((Type)2.0)*fB*fCos; - fP = fSin*fR; - m_afDiag[i3+1] = fG+fP; - fG = fCos*fR-fB; - for (int32_t i4 = 0; i4 < 3; i4++) - { - fF = mElement[i4][i3+1]; - mElement[i4][i3+1] = fSin*mElement[i4][i3]+fCos*fF; - mElement[i4][i3] = fCos*mElement[i4][i3]-fSin*fF; - } - } - m_afDiag[i0] -= fP; - m_afSubd[i0] = fG; - m_afSubd[i2] = (Type)0.0; - } - if (i1 == iMaxIter) - { - return false; - } - } - return true; - } - - void DecreasingSort(void) - { - //sort eigenvalues in decreasing order, e[0] >= ... >= e[iSize-1] - for (int32_t i0 = 0, i1; i0 <= 3-2; i0++) - { - // locate maximum eigenvalue - i1 = i0; - Type fMax = m_afDiag[i1]; - int32_t i2; - for (i2 = i0+1; i2 < 3; i2++) - { - if (m_afDiag[i2] > fMax) - { - i1 = i2; - fMax = m_afDiag[i1]; - } - } - - if (i1 != i0) - { - // swap eigenvalues - m_afDiag[i1] = m_afDiag[i0]; - m_afDiag[i0] = fMax; - // swap eigenvectors - for (i2 = 0; i2 < 3; i2++) - { - Type fTmp = mElement[i2][i0]; - mElement[i2][i0] = mElement[i2][i1]; - mElement[i2][i1] = fTmp; - m_bIsRotation = !m_bIsRotation; - } - } - } - } - - - void GuaranteeRotation(void) - { - if (!m_bIsRotation) - { - // change sign on the first column - for (int32_t iRow = 0; iRow <3; iRow++) - { - mElement[iRow][0] = -mElement[iRow][0]; - } - } - } - - Type mElement[3][3]; - Type m_afDiag[3]; - Type m_afSubd[3]; - bool m_bIsRotation; - }; - - #endif - - bool fm_computeBestFitPlane(uint32_t vcount, - const REAL *points, - uint32_t vstride, - const REAL *weights, - uint32_t wstride, - REAL *plane, - REAL *center) - { - bool ret = false; - - REAL kOrigin[3] = { 0, 0, 0 }; - - REAL wtotal = 0; - - { - const char *source = (const char *) points; - const char *wsource = (const char *) weights; - - for (uint32_t i=0; i kES; - - kES.mElement[0][0] = fSumXX; - kES.mElement[0][1] = fSumXY; - kES.mElement[0][2] = fSumXZ; - - kES.mElement[1][0] = fSumXY; - kES.mElement[1][1] = fSumYY; - kES.mElement[1][2] = fSumYZ; - - kES.mElement[2][0] = fSumXZ; - kES.mElement[2][1] = fSumYZ; - kES.mElement[2][2] = fSumZZ; - - // compute eigenstuff, smallest eigenvalue is in last position - kES.DecrSortEigenStuff(); - - REAL kNormal[3]; - - kNormal[0] = kES.mElement[0][2]; - kNormal[1] = kES.mElement[1][2]; - kNormal[2] = kES.mElement[2][2]; - - // the minimum energy - plane[0] = kNormal[0]; - plane[1] = kNormal[1]; - plane[2] = kNormal[2]; - - plane[3] = 0 - fm_dot(kNormal,kOrigin); - - ret = true; - - return ret; - } - - - bool fm_colinear(const REAL a1[3],const REAL a2[3],const REAL b1[3],const REAL b2[3],REAL epsilon) // true if these two line segments are co-linear. - { - bool ret = false; - - REAL dir1[3]; - REAL dir2[3]; - - dir1[0] = (a2[0] - a1[0]); - dir1[1] = (a2[1] - a1[1]); - dir1[2] = (a2[2] - a1[2]); - - dir2[0] = (b2[0]-a1[0]) - (b1[0]-a1[0]); - dir2[1] = (b2[1]-a1[1]) - (b1[1]-a1[1]); - dir2[2] = (b2[2]-a2[2]) - (b1[2]-a2[2]); - - fm_normalize(dir1); - fm_normalize(dir2); - - REAL dot = fm_dot(dir1,dir2); - - if ( dot >= epsilon ) - { - ret = true; - } - - - return ret; - } - - bool fm_colinear(const REAL *p1,const REAL *p2,const REAL *p3,REAL epsilon) - { - bool ret = false; - - REAL dir1[3]; - REAL dir2[3]; - - dir1[0] = p2[0] - p1[0]; - dir1[1] = p2[1] - p1[1]; - dir1[2] = p2[2] - p1[2]; - - dir2[0] = p3[0] - p2[0]; - dir2[1] = p3[1] - p2[1]; - dir2[2] = p3[2] - p2[2]; - - fm_normalize(dir1); - fm_normalize(dir2); - - REAL dot = fm_dot(dir1,dir2); - - if ( dot >= epsilon ) - { - ret = true; - } - - - return ret; - } - - void fm_initMinMax(const REAL *p,REAL *bmin,REAL *bmax) - { - bmax[0] = bmin[0] = p[0]; - bmax[1] = bmin[1] = p[1]; - bmax[2] = bmin[2] = p[2]; - } - - IntersectResult fm_intersectLineSegments2d(const REAL *a1,const REAL *a2,const REAL *b1,const REAL *b2,REAL *intersection) - { - IntersectResult ret; - - REAL denom = ((b2[1] - b1[1])*(a2[0] - a1[0])) - ((b2[0] - b1[0])*(a2[1] - a1[1])); - REAL nume_a = ((b2[0] - b1[0])*(a1[1] - b1[1])) - ((b2[1] - b1[1])*(a1[0] - b1[0])); - REAL nume_b = ((a2[0] - a1[0])*(a1[1] - b1[1])) - ((a2[1] - a1[1])*(a1[0] - b1[0])); - if (denom == 0 ) - { - if(nume_a == 0 && nume_b == 0) - { - ret = IR_COINCIDENT; - } - else - { - ret = IR_PARALLEL; - } - } - else - { - - REAL recip = 1 / denom; - REAL ua = nume_a * recip; - REAL ub = nume_b * recip; - - if(ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1 ) - { - // Get the intersection point. - intersection[0] = a1[0] + ua*(a2[0] - a1[0]); - intersection[1] = a1[1] + ua*(a2[1] - a1[1]); - ret = IR_DO_INTERSECT; - } - else - { - ret = IR_DONT_INTERSECT; - } - } - return ret; - } - - IntersectResult fm_intersectLineSegments2dTime(const REAL *a1,const REAL *a2,const REAL *b1,const REAL *b2,REAL &t1,REAL &t2) - { - IntersectResult ret; - - REAL denom = ((b2[1] - b1[1])*(a2[0] - a1[0])) - ((b2[0] - b1[0])*(a2[1] - a1[1])); - REAL nume_a = ((b2[0] - b1[0])*(a1[1] - b1[1])) - ((b2[1] - b1[1])*(a1[0] - b1[0])); - REAL nume_b = ((a2[0] - a1[0])*(a1[1] - b1[1])) - ((a2[1] - a1[1])*(a1[0] - b1[0])); - if (denom == 0 ) - { - if(nume_a == 0 && nume_b == 0) - { - ret = IR_COINCIDENT; - } - else - { - ret = IR_PARALLEL; - } - } - else - { - - REAL recip = 1 / denom; - REAL ua = nume_a * recip; - REAL ub = nume_b * recip; - - if(ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1 ) - { - t1 = ua; - t2 = ub; - ret = IR_DO_INTERSECT; - } - else - { - ret = IR_DONT_INTERSECT; - } - } - return ret; - } - - //**** Plane Triangle Intersection - - - - - - // assumes that the points are on opposite sides of the plane! - bool fm_intersectPointPlane(const REAL *p1,const REAL *p2,REAL *split,const REAL *plane) - { - - REAL dp1 = fm_distToPlane(plane,p1); - REAL dp2 = fm_distToPlane(plane, p2); - if (dp1 <= 0 && dp2 <= 0) - { - return false; - } - if (dp1 >= 0 && dp2 >= 0) - { - return false; - } - - REAL dir[3]; - - dir[0] = p2[0] - p1[0]; - dir[1] = p2[1] - p1[1]; - dir[2] = p2[2] - p1[2]; - - REAL dot1 = dir[0]*plane[0] + dir[1]*plane[1] + dir[2]*plane[2]; - REAL dot2 = dp1 - plane[3]; - - REAL t = -(plane[3] + dot2 ) / dot1; - - split[0] = (dir[0]*t)+p1[0]; - split[1] = (dir[1]*t)+p1[1]; - split[2] = (dir[2]*t)+p1[2]; - - return true; - } - - PlaneTriResult fm_getSidePlane(const REAL *p,const REAL *plane,REAL epsilon) - { - PlaneTriResult ret = PTR_ON_PLANE; - - REAL d = fm_distToPlane(plane,p); - - if ( d < -epsilon || d > epsilon ) - { - if ( d > 0 ) - ret = PTR_FRONT; // it is 'in front' within the provided epsilon value. - else - ret = PTR_BACK; - } - - return ret; - } - - - - #ifndef PLANE_TRIANGLE_INTERSECTION_H - - #define PLANE_TRIANGLE_INTERSECTION_H - - #define MAXPTS 256 - - template class point - { - public: - - void set(const Type *p) - { - x = p[0]; - y = p[1]; - z = p[2]; - } - - Type x; - Type y; - Type z; - }; - - template class plane - { - public: - plane(const Type *p) - { - normal.x = p[0]; - normal.y = p[1]; - normal.z = p[2]; - D = p[3]; - } - - Type Classify_Point(const point &p) - { - return p.x*normal.x + p.y*normal.y + p.z*normal.z + D; - } - - point normal; - Type D; - }; - - template class polygon - { - public: - polygon(void) - { - mVcount = 0; - } - - polygon(const Type *p1,const Type *p2,const Type *p3) - { - mVcount = 3; - mVertices[0].set(p1); - mVertices[1].set(p2); - mVertices[2].set(p3); - } - - - int32_t NumVertices(void) const { return mVcount; } - - const point& Vertex(int32_t index) - { - if ( index < 0 ) index+=mVcount; - return mVertices[index]; - } - - - void set(const point *pts,int32_t count) - { - for (int32_t i=0; i *poly,plane *part, polygon &front, polygon &back) - { - int32_t count = poly->NumVertices (); - int32_t out_c = 0, in_c = 0; - point ptA, ptB,outpts[MAXPTS],inpts[MAXPTS]; - Type sideA, sideB; - ptA = poly->Vertex (count - 1); - sideA = part->Classify_Point (ptA); - for (int32_t i = -1; ++i < count;) - { - ptB = poly->Vertex(i); - sideB = part->Classify_Point(ptB); - if (sideB > 0) - { - if (sideA < 0) - { - point v; - fm_intersectPointPlane(&ptB.x, &ptA.x, &v.x, &part->normal.x ); - outpts[out_c++] = inpts[in_c++] = v; - } - outpts[out_c++] = ptB; - } - else if (sideB < 0) - { - if (sideA > 0) - { - point v; - fm_intersectPointPlane(&ptB.x, &ptA.x, &v.x, &part->normal.x ); - outpts[out_c++] = inpts[in_c++] = v; - } - inpts[in_c++] = ptB; - } - else - outpts[out_c++] = inpts[in_c++] = ptB; - ptA = ptB; - sideA = sideB; - } - - front.set(&outpts[0], out_c); - back.set(&inpts[0], in_c); - } - - int32_t mVcount; - point mVertices[MAXPTS]; - }; - - - - #endif - - static inline void add(const REAL *p,REAL *dest,uint32_t tstride,uint32_t &pcount) - { - char *d = (char *) dest; - d = d + pcount*tstride; - dest = (REAL *) d; - dest[0] = p[0]; - dest[1] = p[1]; - dest[2] = p[2]; - pcount++; - assert( pcount <= 4 ); - } - - - PlaneTriResult fm_planeTriIntersection(const REAL *_plane, // the plane equation in Ax+By+Cz+D format - const REAL *triangle, // the source triangle. - uint32_t tstride, // stride in bytes of the input and output *vertices* - REAL epsilon, // the co-planar epsilon value. - REAL *front, // the triangle in front of the - uint32_t &fcount, // number of vertices in the 'front' triangle - REAL *back, // the triangle in back of the plane - uint32_t &bcount) // the number of vertices in the 'back' triangle. - { - - fcount = 0; - bcount = 0; - - const char *tsource = (const char *) triangle; - - // get the three vertices of the triangle. - const REAL *p1 = (const REAL *) (tsource); - const REAL *p2 = (const REAL *) (tsource+tstride); - const REAL *p3 = (const REAL *) (tsource+tstride*2); - - - PlaneTriResult r1 = fm_getSidePlane(p1,_plane,epsilon); // compute the side of the plane each vertex is on - PlaneTriResult r2 = fm_getSidePlane(p2,_plane,epsilon); - PlaneTriResult r3 = fm_getSidePlane(p3,_plane,epsilon); - - // If any of the points lay right *on* the plane.... - if ( r1 == PTR_ON_PLANE || r2 == PTR_ON_PLANE || r3 == PTR_ON_PLANE ) - { - // If the triangle is completely co-planar, then just treat it as 'front' and return! - if ( r1 == PTR_ON_PLANE && r2 == PTR_ON_PLANE && r3 == PTR_ON_PLANE ) - { - add(p1,front,tstride,fcount); - add(p2,front,tstride,fcount); - add(p3,front,tstride,fcount); - return PTR_FRONT; - } - // Decide to place the co-planar points on the same side as the co-planar point. - PlaneTriResult r= PTR_ON_PLANE; - if ( r1 != PTR_ON_PLANE ) - r = r1; - else if ( r2 != PTR_ON_PLANE ) - r = r2; - else if ( r3 != PTR_ON_PLANE ) - r = r3; - - if ( r1 == PTR_ON_PLANE ) r1 = r; - if ( r2 == PTR_ON_PLANE ) r2 = r; - if ( r3 == PTR_ON_PLANE ) r3 = r; - - } - - if ( r1 == r2 && r1 == r3 ) // if all three vertices are on the same side of the plane. - { - if ( r1 == PTR_FRONT ) // if all three are in front of the plane, then copy to the 'front' output triangle. - { - add(p1,front,tstride,fcount); - add(p2,front,tstride,fcount); - add(p3,front,tstride,fcount); - } - else - { - add(p1,back,tstride,bcount); // if all three are in 'back' then copy to the 'back' output triangle. - add(p2,back,tstride,bcount); - add(p3,back,tstride,bcount); - } - return r1; // if all three points are on the same side of the plane return result - } - - - polygon pi(p1,p2,p3); - polygon pfront,pback; - - plane part(_plane); - - pi.Split_Polygon(&pi,&part,pfront,pback); - - for (int32_t i=0; i bmax[0] ) bmax[0] = t[0]; - if ( t[1] > bmax[1] ) bmax[1] = t[1]; - if ( t[2] > bmax[2] ) bmax[2] = t[2]; - - src+=pstride; - } - - REAL center[3]; - - sides[0] = bmax[0]-bmin[0]; - sides[1] = bmax[1]-bmin[1]; - sides[2] = bmax[2]-bmin[2]; - - center[0] = sides[0]*0.5f+bmin[0]; - center[1] = sides[1]*0.5f+bmin[1]; - center[2] = sides[2]*0.5f+bmin[2]; - - REAL ocenter[3]; - - fm_rotate(matrix,center,ocenter); - - matrix[12]+=ocenter[0]; - matrix[13]+=ocenter[1]; - matrix[14]+=ocenter[2]; - - } - - void fm_computeBestFitOBB(uint32_t vcount,const REAL *points,uint32_t pstride,REAL *sides,REAL *matrix,bool bruteForce) - { - REAL plane[4]; - REAL center[3]; - fm_computeBestFitPlane(vcount,points,pstride,0,0,plane,center); - fm_planeToMatrix(plane,matrix); - computeOBB( vcount, points, pstride, sides, matrix ); - - REAL refmatrix[16]; - memcpy(refmatrix,matrix,16*sizeof(REAL)); - - REAL volume = sides[0]*sides[1]*sides[2]; - if ( bruteForce ) - { - for (REAL a=10; a<180; a+=10) - { - REAL quat[4]; - fm_eulerToQuat(0,a*FM_DEG_TO_RAD,0,quat); - REAL temp[16]; - REAL pmatrix[16]; - fm_quatToMatrix(quat,temp); - fm_matrixMultiply(temp,refmatrix,pmatrix); - REAL psides[3]; - computeOBB( vcount, points, pstride, psides, pmatrix ); - REAL v = psides[0]*psides[1]*psides[2]; - if ( v < volume ) - { - volume = v; - memcpy(matrix,pmatrix,sizeof(REAL)*16); - sides[0] = psides[0]; - sides[1] = psides[1]; - sides[2] = psides[2]; - } - } - } - } - - void fm_computeBestFitOBB(uint32_t vcount,const REAL *points,uint32_t pstride,REAL *sides,REAL *pos,REAL *quat,bool bruteForce) - { - REAL matrix[16]; - fm_computeBestFitOBB(vcount,points,pstride,sides,matrix,bruteForce); - fm_getTranslation(matrix,pos); - fm_matrixToQuat(matrix,quat); - } - - void fm_computeBestFitABB(uint32_t vcount,const REAL *points,uint32_t pstride,REAL *sides,REAL *pos) - { - REAL bmin[3]; - REAL bmax[3]; - - bmin[0] = points[0]; - bmin[1] = points[1]; - bmin[2] = points[2]; - - bmax[0] = points[0]; - bmax[1] = points[1]; - bmax[2] = points[2]; - - const char *cp = (const char *) points; - for (uint32_t i=0; i bmax[0] ) bmax[0] = p[0]; - if ( p[1] > bmax[1] ) bmax[1] = p[1]; - if ( p[2] > bmax[2] ) bmax[2] = p[2]; - - cp+=pstride; - } - - - sides[0] = bmax[0] - bmin[0]; - sides[1] = bmax[1] - bmin[1]; - sides[2] = bmax[2] - bmin[2]; - - pos[0] = bmin[0]+sides[0]*0.5f; - pos[1] = bmin[1]+sides[1]*0.5f; - pos[2] = bmin[2]+sides[2]*0.5f; - - } - - - void fm_planeToMatrix(const REAL *plane,REAL *matrix) // convert a plane equation to a 4x4 rotation matrix - { - REAL ref[3] = { 0, 1, 0 }; - REAL quat[4]; - fm_rotationArc(ref,plane,quat); - fm_quatToMatrix(quat,matrix); - REAL origin[3] = { 0, -plane[3], 0 }; - REAL center[3]; - fm_transform(matrix,origin,center); - fm_setTranslation(center,matrix); - } - - void fm_planeToQuat(const REAL *plane,REAL *quat,REAL *pos) // convert a plane equation to a quaternion and translation - { - REAL ref[3] = { 0, 1, 0 }; - REAL matrix[16]; - fm_rotationArc(ref,plane,quat); - fm_quatToMatrix(quat,matrix); - REAL origin[3] = { 0, plane[3], 0 }; - fm_transform(matrix,origin,pos); - } - - void fm_eulerMatrix(REAL ax,REAL ay,REAL az,REAL *matrix) // convert euler (in radians) to a dest 4x4 matrix (translation set to zero) - { - REAL quat[4]; - fm_eulerToQuat(ax,ay,az,quat); - fm_quatToMatrix(quat,matrix); - } - - - //********************************************************** - //********************************************************** - //**** Vertex Welding - //********************************************************** - //********************************************************** - - #ifndef VERTEX_INDEX_H - - #define VERTEX_INDEX_H - - namespace VERTEX_INDEX - { - - class KdTreeNode; - - typedef std::vector< KdTreeNode * > KdTreeNodeVector; - - enum Axes - { - X_AXIS = 0, - Y_AXIS = 1, - Z_AXIS = 2 - }; - - class KdTreeFindNode - { - public: - KdTreeFindNode(void) - { - mNode = 0; - mDistance = 0; - } - KdTreeNode *mNode; - double mDistance; - }; - - class KdTreeInterface - { - public: - virtual ~KdTreeInterface() {} - virtual const double * getPositionDouble(uint32_t index) const = 0; - virtual const float * getPositionFloat(uint32_t index) const = 0; - }; - - class KdTreeNode - { - public: - KdTreeNode(void) - { - mIndex = 0; - mLeft = 0; - mRight = 0; - } - - KdTreeNode(uint32_t index) - { - mIndex = index; - mLeft = 0; - mRight = 0; - }; - - ~KdTreeNode(void) - { - } - - - void addDouble(KdTreeNode *node,Axes dim,const KdTreeInterface *iface) - { - const double *nodePosition = iface->getPositionDouble( node->mIndex ); - const double *position = iface->getPositionDouble( mIndex ); - switch ( dim ) - { - case X_AXIS: - if ( nodePosition[0] <= position[0] ) - { - if ( mLeft ) - mLeft->addDouble(node,Y_AXIS,iface); - else - mLeft = node; - } - else - { - if ( mRight ) - mRight->addDouble(node,Y_AXIS,iface); - else - mRight = node; - } - break; - case Y_AXIS: - if ( nodePosition[1] <= position[1] ) - { - if ( mLeft ) - mLeft->addDouble(node,Z_AXIS,iface); - else - mLeft = node; - } - else - { - if ( mRight ) - mRight->addDouble(node,Z_AXIS,iface); - else - mRight = node; - } - break; - case Z_AXIS: - if ( nodePosition[2] <= position[2] ) - { - if ( mLeft ) - mLeft->addDouble(node,X_AXIS,iface); - else - mLeft = node; - } - else - { - if ( mRight ) - mRight->addDouble(node,X_AXIS,iface); - else - mRight = node; - } - break; - } - - } - - - void addFloat(KdTreeNode *node,Axes dim,const KdTreeInterface *iface) - { - const float *nodePosition = iface->getPositionFloat( node->mIndex ); - const float *position = iface->getPositionFloat( mIndex ); - switch ( dim ) - { - case X_AXIS: - if ( nodePosition[0] <= position[0] ) - { - if ( mLeft ) - mLeft->addFloat(node,Y_AXIS,iface); - else - mLeft = node; - } - else - { - if ( mRight ) - mRight->addFloat(node,Y_AXIS,iface); - else - mRight = node; - } - break; - case Y_AXIS: - if ( nodePosition[1] <= position[1] ) - { - if ( mLeft ) - mLeft->addFloat(node,Z_AXIS,iface); - else - mLeft = node; - } - else - { - if ( mRight ) - mRight->addFloat(node,Z_AXIS,iface); - else - mRight = node; - } - break; - case Z_AXIS: - if ( nodePosition[2] <= position[2] ) - { - if ( mLeft ) - mLeft->addFloat(node,X_AXIS,iface); - else - mLeft = node; - } - else - { - if ( mRight ) - mRight->addFloat(node,X_AXIS,iface); - else - mRight = node; - } - break; - } - - } - - - uint32_t getIndex(void) const { return mIndex; } - - void search(Axes axis,const double *pos,double radius,uint32_t &count,uint32_t maxObjects,KdTreeFindNode *found,const KdTreeInterface *iface) - { - - const double *position = iface->getPositionDouble(mIndex); - - double dx = pos[0] - position[0]; - double dy = pos[1] - position[1]; - double dz = pos[2] - position[2]; - - KdTreeNode *search1 = 0; - KdTreeNode *search2 = 0; - - switch ( axis ) - { - case X_AXIS: - if ( dx <= 0 ) // JWR if we are to the left - { - search1 = mLeft; // JWR then search to the left - if ( -dx < radius ) // JWR if distance to the right is less than our search radius, continue on the right as well. - search2 = mRight; - } - else - { - search1 = mRight; // JWR ok, we go down the left tree - if ( dx < radius ) // JWR if the distance from the right is less than our search radius - search2 = mLeft; - } - axis = Y_AXIS; - break; - case Y_AXIS: - if ( dy <= 0 ) - { - search1 = mLeft; - if ( -dy < radius ) - search2 = mRight; - } - else - { - search1 = mRight; - if ( dy < radius ) - search2 = mLeft; - } - axis = Z_AXIS; - break; - case Z_AXIS: - if ( dz <= 0 ) - { - search1 = mLeft; - if ( -dz < radius ) - search2 = mRight; - } - else - { - search1 = mRight; - if ( dz < radius ) - search2 = mLeft; - } - axis = X_AXIS; - break; - } - - double r2 = radius*radius; - double m = dx*dx+dy*dy+dz*dz; - - if ( m < r2 ) - { - switch ( count ) - { - case 0: - found[count].mNode = this; - found[count].mDistance = m; - break; - case 1: - if ( m < found[0].mDistance ) - { - if ( maxObjects == 1 ) - { - found[0].mNode = this; - found[0].mDistance = m; - } - else - { - found[1] = found[0]; - found[0].mNode = this; - found[0].mDistance = m; - } - } - else if ( maxObjects > 1) - { - found[1].mNode = this; - found[1].mDistance = m; - } - break; - default: - { - bool inserted = false; - - for (uint32_t i=0; i= maxObjects ) scan=maxObjects-1; - for (uint32_t j=scan; j>i; j--) - { - found[j] = found[j-1]; - } - found[i].mNode = this; - found[i].mDistance = m; - inserted = true; - break; - } - } - - if ( !inserted && count < maxObjects ) - { - found[count].mNode = this; - found[count].mDistance = m; - } - } - break; - } - count++; - if ( count > maxObjects ) - { - count = maxObjects; - } - } - - - if ( search1 ) - search1->search( axis, pos,radius, count, maxObjects, found, iface); - - if ( search2 ) - search2->search( axis, pos,radius, count, maxObjects, found, iface); - - } - - void search(Axes axis,const float *pos,float radius,uint32_t &count,uint32_t maxObjects,KdTreeFindNode *found,const KdTreeInterface *iface) - { - - const float *position = iface->getPositionFloat(mIndex); - - float dx = pos[0] - position[0]; - float dy = pos[1] - position[1]; - float dz = pos[2] - position[2]; - - KdTreeNode *search1 = 0; - KdTreeNode *search2 = 0; - - switch ( axis ) - { - case X_AXIS: - if ( dx <= 0 ) // JWR if we are to the left - { - search1 = mLeft; // JWR then search to the left - if ( -dx < radius ) // JWR if distance to the right is less than our search radius, continue on the right as well. - search2 = mRight; - } - else - { - search1 = mRight; // JWR ok, we go down the left tree - if ( dx < radius ) // JWR if the distance from the right is less than our search radius - search2 = mLeft; - } - axis = Y_AXIS; - break; - case Y_AXIS: - if ( dy <= 0 ) - { - search1 = mLeft; - if ( -dy < radius ) - search2 = mRight; - } - else - { - search1 = mRight; - if ( dy < radius ) - search2 = mLeft; - } - axis = Z_AXIS; - break; - case Z_AXIS: - if ( dz <= 0 ) - { - search1 = mLeft; - if ( -dz < radius ) - search2 = mRight; - } - else - { - search1 = mRight; - if ( dz < radius ) - search2 = mLeft; - } - axis = X_AXIS; - break; - } - - float r2 = radius*radius; - float m = dx*dx+dy*dy+dz*dz; - - if ( m < r2 ) - { - switch ( count ) - { - case 0: - found[count].mNode = this; - found[count].mDistance = m; - break; - case 1: - if ( m < found[0].mDistance ) - { - if ( maxObjects == 1 ) - { - found[0].mNode = this; - found[0].mDistance = m; - } - else - { - found[1] = found[0]; - found[0].mNode = this; - found[0].mDistance = m; - } - } - else if ( maxObjects > 1) - { - found[1].mNode = this; - found[1].mDistance = m; - } - break; - default: - { - bool inserted = false; - - for (uint32_t i=0; i= maxObjects ) scan=maxObjects-1; - for (uint32_t j=scan; j>i; j--) - { - found[j] = found[j-1]; - } - found[i].mNode = this; - found[i].mDistance = m; - inserted = true; - break; - } - } - - if ( !inserted && count < maxObjects ) - { - found[count].mNode = this; - found[count].mDistance = m; - } - } - break; - } - count++; - if ( count > maxObjects ) - { - count = maxObjects; - } - } - - - if ( search1 ) - search1->search( axis, pos,radius, count, maxObjects, found, iface); - - if ( search2 ) - search2->search( axis, pos,radius, count, maxObjects, found, iface); - - } - - private: - - void setLeft(KdTreeNode *left) { mLeft = left; }; - void setRight(KdTreeNode *right) { mRight = right; }; - - KdTreeNode *getLeft(void) { return mLeft; } - KdTreeNode *getRight(void) { return mRight; } - - uint32_t mIndex; - KdTreeNode *mLeft; - KdTreeNode *mRight; - }; - - - #define MAX_BUNDLE_SIZE 1024 // 1024 nodes at a time, to minimize memory allocation and guarantee that pointers are persistent. - - class KdTreeNodeBundle - { - public: - - KdTreeNodeBundle(void) - { - mNext = 0; - mIndex = 0; - } - - bool isFull(void) const - { - return (bool)( mIndex == MAX_BUNDLE_SIZE ); - } - - KdTreeNode * getNextNode(void) - { - assert(mIndex DoubleVector; - typedef std::vector< float > FloatVector; - - class KdTree : public KdTreeInterface - { - public: - KdTree(void) - { - mRoot = 0; - mBundle = 0; - mVcount = 0; - mUseDouble = false; - } - - virtual ~KdTree(void) - { - reset(); - } - - const double * getPositionDouble(uint32_t index) const - { - assert( mUseDouble ); - assert ( index < mVcount ); - return &mVerticesDouble[index*3]; - } - - const float * getPositionFloat(uint32_t index) const - { - assert( !mUseDouble ); - assert ( index < mVcount ); - return &mVerticesFloat[index*3]; - } - - uint32_t search(const double *pos,double radius,uint32_t maxObjects,KdTreeFindNode *found) const - { - assert( mUseDouble ); - if ( !mRoot ) return 0; - uint32_t count = 0; - mRoot->search(X_AXIS,pos,radius,count,maxObjects,found,this); - return count; - } - - uint32_t search(const float *pos,float radius,uint32_t maxObjects,KdTreeFindNode *found) const - { - assert( !mUseDouble ); - if ( !mRoot ) return 0; - uint32_t count = 0; - mRoot->search(X_AXIS,pos,radius,count,maxObjects,found,this); - return count; - } - - void reset(void) - { - mRoot = 0; - mVerticesDouble.clear(); - mVerticesFloat.clear(); - KdTreeNodeBundle *bundle = mBundle; - while ( bundle ) - { - KdTreeNodeBundle *next = bundle->mNext; - delete bundle; - bundle = next; - } - mBundle = 0; - mVcount = 0; - } - - uint32_t add(double x,double y,double z) - { - assert(mUseDouble); - uint32_t ret = mVcount; - mVerticesDouble.push_back(x); - mVerticesDouble.push_back(y); - mVerticesDouble.push_back(z); - mVcount++; - KdTreeNode *node = getNewNode(ret); - if ( mRoot ) - { - mRoot->addDouble(node,X_AXIS,this); - } - else - { - mRoot = node; - } - return ret; - } - - uint32_t add(float x,float y,float z) - { - assert(!mUseDouble); - uint32_t ret = mVcount; - mVerticesFloat.push_back(x); - mVerticesFloat.push_back(y); - mVerticesFloat.push_back(z); - mVcount++; - KdTreeNode *node = getNewNode(ret); - if ( mRoot ) - { - mRoot->addFloat(node,X_AXIS,this); - } - else - { - mRoot = node; - } - return ret; - } - - KdTreeNode * getNewNode(uint32_t index) - { - if ( mBundle == 0 ) - { - mBundle = new KdTreeNodeBundle; - } - if ( mBundle->isFull() ) - { - KdTreeNodeBundle *bundle = new KdTreeNodeBundle; - mBundle->mNext = bundle; - mBundle = bundle; - } - KdTreeNode *node = mBundle->getNextNode(); - new ( node ) KdTreeNode(index); - return node; - } - - uint32_t getNearest(const double *pos,double radius,bool &_found) const // returns the nearest possible neighbor's index. - { - assert( mUseDouble ); - uint32_t ret = 0; - - _found = false; - KdTreeFindNode found[1]; - uint32_t count = search(pos,radius,1,found); - if ( count ) - { - KdTreeNode *node = found[0].mNode; - ret = node->getIndex(); - _found = true; - } - return ret; - } - - uint32_t getNearest(const float *pos,float radius,bool &_found) const // returns the nearest possible neighbor's index. - { - assert( !mUseDouble ); - uint32_t ret = 0; - - _found = false; - KdTreeFindNode found[1]; - uint32_t count = search(pos,radius,1,found); - if ( count ) - { - KdTreeNode *node = found[0].mNode; - ret = node->getIndex(); - _found = true; - } - return ret; - } - - const double * getVerticesDouble(void) const - { - assert( mUseDouble ); - const double *ret = 0; - if ( !mVerticesDouble.empty() ) - { - ret = &mVerticesDouble[0]; - } - return ret; - } - - const float * getVerticesFloat(void) const - { - assert( !mUseDouble ); - const float * ret = 0; - if ( !mVerticesFloat.empty() ) - { - ret = &mVerticesFloat[0]; - } - return ret; - } - - uint32_t getVcount(void) const { return mVcount; } - - void setUseDouble(bool useDouble) - { - mUseDouble = useDouble; - } - - private: - bool mUseDouble; - KdTreeNode *mRoot; - KdTreeNodeBundle *mBundle; - uint32_t mVcount; - DoubleVector mVerticesDouble; - FloatVector mVerticesFloat; - }; - - } // end of namespace VERTEX_INDEX - - class MyVertexIndex : public fm_VertexIndex - { - public: - MyVertexIndex(double granularity,bool snapToGrid) - { - mDoubleGranularity = granularity; - mFloatGranularity = (float)granularity; - mSnapToGrid = snapToGrid; - mUseDouble = true; - mKdTree.setUseDouble(true); - } - - MyVertexIndex(float granularity,bool snapToGrid) - { - mDoubleGranularity = granularity; - mFloatGranularity = (float)granularity; - mSnapToGrid = snapToGrid; - mUseDouble = false; - mKdTree.setUseDouble(false); - } - - virtual ~MyVertexIndex(void) - { - - } - - - double snapToGrid(double p) - { - double m = fmod(p,mDoubleGranularity); - p-=m; - return p; - } - - float snapToGrid(float p) - { - float m = fmodf(p,mFloatGranularity); - p-=m; - return p; - } - - uint32_t getIndex(const float *_p,bool &newPos) // get index for a vector float - { - uint32_t ret; - - if ( mUseDouble ) - { - double p[3]; - p[0] = _p[0]; - p[1] = _p[1]; - p[2] = _p[2]; - return getIndex(p,newPos); - } - - newPos = false; - - float p[3]; - - if ( mSnapToGrid ) - { - p[0] = snapToGrid(_p[0]); - p[1] = snapToGrid(_p[1]); - p[2] = snapToGrid(_p[2]); - } - else - { - p[0] = _p[0]; - p[1] = _p[1]; - p[2] = _p[2]; - } - - bool found; - ret = mKdTree.getNearest(p,mFloatGranularity,found); - if ( !found ) - { - newPos = true; - ret = mKdTree.add(p[0],p[1],p[2]); - } - - - return ret; - } - - uint32_t getIndex(const double *_p,bool &newPos) // get index for a vector double - { - uint32_t ret; - - if ( !mUseDouble ) - { - float p[3]; - p[0] = (float)_p[0]; - p[1] = (float)_p[1]; - p[2] = (float)_p[2]; - return getIndex(p,newPos); - } - - newPos = false; - - double p[3]; - - if ( mSnapToGrid ) - { - p[0] = snapToGrid(_p[0]); - p[1] = snapToGrid(_p[1]); - p[2] = snapToGrid(_p[2]); - } - else - { - p[0] = _p[0]; - p[1] = _p[1]; - p[2] = _p[2]; - } - - bool found; - ret = mKdTree.getNearest(p,mDoubleGranularity,found); - if ( !found ) - { - newPos = true; - ret = mKdTree.add(p[0],p[1],p[2]); - } - - - return ret; - } - - const float * getVerticesFloat(void) const - { - const float * ret = 0; - - assert( !mUseDouble ); - - ret = mKdTree.getVerticesFloat(); - - return ret; - } - - const double * getVerticesDouble(void) const - { - const double * ret = 0; - - assert( mUseDouble ); - - ret = mKdTree.getVerticesDouble(); - - return ret; - } - - const float * getVertexFloat(uint32_t index) const - { - const float * ret = 0; - assert( !mUseDouble ); - #ifdef _DEBUG - uint32_t vcount = mKdTree.getVcount(); - assert( index < vcount ); - #endif - ret = mKdTree.getVerticesFloat(); - ret = &ret[index*3]; - return ret; - } - - const double * getVertexDouble(uint32_t index) const - { - const double * ret = 0; - assert( mUseDouble ); - #ifdef _DEBUG - uint32_t vcount = mKdTree.getVcount(); - assert( index < vcount ); - #endif - ret = mKdTree.getVerticesDouble(); - ret = &ret[index*3]; - - return ret; - } - - uint32_t getVcount(void) const - { - return mKdTree.getVcount(); - } - - bool isDouble(void) const - { - return mUseDouble; - } - - - bool saveAsObj(const char *fname,uint32_t tcount,uint32_t *indices) - { - bool ret = false; - - - FILE *fph = fopen(fname,"wb"); - if ( fph ) - { - ret = true; - - uint32_t vcount = getVcount(); - if ( mUseDouble ) - { - const double *v = getVerticesDouble(); - for (uint32_t i=0; i(ret); - } - - fm_VertexIndex * fm_createVertexIndex(float granularity,bool snapToGrid) // create an indexed vertext system for floats - { - MyVertexIndex *ret = new MyVertexIndex(granularity,snapToGrid); - return static_cast< fm_VertexIndex *>(ret); - } - - void fm_releaseVertexIndex(fm_VertexIndex *vindex) - { - MyVertexIndex *m = static_cast< MyVertexIndex *>(vindex); - delete m; - } - - #endif // END OF VERTEX WELDING CODE - - - REAL fm_computeBestFitAABB(uint32_t vcount,const REAL *points,uint32_t pstride,REAL *bmin,REAL *bmax) // returns the diagonal distance - { - - const uint8_t *source = (const uint8_t *) points; - - bmin[0] = points[0]; - bmin[1] = points[1]; - bmin[2] = points[2]; - - bmax[0] = points[0]; - bmax[1] = points[1]; - bmax[2] = points[2]; - - - for (uint32_t i=1; i bmax[0] ) bmax[0] = p[0]; - if ( p[1] > bmax[1] ) bmax[1] = p[1]; - if ( p[2] > bmax[2] ) bmax[2] = p[2]; - - } - - REAL dx = bmax[0] - bmin[0]; - REAL dy = bmax[1] - bmin[1]; - REAL dz = bmax[2] - bmin[2]; - - return (REAL) sqrt( dx*dx + dy*dy + dz*dz ); - - } - - - - /* a = b - c */ - #define vector(a,b,c) \ - (a)[0] = (b)[0] - (c)[0]; \ - (a)[1] = (b)[1] - (c)[1]; \ - (a)[2] = (b)[2] - (c)[2]; - - - - #define innerProduct(v,q) \ - ((v)[0] * (q)[0] + \ - (v)[1] * (q)[1] + \ - (v)[2] * (q)[2]) - - #define crossProduct(a,b,c) \ - (a)[0] = (b)[1] * (c)[2] - (c)[1] * (b)[2]; \ - (a)[1] = (b)[2] * (c)[0] - (c)[2] * (b)[0]; \ - (a)[2] = (b)[0] * (c)[1] - (c)[0] * (b)[1]; - - - bool fm_lineIntersectsTriangle(const REAL *rayStart,const REAL *rayEnd,const REAL *p1,const REAL *p2,const REAL *p3,REAL *sect) - { - REAL dir[3]; - - dir[0] = rayEnd[0] - rayStart[0]; - dir[1] = rayEnd[1] - rayStart[1]; - dir[2] = rayEnd[2] - rayStart[2]; - - REAL d = (REAL)sqrt(dir[0]*dir[0] + dir[1]*dir[1] + dir[2]*dir[2]); - REAL r = 1.0f / d; - - dir[0]*=r; - dir[1]*=r; - dir[2]*=r; - - - REAL t; - - bool ret = fm_rayIntersectsTriangle(rayStart, dir, p1, p2, p3, t ); - - if ( ret ) - { - if ( t > d ) - { - sect[0] = rayStart[0] + dir[0]*t; - sect[1] = rayStart[1] + dir[1]*t; - sect[2] = rayStart[2] + dir[2]*t; - } - else - { - ret = false; - } - } - - return ret; - } - - - - bool fm_rayIntersectsTriangle(const REAL *p,const REAL *d,const REAL *v0,const REAL *v1,const REAL *v2,REAL &t) - { - REAL e1[3],e2[3],h[3],s[3],q[3]; - REAL a,f,u,v; - - vector(e1,v1,v0); - vector(e2,v2,v0); - crossProduct(h,d,e2); - a = innerProduct(e1,h); - - if (a > -0.00001 && a < 0.00001) - return(false); - - f = 1/a; - vector(s,p,v0); - u = f * (innerProduct(s,h)); - - if (u < 0.0 || u > 1.0) - return(false); - - crossProduct(q,s,e1); - v = f * innerProduct(d,q); - if (v < 0.0 || u + v > 1.0) - return(false); - // at this stage we can compute t to find out where - // the intersection point is on the line - t = f * innerProduct(e2,q); - if (t > 0) // ray intersection - return(true); - else // this means that there is a line intersection - // but not a ray intersection - return (false); - } - - - inline REAL det(const REAL *p1,const REAL *p2,const REAL *p3) - { - return p1[0]*p2[1]*p3[2] + p2[0]*p3[1]*p1[2] + p3[0]*p1[1]*p2[2] -p1[0]*p3[1]*p2[2] - p2[0]*p1[1]*p3[2] - p3[0]*p2[1]*p1[2]; - } - - - REAL fm_computeMeshVolume(const REAL *vertices,uint32_t tcount,const uint32_t *indices) - { - REAL volume = 0; - - for (uint32_t i=0; i= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f)); - } - - - REAL fm_areaPolygon2d(uint32_t pcount,const REAL *points,uint32_t pstride) - { - uint32_t n = pcount; - - REAL A=0.0f; - for(uint32_t p=n-1,q=0; q= y) || (y2 < y && y1 >= y) ) - { - if (x1+(y-y1)/(y2-y1)*(x2-x1)= 3 ) - { - const REAL *prev = fm_getPoint(points,pstride,pcount-1); - const REAL *current = points; - const REAL *next = fm_getPoint(points,pstride,1); - REAL *dest = _dest; - - for (uint32_t i=0; i class Rect3d - { - public: - Rect3d(void) { } - - Rect3d(const T *bmin,const T *bmax) - { - - mMin[0] = bmin[0]; - mMin[1] = bmin[1]; - mMin[2] = bmin[2]; - - mMax[0] = bmax[0]; - mMax[1] = bmax[1]; - mMax[2] = bmax[2]; - - } - - void SetMin(const T *bmin) - { - mMin[0] = bmin[0]; - mMin[1] = bmin[1]; - mMin[2] = bmin[2]; - } - - void SetMax(const T *bmax) - { - mMax[0] = bmax[0]; - mMax[1] = bmax[1]; - mMax[2] = bmax[2]; - } - - void SetMin(T x,T y,T z) - { - mMin[0] = x; - mMin[1] = y; - mMin[2] = z; - } - - void SetMax(T x,T y,T z) - { - mMax[0] = x; - mMax[1] = y; - mMax[2] = z; - } - - T mMin[3]; - T mMax[3]; - }; - - #endif - - void splitRect(uint32_t axis, - const Rect3d &source, - Rect3d &b1, - Rect3d &b2, - const REAL *midpoint) - { - switch ( axis ) - { - case 0: - b1.SetMin(source.mMin); - b1.SetMax( midpoint[0], source.mMax[1], source.mMax[2] ); - - b2.SetMin( midpoint[0], source.mMin[1], source.mMin[2] ); - b2.SetMax(source.mMax); - - break; - case 1: - b1.SetMin(source.mMin); - b1.SetMax( source.mMax[0], midpoint[1], source.mMax[2] ); - - b2.SetMin( source.mMin[0], midpoint[1], source.mMin[2] ); - b2.SetMax(source.mMax); - - break; - case 2: - b1.SetMin(source.mMin); - b1.SetMax( source.mMax[0], source.mMax[1], midpoint[2] ); - - b2.SetMin( source.mMin[0], source.mMin[1], midpoint[2] ); - b2.SetMax(source.mMax); - - break; - } - } - - bool fm_computeSplitPlane(uint32_t vcount, - const REAL *vertices, - uint32_t /* tcount */, - const uint32_t * /* indices */, - REAL *plane) - { - - REAL sides[3]; - REAL matrix[16]; - - fm_computeBestFitOBB( vcount, vertices, sizeof(REAL)*3, sides, matrix ); - - REAL bmax[3]; - REAL bmin[3]; - - bmax[0] = sides[0]*0.5f; - bmax[1] = sides[1]*0.5f; - bmax[2] = sides[2]*0.5f; - - bmin[0] = -bmax[0]; - bmin[1] = -bmax[1]; - bmin[2] = -bmax[2]; - - - REAL dx = sides[0]; - REAL dy = sides[1]; - REAL dz = sides[2]; - - - uint32_t axis = 0; - - if ( dy > dx ) - { - axis = 1; - } - - if ( dz > dx && dz > dy ) - { - axis = 2; - } - - REAL p1[3]; - REAL p2[3]; - REAL p3[3]; - - p3[0] = p2[0] = p1[0] = bmin[0] + dx*0.5f; - p3[1] = p2[1] = p1[1] = bmin[1] + dy*0.5f; - p3[2] = p2[2] = p1[2] = bmin[2] + dz*0.5f; - - Rect3d b(bmin,bmax); - - Rect3d b1,b2; - - splitRect(axis,b,b1,b2,p1); - - - switch ( axis ) - { - case 0: - p2[1] = bmin[1]; - p2[2] = bmin[2]; - - if ( dz > dy ) - { - p3[1] = bmax[1]; - p3[2] = bmin[2]; - } - else - { - p3[1] = bmin[1]; - p3[2] = bmax[2]; - } - - break; - case 1: - p2[0] = bmin[0]; - p2[2] = bmin[2]; - - if ( dx > dz ) - { - p3[0] = bmax[0]; - p3[2] = bmin[2]; - } - else - { - p3[0] = bmin[0]; - p3[2] = bmax[2]; - } - - break; - case 2: - p2[0] = bmin[0]; - p2[1] = bmin[1]; - - if ( dx > dy ) - { - p3[0] = bmax[0]; - p3[1] = bmin[1]; - } - else - { - p3[0] = bmin[0]; - p3[1] = bmax[1]; - } - - break; - } - - REAL tp1[3]; - REAL tp2[3]; - REAL tp3[3]; - - fm_transform(matrix,p1,tp1); - fm_transform(matrix,p2,tp2); - fm_transform(matrix,p3,tp3); - - plane[3] = fm_computePlane(tp1,tp2,tp3,plane); - - return true; - - } - - #pragma warning(disable:4100) - - void fm_nearestPointInTriangle(const REAL * /*nearestPoint*/,const REAL * /*p1*/,const REAL * /*p2*/,const REAL * /*p3*/,REAL * /*nearest*/) - { - - } - - static REAL Partial(const REAL *a,const REAL *p) - { - return (a[0]*p[1]) - (p[0]*a[1]); - } - - REAL fm_areaTriangle(const REAL *p0,const REAL *p1,const REAL *p2) - { - REAL A = Partial(p0,p1); - A+= Partial(p1,p2); - A+= Partial(p2,p0); - return A*0.5f; - } - - void fm_subtract(const REAL *A,const REAL *B,REAL *diff) // compute A-B and store the result in 'diff' - { - diff[0] = A[0]-B[0]; - diff[1] = A[1]-B[1]; - diff[2] = A[2]-B[2]; - } - - - void fm_multiplyTransform(const REAL *pA,const REAL *pB,REAL *pM) - { - - REAL a = pA[0*4+0] * pB[0*4+0] + pA[0*4+1] * pB[1*4+0] + pA[0*4+2] * pB[2*4+0] + pA[0*4+3] * pB[3*4+0]; - REAL b = pA[0*4+0] * pB[0*4+1] + pA[0*4+1] * pB[1*4+1] + pA[0*4+2] * pB[2*4+1] + pA[0*4+3] * pB[3*4+1]; - REAL c = pA[0*4+0] * pB[0*4+2] + pA[0*4+1] * pB[1*4+2] + pA[0*4+2] * pB[2*4+2] + pA[0*4+3] * pB[3*4+2]; - REAL d = pA[0*4+0] * pB[0*4+3] + pA[0*4+1] * pB[1*4+3] + pA[0*4+2] * pB[2*4+3] + pA[0*4+3] * pB[3*4+3]; - - REAL e = pA[1*4+0] * pB[0*4+0] + pA[1*4+1] * pB[1*4+0] + pA[1*4+2] * pB[2*4+0] + pA[1*4+3] * pB[3*4+0]; - REAL f = pA[1*4+0] * pB[0*4+1] + pA[1*4+1] * pB[1*4+1] + pA[1*4+2] * pB[2*4+1] + pA[1*4+3] * pB[3*4+1]; - REAL g = pA[1*4+0] * pB[0*4+2] + pA[1*4+1] * pB[1*4+2] + pA[1*4+2] * pB[2*4+2] + pA[1*4+3] * pB[3*4+2]; - REAL h = pA[1*4+0] * pB[0*4+3] + pA[1*4+1] * pB[1*4+3] + pA[1*4+2] * pB[2*4+3] + pA[1*4+3] * pB[3*4+3]; - - REAL i = pA[2*4+0] * pB[0*4+0] + pA[2*4+1] * pB[1*4+0] + pA[2*4+2] * pB[2*4+0] + pA[2*4+3] * pB[3*4+0]; - REAL j = pA[2*4+0] * pB[0*4+1] + pA[2*4+1] * pB[1*4+1] + pA[2*4+2] * pB[2*4+1] + pA[2*4+3] * pB[3*4+1]; - REAL k = pA[2*4+0] * pB[0*4+2] + pA[2*4+1] * pB[1*4+2] + pA[2*4+2] * pB[2*4+2] + pA[2*4+3] * pB[3*4+2]; - REAL l = pA[2*4+0] * pB[0*4+3] + pA[2*4+1] * pB[1*4+3] + pA[2*4+2] * pB[2*4+3] + pA[2*4+3] * pB[3*4+3]; - - REAL m = pA[3*4+0] * pB[0*4+0] + pA[3*4+1] * pB[1*4+0] + pA[3*4+2] * pB[2*4+0] + pA[3*4+3] * pB[3*4+0]; - REAL n = pA[3*4+0] * pB[0*4+1] + pA[3*4+1] * pB[1*4+1] + pA[3*4+2] * pB[2*4+1] + pA[3*4+3] * pB[3*4+1]; - REAL o = pA[3*4+0] * pB[0*4+2] + pA[3*4+1] * pB[1*4+2] + pA[3*4+2] * pB[2*4+2] + pA[3*4+3] * pB[3*4+2]; - REAL p = pA[3*4+0] * pB[0*4+3] + pA[3*4+1] * pB[1*4+3] + pA[3*4+2] * pB[2*4+3] + pA[3*4+3] * pB[3*4+3]; - - pM[0] = a; pM[1] = b; pM[2] = c; pM[3] = d; - - pM[4] = e; pM[5] = f; pM[6] = g; pM[7] = h; - - pM[8] = i; pM[9] = j; pM[10] = k; pM[11] = l; - - pM[12] = m; pM[13] = n; pM[14] = o; pM[15] = p; - } - - void fm_multiply(REAL *A,REAL scaler) - { - A[0]*=scaler; - A[1]*=scaler; - A[2]*=scaler; - } - - void fm_add(const REAL *A,const REAL *B,REAL *sum) - { - sum[0] = A[0]+B[0]; - sum[1] = A[1]+B[1]; - sum[2] = A[2]+B[2]; - } - - void fm_copy3(const REAL *source,REAL *dest) - { - dest[0] = source[0]; - dest[1] = source[1]; - dest[2] = source[2]; - } - - - uint32_t fm_copyUniqueVertices(uint32_t vcount,const REAL *input_vertices,REAL *output_vertices,uint32_t tcount,const uint32_t *input_indices,uint32_t *output_indices) - { - uint32_t ret = 0; - - REAL *vertices = (REAL *)malloc(sizeof(REAL)*vcount*3); - memcpy(vertices,input_vertices,sizeof(REAL)*vcount*3); - REAL *dest = output_vertices; - - uint32_t *reindex = (uint32_t *)malloc(sizeof(uint32_t)*vcount); - memset(reindex,0xFF,sizeof(uint32_t)*vcount); - - uint32_t icount = tcount*3; - - for (uint32_t i=0; i 0 ) - { - uint32_t i1 = indices[0]; - uint32_t i2 = indices[1]; - uint32_t i3 = indices[2]; - const REAL *p1 = &vertices[i1*3]; - const REAL *p2 = &vertices[i2*3]; - const REAL *p3 = &vertices[i3*3]; - REAL plane[4]; - plane[3] = fm_computePlane(p1,p2,p3,plane); - const uint32_t *scan = &indices[3]; - for (uint32_t i=1; i= dmin && dot <= dmax ) - { - ret = true; // then the plane equation is for practical purposes identical. - } - } - #endif - return ret; - } - - - void fm_initMinMax(REAL bmin[3],REAL bmax[3]) - { - bmin[0] = FLT_MAX; - bmin[1] = FLT_MAX; - bmin[2] = FLT_MAX; - - bmax[0] = -FLT_MAX; - bmax[1] = -FLT_MAX; - bmax[2] = -FLT_MAX; - } - - void fm_inflateMinMax(REAL bmin[3], REAL bmax[3], REAL ratio) - { - REAL inflate = fm_distance(bmin, bmax)*0.5f*ratio; - - bmin[0] -= inflate; - bmin[1] -= inflate; - bmin[2] -= inflate; - - bmax[0] += inflate; - bmax[1] += inflate; - bmax[2] += inflate; - } - - #ifndef TESSELATE_H - - #define TESSELATE_H - - typedef std::vector< uint32_t > UintVector; - - class Myfm_Tesselate : public fm_Tesselate - { - public: - virtual ~Myfm_Tesselate(void) - { - - } - - const uint32_t * tesselate(fm_VertexIndex *vindex,uint32_t tcount,const uint32_t *indices,float longEdge,uint32_t maxDepth,uint32_t &outcount) - { - const uint32_t *ret = 0; - - mMaxDepth = maxDepth; - mLongEdge = longEdge*longEdge; - mLongEdgeD = mLongEdge; - mVertices = vindex; - - if ( mVertices->isDouble() ) - { - uint32_t vcount = mVertices->getVcount(); - double *vertices = (double *)malloc(sizeof(double)*vcount*3); - memcpy(vertices,mVertices->getVerticesDouble(),sizeof(double)*vcount*3); - - for (uint32_t i=0; igetVcount(); - float *vertices = (float *)malloc(sizeof(float)*vcount*3); - memcpy(vertices,mVertices->getVerticesFloat(),sizeof(float)*vcount*3); - - - for (uint32_t i=0; i mLongEdge || l2 > mLongEdge || l3 > mLongEdge ) - split = true; - - } - - if ( split ) - { - uint32_t edge; - - if ( l1 >= l2 && l1 >= l3 ) - edge = 0; - else if ( l2 >= l1 && l2 >= l3 ) - edge = 1; - else - edge = 2; - - float splits[3]; - - switch ( edge ) - { - case 0: - { - fm_lerp(p1,p2,splits,0.5f); - tesselate(p1,splits,p3, recurse+1 ); - tesselate(splits,p2,p3, recurse+1 ); - } - break; - case 1: - { - fm_lerp(p2,p3,splits,0.5f); - tesselate(p1,p2,splits, recurse+1 ); - tesselate(p1,splits,p3, recurse+1 ); - } - break; - case 2: - { - fm_lerp(p3,p1,splits,0.5f); - tesselate(p1,p2,splits, recurse+1 ); - tesselate(splits,p2,p3, recurse+1 ); - } - break; - } - } - else - { - bool newp; - - uint32_t i1 = mVertices->getIndex(p1,newp); - uint32_t i2 = mVertices->getIndex(p2,newp); - uint32_t i3 = mVertices->getIndex(p3,newp); - - mIndices.push_back(i1); - mIndices.push_back(i2); - mIndices.push_back(i3); - } - - } - - void tesselate(const double *p1,const double *p2,const double *p3,uint32_t recurse) - { - bool split = false; - double l1,l2,l3; - - l1 = l2 = l3 = 0; - - if ( recurse < mMaxDepth ) - { - l1 = fm_distanceSquared(p1,p2); - l2 = fm_distanceSquared(p2,p3); - l3 = fm_distanceSquared(p3,p1); - - if ( l1 > mLongEdgeD || l2 > mLongEdgeD || l3 > mLongEdgeD ) - split = true; - - } - - if ( split ) - { - uint32_t edge; - - if ( l1 >= l2 && l1 >= l3 ) - edge = 0; - else if ( l2 >= l1 && l2 >= l3 ) - edge = 1; - else - edge = 2; - - double splits[3]; - - switch ( edge ) - { - case 0: - { - fm_lerp(p1,p2,splits,0.5); - tesselate(p1,splits,p3, recurse+1 ); - tesselate(splits,p2,p3, recurse+1 ); - } - break; - case 1: - { - fm_lerp(p2,p3,splits,0.5); - tesselate(p1,p2,splits, recurse+1 ); - tesselate(p1,splits,p3, recurse+1 ); - } - break; - case 2: - { - fm_lerp(p3,p1,splits,0.5); - tesselate(p1,p2,splits, recurse+1 ); - tesselate(splits,p2,p3, recurse+1 ); - } - break; - } - } - else - { - bool newp; - - uint32_t i1 = mVertices->getIndex(p1,newp); - uint32_t i2 = mVertices->getIndex(p2,newp); - uint32_t i3 = mVertices->getIndex(p3,newp); - - mIndices.push_back(i1); - mIndices.push_back(i2); - mIndices.push_back(i3); - } - - } - - private: - float mLongEdge; - double mLongEdgeD; - fm_VertexIndex *mVertices; - UintVector mIndices; - uint32_t mMaxDepth; - }; - - fm_Tesselate * fm_createTesselate(void) - { - Myfm_Tesselate *m = new Myfm_Tesselate; - return static_cast< fm_Tesselate * >(m); - } - - void fm_releaseTesselate(fm_Tesselate *t) - { - Myfm_Tesselate *m = static_cast< Myfm_Tesselate *>(t); - delete m; - } - - #endif - - - #ifndef RAY_ABB_INTERSECT - - #define RAY_ABB_INTERSECT - - //! Integer representation of a floating-point value. - #define IR(x) ((uint32_t&)x) - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** - * A method to compute a ray-AABB intersection. - * Original code by Andrew Woo, from "Graphics Gems", Academic Press, 1990 - * Optimized code by Pierre Terdiman, 2000 (~20-30% faster on my Celeron 500) - * Epsilon value added by Klaus Hartmann. (discarding it saves a few cycles only) - * - * Hence this version is faster as well as more robust than the original one. - * - * Should work provided: - * 1) the integer representation of 0.0f is 0x00000000 - * 2) the sign bit of the float is the most significant one - * - * Report bugs: p.terdiman@codercorner.com - * - * \param aabb [in] the axis-aligned bounding box - * \param origin [in] ray origin - * \param dir [in] ray direction - * \param coord [out] impact coordinates - * \return true if ray intersects AABB - */ - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - #define RAYAABB_EPSILON 0.00001f - bool fm_intersectRayAABB(const float MinB[3],const float MaxB[3],const float origin[3],const float dir[3],float coord[3]) - { - bool Inside = true; - float MaxT[3]; - MaxT[0]=MaxT[1]=MaxT[2]=-1.0f; - - // Find candidate planes. - for(uint32_t i=0;i<3;i++) - { - if(origin[i] < MinB[i]) - { - coord[i] = MinB[i]; - Inside = false; - - // Calculate T distances to candidate planes - if(IR(dir[i])) MaxT[i] = (MinB[i] - origin[i]) / dir[i]; - } - else if(origin[i] > MaxB[i]) - { - coord[i] = MaxB[i]; - Inside = false; - - // Calculate T distances to candidate planes - if(IR(dir[i])) MaxT[i] = (MaxB[i] - origin[i]) / dir[i]; - } - } - - // Ray origin inside bounding box - if(Inside) - { - coord[0] = origin[0]; - coord[1] = origin[1]; - coord[2] = origin[2]; - return true; - } - - // Get largest of the maxT's for final choice of intersection - uint32_t WhichPlane = 0; - if(MaxT[1] > MaxT[WhichPlane]) WhichPlane = 1; - if(MaxT[2] > MaxT[WhichPlane]) WhichPlane = 2; - - // Check final candidate actually inside box - if(IR(MaxT[WhichPlane])&0x80000000) return false; - - for(uint32_t i=0;i<3;i++) - { - if(i!=WhichPlane) - { - coord[i] = origin[i] + MaxT[WhichPlane] * dir[i]; - #ifdef RAYAABB_EPSILON - if(coord[i] < MinB[i] - RAYAABB_EPSILON || coord[i] > MaxB[i] + RAYAABB_EPSILON) return false; - #else - if(coord[i] < MinB[i] || coord[i] > MaxB[i]) return false; - #endif - } - } - return true; // ray hits box - } - - bool fm_intersectLineSegmentAABB(const float bmin[3],const float bmax[3],const float p1[3],const float p2[3],float intersect[3]) - { - bool ret = false; - - float dir[3]; - dir[0] = p2[0] - p1[0]; - dir[1] = p2[1] - p1[1]; - dir[2] = p2[2] - p1[2]; - float dist = fm_normalize(dir); - if ( dist > RAYAABB_EPSILON ) - { - ret = fm_intersectRayAABB(bmin,bmax,p1,dir,intersect); - if ( ret ) - { - float d = fm_distanceSquared(p1,intersect); - if ( d > (dist*dist) ) - { - ret = false; - } - } - } - return ret; - } - - #endif - - #ifndef OBB_TO_AABB - - #define OBB_TO_AABB - - #pragma warning(disable:4100) - - void fm_OBBtoAABB(const float /*obmin*/[3],const float /*obmax*/[3],const float /*matrix*/[16],float /*abmin*/[3],float /*abmax*/[3]) - { - assert(0); // not yet implemented. - } - - - const REAL * computePos(uint32_t index,const REAL *vertices,uint32_t vstride) - { - const char *tmp = (const char *)vertices; - tmp+=(index*vstride); - return (const REAL*)tmp; - } - - void computeNormal(uint32_t index,REAL *normals,uint32_t nstride,const REAL *normal) - { - char *tmp = (char *)normals; - tmp+=(index*nstride); - REAL *dest = (REAL *)tmp; - dest[0]+=normal[0]; - dest[1]+=normal[1]; - dest[2]+=normal[2]; - } - - void fm_computeMeanNormals(uint32_t vcount, // the number of vertices - const REAL *vertices, // the base address of the vertex position data. - uint32_t vstride, // the stride between position data. - REAL *normals, // the base address of the destination for mean vector normals - uint32_t nstride, // the stride between normals - uint32_t tcount, // the number of triangles - const uint32_t *indices) // the triangle indices - { - - // Step #1 : Zero out the vertex normals - char *dest = (char *)normals; - for (uint32_t i=0; ixmax[0]) - Copy(xmax,caller_p); - if (caller_p[1]ymax[1]) - Copy(ymax,caller_p); - if (caller_p[2]zmax[2]) - Copy(zmax,caller_p); - scan+=pstride; - } - } - - /* Set xspan = distance between the 2 points xmin & xmax (squared) */ - REAL dx = xmax[0] - xmin[0]; - REAL dy = xmax[1] - xmin[1]; - REAL dz = xmax[2] - xmin[2]; - REAL xspan = dx*dx + dy*dy + dz*dz; - - /* Same for y & z spans */ - dx = ymax[0] - ymin[0]; - dy = ymax[1] - ymin[1]; - dz = ymax[2] - ymin[2]; - REAL yspan = dx*dx + dy*dy + dz*dz; - - dx = zmax[0] - zmin[0]; - dy = zmax[1] - zmin[1]; - dz = zmax[2] - zmin[2]; - REAL zspan = dx*dx + dy*dy + dz*dz; - - /* Set points dia1 & dia2 to the maximally separated pair */ - Copy(dia1,xmin); - Copy(dia2,xmax); /* assume xspan biggest */ - REAL maxspan = xspan; - - if (yspan>maxspan) - { - maxspan = yspan; - Copy(dia1,ymin); - Copy(dia2,ymax); - } - - if (zspan>maxspan) - { - maxspan = zspan; - Copy(dia1,zmin); - Copy(dia2,zmax); - } - - - /* dia1,dia2 is a diameter of initial sphere */ - /* calc initial center */ - center[0] = (dia1[0]+dia2[0])*0.5f; - center[1] = (dia1[1]+dia2[1])*0.5f; - center[2] = (dia1[2]+dia2[2])*0.5f; - - /* calculate initial radius**2 and radius */ - - dx = dia2[0]-center[0]; /* x component of radius vector */ - dy = dia2[1]-center[1]; /* y component of radius vector */ - dz = dia2[2]-center[2]; /* z component of radius vector */ - - radius2 = dx*dx + dy*dy + dz*dz; - radius = REAL(sqrt(radius2)); - - /* SECOND PASS: increment current sphere */ - { - const char *scan = (const char *)points; - for (uint32_t i=0; i radius2) /* do r**2 test first */ - { /* this point is outside of current sphere */ - REAL old_to_p = REAL(sqrt(old_to_p_sq)); - /* calc radius of new sphere */ - radius = (radius + old_to_p) * 0.5f; - radius2 = radius*radius; /* for next r**2 compare */ - REAL old_to_new = old_to_p - radius; - /* calc center of new sphere */ - REAL recip = 1.0f /old_to_p; - REAL cx = (radius*center[0] + old_to_new*caller_p[0]) * recip; - REAL cy = (radius*center[1] + old_to_new*caller_p[1]) * recip; - REAL cz = (radius*center[2] + old_to_new*caller_p[2]) * recip; - Set(center,cx,cy,cz); - scan+=pstride; - } - } - } - return radius; - } - - - void fm_computeBestFitCapsule(uint32_t vcount,const REAL *points,uint32_t pstride,REAL &radius,REAL &height,REAL matrix[16],bool bruteForce) - { - REAL sides[3]; - REAL omatrix[16]; - fm_computeBestFitOBB(vcount,points,pstride,sides,omatrix,bruteForce); - - int32_t axis = 0; - if ( sides[0] > sides[1] && sides[0] > sides[2] ) - axis = 0; - else if ( sides[1] > sides[0] && sides[1] > sides[2] ) - axis = 1; - else - axis = 2; - - REAL localTransform[16]; - - REAL maxDist = 0; - REAL maxLen = 0; - - switch ( axis ) - { - case 0: - { - fm_eulerMatrix(0,0,FM_PI/2,localTransform); - fm_matrixMultiply(localTransform,omatrix,matrix); - - const uint8_t *scan = (const uint8_t *)points; - for (uint32_t i=0; i maxDist ) - { - maxDist = dist; - } - REAL l = (REAL) fabs(t[0]); - if ( l > maxLen ) - { - maxLen = l; - } - scan+=pstride; - } - } - height = sides[0]; - break; - case 1: - { - fm_eulerMatrix(0,FM_PI/2,0,localTransform); - fm_matrixMultiply(localTransform,omatrix,matrix); - - const uint8_t *scan = (const uint8_t *)points; - for (uint32_t i=0; i maxDist ) - { - maxDist = dist; - } - REAL l = (REAL) fabs(t[1]); - if ( l > maxLen ) - { - maxLen = l; - } - scan+=pstride; - } - } - height = sides[1]; - break; - case 2: - { - fm_eulerMatrix(FM_PI/2,0,0,localTransform); - fm_matrixMultiply(localTransform,omatrix,matrix); - - const uint8_t *scan = (const uint8_t *)points; - for (uint32_t i=0; i maxDist ) - { - maxDist = dist; - } - REAL l = (REAL) fabs(t[2]); - if ( l > maxLen ) - { - maxLen = l; - } - scan+=pstride; - } - } - height = sides[2]; - break; - } - radius = (REAL)sqrt(maxDist); - height = (maxLen*2)-(radius*2); - } - - - //************* Triangulation - - #ifndef TRIANGULATE_H - - #define TRIANGULATE_H - - typedef uint32_t TU32; - - class TVec - { - public: - TVec(double _x,double _y,double _z) { x = _x; y = _y; z = _z; } - TVec(void) { } - - double x; - double y; - double z; - }; - - typedef std::vector< TVec > TVecVector; - typedef std::vector< TU32 > TU32Vector; - - class CTriangulator - { - public: - /// Default constructor - CTriangulator(); - - /// Default destructor - virtual ~CTriangulator(); - - /// Triangulates the contour - void triangulate(TU32Vector &indices); - - /// Returns the given point in the triangulator array - inline TVec get(const TU32 id) { return mPoints[id]; } - - virtual void reset(void) - { - mInputPoints.clear(); - mPoints.clear(); - mIndices.clear(); - } - - virtual void addPoint(double x,double y,double z) - { - TVec v(x,y,z); - // update bounding box... - if ( mInputPoints.empty() ) - { - mMin = v; - mMax = v; - } - else - { - if ( x < mMin.x ) mMin.x = x; - if ( y < mMin.y ) mMin.y = y; - if ( z < mMin.z ) mMin.z = z; - - if ( x > mMax.x ) mMax.x = x; - if ( y > mMax.y ) mMax.y = y; - if ( z > mMax.z ) mMax.z = z; - } - mInputPoints.push_back(v); - } - - // Triangulation happens in 2d. We could inverse transform the polygon around the normal direction, or we just use the two most signficant axes - // Here we find the two longest axes and use them to triangulate. Inverse transforming them would introduce more doubleing point error and isn't worth it. - virtual uint32_t * triangulate(uint32_t &tcount,double epsilon) - { - uint32_t *ret = 0; - tcount = 0; - mEpsilon = epsilon; - - if ( !mInputPoints.empty() ) - { - mPoints.clear(); - - double dx = mMax.x - mMin.x; // locate the first, second and third longest edges and store them in i1, i2, i3 - double dy = mMax.y - mMin.y; - double dz = mMax.z - mMin.z; - - uint32_t i1,i2,i3; - - if ( dx > dy && dx > dz ) - { - i1 = 0; - if ( dy > dz ) - { - i2 = 1; - i3 = 2; - } - else - { - i2 = 2; - i3 = 1; - } - } - else if ( dy > dx && dy > dz ) - { - i1 = 1; - if ( dx > dz ) - { - i2 = 0; - i3 = 2; - } - else - { - i2 = 2; - i3 = 0; - } - } - else - { - i1 = 2; - if ( dx > dy ) - { - i2 = 0; - i3 = 1; - } - else - { - i2 = 1; - i3 = 0; - } - } - - uint32_t pcount = (uint32_t)mInputPoints.size(); - const double *points = &mInputPoints[0].x; - for (uint32_t i=0; i 2;) - { - if (0 >= (count--)) - return; - - int32_t u = v; - if (nv <= u) - u = 0; - v = u + 1; - if (nv <= v) - v = 0; - int32_t w = v + 1; - if (nv <= w) - w = 0; - - if (_snip(u, v, w, nv, V)) - { - int32_t a, b, c, s, t; - a = V[u]; - b = V[v]; - c = V[w]; - if ( flipped ) - { - indices.push_back(TU32(a)); - indices.push_back(TU32(b)); - indices.push_back(TU32(c)); - } - else - { - indices.push_back(TU32(c)); - indices.push_back(TU32(b)); - indices.push_back(TU32(a)); - } - m++; - for (s = v, t = v + 1; t < nv; s++, t++) - V[s] = V[t]; - nv--; - count = 2 * nv; - } - } - - free(V); - } - - /// Returns the area of the contour - double CTriangulator::_area() - { - size_t n = mPoints.size(); - double A = 0.0f; - for (size_t p = n - 1, q = 0; q < n; p = q++) - { - const TVec &pval = mPoints[p]; - const TVec &qval = mPoints[q]; - A += pval.x * qval.y - qval.x * pval.y; - } - A*=0.5f; - return A; - } - - bool CTriangulator::_snip(int32_t u, int32_t v, int32_t w, int32_t n, int32_t *V) - { - int32_t p; - - const TVec &A = mPoints[ size_t(V[u]) ]; - const TVec &B = mPoints[ size_t(V[v]) ]; - const TVec &C = mPoints[ size_t(V[w]) ]; - - if (mEpsilon > (((B.x - A.x) * (C.y - A.y)) - ((B.y - A.y) * (C.x - A.x))) ) - return false; - - for (p = 0; p < n; p++) - { - if ((p == u) || (p == v) || (p == w)) - continue; - const TVec &P = mPoints[size_t(V[p]) ]; - if (_insideTriangle(A, B, C, P)) - return false; - } - return true; - } - - /// Tests if a point is inside the given triangle - bool CTriangulator::_insideTriangle(const TVec& A, const TVec& B, const TVec& C,const TVec& P) - { - double ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy; - double cCROSSap, bCROSScp, aCROSSbp; - - ax = C.x - B.x; ay = C.y - B.y; - bx = A.x - C.x; by = A.y - C.y; - cx = B.x - A.x; cy = B.y - A.y; - apx = P.x - A.x; apy = P.y - A.y; - bpx = P.x - B.x; bpy = P.y - B.y; - cpx = P.x - C.x; cpy = P.y - C.y; - - aCROSSbp = ax * bpy - ay * bpx; - cCROSSap = cx * apy - cy * apx; - bCROSScp = bx * cpy - by * cpx; - - return ((aCROSSbp >= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f)); - } - - class Triangulate : public fm_Triangulate - { - public: - Triangulate(void) - { - mPointsFloat = 0; - mPointsDouble = 0; - } - - virtual ~Triangulate(void) - { - reset(); - } - void reset(void) - { - free(mPointsFloat); - free(mPointsDouble); - mPointsFloat = 0; - mPointsDouble = 0; - } - - virtual const double * triangulate3d(uint32_t pcount, - const double *_points, - uint32_t vstride, - uint32_t &tcount, - bool consolidate, - double epsilon) - { - reset(); - - double *points = (double *)malloc(sizeof(double)*pcount*3); - if ( consolidate ) - { - pcount = fm_consolidatePolygon(pcount,_points,vstride,points,1-epsilon); - } - else - { - double *dest = points; - for (uint32_t i=0; i= 3 ) - { - CTriangulator ct; - for (uint32_t i=0; i(t); - } - - void fm_releaseTriangulate(fm_Triangulate *t) - { - Triangulate *tt = static_cast< Triangulate *>(t); - delete tt; - } - - #endif - - bool validDistance(const REAL *p1,const REAL *p2,REAL epsilon) - { - bool ret = true; - - REAL dx = p1[0] - p2[0]; - REAL dy = p1[1] - p2[1]; - REAL dz = p1[2] - p2[2]; - REAL dist = dx*dx+dy*dy+dz*dz; - if ( dist < (epsilon*epsilon) ) - { - ret = false; - } - return ret; - } - - bool fm_isValidTriangle(const REAL *p1,const REAL *p2,const REAL *p3,REAL epsilon) - { - bool ret = false; - - if ( validDistance(p1,p2,epsilon) && - validDistance(p1,p3,epsilon) && - validDistance(p2,p3,epsilon) ) - { - - REAL area = fm_computeArea(p1,p2,p3); - if ( area > epsilon ) - { - REAL _vertices[3*3],vertices[64*3]; - - _vertices[0] = p1[0]; - _vertices[1] = p1[1]; - _vertices[2] = p1[2]; - - _vertices[3] = p2[0]; - _vertices[4] = p2[1]; - _vertices[5] = p2[2]; - - _vertices[6] = p3[0]; - _vertices[7] = p3[1]; - _vertices[8] = p3[2]; - - uint32_t pcount = fm_consolidatePolygon(3,_vertices,sizeof(REAL)*3,vertices,1-epsilon); - if ( pcount == 3 ) - { - ret = true; - } - } - } - return ret; - } - - - void fm_multiplyQuat(const REAL *left,const REAL *right,REAL *quat) - { - REAL a,b,c,d; - - a = left[3]*right[3] - left[0]*right[0] - left[1]*right[1] - left[2]*right[2]; - b = left[3]*right[0] + right[3]*left[0] + left[1]*right[2] - right[1]*left[2]; - c = left[3]*right[1] + right[3]*left[1] + left[2]*right[0] - right[2]*left[0]; - d = left[3]*right[2] + right[3]*left[2] + left[0]*right[1] - right[0]*left[1]; - - quat[3] = a; - quat[0] = b; - quat[1] = c; - quat[2] = d; - } - - bool fm_computeCentroid(uint32_t vcount, // number of input data points - const REAL *points, // starting address of points array. - REAL *center) - - { - bool ret = false; - if ( vcount ) - { - center[0] = 0; - center[1] = 0; - center[2] = 0; - const REAL *p = points; - for (uint32_t i=0; i class Vec3 - { - public: - Vec3(void) - { - - } - Vec3(Type _x,Type _y,Type _z) - { - x = _x; - y = _y; - z = _z; - } - Type x; - Type y; - Type z; - }; - #endif - - void fm_transformAABB(const REAL bmin[3],const REAL bmax[3],const REAL matrix[16],REAL tbmin[3],REAL tbmax[3]) - { - Vec3 box[8]; - box[0] = Vec3< REAL >( bmin[0], bmin[1], bmin[2] ); - box[1] = Vec3< REAL >( bmax[0], bmin[1], bmin[2] ); - box[2] = Vec3< REAL >( bmax[0], bmax[1], bmin[2] ); - box[3] = Vec3< REAL >( bmin[0], bmax[1], bmin[2] ); - box[4] = Vec3< REAL >( bmin[0], bmin[1], bmax[2] ); - box[5] = Vec3< REAL >( bmax[0], bmin[1], bmax[2] ); - box[6] = Vec3< REAL >( bmax[0], bmax[1], bmax[2] ); - box[7] = Vec3< REAL >( bmin[0], bmax[1], bmax[2] ); - // transform all 8 corners of the box and then recompute a new AABB - for (unsigned int i=0; i<8; i++) - { - Vec3< REAL > &p = box[i]; - fm_transform(matrix,&p.x,&p.x); - if ( i == 0 ) - { - tbmin[0] = tbmax[0] = p.x; - tbmin[1] = tbmax[1] = p.y; - tbmin[2] = tbmax[2] = p.z; - } - else - { - if ( p.x < tbmin[0] ) tbmin[0] = p.x; - if ( p.y < tbmin[1] ) tbmin[1] = p.y; - if ( p.z < tbmin[2] ) tbmin[2] = p.z; - if ( p.x > tbmax[0] ) tbmax[0] = p.x; - if ( p.y > tbmax[1] ) tbmax[1] = p.y; - if ( p.z > tbmax[2] ) tbmax[2] = p.z; - } - } - } - - REAL fm_normalizeQuat(REAL n[4]) // normalize this quat - { - REAL dx = n[0]*n[0]; - REAL dy = n[1]*n[1]; - REAL dz = n[2]*n[2]; - REAL dw = n[3]*n[3]; - - REAL dist = dx*dx+dy*dy+dz*dz+dw*dw; - - dist = (REAL)sqrt(dist); - - REAL recip = 1.0f / dist; - - n[0]*=recip; - n[1]*=recip; - n[2]*=recip; - n[3]*=recip; - - return dist; - } - } // end of namespace -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/VHACD.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/VHACD.cpp deleted file mode 100644 index 56c5cb20f1..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/VHACD.cpp +++ /dev/null @@ -1,1238 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include -#include "vhacdConvexHull.h" -#include "VHACD.h" -#include "vhacdICHull.h" -#include "vhacdMesh.h" -#include "vhacdSArray.h" -#include "vhacdTimer.h" -#include "vhacdVHACD.h" -#include "vhacdVector.h" -#include "vhacdVolume.h" -#include "FloatMath.h" - -namespace nd_ -{ - #define MAX(a, b) (((a) > (b)) ? (a) : (b)) - #define MIN(a, b) (((a) < (b)) ? (a) : (b)) - #define ABS(a) (((a) < 0) ? -(a) : (a)) - #define ZSGN(a) (((a) < 0) ? -1 : (a) > 0 ? 1 : 0) - #define MAX_DOUBLE (1.79769e+308) - - #define USE_CPP_11_THREADS - - inline int32_t FindMinimumElement(const float* const d, float* const m, const int32_t begin, const int32_t end) - { - int32_t idx = -1; - float min = (std::numeric_limits::max)(); - for (size_t i = size_t(begin); i < size_t(end); ++i) { - if (d[i] < min) { - idx = int32_t(i); - min = d[i]; - } - } - - *m = min; - return idx; - } - - namespace VHACD { - IVHACD* CreateVHACD(void) - { - return new VHACD(); - } - - void VHACD::ComputePrimitiveSet(const Parameters& params) - { - if (GetCancel()) { - return; - } - m_timer.Tic(); - - m_stage = "Compute primitive set"; - m_operation = "Convert volume to pset"; - - std::ostringstream msg; - if (params.m_logger) { - msg << "+ " << m_stage << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - Update(0.0, 0.0, params); - if (params.m_mode == 0) { - VoxelSet* vset = new VoxelSet; - m_volume->Convert(*vset); - m_pset = vset; - } - else { - TetrahedronSet* tset = new TetrahedronSet; - m_volume->Convert(*tset); - m_pset = tset; - } - - delete m_volume; - m_volume = 0; - - if (params.m_logger) { - msg.str(""); - msg << "\t # primitives " << m_pset->GetNPrimitives() << std::endl; - msg << "\t # inside surface " << m_pset->GetNPrimitivesInsideSurf() << std::endl; - msg << "\t # on surface " << m_pset->GetNPrimitivesOnSurf() << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - m_overallProgress = 15.0; - Update(100.0, 100.0, params); - m_timer.Toc(); - if (params.m_logger) { - msg.str(""); - msg << "\t time " << m_timer.GetElapsedTime() / 1000.0 << "s" << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - } - bool VHACD::Compute(const double* const points, const uint32_t nPoints, - const uint32_t* const triangles,const uint32_t nTriangles, const Parameters& params) - { - return ComputeACD(points, nPoints, triangles, nTriangles, params); - } - bool VHACD::Compute(const float* const points,const uint32_t nPoints, - const uint32_t* const triangles,const uint32_t nTriangles, const Parameters& params) - { - return ComputeACD(points, nPoints, triangles, nTriangles, params); - } - double ComputePreferredCuttingDirection(const PrimitiveSet* const tset, Vec3& dir) - { - double ex = tset->GetEigenValue(AXIS_X); - double ey = tset->GetEigenValue(AXIS_Y); - double ez = tset->GetEigenValue(AXIS_Z); - double vx = (ey - ez) * (ey - ez); - double vy = (ex - ez) * (ex - ez); - double vz = (ex - ey) * (ex - ey); - if (vx < vy && vx < vz) { - double e = ey * ey + ez * ez; - dir[0] = 1.0; - dir[1] = 0.0; - dir[2] = 0.0; - return (e == 0.0) ? 0.0 : 1.0 - vx / e; - } - else if (vy < vx && vy < vz) { - double e = ex * ex + ez * ez; - dir[0] = 0.0; - dir[1] = 1.0; - dir[2] = 0.0; - return (e == 0.0) ? 0.0 : 1.0 - vy / e; - } - else { - double e = ex * ex + ey * ey; - dir[0] = 0.0; - dir[1] = 0.0; - dir[2] = 1.0; - return (e == 0.0) ? 0.0 : 1.0 - vz / e; - } - } - void ComputeAxesAlignedClippingPlanes(const VoxelSet& vset, const short downsampling, SArray& planes) - { - const Vec3 minV = vset.GetMinBBVoxels(); - const Vec3 maxV = vset.GetMaxBBVoxels(); - Vec3 pt; - Plane plane; - const short i0 = minV[0]; - const short i1 = maxV[0]; - plane.m_a = 1.0; - plane.m_b = 0.0; - plane.m_c = 0.0; - plane.m_axis = AXIS_X; - for (short i = i0; i <= i1; i += downsampling) { - pt = vset.GetPoint(Vec3(i + 0.5, 0.0, 0.0)); - plane.m_d = -pt[0]; - plane.m_index = i; - planes.PushBack(plane); - } - const short j0 = minV[1]; - const short j1 = maxV[1]; - plane.m_a = 0.0; - plane.m_b = 1.0; - plane.m_c = 0.0; - plane.m_axis = AXIS_Y; - for (short j = j0; j <= j1; j += downsampling) { - pt = vset.GetPoint(Vec3(0.0, j + 0.5, 0.0)); - plane.m_d = -pt[1]; - plane.m_index = j; - planes.PushBack(plane); - } - const short k0 = minV[2]; - const short k1 = maxV[2]; - plane.m_a = 0.0; - plane.m_b = 0.0; - plane.m_c = 1.0; - plane.m_axis = AXIS_Z; - for (short k = k0; k <= k1; k += downsampling) { - pt = vset.GetPoint(Vec3(0.0, 0.0, k + 0.5)); - plane.m_d = -pt[2]; - plane.m_index = k; - planes.PushBack(plane); - } - } - void ComputeAxesAlignedClippingPlanes(const TetrahedronSet& tset, const short downsampling, SArray& planes) - { - const Vec3 minV = tset.GetMinBB(); - const Vec3 maxV = tset.GetMaxBB(); - const double scale = tset.GetSacle(); - const short i0 = 0; - const short j0 = 0; - const short k0 = 0; - const short i1 = static_cast((maxV[0] - minV[0]) / scale + 0.5); - const short j1 = static_cast((maxV[1] - minV[1]) / scale + 0.5); - const short k1 = static_cast((maxV[2] - minV[2]) / scale + 0.5); - - Plane plane; - plane.m_a = 1.0; - plane.m_b = 0.0; - plane.m_c = 0.0; - plane.m_axis = AXIS_X; - for (short i = i0; i <= i1; i += downsampling) { - double x = minV[0] + scale * i; - plane.m_d = -x; - plane.m_index = i; - planes.PushBack(plane); - } - plane.m_a = 0.0; - plane.m_b = 1.0; - plane.m_c = 0.0; - plane.m_axis = AXIS_Y; - for (short j = j0; j <= j1; j += downsampling) { - double y = minV[1] + scale * j; - plane.m_d = -y; - plane.m_index = j; - planes.PushBack(plane); - } - plane.m_a = 0.0; - plane.m_b = 0.0; - plane.m_c = 1.0; - plane.m_axis = AXIS_Z; - for (short k = k0; k <= k1; k += downsampling) { - double z = minV[2] + scale * k; - plane.m_d = -z; - plane.m_index = k; - planes.PushBack(plane); - } - } - void RefineAxesAlignedClippingPlanes(const VoxelSet& vset, const Plane& bestPlane, const short downsampling, - SArray& planes) - { - const Vec3 minV = vset.GetMinBBVoxels(); - const Vec3 maxV = vset.GetMaxBBVoxels(); - Vec3 pt; - Plane plane; - - if (bestPlane.m_axis == AXIS_X) { - const short i0 = MAX(minV[0], bestPlane.m_index - downsampling); - const short i1 = MIN(maxV[0], bestPlane.m_index + downsampling); - plane.m_a = 1.0; - plane.m_b = 0.0; - plane.m_c = 0.0; - plane.m_axis = AXIS_X; - for (short i = i0; i <= i1; ++i) { - pt = vset.GetPoint(Vec3(i + 0.5, 0.0, 0.0)); - plane.m_d = -pt[0]; - plane.m_index = i; - planes.PushBack(plane); - } - } - else if (bestPlane.m_axis == AXIS_Y) { - const short j0 = MAX(minV[1], bestPlane.m_index - downsampling); - const short j1 = MIN(maxV[1], bestPlane.m_index + downsampling); - plane.m_a = 0.0; - plane.m_b = 1.0; - plane.m_c = 0.0; - plane.m_axis = AXIS_Y; - for (short j = j0; j <= j1; ++j) { - pt = vset.GetPoint(Vec3(0.0, j + 0.5, 0.0)); - plane.m_d = -pt[1]; - plane.m_index = j; - planes.PushBack(plane); - } - } - else { - const short k0 = MAX(minV[2], bestPlane.m_index - downsampling); - const short k1 = MIN(maxV[2], bestPlane.m_index + downsampling); - plane.m_a = 0.0; - plane.m_b = 0.0; - plane.m_c = 1.0; - plane.m_axis = AXIS_Z; - for (short k = k0; k <= k1; ++k) { - pt = vset.GetPoint(Vec3(0.0, 0.0, k + 0.5)); - plane.m_d = -pt[2]; - plane.m_index = k; - planes.PushBack(plane); - } - } - } - void RefineAxesAlignedClippingPlanes(const TetrahedronSet& tset, const Plane& bestPlane, const short downsampling, - SArray& planes) - { - const Vec3 minV = tset.GetMinBB(); - const Vec3 maxV = tset.GetMaxBB(); - const double scale = tset.GetSacle(); - Plane plane; - - if (bestPlane.m_axis == AXIS_X) { - const short i0 = MAX(0, bestPlane.m_index - downsampling); - const short i1 = static_cast(MIN((maxV[0] - minV[0]) / scale + 0.5, bestPlane.m_index + downsampling)); - plane.m_a = 1.0; - plane.m_b = 0.0; - plane.m_c = 0.0; - plane.m_axis = AXIS_X; - for (short i = i0; i <= i1; ++i) { - double x = minV[0] + scale * i; - plane.m_d = -x; - plane.m_index = i; - planes.PushBack(plane); - } - } - else if (bestPlane.m_axis == AXIS_Y) { - const short j0 = MAX(0, bestPlane.m_index - downsampling); - const short j1 = static_cast(MIN((maxV[1] - minV[1]) / scale + 0.5, bestPlane.m_index + downsampling)); - plane.m_a = 0.0; - plane.m_b = 1.0; - plane.m_c = 0.0; - plane.m_axis = AXIS_Y; - for (short j = j0; j <= j1; ++j) { - double y = minV[1] + scale * j; - plane.m_d = -y; - plane.m_index = j; - planes.PushBack(plane); - } - } - else { - const short k0 = MAX(0, bestPlane.m_index - downsampling); - const short k1 = static_cast(MIN((maxV[2] - minV[2]) / scale + 0.5, bestPlane.m_index + downsampling)); - plane.m_a = 0.0; - plane.m_b = 0.0; - plane.m_c = 1.0; - plane.m_axis = AXIS_Z; - for (short k = k0; k <= k1; ++k) { - double z = minV[2] + scale * k; - plane.m_d = -z; - plane.m_index = k; - planes.PushBack(plane); - } - } - } - inline double ComputeLocalConcavity(const double volume, const double volumeCH) - { - return fabs(volumeCH - volume) / volumeCH; - } - inline double ComputeConcavity(const double volume, const double volumeCH, const double volume0) - { - return fabs(volumeCH - volume) / volume0; - } - - void VHACD::ComputeBestClippingPlane(const PrimitiveSet* inputPSet, const double, const SArray& planes, - const Vec3& preferredCuttingDirection, const double w, const double alpha, const double beta, - const int32_t convexhullDownsampling, const double, const double, Plane& bestPlane, - double& minConcavity, const Parameters& params) - { - if (GetCancel()) - { - return; - } - char msg[256]; - int32_t iBest = -1; - int32_t nPlanes = static_cast(planes.Size()); - double minTotal = MAX_DOUBLE; - double minBalance = MAX_DOUBLE; - double minSymmetry = MAX_DOUBLE; - minConcavity = MAX_DOUBLE; - - PrimitiveSet* onSurfacePSet = inputPSet->Create(); - inputPSet->SelectOnSurface(onSurfacePSet); - - PrimitiveSet** psets = 0; - if (!params.m_convexhullApproximation) - { - psets = new PrimitiveSet*[2]; - for (int32_t i = 0; i < 2; ++i) - { - psets[i] = inputPSet->Create(); - } - } - - #ifdef DEBUG_TEMP - Timer timerComputeCost; - timerComputeCost.Tic(); - #endif // DEBUG_TEMP - - - class CommonData - { - public: - CommonData(VHACD* me, const Parameters& params) - :m_me(me) - ,m_params(params) - { - } - - VHACD* m_me; - double m_w; - double m_beta; - double m_alpha; - const Parameters& m_params; - PrimitiveSet* m_onSurfacePSet; - const PrimitiveSet* m_inputPSet; - int32_t m_convexhullDownsampling; - Mesh chs[VHACD_WORKERS_THREADS][2]; - SArray> chPts[VHACD_WORKERS_THREADS][2]; - - Vec3 m_preferredCuttingDirection; - PrimitiveSet** m_psets; - }; - - class BestClippingPlaneJob : public Job - { - public: - BestClippingPlaneJob() - :Job() - { - } - - void Execute(int threadId) - { - Mesh& leftCH = m_commonData->chs[threadId][0]; - Mesh& rightCH = m_commonData->chs[threadId][1]; - rightCH.ResizePoints(0); - leftCH.ResizePoints(0); - rightCH.ResizeTriangles(0); - leftCH.ResizeTriangles(0); - - if (m_commonData->m_params.m_convexhullApproximation) - { - SArray >& leftCHPts = m_commonData->chPts[threadId][0]; - SArray >& rightCHPts = m_commonData->chPts[threadId][1];; - rightCHPts.Resize(0); - leftCHPts.Resize(0); - m_commonData->m_onSurfacePSet->Intersect(m_plane, &rightCHPts, &leftCHPts, size_t (m_commonData->m_convexhullDownsampling * 32)); - m_commonData->m_inputPSet->GetConvexHull().Clip(m_plane, rightCHPts, leftCHPts); - rightCH.ComputeConvexHull((double*)rightCHPts.Data(), rightCHPts.Size()); - leftCH.ComputeConvexHull((double*)leftCHPts.Data(), leftCHPts.Size()); - } - else - { - _ASSERT(0); - PrimitiveSet* const right = m_commonData->m_psets[threadId * 2 + 0]; - PrimitiveSet* const left = m_commonData->m_psets[threadId * 2 + 1]; - m_commonData->m_onSurfacePSet->Clip(m_plane, right, left); - right->ComputeConvexHull(rightCH, size_t(m_commonData->m_convexhullDownsampling)); - left->ComputeConvexHull(leftCH, size_t(m_commonData->m_convexhullDownsampling)); - } - - double volumeLeftCH = leftCH.ComputeVolume(); - double volumeRightCH = rightCH.ComputeVolume(); - - // compute clipped volumes - double volumeLeft = 0.0; - double volumeRight = 0.0; - - m_commonData->m_inputPSet->ComputeClippedVolumes(m_plane, volumeRight, volumeLeft); - - double concavityLeft = float(ComputeConcavity(volumeLeft, volumeLeftCH, m_commonData->m_me->m_volumeCH0)); - double concavityRight = float(ComputeConcavity(volumeRight, volumeRightCH, m_commonData->m_me->m_volumeCH0)); - double concavity = (concavityLeft + concavityRight); - - // compute cost - m_concavity = concavity; - m_balance = m_commonData->m_alpha * fabs(volumeLeft - volumeRight) / m_commonData->m_me->m_volumeCH0; - double d = m_commonData->m_w * (m_commonData->m_preferredCuttingDirection[0] * m_plane.m_a + m_commonData->m_preferredCuttingDirection[1] * m_plane.m_b + m_commonData->m_preferredCuttingDirection[2] * m_plane.m_c); - m_symmetry = m_commonData->m_beta * d; - } - - double m_concavity; - double m_balance; - double m_symmetry; - Plane m_plane; - CommonData* m_commonData; - }; - - std::vector jobs; - jobs.resize(size_t(nPlanes)); - - CommonData data(this, params); - data.m_w = w; - data.m_beta = beta; - data.m_alpha = alpha; - data.m_psets = psets; - data.m_inputPSet = inputPSet; - data.m_onSurfacePSet = onSurfacePSet; - data.m_preferredCuttingDirection = preferredCuttingDirection; - data.m_convexhullDownsampling = convexhullDownsampling; - for (size_t i = 0; i < size_t(nPlanes); ++i) - { - jobs[i].m_plane = planes[i]; - jobs[i].m_commonData = &data; - m_parallelQueue.PushTask(&jobs[i]); - } - m_parallelQueue.Sync(); - - iBest = 0; - minConcavity = jobs[0].m_concavity; - minBalance = jobs[0].m_balance; - minSymmetry = jobs[0].m_symmetry; - bestPlane = jobs[0].m_plane; - minTotal = jobs[0].m_concavity + jobs[0].m_balance + jobs[0].m_symmetry; - for (size_t i = 1; i < size_t(nPlanes); ++i) - { - double total = jobs[i].m_concavity + jobs[i].m_balance + jobs[i].m_symmetry; - if ((total < minTotal && int32_t(i) < iBest) || total < minTotal) - { - minConcavity = jobs[i].m_concavity; - minBalance = jobs[i].m_balance; - minSymmetry = jobs[i].m_symmetry; - bestPlane = jobs[i].m_plane; - minTotal = total; - iBest = int32_t(i); - } - } - - #ifdef DEBUG_TEMP - timerComputeCost.Toc(); - printf_s("Cost[%i] = %f\n", nPlanes, timerComputeCost.GetElapsedTime()); - #endif // DEBUG_TEMP - - if (psets) - { - for (int32_t i = 0; i < 2; ++i) - { - delete psets[i]; - } - delete[] psets; - } - delete onSurfacePSet; - if (params.m_logger) - { - snprintf(msg, sizeof (msg), "\n\t\t\t Best %04i T=%2.6f C=%2.6f B=%2.6f S=%2.6f (%1.1f, %1.1f, %1.1f, %3.3f)\n\n", int (iBest), minTotal, minConcavity, minBalance, minSymmetry, bestPlane.m_a, bestPlane.m_b, bestPlane.m_c, bestPlane.m_d); - params.m_logger->Log(msg); - } - } - - void VHACD::ComputeACD(const Parameters& params) - { - if (GetCancel()) { - return; - } - m_timer.Tic(); - - m_stage = "Approximate Convex Decomposition"; - m_stageProgress = 0.0; - std::ostringstream msg; - if (params.m_logger) { - msg << "+ " << m_stage << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - SArray parts; - SArray inputParts; - SArray temp; - inputParts.PushBack(m_pset); - m_pset = 0; - SArray planes; - SArray planesRef; - uint32_t sub = 0; - bool firstIteration = true; - m_volumeCH0 = 1.0; - - // Compute the decomposition depth based on the number of convex hulls being requested.. - uint32_t hullCount = 2; - uint32_t depth = 1; - while (params.m_maxConvexHulls > hullCount) - { - depth++; - hullCount *= 2; - } - // We must always increment the decomposition depth one higher than the maximum number of hulls requested. - // The reason for this is as follows. - // Say, for example, the user requests 32 convex hulls exactly. This would be a decomposition depth of 5. - // However, when we do that, we do *not* necessarily get 32 hulls as a result. This is because, during - // the recursive descent of the binary tree, one or more of the leaf nodes may have no concavity and - // will not be split. So, in this way, even with a decomposition depth of 5, you can produce fewer than - // 32 hulls. So, in this case, we would set the decomposition depth to 6 (producing up to as high as 64 convex hulls). - // Then, the merge step which combines over-described hulls down to the user requested amount, we will end up - // getting exactly 32 convex hulls as a result. - // We could just allow the artist to directly control the decomposition depth directly, but this would be a bit - // too complex and the preference is simply to let them specify how many hulls they want and derive the solution - // from that. - depth++; - - - while (sub++ < depth && inputParts.Size() > 0 && !m_cancel) { - msg.str(""); - msg << "Subdivision level " << sub; - m_operation = msg.str(); - - if (params.m_logger) { - msg.str(""); - msg << "\t Subdivision level " << sub << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - double maxConcavity = 0.0; - const size_t nInputParts = inputParts.Size(); - Update(m_stageProgress, 0.0, params); - for (size_t p = 0; p < nInputParts && !m_cancel; ++p) { - const double progress0 = double(p) * 100.0 / (double)nInputParts; - const double progress1 = (double(p) + 0.75) * 100.0 / (double)nInputParts; - const double progress2 = (double(p) + 1.00) * 100.0 / (double)nInputParts; - - Update(m_stageProgress, progress0, params); - - PrimitiveSet* pset = inputParts[p]; - inputParts[p] = 0; - double volume = pset->ComputeVolume(); - pset->ComputeBB(); - pset->ComputePrincipalAxes(); - if (params.m_pca) { - pset->AlignToPrincipalAxes(); - } - - pset->ComputeConvexHull(pset->GetConvexHull()); - double volumeCH = fabs(pset->GetConvexHull().ComputeVolume()); - if (firstIteration) { - m_volumeCH0 = volumeCH; - } - - double concavity = float(ComputeConcavity(volume, volumeCH, m_volumeCH0)); - double error = 1.01 * pset->ComputeMaxVolumeError() / m_volumeCH0; - // make the value smaller, later put it the parameters. - error *= params.m_concavityToVolumeWeigh; - - if (firstIteration) { - firstIteration = false; - } - - if (params.m_logger) { - msg.str(""); - msg << "\t -> Part[" << p - << "] C = " << concavity - << ", E = " << error - << ", VS = " << pset->GetNPrimitivesOnSurf() - << ", VI = " << pset->GetNPrimitivesInsideSurf() - << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - if (concavity > params.m_concavity && concavity > error) { - Vec3 preferredCuttingDirection; - double w = ComputePreferredCuttingDirection(pset, preferredCuttingDirection); - planes.Resize(0); - if (params.m_mode == 0) { - VoxelSet* vset = (VoxelSet*)pset; - ComputeAxesAlignedClippingPlanes(*vset, short(params.m_planeDownsampling), planes); - } - else { - TetrahedronSet* tset = (TetrahedronSet*)pset; - ComputeAxesAlignedClippingPlanes(*tset, short(params.m_planeDownsampling), planes); - } - - if (params.m_logger) { - msg.str(""); - msg << "\t\t [Regular sampling] Number of clipping planes " << planes.Size() << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - Plane bestPlane; - double minConcavity = MAX_DOUBLE; - ComputeBestClippingPlane(pset, - volume, - planes, - preferredCuttingDirection, - w, - concavity * params.m_alpha, - concavity * params.m_beta, - int32_t(params.m_convexhullDownsampling), - progress0, - progress1, - bestPlane, - minConcavity, - params); - if (!m_cancel && (params.m_planeDownsampling > 1 || params.m_convexhullDownsampling > 1)) { - planesRef.Resize(0); - - if (params.m_mode == 0) { - VoxelSet* vset = (VoxelSet*)pset; - RefineAxesAlignedClippingPlanes(*vset, bestPlane, short(params.m_planeDownsampling), planesRef); - } - else { - TetrahedronSet* tset = (TetrahedronSet*)pset; - RefineAxesAlignedClippingPlanes(*tset, bestPlane, short(params.m_planeDownsampling), planesRef); - } - - if (params.m_logger) { - msg.str(""); - msg << "\t\t [Refining] Number of clipping planes " << planesRef.Size() << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - ComputeBestClippingPlane(pset, - volume, - planesRef, - preferredCuttingDirection, - w, - concavity * params.m_alpha, - concavity * params.m_beta, - 1, // convexhullDownsampling = 1 - progress1, - progress2, - bestPlane, - minConcavity, - params); - } - if (GetCancel()) { - delete pset; // clean up - break; - } - else { - if (maxConcavity < minConcavity) { - maxConcavity = minConcavity; - } - PrimitiveSet* bestLeft = pset->Create(); - PrimitiveSet* bestRight = pset->Create(); - temp.PushBack(bestLeft); - temp.PushBack(bestRight); - pset->Clip(bestPlane, bestRight, bestLeft); - if (params.m_pca) { - bestRight->RevertAlignToPrincipalAxes(); - bestLeft->RevertAlignToPrincipalAxes(); - } - delete pset; - } - } - else { - if (params.m_pca) { - pset->RevertAlignToPrincipalAxes(); - } - parts.PushBack(pset); - } - } - - Update(95.0 * (1.0 - maxConcavity) / (1.0 - params.m_concavity), 100.0, params); - if (GetCancel()) { - const size_t nTempParts = temp.Size(); - for (size_t p = 0; p < nTempParts; ++p) { - delete temp[p]; - } - temp.Resize(0); - } - else { - inputParts = temp; - temp.Resize(0); - } - } - const size_t nInputParts = inputParts.Size(); - for (size_t p = 0; p < nInputParts; ++p) { - parts.PushBack(inputParts[p]); - } - - if (GetCancel()) { - const size_t nParts = parts.Size(); - for (size_t p = 0; p < nParts; ++p) { - delete parts[p]; - } - return; - } - - m_overallProgress = 90.0; - Update(m_stageProgress, 100.0, params); - - msg.str(""); - msg << "Generate convex-hulls"; - m_operation = msg.str(); - size_t nConvexHulls = parts.Size(); - if (params.m_logger) { - msg.str(""); - msg << "+ Generate " << nConvexHulls << " convex-hulls " << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - Update(m_stageProgress, 0.0, params); - m_convexHulls.Resize(0); - for (size_t p = 0; p < nConvexHulls && !m_cancel; ++p) { - Update(m_stageProgress, (double)p * 100.0 / (double)nConvexHulls, params); - m_convexHulls.PushBack(new Mesh); - parts[p]->ComputeConvexHull(*m_convexHulls[p]); - size_t nv = m_convexHulls[p]->GetNPoints(); - double x, y, z; - for (size_t i = 0; i < nv; ++i) { - Vec3& pt = m_convexHulls[p]->GetPoint(i); - x = pt[0]; - y = pt[1]; - z = pt[2]; - pt[0] = m_rot[0][0] * x + m_rot[0][1] * y + m_rot[0][2] * z + m_barycenter[0]; - pt[1] = m_rot[1][0] * x + m_rot[1][1] * y + m_rot[1][2] * z + m_barycenter[1]; - pt[2] = m_rot[2][0] * x + m_rot[2][1] * y + m_rot[2][2] * z + m_barycenter[2]; - } - } - - const size_t nParts = parts.Size(); - for (size_t p = 0; p < nParts; ++p) { - delete parts[p]; - parts[p] = 0; - } - parts.Resize(0); - - if (GetCancel()) { - for (size_t p = 0; p < m_convexHulls.Size(); ++p) { - delete m_convexHulls[p]; - } - m_convexHulls.Clear(); - return; - } - - m_overallProgress = 95.0; - Update(100.0, 100.0, params); - m_timer.Toc(); - if (params.m_logger) { - msg.str(""); - msg << "\t time " << m_timer.GetElapsedTime() / 1000.0 << "s" << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - } - void AddPoints(const Mesh* const mesh, SArray >& pts) - { - const size_t n = mesh->GetNPoints(); - for (size_t i = 0; i < n; ++i) { - pts.PushBack(mesh->GetPoint(i)); - } - } - void ComputeConvexHull(const Mesh* const ch1, const Mesh* const ch2, SArray >& pts, Mesh* const combinedCH) - { - pts.Resize(0); - AddPoints(ch1, pts); - AddPoints(ch2, pts); - - ConvexHull ch((double*)pts.Data(), 3 * sizeof(double), (int32_t)pts.Size(), 1.0e-5f); - - combinedCH->ResizePoints(0); - combinedCH->ResizeTriangles(0); - const std::vector& convexPoints = ch.GetVertexPool(); - for (size_t v = 0; v < convexPoints.size(); v++) { - combinedCH->AddPoint(convexPoints[v]); - } - - for (ConvexHull::ndNode* node = ch.GetFirst(); node; node = node->GetNext()) - { - ConvexHullFace* const face = &node->GetInfo(); - combinedCH->AddTriangle(Vec3(face->m_index[0], face->m_index[1], face->m_index[2])); - } - } - - void VHACD::MergeConvexHulls(const Parameters& params) - { - if (GetCancel()) { - return; - } - m_timer.Tic(); - - m_stage = "Merge Convex Hulls"; - - std::ostringstream msg; - if (params.m_logger) { - msg << "+ " << m_stage << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - struct ConvexProxy - { - Vec3 m_bmin; - Vec3 m_bmax; - Mesh* m_hull; - int m_id; - }; - - struct ConvexKey - { - ConvexKey() - { - } - - ConvexKey(int i0, int i1) - :m_p0(Min(i0, i1)) - ,m_p1(Max(i0, i1)) - { - } - - bool operator< (const ConvexKey& key) const - { - int key0 = (m_p1 << 16) + m_p0; - int key1 = (key.m_p1 << 16) + key.m_p0; - return key0 < key1; - } - - int m_p0; - int m_p1; - }; - - struct ConvexPair: public ConvexKey - { - ConvexPair() - { - } - - ConvexPair(int i0, int i1) - :ConvexKey(i0, i1) - { - } - - float m_cost; - }; - - std::set hullGraph; - std::vector convexPairArray; - std::vector convexProxyArray; - ndUpHeap priority(int(8 * m_convexHulls.Size() * m_convexHulls.Size())); - - class MergeConvexJob : public Job - { - public: - MergeConvexJob() - :Job() - { - } - - void Execute(int) - { - Mesh combinedCH; - SArray > pts; - for (int i = 0; i < m_pairsCount; i++) - { - ConvexPair& pair = m_pairs[i]; - const float volume0 = float(m_convexHulls[pair.m_p0]->ComputeVolume()); - const float volume1 = float(m_convexHulls[pair.m_p1]->ComputeVolume()); - ComputeConvexHull(m_convexHulls[pair.m_p0], m_convexHulls[pair.m_p1], pts, &combinedCH); - pair.m_cost = float(ComputeConcavity(volume0 + volume1, combinedCH.ComputeVolume(), m_volumeCH0)); - } - } - - ConvexPair* m_pairs; - Mesh** m_convexHulls; - double m_volumeCH0; - int m_pairsCount; - }; - - MergeConvexJob jobBashes[VHACD_WORKERS_THREADS * 4 + 1]; - - size_t pairsCount = 0; - convexPairArray.resize(((m_convexHulls.Size()* m_convexHulls.Size()) - m_convexHulls.Size()) >> 1); - - for (size_t i = 0; i < m_convexHulls.Size(); ++i) - { - convexProxyArray.push_back(ConvexProxy()); - convexProxyArray[i].m_hull = new Mesh (*m_convexHulls[i]); - convexProxyArray[i].m_id = int (i); - convexProxyArray[i].m_hull->CalculateBoundingBox(convexProxyArray[i].m_bmin, convexProxyArray[i].m_bmax); - } - - for (size_t i = 1; i < convexProxyArray.size(); ++i) - { - Vec3 bmin1(convexProxyArray[i].m_bmin); - Vec3 bmax1(convexProxyArray[i].m_bmax); - for (size_t j = 0; j < i; ++j) - { - Vec3 bmin0(convexProxyArray[j].m_bmin); - Vec3 bmax0(convexProxyArray[j].m_bmax); - Vec3 box1(bmax1 - bmin0); - Vec3 box0(bmin1 - bmax0); - Vec3 size(box0.X() * box1.X(), box0.Y()* box1.Y(), box0.Z()* box1.Z()); - - if ((size[0] <= 0.0) && (size[1] <= 0.0) && (size[2] <= 0.0)) - { - int i0 = int(i); - int j0 = int(j); - ConvexKey key(i0, j0); - hullGraph.insert(key); - //convexPairArray[pairsCount] = ConvexPair(i, j); - convexPairArray[pairsCount] = ConvexPair(i0, j0); - pairsCount++; - } - } - } - - size_t nConvexHulls = m_convexHulls.Size(); - if (nConvexHulls > 1 && !m_cancel) - { - size_t start = 0; - size_t bashSize = pairsCount / (VHACD_WORKERS_THREADS * 4); - for (size_t j = 0; j < VHACD_WORKERS_THREADS * 4; ++j) - { - //size_t i = j * bashSize; - //size_t count = ((i + bashSize) <= pairsCount) ? bashSize : pairsCount - i; - //size_t count = ((i + bashSize) <= pairsCount) ? bashSize : pairsCount - i; - size_t count = (j + 1) * bashSize - start; - if (count > 0) - { - jobBashes[j].m_pairs = &convexPairArray[start]; - jobBashes[j].m_pairsCount = int(count); - jobBashes[j].m_volumeCH0 = m_volumeCH0; - jobBashes[j].m_convexHulls = &m_convexHulls[0]; - m_parallelQueue.PushTask(&jobBashes[j]); - } - start += bashSize; - } - size_t count = pairsCount - start; - if (count > 0) - { - jobBashes[VHACD_WORKERS_THREADS * 4].m_pairs = &convexPairArray[start]; - jobBashes[VHACD_WORKERS_THREADS * 4].m_pairsCount = int(count); - jobBashes[VHACD_WORKERS_THREADS * 4].m_volumeCH0 = m_volumeCH0; - jobBashes[VHACD_WORKERS_THREADS * 4].m_convexHulls = &m_convexHulls[0]; - m_parallelQueue.PushTask(&jobBashes[VHACD_WORKERS_THREADS * 4]); - } - - m_parallelQueue.Sync(); - - for (size_t i = 0; i < pairsCount; i++) - { - ConvexPair& pair = convexPairArray[i]; - if (pair.m_cost < (2.0f * params.m_minMergeToleranace)) - { - priority.Push(pair, pair.m_cost); - } - } - - Mesh combinedCH; - SArray > pts; - while (((nConvexHulls > params.m_maxConvexHulls) || (priority.Value() <= params.m_minMergeToleranace)) && priority.GetCount()) - { - ConvexKey key(priority[0]); - std::set::iterator it = hullGraph.find(key); - if (it != hullGraph.end()) - { - hullGraph.erase(it); - for (size_t i = 0; i < convexProxyArray.size(); i++) - { - if (convexProxyArray[i].m_hull) - { - ConvexKey key0(key.m_p0, int(i)); - hullGraph.erase(key0); - - ConvexKey key1(key.m_p1, int(i)); - hullGraph.erase(key1); - } - } - - Mesh* const newHull = new Mesh(); - size_t index = convexProxyArray.size(); - ComputeConvexHull(convexProxyArray[size_t(key.m_p0)].m_hull, convexProxyArray[size_t(key.m_p1)].m_hull, pts, newHull); - convexProxyArray.push_back(ConvexProxy()); - convexProxyArray[index].m_hull = newHull; - convexProxyArray[index].m_id = int(index); - convexProxyArray[index].m_hull->CalculateBoundingBox(convexProxyArray[index].m_bmin, convexProxyArray[index].m_bmax); - - delete convexProxyArray[size_t(key.m_p0)].m_hull; - delete convexProxyArray[size_t(key.m_p1)].m_hull; - convexProxyArray[size_t(key.m_p0)].m_hull = nullptr; - convexProxyArray[size_t(key.m_p1)].m_hull = nullptr; - - const float volume0 = float(newHull->ComputeVolume()); - - const Vec3 bmin(convexProxyArray[index].m_bmin); - const Vec3 bmax(convexProxyArray[index].m_bmax); - - for (size_t i = 0; i < convexProxyArray.size() - 1; i++) - { - if (convexProxyArray[i].m_hull) - { - Vec3 bmin0(convexProxyArray[i].m_bmin); - Vec3 bmax0(convexProxyArray[i].m_bmax); - Vec3 box1(bmax - bmin0); - Vec3 box0(bmin - bmax0); - Vec3 size(box0.X() * box1.X(), box0.Y() * box1.Y(), box0.Z() * box1.Z()); - - if ((size[0] <= 0.0) && (size[1] <= 0.0) && (size[2] <= 0.0)) - { - int i0 = int(i); - ConvexPair pair(i0, int(index)); - const float volume1 = float(convexProxyArray[i].m_hull->ComputeVolume()); - ComputeConvexHull(newHull, convexProxyArray[i].m_hull, pts, &combinedCH); - float cost = float(ComputeConcavity(volume0 + volume1, combinedCH.ComputeVolume(), m_volumeCH0)); - priority.Push(pair, cost); - } - } - } - - nConvexHulls--; - } - priority.Pop(); - } - - for (int i = int (m_convexHulls.Size()-1); i >= 0; --i) - { - delete m_convexHulls[size_t(i)]; - m_convexHulls.PopBack(); - } - - for (size_t i = 0; i < convexProxyArray.size(); i++) - { - if (convexProxyArray[i].m_hull) - { - m_convexHulls.PushBack(convexProxyArray[i].m_hull); - } - } - } - - m_overallProgress = 99.0; - Update(100.0, 100.0, params); - m_timer.Toc(); - if (params.m_logger) { - msg.str(""); - msg << "\t time " << m_timer.GetElapsedTime() / 1000.0 << "s" << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - } - - - void VHACD::SimplifyConvexHull(Mesh* const ch, const size_t nvertices, const double minVolume) - { - if (nvertices <= 4) { - return; - } - ICHull icHull; - if (m_raycastMesh) - { - // We project these points onto the original source mesh to increase precision - // The voxelization process drops floating point precision so returned data points are not exactly lying on the - // surface of the original source mesh. - // The first step is we need to compute the bounding box of the mesh we are trying to build a convex hull for. - // From this bounding box, we compute the length of the diagonal to get a relative size and center for point projection - uint32_t nPoints = uint32_t(ch->GetNPoints()); - Vec3 *inputPoints = ch->GetPointsBuffer(); - Vec3 bmin(inputPoints[0]); - Vec3 bmax(inputPoints[1]); - for (uint32_t i = 1; i < nPoints; i++) - { - const Vec3 &p = inputPoints[i]; - p.UpdateMinMax(bmin, bmax); - } - Vec3 center; - double diagonalLength = center.GetCenter(bmin, bmax); // Get the center of the bounding box - // This is the error threshold for determining if we should use the raycast result data point vs. the voxelized result. - double pointDistanceThreshold = diagonalLength * 0.05; - // If a new point is within 1/100th the diagonal length of the bounding volume we do not add it. To do so would create a - // thin sliver in the resulting convex hull - double snapDistanceThreshold = diagonalLength * 0.01; - double snapDistanceThresholdSquared = snapDistanceThreshold*snapDistanceThreshold; - - // Allocate buffer for projected vertices - Vec3 *outputPoints = new Vec3[nPoints]; - uint32_t outCount = 0; - for (uint32_t i = 0; i < nPoints; i++) - { - Vec3 &inputPoint = inputPoints[i]; - Vec3 &outputPoint = outputPoints[outCount]; - // Compute the direction vector from the center of this mesh to the vertex - Vec3 dir = inputPoint - center; - // Normalize the direction vector. - dir.Normalize(); - // Multiply times the diagonal length of the mesh - dir *= diagonalLength; - // Add the center back in again to get the destination point - dir += center; - // By default the output point is equal to the input point - outputPoint = inputPoint; - double pointDistance; - if (m_raycastMesh->raycast(center.GetData(), dir.GetData(), inputPoint.GetData(), outputPoint.GetData(),&pointDistance) ) - { - // If the nearest intersection point is too far away, we keep the original source data point. - // Not all points lie directly on the original mesh surface - if (pointDistance > pointDistanceThreshold) - { - outputPoint = inputPoint; - } - } - // Ok, before we add this point, we do not want to create points which are extremely close to each other. - // This will result in tiny sliver triangles which are really bad for collision detection. - bool foundNearbyPoint = false; - for (uint32_t j = 0; j < outCount; ++j) - { - // If this new point is extremely close to an existing point, we do not add it! - double squaredDistance = outputPoints[j].GetDistanceSquared(outputPoint); - if (squaredDistance < snapDistanceThresholdSquared ) - { - foundNearbyPoint = true; - break; - } - } - if (!foundNearbyPoint) - { - outCount++; - } - } - icHull.AddPoints(outputPoints, outCount); - delete[]outputPoints; - } - else - { - icHull.AddPoints(ch->GetPointsBuffer(), ch->GetNPoints()); - } - icHull.Process((uint32_t)nvertices, minVolume); - TMMesh& mesh = icHull.GetMesh(); - const size_t nT = mesh.GetNTriangles(); - const size_t nV = mesh.GetNVertices(); - ch->ResizePoints(nV); - ch->ResizeTriangles(nT); - mesh.GetIFS(ch->GetPointsBuffer(), ch->GetTrianglesBuffer()); - } - void VHACD::SimplifyConvexHulls(const Parameters& params) - { - if (m_cancel || params.m_maxNumVerticesPerCH < 4) { - return; - } - m_timer.Tic(); - - m_stage = "Simplify convex-hulls"; - m_operation = "Simplify convex-hulls"; - - std::ostringstream msg; - const size_t nConvexHulls = m_convexHulls.Size(); - if (params.m_logger) { - msg << "+ Simplify " << nConvexHulls << " convex-hulls " << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - - Update(0.0, 0.0, params); - for (size_t i = 0; i < nConvexHulls && !m_cancel; ++i) { - if (params.m_logger) { - msg.str(""); - msg << "\t\t Simplify CH[" << std::setfill('0') << std::setw(5) << i << "] " << m_convexHulls[i]->GetNPoints() << " V, " << m_convexHulls[i]->GetNTriangles() << " T" << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - SimplifyConvexHull(m_convexHulls[i], params.m_maxNumVerticesPerCH, m_volumeCH0 * params.m_minVolumePerCH); - } - - m_overallProgress = 100.0; - Update(100.0, 100.0, params); - m_timer.Toc(); - if (params.m_logger) { - msg.str(""); - msg << "\t time " << m_timer.GetElapsedTime() / 1000.0 << "s" << std::endl; - params.m_logger->Log(msg.str().c_str()); - } - } -} // end of VHACD namespace -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdConvexHull.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdConvexHull.cpp deleted file mode 100644 index f6650aae26..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdConvexHull.cpp +++ /dev/null @@ -1,933 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "vhacdConvexHull.h" - -namespace nd_ -{ - namespace VHACD - { - #define DG_STACK_DEPTH_3D 64 - - ConvexHullFace::ConvexHullFace() - { - m_mark = 0; - m_twin[0] = nullptr; - m_twin[1] = nullptr; - m_twin[2] = nullptr; - } - - hullPlane ConvexHullFace::GetPlaneEquation(const hullVector* const pointArray, bool& isvalid) const - { - const hullVector& p0 = pointArray[m_index[0]]; - const hullVector& p1 = pointArray[m_index[1]]; - const hullVector& p2 = pointArray[m_index[2]]; - hullPlane plane(p0, p1, p2); - - isvalid = false; - double mag2 = plane.DotProduct(plane); - if (mag2 > 1.0e-16f) - { - isvalid = true; - plane = plane.Scale(1.0f / sqrt(mag2)); - } - return plane; - } - - double ConvexHullFace::Evalue(const hullVector* const pointArray, const hullVector& point) const - { - const hullVector& p0 = pointArray[m_index[0]]; - const hullVector& p1 = pointArray[m_index[1]]; - const hullVector& p2 = pointArray[m_index[2]]; - - double matrix[3][3]; - for (size_t i = 0; i < 3; ++i) - { - matrix[0][i] = p2[i] - p0[i]; - matrix[1][i] = p1[i] - p0[i]; - matrix[2][i] = point[i] - p0[i]; - } - - double error; - double det = Determinant3x3(matrix, &error); - - // the code use double, however the threshold for accuracy test is the machine precision of a float. - // by changing this to a smaller number, the code should run faster since many small test will be considered valid - // the precision must be a power of two no smaller than the machine precision of a double, (1<<48) - // float64(1<<30) can be a good value - - // double precision = double (1.0f) / double (1<<30); - double precision = double(1.0f) / double(1 << 24); - double errbound = error * precision; - if (fabs(det) > errbound) - { - return det; - } - - Googol exactMatrix[3][3]; - for (size_t i = 0; i < 3; ++i) - { - exactMatrix[0][i] = Googol(p2[i]) - Googol(p0[i]); - exactMatrix[1][i] = Googol(p1[i]) - Googol(p0[i]); - exactMatrix[2][i] = Googol(point[i]) - Googol(p0[i]); - } - return Determinant3x3(exactMatrix); - } - - ConvexHull3dPointSet::ConvexHull3dPointSet() - { - } - - ConvexHull3dPointSet::ConvexHull3dPointSet(const double* const vertexCloud, int strideInBytes, int count) - { - resize(size_t(count)); - - std::vector& array = *this; - const int stride = int(strideInBytes / sizeof(double)); - for (size_t i = 0; i < size_t(count); ++i) - { - size_t index = i * stride; - hullVector& vertex = array[i]; - vertex = hullVector(vertexCloud[index], vertexCloud[index + 1], vertexCloud[index + 2], double(0.0f)); - array[i].m_mark = 0; - } - - class CompareVertex - { - public: - int Compare(const ConvexHullVertex& elementA, const ConvexHullVertex& elementB) const - { - for (size_t i = 0; i < 3; i++) - { - if (elementA[i] < elementB[i]) - { - return -1; - } - else if (elementA[i] > elementB[i]) - { - return 1; - } - } - return 0; - } - }; - - count = int(size()); - Sort(&array[0], count); - - size_t indexCount = 0; - CompareVertex compareVetex; - for (size_t i = 1; i < size_t(count); ++i) - { - for (; i < size_t(count); ++i) - { - if (compareVetex.Compare(array[indexCount], array[i])) - { - indexCount++; - array[indexCount] = array[i]; - break; - } - } - } - count = int (indexCount + 1); - array.resize(size_t (count)); - } - - ConvexHullAABBTreeNode* ConvexHull3dPointSet::BuildAccelerator() - { - size_t treeCount = size() / (VHACD_CONVEXHULL_3D_VERTEX_CLUSTER_SIZE >> 1); - if (treeCount < 4) - { - treeCount = 4; - } - treeCount *= 2; - m_treeBuffer.resize(treeCount + 256); - - if (size() > 4) - { - size_t memoryIndex = 0; - std::vector& array = *this; - return BuildRecurse(nullptr, &array[0], int (size()), 0, memoryIndex); - } - return nullptr; - } - - ConvexHullAABBTreeNode* ConvexHull3dPointSet::BuildRecurse(ConvexHullAABBTreeNode* const parent, ConvexHullVertex* const points, int count, int baseIndex, size_t& memoryIndex) - { - ConvexHullAABBTreeNode* tree = nullptr; - - _ASSERT(count); - hullVector minP(double(1.0e15f)); - hullVector maxP(-double(1.0e15f)); - if (count <= VHACD_CONVEXHULL_3D_VERTEX_CLUSTER_SIZE) - { - ConvexHull3dPointCluster* const clump = new (&m_treeBuffer[memoryIndex]) ConvexHull3dPointCluster(); - memoryIndex++; - _ASSERT(memoryIndex <= int (m_treeBuffer.size())); - - _ASSERT(clump); - clump->m_count = count; - for (int i = 0; i < count; ++i) - { - clump->m_indices[i] = i + baseIndex; - - const hullVector& p = points[i]; - minP = minP.GetMin(p); - maxP = maxP.GetMax(p); - } - - clump->m_left = nullptr; - clump->m_right = nullptr; - tree = clump; - } - else - { - hullVector median(0); - hullVector varian(0); - for (int i = 0; i < count; ++i) - { - const hullVector& p = points[i]; - median += p; - varian += p * p; - minP = minP.GetMin(p); - maxP = maxP.GetMax(p); - } - - varian = varian.Scale(double(count)) - median * median; - size_t index = 0; - double maxVarian = double(-1.0e10f); - for (size_t i = 0; i < 3; ++i) - { - if (varian[i] > maxVarian) - { - index = i; - maxVarian = varian[i]; - } - } - hullVector center(median.Scale(double(1.0f) / double(count))); - - double test = center[index]; - - int i0 = 0; - int i1 = count - 1; - do - { - for (; i0 <= i1; i0++) - { - double val = points[i0][index]; - if (val > test) - { - break; - } - } - - for (; i1 >= i0; i1--) - { - double val = points[i1][index]; - if (val < test) - { - break; - } - } - - if (i0 < i1) - { - Swap(points[i0], points[i1]); - i0++; - i1--; - } - } while (i0 <= i1); - - if (i0 == 0) - { - i0 = count / 2; - } - if (i0 >= (count - 1)) - { - i0 = count / 2; - } - - tree = new (&m_treeBuffer[memoryIndex]) ConvexHullAABBTreeNode(); - memoryIndex++; - _ASSERT(memoryIndex <= m_treeBuffer.size()); - - _ASSERT(i0); - _ASSERT(count - i0); - - tree->m_left = BuildRecurse(tree, points, i0, baseIndex, memoryIndex); - tree->m_right = BuildRecurse(tree, &points[i0], count - i0, i0 + baseIndex, memoryIndex); - } - - _ASSERT(tree); - tree->m_parent = parent; - tree->m_box[0] = minP - hullVector(double(1.0e-3f)); - tree->m_box[1] = maxP + hullVector(double(1.0e-3f)); - return tree; - } - - //void ConvexHull3dSupportAccelerator::Split(VHACD::Vec3& dir, double dist, ConvexHull3dSupportAccelerator& back, ConvexHull3dSupportAccelerator& front) const - //{ - // back.m_points = m_points; - // front.m_points = m_points; - // back.m_treeBuffer = m_treeBuffer; - // front.m_treeBuffer = m_treeBuffer; - // - // _ASSERT(m_tree == &m_treeBuffer[0]); - // back.m_tree = &back.m_treeBuffer[0]; - // front.m_tree = &front.m_treeBuffer[0]; - // - // for (int i = 0; i < m_treeBuffer.size(); ++i) - // { - // const ConvexHullAABBTreeNode* const node = &m_treeBuffer[i]; - // ConvexHullAABBTreeNode* const backNode = &back.m_treeBuffer[i]; - // ConvexHullAABBTreeNode* const frontNode = &front.m_treeBuffer[i]; - // if (node->m_parent) - // { - // int index = node->m_parent - m_tree; - // backNode->m_parent = &back.m_treeBuffer[index]; - // frontNode->m_parent = &front.m_treeBuffer[index]; - // } - // - // if (node->m_left) - // { - // int index = node->m_left - m_tree; - // backNode->m_left = &back.m_treeBuffer[index]; - // frontNode->m_right = &front.m_treeBuffer[index]; - // } - // - // if (node->m_right) - // { - // int index = node->m_right - m_tree; - // backNode->m_right = &back.m_treeBuffer[index]; - // frontNode->m_right = &front.m_treeBuffer[index]; - // } - // } - // - // VHACD::Vec3 backDir(dir.X() * -1.0, dir.Y() * -1.0, dir.Z() * -1.0); - // front.Prune(dir, dist); - // back.Prune(backDir, dist * -1.0); - //} - - class ConvexHull::ndNormalMap - { - public: - ndNormalMap() - :m_count(sizeof(m_normal) / sizeof(m_normal[0])) - { - hullVector p0(double(1.0f), double(0.0f), double(0.0f), double(0.0f)); - hullVector p1(double(-1.0f), double(0.0f), double(0.0f), double(0.0f)); - hullVector p2(double(0.0f), double(1.0f), double(0.0f), double(0.0f)); - hullVector p3(double(0.0f), double(-1.0f), double(0.0f), double(0.0f)); - hullVector p4(double(0.0f), double(0.0f), double(1.0f), double(0.0f)); - hullVector p5(double(0.0f), double(0.0f), double(-1.0f), double(0.0f)); - - int count = 0; - int subdivitions = 2; - TessellateTriangle(subdivitions, p4, p0, p2, count); - TessellateTriangle(subdivitions, p0, p5, p2, count); - TessellateTriangle(subdivitions, p5, p1, p2, count); - TessellateTriangle(subdivitions, p1, p4, p2, count); - TessellateTriangle(subdivitions, p0, p4, p3, count); - TessellateTriangle(subdivitions, p5, p0, p3, count); - TessellateTriangle(subdivitions, p1, p5, p3, count); - TessellateTriangle(subdivitions, p4, p1, p3, count); - } - - static const ndNormalMap& GetNormaMap() - { - static ndNormalMap normalMap; - return normalMap; - } - - void TessellateTriangle(int level, const hullVector& p0, const hullVector& p1, const hullVector& p2, int& count) - { - if (level) - { - _ASSERT(fabs(p0.DotProduct(p0) - double(1.0f)) < double(1.0e-4f)); - _ASSERT(fabs(p1.DotProduct(p1) - double(1.0f)) < double(1.0e-4f)); - _ASSERT(fabs(p2.DotProduct(p2) - double(1.0f)) < double(1.0e-4f)); - hullVector p01(p0 + p1); - hullVector p12(p1 + p2); - hullVector p20(p2 + p0); - - p01 = p01.Scale(1.0 / sqrt(p01.DotProduct(p01))); - p12 = p12.Scale(1.0 / sqrt(p12.DotProduct(p12))); - p20 = p20.Scale(1.0 / sqrt(p20.DotProduct(p20))); - - _ASSERT(fabs(p01.DotProduct(p01) - double(1.0f)) < double(1.0e-4f)); - _ASSERT(fabs(p12.DotProduct(p12) - double(1.0f)) < double(1.0e-4f)); - _ASSERT(fabs(p20.DotProduct(p20) - double(1.0f)) < double(1.0e-4f)); - - TessellateTriangle(level - 1, p0, p01, p20, count); - TessellateTriangle(level - 1, p1, p12, p01, count); - TessellateTriangle(level - 1, p2, p20, p12, count); - TessellateTriangle(level - 1, p01, p12, p20, count); - } - else - { - hullPlane n(p0, p1, p2); - n = n.Scale(double(1.0f) / sqrt(n.DotProduct(n))); - n.m_w = double(0.0f); - int index = dBitReversal(count, sizeof(m_normal) / sizeof(m_normal[0])); - m_normal[index] = n; - count++; - _ASSERT(count <= int(sizeof(m_normal) / sizeof(m_normal[0]))); - } - } - - hullVector m_normal[128]; - int m_count; - }; - - ConvexHull::ConvexHull(const double* const vertexCloud, int strideInBytes, int count, double distTol, int maxVertexCount) - :List() - ,m_aabbP0(0) - ,m_aabbP1(0) - ,m_diag() - ,m_points() - { - m_points.resize(0); - ConvexHull3dPointSet accelerator(vertexCloud, strideInBytes, count); - BuildHull(accelerator, distTol, maxVertexCount); - } - - ConvexHull::ConvexHull(ConvexHull3dPointSet& accelerator, double distTol, int maxVertexCount) - :List() - ,m_aabbP0(0) - ,m_aabbP1(0) - ,m_diag() - ,m_points() - { - m_points.resize(0); - #ifdef _DEBUG - for (size_t i = 0; i < int (accelerator.size()); i++) - { - _ASSERT(accelerator[i].m_mark == 0); - } - #endif - BuildHull(accelerator, distTol, maxVertexCount); - } - - ConvexHull::~ConvexHull() - { - } - - const std::vector& ConvexHull::GetVertexPool() const - { - return m_points; - } - - void ConvexHull::BuildHull(ConvexHull3dPointSet& accelerator, double distTol, int maxVertexCount) - { - ConvexHullAABBTreeNode* const tree = InitVertexArray(accelerator); - if (tree) - { - CalculateConvexHull3d(tree, accelerator, int (accelerator.size()), distTol, maxVertexCount); - } - } - - size_t ConvexHull::SupportVertex(ConvexHullAABBTreeNode** const treePointer, const std::vector& points, const hullVector& dirPlane, const bool removeEntry) const - { - double aabbProjection[DG_STACK_DEPTH_3D]; - const ConvexHullAABBTreeNode *stackPool[DG_STACK_DEPTH_3D]; - - hullVector dir(dirPlane); - - int index = -1; - int stack = 1; - stackPool[0] = *treePointer; - aabbProjection[0] = double(1.0e20f); - double maxProj = double(-1.0e20f); - int ix = (dir[0] > double(0.0f)) ? 1 : 0; - int iy = (dir[1] > double(0.0f)) ? 1 : 0; - int iz = (dir[2] > double(0.0f)) ? 1 : 0; - while (stack) - { - stack--; - double boxSupportValue = aabbProjection[stack]; - if (boxSupportValue > maxProj) - { - const ConvexHullAABBTreeNode* const me = stackPool[stack]; - - if (me->m_left && me->m_right) - { - const hullVector leftSupportPoint(me->m_left->m_box[ix].X(), me->m_left->m_box[iy].Y(), me->m_left->m_box[iz].Z(), 0.0f); - double leftSupportDist = leftSupportPoint.DotProduct(dir); - - const hullVector rightSupportPoint(me->m_right->m_box[ix].X(), me->m_right->m_box[iy].Y(), me->m_right->m_box[iz].Z(), 0.0f); - double rightSupportDist = rightSupportPoint.DotProduct(dir); - - if (rightSupportDist >= leftSupportDist) - { - aabbProjection[stack] = leftSupportDist; - stackPool[stack] = me->m_left; - stack++; - _ASSERT(stack < DG_STACK_DEPTH_3D); - aabbProjection[stack] = rightSupportDist; - stackPool[stack] = me->m_right; - stack++; - _ASSERT(stack < DG_STACK_DEPTH_3D); - } - else - { - aabbProjection[stack] = rightSupportDist; - stackPool[stack] = me->m_right; - stack++; - _ASSERT(stack < DG_STACK_DEPTH_3D); - aabbProjection[stack] = leftSupportDist; - stackPool[stack] = me->m_left; - stack++; - _ASSERT(stack < DG_STACK_DEPTH_3D); - } - } - else - { - ConvexHull3dPointCluster* const cluster = (ConvexHull3dPointCluster*)me; - for (int i = 0; i < cluster->m_count; ++i) - { - const ConvexHullVertex& p = points[size_t(cluster->m_indices[i])]; - _ASSERT(p.X() >= cluster->m_box[0].X()); - _ASSERT(p.X() <= cluster->m_box[1].X()); - _ASSERT(p.Y() >= cluster->m_box[0].Y()); - _ASSERT(p.Y() <= cluster->m_box[1].Y()); - _ASSERT(p.Z() >= cluster->m_box[0].Z()); - _ASSERT(p.Z() <= cluster->m_box[1].Z()); - if (!p.m_mark) - { - //_ASSERT(p.m_w == double(0.0f)); - double dist = p.DotProduct(dir); - if (dist > maxProj) - { - maxProj = dist; - index = cluster->m_indices[i]; - } - } - else if (removeEntry) - { - cluster->m_indices[i] = cluster->m_indices[cluster->m_count - 1]; - cluster->m_count = cluster->m_count - 1; - i--; - } - } - - if (cluster->m_count == 0) - { - ConvexHullAABBTreeNode* const parent = cluster->m_parent; - if (parent) - { - ConvexHullAABBTreeNode* const sibling = (parent->m_left != cluster) ? parent->m_left : parent->m_right; - _ASSERT(sibling != cluster); - ConvexHullAABBTreeNode* const grandParent = parent->m_parent; - if (grandParent) - { - sibling->m_parent = grandParent; - if (grandParent->m_right == parent) - { - grandParent->m_right = sibling; - } - else - { - grandParent->m_left = sibling; - } - } - else - { - sibling->m_parent = nullptr; - *treePointer = sibling; - } - } - } - } - } - } - - _ASSERT(index != -1); - return size_t(index); - } - - double ConvexHull::TetrahedrumVolume(const hullVector& p0, const hullVector& p1, const hullVector& p2, const hullVector& p3) const - { - const hullVector p1p0(p1 - p0); - const hullVector p2p0(p2 - p0); - const hullVector p3p0(p3 - p0); - return p3p0.DotProduct(p1p0.CrossProduct(p2p0)); - } - - ConvexHullAABBTreeNode* ConvexHull::InitVertexArray(ConvexHull3dPointSet& accelerator) - { - ConvexHullAABBTreeNode* tree = accelerator.BuildAccelerator(); - if (tree) - { - int count = int(accelerator.size()); - if (count < 4) - { - m_points.resize(0); - return nullptr; - } - m_points.resize(4); - - m_aabbP0 = tree->m_box[0]; - m_aabbP1 = tree->m_box[1]; - - hullVector boxSize(tree->m_box[1] - tree->m_box[0]); - m_diag = double(sqrt(boxSize.DotProduct(boxSize))); - const ndNormalMap& normalMap = ndNormalMap::GetNormaMap(); - - size_t index0 = SupportVertex(&tree, accelerator, normalMap.m_normal[0]); - m_points[0] = accelerator[index0]; - accelerator[index0].m_mark = 1; - - bool validTetrahedrum = false; - hullVector e1(0.0); - for (int i = 1; i < normalMap.m_count; ++i) - { - size_t index = SupportVertex(&tree, accelerator, normalMap.m_normal[i]); - - e1 = accelerator[index] - m_points[0]; - double error2 = e1.DotProduct(e1); - if (error2 > (double(1.0e-4f) * m_diag * m_diag)) - { - m_points[1] = accelerator[index]; - accelerator[index].m_mark = 1; - validTetrahedrum = true; - break; - } - } - if (!validTetrahedrum) - { - m_points.resize(0); - return nullptr; - } - - validTetrahedrum = false; - hullVector e2(0.0); - hullVector normal(0.0); - for (int i = 2; i < normalMap.m_count; ++i) - { - size_t index = SupportVertex(&tree, accelerator, normalMap.m_normal[i]); - e2 = accelerator[index] - m_points[0]; - normal = e1.CrossProduct(e2); - double error2 = sqrt(normal.DotProduct(normal)); - if (error2 > (double(1.0e-4f) * m_diag * m_diag)) - { - m_points[2] = accelerator[index]; - accelerator[index].m_mark = 1; - validTetrahedrum = true; - break; - } - } - - if (!validTetrahedrum) - { - m_points.resize(0); - return nullptr; - } - - // find the largest possible tetrahedron - validTetrahedrum = false; - hullVector e3(0.0); - - index0 = SupportVertex(&tree, accelerator, normal); - e3 = accelerator[index0] - m_points[0]; - double err2 = normal.DotProduct(e3); - if (fabs(err2) > (double(1.0e-6f) * m_diag * m_diag)) - { - // we found a valid tetrahedral, about and start build the hull by adding the rest of the points - m_points[3] = accelerator[index0]; - accelerator[index0].m_mark = 1; - validTetrahedrum = true; - } - if (!validTetrahedrum) - { - hullVector n(normal.Scale(double(-1.0f))); - size_t index = SupportVertex(&tree, accelerator, n); - e3 = accelerator[index] - m_points[0]; - double error2 = normal.DotProduct(e3); - if (fabs(error2) > (double(1.0e-6f) * m_diag * m_diag)) - { - // we found a valid tetrahedral, about and start build the hull by adding the rest of the points - m_points[3] = accelerator[index]; - accelerator[index].m_mark = 1; - validTetrahedrum = true; - } - } - if (!validTetrahedrum) - { - for (int i = 3; i < normalMap.m_count; ++i) - { - size_t index = SupportVertex(&tree, accelerator, normalMap.m_normal[i]); - - //make sure the volume of the fist tetrahedral is no negative - e3 = accelerator[index] - m_points[0]; - double error2 = normal.DotProduct(e3); - if (fabs(error2) > (double(1.0e-6f) * m_diag * m_diag)) - { - // we found a valid tetrahedral, about and start build the hull by adding the rest of the points - m_points[3] = accelerator[index]; - accelerator[index].m_mark = 1; - validTetrahedrum = true; - break; - } - } - } - if (!validTetrahedrum) - { - // the points do not form a convex hull - m_points.resize(0); - return nullptr; - } - - double volume = TetrahedrumVolume(m_points[0], m_points[1], m_points[2], m_points[3]); - if (volume > double(0.0f)) - { - Swap(m_points[2], m_points[3]); - } - _ASSERT(TetrahedrumVolume(m_points[0], m_points[1], m_points[2], m_points[3]) < double(0.0f)); - } - return tree; - } - - ConvexHull::ndNode* ConvexHull::AddFace(int i0, int i1, int i2) - { - ndNode* const node = Append(); - ConvexHullFace& face = node->GetInfo(); - - face.m_index[0] = i0; - face.m_index[1] = i1; - face.m_index[2] = i2; - return node; - } - - void ConvexHull::CalculateConvexHull3d(ConvexHullAABBTreeNode* vertexTree, std::vector& points, int count, double distTol, int maxVertexCount) - { - distTol = fabs(distTol) * m_diag; - ndNode* const f0Node = AddFace(0, 1, 2); - ndNode* const f1Node = AddFace(0, 2, 3); - ndNode* const f2Node = AddFace(2, 1, 3); - ndNode* const f3Node = AddFace(1, 0, 3); - - ConvexHullFace* const f0 = &f0Node->GetInfo(); - ConvexHullFace* const f1 = &f1Node->GetInfo(); - ConvexHullFace* const f2 = &f2Node->GetInfo(); - ConvexHullFace* const f3 = &f3Node->GetInfo(); - - f0->m_twin[0] = f3Node; - f0->m_twin[1] = f2Node; - f0->m_twin[2] = f1Node; - - f1->m_twin[0] = f0Node; - f1->m_twin[1] = f2Node; - f1->m_twin[2] = f3Node; - - f2->m_twin[0] = f0Node; - f2->m_twin[1] = f3Node; - f2->m_twin[2] = f1Node; - - f3->m_twin[0] = f0Node; - f3->m_twin[1] = f1Node; - f3->m_twin[2] = f2Node; - - List boundaryFaces; - boundaryFaces.Append(f0Node); - boundaryFaces.Append(f1Node); - boundaryFaces.Append(f2Node); - boundaryFaces.Append(f3Node); - - m_points.resize(size_t(count)); - - count -= 4; - maxVertexCount -= 4; - size_t currentIndex = 4; - - std::vector stackPool; - std::vector coneListPool; - std::vector deleteListPool; - - stackPool.resize(size_t(1024 + count)); - coneListPool.resize(size_t(1024 + count)); - deleteListPool.resize(size_t(1024 + count)); - - ndNode** const stack = &stackPool[0]; - ndNode** const coneList = &stackPool[0]; - ndNode** const deleteList = &deleteListPool[0]; - - while (boundaryFaces.GetCount() && count && (maxVertexCount > 0)) - { - // my definition of the optimal convex hull of a given vertex count, - // is the convex hull formed by a subset of the input vertex that minimizes the volume difference - // between the perfect hull formed from all input vertex and the hull of the sub set of vertex. - // When using a priority heap this algorithms will generate the an optimal of a fix vertex count. - // Since all Newton's tools do not have a limit on the point count of a convex hull, I can use either a stack or a queue. - // a stack maximize construction speed, a Queue tend to maximize the volume of the generated Hull approaching a perfect Hull. - // For now we use a queue. - // For general hulls it does not make a difference if we use a stack, queue, or a priority heap. - // perfect optimal hull only apply for when build hull of a limited vertex count. - // - // Also when building Hulls of a limited vertex count, this function runs in constant time. - // yes that is correct, it does not makes a difference if you build a N point hull from 100 vertex - // or from 100000 vertex input array. - - // using a queue (some what slower by better hull when reduced vertex count is desired) - bool isvalid; - ndNode* const faceNode = boundaryFaces.GetLast()->GetInfo(); - ConvexHullFace* const face = &faceNode->GetInfo(); - hullPlane planeEquation(face->GetPlaneEquation(&m_points[0], isvalid)); - - size_t index = 0; - double dist = 0; - hullVector p; - if (isvalid) - { - index = SupportVertex(&vertexTree, points, planeEquation); - p = points[index]; - dist = planeEquation.Evalue(p); - } - - if (isvalid && (dist >= distTol) && (face->Evalue(&m_points[0], p) > double(0.0f))) - { - stack[0] = faceNode; - - int stackIndex = 1; - int deletedCount = 0; - - while (stackIndex) - { - stackIndex--; - ndNode* const node1 = stack[stackIndex]; - ConvexHullFace* const face1 = &node1->GetInfo(); - - if (!face1->m_mark && (face1->Evalue(&m_points[0], p) > double(0.0f))) - { - #ifdef _DEBUG - for (int i = 0; i < deletedCount; ++i) - { - _ASSERT(deleteList[i] != node1); - } - #endif - - deleteList[deletedCount] = node1; - deletedCount++; - _ASSERT(deletedCount < int(deleteListPool.size())); - face1->m_mark = 1; - for (int i = 0; i < 3; ++i) - { - ndNode* const twinNode = face1->m_twin[i]; - _ASSERT(twinNode); - ConvexHullFace* const twinFace = &twinNode->GetInfo(); - if (!twinFace->m_mark) - { - stack[stackIndex] = twinNode; - stackIndex++; - _ASSERT(stackIndex < int(stackPool.size())); - } - } - } - } - - m_points[currentIndex] = points[index]; - points[index].m_mark = 1; - - int newCount = 0; - for (int i = 0; i < deletedCount; ++i) - { - ndNode* const node1 = deleteList[i]; - ConvexHullFace* const face1 = &node1->GetInfo(); - _ASSERT(face1->m_mark == 1); - for (int j0 = 0; j0 < 3; j0++) - { - ndNode* const twinNode = face1->m_twin[j0]; - ConvexHullFace* const twinFace = &twinNode->GetInfo(); - if (!twinFace->m_mark) - { - int j1 = (j0 == 2) ? 0 : j0 + 1; - ndNode* const newNode = AddFace(int(currentIndex), face1->m_index[j0], face1->m_index[j1]); - boundaryFaces.Addtop(newNode); - - ConvexHullFace* const newFace = &newNode->GetInfo(); - newFace->m_twin[1] = twinNode; - for (int k = 0; k < 3; ++k) - { - if (twinFace->m_twin[k] == node1) - { - twinFace->m_twin[k] = newNode; - } - } - coneList[newCount] = newNode; - newCount++; - _ASSERT(newCount < int(coneListPool.size())); - } - } - } - - for (int i = 0; i < newCount - 1; ++i) - { - ndNode* const nodeA = coneList[i]; - ConvexHullFace* const faceA = &nodeA->GetInfo(); - _ASSERT(faceA->m_mark == 0); - for (int j = i + 1; j < newCount; ++j) - { - ndNode* const nodeB = coneList[j]; - ConvexHullFace* const faceB = &nodeB->GetInfo(); - _ASSERT(faceB->m_mark == 0); - if (faceA->m_index[2] == faceB->m_index[1]) - { - faceA->m_twin[2] = nodeB; - faceB->m_twin[0] = nodeA; - break; - } - } - - for (int j = i + 1; j < newCount; ++j) - { - ndNode* const nodeB = coneList[j]; - ConvexHullFace* const faceB = &nodeB->GetInfo(); - _ASSERT(faceB->m_mark == 0); - if (faceA->m_index[1] == faceB->m_index[2]) - { - faceA->m_twin[0] = nodeB; - faceB->m_twin[2] = nodeA; - break; - } - } - } - - for (int i = 0; i < deletedCount; ++i) - { - ndNode* const node = deleteList[i]; - boundaryFaces.Remove(node); - Remove(node); - } - - maxVertexCount--; - currentIndex++; - count--; - } - else - { - boundaryFaces.Remove(faceNode); - } - } - m_points.resize(currentIndex); - } - } -} - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdConvexHullUtils.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdConvexHullUtils.cpp deleted file mode 100644 index e95e0bbcd0..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdConvexHullUtils.cpp +++ /dev/null @@ -1,715 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include "vhacdConvexHullUtils.h" - -namespace nd_ -{ - namespace VHACD - { - #define Absolute(a) ((a) >= 0.0 ? (a) : -(a)) - - Googol Googol::m_zero(0.0); - Googol Googol::m_one(1.0); - Googol Googol::m_two(2.0); - Googol Googol::m_three(3.0); - Googol Googol::m_half(0.5); - - Googol::Googol(void) - :m_sign(0) - ,m_exponent(0) - { - memset(m_mantissa, 0, sizeof(m_mantissa)); - } - - Googol::Googol(double value) - :m_sign(0) - , m_exponent(0) - { - int exp; - double mantissa = fabs(frexp(value, &exp)); - - m_exponent = int(exp); - m_sign = (value >= 0) ? 0 : 1; - - memset(m_mantissa, 0, sizeof(m_mantissa)); - m_mantissa[0] = uint64_t(double(uint64_t(1) << 62) * mantissa); - } - - void Googol::CopySignedMantissa(uint64_t* const mantissa) const - { - memcpy(mantissa, m_mantissa, sizeof(m_mantissa)); - if (m_sign) - { - NegateMantissa(mantissa); - } - } - - Googol::operator double() const - { - double mantissa = (double(1.0f) / double(uint64_t(1) << 62)) * double(m_mantissa[0]); - mantissa = ldexp(mantissa, m_exponent) * (m_sign ? double(-1.0f) : double(1.0f)); - return mantissa; - } - - Googol Googol::operator+ (const Googol &A) const - { - Googol tmp; - if (m_mantissa[0] && A.m_mantissa[0]) - { - uint64_t mantissa0[VHACD_GOOGOL_SIZE]; - uint64_t mantissa1[VHACD_GOOGOL_SIZE]; - uint64_t mantissa[VHACD_GOOGOL_SIZE]; - - CopySignedMantissa(mantissa0); - A.CopySignedMantissa(mantissa1); - - int exponetDiff = m_exponent - A.m_exponent; - int exponent = m_exponent; - if (exponetDiff > 0) - { - ShiftRightMantissa(mantissa1, exponetDiff); - } - else if (exponetDiff < 0) - { - exponent = A.m_exponent; - ShiftRightMantissa(mantissa0, -exponetDiff); - } - - uint64_t carrier = 0; - for (int i = VHACD_GOOGOL_SIZE - 1; i >= 0; i--) - { - uint64_t m0 = mantissa0[i]; - uint64_t m1 = mantissa1[i]; - mantissa[i] = m0 + m1 + carrier; - carrier = CheckCarrier(m0, m1) | CheckCarrier(m0 + m1, carrier); - } - - int sign = 0; - if (int64_t(mantissa[0]) < 0) - { - sign = 1; - NegateMantissa(mantissa); - } - - int bits = NormalizeMantissa(mantissa); - if (bits <= (-64 * VHACD_GOOGOL_SIZE)) - { - tmp.m_sign = 0; - tmp.m_exponent = 0; - } - else - { - tmp.m_sign = sign; - tmp.m_exponent = int(exponent + bits); - } - - memcpy(tmp.m_mantissa, mantissa, sizeof(m_mantissa)); - } - else if (A.m_mantissa[0]) - { - tmp = A; - } - else - { - tmp = *this; - } - - return tmp; - } - - Googol Googol::operator- (const Googol &A) const - { - Googol tmp(A); - tmp.m_sign = !tmp.m_sign; - return *this + tmp; - } - - void Googol::ScaleMantissa(uint64_t* const dst, uint64_t scale) const - { - uint64_t carrier = 0; - for (int i = VHACD_GOOGOL_SIZE - 1; i >= 0; i--) - { - if (m_mantissa[i]) - { - uint64_t low; - uint64_t high; - ExtendeMultiply(scale, m_mantissa[i], high, low); - uint64_t acc = low + carrier; - carrier = CheckCarrier(low, carrier); - carrier += high; - dst[i + 1] = acc; - } - else - { - dst[i + 1] = carrier; - carrier = 0; - } - - } - dst[0] = carrier; - } - - Googol Googol::operator* (const Googol &A) const - { - if (m_mantissa[0] && A.m_mantissa[0]) - { - uint64_t mantissaAcc[VHACD_GOOGOL_SIZE * 2]; - memset(mantissaAcc, 0, sizeof(mantissaAcc)); - for (int i = VHACD_GOOGOL_SIZE - 1; i >= 0; i--) - { - uint64_t a = m_mantissa[i]; - if (a) - { - uint64_t mantissaScale[2 * VHACD_GOOGOL_SIZE]; - memset(mantissaScale, 0, sizeof(mantissaScale)); - A.ScaleMantissa(&mantissaScale[i], a); - - uint64_t carrier = 0; - for (int j = 0; j < 2 * VHACD_GOOGOL_SIZE; ++j) - { - const int k = 2 * VHACD_GOOGOL_SIZE - 1 - j; - uint64_t m0 = mantissaAcc[k]; - uint64_t m1 = mantissaScale[k]; - mantissaAcc[k] = m0 + m1 + carrier; - carrier = CheckCarrier(m0, m1) | CheckCarrier(m0 + m1, carrier); - } - } - } - - uint64_t carrier = 0; - //int bits = uint64_t(LeadingZeros (mantissaAcc[0]) - 2); - int bits = LeadingZeros(mantissaAcc[0]) - 2; - for (int i = 0; i < 2 * VHACD_GOOGOL_SIZE; ++i) - { - const int k = 2 * VHACD_GOOGOL_SIZE - 1 - i; - uint64_t a = mantissaAcc[k]; - mantissaAcc[k] = (a << uint64_t(bits)) | carrier; - carrier = a >> uint64_t(64 - bits); - } - - int exp = m_exponent + A.m_exponent - (bits - 2); - - Googol tmp; - tmp.m_sign = m_sign ^ A.m_sign; - tmp.m_exponent = int(exp); - memcpy(tmp.m_mantissa, mantissaAcc, sizeof(m_mantissa)); - - return tmp; - } - return Googol(0.0); - } - - Googol Googol::operator/ (const Googol &A) const - { - Googol tmp(1.0 / A); - tmp = tmp * (m_two - A * tmp); - tmp = tmp * (m_two - A * tmp); - int test = 0; - int passes = 0; - do - { - passes++; - Googol tmp0(tmp); - tmp = tmp * (m_two - A * tmp); - test = memcmp(&tmp0, &tmp, sizeof(Googol)); - } while (test && (passes < (2 * VHACD_GOOGOL_SIZE))); - return (*this) * tmp; - } - - Googol Googol::Abs() const - { - Googol tmp(*this); - tmp.m_sign = 0; - return tmp; - } - - Googol Googol::Floor() const - { - if (m_exponent < 1) - { - return Googol(0.0); - } - int bits = m_exponent + 2; - int start = 0; - while (bits >= 64) - { - bits -= 64; - start++; - } - - Googol tmp(*this); - for (int i = VHACD_GOOGOL_SIZE - 1; i > start; i--) - { - tmp.m_mantissa[i] = 0; - } - // some compilers do no like this and I do not know why is that - //uint64_t mask = (-1LL) << (64 - bits); - uint64_t mask(~0ULL); - mask <<= (64 - bits); - tmp.m_mantissa[start] &= mask; - return tmp; - } - - Googol Googol::InvSqrt() const - { - const Googol& me = *this; - Googol x(1.0f / sqrt(me)); - - int test = 0; - int passes = 0; - do - { - passes++; - Googol tmp(x); - x = m_half * x * (m_three - me * x * x); - test = memcmp(&x, &tmp, sizeof(Googol)); - } while (test && (passes < (2 * VHACD_GOOGOL_SIZE))); - return x; - } - - Googol Googol::Sqrt() const - { - return *this * InvSqrt(); - } - - void Googol::ToString(char* const string) const - { - Googol tmp(*this); - Googol base(10.0); - while (double(tmp) > 1.0) - { - tmp = tmp / base; - } - - int index = 0; - while (tmp.m_mantissa[0]) - { - tmp = tmp * base; - Googol digit(tmp.Floor()); - tmp -= digit; - double val = digit; - string[index] = char(val) + '0'; - index++; - } - string[index] = 0; - } - - void Googol::NegateMantissa(uint64_t* const mantissa) const - { - uint64_t carrier = 1; - for (int i = VHACD_GOOGOL_SIZE - 1; i >= 0; i--) - { - uint64_t a = ~mantissa[i] + carrier; - if (a) - { - carrier = 0; - } - mantissa[i] = a; - } - } - - void Googol::ShiftRightMantissa(uint64_t* const mantissa, int bits) const - { - uint64_t carrier = 0; - if (int64_t(mantissa[0]) < int64_t(0)) - { - carrier = uint64_t(-1); - } - - while (bits >= 64) - { - for (int i = VHACD_GOOGOL_SIZE - 2; i >= 0; i--) - { - mantissa[i + 1] = mantissa[i]; - } - mantissa[0] = carrier; - bits -= 64; - } - - if (bits > 0) - { - carrier <<= (64 - bits); - for (int i = 0; i < VHACD_GOOGOL_SIZE; ++i) - { - uint64_t a = mantissa[i]; - mantissa[i] = (a >> bits) | carrier; - carrier = a << (64 - bits); - } - } - } - - int Googol::LeadingZeros(uint64_t a) const - { - #define dgCOUNTBIT(mask,add) \ - { \ - uint64_t test = a & mask; \ - n += test ? 0 : add; \ - a = test ? test : (a & ~mask); \ - } - - int n = 0; - dgCOUNTBIT(0xffffffff00000000LL, 32); - dgCOUNTBIT(0xffff0000ffff0000LL, 16); - dgCOUNTBIT(0xff00ff00ff00ff00LL, 8); - dgCOUNTBIT(0xf0f0f0f0f0f0f0f0LL, 4); - dgCOUNTBIT(0xccccccccccccccccLL, 2); - dgCOUNTBIT(0xaaaaaaaaaaaaaaaaLL, 1); - - return n; - } - - int Googol::NormalizeMantissa(uint64_t* const mantissa) const - { - int bits = 0; - if (int64_t(mantissa[0] * 2) < 0) - { - bits = 1; - ShiftRightMantissa(mantissa, 1); - } - else - { - while (!mantissa[0] && bits > (-64 * VHACD_GOOGOL_SIZE)) - { - bits -= 64; - for (int i = 1; i < VHACD_GOOGOL_SIZE; ++i) { - mantissa[i - 1] = mantissa[i]; - } - mantissa[VHACD_GOOGOL_SIZE - 1] = 0; - } - - if (bits > (-64 * VHACD_GOOGOL_SIZE)) - { - int n = LeadingZeros(mantissa[0]) - 2; - if (n > 0) - { - uint64_t carrier = 0; - for (int i = VHACD_GOOGOL_SIZE - 1; i >= 0; i--) - { - uint64_t a = mantissa[i]; - mantissa[i] = (a << n) | carrier; - carrier = a >> (64 - n); - } - bits -= n; - } - else if (n < 0) - { - // this is very rare but it does happens, whee the leading zeros of the mantissa is an exact multiple of 64 - uint64_t carrier = 0; - int shift = -n; - for (int i = 0; i < VHACD_GOOGOL_SIZE; ++i) - { - uint64_t a = mantissa[i]; - mantissa[i] = (a >> shift) | carrier; - carrier = a << (64 - shift); - } - bits -= n; - } - } - } - return bits; - } - - uint64_t Googol::CheckCarrier(uint64_t a, uint64_t b) const - { - return ((uint64_t(-1) - b) < a) ? uint64_t(1) : 0; - } - - void Googol::ExtendeMultiply(uint64_t a, uint64_t b, uint64_t& high, uint64_t& low) const - { - uint64_t bLow = b & 0xffffffff; - uint64_t bHigh = b >> 32; - uint64_t aLow = a & 0xffffffff; - uint64_t aHigh = a >> 32; - - uint64_t l = bLow * aLow; - - uint64_t c1 = bHigh * aLow; - uint64_t c2 = bLow * aHigh; - uint64_t m = c1 + c2; - uint64_t carrier = CheckCarrier(c1, c2) << 32; - - uint64_t h = bHigh * aHigh + carrier; - - uint64_t ml = m << 32; - uint64_t ll = l + ml; - uint64_t mh = (m >> 32) + CheckCarrier(l, ml); - uint64_t hh = h + mh; - - low = ll; - high = hh; - } - - Googol Googol::operator+= (const Googol &A) - { - *this = *this + A; - return *this; - } - - Googol Googol::operator-= (const Googol &A) - { - *this = *this - A; - return *this; - } - - bool Googol::operator> (const Googol &A) const - { - Googol tmp(*this - A); - return double(tmp) > 0.0; - } - - bool Googol::operator>= (const Googol &A) const - { - Googol tmp(*this - A); - return double(tmp) >= 0.0; - } - - bool Googol::operator< (const Googol &A) const - { - Googol tmp(*this - A); - return double(tmp) < 0.0; - } - - bool Googol::operator<= (const Googol &A) const - { - Googol tmp(*this - A); - return double(tmp) <= 0.0; - } - - bool Googol::operator== (const Googol &A) const - { - Googol tmp(*this - A); - return double(tmp) == 0.0; - } - - bool Googol::operator!= (const Googol &A) const - { - Googol tmp(*this - A); - return double(tmp) != 0.0; - } - - void Googol::Trace() const - { - //dTrace (("%f ", double (*this))); - } - - double Determinant2x2(const double matrix[2][2], double* const error) - { - double a00xa11 = matrix[0][0] * matrix[1][1]; - double a01xa10 = matrix[0][1] * matrix[1][0]; - *error = Absolute(a00xa11) + Absolute(a01xa10); - return a00xa11 - a01xa10; - } - - double Determinant3x3(const double matrix[3][3], double* const error) - { - double sign = double(-1.0f); - double det = double(0.0f); - double accError = double(0.0f); - for (int i = 0; i < 3; ++i) - { - double cofactor[2][2]; - for (int j = 0; j < 2; ++j) - { - int k0 = 0; - for (int k = 0; k < 3; ++k) - { - if (k != i) - { - cofactor[j][k0] = matrix[j][k]; - k0++; - } - } - } - - double parcialError; - double minorDet = Determinant2x2(cofactor, &parcialError); - accError += parcialError * Absolute(matrix[2][i]); - det += sign * minorDet * matrix[2][i]; - sign *= double(-1.0f); - } - - *error = accError; - return det; - } - - Googol Determinant2x2(const Googol matrix[2][2]) - { - Googol a00xa11(matrix[0][0] * matrix[1][1]); - Googol a01xa10(matrix[0][1] * matrix[1][0]); - return a00xa11 - a01xa10; - } - - Googol Determinant3x3(const Googol matrix[3][3]) - { - Googol negOne(double(-1.0f)); - Googol sign(double(-1.0f)); - Googol det = double(0.0f); - for (int i = 0; i < 3; ++i) - { - Googol cofactor[2][2]; - for (int j = 0; j < 2; ++j) - { - int k0 = 0; - for (int k = 0; k < 3; ++k) - { - if (k != i) - { - cofactor[j][k0] = matrix[j][k]; - k0++; - } - } - } - - Googol minorDet(Determinant2x2(cofactor)); - det = det + sign * minorDet * matrix[2][i]; - sign = sign * negOne; - } - return det; - } - - Semaphore::Semaphore() - :m_count(0) - ,m_mutex() - ,m_condition() - ,m_terminate(false) - { - } - - Semaphore::~Semaphore() - { - } - - bool Semaphore::Wait() - { - std::unique_lock lock(m_mutex); - while (m_count == 0) - { - m_condition.wait(lock); - } - - m_count--; - return m_terminate.load(); - } - - void Semaphore::Signal() - { - std::unique_lock lock(m_mutex); - m_count++; - m_condition.notify_one(); - } - - void Semaphore::Terminate() - { - std::unique_lock lock(m_mutex); - m_count++; - m_terminate.store(true); - m_condition.notify_one(); - } - - Queue::Queue() - :List() - ,m_mutex() - ,m_jobs(0) - { - for (int i = 0; i < VHACD_WORKERS_THREADS; ++i) - { - m_threads[i].m_threadID = i; - m_threads[i].m_queue = this; - } - } - - Queue::~Queue() - { - for (int i = 0; i < VHACD_WORKERS_THREADS; ++i) - { - m_threads[i].Terminate(); - m_threads[i].join(); - } - } - - void Queue::PushTask(Job* const job) - { - std::unique_lock lock(m_mutex); - Append(job); - m_jobs.fetch_add(1); - for (int i = 0; i < VHACD_WORKERS_THREADS; ++i) - { - m_threads[i].Signal(); - } - } - - Job* Queue::PopTask() - { - std::unique_lock lock(m_mutex); - Job* job = nullptr; - if (GetCount()) - { - ndNode* const node = GetFirst(); - job = node->GetInfo(); - Remove(node); - } - return job; - } - - void Queue::Sync() - { - while (m_jobs) - { - std::this_thread::yield(); - } - } - - #ifdef _MSC_VER - #pragma warning( push ) - #pragma warning( disable : 4355) - #endif - - Thread::Thread() - :Semaphore() - ,std::thread(&Thread::ThreadFunctionCallback, this) - ,m_queue(nullptr) - { - } - - #ifdef _MSC_VER - #pragma warning( pop ) - #endif - - Thread::~Thread() - { - } - - void Thread::ThreadFunctionCallback() - { - while (!Wait()) - { - Job* const job = m_queue->PopTask(); - if (job) - { - job->Execute(m_threadID); - m_queue->m_jobs.fetch_add(-1); - } - } - } - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdICHull.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdICHull.cpp deleted file mode 100644 index f14c67088b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdICHull.cpp +++ /dev/null @@ -1,733 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include "vhacdDefines.h" -#include "vhacdICHull.h" - - -namespace nd_ -{ - namespace VHACD - { - const double ICHull::sc_eps = 1.0e-15; - //const int32_t ICHull::sc_dummyIndex = std::numeric_limits::max(); - const int32_t ICHull::sc_dummyIndex = 0x7fffffff; - ICHull::ICHull() - { - m_isFlat = false; - } - bool ICHull::AddPoints(const Vec3* points, size_t nPoints) - { - if (!points) { - return false; - } - CircularListElement* vertex = NULL; - for (size_t i = 0; i < nPoints; i++) { - vertex = m_mesh.AddVertex(); - vertex->GetData().m_pos.X() = points[i].X(); - vertex->GetData().m_pos.Y() = points[i].Y(); - vertex->GetData().m_pos.Z() = points[i].Z(); - vertex->GetData().m_name = static_cast(i); - } - return true; - } - bool ICHull::AddPoint(const Vec3& point, int32_t id) - { - if (AddPoints(&point, 1)) { - m_mesh.m_vertices.GetData().m_name = id; - return true; - } - return false; - } - - ICHullError ICHull::Process() - { - uint32_t addedPoints = 0; - if (m_mesh.GetNVertices() < 3) { - return ICHullErrorNotEnoughPoints; - } - if (m_mesh.GetNVertices() == 3) { - m_isFlat = true; - CircularListElement* t1 = m_mesh.AddTriangle(); - CircularListElement* t2 = m_mesh.AddTriangle(); - CircularListElement* v0 = m_mesh.m_vertices.GetHead(); - CircularListElement* v1 = v0->GetNext(); - CircularListElement* v2 = v1->GetNext(); - // Compute the normal to the plane - Vec3 p0 = v0->GetData().m_pos; - Vec3 p1 = v1->GetData().m_pos; - Vec3 p2 = v2->GetData().m_pos; - m_normal = (p1 - p0) ^ (p2 - p0); - m_normal.Normalize(); - t1->GetData().m_vertices[0] = v0; - t1->GetData().m_vertices[1] = v1; - t1->GetData().m_vertices[2] = v2; - t2->GetData().m_vertices[0] = v1; - t2->GetData().m_vertices[1] = v2; - t2->GetData().m_vertices[2] = v2; - return ICHullErrorOK; - } - if (m_isFlat) { - m_mesh.m_edges.Clear(); - m_mesh.m_triangles.Clear(); - m_isFlat = false; - } - if (m_mesh.GetNTriangles() == 0) // we have to create the first polyhedron - { - ICHullError res = DoubleTriangle(); - if (res != ICHullErrorOK) { - return res; - } - else { - addedPoints += 3; - } - } - CircularList& vertices_ = m_mesh.GetVertices(); - // go to the first added and not processed vertex - while (!(vertices_.GetHead()->GetPrev()->GetData().m_tag)) { - vertices_.Prev(); - } - while (!vertices_.GetData().m_tag) // not processed - { - vertices_.GetData().m_tag = true; - if (ProcessPoint()) { - addedPoints++; - CleanUp(addedPoints); - vertices_.Next(); - if (!GetMesh().CheckConsistancy()) { - size_t nV = m_mesh.GetNVertices(); - CircularList& vertices = m_mesh.GetVertices(); - for (size_t v = 0; v < nV; ++v) { - if (vertices.GetData().m_name == sc_dummyIndex) { - vertices.Delete(); - break; - } - vertices.Next(); - } - return ICHullErrorInconsistent; - } - } - } - if (m_isFlat) { - SArray*> trianglesToDuplicate; - size_t nT = m_mesh.GetNTriangles(); - for (size_t f = 0; f < nT; f++) { - TMMTriangle& currentTriangle = m_mesh.m_triangles.GetHead()->GetData(); - if (currentTriangle.m_vertices[0]->GetData().m_name == sc_dummyIndex || currentTriangle.m_vertices[1]->GetData().m_name == sc_dummyIndex || currentTriangle.m_vertices[2]->GetData().m_name == sc_dummyIndex) { - m_trianglesToDelete.PushBack(m_mesh.m_triangles.GetHead()); - for (int32_t k = 0; k < 3; ++k) { - for (int32_t h = 0; h < 2; h++) { - if (currentTriangle.m_edges[k]->GetData().m_triangles[h] == m_mesh.m_triangles.GetHead()) { - currentTriangle.m_edges[k]->GetData().m_triangles[h] = 0; - break; - } - } - } - } - else { - trianglesToDuplicate.PushBack(m_mesh.m_triangles.GetHead()); - } - m_mesh.m_triangles.Next(); - } - size_t nE = m_mesh.GetNEdges(); - for (size_t e = 0; e < nE; e++) { - TMMEdge& currentEdge = m_mesh.m_edges.GetHead()->GetData(); - if (currentEdge.m_triangles[0] == 0 && currentEdge.m_triangles[1] == 0) { - m_edgesToDelete.PushBack(m_mesh.m_edges.GetHead()); - } - m_mesh.m_edges.Next(); - } - size_t nV = m_mesh.GetNVertices(); - CircularList& vertices = m_mesh.GetVertices(); - for (size_t v = 0; v < nV; ++v) { - if (vertices.GetData().m_name == sc_dummyIndex) { - vertices.Delete(); - } - else { - vertices.GetData().m_tag = false; - vertices.Next(); - } - } - CleanEdges(); - CleanTriangles(); - CircularListElement* newTriangle; - for (size_t t = 0; t < trianglesToDuplicate.Size(); t++) { - newTriangle = m_mesh.AddTriangle(); - newTriangle->GetData().m_vertices[0] = trianglesToDuplicate[t]->GetData().m_vertices[1]; - newTriangle->GetData().m_vertices[1] = trianglesToDuplicate[t]->GetData().m_vertices[0]; - newTriangle->GetData().m_vertices[2] = trianglesToDuplicate[t]->GetData().m_vertices[2]; - } - } - return ICHullErrorOK; - } - ICHullError ICHull::Process(const uint32_t nPointsCH, - const double minVolume) - { - uint32_t addedPoints = 0; - if (nPointsCH < 3 || m_mesh.GetNVertices() < 3) { - return ICHullErrorNotEnoughPoints; - } - if (m_mesh.GetNVertices() == 3) { - m_isFlat = true; - CircularListElement* t1 = m_mesh.AddTriangle(); - CircularListElement* t2 = m_mesh.AddTriangle(); - CircularListElement* v0 = m_mesh.m_vertices.GetHead(); - CircularListElement* v1 = v0->GetNext(); - CircularListElement* v2 = v1->GetNext(); - // Compute the normal to the plane - Vec3 p0 = v0->GetData().m_pos; - Vec3 p1 = v1->GetData().m_pos; - Vec3 p2 = v2->GetData().m_pos; - m_normal = (p1 - p0) ^ (p2 - p0); - m_normal.Normalize(); - t1->GetData().m_vertices[0] = v0; - t1->GetData().m_vertices[1] = v1; - t1->GetData().m_vertices[2] = v2; - t2->GetData().m_vertices[0] = v1; - t2->GetData().m_vertices[1] = v0; - t2->GetData().m_vertices[2] = v2; - return ICHullErrorOK; - } - - if (m_isFlat) { - m_mesh.m_triangles.Clear(); - m_mesh.m_edges.Clear(); - m_isFlat = false; - } - - if (m_mesh.GetNTriangles() == 0) // we have to create the first polyhedron - { - ICHullError res = DoubleTriangle(); - if (res != ICHullErrorOK) { - return res; - } - else { - addedPoints += 3; - } - } - CircularList& vertices_ = m_mesh.GetVertices(); - while (!vertices_.GetData().m_tag && addedPoints < nPointsCH) // not processed - { - if (!FindMaxVolumePoint((addedPoints > 4) ? minVolume : 0.0)) { - break; - } - vertices_.GetData().m_tag = true; - if (ProcessPoint()) { - addedPoints++; - CleanUp(addedPoints); - if (!GetMesh().CheckConsistancy()) { - size_t nV = m_mesh.GetNVertices(); - CircularList& vertices = m_mesh.GetVertices(); - for (size_t v = 0; v < nV; ++v) { - if (vertices.GetData().m_name == sc_dummyIndex) { - vertices.Delete(); - break; - } - vertices.Next(); - } - return ICHullErrorInconsistent; - } - vertices_.Next(); - } - } - // delete remaining points - while (!vertices_.GetData().m_tag) { - vertices_.Delete(); - } - if (m_isFlat) { - SArray*> trianglesToDuplicate; - size_t nT = m_mesh.GetNTriangles(); - for (size_t f = 0; f < nT; f++) { - TMMTriangle& currentTriangle = m_mesh.m_triangles.GetHead()->GetData(); - if (currentTriangle.m_vertices[0]->GetData().m_name == sc_dummyIndex || currentTriangle.m_vertices[1]->GetData().m_name == sc_dummyIndex || currentTriangle.m_vertices[2]->GetData().m_name == sc_dummyIndex) { - m_trianglesToDelete.PushBack(m_mesh.m_triangles.GetHead()); - for (int32_t k = 0; k < 3; ++k) { - for (int32_t h = 0; h < 2; h++) { - if (currentTriangle.m_edges[k]->GetData().m_triangles[h] == m_mesh.m_triangles.GetHead()) { - currentTriangle.m_edges[k]->GetData().m_triangles[h] = 0; - break; - } - } - } - } - else { - trianglesToDuplicate.PushBack(m_mesh.m_triangles.GetHead()); - } - m_mesh.m_triangles.Next(); - } - size_t nE = m_mesh.GetNEdges(); - for (size_t e = 0; e < nE; e++) { - TMMEdge& currentEdge = m_mesh.m_edges.GetHead()->GetData(); - if (currentEdge.m_triangles[0] == 0 && currentEdge.m_triangles[1] == 0) { - m_edgesToDelete.PushBack(m_mesh.m_edges.GetHead()); - } - m_mesh.m_edges.Next(); - } - size_t nV = m_mesh.GetNVertices(); - CircularList& vertices = m_mesh.GetVertices(); - for (size_t v = 0; v < nV; ++v) { - if (vertices.GetData().m_name == sc_dummyIndex) { - vertices.Delete(); - } - else { - vertices.GetData().m_tag = false; - vertices.Next(); - } - } - CleanEdges(); - CleanTriangles(); - CircularListElement* newTriangle; - for (size_t t = 0; t < trianglesToDuplicate.Size(); t++) { - newTriangle = m_mesh.AddTriangle(); - newTriangle->GetData().m_vertices[0] = trianglesToDuplicate[t]->GetData().m_vertices[1]; - newTriangle->GetData().m_vertices[1] = trianglesToDuplicate[t]->GetData().m_vertices[0]; - newTriangle->GetData().m_vertices[2] = trianglesToDuplicate[t]->GetData().m_vertices[2]; - } - } - return ICHullErrorOK; - } - bool ICHull::FindMaxVolumePoint(const double minVolume) - { - CircularList& vertices = m_mesh.GetVertices(); - CircularListElement* vMaxVolume = 0; - CircularListElement* vHeadPrev = vertices.GetHead()->GetPrev(); - - double maxVolume = minVolume; - double volume = 0.0; - while (!vertices.GetData().m_tag) // not processed - { - if (ComputePointVolume(volume, false)) { - if (maxVolume < volume) { - maxVolume = volume; - vMaxVolume = vertices.GetHead(); - } - vertices.Next(); - } - } - CircularListElement* vHead = vHeadPrev->GetNext(); - vertices.GetHead() = vHead; - if (!vMaxVolume) { - return false; - } - if (vMaxVolume != vHead) { - Vec3 pos = vHead->GetData().m_pos; - int32_t id = vHead->GetData().m_name; - vHead->GetData().m_pos = vMaxVolume->GetData().m_pos; - vHead->GetData().m_name = vMaxVolume->GetData().m_name; - vMaxVolume->GetData().m_pos = pos; - vHead->GetData().m_name = id; - } - return true; - } - ICHullError ICHull::DoubleTriangle() - { - // find three non colinear points - m_isFlat = false; - CircularList& vertices = m_mesh.GetVertices(); - CircularListElement* v0 = vertices.GetHead(); - while (Colinear(v0->GetData().m_pos, - v0->GetNext()->GetData().m_pos, - v0->GetNext()->GetNext()->GetData().m_pos)) { - if ((v0 = v0->GetNext()) == vertices.GetHead()) { - return ICHullErrorCoplanarPoints; - } - } - CircularListElement* v1 = v0->GetNext(); - CircularListElement* v2 = v1->GetNext(); - // mark points as processed - v0->GetData().m_tag = v1->GetData().m_tag = v2->GetData().m_tag = true; - - // create two triangles - CircularListElement* f0 = MakeFace(v0, v1, v2, 0); - MakeFace(v2, v1, v0, f0); - - // find a fourth non-coplanar point to form tetrahedron - CircularListElement* v3 = v2->GetNext(); - vertices.GetHead() = v3; - - double vol = ComputeVolume4(v0->GetData().m_pos, v1->GetData().m_pos, v2->GetData().m_pos, v3->GetData().m_pos); - while (fabs(vol) < sc_eps && !v3->GetNext()->GetData().m_tag) { - v3 = v3->GetNext(); - vol = ComputeVolume4(v0->GetData().m_pos, v1->GetData().m_pos, v2->GetData().m_pos, v3->GetData().m_pos); - } - if (fabs(vol) < sc_eps) { - // compute the barycenter - Vec3 bary(0.0, 0.0, 0.0); - CircularListElement* vBary = v0; - do { - bary += vBary->GetData().m_pos; - } while ((vBary = vBary->GetNext()) != v0); - bary /= static_cast(vertices.GetSize()); - - // Compute the normal to the plane - Vec3 p0 = v0->GetData().m_pos; - Vec3 p1 = v1->GetData().m_pos; - Vec3 p2 = v2->GetData().m_pos; - m_normal = (p1 - p0) ^ (p2 - p0); - m_normal.Normalize(); - // add dummy vertex placed at (bary + normal) - vertices.GetHead() = v2; - Vec3 newPt = bary + m_normal; - AddPoint(newPt, sc_dummyIndex); - m_isFlat = true; - return ICHullErrorOK; - } - else if (v3 != vertices.GetHead()) { - TMMVertex temp; - temp.m_name = v3->GetData().m_name; - temp.m_pos = v3->GetData().m_pos; - v3->GetData().m_name = vertices.GetHead()->GetData().m_name; - v3->GetData().m_pos = vertices.GetHead()->GetData().m_pos; - vertices.GetHead()->GetData().m_name = temp.m_name; - vertices.GetHead()->GetData().m_pos = temp.m_pos; - } - return ICHullErrorOK; - } - CircularListElement* ICHull::MakeFace(CircularListElement* v0, - CircularListElement* v1, - CircularListElement* v2, - CircularListElement* fold) - { - CircularListElement* e0; - CircularListElement* e1; - CircularListElement* e2; - int32_t index = 0; - if (!fold) // if first face to be created - { - e0 = m_mesh.AddEdge(); // create the three edges - e1 = m_mesh.AddEdge(); - e2 = m_mesh.AddEdge(); - } - else // otherwise re-use existing edges (in reverse order) - { - e0 = fold->GetData().m_edges[2]; - e1 = fold->GetData().m_edges[1]; - e2 = fold->GetData().m_edges[0]; - index = 1; - } - e0->GetData().m_vertices[0] = v0; - e0->GetData().m_vertices[1] = v1; - e1->GetData().m_vertices[0] = v1; - e1->GetData().m_vertices[1] = v2; - e2->GetData().m_vertices[0] = v2; - e2->GetData().m_vertices[1] = v0; - // create the new face - CircularListElement* f = m_mesh.AddTriangle(); - f->GetData().m_edges[0] = e0; - f->GetData().m_edges[1] = e1; - f->GetData().m_edges[2] = e2; - f->GetData().m_vertices[0] = v0; - f->GetData().m_vertices[1] = v1; - f->GetData().m_vertices[2] = v2; - // link edges to face f - e0->GetData().m_triangles[index] = e1->GetData().m_triangles[index] = e2->GetData().m_triangles[index] = f; - return f; - } - CircularListElement* ICHull::MakeConeFace(CircularListElement* e, CircularListElement* p) - { - // create two new edges if they don't already exist - CircularListElement* newEdges[2]; - for (int32_t i = 0; i < 2; ++i) { - //if (!(newEdges[i] = e->GetData().m_vertices[i]->GetData().m_duplicate)) { // if the edge doesn't exits add it and mark the vertex as duplicated - if (!(newEdges[i] == e->GetData().m_vertices[i]->GetData().m_duplicate)) { // if the edge doesn't exits add it and mark the vertex as duplicated - newEdges[i] = m_mesh.AddEdge(); - newEdges[i]->GetData().m_vertices[0] = e->GetData().m_vertices[i]; - newEdges[i]->GetData().m_vertices[1] = p; - e->GetData().m_vertices[i]->GetData().m_duplicate = newEdges[i]; - } - } - // make the new face - CircularListElement* newFace = m_mesh.AddTriangle(); - newFace->GetData().m_edges[0] = e; - newFace->GetData().m_edges[1] = newEdges[0]; - newFace->GetData().m_edges[2] = newEdges[1]; - MakeCCW(newFace, e, p); - for (int32_t i = 0; i < 2; ++i) { - for (int32_t j = 0; j < 2; ++j) { - if (!newEdges[i]->GetData().m_triangles[j]) { - newEdges[i]->GetData().m_triangles[j] = newFace; - break; - } - } - } - return newFace; - } - bool ICHull::ComputePointVolume(double& totalVolume, bool markVisibleFaces) - { - // mark visible faces - CircularListElement* fHead = m_mesh.GetTriangles().GetHead(); - CircularListElement* f = fHead; - CircularList& vertices = m_mesh.GetVertices(); - CircularListElement* vertex0 = vertices.GetHead(); - bool visible = false; - Vec3 pos0 = Vec3(vertex0->GetData().m_pos.X(), - vertex0->GetData().m_pos.Y(), - vertex0->GetData().m_pos.Z()); - double vol = 0.0; - totalVolume = 0.0; - Vec3 ver0, ver1, ver2; - do { - ver0.X() = f->GetData().m_vertices[0]->GetData().m_pos.X(); - ver0.Y() = f->GetData().m_vertices[0]->GetData().m_pos.Y(); - ver0.Z() = f->GetData().m_vertices[0]->GetData().m_pos.Z(); - ver1.X() = f->GetData().m_vertices[1]->GetData().m_pos.X(); - ver1.Y() = f->GetData().m_vertices[1]->GetData().m_pos.Y(); - ver1.Z() = f->GetData().m_vertices[1]->GetData().m_pos.Z(); - ver2.X() = f->GetData().m_vertices[2]->GetData().m_pos.X(); - ver2.Y() = f->GetData().m_vertices[2]->GetData().m_pos.Y(); - ver2.Z() = f->GetData().m_vertices[2]->GetData().m_pos.Z(); - vol = ComputeVolume4(ver0, ver1, ver2, pos0); - if (vol < -sc_eps) { - vol = fabs(vol); - totalVolume += vol; - if (markVisibleFaces) { - f->GetData().m_visible = true; - m_trianglesToDelete.PushBack(f); - } - visible = true; - } - f = f->GetNext(); - } while (f != fHead); - - if (m_trianglesToDelete.Size() == m_mesh.m_triangles.GetSize()) { - for (size_t i = 0; i < m_trianglesToDelete.Size(); i++) { - m_trianglesToDelete[i]->GetData().m_visible = false; - } - visible = false; - } - // if no faces visible from p then p is inside the hull - if (!visible && markVisibleFaces) { - vertices.Delete(); - m_trianglesToDelete.Resize(0); - return false; - } - return true; - } - bool ICHull::ProcessPoint() - { - double totalVolume = 0.0; - if (!ComputePointVolume(totalVolume, true)) { - return false; - } - // Mark edges in interior of visible region for deletion. - // Create a new face based on each border edge - CircularListElement* v0 = m_mesh.GetVertices().GetHead(); - CircularListElement* eHead = m_mesh.GetEdges().GetHead(); - CircularListElement* e = eHead; - CircularListElement* tmp = 0; - int32_t nvisible = 0; - m_edgesToDelete.Resize(0); - m_edgesToUpdate.Resize(0); - do { - tmp = e->GetNext(); - nvisible = 0; - for (int32_t k = 0; k < 2; ++k) { - if (e->GetData().m_triangles[k]->GetData().m_visible) { - nvisible++; - } - } - if (nvisible == 2) { - m_edgesToDelete.PushBack(e); - } - else if (nvisible == 1) { - e->GetData().m_newFace = MakeConeFace(e, v0); - m_edgesToUpdate.PushBack(e); - } - e = tmp; - } while (e != eHead); - return true; - } - bool ICHull::MakeCCW(CircularListElement* f, - CircularListElement* e, - CircularListElement* v) - { - // the visible face adjacent to e - CircularListElement* fv; - if (e->GetData().m_triangles[0]->GetData().m_visible) { - fv = e->GetData().m_triangles[0]; - } - else { - fv = e->GetData().m_triangles[1]; - } - - // set vertex[0] and vertex[1] to have the same orientation as the corresponding vertices of fv. - int32_t i; // index of e->m_vertices[0] in fv - CircularListElement* v0 = e->GetData().m_vertices[0]; - CircularListElement* v1 = e->GetData().m_vertices[1]; - for (i = 0; fv->GetData().m_vertices[i] != v0; i++) - ; - - if (fv->GetData().m_vertices[(i + 1) % 3] != e->GetData().m_vertices[1]) { - f->GetData().m_vertices[0] = v1; - f->GetData().m_vertices[1] = v0; - } - else { - f->GetData().m_vertices[0] = v0; - f->GetData().m_vertices[1] = v1; - // swap edges - CircularListElement* tmp = f->GetData().m_edges[0]; - f->GetData().m_edges[0] = f->GetData().m_edges[1]; - f->GetData().m_edges[1] = tmp; - } - f->GetData().m_vertices[2] = v; - return true; - } - bool ICHull::CleanUp(uint32_t& addedPoints) - { - bool r0 = CleanEdges(); - bool r1 = CleanTriangles(); - bool r2 = CleanVertices(addedPoints); - return r0 && r1 && r2; - } - bool ICHull::CleanEdges() - { - // integrate the new faces into the data structure - CircularListElement* e; - const size_t ne_update = m_edgesToUpdate.Size(); - for (size_t i = 0; i < ne_update; ++i) { - e = m_edgesToUpdate[i]; - if (e->GetData().m_newFace) { - if (e->GetData().m_triangles[0]->GetData().m_visible) { - e->GetData().m_triangles[0] = e->GetData().m_newFace; - } - else { - e->GetData().m_triangles[1] = e->GetData().m_newFace; - } - e->GetData().m_newFace = 0; - } - } - // delete edges maked for deletion - CircularList& edges = m_mesh.GetEdges(); - const size_t ne_delete = m_edgesToDelete.Size(); - for (size_t i = 0; i < ne_delete; ++i) { - edges.Delete(m_edgesToDelete[i]); - } - m_edgesToDelete.Resize(0); - m_edgesToUpdate.Resize(0); - return true; - } - bool ICHull::CleanTriangles() - { - CircularList& triangles = m_mesh.GetTriangles(); - const size_t nt_delete = m_trianglesToDelete.Size(); - for (size_t i = 0; i < nt_delete; ++i) { - triangles.Delete(m_trianglesToDelete[i]); - } - m_trianglesToDelete.Resize(0); - return true; - } - bool ICHull::CleanVertices(uint32_t& addedPoints) - { - // mark all vertices incident to some undeleted edge as on the hull - CircularList& edges = m_mesh.GetEdges(); - CircularListElement* e = edges.GetHead(); - size_t nE = edges.GetSize(); - for (size_t i = 0; i < nE; i++) { - e->GetData().m_vertices[0]->GetData().m_onHull = true; - e->GetData().m_vertices[1]->GetData().m_onHull = true; - e = e->GetNext(); - } - // delete all the vertices that have been processed but are not on the hull - CircularList& vertices = m_mesh.GetVertices(); - CircularListElement* vHead = vertices.GetHead(); - CircularListElement* v = vHead; - v = v->GetPrev(); - do { - if (v->GetData().m_tag && !v->GetData().m_onHull) { - CircularListElement* tmp = v->GetPrev(); - vertices.Delete(v); - v = tmp; - addedPoints--; - } - else { - v->GetData().m_duplicate = 0; - v->GetData().m_onHull = false; - v = v->GetPrev(); - } - } while (v->GetData().m_tag && v != vHead); - return true; - } - void ICHull::Clear() - { - m_mesh.Clear(); - m_edgesToDelete.Resize(0); - m_edgesToUpdate.Resize(0); - m_trianglesToDelete.Resize(0); - m_isFlat = false; - } - const ICHull& ICHull::operator=(ICHull& rhs) - { - if (&rhs != this) { - m_mesh.Copy(rhs.m_mesh); - m_edgesToDelete = rhs.m_edgesToDelete; - m_edgesToUpdate = rhs.m_edgesToUpdate; - m_trianglesToDelete = rhs.m_trianglesToDelete; - m_isFlat = rhs.m_isFlat; - } - return (*this); - } - bool ICHull::IsInside(const Vec3& pt0, const double eps) - { - const Vec3 pt(pt0.X(), pt0.Y(), pt0.Z()); - if (m_isFlat) { - size_t nT = m_mesh.m_triangles.GetSize(); - Vec3 ver0, ver1, ver2, a, b, c; - double u, v; - for (size_t t = 0; t < nT; t++) { - ver0.X() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[0]->GetData().m_pos.X(); - ver0.Y() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[0]->GetData().m_pos.Y(); - ver0.Z() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[0]->GetData().m_pos.Z(); - ver1.X() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[1]->GetData().m_pos.X(); - ver1.Y() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[1]->GetData().m_pos.Y(); - ver1.Z() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[1]->GetData().m_pos.Z(); - ver2.X() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[2]->GetData().m_pos.X(); - ver2.Y() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[2]->GetData().m_pos.Y(); - ver2.Z() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[2]->GetData().m_pos.Z(); - a = ver1 - ver0; - b = ver2 - ver0; - c = pt - ver0; - u = c * a; - v = c * b; - if (u >= 0.0 && u <= 1.0 && v >= 0.0 && u + v <= 1.0) { - return true; - } - m_mesh.m_triangles.Next(); - } - return false; - } - else { - size_t nT = m_mesh.m_triangles.GetSize(); - Vec3 ver0, ver1, ver2; - double vol; - for (size_t t = 0; t < nT; t++) { - ver0.X() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[0]->GetData().m_pos.X(); - ver0.Y() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[0]->GetData().m_pos.Y(); - ver0.Z() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[0]->GetData().m_pos.Z(); - ver1.X() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[1]->GetData().m_pos.X(); - ver1.Y() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[1]->GetData().m_pos.Y(); - ver1.Z() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[1]->GetData().m_pos.Z(); - ver2.X() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[2]->GetData().m_pos.X(); - ver2.Y() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[2]->GetData().m_pos.Y(); - ver2.Z() = m_mesh.m_triangles.GetHead()->GetData().m_vertices[2]->GetData().m_pos.Z(); - vol = ComputeVolume4(ver0, ver1, ver2, pt); - if (vol < eps) { - return false; - } - m_mesh.m_triangles.Next(); - } - return true; - } - } - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdManifoldMesh.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdManifoldMesh.cpp deleted file mode 100644 index 3fd84fd91f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdManifoldMesh.cpp +++ /dev/null @@ -1,198 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include "vhacdManifoldMesh.h" -namespace nd_ -{ - namespace VHACD - { - TMMVertex::TMMVertex(void) - { - Initialize(); - } - void TMMVertex::Initialize() - { - m_name = 0; - m_id = 0; - m_duplicate = 0; - m_onHull = false; - m_tag = false; - } - - TMMEdge::TMMEdge(void) - { - Initialize(); - } - void TMMEdge::Initialize() - { - m_id = 0; - m_triangles[0] = m_triangles[1] = m_newFace = 0; - m_vertices[0] = m_vertices[1] = 0; - } - - void TMMTriangle::Initialize() - { - m_id = 0; - for (int32_t i = 0; i < 3; i++) { - m_edges[i] = 0; - m_vertices[0] = 0; - } - m_visible = false; - } - TMMTriangle::TMMTriangle(void) - { - Initialize(); - } - TMMesh::TMMesh() - { - } - TMMesh::~TMMesh(void) - { - } - void TMMesh::GetIFS(Vec3* const points, Vec3* const triangles) - { - size_t nV = m_vertices.GetSize(); - size_t nT = m_triangles.GetSize(); - - for (size_t v = 0; v < nV; v++) { - points[v] = m_vertices.GetData().m_pos; - m_vertices.GetData().m_id = v; - m_vertices.Next(); - } - for (size_t f = 0; f < nT; f++) { - TMMTriangle& currentTriangle = m_triangles.GetData(); - triangles[f].X() = static_cast(currentTriangle.m_vertices[0]->GetData().m_id); - triangles[f].Y() = static_cast(currentTriangle.m_vertices[1]->GetData().m_id); - triangles[f].Z() = static_cast(currentTriangle.m_vertices[2]->GetData().m_id); - m_triangles.Next(); - } - } - void TMMesh::Clear() - { - m_vertices.Clear(); - m_edges.Clear(); - m_triangles.Clear(); - } - void TMMesh::Copy(TMMesh& mesh) - { - Clear(); - // updating the id's - size_t nV = mesh.m_vertices.GetSize(); - size_t nE = mesh.m_edges.GetSize(); - size_t nT = mesh.m_triangles.GetSize(); - for (size_t v = 0; v < nV; v++) { - mesh.m_vertices.GetData().m_id = v; - mesh.m_vertices.Next(); - } - for (size_t e = 0; e < nE; e++) { - mesh.m_edges.GetData().m_id = e; - mesh.m_edges.Next(); - } - for (size_t f = 0; f < nT; f++) { - mesh.m_triangles.GetData().m_id = f; - mesh.m_triangles.Next(); - } - // copying data - m_vertices = mesh.m_vertices; - m_edges = mesh.m_edges; - m_triangles = mesh.m_triangles; - - // generate mapping - CircularListElement** vertexMap = new CircularListElement*[nV]; - CircularListElement** edgeMap = new CircularListElement*[nE]; - CircularListElement** triangleMap = new CircularListElement*[nT]; - for (size_t v = 0; v < nV; v++) { - vertexMap[v] = m_vertices.GetHead(); - m_vertices.Next(); - } - for (size_t e = 0; e < nE; e++) { - edgeMap[e] = m_edges.GetHead(); - m_edges.Next(); - } - for (size_t f = 0; f < nT; f++) { - triangleMap[f] = m_triangles.GetHead(); - m_triangles.Next(); - } - - // updating pointers - for (size_t v = 0; v < nV; v++) { - if (vertexMap[v]->GetData().m_duplicate) { - vertexMap[v]->GetData().m_duplicate = edgeMap[vertexMap[v]->GetData().m_duplicate->GetData().m_id]; - } - } - for (size_t e = 0; e < nE; e++) { - if (edgeMap[e]->GetData().m_newFace) { - edgeMap[e]->GetData().m_newFace = triangleMap[edgeMap[e]->GetData().m_newFace->GetData().m_id]; - } - if (nT > 0) { - for (int32_t f = 0; f < 2; f++) { - if (edgeMap[e]->GetData().m_triangles[f]) { - edgeMap[e]->GetData().m_triangles[f] = triangleMap[edgeMap[e]->GetData().m_triangles[f]->GetData().m_id]; - } - } - } - for (int32_t v = 0; v < 2; v++) { - if (edgeMap[e]->GetData().m_vertices[v]) { - edgeMap[e]->GetData().m_vertices[v] = vertexMap[edgeMap[e]->GetData().m_vertices[v]->GetData().m_id]; - } - } - } - for (size_t f = 0; f < nT; f++) { - if (nE > 0) { - for (int32_t e = 0; e < 3; e++) { - if (triangleMap[f]->GetData().m_edges[e]) { - triangleMap[f]->GetData().m_edges[e] = edgeMap[triangleMap[f]->GetData().m_edges[e]->GetData().m_id]; - } - } - } - for (int32_t v = 0; v < 3; v++) { - if (triangleMap[f]->GetData().m_vertices[v]) { - triangleMap[f]->GetData().m_vertices[v] = vertexMap[triangleMap[f]->GetData().m_vertices[v]->GetData().m_id]; - } - } - } - delete[] vertexMap; - delete[] edgeMap; - delete[] triangleMap; - } - bool TMMesh::CheckConsistancy() - { - size_t nE = m_edges.GetSize(); - size_t nT = m_triangles.GetSize(); - for (size_t e = 0; e < nE; e++) { - for (int32_t f = 0; f < 2; f++) { - if (!m_edges.GetHead()->GetData().m_triangles[f]) { - return false; - } - } - m_edges.Next(); - } - for (size_t f = 0; f < nT; f++) { - for (int32_t e = 0; e < 3; e++) { - int32_t found = 0; - for (int32_t k = 0; k < 2; ++k) { - if (m_triangles.GetHead()->GetData().m_edges[e]->GetData().m_triangles[k] == m_triangles.GetHead()) { - found++; - } - } - if (found != 1) { - return false; - } - } - m_triangles.Next(); - } - return true; - } - } -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdMesh.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdMesh.cpp deleted file mode 100644 index aaca92f18e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdMesh.cpp +++ /dev/null @@ -1,322 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "vhacdMesh.h" -#include "FloatMath.h" -#include -#include -#include -#include -#include -#include -#include "vhacdConvexHull.h" - -namespace nd_ -{ - namespace VHACD - { - Mesh::Mesh() - { - } - Mesh::~Mesh() - { - } - - Mesh::Mesh(const Mesh& src) - { - size_t nV = src.m_points.Size(); - size_t nT = src.m_triangles.Size(); - for (size_t v = 0; v < nV; v++) - { - m_points.PushBack(src.m_points[v]); - } - for (size_t f = 0; f < nT; f++) - { - m_triangles.PushBack(src.m_triangles[f]); - } - } - - double Mesh::ComputeVolume() const - { - const size_t nV = GetNPoints(); - const size_t nT = GetNTriangles(); - if (nV == 0 || nT == 0) { - return 0.0; - } - - Vec3 bary(0.0, 0.0, 0.0); - for (size_t v = 0; v < nV; v++) { - bary += GetPoint(v); - } - bary /= static_cast(nV); - - Vec3 ver0, ver1, ver2; - double totalVolume = 0.0; - for (size_t t = 0; t < nT; t++) { - const Vec3& tri = GetTriangle(t); - ver0 = GetPoint(size_t(tri[0])); - ver1 = GetPoint(size_t(tri[1])); - ver2 = GetPoint(size_t(tri[2])); - totalVolume += ComputeVolume4(ver0, ver1, ver2, bary); - } - return totalVolume / 6.0; - } - - void Mesh::ComputeConvexHull(const double* const pts, const size_t nPts) - { - ResizePoints(0); - ResizeTriangles(0); - ConvexHull ch(pts, 3 * sizeof(double), (int32_t)nPts, 1.0e-5f); - - const std::vector& convexPoints = ch.GetVertexPool(); - for (size_t v = 0; v < convexPoints.size(); v++) { - AddPoint(convexPoints[v]); - } - - for (ConvexHull::ndNode* node = ch.GetFirst(); node; node = node->GetNext()) - { - ConvexHullFace* const face = &node->GetInfo(); - AddTriangle(Vec3(face->m_index[0], face->m_index[1], face->m_index[2])); - } - } - - void Mesh::Clip(const Plane& plane, - SArray >& positivePart, - SArray >& negativePart) const - { - const size_t nV = GetNPoints(); - if (nV == 0) { - return; - } - double d; - for (size_t v = 0; v < nV; v++) { - const Vec3& pt = GetPoint(v); - d = plane.m_a * pt[0] + plane.m_b * pt[1] + plane.m_c * pt[2] + plane.m_d; - if (d > 0.0) { - positivePart.PushBack(pt); - } - else if (d < 0.0) { - negativePart.PushBack(pt); - } - else { - positivePart.PushBack(pt); - negativePart.PushBack(pt); - } - } - } - bool Mesh::IsInside(const Vec3& pt) const - { - const size_t nV = GetNPoints(); - const size_t nT = GetNTriangles(); - if (nV == 0 || nT == 0) { - return false; - } - Vec3 ver0, ver1, ver2; - double volume; - for (size_t t = 0; t < nT; t++) { - const Vec3& tri = GetTriangle(t); - ver0 = GetPoint(size_t(tri[0])); - ver1 = GetPoint(size_t(tri[1])); - ver2 = GetPoint(size_t(tri[2])); - volume = ComputeVolume4(ver0, ver1, ver2, pt); - if (volume < 0.0) { - return false; - } - } - return true; - } - - void Mesh::CalculateBoundingBox(Vec3& p0, Vec3& p1) const - { - Vec3 bmin(m_points[0]); - Vec3 bmax(m_points[1]); - for (uint32_t i = 1; i < m_points.Size(); i++) - { - const Vec3& p = m_points[i]; - p.UpdateMinMax(bmin, bmax); - } - p0 = bmin; - p1 = bmax; - } - - #ifdef VHACD_DEBUG_MESH - bool Mesh::SaveVRML2(const std::string& fileName) const - { - std::ofstream fout(fileName.c_str()); - if (fout.is_open()) { - const Material material; - - if (SaveVRML2(fout, material)) { - fout.close(); - return true; - } - return false; - } - return false; - } - bool Mesh::SaveVRML2(std::ofstream& fout, const Material& material) const - { - if (fout.is_open()) { - fout.setf(std::ios::fixed, std::ios::floatfield); - fout.setf(std::ios::showpoint); - fout.precision(6); - size_t nV = m_points.Size(); - size_t nT = m_triangles.Size(); - fout << "#VRML V2.0 utf8" << std::endl; - fout << "" << std::endl; - fout << "# Vertices: " << nV << std::endl; - fout << "# Triangles: " << nT << std::endl; - fout << "" << std::endl; - fout << "Group {" << std::endl; - fout << " children [" << std::endl; - fout << " Shape {" << std::endl; - fout << " appearance Appearance {" << std::endl; - fout << " material Material {" << std::endl; - fout << " diffuseColor " << material.m_diffuseColor[0] << " " - << material.m_diffuseColor[1] << " " - << material.m_diffuseColor[2] << std::endl; - fout << " ambientIntensity " << material.m_ambientIntensity << std::endl; - fout << " specularColor " << material.m_specularColor[0] << " " - << material.m_specularColor[1] << " " - << material.m_specularColor[2] << std::endl; - fout << " emissiveColor " << material.m_emissiveColor[0] << " " - << material.m_emissiveColor[1] << " " - << material.m_emissiveColor[2] << std::endl; - fout << " shininess " << material.m_shininess << std::endl; - fout << " transparency " << material.m_transparency << std::endl; - fout << " }" << std::endl; - fout << " }" << std::endl; - fout << " geometry IndexedFaceSet {" << std::endl; - fout << " ccw TRUE" << std::endl; - fout << " solid TRUE" << std::endl; - fout << " convex TRUE" << std::endl; - if (nV > 0) { - fout << " coord DEF co Coordinate {" << std::endl; - fout << " point [" << std::endl; - for (size_t v = 0; v < nV; v++) { - fout << " " << m_points[v][0] << " " - << m_points[v][1] << " " - << m_points[v][2] << "," << std::endl; - } - fout << " ]" << std::endl; - fout << " }" << std::endl; - } - if (nT > 0) { - fout << " coordIndex [ " << std::endl; - for (size_t f = 0; f < nT; f++) { - fout << " " << m_triangles[f][0] << ", " - << m_triangles[f][1] << ", " - << m_triangles[f][2] << ", -1," << std::endl; - } - fout << " ]" << std::endl; - } - fout << " }" << std::endl; - fout << " }" << std::endl; - fout << " ]" << std::endl; - fout << "}" << std::endl; - return true; - } - return false; - } - bool Mesh::SaveOFF(const std::string& fileName) const - { - std::ofstream fout(fileName.c_str()); - if (fout.is_open()) { - size_t nV = m_points.Size(); - size_t nT = m_triangles.Size(); - fout << "OFF" << std::endl; - fout << nV << " " << nT << " " << 0 << std::endl; - for (size_t v = 0; v < nV; v++) { - fout << m_points[v][0] << " " - << m_points[v][1] << " " - << m_points[v][2] << std::endl; - } - for (size_t f = 0; f < nT; f++) { - fout << "3 " << m_triangles[f][0] << " " - << m_triangles[f][1] << " " - << m_triangles[f][2] << std::endl; - } - fout.close(); - return true; - } - return false; - } - - bool Mesh::LoadOFF(const std::string& fileName, bool invert) - { - int ret = 0; - ret++; - FILE* fid = fopen(fileName.c_str(), "r"); - if (fid) { - const std::string strOFF("OFF"); - char temp[1024]; - ret = fscanf(fid, "%s", temp); - if (std::string(temp) != strOFF) { - fclose(fid); - return false; - } - else { - int32_t nv = 0; - int32_t nf = 0; - int32_t ne = 0; - ret = fscanf(fid, "%i", &nv); - ret = fscanf(fid, "%i", &nf); - ret = fscanf(fid, "%i", &ne); - m_points.Resize(size_t(nv)); - m_triangles.Resize(size_t(nf)); - Vec3 coord; - float x, y, z; - for (int32_t p = 0; p < nv; p++) { - ret = fscanf(fid, "%f", &x); - ret = fscanf(fid, "%f", &y); - ret = fscanf(fid, "%f", &z); - m_points[size_t(p)][0] = x; - m_points[size_t(p)][1] = y; - m_points[size_t(p)][2] = z; - } - int32_t i, j, k, s; - for (size_t t = 0; t < size_t(nf); ++t) { - ret = fscanf(fid, "%i", &s); - if (s == 3) { - ret = fscanf(fid, "%i", &i); - ret = fscanf(fid, "%i", &j); - ret = fscanf(fid, "%i", &k); - m_triangles[t][0] = i; - if (invert) { - m_triangles[t][1] = k; - m_triangles[t][2] = j; - } - else { - m_triangles[t][1] = j; - m_triangles[t][2] = k; - } - } - else // Fix me: support only triangular meshes - { - for (int32_t h = 0; h < s; ++h) - ret = fscanf(fid, "%i", &s); - } - } - fclose(fid); - } - } - else { - return false; - } - return true; - } - #endif // VHACD_DEBUG_MESH - } -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdRaycastMesh.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdRaycastMesh.cpp deleted file mode 100644 index 1231906e8e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdRaycastMesh.cpp +++ /dev/null @@ -1,209 +0,0 @@ -#include "vhacdRaycastMesh.h" -#include -#include - -namespace nd_ -{ - namespace RAYCAST_MESH - { - /* a = b - c */ - #define vector(a,b,c) \ - (a)[0] = (b)[0] - (c)[0]; \ - (a)[1] = (b)[1] - (c)[1]; \ - (a)[2] = (b)[2] - (c)[2]; - - #define innerProduct(v,q) \ - ((v)[0] * (q)[0] + \ - (v)[1] * (q)[1] + \ - (v)[2] * (q)[2]) - - #define crossProduct(a,b,c) \ - (a)[0] = (b)[1] * (c)[2] - (c)[1] * (b)[2]; \ - (a)[1] = (b)[2] * (c)[0] - (c)[2] * (b)[0]; \ - (a)[2] = (b)[0] * (c)[1] - (c)[0] * (b)[1]; - - static inline bool rayIntersectsTriangle(const double *p, const double *d, const double *v0, const double *v1, const double *v2, double &t) - { - double e1[3], e2[3], h[3], s[3], q[3]; - double a, f, u, v; - - vector(e1, v1, v0); - vector(e2, v2, v0); - crossProduct(h, d, e2); - a = innerProduct(e1, h); - - if (a > -0.00001 && a < 0.00001) - return(false); - - f = 1 / a; - vector(s, p, v0); - u = f * (innerProduct(s, h)); - - if (u < 0.0 || u > 1.0) - return(false); - - crossProduct(q, s, e1); - v = f * innerProduct(d, q); - if (v < 0.0 || u + v > 1.0) - return(false); - // at this stage we can compute t to find out where - // the intersection point is on the line - t = f * innerProduct(e2, q); - if (t > 0) // ray intersection - return(true); - else // this means that there is a line intersection - // but not a ray intersection - return (false); - } - - static double getPointDistance(const double *p1, const double *p2) - { - double dx = p1[0] - p2[0]; - double dy = p1[1] - p2[1]; - double dz = p1[2] - p2[2]; - return sqrt(dx*dx + dy*dy + dz*dz); - } - - class MyRaycastMesh : public VHACD::RaycastMesh - { - public: - - template - MyRaycastMesh(uint32_t vcount, - const T *vertices, - uint32_t tcount, - const uint32_t *indices) - { - mVcount = vcount; - mVertices = new double[mVcount * 3]; - for (uint32_t i = 0; i < mVcount; i++) - { - mVertices[i * 3 + 0] = vertices[0]; - mVertices[i * 3 + 1] = vertices[1]; - mVertices[i * 3 + 2] = vertices[2]; - vertices += 3; - } - mTcount = tcount; - mIndices = new uint32_t[mTcount * 3]; - for (uint32_t i = 0; i < mTcount; i++) - { - mIndices[i * 3 + 0] = indices[0]; - mIndices[i * 3 + 1] = indices[1]; - mIndices[i * 3 + 2] = indices[2]; - indices += 3; - } - } - - - ~MyRaycastMesh(void) - { - delete[]mVertices; - delete[]mIndices; - } - - virtual void release(void) - { - delete this; - } - - virtual bool raycast(const double *from, // The starting point of the raycast - const double *to, // The ending point of the raycast - const double *closestToPoint, // The point to match the nearest hit location (can just be the 'from' location of no specific point) - double *hitLocation, // The point where the ray hit nearest to the 'closestToPoint' location - double *hitDistance) final // The distance the ray traveled to the hit location - { - bool ret = false; - - double dir[3]; - - dir[0] = to[0] - from[0]; - dir[1] = to[1] - from[1]; - dir[2] = to[2] - from[2]; - - double distance = sqrt(dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2]); - if (distance < 0.0000000001f) return false; - double recipDistance = 1.0f / distance; - dir[0] *= recipDistance; - dir[1] *= recipDistance; - dir[2] *= recipDistance; - const uint32_t *indices = mIndices; - const double *vertices = mVertices; - double nearestDistance = distance; - - for (uint32_t tri = 0; tri < mTcount; tri++) - { - uint32_t i1 = indices[tri * 3 + 0]; - uint32_t i2 = indices[tri * 3 + 1]; - uint32_t i3 = indices[tri * 3 + 2]; - - const double *p1 = &vertices[i1 * 3]; - const double *p2 = &vertices[i2 * 3]; - const double *p3 = &vertices[i3 * 3]; - - double t; - if (rayIntersectsTriangle(from, dir, p1, p2, p3, t)) - { - double hitPos[3]; - - hitPos[0] = from[0] + dir[0] * t; - hitPos[1] = from[1] + dir[1] * t; - hitPos[2] = from[2] + dir[2] * t; - - double pointDistance = getPointDistance(hitPos, closestToPoint); - - if (pointDistance < nearestDistance) - { - nearestDistance = pointDistance; - if (hitLocation) - { - hitLocation[0] = hitPos[0]; - hitLocation[1] = hitPos[1]; - hitLocation[2] = hitPos[2]; - } - if (hitDistance) - { - *hitDistance = pointDistance; - } - ret = true; - } - } - } - return ret; - } - - uint32_t mVcount; - double *mVertices; - uint32_t mTcount; - uint32_t *mIndices; - }; - - }; - - - - using namespace RAYCAST_MESH; - - namespace VHACD - { - - RaycastMesh * RaycastMesh::createRaycastMesh(uint32_t vcount, // The number of vertices in the source triangle mesh - const double *vertices, // The array of vertex positions in the format x1,y1,z1..x2,y2,z2.. etc. - uint32_t tcount, // The number of triangles in the source triangle mesh - const uint32_t *indices) // The triangle indices in the format of i1,i2,i3 ... i4,i5,i6, ... - { - MyRaycastMesh *m = new MyRaycastMesh(vcount, vertices, tcount, indices); - return static_cast(m); - } - - RaycastMesh * RaycastMesh::createRaycastMesh(uint32_t vcount, // The number of vertices in the source triangle mesh - const float *vertices, // The array of vertex positions in the format x1,y1,z1..x2,y2,z2.. etc. - uint32_t tcount, // The number of triangles in the source triangle mesh - const uint32_t *indices) // The triangle indices in the format of i1,i2,i3 ... i4,i5,i6, ... - { - MyRaycastMesh *m = new MyRaycastMesh(vcount, vertices, tcount, indices); - return static_cast(m); - } - - - } // end of VHACD namespace -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdVolume.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdVolume.cpp deleted file mode 100644 index 54829a87c4..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/hacd/src/VHACD_Lib/src/vhacdVolume.cpp +++ /dev/null @@ -1,1650 +0,0 @@ -/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com) - All rights reserved. - - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "vhacdVolume.h" -#include -#include -#include -#include -#include -#include "vhacdConvexHull.h" - -namespace nd_ -{ - namespace VHACD - { - /********************************************************/ - /* AABB-triangle overlap test code */ - /* by Tomas Akenine-M�ller */ - /* Function: int32_t triBoxOverlap(float boxcenter[3], */ - /* float boxhalfsize[3],float triverts[3][3]); */ - /* History: */ - /* 2001-03-05: released the code in its first version */ - /* 2001-06-18: changed the order of the tests, faster */ - /* */ - /* Acknowledgement: Many thanks to Pierre Terdiman for */ - /* suggestions and discussions on how to optimize code. */ - /* Thanks to David Hunt for finding a ">="-bug! */ - /********************************************************/ - - #define X 0 - #define Y 1 - #define Z 2 - #define FINDMINMAX(x0, x1, x2, min, max) \ - min = max = x0; \ - if (x1 < min) \ - min = x1; \ - if (x1 > max) \ - max = x1; \ - if (x2 < min) \ - min = x2; \ - if (x2 > max) \ - max = x2; - - #define AXISTEST_X01(a, b, fa, fb) \ - p0 = a * v0[Y] - b * v0[Z]; \ - p2 = a * v2[Y] - b * v2[Z]; \ - if (p0 < p2) { \ - min = p0; \ - max = p2; \ - } \ - else { \ - min = p2; \ - max = p0; \ - } \ - rad = fa * boxhalfsize[Y] + fb * boxhalfsize[Z]; \ - if (min > rad || max < -rad) \ - return 0; - - #define AXISTEST_X2(a, b, fa, fb) \ - p0 = a * v0[Y] - b * v0[Z]; \ - p1 = a * v1[Y] - b * v1[Z]; \ - if (p0 < p1) { \ - min = p0; \ - max = p1; \ - } \ - else { \ - min = p1; \ - max = p0; \ - } \ - rad = fa * boxhalfsize[Y] + fb * boxhalfsize[Z]; \ - if (min > rad || max < -rad) \ - return 0; - - #define AXISTEST_Y02(a, b, fa, fb) \ - p0 = -a * v0[X] + b * v0[Z]; \ - p2 = -a * v2[X] + b * v2[Z]; \ - if (p0 < p2) { \ - min = p0; \ - max = p2; \ - } \ - else { \ - min = p2; \ - max = p0; \ - } \ - rad = fa * boxhalfsize[X] + fb * boxhalfsize[Z]; \ - if (min > rad || max < -rad) \ - return 0; - - #define AXISTEST_Y1(a, b, fa, fb) \ - p0 = -a * v0[X] + b * v0[Z]; \ - p1 = -a * v1[X] + b * v1[Z]; \ - if (p0 < p1) { \ - min = p0; \ - max = p1; \ - } \ - else { \ - min = p1; \ - max = p0; \ - } \ - rad = fa * boxhalfsize[X] + fb * boxhalfsize[Z]; \ - if (min > rad || max < -rad) \ - return 0; - - #define AXISTEST_Z12(a, b, fa, fb) \ - p1 = a * v1[X] - b * v1[Y]; \ - p2 = a * v2[X] - b * v2[Y]; \ - if (p2 < p1) { \ - min = p2; \ - max = p1; \ - } \ - else { \ - min = p1; \ - max = p2; \ - } \ - rad = fa * boxhalfsize[X] + fb * boxhalfsize[Y]; \ - if (min > rad || max < -rad) \ - return 0; - - #define AXISTEST_Z0(a, b, fa, fb) \ - p0 = a * v0[X] - b * v0[Y]; \ - p1 = a * v1[X] - b * v1[Y]; \ - if (p0 < p1) { \ - min = p0; \ - max = p1; \ - } \ - else { \ - min = p1; \ - max = p0; \ - } \ - rad = fa * boxhalfsize[X] + fb * boxhalfsize[Y]; \ - if (min > rad || max < -rad) \ - return 0; - - int32_t PlaneBoxOverlap(const Vec3& normal, - const Vec3& vert, - const Vec3& maxbox) - { - size_t q; - Vec3 vmin, vmax; - double v; - for (q = X; q <= Z; q++) { - v = vert[q]; - if (normal[q] > 0.0) { - vmin[q] = -maxbox[q] - v; - vmax[q] = maxbox[q] - v; - } - else { - vmin[q] = maxbox[q] - v; - vmax[q] = -maxbox[q] - v; - } - } - if (normal * vmin > 0.0) - return 0; - if (normal * vmax >= 0.0) - return 1; - return 0; - } - - int32_t TriBoxOverlap(const Vec3& boxcenter, - const Vec3& boxhalfsize, - const Vec3& triver0, - const Vec3& triver1, - const Vec3& triver2) - { - /* use separating axis theorem to test overlap between triangle and box */ - /* need to test for overlap in these directions: */ - /* 1) the {x,y,z}-directions (actually, since we use the AABB of the triangle */ - /* we do not even need to test these) */ - /* 2) normal of the triangle */ - /* 3) crossproduct(edge from tri, {x,y,z}-directin) */ - /* this gives 3x3=9 more tests */ - - Vec3 v0, v1, v2; - double min, max, p0, p1, p2, rad, fex, fey, fez; // -NJMP- "d" local variable removed - Vec3 normal, e0, e1, e2; - - /* This is the fastest branch on Sun */ - /* move everything so that the boxcenter is in (0,0,0) */ - - v0 = triver0 - boxcenter; - v1 = triver1 - boxcenter; - v2 = triver2 - boxcenter; - - /* compute triangle edges */ - e0 = v1 - v0; /* tri edge 0 */ - e1 = v2 - v1; /* tri edge 1 */ - e2 = v0 - v2; /* tri edge 2 */ - - /* Bullet 3: */ - /* test the 9 tests first (this was faster) */ - fex = fabs(e0[X]); - fey = fabs(e0[Y]); - fez = fabs(e0[Z]); - - AXISTEST_X01(e0[Z], e0[Y], fez, fey); - AXISTEST_Y02(e0[Z], e0[X], fez, fex); - AXISTEST_Z12(e0[Y], e0[X], fey, fex); - - fex = fabs(e1[X]); - fey = fabs(e1[Y]); - fez = fabs(e1[Z]); - - AXISTEST_X01(e1[Z], e1[Y], fez, fey); - AXISTEST_Y02(e1[Z], e1[X], fez, fex); - AXISTEST_Z0(e1[Y], e1[X], fey, fex); - - fex = fabs(e2[X]); - fey = fabs(e2[Y]); - fez = fabs(e2[Z]); - - AXISTEST_X2(e2[Z], e2[Y], fez, fey); - AXISTEST_Y1(e2[Z], e2[X], fez, fex); - AXISTEST_Z12(e2[Y], e2[X], fey, fex); - - /* Bullet 1: */ - /* first test overlap in the {x,y,z}-directions */ - /* find min, max of the triangle each direction, and test for overlap in */ - /* that direction -- this is equivalent to testing a minimal AABB around */ - /* the triangle against the AABB */ - - /* test in X-direction */ - FINDMINMAX(v0[X], v1[X], v2[X], min, max); - if (min > boxhalfsize[X] || max < -boxhalfsize[X]) - return 0; - - /* test in Y-direction */ - FINDMINMAX(v0[Y], v1[Y], v2[Y], min, max); - if (min > boxhalfsize[Y] || max < -boxhalfsize[Y]) - return 0; - - /* test in Z-direction */ - FINDMINMAX(v0[Z], v1[Z], v2[Z], min, max); - if (min > boxhalfsize[Z] || max < -boxhalfsize[Z]) - return 0; - - /* Bullet 2: */ - /* test if the box intersects the plane of the triangle */ - /* compute plane equation of triangle: normal*x+d=0 */ - normal = e0 ^ e1; - - if (!PlaneBoxOverlap(normal, v0, boxhalfsize)) - return 0; - return 1; /* box and triangle overlaps */ - } - - // Slightly modified version of Stan Melax's code for 3x3 matrix diagonalization (Thanks Stan!) - // source: http://www.melax.com/diag.html?attredirects=0 - void Diagonalize(const double (&A)[3][3], double (&Q)[3][3], double (&D)[3][3]) - { - // A must be a symmetric matrix. - // returns Q and D such that - // Diagonal matrix D = QT * A * Q; and A = Q*D*QT - const int32_t maxsteps = 24; // certainly wont need that many. - int32_t k0, k1, k2; - double o[3], m[3]; - double q[4] = { 0.0, 0.0, 0.0, 1.0 }; - double jr[4]; - double sqw, sqx, sqy, sqz; - double tmp1, tmp2, mq; - double AQ[3][3]; - double thet, sgn, t, c; - for (int32_t i = 0; i < maxsteps; ++i) { - // quat to matrix - sqx = q[0] * q[0]; - sqy = q[1] * q[1]; - sqz = q[2] * q[2]; - sqw = q[3] * q[3]; - Q[0][0] = (sqx - sqy - sqz + sqw); - Q[1][1] = (-sqx + sqy - sqz + sqw); - Q[2][2] = (-sqx - sqy + sqz + sqw); - tmp1 = q[0] * q[1]; - tmp2 = q[2] * q[3]; - Q[1][0] = 2.0 * (tmp1 + tmp2); - Q[0][1] = 2.0 * (tmp1 - tmp2); - tmp1 = q[0] * q[2]; - tmp2 = q[1] * q[3]; - Q[2][0] = 2.0 * (tmp1 - tmp2); - Q[0][2] = 2.0 * (tmp1 + tmp2); - tmp1 = q[1] * q[2]; - tmp2 = q[0] * q[3]; - Q[2][1] = 2.0 * (tmp1 + tmp2); - Q[1][2] = 2.0 * (tmp1 - tmp2); - - // AQ = A * Q - AQ[0][0] = Q[0][0] * A[0][0] + Q[1][0] * A[0][1] + Q[2][0] * A[0][2]; - AQ[0][1] = Q[0][1] * A[0][0] + Q[1][1] * A[0][1] + Q[2][1] * A[0][2]; - AQ[0][2] = Q[0][2] * A[0][0] + Q[1][2] * A[0][1] + Q[2][2] * A[0][2]; - AQ[1][0] = Q[0][0] * A[0][1] + Q[1][0] * A[1][1] + Q[2][0] * A[1][2]; - AQ[1][1] = Q[0][1] * A[0][1] + Q[1][1] * A[1][1] + Q[2][1] * A[1][2]; - AQ[1][2] = Q[0][2] * A[0][1] + Q[1][2] * A[1][1] + Q[2][2] * A[1][2]; - AQ[2][0] = Q[0][0] * A[0][2] + Q[1][0] * A[1][2] + Q[2][0] * A[2][2]; - AQ[2][1] = Q[0][1] * A[0][2] + Q[1][1] * A[1][2] + Q[2][1] * A[2][2]; - AQ[2][2] = Q[0][2] * A[0][2] + Q[1][2] * A[1][2] + Q[2][2] * A[2][2]; - // D = Qt * AQ - D[0][0] = AQ[0][0] * Q[0][0] + AQ[1][0] * Q[1][0] + AQ[2][0] * Q[2][0]; - D[0][1] = AQ[0][0] * Q[0][1] + AQ[1][0] * Q[1][1] + AQ[2][0] * Q[2][1]; - D[0][2] = AQ[0][0] * Q[0][2] + AQ[1][0] * Q[1][2] + AQ[2][0] * Q[2][2]; - D[1][0] = AQ[0][1] * Q[0][0] + AQ[1][1] * Q[1][0] + AQ[2][1] * Q[2][0]; - D[1][1] = AQ[0][1] * Q[0][1] + AQ[1][1] * Q[1][1] + AQ[2][1] * Q[2][1]; - D[1][2] = AQ[0][1] * Q[0][2] + AQ[1][1] * Q[1][2] + AQ[2][1] * Q[2][2]; - D[2][0] = AQ[0][2] * Q[0][0] + AQ[1][2] * Q[1][0] + AQ[2][2] * Q[2][0]; - D[2][1] = AQ[0][2] * Q[0][1] + AQ[1][2] * Q[1][1] + AQ[2][2] * Q[2][1]; - D[2][2] = AQ[0][2] * Q[0][2] + AQ[1][2] * Q[1][2] + AQ[2][2] * Q[2][2]; - o[0] = D[1][2]; - o[1] = D[0][2]; - o[2] = D[0][1]; - m[0] = fabs(o[0]); - m[1] = fabs(o[1]); - m[2] = fabs(o[2]); - - k0 = (m[0] > m[1] && m[0] > m[2]) ? 0 : (m[1] > m[2]) ? 1 : 2; // index of largest element of offdiag - k1 = (k0 + 1) % 3; - k2 = (k0 + 2) % 3; - if (o[k0] == 0.0) { - break; // diagonal already - } - thet = (D[k2][k2] - D[k1][k1]) / (2.0 * o[k0]); - sgn = (thet > 0.0) ? 1.0 : -1.0; - thet *= sgn; // make it positive - t = sgn / (thet + ((thet < 1.E6) ? sqrt(thet * thet + 1.0) : thet)); // sign(T)/(|T|+sqrt(T^2+1)) - c = 1.0 / sqrt(t * t + 1.0); // c= 1/(t^2+1) , t=s/c - if (c == 1.0) { - break; // no room for improvement - reached machine precision. - } - jr[0] = jr[1] = jr[2] = jr[3] = 0.0; - jr[k0] = sgn * sqrt((1.0 - c) / 2.0); // using 1/2 angle identity sin(a/2) = sqrt((1-cos(a))/2) - jr[k0] *= -1.0; // since our quat-to-matrix convention was for v*M instead of M*v - jr[3] = sqrt(1.0 - jr[k0] * jr[k0]); - if (jr[3] == 1.0) { - break; // reached limits of floating point precision - } - q[0] = (q[3] * jr[0] + q[0] * jr[3] + q[1] * jr[2] - q[2] * jr[1]); - q[1] = (q[3] * jr[1] - q[0] * jr[2] + q[1] * jr[3] + q[2] * jr[0]); - q[2] = (q[3] * jr[2] + q[0] * jr[1] - q[1] * jr[0] + q[2] * jr[3]); - q[3] = (q[3] * jr[3] - q[0] * jr[0] - q[1] * jr[1] - q[2] * jr[2]); - mq = sqrt(q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]); - q[0] /= mq; - q[1] /= mq; - q[2] /= mq; - q[3] /= mq; - } - } - const double TetrahedronSet::EPS = 0.0000000000001; - VoxelSet::VoxelSet() - { - m_minBB[0] = m_minBB[1] = m_minBB[2] = 0.0; - m_minBBVoxels[0] = m_minBBVoxels[1] = m_minBBVoxels[2] = 0; - m_maxBBVoxels[0] = m_maxBBVoxels[1] = m_maxBBVoxels[2] = 1; - m_minBBPts[0] = m_minBBPts[1] = m_minBBPts[2] = 0; - m_maxBBPts[0] = m_maxBBPts[1] = m_maxBBPts[2] = 1; - m_barycenter[0] = m_barycenter[1] = m_barycenter[2] = 0; - m_barycenterPCA[0] = m_barycenterPCA[1] = m_barycenterPCA[2] = 0.0; - m_scale = 1.0; - m_unitVolume = 1.0; - m_numVoxelsOnSurface = 0; - m_numVoxelsInsideSurface = 0; - memset(m_Q, 0, sizeof(double) * 9); - memset(m_D, 0, sizeof(double) * 9); - } - VoxelSet::~VoxelSet(void) - { - } - void VoxelSet::ComputeBB() - { - const size_t nVoxels = m_voxels.Size(); - if (nVoxels == 0) - return; - for (size_t h = 0; h < 3; ++h) { - m_minBBVoxels[h] = m_voxels[0].m_coord[h]; - m_maxBBVoxels[h] = m_voxels[0].m_coord[h]; - } - Vec3 bary(0.0); - for (size_t p = 0; p < nVoxels; ++p) { - for (size_t h = 0; h < 3; ++h) { - bary[h] += m_voxels[p].m_coord[h]; - if (m_minBBVoxels[h] > m_voxels[p].m_coord[h]) - m_minBBVoxels[h] = m_voxels[p].m_coord[h]; - if (m_maxBBVoxels[h] < m_voxels[p].m_coord[h]) - m_maxBBVoxels[h] = m_voxels[p].m_coord[h]; - } - } - bary /= (double)nVoxels; - for (size_t h = 0; h < 3; ++h) { - m_minBBPts[h] = m_minBBVoxels[h] * m_scale + m_minBB[h]; - m_maxBBPts[h] = m_maxBBVoxels[h] * m_scale + m_minBB[h]; - m_barycenter[h] = (short)(bary[h] + 0.5); - } - } - void VoxelSet::ComputeConvexHull(Mesh& meshCH, const size_t sampling) const - { - const size_t nVoxels = m_voxels.Size(); - if (nVoxels == 0) - return; - - std::vector> points; - std::vector> cpoints; - size_t p = 0; - size_t s = 0; - short i, j, k; - while (p < nVoxels) - { - while (p < nVoxels) - { - if (m_voxels[p].m_data == PRIMITIVE_ON_SURFACE) - { - ++s; - if (s == sampling) { - s = 0; - i = m_voxels[p].m_coord[0]; - j = m_voxels[p].m_coord[1]; - k = m_voxels[p].m_coord[2]; - Vec3 p0((i - 0.5) * m_scale, (j - 0.5) * m_scale, (k - 0.5) * m_scale); - Vec3 p1((i + 0.5) * m_scale, (j - 0.5) * m_scale, (k - 0.5) * m_scale); - Vec3 p2((i + 0.5) * m_scale, (j + 0.5) * m_scale, (k - 0.5) * m_scale); - Vec3 p3((i - 0.5) * m_scale, (j + 0.5) * m_scale, (k - 0.5) * m_scale); - Vec3 p4((i - 0.5) * m_scale, (j - 0.5) * m_scale, (k + 0.5) * m_scale); - Vec3 p5((i + 0.5) * m_scale, (j - 0.5) * m_scale, (k + 0.5) * m_scale); - Vec3 p6((i + 0.5) * m_scale, (j + 0.5) * m_scale, (k + 0.5) * m_scale); - Vec3 p7((i - 0.5) * m_scale, (j + 0.5) * m_scale, (k + 0.5) * m_scale); - - points.push_back(p0 + m_minBB); - points.push_back(p1 + m_minBB); - points.push_back(p2 + m_minBB); - points.push_back(p3 + m_minBB); - points.push_back(p4 + m_minBB); - points.push_back(p5 + m_minBB); - points.push_back(p6 + m_minBB); - points.push_back(p7 + m_minBB); - } - } - ++p; - } - - ConvexHull ch(&points[0][0], 3 * sizeof(double), int32_t(points.size()), 1.0e-5f); - const std::vector& convexPoints = ch.GetVertexPool(); - for (size_t v = 0; v < convexPoints.size(); v++) - { - cpoints.push_back(convexPoints[v]); - } - } - ConvexHull ch(&cpoints[0][0], 3 * sizeof(double), int32_t(cpoints.size()), 1.0e-5f); - meshCH.ResizePoints(0); - meshCH.ResizeTriangles(0); - - const std::vector& convexPoints = ch.GetVertexPool(); - for (size_t v = 0; v < convexPoints.size(); v++) - { - meshCH.AddPoint(convexPoints[v]); - } - - for (ConvexHull::ndNode* node = ch.GetFirst(); node; node = node->GetNext()) - { - ConvexHullFace* const face = &node->GetInfo(); - meshCH.AddTriangle(Vec3(face->m_index[0], face->m_index[1], face->m_index[2])); - } - } - - void VoxelSet::GetPoints(const Voxel& voxel, - Vec3* const pts) const - { - short i = voxel.m_coord[0]; - short j = voxel.m_coord[1]; - short k = voxel.m_coord[2]; - pts[0][0] = (i - 0.5) * m_scale + m_minBB[0]; - pts[1][0] = (i + 0.5) * m_scale + m_minBB[0]; - pts[2][0] = (i + 0.5) * m_scale + m_minBB[0]; - pts[3][0] = (i - 0.5) * m_scale + m_minBB[0]; - pts[4][0] = (i - 0.5) * m_scale + m_minBB[0]; - pts[5][0] = (i + 0.5) * m_scale + m_minBB[0]; - pts[6][0] = (i + 0.5) * m_scale + m_minBB[0]; - pts[7][0] = (i - 0.5) * m_scale + m_minBB[0]; - pts[0][1] = (j - 0.5) * m_scale + m_minBB[1]; - pts[1][1] = (j - 0.5) * m_scale + m_minBB[1]; - pts[2][1] = (j + 0.5) * m_scale + m_minBB[1]; - pts[3][1] = (j + 0.5) * m_scale + m_minBB[1]; - pts[4][1] = (j - 0.5) * m_scale + m_minBB[1]; - pts[5][1] = (j - 0.5) * m_scale + m_minBB[1]; - pts[6][1] = (j + 0.5) * m_scale + m_minBB[1]; - pts[7][1] = (j + 0.5) * m_scale + m_minBB[1]; - pts[0][2] = (k - 0.5) * m_scale + m_minBB[2]; - pts[1][2] = (k - 0.5) * m_scale + m_minBB[2]; - pts[2][2] = (k - 0.5) * m_scale + m_minBB[2]; - pts[3][2] = (k - 0.5) * m_scale + m_minBB[2]; - pts[4][2] = (k + 0.5) * m_scale + m_minBB[2]; - pts[5][2] = (k + 0.5) * m_scale + m_minBB[2]; - pts[6][2] = (k + 0.5) * m_scale + m_minBB[2]; - pts[7][2] = (k + 0.5) * m_scale + m_minBB[2]; - } - - void VoxelSet::Intersect(const Plane& plane, - SArray >* const positivePts, - SArray >* const negativePts, - const size_t sampling) const - { - const size_t nVoxels = m_voxels.Size(); - if (nVoxels == 0) - return; - const double d0 = m_scale; - double d; - Vec3 pts[8]; - Vec3 pt; - Voxel voxel; - size_t sp = 0; - size_t sn = 0; - for (size_t v = 0; v < nVoxels; ++v) - { - voxel = m_voxels[v]; - pt = GetPoint(voxel); - d = plane.m_a * pt[0] + plane.m_b * pt[1] + plane.m_c * pt[2] + plane.m_d; - if (d >= 0.0) - { - if (d <= d0) - { - GetPoints(voxel, pts); - for (int32_t k = 0; k < 8; ++k) - { - positivePts->PushBack(pts[k]); - } - } - else - { - if (++sp == sampling) - { - GetPoints(voxel, pts); - for (int32_t k = 0; k < 8; ++k) - { - positivePts->PushBack(pts[k]); - } - sp = 0; - } - } - } - else - { - if (-d <= d0) - { - GetPoints(voxel, pts); - for (int32_t k = 0; k < 8; ++k) - { - negativePts->PushBack(pts[k]); - } - } - else - { - if (++sn == sampling) - { - GetPoints(voxel, pts); - for (int32_t k = 0; k < 8; ++k) - { - negativePts->PushBack(pts[k]); - } - sn = 0; - } - } - } - } - - _ASSERT(positivePts->Size() <= nVoxels * 8); - _ASSERT(negativePts->Size() <= nVoxels * 8); - } - - void VoxelSet::GetPointArray(std::vector>& points) const - { - const size_t nVoxels = m_voxels.Size(); - - Vec3 pts[8]; - for (size_t i = 0; i < nVoxels; ++i) - { - Voxel voxel (m_voxels[i]); - GetPoints(voxel, pts); - for (int32_t k = 0; k < 8; ++k) - { - points.push_back(pts[k]); - } - } - } - - void VoxelSet::ComputeExteriorPoints(const Plane& plane, - const Mesh& mesh, - SArray >* const exteriorPts) const - { - const size_t nVoxels = m_voxels.Size(); - if (nVoxels == 0) - return; - double d; - Vec3 pt; - Vec3 pts[8]; - Voxel voxel; - for (size_t v = 0; v < nVoxels; ++v) { - voxel = m_voxels[v]; - pt = GetPoint(voxel); - d = plane.m_a * pt[0] + plane.m_b * pt[1] + plane.m_c * pt[2] + plane.m_d; - if (d >= 0.0) { - if (!mesh.IsInside(pt)) { - GetPoints(voxel, pts); - for (int32_t k = 0; k < 8; ++k) { - exteriorPts->PushBack(pts[k]); - } - } - } - } - } - void VoxelSet::ComputeClippedVolumes(const Plane& plane, - double& positiveVolume, - double& negativeVolume) const - { - negativeVolume = 0.0; - positiveVolume = 0.0; - const size_t nVoxels = m_voxels.Size(); - if (nVoxels == 0) - return; - double d; - Vec3 pt; - size_t nPositiveVoxels = 0; - for (size_t v = 0; v < nVoxels; ++v) { - pt = GetPoint(m_voxels[v]); - d = plane.m_a * pt[0] + plane.m_b * pt[1] + plane.m_c * pt[2] + plane.m_d; - nPositiveVoxels += (d >= 0.0); - } - size_t nNegativeVoxels = nVoxels - nPositiveVoxels; - positiveVolume = m_unitVolume * (double)nPositiveVoxels; - negativeVolume = m_unitVolume * (double)nNegativeVoxels; - } - void VoxelSet::SelectOnSurface(PrimitiveSet* const onSurfP) const - { - VoxelSet* const onSurf = (VoxelSet*)onSurfP; - const size_t nVoxels = m_voxels.Size(); - if (nVoxels == 0) - return; - - for (size_t h = 0; h < 3; ++h) { - onSurf->m_minBB[h] = m_minBB[h]; - } - onSurf->m_voxels.Resize(0); - onSurf->m_scale = m_scale; - onSurf->m_unitVolume = m_unitVolume; - onSurf->m_numVoxelsOnSurface = 0; - onSurf->m_numVoxelsInsideSurface = 0; - Voxel voxel; - for (size_t v = 0; v < nVoxels; ++v) { - voxel = m_voxels[v]; - if (voxel.m_data == PRIMITIVE_ON_SURFACE) { - onSurf->m_voxels.PushBack(voxel); - ++onSurf->m_numVoxelsOnSurface; - } - } - } - void VoxelSet::Clip(const Plane& plane, - PrimitiveSet* const positivePartP, - PrimitiveSet* const negativePartP) const - { - VoxelSet* const positivePart = (VoxelSet*)positivePartP; - VoxelSet* const negativePart = (VoxelSet*)negativePartP; - const size_t nVoxels = m_voxels.Size(); - if (nVoxels == 0) - return; - - for (size_t h = 0; h < 3; ++h) { - negativePart->m_minBB[h] = positivePart->m_minBB[h] = m_minBB[h]; - } - positivePart->m_voxels.Resize(0); - negativePart->m_voxels.Resize(0); - positivePart->m_voxels.Allocate(nVoxels); - negativePart->m_voxels.Allocate(nVoxels); - negativePart->m_scale = positivePart->m_scale = m_scale; - negativePart->m_unitVolume = positivePart->m_unitVolume = m_unitVolume; - negativePart->m_numVoxelsOnSurface = positivePart->m_numVoxelsOnSurface = 0; - negativePart->m_numVoxelsInsideSurface = positivePart->m_numVoxelsInsideSurface = 0; - - double d; - Vec3 pt; - Voxel voxel; - const double d0 = m_scale; - for (size_t v = 0; v < nVoxels; ++v) { - voxel = m_voxels[v]; - pt = GetPoint(voxel); - d = plane.m_a * pt[0] + plane.m_b * pt[1] + plane.m_c * pt[2] + plane.m_d; - if (d >= 0.0) { - if (voxel.m_data == PRIMITIVE_ON_SURFACE || d <= d0) { - voxel.m_data = PRIMITIVE_ON_SURFACE; - positivePart->m_voxels.PushBack(voxel); - ++positivePart->m_numVoxelsOnSurface; - } - else { - positivePart->m_voxels.PushBack(voxel); - ++positivePart->m_numVoxelsInsideSurface; - } - } - else { - if (voxel.m_data == PRIMITIVE_ON_SURFACE || -d <= d0) { - voxel.m_data = PRIMITIVE_ON_SURFACE; - negativePart->m_voxels.PushBack(voxel); - ++negativePart->m_numVoxelsOnSurface; - } - else { - negativePart->m_voxels.PushBack(voxel); - ++negativePart->m_numVoxelsInsideSurface; - } - } - } - } - void VoxelSet::Convert(Mesh& mesh, const VOXEL_VALUE value) const - { - const size_t nVoxels = m_voxels.Size(); - if (nVoxels == 0) - return; - Voxel voxel; - Vec3 pts[8]; - for (size_t v = 0; v < nVoxels; ++v) { - voxel = m_voxels[v]; - if (voxel.m_data == value) { - GetPoints(voxel, pts); - int32_t s = (int32_t)mesh.GetNPoints(); - for (int32_t k = 0; k < 8; ++k) { - mesh.AddPoint(pts[k]); - } - mesh.AddTriangle(Vec3(s + 0, s + 2, s + 1)); - mesh.AddTriangle(Vec3(s + 0, s + 3, s + 2)); - mesh.AddTriangle(Vec3(s + 4, s + 5, s + 6)); - mesh.AddTriangle(Vec3(s + 4, s + 6, s + 7)); - mesh.AddTriangle(Vec3(s + 7, s + 6, s + 2)); - mesh.AddTriangle(Vec3(s + 7, s + 2, s + 3)); - mesh.AddTriangle(Vec3(s + 4, s + 1, s + 5)); - mesh.AddTriangle(Vec3(s + 4, s + 0, s + 1)); - mesh.AddTriangle(Vec3(s + 6, s + 5, s + 1)); - mesh.AddTriangle(Vec3(s + 6, s + 1, s + 2)); - mesh.AddTriangle(Vec3(s + 7, s + 0, s + 4)); - mesh.AddTriangle(Vec3(s + 7, s + 3, s + 0)); - } - } - } - void VoxelSet::ComputePrincipalAxes() - { - const size_t nVoxels = m_voxels.Size(); - if (nVoxels == 0) - return; - m_barycenterPCA[0] = m_barycenterPCA[1] = m_barycenterPCA[2] = 0.0; - for (size_t v = 0; v < nVoxels; ++v) { - Voxel& voxel = m_voxels[v]; - m_barycenterPCA[0] += voxel.m_coord[0]; - m_barycenterPCA[1] += voxel.m_coord[1]; - m_barycenterPCA[2] += voxel.m_coord[2]; - } - m_barycenterPCA /= (double)nVoxels; - - double covMat[3][3] = { { 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0 } }; - double x, y, z; - for (size_t v = 0; v < nVoxels; ++v) { - Voxel& voxel = m_voxels[v]; - x = voxel.m_coord[0] - m_barycenter[0]; - y = voxel.m_coord[1] - m_barycenter[1]; - z = voxel.m_coord[2] - m_barycenter[2]; - covMat[0][0] += x * x; - covMat[1][1] += y * y; - covMat[2][2] += z * z; - covMat[0][1] += x * y; - covMat[0][2] += x * z; - covMat[1][2] += y * z; - } - covMat[0][0] /= (double)nVoxels; - covMat[1][1] /= (double)nVoxels; - covMat[2][2] /= (double)nVoxels; - covMat[0][1] /= (double)nVoxels; - covMat[0][2] /= (double)nVoxels; - covMat[1][2] /= (double)nVoxels; - covMat[1][0] = covMat[0][1]; - covMat[2][0] = covMat[0][2]; - covMat[2][1] = covMat[1][2]; - Diagonalize(covMat, m_Q, m_D); - } - Volume::Volume() - { - m_dim[0] = m_dim[1] = m_dim[2] = 0; - m_minBB[0] = m_minBB[1] = m_minBB[2] = 0.0; - m_maxBB[0] = m_maxBB[1] = m_maxBB[2] = 1.0; - m_numVoxelsOnSurface = 0; - m_numVoxelsInsideSurface = 0; - m_numVoxelsOutsideSurface = 0; - m_scale = 1.0; - m_data = 0; - } - Volume::~Volume(void) - { - delete[] m_data; - } - void Volume::Allocate() - { - delete[] m_data; - size_t size = m_dim[0] * m_dim[1] * m_dim[2]; - m_data = new unsigned char[size]; - memset(m_data, PRIMITIVE_UNDEFINED, sizeof(unsigned char) * size); - } - void Volume::Free() - { - delete[] m_data; - m_data = 0; - } - void Volume::FillOutsideSurface(const size_t i0, - const size_t j0, - const size_t k0, - const size_t i1, - const size_t j1, - const size_t k1) - { - const short neighbours[6][3] = { { 1, 0, 0 }, - { 0, 1, 0 }, - { 0, 0, 1 }, - { -1, 0, 0 }, - { 0, -1, 0 }, - { 0, 0, -1 } }; - std::queue > fifo; - Vec3 current; - short a, b, c; - for (size_t i = i0; i < i1; ++i) { - for (size_t j = j0; j < j1; ++j) { - for (size_t k = k0; k < k1; ++k) { - - if (GetVoxel(i, j, k) == PRIMITIVE_UNDEFINED) { - current[0] = (short)i; - current[1] = (short)j; - current[2] = (short)k; - fifo.push(current); - GetVoxel(size_t(current[0]), size_t(current[1]), size_t(current[2])) = PRIMITIVE_OUTSIDE_SURFACE; - ++m_numVoxelsOutsideSurface; - while (fifo.size() > 0) { - current = fifo.front(); - fifo.pop(); - for (int32_t h = 0; h < 6; ++h) { - a = current[0] + neighbours[h][0]; - b = current[1] + neighbours[h][1]; - c = current[2] + neighbours[h][2]; - if (a < 0 || a >= (int32_t)m_dim[0] || b < 0 || b >= (int32_t)m_dim[1] || c < 0 || c >= (int32_t)m_dim[2]) { - continue; - } - unsigned char& v = GetVoxel(size_t(a), size_t(b), size_t(c)); - if (v == PRIMITIVE_UNDEFINED) { - v = PRIMITIVE_OUTSIDE_SURFACE; - ++m_numVoxelsOutsideSurface; - fifo.push(Vec3(a, b, c)); - } - } - } - } - } - } - } - } - void Volume::FillInsideSurface() - { - const size_t i0 = m_dim[0]; - const size_t j0 = m_dim[1]; - const size_t k0 = m_dim[2]; - for (size_t i = 0; i < i0; ++i) { - for (size_t j = 0; j < j0; ++j) { - for (size_t k = 0; k < k0; ++k) { - unsigned char& v = GetVoxel(i, j, k); - if (v == PRIMITIVE_UNDEFINED) { - v = PRIMITIVE_INSIDE_SURFACE; - ++m_numVoxelsInsideSurface; - } - } - } - } - } - void Volume::Convert(Mesh& mesh, const VOXEL_VALUE value) const - { - const size_t i0 = m_dim[0]; - const size_t j0 = m_dim[1]; - const size_t k0 = m_dim[2]; - for (size_t i = 0; i < i0; ++i) { - for (size_t j = 0; j < j0; ++j) { - for (size_t k = 0; k < k0; ++k) { - const unsigned char& voxel = GetVoxel(i, j, k); - if (voxel == value) { - Vec3 p0(((double)i - 0.5) * m_scale, ((double)j - 0.5) * m_scale, ((double)k - 0.5) * m_scale); - Vec3 p1(((double)i + 0.5) * m_scale, ((double)j - 0.5) * m_scale, ((double)k - 0.5) * m_scale); - Vec3 p2(((double)i + 0.5) * m_scale, ((double)j + 0.5) * m_scale, ((double)k - 0.5) * m_scale); - Vec3 p3(((double)i - 0.5) * m_scale, ((double)j + 0.5) * m_scale, ((double)k - 0.5) * m_scale); - Vec3 p4(((double)i - 0.5) * m_scale, ((double)j - 0.5) * m_scale, ((double)k + 0.5) * m_scale); - Vec3 p5(((double)i + 0.5) * m_scale, ((double)j - 0.5) * m_scale, ((double)k + 0.5) * m_scale); - Vec3 p6(((double)i + 0.5) * m_scale, ((double)j + 0.5) * m_scale, ((double)k + 0.5) * m_scale); - Vec3 p7(((double)i - 0.5) * m_scale, ((double)j + 0.5) * m_scale, ((double)k + 0.5) * m_scale); - int32_t s = (int32_t)mesh.GetNPoints(); - mesh.AddPoint(p0 + m_minBB); - mesh.AddPoint(p1 + m_minBB); - mesh.AddPoint(p2 + m_minBB); - mesh.AddPoint(p3 + m_minBB); - mesh.AddPoint(p4 + m_minBB); - mesh.AddPoint(p5 + m_minBB); - mesh.AddPoint(p6 + m_minBB); - mesh.AddPoint(p7 + m_minBB); - mesh.AddTriangle(Vec3(s + 0, s + 2, s + 1)); - mesh.AddTriangle(Vec3(s + 0, s + 3, s + 2)); - mesh.AddTriangle(Vec3(s + 4, s + 5, s + 6)); - mesh.AddTriangle(Vec3(s + 4, s + 6, s + 7)); - mesh.AddTriangle(Vec3(s + 7, s + 6, s + 2)); - mesh.AddTriangle(Vec3(s + 7, s + 2, s + 3)); - mesh.AddTriangle(Vec3(s + 4, s + 1, s + 5)); - mesh.AddTriangle(Vec3(s + 4, s + 0, s + 1)); - mesh.AddTriangle(Vec3(s + 6, s + 5, s + 1)); - mesh.AddTriangle(Vec3(s + 6, s + 1, s + 2)); - mesh.AddTriangle(Vec3(s + 7, s + 0, s + 4)); - mesh.AddTriangle(Vec3(s + 7, s + 3, s + 0)); - } - } - } - } - } - void Volume::Convert(VoxelSet& vset) const - { - for (size_t h = 0; h < 3; ++h) - { - vset.m_minBB[h] = m_minBB[h]; - } - vset.m_voxels.Allocate(m_numVoxelsInsideSurface + m_numVoxelsOnSurface); - vset.m_scale = m_scale; - vset.m_unitVolume = m_scale * m_scale * m_scale; - const short i0 = (short)m_dim[0]; - const short j0 = (short)m_dim[1]; - const short k0 = (short)m_dim[2]; - Voxel voxel; - vset.m_numVoxelsOnSurface = 0; - vset.m_numVoxelsInsideSurface = 0; - for (short i = 0; i < i0; ++i) - { - for (short j = 0; j < j0; ++j) - { - for (short k = 0; k < k0; ++k) - { - const unsigned char& value = GetVoxel(size_t(i), size_t(j), size_t(k)); - if (value == PRIMITIVE_INSIDE_SURFACE) - { - voxel.m_coord[0] = i; - voxel.m_coord[1] = j; - voxel.m_coord[2] = k; - voxel.m_data = PRIMITIVE_INSIDE_SURFACE; - vset.m_voxels.PushBack(voxel); - ++vset.m_numVoxelsInsideSurface; - } - else if (value == PRIMITIVE_ON_SURFACE) - { - voxel.m_coord[0] = i; - voxel.m_coord[1] = j; - voxel.m_coord[2] = k; - voxel.m_data = PRIMITIVE_ON_SURFACE; - vset.m_voxels.PushBack(voxel); - ++vset.m_numVoxelsOnSurface; - } - } - } - } - } - - void Volume::Convert(TetrahedronSet& tset) const - { - tset.m_tetrahedra.Allocate(5 * (m_numVoxelsInsideSurface + m_numVoxelsOnSurface)); - tset.m_scale = m_scale; - const short i0 = (short)m_dim[0]; - const short j0 = (short)m_dim[1]; - const short k0 = (short)m_dim[2]; - tset.m_numTetrahedraOnSurface = 0; - tset.m_numTetrahedraInsideSurface = 0; - Tetrahedron tetrahedron; - for (short i = 0; i < i0; ++i) { - for (short j = 0; j < j0; ++j) { - for (short k = 0; k < k0; ++k) { - const unsigned char& value = GetVoxel(size_t(i), size_t(j), size_t(k)); - if (value == PRIMITIVE_INSIDE_SURFACE || value == PRIMITIVE_ON_SURFACE) { - tetrahedron.m_data = value; - Vec3 p1((i - 0.5) * m_scale + m_minBB[0], (j - 0.5) * m_scale + m_minBB[1], (k - 0.5) * m_scale + m_minBB[2]); - Vec3 p2((i + 0.5) * m_scale + m_minBB[0], (j - 0.5) * m_scale + m_minBB[1], (k - 0.5) * m_scale + m_minBB[2]); - Vec3 p3((i + 0.5) * m_scale + m_minBB[0], (j + 0.5) * m_scale + m_minBB[1], (k - 0.5) * m_scale + m_minBB[2]); - Vec3 p4((i - 0.5) * m_scale + m_minBB[0], (j + 0.5) * m_scale + m_minBB[1], (k - 0.5) * m_scale + m_minBB[2]); - Vec3 p5((i - 0.5) * m_scale + m_minBB[0], (j - 0.5) * m_scale + m_minBB[1], (k + 0.5) * m_scale + m_minBB[2]); - Vec3 p6((i + 0.5) * m_scale + m_minBB[0], (j - 0.5) * m_scale + m_minBB[1], (k + 0.5) * m_scale + m_minBB[2]); - Vec3 p7((i + 0.5) * m_scale + m_minBB[0], (j + 0.5) * m_scale + m_minBB[1], (k + 0.5) * m_scale + m_minBB[2]); - Vec3 p8((i - 0.5) * m_scale + m_minBB[0], (j + 0.5) * m_scale + m_minBB[1], (k + 0.5) * m_scale + m_minBB[2]); - - tetrahedron.m_pts[0] = p2; - tetrahedron.m_pts[1] = p4; - tetrahedron.m_pts[2] = p7; - tetrahedron.m_pts[3] = p5; - tset.m_tetrahedra.PushBack(tetrahedron); - - tetrahedron.m_pts[0] = p6; - tetrahedron.m_pts[1] = p2; - tetrahedron.m_pts[2] = p7; - tetrahedron.m_pts[3] = p5; - tset.m_tetrahedra.PushBack(tetrahedron); - - tetrahedron.m_pts[0] = p3; - tetrahedron.m_pts[1] = p4; - tetrahedron.m_pts[2] = p7; - tetrahedron.m_pts[3] = p2; - tset.m_tetrahedra.PushBack(tetrahedron); - - tetrahedron.m_pts[0] = p1; - tetrahedron.m_pts[1] = p4; - tetrahedron.m_pts[2] = p2; - tetrahedron.m_pts[3] = p5; - tset.m_tetrahedra.PushBack(tetrahedron); - - tetrahedron.m_pts[0] = p8; - tetrahedron.m_pts[1] = p5; - tetrahedron.m_pts[2] = p7; - tetrahedron.m_pts[3] = p4; - tset.m_tetrahedra.PushBack(tetrahedron); - if (value == PRIMITIVE_INSIDE_SURFACE) { - tset.m_numTetrahedraInsideSurface += 5; - } - else { - tset.m_numTetrahedraOnSurface += 5; - } - } - } - } - } - } - - void Volume::AlignToPrincipalAxes(double (&rot)[3][3]) const - { - const short i0 = (short)m_dim[0]; - const short j0 = (short)m_dim[1]; - const short k0 = (short)m_dim[2]; - Vec3 barycenter(0.0); - size_t nVoxels = 0; - for (short i = 0; i < i0; ++i) { - for (short j = 0; j < j0; ++j) { - for (short k = 0; k < k0; ++k) { - const unsigned char& value = GetVoxel(size_t(i), size_t(j), size_t(k)); - if (value == PRIMITIVE_INSIDE_SURFACE || value == PRIMITIVE_ON_SURFACE) { - barycenter[0] += i; - barycenter[1] += j; - barycenter[2] += k; - ++nVoxels; - } - } - } - } - barycenter /= (double)nVoxels; - - double covMat[3][3] = { { 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0 } }; - double x, y, z; - for (short i = 0; i < i0; ++i) { - for (short j = 0; j < j0; ++j) { - for (short k = 0; k < k0; ++k) { - const unsigned char& value = GetVoxel(size_t(i), size_t(j), size_t(k)); - if (value == PRIMITIVE_INSIDE_SURFACE || value == PRIMITIVE_ON_SURFACE) { - x = i - barycenter[0]; - y = j - barycenter[1]; - z = k - barycenter[2]; - covMat[0][0] += x * x; - covMat[1][1] += y * y; - covMat[2][2] += z * z; - covMat[0][1] += x * y; - covMat[0][2] += x * z; - covMat[1][2] += y * z; - } - } - } - } - covMat[1][0] = covMat[0][1]; - covMat[2][0] = covMat[0][2]; - covMat[2][1] = covMat[1][2]; - double D[3][3]; - Diagonalize(covMat, rot, D); - } - TetrahedronSet::TetrahedronSet() - { - m_minBB[0] = m_minBB[1] = m_minBB[2] = 0.0; - m_maxBB[0] = m_maxBB[1] = m_maxBB[2] = 1.0; - m_barycenter[0] = m_barycenter[1] = m_barycenter[2] = 0.0; - m_scale = 1.0; - m_numTetrahedraOnSurface = 0; - m_numTetrahedraInsideSurface = 0; - memset(m_Q, 0, sizeof(double) * 9); - memset(m_D, 0, sizeof(double) * 9); - } - TetrahedronSet::~TetrahedronSet(void) - { - } - void TetrahedronSet::ComputeBB() - { - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return; - - for (size_t h = 0; h < 3; ++h) { - m_minBB[h] = m_maxBB[h] = m_tetrahedra[0].m_pts[0][h]; - m_barycenter[h] = 0.0; - } - for (size_t p = 0; p < nTetrahedra; ++p) { - for (size_t i = 0; i < 4; ++i) { - for (size_t h = 0; h < 3; ++h) { - if (m_minBB[h] > m_tetrahedra[p].m_pts[i][h]) - m_minBB[h] = m_tetrahedra[p].m_pts[i][h]; - if (m_maxBB[h] < m_tetrahedra[p].m_pts[i][h]) - m_maxBB[h] = m_tetrahedra[p].m_pts[i][h]; - m_barycenter[h] += m_tetrahedra[p].m_pts[i][h]; - } - } - } - m_barycenter /= (double)(4 * nTetrahedra); - } - - void TetrahedronSet::ComputeConvexHull(Mesh& meshCH, const size_t sampling) const - { - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return; - - std::vector> points; - std::vector> cpoints; - - size_t p = 0; - while (p < nTetrahedra) { - size_t s = 0; - while (p < nTetrahedra) { - if (m_tetrahedra[p].m_data == PRIMITIVE_ON_SURFACE) { - ++s; - if (s == sampling) { - s = 0; - for (int32_t a = 0; a < 4; ++a) { - points.push_back(m_tetrahedra[p].m_pts[a]); - for (size_t xx = 0; xx < 3; ++xx) { - assert(m_tetrahedra[p].m_pts[a][xx] + EPS >= m_minBB[xx]); - assert(m_tetrahedra[p].m_pts[a][xx] <= m_maxBB[xx] + EPS); - } - } - } - } - ++p; - } - - ConvexHull ch(&points[0][0], 3 * sizeof(double), int32_t(points.size()), 1.0e-5f); - const std::vector& convexPoints = ch.GetVertexPool(); - for (size_t v = 0; v < int(convexPoints.size()); v++) - { - cpoints.push_back(convexPoints[v]); - } - } - - ConvexHull ch(&cpoints[0][0], 3 * sizeof(double), int32_t(cpoints.size()), 1.0e-5f); - meshCH.ResizePoints(0); - meshCH.ResizeTriangles(0); - const std::vector& convexPoints = ch.GetVertexPool(); - for (size_t v = 0; v < int(convexPoints.size()); v++) { - meshCH.AddPoint(convexPoints[v]); - } - - for (ConvexHull::ndNode* node = ch.GetFirst(); node; node = node->GetNext()) - { - ConvexHullFace* const face = &node->GetInfo(); - meshCH.AddTriangle(Vec3(face->m_index[0], face->m_index[1], face->m_index[2])); - } - } - inline bool TetrahedronSet::Add(Tetrahedron& tetrahedron) - { - double v = ComputeVolume4(tetrahedron.m_pts[0], tetrahedron.m_pts[1], tetrahedron.m_pts[2], tetrahedron.m_pts[3]); - - const double EPS = 0.0000000001; - if (fabs(v) < EPS) { - return false; - } - else if (v < 0.0) { - Vec3 tmp = tetrahedron.m_pts[0]; - tetrahedron.m_pts[0] = tetrahedron.m_pts[1]; - tetrahedron.m_pts[1] = tmp; - } - - for (size_t a = 0; a < 4; ++a) { - for (size_t xx = 0; xx < 3; ++xx) { - assert(tetrahedron.m_pts[a][xx] + EPS >= m_minBB[xx]); - assert(tetrahedron.m_pts[a][xx] <= m_maxBB[xx] + EPS); - } - } - m_tetrahedra.PushBack(tetrahedron); - return true; - } - - void TetrahedronSet::GetPointArray(std::vector>&) const - { - #ifdef _WIN32 - _ASSERT(0); - #endif - } - - void TetrahedronSet::AddClippedTetrahedra(const Vec3 (&pts)[10], const int32_t nPts) - { - const int32_t tetF[4][3] = { { 0, 1, 2 }, { 2, 1, 3 }, { 3, 1, 0 }, { 3, 0, 2 } }; - if (nPts < 4) { - return; - } - else if (nPts == 4) { - Tetrahedron tetrahedron; - tetrahedron.m_data = PRIMITIVE_ON_SURFACE; - tetrahedron.m_pts[0] = pts[0]; - tetrahedron.m_pts[1] = pts[1]; - tetrahedron.m_pts[2] = pts[2]; - tetrahedron.m_pts[3] = pts[3]; - if (Add(tetrahedron)) { - ++m_numTetrahedraOnSurface; - } - } - else if (nPts == 5) { - const int32_t tet[15][4] = { - { 0, 1, 2, 3 }, { 1, 2, 3, 4 }, { 0, 2, 3, 4 }, { 0, 1, 3, 4 }, { 0, 1, 2, 4 }, - }; - const int32_t rem[5] = { 4, 0, 1, 2, 3 }; - double maxVol = 0.0; - int32_t h0 = -1; - Tetrahedron tetrahedron0; - tetrahedron0.m_data = PRIMITIVE_ON_SURFACE; - for (int32_t h = 0; h < 5; ++h) { - double v = ComputeVolume4(pts[tet[h][0]], pts[tet[h][1]], pts[tet[h][2]], pts[tet[h][3]]); - if (v > maxVol) { - h0 = h; - tetrahedron0.m_pts[0] = pts[tet[h][0]]; - tetrahedron0.m_pts[1] = pts[tet[h][1]]; - tetrahedron0.m_pts[2] = pts[tet[h][2]]; - tetrahedron0.m_pts[3] = pts[tet[h][3]]; - maxVol = v; - } - else if (-v > maxVol) { - h0 = h; - tetrahedron0.m_pts[0] = pts[tet[h][1]]; - tetrahedron0.m_pts[1] = pts[tet[h][0]]; - tetrahedron0.m_pts[2] = pts[tet[h][2]]; - tetrahedron0.m_pts[3] = pts[tet[h][3]]; - maxVol = -v; - } - } - if (h0 == -1) - return; - if (Add(tetrahedron0)) { - ++m_numTetrahedraOnSurface; - } - else { - return; - } - int32_t a = rem[h0]; - maxVol = 0.0; - int32_t h1 = -1; - Tetrahedron tetrahedron1; - tetrahedron1.m_data = PRIMITIVE_ON_SURFACE; - for (int32_t h = 0; h < 4; ++h) { - double v = ComputeVolume4(pts[a], tetrahedron0.m_pts[tetF[h][0]], tetrahedron0.m_pts[tetF[h][1]], tetrahedron0.m_pts[tetF[h][2]]); - if (v > maxVol) { - h1 = h; - tetrahedron1.m_pts[0] = pts[a]; - tetrahedron1.m_pts[1] = tetrahedron0.m_pts[tetF[h][0]]; - tetrahedron1.m_pts[2] = tetrahedron0.m_pts[tetF[h][1]]; - tetrahedron1.m_pts[3] = tetrahedron0.m_pts[tetF[h][2]]; - maxVol = v; - } - } - if (h1 == -1 && Add(tetrahedron1)) { - ++m_numTetrahedraOnSurface; - } - } - else if (nPts == 6) { - - const int32_t tet[15][4] = { { 2, 3, 4, 5 }, { 1, 3, 4, 5 }, { 1, 2, 4, 5 }, { 1, 2, 3, 5 }, { 1, 2, 3, 4 }, - { 0, 3, 4, 5 }, { 0, 2, 4, 5 }, { 0, 2, 3, 5 }, { 0, 2, 3, 4 }, { 0, 1, 4, 5 }, - { 0, 1, 3, 5 }, { 0, 1, 3, 4 }, { 0, 1, 2, 5 }, { 0, 1, 2, 4 }, { 0, 1, 2, 3 } }; - const int32_t rem[15][2] = { { 0, 1 }, { 0, 2 }, { 0, 3 }, { 0, 4 }, { 0, 5 }, - { 1, 2 }, { 1, 3 }, { 1, 4 }, { 1, 5 }, { 2, 3 }, - { 2, 4 }, { 2, 5 }, { 3, 4 }, { 3, 5 }, { 4, 5 } }; - double maxVol = 0.0; - int32_t h0 = -1; - Tetrahedron tetrahedron0; - tetrahedron0.m_data = PRIMITIVE_ON_SURFACE; - for (int32_t h = 0; h < 15; ++h) { - double v = ComputeVolume4(pts[tet[h][0]], pts[tet[h][1]], pts[tet[h][2]], pts[tet[h][3]]); - if (v > maxVol) { - h0 = h; - tetrahedron0.m_pts[0] = pts[tet[h][0]]; - tetrahedron0.m_pts[1] = pts[tet[h][1]]; - tetrahedron0.m_pts[2] = pts[tet[h][2]]; - tetrahedron0.m_pts[3] = pts[tet[h][3]]; - maxVol = v; - } - else if (-v > maxVol) { - h0 = h; - tetrahedron0.m_pts[0] = pts[tet[h][1]]; - tetrahedron0.m_pts[1] = pts[tet[h][0]]; - tetrahedron0.m_pts[2] = pts[tet[h][2]]; - tetrahedron0.m_pts[3] = pts[tet[h][3]]; - maxVol = -v; - } - } - if (h0 == -1) - return; - if (Add(tetrahedron0)) { - ++m_numTetrahedraOnSurface; - } - else { - return; - } - - int32_t a0 = rem[h0][0]; - int32_t a1 = rem[h0][1]; - int32_t h1 = -1; - Tetrahedron tetrahedron1; - tetrahedron1.m_data = PRIMITIVE_ON_SURFACE; - maxVol = 0.0; - for (int32_t h = 0; h < 4; ++h) { - double v = ComputeVolume4(pts[a0], tetrahedron0.m_pts[tetF[h][0]], tetrahedron0.m_pts[tetF[h][1]], tetrahedron0.m_pts[tetF[h][2]]); - if (v > maxVol) { - h1 = h; - tetrahedron1.m_pts[0] = pts[a0]; - tetrahedron1.m_pts[1] = tetrahedron0.m_pts[tetF[h][0]]; - tetrahedron1.m_pts[2] = tetrahedron0.m_pts[tetF[h][1]]; - tetrahedron1.m_pts[3] = tetrahedron0.m_pts[tetF[h][2]]; - maxVol = v; - } - } - if (h1 != -1 && Add(tetrahedron1)) { - ++m_numTetrahedraOnSurface; - } - else { - h1 = -1; - } - maxVol = 0.0; - int32_t h2 = -1; - Tetrahedron tetrahedron2; - tetrahedron2.m_data = PRIMITIVE_ON_SURFACE; - for (int32_t h = 0; h < 4; ++h) { - double v = ComputeVolume4(pts[a0], tetrahedron0.m_pts[tetF[h][0]], tetrahedron0.m_pts[tetF[h][1]], tetrahedron0.m_pts[tetF[h][2]]); - if (h == h1) - continue; - if (v > maxVol) { - h2 = h; - tetrahedron2.m_pts[0] = pts[a1]; - tetrahedron2.m_pts[1] = tetrahedron0.m_pts[tetF[h][0]]; - tetrahedron2.m_pts[2] = tetrahedron0.m_pts[tetF[h][1]]; - tetrahedron2.m_pts[3] = tetrahedron0.m_pts[tetF[h][2]]; - maxVol = v; - } - } - if (h1 != -1) { - for (int32_t h = 0; h < 4; ++h) { - double v = ComputeVolume4(pts[a1], tetrahedron1.m_pts[tetF[h][0]], tetrahedron1.m_pts[tetF[h][1]], tetrahedron1.m_pts[tetF[h][2]]); - if (h == 1) - continue; - if (v > maxVol) { - h2 = h; - tetrahedron2.m_pts[0] = pts[a1]; - tetrahedron2.m_pts[1] = tetrahedron1.m_pts[tetF[h][0]]; - tetrahedron2.m_pts[2] = tetrahedron1.m_pts[tetF[h][1]]; - tetrahedron2.m_pts[3] = tetrahedron1.m_pts[tetF[h][2]]; - maxVol = v; - } - } - } - if (h2 != -1 && Add(tetrahedron2)) { - ++m_numTetrahedraOnSurface; - } - } - else { - assert(0); - } - } - - void TetrahedronSet::Intersect(const Plane&, - SArray >* const, - SArray >* const, - const size_t) const - { - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return; - } - void TetrahedronSet::ComputeExteriorPoints(const Plane&, - const Mesh&, - SArray >* const) const - { - } - void TetrahedronSet::ComputeClippedVolumes(const Plane&, - double&, - double&) const - { - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return; - } - - void TetrahedronSet::SelectOnSurface(PrimitiveSet* const onSurfP) const - { - TetrahedronSet* const onSurf = (TetrahedronSet*)onSurfP; - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return; - onSurf->m_tetrahedra.Resize(0); - onSurf->m_scale = m_scale; - onSurf->m_numTetrahedraOnSurface = 0; - onSurf->m_numTetrahedraInsideSurface = 0; - onSurf->m_barycenter = m_barycenter; - onSurf->m_minBB = m_minBB; - onSurf->m_maxBB = m_maxBB; - for (int32_t i = 0; i < 3; ++i) { - for (int32_t j = 0; j < 3; ++j) { - onSurf->m_Q[i][j] = m_Q[i][j]; - onSurf->m_D[i][j] = m_D[i][j]; - } - } - Tetrahedron tetrahedron; - for (size_t v = 0; v < nTetrahedra; ++v) { - tetrahedron = m_tetrahedra[v]; - if (tetrahedron.m_data == PRIMITIVE_ON_SURFACE) { - onSurf->m_tetrahedra.PushBack(tetrahedron); - ++onSurf->m_numTetrahedraOnSurface; - } - } - } - void TetrahedronSet::Clip(const Plane& plane, - PrimitiveSet* const positivePartP, - PrimitiveSet* const negativePartP) const - { - TetrahedronSet* const positivePart = (TetrahedronSet*)positivePartP; - TetrahedronSet* const negativePart = (TetrahedronSet*)negativePartP; - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return; - positivePart->m_tetrahedra.Resize(0); - negativePart->m_tetrahedra.Resize(0); - positivePart->m_tetrahedra.Allocate(nTetrahedra); - negativePart->m_tetrahedra.Allocate(nTetrahedra); - negativePart->m_scale = positivePart->m_scale = m_scale; - negativePart->m_numTetrahedraOnSurface = positivePart->m_numTetrahedraOnSurface = 0; - negativePart->m_numTetrahedraInsideSurface = positivePart->m_numTetrahedraInsideSurface = 0; - negativePart->m_barycenter = m_barycenter; - positivePart->m_barycenter = m_barycenter; - negativePart->m_minBB = m_minBB; - positivePart->m_minBB = m_minBB; - negativePart->m_maxBB = m_maxBB; - positivePart->m_maxBB = m_maxBB; - for (int32_t i = 0; i < 3; ++i) { - for (int32_t j = 0; j < 3; ++j) { - negativePart->m_Q[i][j] = positivePart->m_Q[i][j] = m_Q[i][j]; - negativePart->m_D[i][j] = positivePart->m_D[i][j] = m_D[i][j]; - } - } - - Tetrahedron tetrahedron; - double delta, alpha; - int32_t sign[4]; - int32_t npos, nneg; - Vec3 posPts[10]; - Vec3 negPts[10]; - Vec3 P0, P1, M; - const Vec3 n(plane.m_a, plane.m_b, plane.m_c); - const int32_t edges[6][2] = { { 0, 1 }, { 0, 2 }, { 0, 3 }, { 1, 2 }, { 1, 3 }, { 2, 3 } }; - double dist; - for (size_t v = 0; v < nTetrahedra; ++v) { - tetrahedron = m_tetrahedra[v]; - npos = nneg = 0; - for (int32_t i = 0; i < 4; ++i) { - dist = plane.m_a * tetrahedron.m_pts[i][0] + plane.m_b * tetrahedron.m_pts[i][1] + plane.m_c * tetrahedron.m_pts[i][2] + plane.m_d; - if (dist > 0.0) { - sign[i] = 1; - posPts[npos] = tetrahedron.m_pts[i]; - ++npos; - } - else { - sign[i] = -1; - negPts[nneg] = tetrahedron.m_pts[i]; - ++nneg; - } - } - - if (npos == 4) { - positivePart->Add(tetrahedron); - if (tetrahedron.m_data == PRIMITIVE_ON_SURFACE) { - ++positivePart->m_numTetrahedraOnSurface; - } - else { - ++positivePart->m_numTetrahedraInsideSurface; - } - } - else if (nneg == 4) { - negativePart->Add(tetrahedron); - if (tetrahedron.m_data == PRIMITIVE_ON_SURFACE) { - ++negativePart->m_numTetrahedraOnSurface; - } - else { - ++negativePart->m_numTetrahedraInsideSurface; - } - } - else { - int32_t nnew = 0; - for (int32_t j = 0; j < 6; ++j) { - if (sign[edges[j][0]] * sign[edges[j][1]] == -1) { - P0 = tetrahedron.m_pts[edges[j][0]]; - P1 = tetrahedron.m_pts[edges[j][1]]; - delta = (P0 - P1) * n; - alpha = -(plane.m_d + (n * P1)) / delta; - assert(alpha >= 0.0 && alpha <= 1.0); - M = alpha * P0 + (1 - alpha) * P1; - for (size_t xx = 0; xx < 3; ++xx) { - assert(M[xx] + EPS >= m_minBB[xx]); - assert(M[xx] <= m_maxBB[xx] + EPS); - } - posPts[npos++] = M; - negPts[nneg++] = M; - ++nnew; - } - } - negativePart->AddClippedTetrahedra(negPts, nneg); - positivePart->AddClippedTetrahedra(posPts, npos); - } - } - } - void TetrahedronSet::Convert(Mesh& mesh, const VOXEL_VALUE value) const - { - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return; - for (size_t v = 0; v < nTetrahedra; ++v) { - const Tetrahedron& tetrahedron = m_tetrahedra[v]; - if (tetrahedron.m_data == value) { - int32_t s = (int32_t)mesh.GetNPoints(); - mesh.AddPoint(tetrahedron.m_pts[0]); - mesh.AddPoint(tetrahedron.m_pts[1]); - mesh.AddPoint(tetrahedron.m_pts[2]); - mesh.AddPoint(tetrahedron.m_pts[3]); - mesh.AddTriangle(Vec3(s + 0, s + 1, s + 2)); - mesh.AddTriangle(Vec3(s + 2, s + 1, s + 3)); - mesh.AddTriangle(Vec3(s + 3, s + 1, s + 0)); - mesh.AddTriangle(Vec3(s + 3, s + 0, s + 2)); - } - } - } - double TetrahedronSet::ComputeVolume() const - { - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return 0.0; - double volume = 0.0; - for (size_t v = 0; v < nTetrahedra; ++v) { - const Tetrahedron& tetrahedron = m_tetrahedra[v]; - volume += fabs(ComputeVolume4(tetrahedron.m_pts[0], tetrahedron.m_pts[1], tetrahedron.m_pts[2], tetrahedron.m_pts[3])); - } - return volume / 6.0; - } - double TetrahedronSet::ComputeMaxVolumeError() const - { - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return 0.0; - double volume = 0.0; - for (size_t v = 0; v < nTetrahedra; ++v) { - const Tetrahedron& tetrahedron = m_tetrahedra[v]; - if (tetrahedron.m_data == PRIMITIVE_ON_SURFACE) { - volume += fabs(ComputeVolume4(tetrahedron.m_pts[0], tetrahedron.m_pts[1], tetrahedron.m_pts[2], tetrahedron.m_pts[3])); - } - } - return volume / 6.0; - } - void TetrahedronSet::RevertAlignToPrincipalAxes() - { - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return; - double x, y, z; - for (size_t v = 0; v < nTetrahedra; ++v) { - Tetrahedron& tetrahedron = m_tetrahedra[v]; - for (int32_t i = 0; i < 4; ++i) { - x = tetrahedron.m_pts[i][0] - m_barycenter[0]; - y = tetrahedron.m_pts[i][1] - m_barycenter[1]; - z = tetrahedron.m_pts[i][2] - m_barycenter[2]; - tetrahedron.m_pts[i][0] = m_Q[0][0] * x + m_Q[0][1] * y + m_Q[0][2] * z + m_barycenter[0]; - tetrahedron.m_pts[i][1] = m_Q[1][0] * x + m_Q[1][1] * y + m_Q[1][2] * z + m_barycenter[1]; - tetrahedron.m_pts[i][2] = m_Q[2][0] * x + m_Q[2][1] * y + m_Q[2][2] * z + m_barycenter[2]; - } - } - ComputeBB(); - } - void TetrahedronSet::ComputePrincipalAxes() - { - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return; - double covMat[3][3] = { { 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0 } }; - double x, y, z; - for (size_t v = 0; v < nTetrahedra; ++v) { - Tetrahedron& tetrahedron = m_tetrahedra[v]; - for (int32_t i = 0; i < 4; ++i) { - x = tetrahedron.m_pts[i][0] - m_barycenter[0]; - y = tetrahedron.m_pts[i][1] - m_barycenter[1]; - z = tetrahedron.m_pts[i][2] - m_barycenter[2]; - covMat[0][0] += x * x; - covMat[1][1] += y * y; - covMat[2][2] += z * z; - covMat[0][1] += x * y; - covMat[0][2] += x * z; - covMat[1][2] += y * z; - } - } - double n = (double)nTetrahedra * 4.0; - covMat[0][0] /= n; - covMat[1][1] /= n; - covMat[2][2] /= n; - covMat[0][1] /= n; - covMat[0][2] /= n; - covMat[1][2] /= n; - covMat[1][0] = covMat[0][1]; - covMat[2][0] = covMat[0][2]; - covMat[2][1] = covMat[1][2]; - Diagonalize(covMat, m_Q, m_D); - } - void TetrahedronSet::AlignToPrincipalAxes() - { - const size_t nTetrahedra = m_tetrahedra.Size(); - if (nTetrahedra == 0) - return; - double x, y, z; - for (size_t v = 0; v < nTetrahedra; ++v) { - Tetrahedron& tetrahedron = m_tetrahedra[v]; - for (int32_t i = 0; i < 4; ++i) { - x = tetrahedron.m_pts[i][0] - m_barycenter[0]; - y = tetrahedron.m_pts[i][1] - m_barycenter[1]; - z = tetrahedron.m_pts[i][2] - m_barycenter[2]; - tetrahedron.m_pts[i][0] = m_Q[0][0] * x + m_Q[1][0] * y + m_Q[2][0] * z + m_barycenter[0]; - tetrahedron.m_pts[i][1] = m_Q[0][1] * x + m_Q[1][1] * y + m_Q[2][1] * z + m_barycenter[1]; - tetrahedron.m_pts[i][2] = m_Q[0][2] * x + m_Q[1][2] * y + m_Q[2][2] * z + m_barycenter[2]; - } - } - ComputeBB(); - } - } -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/ndConvexApproximation.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/ndConvexApproximation.cpp deleted file mode 100644 index d67a85856c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/ndConvexApproximation.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "ndCoreStdafx.h" -#include "VHACD.h" -#include "ndConvexApproximation.h" - -class ndConvexApproximation::ProgressBar: public nd_::VHACD::IVHACD::IUserCallback -{ - public: - ProgressBar(ndConvexApproximation* const owner) - :m_owner(owner) - { - } - - virtual void Update(const double overallProgress, - const double stageProgress, - const double operationProgress, - const char* const stage, - const char* const operation) - { - m_owner->Progress(); - } - - ndConvexApproximation* m_owner; -}; - -ndConvexApproximation::ndConvexApproximation(ndInt32 maxConvexes, bool quality) - :m_maxConvexes(maxConvexes) - ,m_quality(quality) -{ -} - -ndConvexApproximation::~ndConvexApproximation() -{ - for (ndInt32 i = ndInt32(m_ouputHulls.GetCount()) - 1; i >= 0; --i) - { - delete m_ouputHulls[i]; - } -} - -void ndConvexApproximation::InitProgress() -{ -} - -void ndConvexApproximation::Progress() -{ -} - -void ndConvexApproximation::EndProgress() -{ -} - -void ndConvexApproximation::Execute() -{ - InitProgress(); - ndArray points; - ndArray remapIndex; - ndArray faces; - for (ndInt32 i = 0; i < m_inputMesh.m_points.GetCount(); ++i) - { - points.PushBack(m_inputMesh.m_points[i]); - } - remapIndex.SetCount(points.GetCount()); - ndInt32 vCount = ndVertexListToIndexList(&points[0].m_x, sizeof(ndHullPoint), 3, ndInt32(points.GetCount()), &remapIndex[0], ndFloat32(1.0e-6f)); - - for (ndInt32 i = ndInt32(m_inputMesh.m_faces.GetCount()) - 1; i >= 0; --i) - { - ndInt32 j; - ndHullInputMesh::ndFace face; - - j = m_inputMesh.m_faces[i].m_i0; - face.m_i0 = remapIndex[j]; - - j = m_inputMesh.m_faces[i].m_i1; - face.m_i1 = remapIndex[j]; - - j = m_inputMesh.m_faces[i].m_i2; - face.m_i2 = remapIndex[j]; - - faces.PushBack(face); - } - - ProgressBar progressBar(this); - nd_::VHACD::IVHACD* const interfaceVHACD = nd_::VHACD::CreateVHACD(); - nd_::VHACD::IVHACD::Parameters paramsVHACD; - paramsVHACD.m_callback = &progressBar; - paramsVHACD.m_maxConvexHulls = m_maxConvexes; - paramsVHACD.m_concavityToVolumeWeigh = m_quality ? 1.0f : 0.5f; - interfaceVHACD->Compute(&points[0].m_x, uint32_t(vCount), (uint32_t*)&faces[0].m_i0, uint32_t(faces.GetCount()), paramsVHACD); - - ndInt32 hullCount = ndInt32(interfaceVHACD->GetNConvexHulls()); - for (ndInt32 i = 0; i < hullCount; ++i) - { - nd_::VHACD::IVHACD::ConvexHull ch; - interfaceVHACD->GetConvexHull(uint32_t(i), ch); - ndHullOutput* const outputHull = new ndHullOutput; - for (ndInt32 j = 0; j < ndInt32(ch.m_nPoints); ++j) - { - ndHullPoint point; - point.m_x = ndReal(ch.m_points[j * 3 + 0]); - point.m_y = ndReal(ch.m_points[j * 3 + 1]); - point.m_z = ndReal(ch.m_points[j * 3 + 2]); - outputHull->PushBack(point); - } - m_ouputHulls.PushBack(outputHull); - } - - interfaceVHACD->Clean(); - interfaceVHACD->Release(); - EndProgress(); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/ndConvexApproximation.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/ndConvexApproximation.h deleted file mode 100644 index c890a616b2..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/Public/thirdParty/ndConvexApproximation.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) <2003-2022> -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#pragma once -#include "ndNewton.h" - -class ndHullPoint -{ - public: - ndReal m_x; - ndReal m_y; - ndReal m_z; -}; - -class ndHullInputMesh -{ - public: - class ndFace - { - public: - ndInt32 m_i0; - ndInt32 m_i1; - ndInt32 m_i2; - }; - ndArray m_faces; - ndArray m_points; -}; - -class ndHullOutput: public ndArray -{ -}; - -class ndConvexApproximation -{ - class ProgressBar; - public: - D_CORE_API ndConvexApproximation(ndInt32 maxConvexes, bool quality); - D_CORE_API virtual ~ndConvexApproximation(); - - D_CORE_API void Execute(); - - D_CORE_API virtual void InitProgress(); - D_CORE_API virtual void Progress(); - D_CORE_API virtual void EndProgress(); - - ndHullInputMesh m_inputMesh; - ndArray m_ouputHulls; - ndInt32 m_maxConvexes; - bool m_quality; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/newtonLibrary.Build.cs b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/newtonLibrary.Build.cs deleted file mode 100644 index cc9034173d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/newtonLibrary.Build.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -using System.IO; -using UnrealBuildTool; - -public class newtonLibrary : ModuleRules -{ - public newtonLibrary(ReadOnlyTargetRules Target) : base(Target) - { - Type = ModuleType.External; - PublicSystemIncludePaths.Add("$(ModuleDir)/Public"); - - if (Target.Platform == UnrealTargetPlatform.Win64) - { - // Add the import library - PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "x64", "Release", "ExampleLibrary.lib")); - - // Delay-load the DLL, so we can load it from the right place first - PublicDelayLoadDLLs.Add("ExampleLibrary.dll"); - - // Ensure that the DLL is staged along with the executable - RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.dll"); - } - else if (Target.Platform == UnrealTargetPlatform.Mac) - { - PublicDelayLoadDLLs.Add(Path.Combine(ModuleDirectory, "Mac", "Release", "libExampleLibrary.dylib")); - RuntimeDependencies.Add("$(PluginDir)/Source/ThirdParty/newtonLibrary/Mac/Release/libExampleLibrary.dylib"); - } - else if (Target.Platform == UnrealTargetPlatform.Linux) - { - string ExampleSoPath = Path.Combine("$(PluginDir)", "Binaries", "ThirdParty", "newtonLibrary", "Linux", "x86_64-unknown-linux-gnu", "libExampleLibrary.so"); - PublicAdditionalLibraries.Add(ExampleSoPath); - PublicDelayLoadDLLs.Add(ExampleSoPath); - RuntimeDependencies.Add(ExampleSoPath); - } - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/newtonLibrary.tps b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/newtonLibrary.tps deleted file mode 100644 index 5bfce86dcc..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/newtonLibrary.tps +++ /dev/null @@ -1,6 +0,0 @@ - - - -Notes: This is a sample module and not actually third party. - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.dll b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.dll deleted file mode 100644 index 38d65ef835..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.dll and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.lib b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.lib deleted file mode 100644 index 3ab6edd242..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.lib and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.pdb b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.pdb deleted file mode 100644 index bd739b1953..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.pdb and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.lib b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.lib deleted file mode 100644 index c748360f82..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.lib and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.pdb b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.pdb deleted file mode 100644 index 2c77eef9db..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.pdb and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/Newton.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/Newton.cpp deleted file mode 100644 index f310c88c1f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/Newton.cpp +++ /dev/null @@ -1,556 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#include "Newton.h" -#include "EngineUtils.h" -#include "Misc/MessageDialog.h" -#include "Interfaces/IPluginManager.h" -#include "Misc/Paths.h" -#include "HAL/PlatformProcess.h" -#include "Containers/Ticker.h" -#include "ToolMenus.h" -#include "Selection.h" -#include "LandscapeProxy.h" -#include "BlueprintEditorModule.h" -#include "Kismet/GameplayStatics.h" -#include "Components/LineBatchComponent.h" - -#include "testButtonStyle.h" -#include "testButtonCommands.h" - -#include "NewtonJoint.h" -#include "NewtonCollision.h" -#include "NewtonRigidBody.h" -#include "NewtonSceneActor.h" -#include "NewtonWorldActor.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -#define LOCTEXT_NAMESPACE "FnewtonModule" - -FnewtonModule* FnewtonModule::m_pluginSingleton; - -int FnewtonModule::m_currentVersion = FnewtonModule::m_firstVersion; -const FGuid FnewtonModule::m_guiID(0x2EabFDBD, 0x0105C4D10, 0x8876F38F, 0x2516A5DA); -FCustomVersionRegistration FnewtonModule::m_guidRegistration(FnewtonModule::m_guiID, FnewtonModule::m_currentVersion, TEXT("FnewtonModule")); - -class FnewtonModule::ResourceCache -{ - public: - template - class Cache : public ndTree, long long> - { - public: - Cache() - :ndTree, long long>() - { - } - - ~Cache() - { - CollectGarbage(); - } - - TSharedPtr Find(long long hash) const - { - typename Cache::ndNode* const node = ndTree, long long>::Find(hash); - return node ? node->GetInfo() : TSharedPtr(); - } - - void Add(const TSharedPtr& object, long long hash) - { - check(!Find(hash)); - Cache::Insert(object, hash); - } - - void CollectGarbage() - { - typename Cache::Iterator it(*this); - for (it.Begin(); it; ) - { - typename Cache::ndNode* const node = it.GetNode(); - it++; - const TSharedPtr& resource = node->GetInfo(); - ndInt32 refCount = resource.GetSharedReferenceCount(); - if (refCount == 1) - { - //TSharedPtr* xxxx = &node->GetInfo(); - //node->GetInfo() = TSharedPtr(nullptr); - Cache::Remove(node); - //refCount *= 1; - } - } - } - }; - - ~ResourceCache() - { - } - - TSharedPtr FindDynamicMesh(long long hash) const - { - return m_visualMeshCache.Find(hash); - } - - void AddDynamicMesh(const TSharedPtr& mesh, long long hash) - { - m_visualMeshCache.Insert(mesh, hash); - } - - ndShape* FindShape(long long hash) const - { - ndTree::ndNode* const node = m_shapeCache.Find(hash); - return node ? node->GetInfo() : nullptr; - } - - void AddShape(ndShape* const shape, long long hash) - { - check(!m_shapeCache.Find(hash)); - shape->AddRef(); - m_shapeCache.Insert(shape, hash); - } - - void CollectGarbage() - { - ndTree::Iterator it(m_shapeCache); - for (it.Begin(); it; ) - { - ndTree::ndNode* const node = it.GetNode(); - it++; - ndShape* const shape = node->GetInfo(); - if (shape->GetRefCount() == 1) - { - shape->Release(); - m_shapeCache.Remove(node); - } - } - m_visualMeshCache.CollectGarbage(); - } - - ndTree m_shapeCache; - Cache m_visualMeshCache; -}; - -void FnewtonModule::StartupModule() -{ - // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module - // Get the base directory of this plugin - FString BaseDir = IPluginManager::Get().FindPlugin("newton")->GetBaseDir(); - - // Add on the relative location of the third party dll and load it - FString LibraryPath; -#if PLATFORM_WINDOWS - LibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.dll")); -#elif PLATFORM_MAC - LibraryPath = FPaths::Combine(*BaseDir, TEXT("Source/ThirdParty/newtonLibrary/Mac/Release/libExampleLibrary.dylib")); -#elif PLATFORM_LINUX - LibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/newtonLibrary/Linux/x86_64-unknown-linux-gnu/libExampleLibrary.so")); -#endif // PLATFORM_WINDOWS - - m_newtonLibraryHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr; - - //m_newtonWorld = nullptr; - m_runSimulation = false; - if (m_newtonLibraryHandle) - { - // Call the test function in the third party library that opens a message box - ndMemory::SetMemoryAllocators(PhysicsAlloc, PhysicsFree); - - FTSTicker& coretiker = FTSTicker::GetCoreTicker(); - m_tickDelegate = FTickerDelegate::CreateRaw(this, &FnewtonModule::Tick); - m_tickDelegateHandle = coretiker.AddTicker(m_tickDelegate); - } - else - { - FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Failed to load example third party library")); - } - - CreateEditorRunTimeButton(); - - m_pluginSingleton = this; - m_resourceCache = new ResourceCache; -} - -void FnewtonModule::ShutdownModule() -{ - delete m_resourceCache; - - UToolMenus::UnRegisterStartupCallback(this); - UToolMenus::UnregisterOwner(this); - FtestButtonStyle::Shutdown(); - FtestButtonCommands::Unregister(); - - if (m_newtonLibraryHandle) - { - FTSTicker::GetCoreTicker().RemoveTicker(m_tickDelegateHandle); - FPlatformProcess::FreeDllHandle(m_newtonLibraryHandle); - } - m_newtonLibraryHandle = nullptr; - - m_pluginSingleton = nullptr; -} - -void FnewtonModule::CreateEditorRunTimeButton() -{ - FtestButtonStyle::Initialize(); - FtestButtonStyle::ReloadTextures(); - - FtestButtonCommands::Register(); - - PluginCommands = MakeShareable(new FUICommandList); - - PluginCommands->MapAction( - FtestButtonCommands::Get().PluginAction, - FExecuteAction::CreateRaw(this, &FnewtonModule::ToggleEditorUpdates), - FCanExecuteAction()); - - UToolMenus::RegisterStartupCallback(FSimpleMulticastDelegate::FDelegate::CreateRaw(this, &FnewtonModule::RegisterMenus)); -} - -// memory allocation for Newton -void* FnewtonModule::PhysicsAlloc(size_t sizeInBytes) -{ - // I do not know how to allocate raw memory from Unreal - // hopefully operator new will do the right thing. - char* ptr = new char[sizeInBytes]; - return ptr; -} - -void FnewtonModule::PhysicsFree(void* ptr) -{ - delete[] ptr; -} - -void FnewtonModule::ToggleEditorUpdates() -{ - m_runSimulation = !m_runSimulation; -} - -FnewtonModule* FnewtonModule::GetPlugin() -{ - return m_pluginSingleton; -} - -TSharedPtr FnewtonModule::FindDynamicMesh(long long hash) const -{ - return m_resourceCache->FindDynamicMesh(hash); -} - -void FnewtonModule::AddDynamicMesh(const TSharedPtr& mesh, long long hash) -{ - m_resourceCache->AddDynamicMesh(mesh, hash); -} - -ndShape* FnewtonModule::FindShape(long long hash) const -{ - return m_resourceCache->FindShape(hash); -} - -void FnewtonModule::AddShape(ndShape* shape, long long hash) -{ - m_resourceCache->AddShape(shape, hash); -} - -void FnewtonModule::RegisterMenus() -{ - FToolMenuOwnerScoped OwnerScoped(this); - - { - UToolMenu* Menu = UToolMenus::Get()->ExtendMenu("LevelEditor.MainMenu.Window"); - { - FToolMenuSection& Section = Menu->FindOrAddSection("WindowLayout"); - Section.AddMenuEntryWithCommandList(FtestButtonCommands::Get().PluginAction, PluginCommands); - } - } - - { - UToolMenu* ToolbarMenu = UToolMenus::Get()->ExtendMenu("LevelEditor.LevelEditorToolBar.PlayToolBar"); - { - FToolMenuSection& Section = ToolbarMenu->FindOrAddSection("PluginTools"); - { - FToolMenuEntry& Entry = Section.AddEntry(FToolMenuEntry::InitToolBarButton(FtestButtonCommands::Get().PluginAction)); - Entry.SetCommandList(PluginCommands); - } - } - } -} - -void FnewtonModule::DrawGizmos(const UWorld* const world, float timestep) const -{ - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor->FindComponentByClass(UNewtonRigidBody::StaticClass())) - { - const TSet& components = actor->GetComponents(); - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonRigidBody* const body = Cast(*it); - if (body) - { - body->DrawGizmo(timestep); - } - - const UNewtonJoint* const joint = Cast(*it); - if (joint) - { - joint->DrawGizmo(timestep); - } - } - } - } -} - -void FnewtonModule::CleanupDebugLines(const UWorld* const world, float timestep) const -{ - ULineBatchComponent* const debugLines = world->PersistentLineBatcher.Get(); - { - ndInt32 lineCount = debugLines->BatchedLines.Num(); - for (int i = lineCount - 1; i >= 0; --i) - { - FBatchedLine& line = debugLines->BatchedLines[i]; - if (line.RemainingLifeTime >= 0.0f) - { - line.RemainingLifeTime -= timestep; - if (line.RemainingLifeTime < 0.0f) - { - lineCount--; - debugLines->BatchedLines[i] = debugLines->BatchedLines[lineCount]; - } - } - } - if (lineCount != debugLines->BatchedLines.Num()) - { - debugLines->BatchedLines.SetNum(lineCount); - debugLines->MarkRenderStateDirty(); - } - } - - { - ndInt32 pointCount = debugLines->BatchedPoints.Num(); - for (int i = pointCount - 1; i >= 0; --i) - { - FBatchedPoint& point = debugLines->BatchedPoints[i]; - if (point.RemainingLifeTime >= 0.0f) - { - point.RemainingLifeTime -= timestep; - if (point.RemainingLifeTime < 0.0f) - { - pointCount--; - debugLines->BatchedPoints[i] = debugLines->BatchedPoints[pointCount]; - } - } - } - if (pointCount != debugLines->BatchedPoints.Num()) - { - debugLines->BatchedPoints.SetNum(pointCount); - debugLines->MarkRenderStateDirty(); - } - } - - { - ndInt32 meshCount = debugLines->BatchedMeshes.Num(); - for (int i = meshCount - 1; i >= 0; --i) - { - FBatchedMesh& mesh = debugLines->BatchedMeshes[i]; - if (mesh.RemainingLifeTime >= 0.0f) - { - mesh.RemainingLifeTime -= timestep; - if (mesh.RemainingLifeTime < 0.0f) - { - meshCount--; - debugLines->BatchedMeshes[i] = debugLines->BatchedMeshes[meshCount]; - } - } - } - if (meshCount != debugLines->BatchedMeshes.Num()) - { - debugLines->BatchedMeshes.SetNum(meshCount); - debugLines->MarkRenderStateDirty(); - } - } - - m_resourceCache->CollectGarbage(); -} - -void FnewtonModule::UpdatePropertyChanges(const UWorld* const world) const -{ - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor->FindComponentByClass(UNewtonRigidBody::StaticClass())) - { - bool propertyChange = false; - ANewtonSceneActor* const sceneActor = Cast(actor); - if (sceneActor) - { - propertyChange = propertyChange || sceneActor->m_propertyChanged; - } - - const TSet& components = actor->GetComponents(); - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonCollision* const shape = Cast(*it); - if (shape) - { - propertyChange = propertyChange || shape->m_propertyChanged; - } - - UNewtonRigidBody* const body = Cast(*it); - if (body) - { - propertyChange = propertyChange || body->m_propertyChanged; - } - - UNewtonJoint* const joint = Cast(*it); - if (joint) - { - propertyChange = propertyChange || joint->m_propertyChanged; - } - } - - if (propertyChange) - { - if (sceneActor) - { - sceneActor->ApplyPropertyChanges(); - } - - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonCollision* const shape = Cast(*it); - if (shape) - { - shape->ApplyPropertyChanges(); - } - } - - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonRigidBody* const body = Cast(*it); - if (body) - { - body->ApplyPropertyChanges(); - } - } - - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonJoint* const joint = Cast(*it); - if (joint) - { - joint->ApplyPropertyChanges(); - } - } - } - } - } -} - -void FnewtonModule::InitNewtonWorld(ANewtonWorldActor* const newtonWorld) const -{ - UWorld* const world = newtonWorld->GetWorld(); - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor->FindComponentByClass(UNewtonRigidBody::StaticClass())) - { - const TSet& components = actor->GetComponents(); - - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonCollision* const shape = Cast(*it); - if (shape) - { - shape->ApplyPropertyChanges(); - } - } - - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonRigidBody* const body = Cast(*it); - if (body) - { - body->ApplyPropertyChanges(); - } - } - - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonJoint* const joint = Cast(*it); - if (joint) - { - joint->ApplyPropertyChanges(); - } - } - } - } - newtonWorld->StartGame(); -} - -bool FnewtonModule::Tick(float timestep) -{ - //if (! (GEngine && m_runSimulation)) - if (!GEngine) - { - return true; - } - - auto FindNewtonWorldActor = [this]() - { - const TIndirectArray& contexts = GEngine->GetWorldContexts(); - for (int i = contexts.Num() - 1; i >= 0; --i) - { - const FWorldContext& context = contexts[i]; - if (context.WorldType == EWorldType::PIE) - { - ANewtonWorldActor* const world = Cast(UGameplayStatics::GetActorOfClass(contexts[i].World(), ANewtonWorldActor::StaticClass())); - return (world && world->m_world) ? world : (ANewtonWorldActor*)nullptr; - } - } - return (ANewtonWorldActor*)nullptr; - }; - - ANewtonWorldActor* const newtonWorld = FindNewtonWorldActor(); - if (newtonWorld) - { - char tmp[256]; - float simTime = newtonWorld->GetSimTime() * 1.0e3f; - snprintf(tmp, sizeof(tmp), "timestep:%f(ms) physicsTime:%f(ms)", timestep * 1.0e3f, simTime); - - FString msg(tmp); - GEngine->AddOnScreenDebugMessage(INDEX_NONE, 0.0f, FColor::Yellow, msg); - - CleanupDebugLines(newtonWorld->GetWorld(), timestep); - if (newtonWorld->m_beginPlay) - { - InitNewtonWorld(newtonWorld); - } - newtonWorld->Update(timestep); - } - else - { - #if WITH_EDITOR - const TIndirectArray& contexts = GEngine->GetWorldContexts(); - - //float persitentTimestep = timestep * 1.5f; - float persitentTimestep = ndClamp(timestep * 1.5f, 0.0f, 1.0f); - for (int i = contexts.Num() - 1; i >= 0; --i) - { - const FWorldContext& context = contexts[i]; - if (context.WorldType != EWorldType::PIE) - { - UWorld* const world = context.World(); - - UpdatePropertyChanges(world); - CleanupDebugLines(world, timestep); - DrawGizmos(world, persitentTimestep); - } - } - #endif - } - - return true; -} - -#undef LOCTEXT_NAMESPACE - -IMPLEMENT_MODULE(FnewtonModule, newton) diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollision.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollision.cpp deleted file mode 100644 index 0a36b6d377..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollision.cpp +++ /dev/null @@ -1,335 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonCollision.h" -#include "Kismet/GameplayStatics.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "NewtonWorldActor.h" -#include "NewtonSceneActor.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -// Sets default values for this component's properties -UNewtonCollision::UNewtonCollision() - :Super() -{ - // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features - // off to improve performance if you don't need them. - //PrimaryComponentTick.bCanEverTick = true; - - m_hash = 0; - m_shape = nullptr; - m_showDebug = false; - m_propertyChanged = true; - m_debugVisualIsDirty = false; - - BestFit = false; - CastShadow = 0; - bExplicitShowWireframe = true; - m_geometryMesh = TObjectPtr(nullptr); - m_visualMesh = TSharedPtr(nullptr); - - ConstructorHelpers::FObjectFinder TexObj(TEXT("/newton/NewtonTransparentMaterial")); - m_transparentMaterial = Cast(TexObj.Object); - m_transparentMaterial->OpacityMaskClipValue = 0.0f; -} - -void UNewtonCollision::OnRegister() -{ - Super::OnRegister(); - m_propertyChanged = true; -} - -void UNewtonCollision::OnUnregister() -{ - Super::OnUnregister(); - if (m_shape) - { - m_shape->Release(); - m_shape = nullptr; - } - m_hash = 0; - m_visualMesh = TSharedPtr(nullptr); -} - -//USceneComponent* UNewtonCollision::GetGeometryMesh() const -TObjectPtr UNewtonCollision::GetGeometryMesh() const -{ - return m_geometryMesh; -} - -//void UNewtonCollision::SetGeometryMesh(USceneComponent* const geometry) -void UNewtonCollision::SetGeometryMesh(const TObjectPtr& geometry) -{ - m_geometryMesh = geometry; -} - -void UNewtonCollision::Serialize(FArchive& ar) -{ - Super::Serialize(ar); - ar << m_geometryMesh; -} - -void UNewtonCollision::PostLoad() -{ - Super::PostLoad(); - - m_propertyChanged = true; - - UDynamicMesh* mesh = GetDynamicMesh(); - check(mesh); - UE::Geometry::FDynamicMesh3* const triangleMesh = mesh->GetMeshPtr(); - triangleMesh->Clear(); -} - -void UNewtonCollision::OnAttachmentChanged() -{ - Super::OnAttachmentChanged(); - m_propertyChanged = true; -} - -void UNewtonCollision::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) -{ - Super::PostEditChangeProperty(PropertyChangedEvent); - m_propertyChanged = true; - if (BestFit) - { - BestFit = false; - } -} - -void UNewtonCollision::BeginDestroy() -{ - Super::BeginDestroy(); - if (m_shape) - { - m_shape->Release(); - m_shape = nullptr; - } - m_hash = 0; - m_visualMesh = TSharedPtr(nullptr); -} - -bool UNewtonCollision::ShouldCreatePhysicsState() const -{ - Super::ShouldCreatePhysicsState(); - return false; -} - -long long UNewtonCollision::CalculateHash() const -{ - check(0); - return 0; -} - -ndShape* UNewtonCollision::CreateShape() const -{ - check(0); - return new ndShapeNull(); -} - -void UNewtonCollision::BuildNewtonShape() -{ - const ANewtonSceneActor* const owner = Cast(GetOwner()); - if (owner) - { - const FTransform bodyTransform(owner->GetRootComponent()->GetComponentToWorld()); - const FTransform meshTransform(m_geometryMesh->GetComponentToWorld()); - const FTransform transform(meshTransform * bodyTransform.Inverse()); - SetComponentToWorld(transform); - } - - long long hash = CalculateHash(); - if (m_hash != hash) - { - m_hash = hash; - m_debugVisualIsDirty = true; - if (m_shape) - { - m_shape->Release(); - } - - FnewtonModule* const plugin = FnewtonModule::GetPlugin(); - check(plugin); - ndShape* shape = plugin->FindShape(m_hash); - if (!shape) - { - shape = CreateShape(); - plugin->AddShape(shape, m_hash); - } - m_shape = (ndShape*)shape->AddRef(); - } -} - -void UNewtonCollision::SetWireFrameColor(const FLinearColor& color) -{ - WireframeColor = color; - OnRenderingStateChanged(false); - MarkRenderDynamicDataDirty(); - NotifyMeshUpdated(); -} - -ndShapeInstance* UNewtonCollision::CreateInstanceShape() const -{ - ndShapeInstance* const instance = new ndShapeInstance(m_shape); - return instance; -} - -ndShapeInstance* UNewtonCollision::CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const -{ - ndShapeInstance* const instance = CreateInstanceShape(); - - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(1.0f)); - - const FTransform transform(GetComponentToWorld()); - const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform) * bodyMatrix.OrthoInverse()); - - instance->SetScale(scale); - instance->SetLocalMatrix(matrix); - return instance; -} - -void UNewtonCollision::ApplyPropertyChanges() -{ - class PolygonizeMesh : public ndShapeDebugNotify - { - public: - PolygonizeMesh() - :ndShapeDebugNotify() - ,m_scale(UNREAL_UNIT_SYSTEM) - { - } - - void DrawPolygon(ndInt32 vertexCount, const ndVector* const faceArray, const ndEdgeType* const) - { - ndInt32 baseIndex = m_points.GetCount(); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - m_points.PushBack(faceArray[i] * m_scale); - } - - for (ndInt32 i = 2; i < vertexCount; ++i) - { - m_index.PushBack(baseIndex); - m_index.PushBack(baseIndex + i - 0); - m_index.PushBack(baseIndex + i - 1); - } - } - - TSharedPtr CreateDynamicMesh3() - { - ndArray remapIndex; - remapIndex.SetCount(m_points.GetCount()); - ndInt32 vertexCount = ndVertexListToIndexList(&m_points[0].m_x, sizeof(ndVector), 3, ndInt32(m_points.GetCount()), &remapIndex[0], 1.0e-5f); - - ndArray unrealVertexIndex; - unrealVertexIndex.SetCount(m_points.GetCount()); - - TSharedPtr mesh3(new UE::Geometry::FDynamicMesh3()); - UE::Geometry::FDynamicMesh3* const triangleMesh = mesh3.Get(); - - triangleMesh->Clear(); - for (ndInt32 i = 0; i < vertexCount; ++i) - { - FVector3d p(m_points[i].m_x, m_points[i].m_y, m_points[i].m_z); - unrealVertexIndex[i] = triangleMesh->AppendVertex(p); - } - - for (ndInt32 i = 0; i < m_index.GetCount(); i += 3) - { - int k0 = remapIndex[m_index[i + 0]]; - int k1 = remapIndex[m_index[i + 1]]; - int k2 = remapIndex[m_index[i + 2]]; - - int j0 = unrealVertexIndex[k0]; - int j1 = unrealVertexIndex[k1]; - int j2 = unrealVertexIndex[k2]; - triangleMesh->AppendTriangle(j0, j1, j2); - } - return mesh3; - } - - const ndVector m_scale; - ndArray m_index; - ndArray m_points; - }; - - if (m_geometryMesh.Get()) - { - m_debugVisualIsDirty = true; - } - - m_propertyChanged = false; - - if (m_shape) - { - auto GetDebugMode = [this]() - { - for (USceneComponent* component = GetAttachParent(); component; component = component->GetAttachParent()) - { - const UNewtonRigidBody* const rigidBody = Cast(component); - if (rigidBody) - { - return rigidBody->ShowDebug; - } - } - return false; - }; - - bool showDebug = GetDebugMode(); - if (showDebug) - { - if (!m_showDebug && m_debugVisualIsDirty) - { - FnewtonModule* const plugin = FnewtonModule::GetPlugin(); - check(plugin); - TSharedPtr visualMesh(plugin->FindDynamicMesh(m_hash)); - if (visualMesh.Get() == nullptr) - { - //UE_LOG(LogTemp, Warning, TEXT("Rebuild Mesh")); - PolygonizeMesh wireMesh; - ndShapeInstance* const instanceShape = CreateInstanceShape(); - instanceShape->DebugShape(ndGetIdentityMatrix(), wireMesh); - visualMesh = wireMesh.CreateDynamicMesh3(); - plugin->AddDynamicMesh(visualMesh, m_hash); - - delete instanceShape; - } - - m_visualMesh = visualMesh; - UDynamicMesh* const dynMesh = GetDynamicMesh(); - dynMesh->SetMesh(UE::Geometry::FDynamicMesh3(*visualMesh.Get())); - - UMaterialInstanceDynamic* const transparentMaterialInstance = UMaterialInstanceDynamic::Create(m_transparentMaterial, nullptr); - SetMaterial(0, transparentMaterialInstance); - } - } - else - { - // remove the show debug mesh - UE::Geometry::FDynamicMesh3* const triangleMesh = GetDynamicMesh()->GetMeshPtr(); - triangleMesh->Clear(); - } - - m_showDebug = showDebug; - m_debugVisualIsDirty = false; - OnRenderingStateChanged(false); - MarkRenderDynamicDataDirty(); - NotifyMeshUpdated(); - } -} - -ndVector UNewtonCollision::GetVolumePosition() const -{ - ndVector posit(0.0f); - const ndShapeInstance* const instance = CreateInstanceShape(); - if (instance) - { - posit = instance->GetLocalMatrix().m_posit; - posit.m_w = instance->GetVolume(); - delete instance; - } - return posit; -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollision.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollision.h deleted file mode 100644 index 68858b6f88..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollision.h +++ /dev/null @@ -1,67 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" - -#include "Components/DynamicMeshComponent.h" -#include "NewtonCollision.generated.h" - -class ndShape; -class ndVector; -class ndMatrix; -class ndShapeInstance; -class UNewtonRigidBody; - -template -class ndSharedPtr; - -//UCLASS(ClassGroup = NewtonCollision, meta=(BlueprintSpawnableComponent), HideCategories = (RayTracing, Mobile, TextureStreaming, VirtualTexture, MaterialParameters, DynamicMeshComponent, Advanced, Activation, Collision, Lighting, BodySetup, Primitives, HLOD, ComponentTick, Rendering, Physics, Tags, Replication, ComponentReplication, Cooking, Events, LOD, Navigation, AssetUserData), MinimalAPI) -UCLASS(Abstract, meta=(BlueprintSpawnableComponent), HideCategories = (RayTracing, Mobile, TextureStreaming, VirtualTexture, MaterialParameters, DynamicMeshComponent, Advanced, Activation, Collision, Lighting, BodySetup, Primitives, HLOD, ComponentTick, Rendering, Physics, Tags, Replication, ComponentReplication, Cooking, Events, LOD, Navigation, AssetUserData), MinimalAPI) -class UNewtonCollision : public UDynamicMeshComponent -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonCollision(); - - virtual ndVector GetVolumePosition() const; - TObjectPtr GetGeometryMesh() const; - void SetGeometryMesh(const TObjectPtr& tile); - virtual void SetWireFrameColor(const FLinearColor& color); - - protected: - UPROPERTY(EditAnywhere, Category = Newton) - bool BestFit; - - // Called when the game starts - virtual void OnRegister(); - virtual void OnUnregister(); - virtual void PostLoad() override; - virtual void OnAttachmentChanged(); - virtual void BeginDestroy() override; - virtual void Serialize(FArchive& Ar) override; - virtual bool ShouldCreatePhysicsState() const override; - virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; - - virtual void BuildNewtonShape(); - virtual void ApplyPropertyChanges(); - virtual ndShape* CreateShape() const; - virtual long long CalculateHash() const; - virtual ndShapeInstance* CreateInstanceShape() const; - virtual ndShapeInstance* CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const; - - //public: - long long m_hash; - ndShape* m_shape; - TObjectPtr m_geometryMesh; - TSharedPtr m_visualMesh; - UMaterial* m_transparentMaterial; - bool m_propertyChanged; - bool m_showDebug; - bool m_debugVisualIsDirty; - friend class FnewtonModule; - friend class UNewtonRigidBody; - friend class UNewtonSceneRigidBody; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionBox.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionBox.cpp deleted file mode 100644 index 15af4e9199..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionBox.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonCollisionBox.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -UNewtonCollisionBox::UNewtonCollisionBox() - :Super() - ,SizeX(100.0f) - ,SizeY(100.0f) - ,SizeZ(100.0f) -{ -} - -ndShape* UNewtonCollisionBox::CreateShape() const -{ - return new ndShapeBox(SizeX * UNREAL_INV_UNIT_SYSTEM, SizeY * UNREAL_INV_UNIT_SYSTEM, SizeZ * UNREAL_INV_UNIT_SYSTEM); -} - -long long UNewtonCollisionBox::CalculateHash() const -{ - long long hash = ndCRC64(ndShapeBox::StaticClassName(), strlen(ndShapeBox::StaticClassName()), 0); - hash = ndCRC64(&SizeX, sizeof(float), hash); - hash = ndCRC64(&SizeY, sizeof(float), hash); - hash = ndCRC64(&SizeZ, sizeof(float), hash); - return hash; -} - -void UNewtonCollisionBox::ApplyPropertyChanges() -{ - //if (BestFit) - //{ - // UStaticMeshComponent* const meshComp = Cast(GetAttachParent()); - // if (meshComp && meshComp->GetStaticMesh()) - // { - // //FBoxSphereBounds bounds(meshComp->CalcBounds(FTransform())); - // //SizeX = ndMax(float(bounds.BoxExtent.X * 2.0f), 2.0f); - // //SizeY = ndMax(float(bounds.BoxExtent.Y * 2.0f), 2.0f); - // //SizeZ = ndMax(float(bounds.BoxExtent.Z * 2.0f), 2.0f); - // //FTransform tranform; - // //tranform.SetLocation(bounds.Origin); - // //SetRelativeTransform(tranform); - // } - //} - - BuildNewtonShape(); - Super::ApplyPropertyChanges(); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionBox.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionBox.h deleted file mode 100644 index dcaf52b4a5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionBox.h +++ /dev/null @@ -1,37 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonCollision.h" -#include "NewtonCollisionBox.generated.h" - -class ndShapeInstance; -class UNewtonRigidBody; - -/** - * - */ -UCLASS(ClassGroup=(NewtonCollision), meta=(BlueprintSpawnableComponent)) -class UNewtonCollisionBox : public UNewtonCollision -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonCollisionBox(); - - protected: - virtual void ApplyPropertyChanges(); - virtual ndShape* CreateShape() const; - virtual long long CalculateHash() const; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 2.0f)) - float SizeX; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 2.0f)) - float SizeY; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 2.0f)) - float SizeZ; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCapsule.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCapsule.cpp deleted file mode 100644 index 0aa7fcabfd..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCapsule.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonCollisionCapsule.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -UNewtonCollisionCapsule::UNewtonCollisionCapsule() - :Super() - ,Radio0(50.0f) - ,Radio1(50.0f) - ,Length(100.0f) -{ -} - -ndShape* UNewtonCollisionCapsule::CreateShape() const -{ - return new ndShapeCapsule(Radio0 * UNREAL_INV_UNIT_SYSTEM, Radio1 * UNREAL_INV_UNIT_SYSTEM, Length * UNREAL_INV_UNIT_SYSTEM); -} - -long long UNewtonCollisionCapsule::CalculateHash() const -{ - long long hash = ndCRC64(ndShapeCapsule::StaticClassName(), strlen(ndShapeCapsule::StaticClassName()), 0); - hash = ndCRC64(&Radio0, sizeof(float), hash); - hash = ndCRC64(&Radio1, sizeof(float), hash); - hash = ndCRC64(&Length, sizeof(float), hash); - return hash; -} - -void UNewtonCollisionCapsule::ApplyPropertyChanges() -{ - if (BestFit) - { - for (USceneComponent* parent = GetAttachParent(); parent; parent = parent->GetAttachParent()) - { - UStaticMeshComponent* const meshComp = Cast(parent); - if (meshComp && meshComp->GetStaticMesh()) - { - //FBoxSphereBounds bounds(meshComp->CalcBounds(FTransform())); - //SizeX = ndMax(float(bounds.BoxExtent.X * 2.0f), 2.0f); - //SizeY = ndMax(float(bounds.BoxExtent.Y * 2.0f), 2.0f); - //SizeZ = ndMax(float(bounds.BoxExtent.Z * 2.0f), 2.0f); - //SetRelativeTransform(FTransform()); - break; - } - } - } - BuildNewtonShape(); - - Super::ApplyPropertyChanges(); -} - -ndShapeInstance* UNewtonCollisionCapsule::CreateInstanceShape() const -{ - ndShapeInstance* const instance = Super::CreateInstanceShape(); - const ndMatrix aligment(ndYawMatrix(ndPi * 0.5f)); - instance->SetLocalMatrix(aligment * instance->GetLocalMatrix()); - return instance; -} - -ndShapeInstance* UNewtonCollisionCapsule::CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const -{ - ndShapeInstance* const instance = Super::CreateBodyInstanceShape(bodyMatrix); - const ndMatrix aligment(ndYawMatrix(ndPi * 0.5f)); - instance->SetLocalMatrix(aligment * instance->GetLocalMatrix()); - return instance; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCapsule.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCapsule.h deleted file mode 100644 index 555abea877..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCapsule.h +++ /dev/null @@ -1,39 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonCollision.h" -#include "NewtonCollisionCapsule.generated.h" - -class ndShapeInstance; -class UNewtonRigidBody; - -/** - * - */ -UCLASS(ClassGroup=(NewtonCollision), meta=(BlueprintSpawnableComponent)) -class UNewtonCollisionCapsule : public UNewtonCollision -{ - GENERATED_BODY() - public: - // Sets default values for this component's properties - UNewtonCollisionCapsule(); - - protected: - virtual void ApplyPropertyChanges(); - virtual ndShape* CreateShape() const; - virtual long long CalculateHash() const; - virtual ndShapeInstance* CreateInstanceShape() const override; - virtual ndShapeInstance* CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const override; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 2.0f)) - float Radio0; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 2.0f)) - float Radio1; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 2.0f)) - float Length; - -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionConvexHull.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionConvexHull.cpp deleted file mode 100644 index ff62126b67..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionConvexHull.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonCollisionConvexHull.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "NewtonSceneActor.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" -#include "ThirdParty/newtonLibrary/Public/thirdParty/ndConvexApproximation.h" - -UNewtonCollisionConvexHull::UNewtonCollisionConvexHull() - :Super() - ,Tolerance(1.0e-3f) - ,MaxVertexCount(128) -{ -} - -void UNewtonCollisionConvexHull::Serialize(FArchive& ar) -{ - Super::Serialize(ar); - - // this actually sucks big time in unreal - //ar.UsingCustomVersion(FnewtonModule::m_guiID); - //int xxxx0 = ar.CustomVer(FnewtonModule::m_guiID); - - ar << m_proceduralData; -} - -void UNewtonCollisionConvexHull::SetProceduralData(const ndHullOutput& pointCloud) -{ - m_proceduralData.Empty(); - for (ndInt32 i = pointCloud.GetCount() - 1; i >= 0; --i) - { - FVector3f p(pointCloud[i].m_x, pointCloud[i].m_y, pointCloud[i].m_z); - m_proceduralData.Push(p); - } -} - -long long UNewtonCollisionConvexHull::CalculateHash() const -{ - long long hash = ndCRC64(ndShapeConvexHull::StaticClassName(), strlen(ndShapeConvexHull::StaticClassName()), 0); - if (m_proceduralData.Num()) - { - for (int i = m_proceduralData.Num() - 1; i >= 0; --i) - { - const FVector3f point(m_proceduralData[i]); - hash = ndCRC64(&point, sizeof(point), hash); - } - } - else - { - auto FindStaticMesh = [this]() - { - const UStaticMeshComponent* const mesh = Cast(GetAttachParent()); - if (mesh && mesh->GetStaticMesh().Get()) - { - return mesh->GetStaticMesh().Get(); - } - UStaticMeshComponent* const staticMesh = Cast(GetGeometryMesh()); - if (staticMesh) - { - - } - return staticMesh ? staticMesh->GetStaticMesh().Get() : (UStaticMesh*) nullptr; - }; - - const UStaticMesh* const staticMesh = FindStaticMesh(); - if (staticMesh) - { - const FStaticMeshRenderData* const renderData = staticMesh->GetRenderData(); - const FStaticMeshLODResourcesArray& renderResource = renderData->LODResources; - - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(0.0f)); - const ndVector bakedScale(scale.Scale(UNREAL_INV_UNIT_SYSTEM)); - - const FStaticMeshLODResources& renderLOD = renderResource[0]; - const FStaticMeshVertexBuffers& staticMeshVertexBuffer = renderLOD.VertexBuffers;; - const FPositionVertexBuffer& positBuffer = staticMeshVertexBuffer.PositionVertexBuffer; - for (int i = positBuffer.GetNumVertices() - 1; i >= 0; --i) - { - const FVector3f p(positBuffer.VertexPosition(i)); - const ndVector q(ndFloat32(p.X), ndFloat32(p.Y), ndFloat32(p.Z), ndFloat32(0.0f)); - const ndVector hashPoint(bakedScale * q); - hash = ndCRC64(&hashPoint, sizeof(hashPoint), hash); - } - } - } - return hash; -} - -ndShape* UNewtonCollisionConvexHull::CreateShape() const -{ - if (m_proceduralData.Num()) - { - ndArray points; - for (int i = m_proceduralData.Num() - 1; i >= 0; --i) - { - const ndVector p(ndFloat32(m_proceduralData[i].X), ndFloat32(m_proceduralData[i].Y), ndFloat32(m_proceduralData[i].Z), ndFloat32(0.0f)); - points.PushBack(p); - } - ndShape* const shape = new ndShapeConvexHull(m_proceduralData.Num(), sizeof(ndVector), Tolerance, &points[0].m_x, MaxVertexCount); - return shape; - } - else - { - auto FindStaticMesh = [this]() - { - const UStaticMeshComponent* const mesh = Cast(GetAttachParent()); - if (mesh && mesh->GetStaticMesh().Get()) - { - return mesh->GetStaticMesh().Get(); - } - UStaticMeshComponent* const staticMesh = Cast(GetGeometryMesh()); - return staticMesh ? staticMesh->GetStaticMesh().Get() : (UStaticMesh*) nullptr; - }; - - const UStaticMesh* const staticMesh = FindStaticMesh(); - if (staticMesh) - { - const FStaticMeshRenderData* const renderData = staticMesh->GetRenderData(); - const FStaticMeshLODResourcesArray& renderResource = renderData->LODResources; - - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(0.0f)); - const ndVector bakedScale(scale.Scale(UNREAL_INV_UNIT_SYSTEM)); - - const FStaticMeshLODResources& renderLOD = renderResource[0]; - const FStaticMeshVertexBuffers& staticMeshVertexBuffer = renderLOD.VertexBuffers;; - const FPositionVertexBuffer& positBuffer = staticMeshVertexBuffer.PositionVertexBuffer; - - ndArray points; - for (int i = positBuffer.GetNumVertices() - 1; i >= 0; --i) - { - const FVector3f p(positBuffer.VertexPosition(i)); - const ndVector q(ndFloat32(p.X), ndFloat32(p.Y), ndFloat32(p.Z), ndFloat32(0.0f)); - points.PushBack(q * bakedScale); - } - ndShape* const shape = new ndShapeConvexHull(positBuffer.GetNumVertices(), sizeof(ndVector), Tolerance, &points[0].m_x, MaxVertexCount); - return shape; - } - } - return new ndShapeNull(); -} - -void UNewtonCollisionConvexHull::ApplyPropertyChanges() -{ - if (m_proceduralData.Num()) - { - m_debugVisualIsDirty = true; - } - BuildNewtonShape(); - Super::ApplyPropertyChanges(); -} - -ndShapeInstance* UNewtonCollisionConvexHull::CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const -{ - ndShapeInstance* const instance = CreateInstanceShape(); - - const ndVector scale(ndFloat32(1.0f)); - const FTransform transform(GetComponentToWorld()); - const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform) * bodyMatrix.OrthoInverse()); - - instance->SetScale(scale); - instance->SetLocalMatrix(matrix); - return instance; -} - -ndShapeInstance* UNewtonCollisionConvexHull::CreateInstanceShape() const -{ - ndShapeInstance* const instance = new ndShapeInstance(m_shape); - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(1.0f / uScale.X), ndFloat32(1.0f / uScale.Y), ndFloat32(1.0f / uScale.Z), ndFloat32(0.0f)); - instance->SetScale(scale); - return instance; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionConvexHull.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionConvexHull.h deleted file mode 100644 index de209679e5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionConvexHull.h +++ /dev/null @@ -1,44 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonCollision.h" -#include "NewtonCollisionConvexHull.generated.h" - -class ndHullOutput; -class ndShapeInstance; -class UNewtonRigidBody; - -/** - * - */ -UCLASS(ClassGroup=(NewtonCollision), meta=(BlueprintSpawnableComponent)) -class UNewtonCollisionConvexHull : public UNewtonCollision -{ - GENERATED_BODY() - public: - // Sets default values for this component's properties - UNewtonCollisionConvexHull(); - - void SetProceduralData(const ndHullOutput& pointCloud); - - protected: - virtual void Serialize(FArchive& Ar) override; - - virtual void ApplyPropertyChanges(); - virtual ndShape* CreateShape() const; - virtual long long CalculateHash() const; - virtual ndShapeInstance* CreateInstanceShape() const; - virtual ndShapeInstance* CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.001f)) - float Tolerance; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 16)) - int MaxVertexCount; - - TArray m_proceduralData; -}; - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCylinder.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCylinder.cpp deleted file mode 100644 index b4f526bf2b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCylinder.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#include "NewtonCollisionCylinder.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -UNewtonCollisionCylinder::UNewtonCollisionCylinder() - :Super() - ,Radio0(50.0f) - ,Radio1(50.0f) - ,Length(100.0f) -{ -} - -ndShape* UNewtonCollisionCylinder::CreateShape() const -{ - return new ndShapeCylinder(Radio0 * UNREAL_INV_UNIT_SYSTEM, Radio1 * UNREAL_INV_UNIT_SYSTEM, Length * UNREAL_INV_UNIT_SYSTEM); -} - -long long UNewtonCollisionCylinder::CalculateHash() const -{ - long long hash = ndCRC64(ndShapeCylinder::StaticClassName(), strlen(ndShapeCylinder::StaticClassName()), 0); - hash = ndCRC64(&Radio0, sizeof(float), hash); - hash = ndCRC64(&Radio1, sizeof(float), hash); - hash = ndCRC64(&Length, sizeof(float), hash); - return hash; -} - -void UNewtonCollisionCylinder::ApplyPropertyChanges() -{ - if (BestFit) - { - for (USceneComponent* parent = GetAttachParent(); parent; parent = parent->GetAttachParent()) - { - UStaticMeshComponent* const meshComp = Cast(parent); - if (meshComp && meshComp->GetStaticMesh()) - { - //FBoxSphereBounds bounds(meshComp->CalcBounds(FTransform())); - //SizeX = ndMax(float(bounds.BoxExtent.X * 2.0f), 2.0f); - //SizeY = ndMax(float(bounds.BoxExtent.Y * 2.0f), 2.0f); - //SizeZ = ndMax(float(bounds.BoxExtent.Z * 2.0f), 2.0f); - //SetRelativeTransform(FTransform()); - break; - } - } - } - BuildNewtonShape(); - - Super::ApplyPropertyChanges(); -} - -ndShapeInstance* UNewtonCollisionCylinder::CreateInstanceShape() const -{ - ndShapeInstance* const instance = Super::CreateInstanceShape(); - const ndMatrix aligment(ndYawMatrix(ndPi * 0.5f)); - instance->SetLocalMatrix(aligment * instance->GetLocalMatrix()); - return instance; -} - -ndShapeInstance* UNewtonCollisionCylinder::CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const -{ - ndShapeInstance* const instance = Super::CreateBodyInstanceShape(bodyMatrix); - const ndMatrix aligment(ndYawMatrix(ndPi * 0.5f)); - instance->SetLocalMatrix(aligment * instance->GetLocalMatrix()); - return instance; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCylinder.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCylinder.h deleted file mode 100644 index 571bb2c19b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionCylinder.h +++ /dev/null @@ -1,39 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonCollision.h" -#include "NewtonCollisionCylinder.generated.h" - -class ndShapeInstance; -class UNewtonRigidBody; - -/** - * - */ -UCLASS(ClassGroup=(NewtonCollision), meta=(BlueprintSpawnableComponent)) -class UNewtonCollisionCylinder : public UNewtonCollision -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonCollisionCylinder(); - - protected: - virtual void ApplyPropertyChanges(); - virtual ndShape* CreateShape() const; - virtual long long CalculateHash() const; - virtual ndShapeInstance* CreateInstanceShape() const override; - virtual ndShapeInstance* CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const override; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 2.0f)) - float Radio0; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 2.0f)) - float Radio1; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 2.0f)) - float Length; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionLandscape.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionLandscape.cpp deleted file mode 100644 index ccba839e8b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionLandscape.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonCollisionLandscape.h" - -#include "Landscape.h" -#include "LandscapeProxy.h" -#include "Chaos/HeightField.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -UNewtonCollisionLandscape::UNewtonCollisionLandscape() - :Super() -{ - //SetMobility(EComponentMobility::Static); -} - -long long UNewtonCollisionLandscape::CalculateHash() const -{ - const ULandscapeHeightfieldCollisionComponent* const tile = Cast(GetGeometryMesh().Get()); - check(tile); - - const ULandscapeHeightfieldCollisionComponent::FHeightfieldGeometryRef* const heightfieldRef = tile->HeightfieldRef; - const Chaos::FHeightField* const mapData = heightfieldRef->HeightfieldGeometry; - const Chaos::FHeightField::FData& elevationData = mapData->GeomData; - - const Chaos::FVec3 elevationScale(elevationData.Scale); - ndFloat32 xScale = elevationScale[0] * UNREAL_INV_UNIT_SYSTEM; - // this is not a bug, y and z are swapped after the mapping - ndFloat32 zScale = elevationScale[1] * UNREAL_INV_UNIT_SYSTEM; - ndFloat32 yScale = elevationScale[2] * UNREAL_INV_UNIT_SYSTEM; - - long long hash = ndCRC64(ndShapeHeightfield::StaticClassName(), strlen(ndShapeHeightfield::StaticClassName()), 0); - hash = ndCRC64(&xScale, sizeof(float), hash); - hash = ndCRC64(&yScale, sizeof(float), hash); - hash = ndCRC64(&zScale, sizeof(float), hash); - hash = ndCRC64(&elevationData.Heights[0], sizeof(uint16) * elevationData.Heights.Num(), hash); - return hash; -} - -void UNewtonCollisionLandscape::ApplyPropertyChanges() -{ - BuildNewtonShape(); - Super::ApplyPropertyChanges(); -} - -ndShape* UNewtonCollisionLandscape::CreateShape() const -{ - const ULandscapeHeightfieldCollisionComponent* const tile = Cast(GetGeometryMesh().Get()); - check(tile); - - const ULandscapeHeightfieldCollisionComponent::FHeightfieldGeometryRef* const heightfieldRef = tile->HeightfieldRef; - const Chaos::FHeightField* const mapData = heightfieldRef->HeightfieldGeometry; - check(mapData); - const Chaos::FHeightField::FData& elevationData = mapData->GeomData; - - const Chaos::FVec3 elevationScale(elevationData.Scale); - // this is not a bug, y and z are swapped after the mapping - ndFloat32 xScale = elevationScale[0] * UNREAL_INV_UNIT_SYSTEM; - ndFloat32 zScale = elevationScale[1] * UNREAL_INV_UNIT_SYSTEM; - - ndShapeHeightfield* const shape = new ndShapeHeightfield( - ndInt32(mapData->GetNumCols()), ndInt32(mapData->GetNumRows()), - ndShapeHeightfield::m_normalDiagonals, xScale, zScale); - - ndReal minValue = elevationData.MinValue; - ndReal highScale = elevationData.HeightPerUnit; - - const ndShapeInfo info(((ndShape*)shape)->GetShapeInfo()); - ndReal* const dstHeigh = info.m_heightfield.m_elevation; - ndReal yScale = ndReal(elevationScale[2] * UNREAL_INV_UNIT_SYSTEM); - - ndInt32 dstRow = 0; - ndInt32 srcRow = (ndInt32(elevationData.NumRows) - 1) * elevationData.NumCols; - for (ndInt32 row = ndInt32(elevationData.NumRows) - 1; row >= 0; --row) - { - for (ndInt32 colum = elevationData.NumCols - 1; colum >= 0; --colum) - { - ndReal h = minValue + ndReal(elevationData.Heights[srcRow + colum]) * highScale; - dstHeigh[dstRow + colum] = h * yScale; - } - srcRow -= elevationData.NumCols; - dstRow += elevationData.NumCols; - } - - shape->UpdateElevationMapAabb(); - return shape; -} - -ndShapeInstance* UNewtonCollisionLandscape::CreateInstanceShape() const -{ - ndShapeInstance* const instance = new ndShapeInstance(m_shape); - ULandscapeHeightfieldCollisionComponent* const tile = Cast(GetGeometryMesh().Get()); - check(tile); - const FVector uScale(GetComponentToWorld().GetScale3D()); - ndMatrix origin(ndGetIdentityMatrix()); - //origin.m_posit.m_x = ndFloat32(tile->SectionBaseX * tile->CollisionScale * uScale.X * UNREAL_INV_UNIT_SYSTEM); - origin.m_posit.m_y = ndFloat32(tile->CollisionSizeQuads * tile->CollisionScale * uScale.Y * UNREAL_INV_UNIT_SYSTEM); - - const ndMatrix aligment(ndPitchMatrix(ndPi * 0.5f)); - const ndMatrix tileMatrix(aligment * origin); - instance->SetLocalMatrix(tileMatrix); - - ndMatrix scaleMatrix(ndGetIdentityMatrix()); - scaleMatrix[0][0] = ndFloat32(1.0f / uScale.X); - scaleMatrix[1][1] = ndFloat32(1.0f / uScale.Y); - scaleMatrix[2][2] = ndFloat32(1.0f / uScale.Z); - const ndMatrix instanceMatrix(tileMatrix * scaleMatrix * tileMatrix.OrthoInverse()); - instance->SetGlobalScale(instanceMatrix); - return instance; -} - -ndShapeInstance* UNewtonCollisionLandscape::CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const -{ - ndShapeInstance* const instance = new ndShapeInstance(m_shape); - ULandscapeHeightfieldCollisionComponent* const tile = Cast(GetGeometryMesh().Get()); - check(tile); - const FTransform transform(GetComponentToWorld()); - const ndMatrix matrix (UNewtonRigidBody::ToNewtonMatrix(transform)); - const FVector uScale(transform.GetScale3D()); - ndMatrix origin(ndGetIdentityMatrix()); - //origin.m_posit.m_x = ndFloat32(tile->SectionBaseX * tile->CollisionScale * uScale.X); - origin.m_posit.m_y = ndFloat32(tile->CollisionSizeQuads * tile->CollisionScale * uScale.Y * UNREAL_INV_UNIT_SYSTEM); - - const ndMatrix aligment(ndPitchMatrix(ndPi * 0.5f)); - const ndMatrix tileMatrix(aligment * origin * matrix * bodyMatrix); - instance->SetLocalMatrix(tileMatrix); - - //ndMatrix scaleMatrix(ndGetIdentityMatrix()); - //scaleMatrix[0][0] = ndFloat32(1.0f / uScale.X); - //scaleMatrix[1][1] = ndFloat32(1.0f / uScale.Y); - //scaleMatrix[2][2] = ndFloat32(1.0f / uScale.Z); - //const ndMatrix instanceMatrix(tileMatrix * scaleMatrix * tileMatrix.OrthoInverse()); - //instance->SetGlobalScale(instanceMatrix); - return instance; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionLandscape.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionLandscape.h deleted file mode 100644 index 3b32dfe19e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionLandscape.h +++ /dev/null @@ -1,33 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonCollision.h" -#include "NewtonCollisionLandscape.generated.h" - -class ndShapeInstance; -class UNewtonRigidBody; -class ULandscapeHeightfieldCollisionComponent; - -/** - * - */ - -//UCLASS(Abstract, meta=(BlueprintSpawnableComponent)) -UCLASS(ClassGroup= NewtonLandScape, meta=(BlueprintSpawnableComponent)) -class UNewtonCollisionLandscape : public UNewtonCollision -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonCollisionLandscape(); - - private: - virtual void ApplyPropertyChanges(); - virtual ndShape* CreateShape() const; - virtual long long CalculateHash() const; - virtual ndShapeInstance* CreateInstanceShape() const; - virtual ndShapeInstance* CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.cpp deleted file mode 100644 index e494001d33..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.cpp +++ /dev/null @@ -1,191 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonCollisionPolygonalMesh.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -UNewtonCollisionPolygonalMesh::UNewtonCollisionPolygonalMesh() - :Super() -{ -} - -long long UNewtonCollisionPolygonalMesh::CalculateHash() const -{ - auto FindStaticMesh = [this]() - { - UStaticMeshComponent* const mesh = Cast(GetAttachParent()); - if (mesh && mesh->GetStaticMesh().Get()) - { - return mesh->GetStaticMesh().Get(); - } - return (UStaticMesh*) nullptr; - }; - - long long hash = ndCRC64(ndShapeHeightfield::StaticClassName(), strlen(ndShapeHeightfield::StaticClassName()), 0); - - UStaticMesh* const staticMesh = FindStaticMesh(); - if (staticMesh) - { - #if 1 - FTriMeshCollisionData collisionData; - bool data = staticMesh->GetPhysicsTriMeshData(&collisionData, true); - if (data) - { - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(0.0f)); - const ndVector bakedScale(scale.Scale(UNREAL_INV_UNIT_SYSTEM)); - - for (int i = collisionData.Vertices.Num() - 1; i >= 0; --i) - { - const FVector3f p(collisionData.Vertices[i]); - const ndVector q(ndFloat32(p.X), ndFloat32(p.Y), ndFloat32(p.Z), ndFloat32(0.0f)); - const ndVector hashPoint(bakedScale * q); - hash = ndCRC64(&hashPoint, sizeof(hashPoint), hash); - } - } - #else - //using actual render LOD0 geometry, maybe not a good idea. - const FStaticMeshRenderData* const renderData = staticMesh->GetRenderData(); - const FStaticMeshLODResourcesArray& renderResource = renderData->LODResources; - - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(0.0f)); - const ndVector bakedScale(scale.Scale(UNREAL_INV_UNIT_SYSTEM)); - - const FStaticMeshLODResources& renderLOD = renderResource[0]; - const FStaticMeshVertexBuffers& staticMeshVertexBuffer = renderLOD.VertexBuffers;; - const FPositionVertexBuffer& positBuffer = staticMeshVertexBuffer.PositionVertexBuffer; - for (int i = positBuffer.GetNumVertices() - 1; i >= 0; --i) - { - const FVector3f p(positBuffer.VertexPosition(i)); - const ndVector q(ndFloat32(p.X), ndFloat32(p.Y), ndFloat32(p.Z), ndFloat32(0.0f)); - const ndVector hashPoint(bakedScale * q); - - hash = ndCRC64(&hashPoint, sizeof(hashPoint), hash); - } - #endif - } - - return hash; -} - -ndShape* UNewtonCollisionPolygonalMesh::CreateShape() const -{ - auto FindStaticMesh = [this]() - { - UStaticMeshComponent* const mesh = Cast(GetAttachParent()); - if (mesh && mesh->GetStaticMesh().Get()) - { - return mesh->GetStaticMesh().Get(); - } - return (UStaticMesh*) nullptr; - }; - - UStaticMesh* const staticMesh = FindStaticMesh(); - if (staticMesh) - { - ndPolygonSoupBuilder meshBuilder; - meshBuilder.Begin(); - ndVector face[8]; - - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(0.0f)); - const ndVector bakedScale(scale.Scale(UNREAL_INV_UNIT_SYSTEM)); - - #if 1 - FTriMeshCollisionData collisionData; - bool data = staticMesh->GetPhysicsTriMeshData(&collisionData, true); - if (data) - { - for (int i = collisionData.Indices.Num() - 1; i >= 0; --i) - { - ndInt32 i0 = collisionData.Indices[i].v0; - ndInt32 i1 = collisionData.Indices[i].v1; - ndInt32 i2 = collisionData.Indices[i].v2; - const FVector3f p0(collisionData.Vertices[i0]); - const FVector3f p1(collisionData.Vertices[i1]); - const FVector3f p2(collisionData.Vertices[i2]); - const ndVector q0(ndFloat32(p0.X), ndFloat32(p0.Y), ndFloat32(p0.Z), ndFloat32(0.0f)); - const ndVector q1(ndFloat32(p1.X), ndFloat32(p1.Y), ndFloat32(p1.Z), ndFloat32(0.0f)); - const ndVector q2(ndFloat32(p2.X), ndFloat32(p2.Y), ndFloat32(p2.Z), ndFloat32(0.0f)); - - face[0] = q0 * bakedScale; - face[2] = q1 * bakedScale; - face[1] = q2 * bakedScale; - - //for now MaterialIndex = 0 - ndInt32 materialIndex = 0; - meshBuilder.AddFace(&face[0].m_x, sizeof(ndVector), 3, materialIndex); - } - } - - #else - const FStaticMeshRenderData* const renderData = staticMesh->GetRenderData(); - const FStaticMeshLODResourcesArray& renderResource = renderData->LODResources; - - const FStaticMeshLODResources& renderLOD = renderResource[0]; - const FRawStaticIndexBuffer& staticMeshIndexBuffer = renderLOD.IndexBuffer; - const FStaticMeshVertexBuffers& staticMeshVertexBuffer = renderLOD.VertexBuffers;; - const FPositionVertexBuffer& positBuffer = staticMeshVertexBuffer.PositionVertexBuffer; - - int32 indexCount = staticMeshIndexBuffer.GetNumIndices(); - for (ndInt32 i = 0; i < indexCount; i += 3) - { - ndInt32 i0 = staticMeshIndexBuffer.GetIndex(i + 0); - ndInt32 i1 = staticMeshIndexBuffer.GetIndex(i + 1); - ndInt32 i2 = staticMeshIndexBuffer.GetIndex(i + 2); - const FVector3f p0(positBuffer.VertexPosition(i0)); - const FVector3f p1(positBuffer.VertexPosition(i1)); - const FVector3f p2(positBuffer.VertexPosition(i2)); - const ndVector q0(ndFloat32(p0.X), ndFloat32(p0.Y), ndFloat32(p0.Z), ndFloat32(0.0f)); - const ndVector q1(ndFloat32(p1.X), ndFloat32(p1.Y), ndFloat32(p1.Z), ndFloat32(0.0f)); - const ndVector q2(ndFloat32(p2.X), ndFloat32(p2.Y), ndFloat32(p2.Z), ndFloat32(0.0f)); - - face[0] = q0 * bakedScale; - face[1] = q1 * bakedScale; - face[2] = q2 * bakedScale; - - //for now MaterialIndex = 0 - ndInt32 materialIndex = 0; - meshBuilder.AddFace(&face[0].m_x, sizeof(ndVector), 3, materialIndex); - } - #endif - - meshBuilder.End(true); - ndShape* const shape = new ndShapeStatic_bvh(meshBuilder); - return shape; - } - return new ndShapeNull(); -} - -void UNewtonCollisionPolygonalMesh::ApplyPropertyChanges() -{ - BuildNewtonShape(); - - Super::ApplyPropertyChanges(); -} - -ndShapeInstance* UNewtonCollisionPolygonalMesh::CreateInstanceShape() const -{ - ndShapeInstance* const instance = new ndShapeInstance(m_shape); - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(1.0f / uScale.X), ndFloat32(1.0f / uScale.Y), ndFloat32(1.0f / uScale.Z), ndFloat32(0.0f)); - instance->SetScale(scale); - return instance; -} - -ndShapeInstance* UNewtonCollisionPolygonalMesh::CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const -{ - ndShapeInstance* const instance = CreateInstanceShape(); - - const ndVector scale(ndFloat32(1.0f)); - const FTransform transform(GetComponentToWorld()); - const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform) * bodyMatrix.OrthoInverse()); - - instance->SetScale(scale); - instance->SetLocalMatrix(matrix); - return instance; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.h deleted file mode 100644 index ffca7b46d7..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.h +++ /dev/null @@ -1,27 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonCollision.h" -#include "NewtonCollisionPolygonalMesh.generated.h" - -/** - * - */ -UCLASS(ClassGroup=(NewtonCollision), meta=(BlueprintSpawnableComponent)) -class UNewtonCollisionPolygonalMesh : public UNewtonCollision -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonCollisionPolygonalMesh(); - - protected: - virtual void ApplyPropertyChanges(); - virtual ndShape* CreateShape() const; - virtual long long CalculateHash() const; - virtual ndShapeInstance* CreateInstanceShape() const; - virtual ndShapeInstance* CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionSphere.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionSphere.cpp deleted file mode 100644 index 9f553c367c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionSphere.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonCollisionSphere.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -UNewtonCollisionSphere::UNewtonCollisionSphere() - :Super() - ,Radio(50.0f) -{ -} - -ndShape* UNewtonCollisionSphere::CreateShape() const -{ - return new ndShapeSphere(Radio * UNREAL_INV_UNIT_SYSTEM); -} - -long long UNewtonCollisionSphere::CalculateHash() const -{ - long long hash = ndCRC64(ndShapeSphere::StaticClassName(), strlen(ndShapeSphere::StaticClassName()), 0); - hash = ndCRC64(&Radio, sizeof(float), hash); - return hash; -} - -void UNewtonCollisionSphere::ApplyPropertyChanges() -{ - if (BestFit) - { - for (USceneComponent* parent = GetAttachParent(); parent; parent = parent->GetAttachParent()) - { - UStaticMeshComponent* const meshComp = Cast(parent); - if (meshComp && meshComp->GetStaticMesh()) - { - //FBoxSphereBounds bounds(meshComp->CalcBounds(FTransform())); - //SizeX = ndMax(float(bounds.BoxExtent.X * 2.0f), 2.0f); - //SizeY = ndMax(float(bounds.BoxExtent.Y * 2.0f), 2.0f); - //SizeZ = ndMax(float(bounds.BoxExtent.Z * 2.0f), 2.0f); - //SetRelativeTransform(FTransform()); - break; - } - } - } - BuildNewtonShape(); - - Super::ApplyPropertyChanges(); -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionSphere.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionSphere.h deleted file mode 100644 index 420e6f7916..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionSphere.h +++ /dev/null @@ -1,31 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonCollision.h" -#include "NewtonCollisionSphere.generated.h" - -class ndShapeInstance; -class UNewtonRigidBody; - -/** - * - */ -UCLASS(ClassGroup=(NewtonCollision), meta=(BlueprintSpawnableComponent)) -class UNewtonCollisionSphere : public UNewtonCollision -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonCollisionSphere(); - - protected: - virtual void ApplyPropertyChanges(); - virtual ndShape* CreateShape() const; - virtual long long CalculateHash() const; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 1.0f)) - float Radio; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionWheel.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionWheel.cpp deleted file mode 100644 index d98b39e9c8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionWheel.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonCollisionWheel.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -UNewtonCollisionWheel::UNewtonCollisionWheel() - :Super() - ,Radio(50.0f) - ,Width(50.0f) -{ -} - -ndShape* UNewtonCollisionWheel::CreateShape() const -{ - return new ndShapeChamferCylinder(0.25f, 0.5f); -} - -long long UNewtonCollisionWheel::CalculateHash() const -{ - long long hash = ndCRC64(ndShapeChamferCylinder::StaticClassName(), strlen(ndShapeChamferCylinder::StaticClassName()), 0); - hash = ndCRC64(&Radio, sizeof(float), hash); - hash = ndCRC64(&Width, sizeof(float), hash); - return hash; -} - -void UNewtonCollisionWheel::ApplyPropertyChanges() -{ - if (BestFit) - { - for (USceneComponent* parent = GetAttachParent(); parent; parent = parent->GetAttachParent()) - { - UStaticMeshComponent* const meshComp = Cast(parent); - if (meshComp && meshComp->GetStaticMesh()) - { - //FBoxSphereBounds bounds(meshComp->CalcBounds(FTransform())); - //SizeX = ndMax(float(bounds.BoxExtent.X * 2.0f), 2.0f); - //SizeY = ndMax(float(bounds.BoxExtent.Y * 2.0f), 2.0f); - //SizeZ = ndMax(float(bounds.BoxExtent.Z * 2.0f), 2.0f); - //SetRelativeTransform(FTransform()); - break; - } - } - } - BuildNewtonShape(); - - Super::ApplyPropertyChanges(); -} - -ndShapeInstance* UNewtonCollisionWheel::CreateInstanceShape() const -{ - ndShapeInstance* const instance = Super::CreateInstanceShape(); - - const ndVector scale(ndFloat32(Width * UNREAL_INV_UNIT_SYSTEM), ndFloat32(Radio * UNREAL_INV_UNIT_SYSTEM), ndFloat32(Radio * UNREAL_INV_UNIT_SYSTEM), ndFloat32 (0.0f)); - instance->SetScale(scale); - - const ndMatrix aligment(ndYawMatrix(ndPi * 0.5f)); - instance->SetLocalMatrix(aligment * instance->GetLocalMatrix()); - return instance; -} - -ndShapeInstance* UNewtonCollisionWheel::CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const -{ - ndShapeInstance* const instance = Super::CreateBodyInstanceShape(bodyMatrix); - - const ndVector scale(ndFloat32(Width * UNREAL_INV_UNIT_SYSTEM), ndFloat32(Radio * UNREAL_INV_UNIT_SYSTEM), ndFloat32(Radio * UNREAL_INV_UNIT_SYSTEM), ndFloat32(0.0f)); - instance->SetScale(scale); - - const ndMatrix aligment(ndYawMatrix(ndPi * 0.5f)); - instance->SetLocalMatrix(aligment * instance->GetLocalMatrix()); - return instance; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionWheel.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionWheel.h deleted file mode 100644 index a124d4e9eb..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonCollisionWheel.h +++ /dev/null @@ -1,36 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonCollision.h" -#include "NewtonCollisionWheel.generated.h" - -class ndShapeInstance; -class UNewtonRigidBody; - -/** - * - */ -UCLASS(ClassGroup=(NewtonCollision), meta=(BlueprintSpawnableComponent)) -class UNewtonCollisionWheel : public UNewtonCollision -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonCollisionWheel(); - - protected: - virtual void ApplyPropertyChanges(); - virtual ndShape* CreateShape() const; - virtual long long CalculateHash() const; - virtual ndShapeInstance* CreateInstanceShape() const override; - virtual ndShapeInstance* CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const override; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 2.0f)) - float Radio; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 2.0f)) - float Width; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJoint.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJoint.cpp deleted file mode 100644 index 1731766077..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJoint.cpp +++ /dev/null @@ -1,150 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonJoint.h" - -#include "NewtonRigidBody.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -// Sets default values for this component's properties -UNewtonJoint::UNewtonJoint() - :Super() - ,ShowDebug(false) - ,DebugScale(1.0f) - //,LoopNewtonStaticMesh0() - //,LoopNewtonStaticMesh1() - ,m_joint(nullptr) - ,m_propertyChanged(true) -{ - // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features - // off to improve performance if you don't need them. - PrimaryComponentTick.bCanEverTick = true; -} - -void UNewtonJoint::ClearDebug() -{ - ShowDebug = false; - m_propertyChanged = true; -} - -void UNewtonJoint::CreateJoint(ANewtonWorldActor* const) -{ - m_transfrom = GetComponentTransform(); - ApplyPropertyChanges(); -} - -void UNewtonJoint::DestroyJoint() -{ - if (m_joint) - { - ndBodyKinematic* const body = m_joint->GetBody0(); - check(body); - - ndWorld* const world = body->GetScene()->GetWorld(); - check(world); - - world->RemoveJoint(m_joint); - m_joint = nullptr; - } -} - -UNewtonRigidBody* UNewtonJoint::FindChild() const -{ - const TArray>& childArray = GetAttachChildren(); - if (childArray.Num()) - { - check(childArray.Num() == 1); - return Cast(childArray[0]); - } - return nullptr; -} - -UNewtonRigidBody* UNewtonJoint::FindParent() const -{ - return Cast(GetAttachParent()); -} - -void UNewtonJoint::GetBodyPairs(ndWorld* const world, ndBodyKinematic** body0, ndBodyKinematic** body1) const -{ - *body0 = nullptr; - *body1 = nullptr; - - UNewtonRigidBody* const child = FindChild(); - if (child) - { - check(child->m_body); - *body0 = child->m_body->GetAsBodyKinematic(); - } - - UNewtonRigidBody* const parent = FindParent(); - if (parent) - { - check(parent->m_body); - *body1 = parent->m_body->GetAsBodyKinematic(); - } - else - { - *body1 = world->GetSentinelBody(); - } - - if (!body0) - { - UE_LOG(LogTemp, Warning, TEXT("The child of a: %s must be a UNewtonRigidBody. Failed to create joint"), *GetName()); - } - - if (!body1) - { - UE_LOG(LogTemp, Warning, TEXT("The parent of a: %s must be a UNewtonRigidBody. Failed to create joint"), *GetName()); - } -} - -void UNewtonJoint::DrawGizmo(float timestep) const -{ - check(0); -} - -void UNewtonJoint::UpdateTransform() -{ - UNewtonRigidBody* const parent = FindParent(); - if (parent) - { - m_transfrom = GetRelativeTransform() * parent->m_globalTransform; - } -} - -void UNewtonJoint::ApplyPropertyChanges() -{ - m_propertyChanged = false; - const FTransform transform(GetComponentTransform()); - const UNewtonRigidBody* const child = FindChild(); - if (child) - { - const FTransform childTransform(child->GetComponentTransform()); - m_localChildTransfrom = transform * childTransform.Inverse(); - } - - const UNewtonRigidBody* const parent = FindParent(); - if (parent) - { - const FTransform parentTransform(parent->GetComponentTransform()); - m_localParentTransfrom = transform * parentTransform.Inverse(); - } -} - -void UNewtonJoint::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) -{ - Super::PostEditChangeProperty(PropertyChangedEvent); - m_propertyChanged = true; -} - -// Called every frame -void UNewtonJoint::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) -{ - Super::TickComponent(DeltaTime, TickType, ThisTickFunction); - - SetComponentToWorld(m_transfrom); - if (ShowDebug) - { - DrawGizmo(DeltaTime); - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJoint.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJoint.h deleted file mode 100644 index 1085c8a477..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJoint.h +++ /dev/null @@ -1,64 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "UObject/ObjectMacros.h" -#include "Components/SceneComponent.h" -#include "NewtonJoint.generated.h" - -class ndWorld; -class ndBodyKinematic; -class UNewtonRigidBody; -class ANewtonWorldActor; -class ndJointBilateralConstraint; - -//UCLASS(ClassGroup=(NewtonJoints), meta=(BlueprintSpawnableComponent), HideCategories = (RayTracing, Mobile, TextureStreaming, VirtualTexture, MaterialParameters, DynamicMeshComponent, Advanced, Activation, Collision, Lighting, BodySetup, Primitives, HLOD, ComponentTick, Rendering, Physics, Tags, Replication, ComponentReplication, Cooking, Events, LOD, Navigation, AssetUserData), MinimalAPI) -UCLASS(Abstract, meta=(BlueprintSpawnableComponent), HideCategories = (RayTracing, Mobile, TextureStreaming, VirtualTexture, MaterialParameters, DynamicMeshComponent, Advanced, Activation, Collision, Lighting, BodySetup, Primitives, HLOD, ComponentTick, Rendering, Physics, Tags, Replication, ComponentReplication, Cooking, Events, LOD, Navigation, AssetUserData), MinimalAPI) -class UNewtonJoint : public USceneComponent -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonJoint(); - - void ClearDebug(); - // Called every frame - virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; - - void DestroyJoint(); - void UpdateTransform(); - virtual void DrawGizmo(float timestep) const; - virtual void CreateJoint(ANewtonWorldActor* const worldActor); - - UPROPERTY(EditAnywhere, Category = Newton) - bool ShowDebug; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.1f, ClampMax = 4.0f)) - float DebugScale; - - ///** Pointer to second Actor to constrain. */ - //UPROPERTY(EditAnywhere, Category = Newton) - //FName LoopNewtonStaticMesh0; - // - ///** Pointer to second Actor to constrain. */ - //UPROPERTY(EditAnywhere, Category = Newton) - //FName LoopNewtonStaticMesh1; - - protected: - UNewtonRigidBody* FindChild() const; - UNewtonRigidBody* FindParent() const; - void GetBodyPairs(ndWorld* const world, ndBodyKinematic** body0, ndBodyKinematic** body1) const; - - void ApplyPropertyChanges(); - virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; - - FTransform m_transfrom; - ndJointBilateralConstraint* m_joint; - FTransform m_localChildTransfrom; - FTransform m_localParentTransfrom; - bool m_propertyChanged; - - friend class FnewtonModule; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointCylinder.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointCylinder.cpp deleted file mode 100644 index 72d699bf6b..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointCylinder.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonJointCylinder.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "NewtonWorldActor.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -UNewtonJointCylinder::UNewtonJointCylinder() - :Super() - ,EnableAngularLimits(false) - ,MinAngle(-45.0f) - ,MaxAngle(45.0f) - ,SpringAngularConst(0.0f) - ,DampingAngularConst(0.0f) - ,SpringDamperAngularRegularizer(1.0e-3f) - ,EnableLinearLimits(false) - ,MinDistance(-100.0f) - ,MaxDistance(100.0f) - ,SpringLinearConst(0.0f) - ,DampingLinearConst(0.0f) - ,SpringDamperLinearRegularizer(1.0e-3f) -{ -} - -void UNewtonJointCylinder::DrawAngularGizmo(float timestep) const -{ - ndFloat32 scale = DebugScale * UNREAL_UNIT_SYSTEM; - const FTransform transform(GetComponentTransform()); - const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform)); - const FColor pinColor(255.0f, 255.0f, 0.0f); - const ndVector pinDir(matrix.m_front.Scale(scale * 0.9f)); - const FVector coneDir(matrix.m_front.m_x, matrix.m_front.m_y, matrix.m_front.m_z); - const FVector pingStart(transform.GetLocation()); - const FVector pingEnd(float(pingStart.X + pinDir.m_x), float(pingStart.Y + pinDir.m_y), float(pingStart.Z + pinDir.m_z)); - - const UWorld* const world = GetWorld(); - DrawDebugLine(world, pingStart, pingEnd, pinColor, false, timestep); - DrawDebugCone(world, pingEnd, coneDir, -scale * 0.125f, 15.0f * ndDegreeToRad, 15.0f * ndDegreeToRad, 8, pinColor, false, timestep); - - UNewtonRigidBody* const child = FindChild(); - if (EnableAngularLimits && child) - { - TArray indices; - TArray verts; - float deltaTwist = MaxAngle - MinAngle; - if ((deltaTwist > 1.0e-3f) && (deltaTwist < 360.0f)) - { - const ndVector point(ndFloat32(0.0f), scale, ndFloat32(0.0f), ndFloat32(0.0f)); - const ndInt32 subdiv = 12; - ndFloat32 angle0 = MinAngle; - ndFloat32 angleStep = ndMin(deltaTwist, 360.0f) / subdiv; - - const FVector parentOrigin(transform.GetLocation()); - const ndMatrix parentMatrix(UNewtonRigidBody::ToNewtonMatrix(transform)); - verts.Push(parentOrigin); - for (ndInt32 i = 0; i <= subdiv; ++i) - { - const ndVector p(parentMatrix.RotateVector(ndPitchMatrix(angle0 * ndDegreeToRad).RotateVector(point))); - const FVector p1(float(p.m_x + parentOrigin.X), float(p.m_y + parentOrigin.Y), float(p.m_z + parentOrigin.Z)); - angle0 += angleStep; - verts.Push(p1); - } - for (ndInt32 i = 0; i < subdiv; ++i) - { - indices.Push(0); - indices.Push(i + 1); - indices.Push(i + 2); - } - const FColor meshColor(255.0f, 0.0f, 0.0f, 32.0f); - DrawDebugMesh(world, verts, indices, meshColor, false, timestep); - } - } -} - -void UNewtonJointCylinder::DrawLinearGizmo(float timestep) const -{ - ndFloat32 scale = DebugScale * UNREAL_UNIT_SYSTEM; - const FTransform transform(GetComponentTransform()); - const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform)); - const FColor pinColor(255.0f, 255.0f, 0.0f); - const ndVector pinDir(matrix.m_front.Scale(scale * 0.9f)); - const FVector pingStart(transform.GetLocation()); - const FVector pingEnd(float(pingStart.X + pinDir.m_x), float(pingStart.Y + pinDir.m_y), float(pingStart.Z + pinDir.m_z)); - - const UWorld* const world = GetWorld(); - DrawDebugLine(world, pingStart, pingEnd, pinColor, false, timestep); - - UNewtonRigidBody* const child = FindChild(); - if (EnableLinearLimits && child) - { - const ndVector maxLimit(matrix.m_front.Scale(MaxDistance)); - const FVector maxConeStart(pingStart.X + maxLimit.m_x, pingStart.Y + maxLimit.m_y, pingStart.Z + maxLimit.m_z); - const ndVector minLimit(matrix.m_front.Scale(MinDistance)); - const FVector minConeStart(pingStart.X + minLimit.m_x, pingStart.Y + minLimit.m_y, pingStart.Z + minLimit.m_z); - - const FVector coneDir(matrix.m_front.m_x, matrix.m_front.m_y, matrix.m_front.m_z); - DrawDebugLine(world, minConeStart, maxConeStart, pinColor, false, timestep); - DrawDebugCone(world, maxConeStart, coneDir, scale * 0.125f, 15.0f * ndDegreeToRad, 15.0f * ndDegreeToRad, 8, pinColor, false, timestep); - DrawDebugCone(world, minConeStart, coneDir, -scale * 0.125f, 15.0f * ndDegreeToRad, 15.0f * ndDegreeToRad, 8, pinColor, false, timestep); - } -} - -void UNewtonJointCylinder::DrawGizmo(float timestep) const -{ - UNewtonRigidBody* const child = FindChild(); - if (child) - { - DrawLinearGizmo(timestep); - DrawAngularGizmo(timestep); - } -} - -// Called when the game starts -void UNewtonJointCylinder::CreateJoint(ANewtonWorldActor* const newtonWorldActor) -{ - Super::CreateJoint(newtonWorldActor); - - check(!m_joint); - ndBodyKinematic* body0; - ndBodyKinematic* body1; - ndWorld* const world = newtonWorldActor->GetNewtonWorld(); - GetBodyPairs(world, &body0, &body1); - - if (body0 && body1) - { - const FTransform transform(GetRelativeTransform()); - const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform) * body1->GetMatrix()); - ndJointCylinder* const joint = new ndJointCylinder(matrix, body0, body1); - - joint->SetLimitStateAngle(EnableAngularLimits); - joint->SetLimitsAngle(ndFloat32(MinAngle * ndDegreeToRad), ndFloat32(MaxAngle * ndDegreeToRad)); - joint->SetAsSpringDamperAngle(SpringDamperAngularRegularizer, SpringAngularConst, DampingAngularConst); - - joint->SetLimitStatePosit(EnableLinearLimits); - joint->SetLimitsPosit(ndFloat32(MinDistance * UNREAL_INV_UNIT_SYSTEM), ndFloat32(MaxDistance * UNREAL_INV_UNIT_SYSTEM)); - joint->SetAsSpringDamperPosit(SpringDamperLinearRegularizer, SpringLinearConst, DampingLinearConst); - - m_joint = joint; - world->AddJoint(m_joint); - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointCylinder.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointCylinder.h deleted file mode 100644 index 77af2f1a64..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointCylinder.h +++ /dev/null @@ -1,64 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonJoint.h" -#include "NewtonJointCylinder.generated.h" - -class ANewtonWorldActor; - -/** - * - */ -UCLASS(ClassGroup=(NewtonJoints), meta=(BlueprintSpawnableComponent)) -class UNewtonJointCylinder : public UNewtonJoint -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonJointCylinder(); - - protected: - void DrawLinearGizmo(float timestep) const; - void DrawAngularGizmo(float timestep) const; - virtual void DrawGizmo(float timestep) const override; - virtual void CreateJoint(ANewtonWorldActor* const worldActor) override; - - UPROPERTY(EditAnywhere, Category = Newton) - bool EnableAngularLimits; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = -10000.0f, ClampMax = -1.0f)) - float MinAngle; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 1.0f, ClampMax = 10000.0f)) - float MaxAngle; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0f, ClampMax = 10000.0f)) - float SpringAngularConst; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0f, ClampMax = 1000.0f)) - float DampingAngularConst; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0001f, ClampMax = 1.0f)) - float SpringDamperAngularRegularizer; - - UPROPERTY(EditAnywhere, Category = Newton) - bool EnableLinearLimits; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = -10000.0f, ClampMax = -0.01f)) - float MinDistance; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.01f, ClampMax = 10000.0f)) - float MaxDistance; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0f, ClampMax = 10000.0f)) - float SpringLinearConst; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0f, ClampMax = 1000.0f)) - float DampingLinearConst; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0001f, ClampMax = 1.0f)) - float SpringDamperLinearRegularizer; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointHinge.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointHinge.cpp deleted file mode 100644 index 0311907ccc..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointHinge.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonJointHinge.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "NewtonWorldActor.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -UNewtonJointHinge::UNewtonJointHinge() - :Super() - ,EnableLimits(false) - ,MinAngle(-45.0f) - ,MaxAngle(45.0f) - ,SpringConst(0.0f) - ,DampingConst(0.0f) - ,SpringDamperRegularizer(1.0e-3f) -{ -} - -void UNewtonJointHinge::DrawGizmo(float timestep) const -{ - ndFloat32 scale = DebugScale * UNREAL_UNIT_SYSTEM; - const FTransform transform(GetComponentTransform()); - const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform)); - const FColor pinColor(255.0f, 255.0f, 0.0f); - const ndVector pinDir(matrix.m_front.Scale(scale * 0.9f)); - const FVector coneDir(matrix.m_front.m_x, matrix.m_front.m_y, matrix.m_front.m_z); - const FVector pingStart(transform.GetLocation()); - const FVector pingEnd(float(pingStart.X + pinDir.m_x), float(pingStart.Y + pinDir.m_y), float(pingStart.Z + pinDir.m_z)); - - const UWorld* const world = GetWorld(); - DrawDebugLine(world, pingStart, pingEnd, pinColor, false, timestep); - DrawDebugCone(world, pingEnd, coneDir, -scale * 0.125f, 15.0f * ndDegreeToRad, 15.0f * ndDegreeToRad, 8, pinColor, false, timestep); - - UNewtonRigidBody* const child = FindChild(); - if (EnableLimits && child) - { - TArray indices; - TArray verts; - float deltaTwist = MaxAngle - MinAngle; - if ((deltaTwist > 1.0e-3f) && (deltaTwist < 360.0f)) - { - const ndVector point(ndFloat32(0.0f), scale, ndFloat32(0.0f), ndFloat32(0.0f)); - const ndInt32 subdiv = 12; - ndFloat32 angle0 = MinAngle; - ndFloat32 angleStep = ndMin(deltaTwist, 360.0f) / subdiv; - - const FVector parentOrigin(transform.GetLocation()); - const ndMatrix parentMatrix(UNewtonRigidBody::ToNewtonMatrix(transform)); - verts.Push(parentOrigin); - for (ndInt32 i = 0; i <= subdiv; ++i) - { - const ndVector p(parentMatrix.RotateVector(ndPitchMatrix(angle0 * ndDegreeToRad).RotateVector(point))); - const FVector p1(float(p.m_x + parentOrigin.X), float(p.m_y + parentOrigin.Y), float(p.m_z + parentOrigin.Z)); - angle0 += angleStep; - verts.Push(p1); - } - for (ndInt32 i = 0; i < subdiv; ++i) - { - indices.Push(0); - indices.Push(i + 1); - indices.Push(i + 2); - } - const FColor meshColor(255.0f, 0.0f, 0.0f, 32.0f); - DrawDebugMesh(world, verts, indices, meshColor, false, timestep); - } - } -} - -// Called when the game starts -void UNewtonJointHinge::CreateJoint(ANewtonWorldActor* const newtonWorldActor) -{ - Super::CreateJoint(newtonWorldActor); - - check(!m_joint); - ndBodyKinematic* body0; - ndBodyKinematic* body1; - ndWorld* const world = newtonWorldActor->GetNewtonWorld(); - GetBodyPairs(world, &body0, &body1); - - if (body0 && body1) - { - const FTransform transform(GetRelativeTransform()); - const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform) * body1->GetMatrix()); - ndJointHinge* const joint = new ndJointHinge(matrix, body0, body1); - - joint->SetLimitState(EnableLimits); - joint->SetLimits(ndFloat32 (MinAngle * ndDegreeToRad), ndFloat32(MaxAngle * ndDegreeToRad)); - joint->SetAsSpringDamper(SpringDamperRegularizer, SpringConst, DampingConst); - - m_joint = joint; - world->AddJoint(m_joint); - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointHinge.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointHinge.h deleted file mode 100644 index 48616b0c17..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointHinge.h +++ /dev/null @@ -1,44 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonJoint.h" -#include "NewtonJointHinge.generated.h" - -class ndWorld; -class ANewtonWorldActor; -/** - * - */ -UCLASS(ClassGroup=(NewtonJoints), meta=(BlueprintSpawnableComponent)) -class UNewtonJointHinge : public UNewtonJoint -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonJointHinge(); - - protected: - virtual void DrawGizmo(float timestep) const override; - virtual void CreateJoint(ANewtonWorldActor* const worldActor) override; - - UPROPERTY(EditAnywhere, Category = Newton) - bool EnableLimits; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = -10000.0f, ClampMax = -1.0f)) - float MinAngle; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 1.0f, ClampMax = 10000.0f)) - float MaxAngle; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0f, ClampMax = 10000.0f)) - float SpringConst; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0f, ClampMax = 1000.0f)) - float DampingConst; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0001f, ClampMax = 1.0f)) - float SpringDamperRegularizer; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointKinematic.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointKinematic.cpp deleted file mode 100644 index 2bba75f281..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointKinematic.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonJointKinematic.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "NewtonWorldActor.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -UNewtonJointKinematic::UNewtonJointKinematic() - :Super() -{ -} - -void UNewtonJointKinematic::DrawGizmo(float timestep) const -{ - //ndFloat32 scale = DebugScale * UNREAL_UNIT_SYSTEM; - //const FTransform transform(GetComponentTransform()); - //const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform)); - //const FColor pinColor(255.0f, 255.0f, 0.0f); - //const ndVector pinDir(matrix.m_front.Scale(scale * 0.9f)); - //const FVector coneDir(matrix.m_front.m_x, matrix.m_front.m_y, matrix.m_front.m_z); - //const FVector pingStart(transform.GetLocation()); - //const FVector pingEnd(float(pingStart.X + pinDir.m_x), float(pingStart.Y + pinDir.m_y), float(pingStart.Z + pinDir.m_z)); - // - //const UWorld* const world = GetWorld(); - //DrawDebugLine(world, pingStart, pingEnd, pinColor, false, timestep); - //DrawDebugCone(world, pingEnd, coneDir, -scale * 0.125f, 15.0f * ndDegreeToRad, 15.0f * ndDegreeToRad, 8, pinColor, false, timestep); - // - //UNewtonRigidBody* const child = FindChild(); - //if (EnableLimits && child) - //{ - // TArray indices; - // TArray verts; - // float deltaTwist = MaxAngle - MinAngle; - // if ((deltaTwist > 1.0e-3f) && (deltaTwist < 360.0f)) - // { - // const ndVector point(ndFloat32(0.0f), scale, ndFloat32(0.0f), ndFloat32(0.0f)); - // const ndInt32 subdiv = 12; - // ndFloat32 angle0 = MinAngle; - // ndFloat32 angleStep = ndMin(deltaTwist, 360.0f) / subdiv; - // - // const FVector parentOrigin(transform.GetLocation()); - // const ndMatrix parentMatrix(UNewtonRigidBody::ToNewtonMatrix(transform)); - // verts.Push(parentOrigin); - // for (ndInt32 i = 0; i <= subdiv; ++i) - // { - // const ndVector p(parentMatrix.RotateVector(ndPitchMatrix(angle0 * ndDegreeToRad).RotateVector(point))); - // const FVector p1(float(p.m_x + parentOrigin.X), float(p.m_y + parentOrigin.Y), float(p.m_z + parentOrigin.Z)); - // angle0 += angleStep; - // verts.Push(p1); - // } - // for (ndInt32 i = 0; i < subdiv; ++i) - // { - // indices.Push(0); - // indices.Push(i + 1); - // indices.Push(i + 2); - // } - // const FColor meshColor(255.0f, 0.0f, 0.0f, 32.0f); - // DrawDebugMesh(world, verts, indices, meshColor, false, timestep); - // } - //} -} - -// Called when the game starts -void UNewtonJointKinematic::CreateJoint(ANewtonWorldActor* const newtonWorldActor) -{ - Super::CreateJoint(newtonWorldActor); - - check(0); - //check(!m_joint); - //ndBodyKinematic* body0; - //ndBodyKinematic* body1; - //ndWorld* const world = newtonWorldActor->GetNewtonWorld(); - //GetBodyPairs(world, &body0, &body1); - // - //if (body0 && body1) - //{ - // const FTransform transform(GetRelativeTransform()); - // const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform) * body1->GetMatrix()); - // ndJointHinge* const joint = new ndJointHinge(matrix, body0, body1); - // - // joint->SetLimitState(EnableLimits); - // joint->SetLimits(ndFloat32(MinAngle * ndDegreeToRad), ndFloat32(MaxAngle * ndDegreeToRad)); - // joint->SetAsSpringDamper(SpringDamperRegularizer, SpringConst, DampingConst); - // - // m_joint = joint; - // world->AddJoint(m_joint); - //} -} - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointKinematic.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointKinematic.h deleted file mode 100644 index 14ce742c81..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointKinematic.h +++ /dev/null @@ -1,26 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonJoint.h" -#include "NewtonJointKinematic.generated.h" - -class ndWorld; -class ANewtonWorldActor; -/** - * - */ -UCLASS(ClassGroup=(NewtonJoints), meta=(BlueprintSpawnableComponent)) -class UNewtonJointKinematic : public UNewtonJoint -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonJointKinematic(); - - protected: - virtual void DrawGizmo(float timestep) const override; - virtual void CreateJoint(ANewtonWorldActor* const worldActor) override; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointSlider.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointSlider.cpp deleted file mode 100644 index 6ffedeb48f..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointSlider.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonJointSlider.h" - -#include "Newton.h" -#include "NewtonRigidBody.h" -#include "NewtonWorldActor.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -UNewtonJointSlider::UNewtonJointSlider() - :Super() - ,EnableLimits(false) - ,MinDistance(-100.0f) - ,MaxDistance(100.0f) - ,SpringConst(0.0f) - ,DampingConst(0.0f) - ,SpringDamperRegularizer(1.0e-3f) -{ -} - -void UNewtonJointSlider::DrawGizmo(float timestep) const -{ - ndFloat32 scale = DebugScale * UNREAL_UNIT_SYSTEM; - const FTransform transform(GetComponentTransform()); - const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform)); - const FColor pinColor(255.0f, 255.0f, 0.0f); - const ndVector pinDir(matrix.m_front.Scale(scale * 0.9f)); - const FVector pingStart(transform.GetLocation()); - const FVector pingEnd(float(pingStart.X + pinDir.m_x), float(pingStart.Y + pinDir.m_y), float(pingStart.Z + pinDir.m_z)); - - const UWorld* const world = GetWorld(); - DrawDebugLine(world, pingStart, pingEnd, pinColor, false, timestep); - - UNewtonRigidBody* const child = FindChild(); - if (EnableLimits && child) - { - const ndVector maxLimit(matrix.m_front.Scale(MaxDistance)); - const FVector maxConeStart(pingStart.X + maxLimit.m_x, pingStart.Y + maxLimit.m_y, pingStart.Z + maxLimit.m_z); - const ndVector minLimit(matrix.m_front.Scale(MinDistance)); - const FVector minConeStart(pingStart.X + minLimit.m_x, pingStart.Y + minLimit.m_y, pingStart.Z + minLimit.m_z); - - const FVector coneDir(matrix.m_front.m_x, matrix.m_front.m_y, matrix.m_front.m_z); - DrawDebugLine(world, minConeStart, maxConeStart, pinColor, false, timestep); - DrawDebugCone(world, maxConeStart, coneDir, scale * 0.125f, 15.0f * ndDegreeToRad, 15.0f * ndDegreeToRad, 8, pinColor, false, timestep); - DrawDebugCone(world, minConeStart, coneDir, -scale * 0.125f, 15.0f * ndDegreeToRad, 15.0f * ndDegreeToRad, 8, pinColor, false, timestep); - } -} - -// Called when the game starts -void UNewtonJointSlider::CreateJoint(ANewtonWorldActor* const newtonWorldActor) -{ - Super::CreateJoint(newtonWorldActor); - - check(!m_joint); - ndBodyKinematic* body0; - ndBodyKinematic* body1; - ndWorld* const world = newtonWorldActor->GetNewtonWorld(); - GetBodyPairs(world, &body0, &body1); - if (body0 && body1) - { - const FTransform transform(GetRelativeTransform()); - const ndMatrix matrix(UNewtonRigidBody::ToNewtonMatrix(transform) * body1->GetMatrix()); - - ndJointSlider* const joint = new ndJointSlider(matrix, body0, body1); - - joint->SetLimitState(EnableLimits); - joint->SetLimits(ndFloat32(MinDistance * UNREAL_INV_UNIT_SYSTEM), ndFloat32(MaxDistance * UNREAL_INV_UNIT_SYSTEM)); - joint->SetAsSpringDamper(SpringDamperRegularizer, SpringConst, DampingConst); - - m_joint = joint; - world->AddJoint(m_joint); - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointSlider.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointSlider.h deleted file mode 100644 index bf6906e589..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonJointSlider.h +++ /dev/null @@ -1,46 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonJoint.h" -#include "NewtonJointSlider.generated.h" - - -class ndWorld; -class ANewtonWorldActor; -/** - * - */ - -UCLASS(ClassGroup=(NewtonJoints), meta=(BlueprintSpawnableComponent)) -class UNewtonJointSlider : public UNewtonJoint -{ - GENERATED_BODY() - - public: - // Sets default values for this component's properties - UNewtonJointSlider(); - - protected: - virtual void DrawGizmo(float timestep) const override; - virtual void CreateJoint(ANewtonWorldActor* const worldActor) override; - - UPROPERTY(EditAnywhere, Category = Newton) - bool EnableLimits; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = -10000.0f, ClampMax = -0.01f)) - float MinDistance; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.01f, ClampMax = 10000.0f)) - float MaxDistance; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0f, ClampMax = 10000.0f)) - float SpringConst; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0f, ClampMax = 1000.0f)) - float DampingConst; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0001f, ClampMax = 1.0f)) - float SpringDamperRegularizer; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonRigidBody.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonRigidBody.cpp deleted file mode 100644 index 35fdd9f38e..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonRigidBody.cpp +++ /dev/null @@ -1,707 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonRigidBody.h" -#include "Selection.h" -#include "LevelEditor.h" -#include "ContentBrowserModule.h" -#include "Modules/ModuleManager.h" -#include "Kismet/GameplayStatics.h" -#include "PhysicsEngine/BodySetup.h" - -#include "Newton.h" -#include "NewtonJoint.h" -#include "NewtonCollision.h" -#include "NewtonWorldActor.h" -#include "NewtonCollisionConvexHull.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" -#include "ThirdParty/newtonLibrary/Public/thirdParty/ndConvexApproximation.h" - -//FLinearColor UNewtonRigidBody::m_awakeColor(1.0f, 0.0f, 0.f); -//FLinearColor UNewtonRigidBody::m_sleepingColor(0.0f, 1.0f, 0.f); - -FLinearColor UNewtonRigidBody::m_awakeColor(0.0f, 0.5f, 1.0f); -FLinearColor UNewtonRigidBody::m_sleepingColor(0.0f, 0.125f, 0.25f); - -class UNewtonRigidBody::NotifyCallback : public ndBodyNotify -{ - public: - NotifyCallback(UNewtonRigidBody* const owner, const ndVector& gravity) - :ndBodyNotify(gravity) - ,m_owner(owner) - ,m_sleepState(false) - { - const FTransform transform(owner->GetComponentTransform()); - const FVector location(transform.GetLocation()); - m_posit0.m_x = ndFloat32(location.X * UNREAL_INV_UNIT_SYSTEM); - m_posit0.m_y = ndFloat32(location.Y * UNREAL_INV_UNIT_SYSTEM); - m_posit0.m_z = ndFloat32(location.Z * UNREAL_INV_UNIT_SYSTEM); - m_posit0.m_w = ndFloat32(1.0f); - m_posit1 = m_posit0; - - const FQuat rot (transform.Rotator().Quaternion()); - m_rotation0.m_x = ndFloat32(rot.X); - m_rotation0.m_y = ndFloat32(rot.Y); - m_rotation0.m_z = ndFloat32(rot.Z); - m_rotation0.m_w = ndFloat32(rot.W); - } - - NotifyCallback(const NotifyCallback& src) - :ndBodyNotify(src) - ,m_posit0(src.m_posit0) - ,m_posit1(src.m_posit1) - ,m_rotation0(src.m_rotation0) - ,m_rotation1(src.m_rotation1) - ,m_owner(src.m_owner) - { - } - - ~NotifyCallback() - { - } - - ndBodyNotify* Clone() const - { - return new NotifyCallback(*this); - } - - virtual bool OnSceneAabbOverlap(const ndBody* const otherBody) const - { - return true; - } - - virtual void* GetUserData() const - { - return m_owner; - } - - void UpdateTransform() - { - m_posit0 = m_posit1; - m_rotation0 = m_rotation1; - m_posit1 = GetBody()->GetMatrix().m_posit; - m_rotation1 = GetBody()->GetRotation(); - - if (m_rotation0.DotProduct(m_rotation1).GetScalar() < 0.0f) - { - m_rotation0 = m_rotation0.Scale(-1.0f); - } - } - - FTransform InteptolateTransform(ndFloat32 param) - { - const ndVector posit(m_posit0 + (m_posit1 - m_posit0).Scale(param)); - const ndQuaternion rotation(m_rotation0.Slerp(m_rotation1, param)); - const FQuat uRot(rotation.m_x, rotation.m_y, rotation.m_z, rotation.m_w); - const FVector uPosit(posit.m_x * UNREAL_UNIT_SYSTEM, posit.m_y * UNREAL_UNIT_SYSTEM, posit.m_z * UNREAL_UNIT_SYSTEM); - - FTransform transform; - transform.SetRotation(uRot); - transform.SetLocation(uPosit); - return transform; - } - - virtual void OnApplyExternalForce(ndInt32 threadIndex, ndFloat32 timestep) - { - ndBodyDynamic* const body = GetBody()->GetAsBodyDynamic(); - const ndVector force(GetGravity().Scale(body->GetMassMatrix().m_w)); - body->SetForce(force); - } - - ndVector m_posit0; - ndVector m_posit1; - ndQuaternion m_rotation0; - ndQuaternion m_rotation1; - UNewtonRigidBody* m_owner; - bool m_sleepState; -}; - -// Sets default values for this component's properties -UNewtonRigidBody::UNewtonRigidBody() - :Super() - ,ShowDebug(false) - ,ShowCenterOfMass(false) - ,AutoSleepMode(true) - ,DebugScale(1.0f) - ,Mass(0.0f) - ,LinearDamp(0.0f) - ,AngularDamp(0.0f) - ,InitialVeloc(0.0f, 0.0f, 0.0f) - ,InitialOmega(0.0f, 0.0f, 0.0f) - ,CenterOfMass(0.0f, 0.0f, 0.0f) - ,Gravity(0.0f, 0.0f, -980.0f) - ,m_localScale(1.0f, 1.0f, 1.0f) - ,m_globalScale(1.0f, 1.0f, 1.0f) - ,m_localTransform() - ,m_globalTransform() - ,m_body(nullptr) - ,m_newtonWorld(nullptr) - ,m_sleeping(true) - ,m_propertyChanged(true) -{ - // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features - // off to improve performance if you don't need them. - PrimaryComponentTick.bCanEverTick = true; - SetMobility(EComponentMobility::Movable); -} - -FTransform UNewtonRigidBody::ToUnRealTransform(const ndMatrix& matrix) -{ - const ndQuaternion rotation(matrix); - const ndVector posit(matrix.m_posit.Scale(UNREAL_UNIT_SYSTEM)); - const FVector uPosit(posit.m_x, posit.m_y, posit.m_z); - const FQuat uRot(rotation.m_x, rotation.m_y, rotation.m_z, rotation.m_w); - - FTransform transform; - transform.SetRotation(uRot); - transform.SetLocation(uPosit); - return transform; -} - -ndMatrix UNewtonRigidBody::ToNewtonMatrix(const FTransform& tranform) -{ - const FVector location(tranform.GetLocation()); - const FQuat rotation(tranform.Rotator().Quaternion()); - - const ndQuaternion quat(ndFloat32(rotation.X), ndFloat32(rotation.Y), ndFloat32(rotation.Z), ndFloat32(rotation.W)); - const ndVector posit(UNREAL_INV_UNIT_SYSTEM * ndFloat32(location.X), UNREAL_INV_UNIT_SYSTEM * ndFloat32(location.Y), UNREAL_INV_UNIT_SYSTEM * ndFloat32(location.Z), ndFloat32(1.0f)); - const ndMatrix matrix(ndCalculateMatrix(quat, posit)); - return matrix; -} - -void UNewtonRigidBody::BeginDestroy() -{ - Super::BeginDestroy(); -} - -void UNewtonRigidBody::DestroyRigidBody() -{ - if (m_body) - { - ndWorld* const world = m_body->GetScene()->GetWorld(); - if (world) - { - world->RemoveBody(m_body); - } - m_body = nullptr; - } -} - -void UNewtonRigidBody::PostLoad() -{ - Super::PostLoad(); - m_propertyChanged = true; -} - -void UNewtonRigidBody::OnRegister() -{ - Super::OnRegister(); - m_propertyChanged = true; -} - -void UNewtonRigidBody::OnUnregister() -{ - Super::OnUnregister(); -} - -void UNewtonRigidBody::OnChildAttached(USceneComponent* component) -{ - Super::OnChildAttached(component); - m_propertyChanged = true; -} - -void UNewtonRigidBody::OnChildDetached(USceneComponent* component) -{ - Super::OnChildDetached(component); - m_propertyChanged = true; -} - -void UNewtonRigidBody::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) -{ - Super::PostEditChangeProperty(PropertyChangedEvent); - m_propertyChanged = true; -} - -void UNewtonRigidBody::ClearDebug() -{ - ShowDebug = false; - ShowCenterOfMass = false; - m_propertyChanged = true; - Inertia.ShowPrincipalAxis = false; -} - -ndMatrix UNewtonRigidBody::CalculateInertiaMatrix() const -{ - ndMatrix inertia(ndGetZeroMatrix()); - ndArray instances; - ndFixSizeArray stack; - stack.PushBack(this); - - bool isDynamics = true; - FVector invScale(GetComponentToWorld().GetScale3D()); - const ndMatrix bodyMatrix(ToNewtonMatrix(GetComponentToWorld()).OrthoInverse()); - invScale.X = 1.0f / invScale.X; - invScale.Y = 1.0f / invScale.Y; - invScale.Z = 1.0f / invScale.Z; - while (stack.GetCount()) - { - const USceneComponent* const component = stack.Pop(); - const UNewtonCollision* const collisionComponent = Cast(component); - if (collisionComponent) - { - check(collisionComponent->m_shape); - isDynamics = isDynamics || (!collisionComponent->m_shape->GetAsShapeStaticMesh()) ? true : false; - - const FTransform transform(collisionComponent->GetComponentToWorld()); - const ndMatrix localMatrix(ToNewtonMatrix(transform) * bodyMatrix); - const FVector localScale(transform.GetScale3D() * invScale); - - ndShapeInstance* const instance = collisionComponent->CreateInstanceShape(); - instance->SetScale(ndVector(ndFloat32 (localScale.X), ndFloat32(localScale.Y), ndFloat32(localScale.Z), ndFloat32 (1.0f))); - instance->SetLocalMatrix(instance->GetLocalMatrix() * localMatrix); - instances.PushBack(instance); - } - const TArray>& childrenComp = component->GetAttachChildren(); - for (int i = childrenComp.Num() - 1; i >= 0; --i) - { - stack.PushBack(childrenComp[i].Get()); - } - } - if (instances.GetCount() == 1) - { - if (isDynamics) - { - inertia = instances[0]->CalculateInertia(); - } - delete instances[0]; - } - else if (instances.GetCount()) - { - ndShapeInstance compoundInstance(new ndShapeCompound()); - ndShapeCompound* const compound = compoundInstance.GetShape()->GetAsShapeCompound(); - compound->BeginAddRemove(); - for (ndInt32 i = ndInt32(instances.GetCount()) - 1; i >= 0; --i) - { - ndShapeInstance* const subShape = instances[i]; - if (isDynamics) - { - compound->AddCollision(subShape); - } - delete subShape; - } - compound->EndAddRemove(); - if (isDynamics) - { - inertia = compoundInstance.CalculateInertia(); - } - } - - return inertia; -} - -void UNewtonRigidBody::DrawGizmo(float timestep) -{ - if (Inertia.ShowPrincipalAxis) - { - ndMatrix inertiaMatrix(CalculateInertiaMatrix()); - inertiaMatrix.EigenVectors(); - - const FTransform tranform(GetComponentToWorld()); - const ndMatrix matrix(ToNewtonMatrix(tranform)); - - FTransform offsetInertia; - offsetInertia.SetRotation(Inertia.PrincipalInertiaAxis.Quaternion()); - const ndMatrix offsetMatrix(ToNewtonMatrix(offsetInertia)); - //const FRotator axisRot(tranform.GetRotation()); - //const FVector axisLoc(axisMatrix.m_posit.m_x * UNREAL_UNIT_SYSTEM, axisMatrix.m_posit.m_y * UNREAL_UNIT_SYSTEM, axisMatrix.m_posit.m_z * UNREAL_UNIT_SYSTEM); - //DrawDebugCoordinateSystem(GetWorld(), axisLoc, axisRot, DebugScale * UNREAL_UNIT_SYSTEM, false, timestep); - - const ndMatrix axisMatrix(offsetMatrix * inertiaMatrix * matrix); - const FTransform inertiaAxisTransform (ToUnRealTransform(axisMatrix)); - const FVector axisLoc(inertiaAxisTransform.GetLocation()); - const FRotator axisRot(inertiaAxisTransform.GetRotation()); - DrawDebugCoordinateSystem(GetWorld(), axisLoc, axisRot, DebugScale * UNREAL_UNIT_SYSTEM, false, timestep); - } - - if (ShowCenterOfMass) - { - ndVector positVolume(ndFloat32(0.0f)); - if (m_body) - { - positVolume = m_body->GetCentreOfMass(); - } - else - { - ndFixSizeArray stack; - stack.PushBack(this); - - ndFloat32 volume = ndFloat32(1.0e-3f); - while (stack.GetCount()) - { - const USceneComponent* const component = stack.Pop(); - const UNewtonCollision* const shape = Cast(component); - if (shape) - { - const ndVector pv(shape->GetVolumePosition()); - volume += pv.m_w; - positVolume += pv; - } - - const TArray>& childrenComp = component->GetAttachChildren(); - for (int i = childrenComp.Num() - 1; i >= 0; --i) - { - stack.PushBack(childrenComp[i].Get()); - } - } - positVolume = positVolume.Scale(ndFloat32(1.0f) / volume); - - const ndVector centerOfMass( - ndFloat32(CenterOfMass.X * UNREAL_INV_UNIT_SYSTEM), - ndFloat32(CenterOfMass.Y * UNREAL_INV_UNIT_SYSTEM), - ndFloat32(CenterOfMass.Z * UNREAL_INV_UNIT_SYSTEM), - ndFloat32(0.0f)); - positVolume += centerOfMass; - positVolume.m_w = ndFloat32(1.0f); - } - - const FTransform tranform(GetComponentToWorld()); - const ndMatrix matrix(ToNewtonMatrix(tranform)); - positVolume = matrix.TransformVector(positVolume); - - const FRotator axisRot(tranform.GetRotation()); - const FVector axisLoc(positVolume.m_x * UNREAL_UNIT_SYSTEM, positVolume.m_y * UNREAL_UNIT_SYSTEM, positVolume.m_z * UNREAL_UNIT_SYSTEM); - DrawDebugCoordinateSystem(GetWorld(), axisLoc, axisRot, DebugScale * UNREAL_UNIT_SYSTEM, false, timestep); - } - - if (ShowDebug && m_body) - { - bool sleepState = m_body->GetSleepState(); - if (m_sleeping && !sleepState) - { - ndFixSizeArray stack; - stack.PushBack(this); - while (stack.GetCount()) - { - USceneComponent* const component = stack.Pop(); - UNewtonCollision* const shape = Cast(component); - if (shape) - { - shape->SetWireFrameColor(m_awakeColor); - } - - const TArray>& childrenComp = component->GetAttachChildren(); - for (int i = childrenComp.Num() - 1; i >= 0; --i) - { - stack.PushBack(childrenComp[i].Get()); - } - } - } - else if (!m_sleeping && sleepState) - { - ndFixSizeArray stack; - stack.PushBack(this); - while (stack.GetCount()) - { - USceneComponent* const component = stack.Pop(); - UNewtonCollision* const shape = Cast(component); - if (shape) - { - shape->SetWireFrameColor(m_sleepingColor); - } - - const TArray>& childrenComp = component->GetAttachChildren(); - for (int i = childrenComp.Num() - 1; i >= 0; --i) - { - stack.PushBack(childrenComp[i].Get()); - } - } - } - m_sleeping = sleepState; - } -} - -void UNewtonRigidBody::UpdateTransform() -{ - check(m_body); - NotifyCallback* const notify = (NotifyCallback*)m_body->GetNotifyCallback(); - notify->UpdateTransform(); -} - -void UNewtonRigidBody::InterpolateTransform(float param) -{ - check(m_body); - NotifyCallback* const notify = (NotifyCallback*)m_body->GetNotifyCallback(); - m_globalTransform = notify->InteptolateTransform(ndFloat32 (param)); - m_globalTransform.SetScale3D(m_globalScale); -} - -void UNewtonRigidBody::CalculateLocalTransform() -{ - check(m_body); - FTransform parentTransform; - const USceneComponent* const parent = GetAttachParent(); - if (parent) - { - parentTransform = parentTransform = parent->GetComponentTransform();; - } - - m_localTransform = m_globalTransform * parentTransform.Inverse(); - m_localTransform.SetScale3D(m_localScale); -} - -void UNewtonRigidBody::ApplyPropertyChanges() -{ - m_propertyChanged = false; - - m_localTransform = GetRelativeTransform(); - m_globalTransform = GetComponentTransform(); - - m_localScale = m_localTransform.GetScale3D(); - m_globalScale = m_globalTransform.GetScale3D(); - - const ndMatrix inertiaMatrix(CalculateInertiaMatrix()); - //float scale = UNREAL_UNIT_SYSTEM * UNREAL_UNIT_SYSTEM * Mass; - //show it in MKS units - //(not in centimeters because it is usually too big number) - float scale = Mass; - const FVector inertia(inertiaMatrix[0][0] * scale, inertiaMatrix[1][1] * scale, inertiaMatrix[2][2] * scale); - Inertia.PrincipalInertia = inertia * Inertia.PrincipalInertiaScaler; - - if (ConvexApproximate.Generate) - { - const AActor* const owner = GetOwner(); - const TArray>& children = GetAttachChildren(); - for (int j = children.Num() - 1; j >= 0; --j) - { - UStaticMeshComponent* const staticMeshComponent = Cast(children[j]); - - if (staticMeshComponent && staticMeshComponent->GetOwner() && staticMeshComponent->GetStaticMesh().Get()) - { - bool hasCollision = false; - const TArray>& childrenComp = staticMeshComponent->GetAttachChildren(); - for (int i = childrenComp.Num() - 1; i >= 0; --i) - { - hasCollision = hasCollision || (Cast(childrenComp[i]) ? true : false); - } - - if (hasCollision) - { - UE_LOG(LogTemp, Warning, TEXT("static mesh: %s, has one or more child collision shape alreary. You must delete all the UNewtonCollision children first"), *staticMeshComponent->GetName()); - } - else - { - CreateConvexApproximationShapes(staticMeshComponent); - } - } - } - - ConvexApproximate.Generate = false; - FLevelEditorModule& levelEditor = FModuleManager::LoadModuleChecked("LevelEditor"); - levelEditor.BroadcastComponentsEdited(); - levelEditor.BroadcastRedrawViewports(false); - } -} - -// Called every frame -void UNewtonRigidBody::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) -{ - Super::TickComponent(DeltaTime, TickType, ThisTickFunction); - if (m_newtonWorld) - { - SetRelativeTransform(m_localTransform); - SetComponentToWorld(m_globalTransform); - - DrawGizmo(DeltaTime); - } -} - -void UNewtonRigidBody::CreateConvexApproximationShapes(UStaticMeshComponent* const staticComponent) -{ - class ConveHullGenerator : public ndConvexApproximation - { - public: - ConveHullGenerator(ndInt32 maxConvexes, bool quality) - :ndConvexApproximation(maxConvexes, quality) - ,m_progressBar(nullptr) - ,m_acc(0.0f) - { - } - - ~ConveHullGenerator() - { - check(!m_progressBar); - } - - // for some reason the progress bar invalidate some UClasses - // I need to report this some day to unreal. - // for now just do not report progress. - //void InitProgress() - //{ - // m_progressBar = new FScopedSlowTask(100.0f, NSLOCTEXT("Newton", "Newton", "Generation Convex Approximation")); - // m_progressBar->MakeDialog(); - //} - //void EndProgress() - //{ - // check(m_progressBar); - // delete m_progressBar; - // m_progressBar = nullptr; - //} - - virtual void Progress() override - { - //m_acc += 1.0f; - //if (m_acc < 99.9f) - //{ - // m_progressBar->EnterProgressFrame(); - //} - } - - FScopedSlowTask* m_progressBar; - float m_acc; - }; - - ConveHullGenerator convexHullSet(ConvexApproximate.MaxConvexes, ConvexApproximate.HighResolution); - - const UStaticMesh* const staticMesh = staticComponent->GetStaticMesh().Get(); - check(staticMesh); - const FStaticMeshRenderData* const renderData = staticMesh->GetRenderData(); - check(renderData); - const FStaticMeshLODResourcesArray& renderResource = renderData->LODResources; - - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(0.0f)); - const ndVector bakedScale(scale.Scale(UNREAL_INV_UNIT_SYSTEM)); - - const FStaticMeshLODResources& renderLOD = renderResource[0]; - const FStaticMeshVertexBuffers& staticMeshVertexBuffer = renderLOD.VertexBuffers;; - const FPositionVertexBuffer& positBuffer = staticMeshVertexBuffer.PositionVertexBuffer; - - ndHullInputMesh& inputMesh = convexHullSet.m_inputMesh; - for (ndInt32 i = 0; i < ndInt32(positBuffer.GetNumVertices()); ++i) - { - ndHullPoint q; - const FVector3f p(positBuffer.VertexPosition(i)); - - q.m_x = ndReal(p.X * bakedScale.m_x); - q.m_y = ndReal(p.Y * bakedScale.m_y); - q.m_z = ndReal(p.Z * bakedScale.m_z); - inputMesh.m_points.PushBack(q); - } - - const FRawStaticIndexBuffer& indexBuffer = renderLOD.IndexBuffer; - for (ndInt32 i = 0; i < ndInt32(indexBuffer.GetNumIndices()); i += 3) - { - ndHullInputMesh::ndFace face; - face.m_i0 = indexBuffer.GetIndex(i + 0); - face.m_i1 = indexBuffer.GetIndex(i + 1); - face.m_i2 = indexBuffer.GetIndex(i + 2); - check(face.m_i0 != face.m_i1); - check(face.m_i0 != face.m_i2); - check(face.m_i1 != face.m_i2); - inputMesh.m_faces.PushBack(face); - } - - convexHullSet.Execute(); - - AActor* const actor = staticComponent->GetOwner(); - check(actor); - ndArray& hullArray = convexHullSet.m_ouputHulls; - for (ndInt32 i = hullArray.GetCount() - 1; i >= 0; --i) - { - UNewtonCollisionConvexHull* const childConvex = Cast(actor->AddComponentByClass(UNewtonCollisionConvexHull::StaticClass(), false, FTransform(), true)); - actor->FinishAddComponent(childConvex, false, FTransform()); - actor->AddInstanceComponent(childConvex); - childConvex->AttachToComponent(staticComponent, FAttachmentTransformRules::KeepRelativeTransform); - childConvex->MarkRenderDynamicDataDirty(); - childConvex->NotifyMeshUpdated(); - - const ndHullOutput* const convexHull = hullArray[i]; - childConvex->SetProceduralData(*convexHull); - } -} - -void UNewtonRigidBody::CreateRigidBody(ANewtonWorldActor* const worldActor, bool overrideAutoSleep) -{ - m_newtonWorld = worldActor; - const ndMatrix matrix(ToNewtonMatrix(m_globalTransform)); - m_body = new ndBodyDynamic(); - m_body->SetMatrix(matrix); - - ndShapeInstance* const shape = CreateCollision(matrix); - m_body->SetCollisionShape(*shape); - m_body->SetMassMatrix(Mass, *shape); - m_body->SetAutoSleep(AutoSleepMode && overrideAutoSleep); - m_body->SetNotifyCallback(new NotifyCallback(this, ndVector(ndFloat32(Gravity.X * UNREAL_INV_UNIT_SYSTEM), ndFloat32(Gravity.Y * UNREAL_INV_UNIT_SYSTEM), ndFloat32(Gravity.Z * UNREAL_INV_UNIT_SYSTEM), ndFloat32(0.0f)))); - - m_body->SetLinearDamping(LinearDamp); - m_body->SetAngularDamping(ndVector(AngularDamp)); - m_body->SetOmega(ndVector(ndFloat32(InitialOmega.X), ndFloat32(InitialOmega.Y), ndFloat32(InitialOmega.Z), ndFloat32(0.0f))); - m_body->SetVelocity(ndVector(ndFloat32(InitialVeloc.X * UNREAL_INV_UNIT_SYSTEM), ndFloat32(InitialVeloc.Y * UNREAL_INV_UNIT_SYSTEM), ndFloat32(InitialVeloc.Z * UNREAL_INV_UNIT_SYSTEM), ndFloat32(0.0f))); - - ndVector centerOfGravity(m_body->GetCentreOfMass()); - centerOfGravity += ndVector(ndFloat32(CenterOfMass.X * UNREAL_INV_UNIT_SYSTEM), ndFloat32(CenterOfMass.Y * UNREAL_INV_UNIT_SYSTEM), ndFloat32(CenterOfMass.Z * UNREAL_INV_UNIT_SYSTEM), ndFloat32(0.0f)); - m_body->SetCentreOfMass(centerOfGravity); - - ndWorld* world = m_newtonWorld->GetNewtonWorld(); - world->AddBody(m_body); - delete shape; - - AActor* const actor = GetOwner(); - m_sleeping = false; - ndFixSizeArray stack; - stack.PushBack(this); - while (stack.GetCount()) - { - USceneComponent* const component = stack.Pop(); - UNewtonCollision* const collision = Cast(component); - if (collision) - { - collision->SetWireFrameColor(m_awakeColor); - } - - const TArray>& childrenComp = component->GetAttachChildren(); - for (int i = childrenComp.Num() - 1; i >= 0; --i) - { - stack.PushBack(childrenComp[i].Get()); - } - } -} - -ndShapeInstance* UNewtonRigidBody::CreateCollision(const ndMatrix& bodyMatrix) const -{ - ndArray collisionShapes; - ndFixSizeArray stack; - stack.PushBack((USceneComponent*)this); - while (stack.GetCount()) - { - USceneComponent* const component = stack.Pop(); - UNewtonCollision* const shape = Cast(component); - if (shape) - { - shape->ApplyPropertyChanges(); - collisionShapes.PushBack(shape); - } - const TArray>& childrenComp = component->GetAttachChildren(); - for (int i = childrenComp.Num() - 1; i >= 0; --i) - { - stack.PushBack(childrenComp[i].Get()); - } - } - - if (collisionShapes.GetCount() == 0) - { - return new ndShapeInstance(new ndShapeNull()); - } - - ndShapeInstance* const compoundInstance = new ndShapeInstance(new ndShapeCompound()); - ndShapeCompound* const compound = compoundInstance->GetShape()->GetAsShapeCompound(); - compound->BeginAddRemove(); - for (ndInt32 i = collisionShapes.GetCount() - 1; i >= 0; --i) - { - ndShapeInstance* const subShape = collisionShapes[i]->CreateBodyInstanceShape(bodyMatrix); - compound->AddCollision(subShape); - delete subShape; - } - compound->EndAddRemove(); - return compoundInstance; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonRigidBody.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonRigidBody.h deleted file mode 100644 index a7d07218e9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonRigidBody.h +++ /dev/null @@ -1,145 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "Components/SceneComponent.h" -#include "NewtonRigidBody.generated.h" - -class ndWorld; -class ndMatrix; -class ndBodyDynamic; -class ndShapeInstance; -class ANewtonWorldActor; -class UNewtonCollision; - -USTRUCT() -struct FConvexApproximationStruct -{ - GENERATED_BODY(); - - UPROPERTY(EditAnywhere, Category = Newton) - bool Generate = false; - - UPROPERTY(EditAnywhere, Category = Newton) - bool HighResolution = false; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 1, ClampMax = 128)) - int MaxConvexes = 16; -}; - -USTRUCT() -struct FInertiaStruct -{ - GENERATED_BODY(); - - UPROPERTY(EditAnywhere, Category = Newton) - bool ShowPrincipalAxis = false; - - UPROPERTY(VisibleAnywhere, Category = Newton) - FVector PrincipalInertia = FVector(0.0f, 0.0f, 0.0f); - - UPROPERTY(EditAnywhere, Category = Newton) - FVector PrincipalInertiaScaler = FVector(1.0f, 1.0f, 1.0f); - - UPROPERTY(EditAnywhere, Category = Newton) - FRotator PrincipalInertiaAxis = FRotator(0.0f, 0.0f, 0.0f); -}; - -/** - * - */ -UCLASS(ClassGroup = Newton, meta=(BlueprintSpawnableComponent), HideCategories = (Physics, Collision), MinimalAPI) -class UNewtonRigidBody : public USceneComponent -{ - GENERATED_BODY() - - class NotifyCallback; - - public: - // Sets default values for this component's properties - UNewtonRigidBody(); - - static ndMatrix ToNewtonMatrix(const FTransform& tranform); - static FTransform ToUnRealTransform(const ndMatrix& matrix); - - protected: - // Called every frame - virtual void PostLoad() override; - virtual void OnRegister() override; - virtual void OnUnregister() override; - virtual void BeginDestroy() override; - virtual void OnChildAttached(USceneComponent* ChildComponent); - virtual void OnChildDetached(USceneComponent* ChildComponent); - virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; - virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; - - void UpdateTransform(); - void DestroyRigidBody(); - void CalculateLocalTransform(); - void DrawGizmo(float timestep); - void InterpolateTransform(float param); - void CreateConvexApproximationShapes(UStaticMeshComponent* const staticComponent); - - virtual void ClearDebug(); - virtual void ApplyPropertyChanges(); - ndMatrix CalculateInertiaMatrix() const; - void CreateRigidBody(ANewtonWorldActor* const worldActor, bool overrideAutoSleep); - virtual ndShapeInstance* CreateCollision(const ndMatrix& bodyMatrix) const; - - UPROPERTY(EditAnywhere, Category = Newton) - bool ShowDebug; - - UPROPERTY(EditAnywhere, Category = Newton) - bool ShowCenterOfMass; - - UPROPERTY(EditAnywhere, Category = Newton) - bool AutoSleepMode; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.1f, ClampMax = 4.0f)) - float DebugScale; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0f)) - float Mass; - - UPROPERTY(EditAnywhere, Category = Newton) - FInertiaStruct Inertia; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0f, ClampMax = 1.0f)) - float LinearDamp; - - UPROPERTY(EditAnywhere, Category = Newton, meta = (ClampMin = 0.0f, ClampMax = 1.0f)) - float AngularDamp; - - UPROPERTY(EditAnywhere, Category = Newton) - FVector InitialVeloc; - - UPROPERTY(EditAnywhere, Category = Newton) - FVector InitialOmega; - - UPROPERTY(EditAnywhere, Category = Newton) - FVector CenterOfMass; - - UPROPERTY(EditAnywhere, Category = Newton) - FVector Gravity; - - UPROPERTY(EditAnywhere, Category = Newton) - FConvexApproximationStruct ConvexApproximate; - - FVector m_localScale; - FVector m_globalScale; - FTransform m_localTransform; - FTransform m_globalTransform; - ndBodyDynamic* m_body; - ANewtonWorldActor* m_newtonWorld; - bool m_sleeping; - bool m_propertyChanged; - - static FLinearColor m_awakeColor; - static FLinearColor m_sleepingColor; - - friend class UNewtonJoint; - friend class FnewtonModule; - friend class UNewtonCollision; - friend class ANewtonWorldActor; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneActor.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneActor.cpp deleted file mode 100644 index ef5e7a1f6c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneActor.cpp +++ /dev/null @@ -1,312 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#include "NewtonSceneActor.h" -#include "Selection.h" -#include "LevelEditor.h" -#include "EngineUtils.h" -#include "LandscapeProxy.h" - -#include "Newton.h" -#include "NewtonCollision.h" -#include "NewtonWorldActor.h" -#include "NewtonCollisionBox.h" -#include "NewtonSceneRigidBody.h" -#include "NewtonCollisionSphere.h" -#include "NewtonCollisionCapsule.h" -#include "NewtonCollisionLandscape.h" -#include "NewtonCollisionConvexHull.h" -#include "NewtonCollisionPolygonalMesh.h" -#include "ThirdParty/newtonLibrary/Public/thirdParty/ndConvexApproximation.h" - -// Sets default values -ANewtonSceneActor::ANewtonSceneActor() -{ - // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. - PrimaryActorTick.bCanEverTick = true; - - GenerateShapes = false; - m_propertyChanged = false; - - RootBody = CreateDefaultSubobject(TEXT("NewtonStaticBody")); - RootComponent = RootBody; - //RootBody->Mobility = EComponentMobility::Static; -} - -void ANewtonSceneActor::PostLoad() -{ - Super::PostLoad(); - m_propertyChanged = true; -} - -void ANewtonSceneActor::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) -{ - Super::PostEditChangeProperty(PropertyChangedEvent); - m_propertyChanged = true; -} - -void ANewtonSceneActor::CreateCollisionFromUnrealPrimitive(TObjectPtr staticComponent) -{ - const UStaticMesh* const staticMesh = staticComponent->GetStaticMesh().Get(); - if (staticMesh) - { - auto GenerateSimpleCollision = [this, staticComponent]() - { - bool hasSimple = false; - //AActor* const actor = staticComponent->GetOwner(); - const UStaticMesh* const staticMesh = staticComponent->GetStaticMesh().Get(); - const UBodySetup* const bodySetup = staticMesh->GetBodySetup(); - - const FKAggregateGeom& aggGeom = bodySetup->AggGeom; - auto AddComponent = [this, staticComponent](UNewtonCollision* const childComp) - { - //UE_LOG(LogTemp, Warning, TEXT("From NewtonSceneRigidBody, component render but does not shows in blueprint browser")); - check(IsValid(childComp)); - FinishAddComponent(childComp, false, FTransform()); - AddInstanceComponent(childComp); - childComp->AttachToComponent(RootBody, FAttachmentTransformRules::KeepRelativeTransform); - childComp->MarkRenderDynamicDataDirty(); - childComp->NotifyMeshUpdated(); - childComp->SetGeometryMesh(staticComponent); - }; - - for (int i = aggGeom.SphereElems.Num() - 1; i >= 0; --i) - { - UNewtonCollisionSphere* const child = Cast(AddComponentByClass(UNewtonCollisionSphere::StaticClass(), false, FTransform(), true)); - AddComponent(child); - hasSimple = true; - } - - for (int i = aggGeom.SphylElems.Num() - 1; i >= 0; --i) - { - UNewtonCollisionCapsule* const child = Cast(AddComponentByClass(UNewtonCollisionCapsule::StaticClass(), false, FTransform(), true)); - AddComponent(child); - hasSimple = true; - } - - for (int i = aggGeom.BoxElems.Num() - 1; i >= 0; --i) - { - UNewtonCollisionBox* const child = Cast(AddComponentByClass(UNewtonCollisionBox::StaticClass(), false, FTransform(), true)); - AddComponent(child); - hasSimple = true; - } - - for (int i = aggGeom.ConvexElems.Num() - 1; i >= 0; --i) - { - UNewtonCollisionConvexHull* const child = Cast(AddComponentByClass(UNewtonCollisionConvexHull::StaticClass(), false, FTransform(), true)); - AddComponent(child); - hasSimple = true; - } - - for (int i = aggGeom.TaperedCapsuleElems.Num() - 1; i >= 0; --i) - { - check(0); - } - - for (int i = aggGeom.LevelSetElems.Num() - 1; i >= 0; --i) - { - check(0); - } - - for (int i = aggGeom.SkinnedLevelSetElems.Num() - 1; i >= 0; --i) - { - check(0); - } - - return hasSimple; - }; - - auto GenerateComplexCollision = [this, staticComponent]() - { - //AActor* const actor = staticComponent->GetOwner(); - auto AddComponent = [this, staticComponent](UNewtonCollision* const childComp) - { - FinishAddComponent(childComp, false, FTransform()); - AddInstanceComponent(childComp); - childComp->AttachToComponent(RootBody, FAttachmentTransformRules::KeepRelativeTransform); - childComp->MarkRenderDynamicDataDirty(); - childComp->NotifyMeshUpdated(); - childComp->SetGeometryMesh(staticComponent); - - //const FTransform bodyTransform(RootBody->GetComponentToWorld()); - //const FTransform meshTransform(staticComponent->GetComponentToWorld()); - //const FTransform transform(meshTransform * bodyTransform.Inverse()); - //childComp->SetComponentToWorld(transform); - }; - - UNewtonCollisionPolygonalMesh* const child = Cast(AddComponentByClass(UNewtonCollisionPolygonalMesh::StaticClass(), false, FTransform(), true)); - AddComponent(child); - }; - - const UBodySetup* const bodySetup = staticMesh->GetBodySetup(); - ECollisionTraceFlag collisionFlag = bodySetup->GetCollisionTraceFlag(); - switch (collisionFlag) - { - case CTF_UseDefault: - { - check(0); - if (!GenerateSimpleCollision()) - { - GenerateComplexCollision(); - } - break; - } - case CTF_UseSimpleAndComplex: - { - if (!GenerateSimpleCollision()) - { - GenerateComplexCollision(); - } - break; - } - case CTF_UseSimpleAsComplex: - { - //GenerateSimpleCollision(); - break; - } - case CTF_UseComplexAsSimple: - { - check(0); - GenerateComplexCollision(); - break; - } - } - } -} - -void ANewtonSceneActor::ApplyPropertyChanges() -{ - if (!m_propertyChanged) - { - return; - } - m_propertyChanged = false; - - if (!GenerateShapes) - { - return; - } - GenerateShapes = false; - - FFolder folder(GetFolder()); - if (folder.IsNone()) - { - UE_LOG(LogTemp, Warning, TEXT("NewtonSceneActor must be child of an oulier folder filder")); - return; - } - - ndArray actorList; - const UWorld* const world = GetWorld(); - const FString key(folder.GetPath().ToString()); - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor != this) - { - const FString key1(actor->GetFolder().ToString()); - int index = key1.Find(key); - if (index == 0) - { - actorList.PushBack(actor); - } - } - } - - for (ndInt32 i = ndInt32(actorList.GetCount()) - 1; i >= 0; --i) - { - AActor* const sceneActor = actorList[i]; - const ALandscapeProxy* const landscapeProxy = Cast(sceneActor); - if (landscapeProxy) - { - GenerateLandScapeCollision(landscapeProxy); - } - else - { - GenerateStaticMeshCollision(sceneActor); - } - } - - FLevelEditorModule& levelEditor = FModuleManager::LoadModuleChecked("LevelEditor"); - levelEditor.BroadcastComponentsEdited(); - levelEditor.BroadcastRedrawViewports(false); -} - -void ANewtonSceneActor::GenerateStaticMeshCollision(const AActor* const actor) -{ - TArray> stack; - TArray> staticMesh; - - stack.Push(TObjectPtr(actor->GetRootComponent())); - while (stack.Num()) - { - TObjectPtr component(stack.Pop()); - TObjectPtr mesh(Cast(component)); - if (mesh) - { - staticMesh.Push(mesh); - } - const TArray>& children = component->GetAttachChildren(); - for (ndInt32 i = children.Num() - 1; i >= 0; --i) - { - stack.Push(children[i].Get()); - } - } - - const TArray>& children = RootBody->GetAttachChildren(); - auto HasCollision = [this, &children](const UStaticMeshComponent* const meshComp) - { - for (ndInt32 i = children.Num() - 1; i >= 0; --i) - { - const UNewtonCollision* const collision = Cast(children[i]); - if (collision && (collision->GetGeometryMesh() == meshComp)) - { - return true; - } - } - return false; - }; - - for (ndInt32 i = staticMesh.Num() - 1; i >= 0; --i) - { - TObjectPtrmeshComponent(staticMesh[i]); - if (!HasCollision(meshComponent.Get())) - { - CreateCollisionFromUnrealPrimitive(meshComponent); - } - } -} - -void ANewtonSceneActor::GenerateLandScapeCollision(const ALandscapeProxy* const landscapeProxy) -{ - const TArray>& landScapeTiles = landscapeProxy->CollisionComponents; - check(landScapeTiles.Num()); - const TArray>& children = RootBody->GetAttachChildren(); - - auto HasCollision = [this, &children](const TObjectPtr& tile) - { - for (ndInt32 i = children.Num() - 1; i >= 0; --i) - { - UNewtonCollisionLandscape* const collision = Cast(children[i]); - if (collision && (collision->GetGeometryMesh() == tile)) - { - return true; - } - } - return false; - }; - - for (ndInt32 i = landScapeTiles.Num() - 1; i >= 0; --i) - //for (ndInt32 i = 0; i < 1; ++i) - { - const TObjectPtr& tile = landScapeTiles[i]; - if (!HasCollision(tile)) - { - UNewtonCollisionLandscape* const collisionTile = Cast(AddComponentByClass(UNewtonCollisionLandscape::StaticClass(), false, FTransform(), true)); - FinishAddComponent(collisionTile, false, FTransform()); - AddInstanceComponent(collisionTile); - collisionTile->AttachToComponent(RootBody, FAttachmentTransformRules::KeepRelativeTransform); - collisionTile->MarkRenderDynamicDataDirty(); - collisionTile->NotifyMeshUpdated(); - collisionTile->SetGeometryMesh(tile); - } - } -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneActor.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneActor.h deleted file mode 100644 index 05817a0b70..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneActor.h +++ /dev/null @@ -1,40 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "GameFramework/Actor.h" -#include "NewtonSceneActor.generated.h" - - -class ALandscapeProxy; - -UCLASS(ClassGroup = NewtonScene, meta=(BlueprintSpawnableComponent), HideCategories = (Physics, Collision), MinimalAPI) -class ANewtonSceneActor : public AActor -{ - GENERATED_BODY() - - public: - // Sets default values for this actor's properties - ANewtonSceneActor(); - - virtual void PostLoad() override; - virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; - - void ApplyPropertyChanges(); - - protected: - UPROPERTY(EditAnywhere, Category = Newton) - bool GenerateShapes; - - UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = NewtonScene, meta = (AllowPrivateAccess = "true")) - TObjectPtr RootBody; - - private: - void GenerateStaticMeshCollision(const AActor* const actor); - void GenerateLandScapeCollision(const ALandscapeProxy* const landscape); - void CreateCollisionFromUnrealPrimitive(TObjectPtr staticComponent); - - bool m_propertyChanged; - friend class FnewtonModule; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneRigidBody.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneRigidBody.cpp deleted file mode 100644 index a2a1e8f709..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneRigidBody.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonSceneRigidBody.h" -#include "Landscape.h" -#include "LevelEditor.h" -#include "LandscapeProxy.h" - -#include "Newton.h" -#include "NewtonWorldActor.h" -#include "NewtonCollisionLandscape.h" -#include "ThirdParty/newtonLibrary/Public/thirdParty/ndConvexApproximation.h" - -UNewtonSceneRigidBody::UNewtonSceneRigidBody() - :Super() -{ -} - -ndShapeInstance* UNewtonSceneRigidBody::CreateCollision(const ndMatrix& bodyMatrix) const -{ - ndArray subShapes; - const TArray>& children = GetAttachChildren(); - - for (int i = children.Num() - 1; i >= 0; --i) - { - const UNewtonCollision* const shape = Cast(children[i]); - if (shape) - { - subShapes.PushBack(shape); - } - } - - if (subShapes.GetCount() == 0) - { - return new ndShapeInstance(new ndShapeNull()); - } - - if (subShapes.GetCount() == 1) - { - return subShapes[0]->CreateBodyInstanceShape(bodyMatrix); - } - - ndShapeInstance* const compoundInstance = new ndShapeInstance(new ndShapeCompound()); - ndShapeCompound* const compound = compoundInstance->GetShape()->GetAsShapeCompound(); - compound->BeginAddRemove(); - for (ndInt32 i = subShapes.GetCount() - 1; i >= 0; --i) - { - ndShapeInstance* const shapeInstance = subShapes[i]->CreateBodyInstanceShape(bodyMatrix); - compound->AddCollision(shapeInstance); - delete shapeInstance; - } - compound->EndAddRemove(); - return compoundInstance; -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneRigidBody.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneRigidBody.h deleted file mode 100644 index 3f01833e19..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonSceneRigidBody.h +++ /dev/null @@ -1,22 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "NewtonRigidBody.h" -#include "NewtonSceneRigidBody.generated.h" - -/** - * - */ -UCLASS(ClassGroup = NewtonScene, meta=(BlueprintSpawnableComponent), HideCategories = (Physics, Collision), MinimalAPI) -class UNewtonSceneRigidBody : public UNewtonRigidBody -{ - GENERATED_BODY() - - public: - UNewtonSceneRigidBody(); - - //virtual void ApplyPropertyChanges() override; - virtual ndShapeInstance* CreateCollision(const ndMatrix& bodyMatrix) const override; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonWorldActor.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonWorldActor.cpp deleted file mode 100644 index 9cadced335..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonWorldActor.cpp +++ /dev/null @@ -1,388 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "NewtonWorldActor.h" -#include "Newton.h" -#include "EngineUtils.h" -#include "LevelEditor.h" -#include "Kismet/GameplayStatics.h" -#include "Interfaces/IPluginManager.h" - -#include "NewtonJoint.h" -#include "NewtonRigidBody.h" -#include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" - -class ANewtonWorldActor::NewtonWorld: public ndWorld -{ - public: - NewtonWorld(ANewtonWorldActor* const owner) - :ndWorld() - ,m_owner(owner) - { - } - - virtual ~NewtonWorld() - { - } - - virtual void UpdateTransforms() - { - ndWorld::UpdateTransforms(); - - const ndArray& bodyList = GetBodyList().GetView(); - for (ndInt32 i = bodyList.GetCount() - 1; i >= 0; --i) - { - ndBodyKinematic* const body = bodyList[i]; - ndBodyNotify* const notify = body->GetNotifyCallback(); - if (notify) - { - UNewtonRigidBody* const meshComp = Cast((USceneComponent*)notify->GetUserData()); - if (meshComp) - { - meshComp->UpdateTransform(); - } - } - } - } - - ANewtonWorldActor* m_owner; -}; - -// Sets default values -ANewtonWorldActor::ANewtonWorldActor() - :m_world(nullptr) - ,m_timeAccumulator(0.0f) - ,m_interpolationParam(1.0f) - ,m_beginPlay(false) -{ - // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. - //PrimaryActorTick.bCanEverTick = true; - - SolverPasses = 2; - UpdateRate = 60.0f; - ParallelThreads = 1; - SolverIterations = 4; - - ClearDebug = false; - AutoSleepMode = true; - ConcurrentUpdate = false; - SolverMode = SolverModeTypes::scalar; -} - -ndWorld* ANewtonWorldActor::GetNewtonWorld() const -{ - return m_world; -} - -// Called when the game starts or when spawned -void ANewtonWorldActor::BeginPlay() -{ - Super::BeginPlay(); - m_beginPlay = true; - if (!m_world) - { - m_world = new NewtonWorld(this); - } - ApplySettings(); - m_world->Sync(); -} - -void ANewtonWorldActor::StartGame() -{ - m_beginPlay = false; - - check(m_world); - - m_world->Sync(); - - UWorld* const world = GetWorld(); - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor->FindComponentByClass(UNewtonRigidBody::StaticClass())) - { - const TSet& components = actor->GetComponents(); - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonRigidBody* const meshComp = Cast(*it); - if (meshComp) - { - meshComp->CreateRigidBody(this, AutoSleepMode); - } - } - } - } - - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor->FindComponentByClass(UNewtonRigidBody::StaticClass())) - { - UNewtonJoint* const component = Cast(actor->FindComponentByClass(UNewtonJoint::StaticClass())); - if (component) - { - component->CreateJoint(this); - } - } - } - - m_timeAccumulator = 0.0f; -} - -void ANewtonWorldActor::Cleanup() -{ - m_world->Sync(); - - UWorld* const world = GetWorld(); - - m_world->Sync(); - - // remove all joints body actors. - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor->FindComponentByClass(UNewtonRigidBody::StaticClass())) - { - const TSet& components = actor->GetComponents(); - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonJoint* const joint = Cast(*it); - if (joint) - { - joint->DestroyJoint(); - } - } - } - } - - // remove all rigid body actors. - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor->FindComponentByClass(UNewtonRigidBody::StaticClass())) - { - const TSet& components = actor->GetComponents(); - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonRigidBody* const meshComp = Cast(*it); - if (meshComp) - { - meshComp->DestroyRigidBody(); - } - } - } - } -} - -void ANewtonWorldActor::EndPlay(const EEndPlayReason::Type EndPlayReason) -{ - Super::EndPlay(EndPlayReason); - if (m_world) - { - Cleanup(); - switch (EndPlayReason) - { - case EEndPlayReason::Destroyed: - ndAssert(0); - break; - case EEndPlayReason::LevelTransition: - ndAssert(0); - break; - case EEndPlayReason::EndPlayInEditor: - ndAssert(0); - break; - case EEndPlayReason::RemovedFromWorld: - ndAssert(0); - break; - case EEndPlayReason::Quit: - m_world->Sync(); - delete m_world; - break; - } - } -} - -void ANewtonWorldActor::Destroyed() -{ - Super::Destroyed(); - - if (m_world) - { - m_world->Sync(); - delete m_world; - } -} - -void ANewtonWorldActor::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) -{ - AActor::PostEditChangeProperty(PropertyChangedEvent); - if (m_world) - { - ApplySettings(); - } - - if (PropertyChangedEvent.GetPropertyName() == "ClearDebug") - { - const UWorld* const world = GetWorld(); - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - const TSet& components = actor->GetComponents(); - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonRigidBody* const body = Cast(*it); - if (body) - { - body->ClearDebug(); - } - - UNewtonJoint* const joint = Cast(*it); - if (joint) - { - joint->ClearDebug(); - } - } - } - - ClearDebug = false; - FLevelEditorModule& levelEditor = FModuleManager::LoadModuleChecked("LevelEditor"); - levelEditor.BroadcastComponentsEdited(); - levelEditor.BroadcastRedrawViewports(false); - } -} - -float ANewtonWorldActor::GetSimTime() const -{ - return float (m_world->GetAverageUpdateTime()); -} - -void ANewtonWorldActor::ApplySettings() -{ - m_world->Sync(); - - ndWorld::ndSolverModes mode = ndWorld::ndStandardSolver; - switch(SolverMode) - { - case SolverModeTypes::scalar: - mode = ndWorld::ndStandardSolver; - break; - case SolverModeTypes::soaSimd: - mode = ndWorld::ndSimdSoaSolver; - break; - }; - - m_world->SelectSolver(mode); - m_world->SetSubSteps(SolverPasses); - m_world->SetThreadCount(ParallelThreads); - m_world->SetSolverIterations(SolverIterations); - - const ndBodyListView& bodyList = m_world->GetBodyList(); - for (ndBodyListView::ndNode* node = bodyList.GetFirst(); node; node = node->GetNext()) - { - ndBodyKinematic* const body = node->GetInfo()->GetAsBodyKinematic(); - body->SetAutoSleep(AutoSleepMode); - } -} - -// Called every frame -void ANewtonWorldActor::Tick(float DeltaTime) -{ - Super::Tick(DeltaTime); -} - -// tick surrugate -void ANewtonWorldActor::Update(float timestep) -{ - if (m_world) - { - const ndFloat32 descreteStep = (1.0f / UpdateRate); - m_timeAccumulator += timestep; - - if (m_timeAccumulator > descreteStep * ndFloat32 (2.0f)) - { - // truncate slow frame updates - m_timeAccumulator = m_timeAccumulator - descreteStep * ndFloor(m_timeAccumulator / descreteStep) + descreteStep; - } - - UWorld* const world = GetWorld(); - while (m_timeAccumulator > descreteStep) - { - m_world->Update(descreteStep); - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor->FindComponentByClass(UNewtonRigidBody::StaticClass())) - { - const TSet& components = actor->GetComponents(); - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonRigidBody* const rigidBody = Cast(*it); - if (rigidBody) - { - rigidBody->InterpolateTransform(m_interpolationParam); - } - } - } - } - - m_timeAccumulator -= descreteStep; - if (!ConcurrentUpdate) - { - m_world->Sync(); - } - } - - m_interpolationParam = ndClamp(m_timeAccumulator / descreteStep, ndFloat32(0.0f), ndFloat32(1.0f)); - - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor->FindComponentByClass(UNewtonRigidBody::StaticClass())) - { - const TSet& components = actor->GetComponents(); - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonRigidBody* const rigidBody = Cast(*it); - if (rigidBody) - { - rigidBody->InterpolateTransform(m_interpolationParam); - } - } - } - } - - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor->FindComponentByClass(UNewtonRigidBody::StaticClass())) - { - const TSet& components = actor->GetComponents(); - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonRigidBody* const meshComp = Cast(*it); - if (meshComp) - { - meshComp->CalculateLocalTransform(); - } - } - } - } - - for (TActorIterator actorItr(world); actorItr; ++actorItr) - { - AActor* const actor = *actorItr; - if (actor->FindComponentByClass(UNewtonRigidBody::StaticClass())) - { - const TSet& components = actor->GetComponents(); - for (TSet::TConstIterator it(components.CreateConstIterator()); it; ++it) - { - UNewtonJoint* const joint = Cast(*it); - if (joint) - { - joint->UpdateTransform(); - } - } - } - } - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonWorldActor.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonWorldActor.h deleted file mode 100644 index 55cbe5708d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/NewtonWorldActor.h +++ /dev/null @@ -1,79 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "GameFramework/Actor.h" -#include "NewtonWorldActor.generated.h" - -class UDynamicMesh; - -UENUM() -enum class SolverModeTypes : uint8 -{ - scalar, - soaSimd, -}; - -class ndWorld; - -UCLASS( ClassGroup = NewtonActors, meta=(BlueprintSpawnableComponent) ) -class ANewtonWorldActor : public AActor -{ - GENERATED_BODY() - - class NewtonWorld; - public: - // Sets default values for this actor's properties - ANewtonWorldActor(); - - ndWorld* GetNewtonWorld() const; - - protected: - // Called when the game starts or when spawned - virtual void BeginPlay() override; - virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; - virtual void Destroyed(); - virtual void Tick(float DeltaTime) override; - virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; - - void ApplySettings(); - float GetSimTime() const; - void Update(float timestep); - - UPROPERTY(EditAnywhere, Category=Newton) - float UpdateRate; - - UPROPERTY(EditAnywhere, Category=Newton, meta = (ClampMin = 2, ClampMax = 8)) - int SolverPasses; - - UPROPERTY(EditAnywhere, Category=Newton, meta = (ClampMin = 4, ClampMax = 32)) - int SolverIterations; - - UPROPERTY(EditAnywhere, Category=Newton, meta = (ClampMin = 1, ClampMax = 32)) - int ParallelThreads; - - UPROPERTY(EditAnywhere, Category = Newton, meta=(ValidEnumValues="scalar, soaSimd")) - SolverModeTypes SolverMode; - - UPROPERTY(EditAnywhere, Category = Newton) - bool AutoSleepMode; - - UPROPERTY(EditAnywhere, Category=Newton) - bool ConcurrentUpdate; - - UPROPERTY(EditAnywhere, Category=Newton) - bool ClearDebug; - - private: - void Cleanup(); - void StartGame(); - - NewtonWorld* m_world; - float m_timeAccumulator; - float m_interpolationParam; - bool m_beginPlay; - - friend class FnewtonModule; - friend class UNewtonCollision; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonCommands.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonCommands.cpp deleted file mode 100644 index 69973708b4..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonCommands.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#include "testButtonCommands.h" - -#define LOCTEXT_NAMESPACE "FtestButtonModule" - -void FtestButtonCommands::RegisterCommands() -{ - UI_COMMAND(PluginAction, "newton", "newton editor updates", EUserInterfaceActionType::Button, FInputChord()); -} - -#undef LOCTEXT_NAMESPACE diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonCommands.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonCommands.h deleted file mode 100644 index dbe1729f9d..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonCommands.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#pragma once - -#include "CoreMinimal.h" -#include "Framework/Commands/Commands.h" -#include "testButtonStyle.h" - -class FtestButtonCommands : public TCommands -{ -public: - - FtestButtonCommands() - : TCommands(TEXT("newton"), NSLOCTEXT("Contexts", "newton", "newton Plugin"), NAME_None, FtestButtonStyle::GetStyleSetName()) - { - } - - // TCommands<> interface - virtual void RegisterCommands() override; - -public: - TSharedPtr< FUICommandInfo > PluginAction; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonStyle.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonStyle.cpp deleted file mode 100644 index 11258e250a..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonStyle.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#include "testButtonStyle.h" -#include "Framework/Application/SlateApplication.h" -#include "Styling/SlateStyleRegistry.h" -#include "Slate/SlateGameResources.h" -#include "Interfaces/IPluginManager.h" -#include "Styling/SlateStyleMacros.h" - -#define RootToContentDir Style->RootToContentDir - -TSharedPtr FtestButtonStyle::StyleInstance = nullptr; - -void FtestButtonStyle::Initialize() -{ - if (!StyleInstance.IsValid()) - { - StyleInstance = Create(); - FSlateStyleRegistry::RegisterSlateStyle(*StyleInstance); - } -} - -void FtestButtonStyle::Shutdown() -{ - FSlateStyleRegistry::UnRegisterSlateStyle(*StyleInstance); - ensure(StyleInstance.IsUnique()); - StyleInstance.Reset(); -} - -FName FtestButtonStyle::GetStyleSetName() -{ - static FName StyleSetName(TEXT("testButtonStyle")); - return StyleSetName; -} - - -TSharedRef< FSlateStyleSet > FtestButtonStyle::Create() -{ - TSharedRef< FSlateStyleSet > Style = MakeShareable(new FSlateStyleSet("testButtonStyle")); - Style->SetContentRoot(IPluginManager::Get().FindPlugin("newton")->GetBaseDir() / TEXT("Resources")); - - //Style->Set("testButton.PluginAction", new IMAGE_BRUSH_SVG(TEXT("PlaceholderButtonIcon"), Icon40x40)); - //Style->Set("testButton.PluginAction", new IMAGE_BRUSH_SVG(TEXT("newtonIcon"), Icon40x40)); - - const FVector2D Icon40x40(40.0f, 40.0f); - FSlateImageBrush* const newtonIcon = new IMAGE_BRUSH("newtonIcon", Icon40x40); - Style->Set("newton.PluginAction", newtonIcon); - - return Style; -} - -void FtestButtonStyle::ReloadTextures() -{ - if (FSlateApplication::IsInitialized()) - { - FSlateApplication::Get().GetRenderer()->ReloadTextureResources(); - } -} - -const ISlateStyle& FtestButtonStyle::Get() -{ - return *StyleInstance; -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonStyle.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonStyle.h deleted file mode 100644 index c0c51f71fb..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Private/testButtonStyle.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#pragma once - -#include "CoreMinimal.h" -#include "Styling/SlateStyle.h" - -class FtestButtonStyle -{ -public: - - static void Initialize(); - - static void Shutdown(); - - /** reloads textures used by slate renderer */ - static void ReloadTextures(); - - /** @return The Slate style set for the Shooter game */ - static const ISlateStyle& Get(); - - static FName GetStyleSetName(); - -private: - - static TSharedRef< class FSlateStyleSet > Create(); - -private: - - static TSharedPtr< class FSlateStyleSet > StyleInstance; -}; \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Public/Newton.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Public/Newton.h deleted file mode 100644 index 1c6d2bc0b8..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/Public/Newton.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#pragma once - -#include "Modules/ModuleManager.h" -#include "DynamicMesh/DynamicMesh3.h" -#include "Interfaces/IPluginManager.h" - -#define UNREAL_UNIT_SYSTEM ndFloat32 (100.0f) -#define UNREAL_INV_UNIT_SYSTEM ndFloat32 (1.0f / UNREAL_UNIT_SYSTEM) - -class ndShape; -class ANewtonWorldActor; - -template -class ndSharedPtr; - -class FnewtonModule : public IModuleInterface -{ - class ResourceCache; - public: - enum Version - { - m_firstVersion, - - }; - - /** IModuleInterface implementation */ - virtual void StartupModule() override; - virtual void ShutdownModule() override; - - static FnewtonModule* GetPlugin(); - - ndShape* FindShape(long long hash) const; - TSharedPtr FindDynamicMesh (long long hash) const; - - void AddShape(ndShape* const shape, long long hash); - void AddDynamicMesh(const TSharedPtr& mesh, long long hash); - - private: - bool Tick(float timestep); - void RegisterMenus(); - void ToggleEditorUpdates(); - - void CreateEditorRunTimeButton(); - static void PhysicsFree(void* ptr); - static void* PhysicsAlloc(size_t sizeInBytes); - - void UpdatePropertyChanges(const UWorld* const world) const; - void InitNewtonWorld(ANewtonWorldActor* const newtonWorld) const; - void DrawGizmos(const UWorld* const world, float timestep) const; - void CleanupDebugLines(const UWorld* const world, float timestep) const; - - /** Handle to the test dll we will load */ - void* m_newtonLibraryHandle; - FTickerDelegate m_tickDelegate; - FTSTicker::FDelegateHandle m_tickDelegateHandle; - - // menu bar button - TSharedPtr PluginCommands; - ResourceCache* m_resourceCache; - bool m_runSimulation; - static FnewtonModule* m_pluginSingleton; - - public: - const static FGuid m_guiID; - static int m_currentVersion; - static FCustomVersionRegistration m_guidRegistration; -}; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/newton.Build.cs b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/newton.Build.cs deleted file mode 100644 index df6b1bc65c..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/Source/newton/newton.Build.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -using UnrealBuildTool; - -public class newton : ModuleRules -{ - public newton(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - PrivateDefinitions.Add("_D_CORE_DLL"); - PrivateDefinitions.Add("_D_NEWTON_DLL"); - PrivateDefinitions.Add("_D_COLLISION_DLL"); - - PublicIncludePaths.AddRange( - new string[] { - // ... add public include paths required here ... - } - ); - - - PrivateIncludePaths.AddRange( - new string[] { - // ... add other private include paths required here ... - "ThirdParty/newtonLibrary/Public/dCore/", - "ThirdParty/newtonLibrary/Public/dNewton/", - "ThirdParty/newtonLibrary/Public/dCollision/", - "ThirdParty/newtonLibrary/Public/thirdParty/", - "ThirdParty/newtonLibrary/Public/dNewton/dJoints/", - "ThirdParty/newtonLibrary/Public/dNewton/dModels/", - "ThirdParty/newtonLibrary/Public/dNewton/dIkSolver/", - "ThirdParty/newtonLibrary/Public/dNewton/dModels/dVehicle/" - } - ); - - - PublicDependencyModuleNames.AddRange( - new string[] - { - "Core", - "Slate", - "Engine", - "UnrealEd", - "Projects", - "SlateCore", - "ToolMenus", - "Landscape", - "CoreUObject", - "PhysicsCore", - "GeometryCore", - "EditorFramework", - "GeometryFramework", - - // ... add other public dependencies that you statically link with here ... - "newtonLibrary" - } - ); - - - PrivateDependencyModuleNames.AddRange( - new string[] - { - // ... add private dependencies that you statically link with here ... - } - ); - - - DynamicallyLoadedModuleNames.AddRange( - new string[] - { - // ... add any modules that your module loads dynamically here ... - } - ); - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/newton.uplugin b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/newton.uplugin deleted file mode 100644 index 88fb92c6c9..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Plugins/newton/newton.uplugin +++ /dev/null @@ -1,24 +0,0 @@ -{ - "FileVersion": 3, - "Version": 1, - "VersionName": "1.0", - "FriendlyName": "newton", - "Description": "Newton Physics", - "Category": "Other", - "CreatedBy": "Julio Jerez", - "CreatedByURL": "NewtonDynamics.com", - "DocsURL": "", - "MarketplaceURL": "", - "SupportURL": "", - "EngineVersion": "5.4.0", - "CanContainContent": true, - "IsBetaVersion": true, - "Installed": true, - "Modules": [ - { - "Name": "newton", - "Type": "Editor", - "LoadingPhase": "Default" - } - ] -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/AutoScreenshot.png b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/AutoScreenshot.png deleted file mode 100644 index 6a996f435a..0000000000 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/AutoScreenshot.png and /dev/null differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-015B75FD41633A75DF15F1A0B5685B38/CrashReportClient.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-015B75FD41633A75DF15F1A0B5685B38/CrashReportClient.ini deleted file mode 100644 index e6a72c5d28..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-015B75FD41633A75DF15F1A0B5685B38/CrashReportClient.ini +++ /dev/null @@ -1,7 +0,0 @@ -[CrashReportClient] -bHideLogFilesOption=false -bIsAllowedToCloseWithoutSending=true -CrashConfigPurgeDays=2 -Stall.RecordDump=false -Ensure.RecordDump=true - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-9E096ED143D25378614C81A17205A8BD/CrashReportClient.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-9E096ED143D25378614C81A17205A8BD/CrashReportClient.ini deleted file mode 100644 index e6a72c5d28..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-9E096ED143D25378614C81A17205A8BD/CrashReportClient.ini +++ /dev/null @@ -1,7 +0,0 @@ -[CrashReportClient] -bHideLogFilesOption=false -bIsAllowedToCloseWithoutSending=true -CrashConfigPurgeDays=2 -Stall.RecordDump=false -Ensure.RecordDump=true - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-C5119EF748CAA36CD6BC5A880F759A69/CrashReportClient.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-C5119EF748CAA36CD6BC5A880F759A69/CrashReportClient.ini deleted file mode 100644 index e6a72c5d28..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-C5119EF748CAA36CD6BC5A880F759A69/CrashReportClient.ini +++ /dev/null @@ -1,7 +0,0 @@ -[CrashReportClient] -bHideLogFilesOption=false -bIsAllowedToCloseWithoutSending=true -CrashConfigPurgeDays=2 -Stall.RecordDump=false -Ensure.RecordDump=true - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-E6EC37A74570D6091B4DE8A75499DECB/CrashReportClient.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-E6EC37A74570D6091B4DE8A75499DECB/CrashReportClient.ini deleted file mode 100644 index e6a72c5d28..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/CrashReportClient/UECC-Windows-E6EC37A74570D6091B4DE8A75499DECB/CrashReportClient.ini +++ /dev/null @@ -1,7 +0,0 @@ -[CrashReportClient] -bHideLogFilesOption=false -bIsAllowedToCloseWithoutSending=true -CrashConfigPurgeDays=2 -Stall.RecordDump=false -Ensure.RecordDump=true - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/Editor.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/Editor.ini deleted file mode 100644 index 879ad14cac..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/Editor.ini +++ /dev/null @@ -1,3 +0,0 @@ -[/Script/UnrealEd.UnrealEdOptions] -UsingXGE=False - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/EditorPerProjectUserSettings.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/EditorPerProjectUserSettings.ini deleted file mode 100644 index 63df1af6c7..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/EditorPerProjectUserSettings.ini +++ /dev/null @@ -1,1925 +0,0 @@ -[/Script/UnrealEd.EditorPerProjectUserSettings] -bDisplayDocumentationLink=False -bDisplayActionListItemRefIds=False -bAlwaysGatherBehaviorTreeDebuggerData=False -bDisplayBlackboardKeysInAlphabeticalOrder=False -bUseSimplygonSwarm=False -SimplygonServerIP=127.0.0.1 -bEnableSwarmDebugging=False -SimplygonSwarmDelay=5000 -SwarmNumOfConcurrentJobs=16 -SwarmMaxUploadChunkSizeInMB=100 -SwarmIntermediateFolder=C:/unrealProjectVideos/UnrealNewtonProject1/Intermediate/Simplygon/ -bShowCompilerLogOnCompileError=False -DataSourceFolder=(Path="") -bAnimationReimportWarnings=False -bSCSEditorShowFloor=False -bAlwaysBuildUAT=True -SCSViewportCameraSpeed=4 -bShowSelectionSubcomponents=True -AssetViewerProfileName= -PreviewFeatureLevel=4 -PreviewPlatformName=None -PreviewShaderFormatName=None -PreviewShaderPlatformName=None -bPreviewFeatureLevelActive=False -bPreviewFeatureLevelWasDefault=True -PreviewDeviceProfileName=None - -[/Script/UnrealEd.EditorStyleSettings] -ApplicationScale=1.000000 -bColorVisionDeficiencyCorrection=False -bColorVisionDeficiencyCorrectionPreviewWithDeficiency=False -SelectionColor=(R=0.828000,G=0.364000,B=0.003000,A=1.000000) -AdditionalSelectionColors[0]=(R=0.019382,G=0.496933,B=1.000000,A=1.000000) -AdditionalSelectionColors[1]=(R=0.356400,G=0.040915,B=0.520996,A=1.000000) -AdditionalSelectionColors[2]=(R=1.000000,G=0.168269,B=0.332452,A=1.000000) -AdditionalSelectionColors[3]=(R=1.000000,G=0.051269,B=0.051269,A=1.000000) -AdditionalSelectionColors[4]=(R=1.000000,G=0.715693,B=0.010330,A=1.000000) -AdditionalSelectionColors[5]=(R=0.258183,G=0.539479,B=0.068478,A=1.000000) -ViewportToolOverlayColor=(R=1.000000,G=1.000000,B=1.000000,A=1.000000) -bEnableEditorWindowBackgroundColor=False -EditorWindowBackgroundColor=(R=1.000000,G=1.000000,B=1.000000,A=1.000000) -MenuSearchFieldVisibilityThreshold=10 -bUseGrid=True -RegularColor=(R=0.035000,G=0.035000,B=0.035000,A=1.000000) -RuleColor=(R=0.008000,G=0.008000,B=0.008000,A=1.000000) -CenterColor=(R=0.000000,G=0.000000,B=0.000000,A=1.000000) -GridSnapSize=16 -GraphBackgroundBrush=(bIsDynamicallyLoaded=False,DrawAs=Image,Tiling=NoTile,Mirroring=NoMirror,ImageType=NoImage,ImageSize=(X=32.000000,Y=32.000000),Margin=(Left=0.000000,Top=0.000000,Right=0.000000,Bottom=0.000000),TintColor=(SpecifiedColor=(R=1.000000,G=1.000000,B=1.000000,A=1.000000),ColorUseRule=UseColor_Specified),OutlineSettings=(CornerRadii=(X=0.000000,Y=0.000000,Z=0.000000,W=0.000000),Color=(SpecifiedColor=(R=0.000000,G=0.000000,B=0.000000,A=0.000000),ColorUseRule=UseColor_Specified),Width=0.000000,RoundingType=HalfHeightRadius,bUseBrushTransparency=False),ResourceObject=None,ResourceName="",UVRegion=(Min=(X=0.000000,Y=0.000000),Max=(X=0.000000,Y=0.000000),bIsValid=False)) -bShowNativeComponentNames=True -AssetEditorOpenLocation=Default -bEnableColorizedEditorTabs=True -CurrentAppliedTheme=134380265FBB4A9CA00A1DC9770217B8 - -[/Script/UnrealEd.LevelEditorPlaySettings] -LaptopScreenResolutions=(Description="Apple MacBook Air 11",Width=1366,Height=768,AspectRatio="16:9",bCanSwapAspectRatio=True,ProfileName="") -LaptopScreenResolutions=(Description="Apple MacBook Air 13\"",Width=1440,Height=900,AspectRatio="16:10",bCanSwapAspectRatio=True,ProfileName="") -LaptopScreenResolutions=(Description="Apple MacBook Pro 13\"",Width=1280,Height=800,AspectRatio="16:10",bCanSwapAspectRatio=True,ProfileName="") -LaptopScreenResolutions=(Description="Apple MacBook Pro 13\" (Retina)",Width=2560,Height=1600,AspectRatio="16:10",bCanSwapAspectRatio=True,ProfileName="") -LaptopScreenResolutions=(Description="Apple MacBook Pro 15\"",Width=1440,Height=900,AspectRatio="16:10",bCanSwapAspectRatio=True,ProfileName="") -LaptopScreenResolutions=(Description="Apple MacBook Pro 15\" (Retina)",Width=2880,Height=1800,AspectRatio="16:10",bCanSwapAspectRatio=True,ProfileName="") -LaptopScreenResolutions=(Description="Generic 14-15.6\" Notebook",Width=1366,Height=768,AspectRatio="16:9",bCanSwapAspectRatio=True,ProfileName="") -MonitorScreenResolutions=(Description="19\" monitor",Width=1440,Height=900,AspectRatio="16:10",bCanSwapAspectRatio=True,ProfileName="") -MonitorScreenResolutions=(Description="20\" monitor",Width=1600,Height=900,AspectRatio="16:9",bCanSwapAspectRatio=True,ProfileName="") -MonitorScreenResolutions=(Description="22\" monitor",Width=1680,Height=1050,AspectRatio="16:10",bCanSwapAspectRatio=True,ProfileName="") -MonitorScreenResolutions=(Description="21.5-24\" monitor",Width=1920,Height=1080,AspectRatio="16:9",bCanSwapAspectRatio=True,ProfileName="") -MonitorScreenResolutions=(Description="27\" monitor",Width=2560,Height=1440,AspectRatio="16:9",bCanSwapAspectRatio=True,ProfileName="") -TabletScreenResolutions=(Description="iPad Pro 12.9-inch (3rd gen.)",Width=1024,Height=1366,AspectRatio="~3:4",bCanSwapAspectRatio=True,ProfileName="iPadPro3_129") -TabletScreenResolutions=(Description="iPad Pro 12.9-inch (2nd gen.)",Width=1024,Height=1366,AspectRatio="~3:4",bCanSwapAspectRatio=True,ProfileName="iPadPro2_129") -TabletScreenResolutions=(Description="iPad Pro 11-inch",Width=834,Height=1194,AspectRatio="5:7",bCanSwapAspectRatio=True,ProfileName="iPadPro11") -TabletScreenResolutions=(Description="iPad Pro 10.5-inch",Width=834,Height=1112,AspectRatio="3:4",bCanSwapAspectRatio=True,ProfileName="iPadPro105") -TabletScreenResolutions=(Description="iPad Pro 12.9-inch",Width=1024,Height=1366,AspectRatio="3:4",bCanSwapAspectRatio=True,ProfileName="iPadPro129") -TabletScreenResolutions=(Description="iPad Pro 9.7-inch",Width=768,Height=1024,AspectRatio="3:4",bCanSwapAspectRatio=True,ProfileName="iPadPro97") -TabletScreenResolutions=(Description="iPad (6th gen.)",Width=768,Height=1024,AspectRatio="3:4",bCanSwapAspectRatio=True,ProfileName="iPad6") -TabletScreenResolutions=(Description="iPad (5th gen.)",Width=768,Height=1024,AspectRatio="3:4",bCanSwapAspectRatio=True,ProfileName="iPad5") -TabletScreenResolutions=(Description="iPad Air 3",Width=768,Height=1024,AspectRatio="3:4",bCanSwapAspectRatio=True,ProfileName="iPadAir3") -TabletScreenResolutions=(Description="iPad Air 2",Width=768,Height=1024,AspectRatio="3:4",bCanSwapAspectRatio=True,ProfileName="iPadAir2") -TabletScreenResolutions=(Description="iPad Mini 5",Width=768,Height=1024,AspectRatio="3:4",bCanSwapAspectRatio=True,ProfileName="iPadMini5") -TabletScreenResolutions=(Description="iPad Mini 4",Width=768,Height=1024,AspectRatio="3:4",bCanSwapAspectRatio=True,ProfileName="iPadMini4") -TabletScreenResolutions=(Description="LG G Pad X 8.0",Width=768,Height=1366,AspectRatio="9:16",bCanSwapAspectRatio=True,ProfileName="") -TabletScreenResolutions=(Description="Asus Zenpad 3s 10",Width=768,Height=1366,AspectRatio="9:16",bCanSwapAspectRatio=True,ProfileName="") -TabletScreenResolutions=(Description="Huawei MediaPad M3",Width=768,Height=1366,AspectRatio="9:16",bCanSwapAspectRatio=True,ProfileName="") -TabletScreenResolutions=(Description="Microsoft Surface RT",Width=768,Height=1366,AspectRatio="9:16",bCanSwapAspectRatio=True,ProfileName="") -TabletScreenResolutions=(Description="Microsoft Surface Pro",Width=1080,Height=1920,AspectRatio="9:16",bCanSwapAspectRatio=True,ProfileName="") -TelevisionScreenResolutions=(Description="720p (HDTV, Blu-ray)",Width=1280,Height=720,AspectRatio="16:9",bCanSwapAspectRatio=True,ProfileName="") -TelevisionScreenResolutions=(Description="1080i, 1080p (HDTV, Blu-ray)",Width=1920,Height=1080,AspectRatio="16:9",bCanSwapAspectRatio=True,ProfileName="") -TelevisionScreenResolutions=(Description="4K Ultra HD",Width=3840,Height=2160,AspectRatio="16:9",bCanSwapAspectRatio=True,ProfileName="") -TelevisionScreenResolutions=(Description="4K Digital Cinema",Width=4096,Height=2160,AspectRatio="1.90:1",bCanSwapAspectRatio=True,ProfileName="") -GameGetsMouseControl=False -UseMouseForTouch=False -MouseControlLabelPosition=LabelAnchorMode_TopLeft -ViewportGetsHMDControl=False -bShouldMinimizeEditorOnNonVRPIE=False -bEmulateStereo=False -SoloAudioInFirstPIEClient=False -EnablePIEEnterAndExitSounds=False -PlayInEditorSoundQualityLevel=0 -bUseNonRealtimeAudioDevice=False -bPreferToStreamLevelsInPIE=False -bPromoteOutputLogWarningsDuringPIE=False -NewWindowPosition=(X=-1,Y=-1) -PIEAlwaysOnTop=False -DisableStandaloneSound=False -AdditionalLaunchParameters= -BuildGameBeforeLaunch=PlayOnBuild_Default -LaunchConfiguration=LaunchConfig_Default -PackFilesForLaunch=NoPak -bAutoCompileBlueprintsOnLaunch=True -bLaunchSeparateServer=False -PlayNetMode=PIE_Standalone -RunUnderOneProcess=True -PlayNumberOfClients=1 -PrimaryPIEClientIndex=0 -ServerPort=17777 -ClientWindowWidth=640 -RouteGamepadToSecondWindow=False -CreateAudioDeviceForEveryPlayer=False -ClientWindowHeight=480 -ServerMapNameOverride= -AdditionalServerGameOptions= -bShowServerDebugDrawingByDefault=True -ServerDebugDrawingColorTintStrength=0.000000 -ServerDebugDrawingColorTint=(R=0.000000,G=0.000000,B=0.000000,A=1.000000) -bOneHeadsetEachProcess=False -AdditionalServerLaunchParameters= -ServerFixedFPS=0 -NetworkEmulationSettings=(bIsNetworkEmulationEnabled=False,EmulationTarget=Server,CurrentProfile="Custom",OutPackets=(MinLatency=0,MaxLatency=0,PacketLossPercentage=0),InPackets=(MinLatency=0,MaxLatency=0,PacketLossPercentage=0)) -LastSize=(X=0,Y=0) -LastExecutedLaunchDevice=Windows@NEWTONWINDOWS -LastExecutedLaunchName=NEWTONWINDOWS -LastExecutedPIEPreviewDevice= -DeviceToEmulate= -PIESafeZoneOverride=(Left=0.000000,Top=0.000000,Right=0.000000,Bottom=0.000000) - -[/Script/UnrealEd.LevelEditorViewportSettings] -FlightCameraControlExperimentalNavigation=False -MinimumOrthographicZoom=250.000000 -bAllowArcballRotate=False -bAllowScreenRotate=False -bShowActorEditorContext=True -bAllowEditWidgetAxisDisplay=True -bUseLegacyCameraMovementNotifications=False -SnapToSurface=(bEnabled=False,SnapOffsetExtent=0.000000,bSnapRotation=True) -bEnableLayerSnap=False -ActiveSnapLayerIndex=0 -PreserveNonUniformScale=False -PreviewMeshes=/Engine/EditorMeshes/ColorCalibrator/SM_ColorCalibrator.SM_ColorCalibrator -BillboardScale=1.000000 -TransformWidgetSizeAdjustment=0 -bSaveEngineStats=False -MeasuringToolUnits=MeasureUnits_Centimeters -SelectedSplinePointSizeAdjustment=0.000000 -SplineLineThicknessAdjustment=0.000000 -SplineTangentHandleSizeAdjustment=0.000000 -SplineTangentScale=0.500000 -LastInViewportMenuLocation=(X=0.000000,Y=0.000000) -MaterialForDroppedTextures=None -MaterialParamsForDroppedTextures=() -EditorViews=(("/Game/level_03_landscape.level_03_landscape", (LevelViewportsInfo=((CamPosition=(X=542.473882,Y=1.910855,Z=318.369810)),(CamPosition=(X=542.473882,Y=1.910855,Z=318.369810)),(CamPosition=(X=542.473882,Y=1.910855,Z=318.369810)),(CamPosition=(X=1266.110408,Y=1705.939107,Z=2314.382174),CamRotation=(Pitch=-15.788928,Yaw=-49.198173,Roll=-0.000001)),(CamUpdated=True),(CamUpdated=True),(CamUpdated=True),(CamPosition=(X=542.473882,Y=1.910855,Z=318.369810),CamUpdated=True)))),("/Game/level_01_firstMap.level_01_firstMap", (LevelViewportsInfo=((CamPosition=(X=1613.535304,Y=2313.074925,Z=285.168951),CamOrthoZoom=207150.843750),(CamPosition=(X=1613.535304,Y=2313.074925,Z=285.168951),CamOrthoZoom=207150.843750),(CamPosition=(X=1613.535304,Y=2313.074925,Z=285.168951),CamOrthoZoom=207150.843750),(CamPosition=(X=563.766977,Y=586.046277,Z=153.685976),CamRotation=(Pitch=-14.973650,Yaw=305.364009,Roll=0.000000)),(CamUpdated=True),(CamUpdated=True),(CamUpdated=True),(CamUpdated=True))))) -PerInstanceSettings=(ConfigName="FourPanes2x2.Viewport 1.Viewport0",ConfigSettings=(ViewportType=LVT_OrthoYZ,PerspViewModeIndex=VMI_Lit,OrthoViewModeIndex=VMI_BrushWireframe,EditorShowFlagsString="PostProcessing=0,Bloom=1,LocalExposure=1,Tonemapper=1,AntiAliasing=1,TemporalAA=1,AmbientCubemap=1,EyeAdaptation=1,VisualizeHDR=0,VisualizeSkyLightIlluminance=0,VisualizeLocalExposure=0,LensFlares=1,GlobalIllumination=1,Vignette=1,Grain=1,AmbientOcclusion=1,Decals=1,CameraImperfections=1,OnScreenDebug=1,OverrideDiffuseAndSpecular=0,LightingOnlyOverride=0,ReflectionOverride=0,VisualizeBuffer=0,VisualizeNanite=0,VisualizeLumen=0,VisualizeSubstrate=0,VisualizeGroom=0,VisualizeVirtualShadowMap=0,DirectLighting=1,DirectionalLights=1,PointLights=1,SpotLights=1,RectLights=1,ColorGrading=1,VectorFields=0,DepthOfField=1,GBufferHints=0,MotionBlur=0,CompositeEditorPrimitives=1,OpaqueCompositeEditorPrimitives=0,TestImage=0,VisualizeDOF=0,VertexColors=0,PhysicalMaterialMasks=0,Refraction=1,CameraInterpolation=1,SceneColorFringe=1,ToneCurve=1,SeparateTranslucency=1,ScreenPercentage=0,VisualizeMotionBlur=0,VisualizeMotionVectors=0,VisualizeReprojection=0,VisualizeTemporalUpscaler=0,VisualizeTSR=0,ReflectionEnvironment=1,VisualizeOutOfBoundsPixels=0,Diffuse=1,Specular=1,SelectionOutline=1,SelectionOutlineColor0=0,SelectionOutlineColor1=0,SelectionOutlineColor2=0,SelectionOutlineColor3=0,SelectionOutlineColor4=0,SelectionOutlineColor5=0,ScreenSpaceReflections=1,LumenReflections=1,ContactShadows=1,RayTracedDistanceFieldShadows=1,CapsuleShadows=1,SubsurfaceScattering=1,VisualizeSSS=0,VolumetricLightmap=1,IndirectLightingCache=1,DebugAI=0,VisLog=1,Navigation=0,GameplayDebug=1,TexturedLightProfiles=1,LightFunctions=1,InstancedStaticMeshes=1,InstancedFoliage=1,HISMCOcclusionBounds=0,HISMCClusterTree=0,VisualizeInstanceUpdates=0,InstancedGrass=1,DynamicShadows=1,Particles=1,Niagara=1,HeterogeneousVolumes=1,SkeletalMeshes=1,BuilderBrush=1,Translucency=1,BillboardSprites=1,LOD=1,LightComplexity=0,ShaderComplexity=0,StationaryLightOverlap=0,LightMapDensity=0,StreamingBounds=0,Constraints=0,MassProperties=0,CameraFrustums=0,AudioRadius=1,ForceFeedbackRadius=1,BSPSplit=0,Brushes=1,Lighting=1,DeferredLighting=1,Editor=1,BSPTriangles=0,LargeVertices=0,Grid=1,Snap=0,MeshEdges=0,Cover=0,Splines=1,Selection=1,VisualizeLevelInstanceEditing=1,ModeWidgets=1,Bounds=0,HitProxies=0,LightInfluences=0,Pivot=1,ShadowFrustums=0,Wireframe=1,Materials=1,StaticMeshes=1,Landscape=1,LightRadius=1,Fog=1,Volumes=1,Game=0,BSP=1,Collision=0,CollisionVisibility=0,CollisionPawn=0,LightShafts=1,PostProcessMaterial=1,Atmosphere=1,Cloud=1,CameraAspectRatioBars=0,CameraSafeFrames=0,TextRender=1,Rendering=1,HMDDistortion=0,StereoRendering=0,DistanceCulledPrimitives=1,VisualizeLightCulling=0,PrecomputedVisibility=1,SkyLighting=1,PreviewShadowsIndicator=1,PrecomputedVisibilityCells=0,VisualizeVolumetricLightmap=0,VolumeLightingSamples=0,Paper2DSprites=1,VisualizeDistanceFieldAO=0,VisualizeMeshDistanceFields=0,PhysicsField=0,VisualizeGlobalDistanceField=0,VisualizeLightingOnProbes=0,ScreenSpaceAO=1,DistanceFieldAO=1,LumenGlobalIllumination=1,VolumetricFog=1,VisualizeSSR=0,VisualizeShadingModels=0,VisualizeSenses=1,LODColoration=0,HLODColoration=0,QuadOverdraw=0,ShaderComplexityWithQuadOverdraw=0,PrimitiveDistanceAccuracy=0,MeshUVDensityAccuracy=0,MaterialTextureScaleAccuracy=0,OutputMaterialTextureScales=0,RequiredTextureResolution=0,VirtualTexturePendingMips=0,WidgetComponents=1,Bones=0,ServerDrawDebug=0,MediaPlanes=1,VREditing=0,OcclusionMeshes=0,VisualizeInstanceOcclusionQueries=0,DisableOcclusionQueries=0,PathTracing=0,RayTracingDebug=0,VisualizeSkyAtmosphere=0,VisualizeLightFunctionAtlas=0,VisualizeCalibrationColor=0,VisualizeCalibrationGrayscale=0,VisualizeCalibrationCustom=0,VisualizePostProcessStack=0,VirtualTexturePrimitives=0,VisualizeVolumetricCloudConservativeDensity=0,VisualizeVolumetricCloudEmptySpaceSkipping=0,VirtualShadowMapPersistentData=1,DebugDrawDistantVirtualSMLights=0,VirtualTextureResidency=1,InputDebugVisualizer=1,LumenScreenTraces=1,LumenDetailTraces=1,LumenGlobalTraces=1,LumenFarFieldTraces=1,LumenSecondaryBounces=1,LumenShortRangeAmbientOcclusion=1,NaniteMeshes=1,NaniteStreamingGeometry=1,VisualizeGPUSkinCache=0,ShaderPrint=1",GameShowFlagsString="PostProcessing=0,Bloom=1,LocalExposure=1,Tonemapper=1,AntiAliasing=1,TemporalAA=1,AmbientCubemap=1,EyeAdaptation=1,VisualizeHDR=0,VisualizeSkyLightIlluminance=0,VisualizeLocalExposure=0,LensFlares=1,GlobalIllumination=1,Vignette=1,Grain=1,AmbientOcclusion=1,Decals=1,CameraImperfections=1,OnScreenDebug=1,OverrideDiffuseAndSpecular=0,LightingOnlyOverride=0,ReflectionOverride=0,VisualizeBuffer=0,VisualizeNanite=0,VisualizeLumen=0,VisualizeSubstrate=0,VisualizeGroom=0,VisualizeVirtualShadowMap=0,DirectLighting=1,DirectionalLights=1,PointLights=1,SpotLights=1,RectLights=1,ColorGrading=1,VectorFields=0,DepthOfField=1,GBufferHints=0,MotionBlur=1,CompositeEditorPrimitives=0,OpaqueCompositeEditorPrimitives=0,TestImage=0,VisualizeDOF=0,VertexColors=0,PhysicalMaterialMasks=0,Refraction=1,CameraInterpolation=1,SceneColorFringe=1,ToneCurve=1,SeparateTranslucency=1,ScreenPercentage=1,VisualizeMotionBlur=0,VisualizeMotionVectors=0,VisualizeReprojection=0,VisualizeTemporalUpscaler=0,VisualizeTSR=0,ReflectionEnvironment=1,VisualizeOutOfBoundsPixels=0,Diffuse=1,Specular=1,SelectionOutline=0,SelectionOutlineColor0=0,SelectionOutlineColor1=0,SelectionOutlineColor2=0,SelectionOutlineColor3=0,SelectionOutlineColor4=0,SelectionOutlineColor5=0,ScreenSpaceReflections=1,LumenReflections=1,ContactShadows=1,RayTracedDistanceFieldShadows=1,CapsuleShadows=1,SubsurfaceScattering=1,VisualizeSSS=0,VolumetricLightmap=1,IndirectLightingCache=1,DebugAI=0,VisLog=1,Navigation=0,GameplayDebug=1,TexturedLightProfiles=1,LightFunctions=1,InstancedStaticMeshes=1,InstancedFoliage=1,HISMCOcclusionBounds=0,HISMCClusterTree=0,VisualizeInstanceUpdates=0,InstancedGrass=1,DynamicShadows=1,Particles=1,Niagara=1,HeterogeneousVolumes=1,SkeletalMeshes=1,BuilderBrush=1,Translucency=1,BillboardSprites=1,LOD=1,LightComplexity=0,ShaderComplexity=0,StationaryLightOverlap=0,LightMapDensity=0,StreamingBounds=0,Constraints=0,MassProperties=0,CameraFrustums=0,AudioRadius=0,ForceFeedbackRadius=1,BSPSplit=0,Brushes=1,Lighting=1,DeferredLighting=1,Editor=0,BSPTriangles=0,LargeVertices=0,Grid=0,Snap=0,MeshEdges=0,Cover=0,Splines=0,Selection=0,VisualizeLevelInstanceEditing=1,ModeWidgets=0,Bounds=0,HitProxies=0,LightInfluences=0,Pivot=0,ShadowFrustums=0,Wireframe=1,Materials=1,StaticMeshes=1,Landscape=1,LightRadius=0,Fog=1,Volumes=0,Game=1,BSP=1,Collision=0,CollisionVisibility=0,CollisionPawn=0,LightShafts=1,PostProcessMaterial=1,Atmosphere=1,Cloud=1,CameraAspectRatioBars=0,CameraSafeFrames=0,TextRender=1,Rendering=1,HMDDistortion=0,StereoRendering=0,DistanceCulledPrimitives=0,VisualizeLightCulling=0,PrecomputedVisibility=1,SkyLighting=1,PreviewShadowsIndicator=1,PrecomputedVisibilityCells=0,VisualizeVolumetricLightmap=0,VolumeLightingSamples=0,Paper2DSprites=1,VisualizeDistanceFieldAO=0,VisualizeMeshDistanceFields=0,PhysicsField=0,VisualizeGlobalDistanceField=0,VisualizeLightingOnProbes=0,ScreenSpaceAO=1,DistanceFieldAO=1,LumenGlobalIllumination=1,VolumetricFog=1,VisualizeSSR=0,VisualizeShadingModels=0,VisualizeSenses=1,LODColoration=0,HLODColoration=0,QuadOverdraw=0,ShaderComplexityWithQuadOverdraw=0,PrimitiveDistanceAccuracy=0,MeshUVDensityAccuracy=0,MaterialTextureScaleAccuracy=0,OutputMaterialTextureScales=0,RequiredTextureResolution=0,VirtualTexturePendingMips=0,WidgetComponents=1,Bones=0,ServerDrawDebug=0,MediaPlanes=1,VREditing=0,OcclusionMeshes=0,VisualizeInstanceOcclusionQueries=0,DisableOcclusionQueries=0,PathTracing=0,RayTracingDebug=0,VisualizeSkyAtmosphere=0,VisualizeLightFunctionAtlas=0,VisualizeCalibrationColor=0,VisualizeCalibrationGrayscale=0,VisualizeCalibrationCustom=0,VisualizePostProcessStack=0,VirtualTexturePrimitives=0,VisualizeVolumetricCloudConservativeDensity=0,VisualizeVolumetricCloudEmptySpaceSkipping=0,VirtualShadowMapPersistentData=1,DebugDrawDistantVirtualSMLights=0,VirtualTextureResidency=1,InputDebugVisualizer=1,LumenScreenTraces=1,LumenDetailTraces=1,LumenGlobalTraces=1,LumenFarFieldTraces=1,LumenSecondaryBounces=1,LumenShortRangeAmbientOcclusion=1,NaniteMeshes=1,NaniteStreamingGeometry=1,VisualizeGPUSkinCache=0,ShaderPrint=1",BufferVisualizationMode="",NaniteVisualizationMode="",LumenVisualizationMode="",SubstrateVisualizationMode="",GroomVisualizationMode="",VirtualShadowMapVisualizationMode="",RayTracingDebugVisualizationMode="",GPUSkinCacheVisualizationMode="",ExposureSettings=(FixedEV100=1.000000,bFixed=False),FOVAngle=90.000000,FarViewPlane=0.000000,bIsRealtime=False,bShowOnScreenStats=True,EnabledStats=,bShowFullToolbar=True,bAllowCinematicControl=True)) -PerInstanceSettings=(ConfigName="FourPanes2x2.Viewport 1.Viewport1",ConfigSettings=(ViewportType=LVT_Perspective,PerspViewModeIndex=VMI_Lit,OrthoViewModeIndex=VMI_BrushWireframe,EditorShowFlagsString="PostProcessing=1,Bloom=1,LocalExposure=1,Tonemapper=1,AntiAliasing=1,TemporalAA=1,AmbientCubemap=1,EyeAdaptation=1,VisualizeHDR=0,VisualizeSkyLightIlluminance=0,VisualizeLocalExposure=0,LensFlares=1,GlobalIllumination=1,Vignette=1,Grain=1,AmbientOcclusion=1,Decals=1,CameraImperfections=1,OnScreenDebug=1,OverrideDiffuseAndSpecular=0,LightingOnlyOverride=0,ReflectionOverride=0,VisualizeBuffer=0,VisualizeNanite=0,VisualizeLumen=0,VisualizeSubstrate=0,VisualizeGroom=0,VisualizeVirtualShadowMap=0,DirectLighting=1,DirectionalLights=1,PointLights=1,SpotLights=1,RectLights=1,ColorGrading=1,VectorFields=0,DepthOfField=1,GBufferHints=0,MotionBlur=0,CompositeEditorPrimitives=1,OpaqueCompositeEditorPrimitives=0,TestImage=0,VisualizeDOF=0,VertexColors=0,PhysicalMaterialMasks=0,Refraction=1,CameraInterpolation=1,SceneColorFringe=1,ToneCurve=1,SeparateTranslucency=1,ScreenPercentage=0,VisualizeMotionBlur=0,VisualizeMotionVectors=0,VisualizeReprojection=0,VisualizeTemporalUpscaler=0,VisualizeTSR=0,ReflectionEnvironment=1,VisualizeOutOfBoundsPixels=0,Diffuse=1,Specular=1,SelectionOutline=1,SelectionOutlineColor0=0,SelectionOutlineColor1=0,SelectionOutlineColor2=0,SelectionOutlineColor3=0,SelectionOutlineColor4=0,SelectionOutlineColor5=0,ScreenSpaceReflections=1,LumenReflections=1,ContactShadows=1,RayTracedDistanceFieldShadows=1,CapsuleShadows=1,SubsurfaceScattering=1,VisualizeSSS=0,VolumetricLightmap=1,IndirectLightingCache=1,DebugAI=0,VisLog=1,Navigation=0,GameplayDebug=1,TexturedLightProfiles=1,LightFunctions=1,InstancedStaticMeshes=1,InstancedFoliage=1,HISMCOcclusionBounds=0,HISMCClusterTree=0,VisualizeInstanceUpdates=0,InstancedGrass=1,DynamicShadows=1,Particles=1,Niagara=1,HeterogeneousVolumes=1,SkeletalMeshes=1,BuilderBrush=1,Translucency=1,BillboardSprites=1,LOD=1,LightComplexity=0,ShaderComplexity=0,StationaryLightOverlap=0,LightMapDensity=0,StreamingBounds=0,Constraints=0,MassProperties=0,CameraFrustums=0,AudioRadius=1,ForceFeedbackRadius=1,BSPSplit=0,Brushes=0,Lighting=1,DeferredLighting=1,Editor=1,BSPTriangles=1,LargeVertices=0,Grid=1,Snap=0,MeshEdges=0,Cover=0,Splines=1,Selection=1,VisualizeLevelInstanceEditing=1,ModeWidgets=1,Bounds=0,HitProxies=0,LightInfluences=0,Pivot=1,ShadowFrustums=0,Wireframe=0,Materials=1,StaticMeshes=1,Landscape=1,LightRadius=1,Fog=1,Volumes=1,Game=0,BSP=1,Collision=0,CollisionVisibility=0,CollisionPawn=0,LightShafts=1,PostProcessMaterial=1,Atmosphere=1,Cloud=1,CameraAspectRatioBars=0,CameraSafeFrames=0,TextRender=1,Rendering=1,HMDDistortion=0,StereoRendering=0,DistanceCulledPrimitives=1,VisualizeLightCulling=0,PrecomputedVisibility=1,SkyLighting=1,PreviewShadowsIndicator=1,PrecomputedVisibilityCells=0,VisualizeVolumetricLightmap=0,VolumeLightingSamples=0,Paper2DSprites=1,VisualizeDistanceFieldAO=0,VisualizeMeshDistanceFields=0,PhysicsField=0,VisualizeGlobalDistanceField=0,VisualizeLightingOnProbes=0,ScreenSpaceAO=1,DistanceFieldAO=1,LumenGlobalIllumination=1,VolumetricFog=1,VisualizeSSR=0,VisualizeShadingModels=0,VisualizeSenses=1,LODColoration=0,HLODColoration=0,QuadOverdraw=0,ShaderComplexityWithQuadOverdraw=0,PrimitiveDistanceAccuracy=0,MeshUVDensityAccuracy=0,MaterialTextureScaleAccuracy=0,OutputMaterialTextureScales=0,RequiredTextureResolution=0,VirtualTexturePendingMips=0,WidgetComponents=1,Bones=0,ServerDrawDebug=0,MediaPlanes=1,VREditing=0,OcclusionMeshes=0,VisualizeInstanceOcclusionQueries=0,DisableOcclusionQueries=0,PathTracing=0,RayTracingDebug=0,VisualizeSkyAtmosphere=0,VisualizeLightFunctionAtlas=0,VisualizeCalibrationColor=0,VisualizeCalibrationGrayscale=0,VisualizeCalibrationCustom=0,VisualizePostProcessStack=0,VirtualTexturePrimitives=0,VisualizeVolumetricCloudConservativeDensity=0,VisualizeVolumetricCloudEmptySpaceSkipping=0,VirtualShadowMapPersistentData=1,DebugDrawDistantVirtualSMLights=0,VirtualTextureResidency=1,InputDebugVisualizer=1,LumenScreenTraces=1,LumenDetailTraces=1,LumenGlobalTraces=1,LumenFarFieldTraces=1,LumenSecondaryBounces=1,LumenShortRangeAmbientOcclusion=1,NaniteMeshes=1,NaniteStreamingGeometry=1,VisualizeGPUSkinCache=0,ShaderPrint=1",GameShowFlagsString="PostProcessing=1,Bloom=1,LocalExposure=1,Tonemapper=1,AntiAliasing=1,TemporalAA=1,AmbientCubemap=1,EyeAdaptation=1,VisualizeHDR=0,VisualizeSkyLightIlluminance=0,VisualizeLocalExposure=0,LensFlares=1,GlobalIllumination=1,Vignette=1,Grain=1,AmbientOcclusion=1,Decals=1,CameraImperfections=1,OnScreenDebug=1,OverrideDiffuseAndSpecular=0,LightingOnlyOverride=0,ReflectionOverride=0,VisualizeBuffer=0,VisualizeNanite=0,VisualizeLumen=0,VisualizeSubstrate=0,VisualizeGroom=0,VisualizeVirtualShadowMap=0,DirectLighting=1,DirectionalLights=1,PointLights=1,SpotLights=1,RectLights=1,ColorGrading=1,VectorFields=0,DepthOfField=1,GBufferHints=0,MotionBlur=1,CompositeEditorPrimitives=0,OpaqueCompositeEditorPrimitives=0,TestImage=0,VisualizeDOF=0,VertexColors=0,PhysicalMaterialMasks=0,Refraction=1,CameraInterpolation=1,SceneColorFringe=1,ToneCurve=1,SeparateTranslucency=1,ScreenPercentage=1,VisualizeMotionBlur=0,VisualizeMotionVectors=0,VisualizeReprojection=0,VisualizeTemporalUpscaler=0,VisualizeTSR=0,ReflectionEnvironment=1,VisualizeOutOfBoundsPixels=0,Diffuse=1,Specular=1,SelectionOutline=0,SelectionOutlineColor0=0,SelectionOutlineColor1=0,SelectionOutlineColor2=0,SelectionOutlineColor3=0,SelectionOutlineColor4=0,SelectionOutlineColor5=0,ScreenSpaceReflections=1,LumenReflections=1,ContactShadows=1,RayTracedDistanceFieldShadows=1,CapsuleShadows=1,SubsurfaceScattering=1,VisualizeSSS=0,VolumetricLightmap=1,IndirectLightingCache=1,DebugAI=0,VisLog=1,Navigation=0,GameplayDebug=1,TexturedLightProfiles=1,LightFunctions=1,InstancedStaticMeshes=1,InstancedFoliage=1,HISMCOcclusionBounds=0,HISMCClusterTree=0,VisualizeInstanceUpdates=0,InstancedGrass=1,DynamicShadows=1,Particles=1,Niagara=1,HeterogeneousVolumes=1,SkeletalMeshes=1,BuilderBrush=1,Translucency=1,BillboardSprites=1,LOD=1,LightComplexity=0,ShaderComplexity=0,StationaryLightOverlap=0,LightMapDensity=0,StreamingBounds=0,Constraints=0,MassProperties=0,CameraFrustums=0,AudioRadius=0,ForceFeedbackRadius=1,BSPSplit=0,Brushes=0,Lighting=1,DeferredLighting=1,Editor=0,BSPTriangles=1,LargeVertices=0,Grid=0,Snap=0,MeshEdges=0,Cover=0,Splines=0,Selection=0,VisualizeLevelInstanceEditing=1,ModeWidgets=0,Bounds=0,HitProxies=0,LightInfluences=0,Pivot=0,ShadowFrustums=0,Wireframe=0,Materials=1,StaticMeshes=1,Landscape=1,LightRadius=0,Fog=1,Volumes=0,Game=1,BSP=1,Collision=0,CollisionVisibility=0,CollisionPawn=0,LightShafts=1,PostProcessMaterial=1,Atmosphere=1,Cloud=1,CameraAspectRatioBars=0,CameraSafeFrames=0,TextRender=1,Rendering=1,HMDDistortion=0,StereoRendering=0,DistanceCulledPrimitives=0,VisualizeLightCulling=0,PrecomputedVisibility=1,SkyLighting=1,PreviewShadowsIndicator=1,PrecomputedVisibilityCells=0,VisualizeVolumetricLightmap=0,VolumeLightingSamples=0,Paper2DSprites=1,VisualizeDistanceFieldAO=0,VisualizeMeshDistanceFields=0,PhysicsField=0,VisualizeGlobalDistanceField=0,VisualizeLightingOnProbes=0,ScreenSpaceAO=1,DistanceFieldAO=1,LumenGlobalIllumination=1,VolumetricFog=1,VisualizeSSR=0,VisualizeShadingModels=0,VisualizeSenses=1,LODColoration=0,HLODColoration=0,QuadOverdraw=0,ShaderComplexityWithQuadOverdraw=0,PrimitiveDistanceAccuracy=0,MeshUVDensityAccuracy=0,MaterialTextureScaleAccuracy=0,OutputMaterialTextureScales=0,RequiredTextureResolution=0,VirtualTexturePendingMips=0,WidgetComponents=1,Bones=0,ServerDrawDebug=0,MediaPlanes=1,VREditing=0,OcclusionMeshes=0,VisualizeInstanceOcclusionQueries=0,DisableOcclusionQueries=0,PathTracing=0,RayTracingDebug=0,VisualizeSkyAtmosphere=0,VisualizeLightFunctionAtlas=0,VisualizeCalibrationColor=0,VisualizeCalibrationGrayscale=0,VisualizeCalibrationCustom=0,VisualizePostProcessStack=0,VirtualTexturePrimitives=0,VisualizeVolumetricCloudConservativeDensity=0,VisualizeVolumetricCloudEmptySpaceSkipping=0,VirtualShadowMapPersistentData=1,DebugDrawDistantVirtualSMLights=0,VirtualTextureResidency=1,InputDebugVisualizer=1,LumenScreenTraces=1,LumenDetailTraces=1,LumenGlobalTraces=1,LumenFarFieldTraces=1,LumenSecondaryBounces=1,LumenShortRangeAmbientOcclusion=1,NaniteMeshes=1,NaniteStreamingGeometry=1,VisualizeGPUSkinCache=0,ShaderPrint=1",BufferVisualizationMode="",NaniteVisualizationMode="",LumenVisualizationMode="",SubstrateVisualizationMode="",GroomVisualizationMode="",VirtualShadowMapVisualizationMode="",RayTracingDebugVisualizationMode="",GPUSkinCacheVisualizationMode="",ExposureSettings=(FixedEV100=1.000000,bFixed=False),FOVAngle=90.000000,FarViewPlane=0.000000,bIsRealtime=True,bShowOnScreenStats=False,EnabledStats=,bShowFullToolbar=True,bAllowCinematicControl=True)) -PerInstanceSettings=(ConfigName="FourPanes2x2.Viewport 1.Viewport2",ConfigSettings=(ViewportType=LVT_OrthoXZ,PerspViewModeIndex=VMI_Lit,OrthoViewModeIndex=VMI_BrushWireframe,EditorShowFlagsString="PostProcessing=0,Bloom=1,LocalExposure=1,Tonemapper=1,AntiAliasing=1,TemporalAA=1,AmbientCubemap=1,EyeAdaptation=1,VisualizeHDR=0,VisualizeSkyLightIlluminance=0,VisualizeLocalExposure=0,LensFlares=1,GlobalIllumination=1,Vignette=1,Grain=1,AmbientOcclusion=1,Decals=1,CameraImperfections=1,OnScreenDebug=1,OverrideDiffuseAndSpecular=0,LightingOnlyOverride=0,ReflectionOverride=0,VisualizeBuffer=0,VisualizeNanite=0,VisualizeLumen=0,VisualizeSubstrate=0,VisualizeGroom=0,VisualizeVirtualShadowMap=0,DirectLighting=1,DirectionalLights=1,PointLights=1,SpotLights=1,RectLights=1,ColorGrading=1,VectorFields=0,DepthOfField=1,GBufferHints=0,MotionBlur=0,CompositeEditorPrimitives=1,OpaqueCompositeEditorPrimitives=0,TestImage=0,VisualizeDOF=0,VertexColors=0,PhysicalMaterialMasks=0,Refraction=1,CameraInterpolation=1,SceneColorFringe=1,ToneCurve=1,SeparateTranslucency=1,ScreenPercentage=0,VisualizeMotionBlur=0,VisualizeMotionVectors=0,VisualizeReprojection=0,VisualizeTemporalUpscaler=0,VisualizeTSR=0,ReflectionEnvironment=1,VisualizeOutOfBoundsPixels=0,Diffuse=1,Specular=1,SelectionOutline=1,SelectionOutlineColor0=0,SelectionOutlineColor1=0,SelectionOutlineColor2=0,SelectionOutlineColor3=0,SelectionOutlineColor4=0,SelectionOutlineColor5=0,ScreenSpaceReflections=1,LumenReflections=1,ContactShadows=1,RayTracedDistanceFieldShadows=1,CapsuleShadows=1,SubsurfaceScattering=1,VisualizeSSS=0,VolumetricLightmap=1,IndirectLightingCache=1,DebugAI=0,VisLog=1,Navigation=0,GameplayDebug=1,TexturedLightProfiles=1,LightFunctions=1,InstancedStaticMeshes=1,InstancedFoliage=1,HISMCOcclusionBounds=0,HISMCClusterTree=0,VisualizeInstanceUpdates=0,InstancedGrass=1,DynamicShadows=1,Particles=1,Niagara=1,HeterogeneousVolumes=1,SkeletalMeshes=1,BuilderBrush=1,Translucency=1,BillboardSprites=1,LOD=1,LightComplexity=0,ShaderComplexity=0,StationaryLightOverlap=0,LightMapDensity=0,StreamingBounds=0,Constraints=0,MassProperties=0,CameraFrustums=0,AudioRadius=1,ForceFeedbackRadius=1,BSPSplit=0,Brushes=1,Lighting=1,DeferredLighting=1,Editor=1,BSPTriangles=0,LargeVertices=0,Grid=1,Snap=0,MeshEdges=0,Cover=0,Splines=1,Selection=1,VisualizeLevelInstanceEditing=1,ModeWidgets=1,Bounds=0,HitProxies=0,LightInfluences=0,Pivot=1,ShadowFrustums=0,Wireframe=1,Materials=1,StaticMeshes=1,Landscape=1,LightRadius=1,Fog=1,Volumes=1,Game=0,BSP=1,Collision=0,CollisionVisibility=0,CollisionPawn=0,LightShafts=1,PostProcessMaterial=1,Atmosphere=1,Cloud=1,CameraAspectRatioBars=0,CameraSafeFrames=0,TextRender=1,Rendering=1,HMDDistortion=0,StereoRendering=0,DistanceCulledPrimitives=1,VisualizeLightCulling=0,PrecomputedVisibility=1,SkyLighting=1,PreviewShadowsIndicator=1,PrecomputedVisibilityCells=0,VisualizeVolumetricLightmap=0,VolumeLightingSamples=0,Paper2DSprites=1,VisualizeDistanceFieldAO=0,VisualizeMeshDistanceFields=0,PhysicsField=0,VisualizeGlobalDistanceField=0,VisualizeLightingOnProbes=0,ScreenSpaceAO=1,DistanceFieldAO=1,LumenGlobalIllumination=1,VolumetricFog=1,VisualizeSSR=0,VisualizeShadingModels=0,VisualizeSenses=1,LODColoration=0,HLODColoration=0,QuadOverdraw=0,ShaderComplexityWithQuadOverdraw=0,PrimitiveDistanceAccuracy=0,MeshUVDensityAccuracy=0,MaterialTextureScaleAccuracy=0,OutputMaterialTextureScales=0,RequiredTextureResolution=0,VirtualTexturePendingMips=0,WidgetComponents=1,Bones=0,ServerDrawDebug=0,MediaPlanes=1,VREditing=0,OcclusionMeshes=0,VisualizeInstanceOcclusionQueries=0,DisableOcclusionQueries=0,PathTracing=0,RayTracingDebug=0,VisualizeSkyAtmosphere=0,VisualizeLightFunctionAtlas=0,VisualizeCalibrationColor=0,VisualizeCalibrationGrayscale=0,VisualizeCalibrationCustom=0,VisualizePostProcessStack=0,VirtualTexturePrimitives=0,VisualizeVolumetricCloudConservativeDensity=0,VisualizeVolumetricCloudEmptySpaceSkipping=0,VirtualShadowMapPersistentData=1,DebugDrawDistantVirtualSMLights=0,VirtualTextureResidency=1,InputDebugVisualizer=1,LumenScreenTraces=1,LumenDetailTraces=1,LumenGlobalTraces=1,LumenFarFieldTraces=1,LumenSecondaryBounces=1,LumenShortRangeAmbientOcclusion=1,NaniteMeshes=1,NaniteStreamingGeometry=1,VisualizeGPUSkinCache=0,ShaderPrint=1",GameShowFlagsString="PostProcessing=0,Bloom=1,LocalExposure=1,Tonemapper=1,AntiAliasing=1,TemporalAA=1,AmbientCubemap=1,EyeAdaptation=1,VisualizeHDR=0,VisualizeSkyLightIlluminance=0,VisualizeLocalExposure=0,LensFlares=1,GlobalIllumination=1,Vignette=1,Grain=1,AmbientOcclusion=1,Decals=1,CameraImperfections=1,OnScreenDebug=1,OverrideDiffuseAndSpecular=0,LightingOnlyOverride=0,ReflectionOverride=0,VisualizeBuffer=0,VisualizeNanite=0,VisualizeLumen=0,VisualizeSubstrate=0,VisualizeGroom=0,VisualizeVirtualShadowMap=0,DirectLighting=1,DirectionalLights=1,PointLights=1,SpotLights=1,RectLights=1,ColorGrading=1,VectorFields=0,DepthOfField=1,GBufferHints=0,MotionBlur=1,CompositeEditorPrimitives=0,OpaqueCompositeEditorPrimitives=0,TestImage=0,VisualizeDOF=0,VertexColors=0,PhysicalMaterialMasks=0,Refraction=1,CameraInterpolation=1,SceneColorFringe=1,ToneCurve=1,SeparateTranslucency=1,ScreenPercentage=1,VisualizeMotionBlur=0,VisualizeMotionVectors=0,VisualizeReprojection=0,VisualizeTemporalUpscaler=0,VisualizeTSR=0,ReflectionEnvironment=1,VisualizeOutOfBoundsPixels=0,Diffuse=1,Specular=1,SelectionOutline=0,SelectionOutlineColor0=0,SelectionOutlineColor1=0,SelectionOutlineColor2=0,SelectionOutlineColor3=0,SelectionOutlineColor4=0,SelectionOutlineColor5=0,ScreenSpaceReflections=1,LumenReflections=1,ContactShadows=1,RayTracedDistanceFieldShadows=1,CapsuleShadows=1,SubsurfaceScattering=1,VisualizeSSS=0,VolumetricLightmap=1,IndirectLightingCache=1,DebugAI=0,VisLog=1,Navigation=0,GameplayDebug=1,TexturedLightProfiles=1,LightFunctions=1,InstancedStaticMeshes=1,InstancedFoliage=1,HISMCOcclusionBounds=0,HISMCClusterTree=0,VisualizeInstanceUpdates=0,InstancedGrass=1,DynamicShadows=1,Particles=1,Niagara=1,HeterogeneousVolumes=1,SkeletalMeshes=1,BuilderBrush=1,Translucency=1,BillboardSprites=1,LOD=1,LightComplexity=0,ShaderComplexity=0,StationaryLightOverlap=0,LightMapDensity=0,StreamingBounds=0,Constraints=0,MassProperties=0,CameraFrustums=0,AudioRadius=0,ForceFeedbackRadius=1,BSPSplit=0,Brushes=1,Lighting=1,DeferredLighting=1,Editor=0,BSPTriangles=0,LargeVertices=0,Grid=0,Snap=0,MeshEdges=0,Cover=0,Splines=0,Selection=0,VisualizeLevelInstanceEditing=1,ModeWidgets=0,Bounds=0,HitProxies=0,LightInfluences=0,Pivot=0,ShadowFrustums=0,Wireframe=1,Materials=1,StaticMeshes=1,Landscape=1,LightRadius=0,Fog=1,Volumes=0,Game=1,BSP=1,Collision=0,CollisionVisibility=0,CollisionPawn=0,LightShafts=1,PostProcessMaterial=1,Atmosphere=1,Cloud=1,CameraAspectRatioBars=0,CameraSafeFrames=0,TextRender=1,Rendering=1,HMDDistortion=0,StereoRendering=0,DistanceCulledPrimitives=0,VisualizeLightCulling=0,PrecomputedVisibility=1,SkyLighting=1,PreviewShadowsIndicator=1,PrecomputedVisibilityCells=0,VisualizeVolumetricLightmap=0,VolumeLightingSamples=0,Paper2DSprites=1,VisualizeDistanceFieldAO=0,VisualizeMeshDistanceFields=0,PhysicsField=0,VisualizeGlobalDistanceField=0,VisualizeLightingOnProbes=0,ScreenSpaceAO=1,DistanceFieldAO=1,LumenGlobalIllumination=1,VolumetricFog=1,VisualizeSSR=0,VisualizeShadingModels=0,VisualizeSenses=1,LODColoration=0,HLODColoration=0,QuadOverdraw=0,ShaderComplexityWithQuadOverdraw=0,PrimitiveDistanceAccuracy=0,MeshUVDensityAccuracy=0,MaterialTextureScaleAccuracy=0,OutputMaterialTextureScales=0,RequiredTextureResolution=0,VirtualTexturePendingMips=0,WidgetComponents=1,Bones=0,ServerDrawDebug=0,MediaPlanes=1,VREditing=0,OcclusionMeshes=0,VisualizeInstanceOcclusionQueries=0,DisableOcclusionQueries=0,PathTracing=0,RayTracingDebug=0,VisualizeSkyAtmosphere=0,VisualizeLightFunctionAtlas=0,VisualizeCalibrationColor=0,VisualizeCalibrationGrayscale=0,VisualizeCalibrationCustom=0,VisualizePostProcessStack=0,VirtualTexturePrimitives=0,VisualizeVolumetricCloudConservativeDensity=0,VisualizeVolumetricCloudEmptySpaceSkipping=0,VirtualShadowMapPersistentData=1,DebugDrawDistantVirtualSMLights=0,VirtualTextureResidency=1,InputDebugVisualizer=1,LumenScreenTraces=1,LumenDetailTraces=1,LumenGlobalTraces=1,LumenFarFieldTraces=1,LumenSecondaryBounces=1,LumenShortRangeAmbientOcclusion=1,NaniteMeshes=1,NaniteStreamingGeometry=1,VisualizeGPUSkinCache=0,ShaderPrint=1",BufferVisualizationMode="",NaniteVisualizationMode="",LumenVisualizationMode="",SubstrateVisualizationMode="",GroomVisualizationMode="",VirtualShadowMapVisualizationMode="",RayTracingDebugVisualizationMode="",GPUSkinCacheVisualizationMode="",ExposureSettings=(FixedEV100=1.000000,bFixed=False),FOVAngle=90.000000,FarViewPlane=0.000000,bIsRealtime=False,bShowOnScreenStats=True,EnabledStats=,bShowFullToolbar=True,bAllowCinematicControl=True)) -PerInstanceSettings=(ConfigName="FourPanes2x2.Viewport 1.Viewport3",ConfigSettings=(ViewportType=LVT_OrthoXY,PerspViewModeIndex=VMI_Lit,OrthoViewModeIndex=VMI_BrushWireframe,EditorShowFlagsString="PostProcessing=0,Bloom=1,LocalExposure=1,Tonemapper=1,AntiAliasing=1,TemporalAA=1,AmbientCubemap=1,EyeAdaptation=1,VisualizeHDR=0,VisualizeSkyLightIlluminance=0,VisualizeLocalExposure=0,LensFlares=1,GlobalIllumination=1,Vignette=1,Grain=1,AmbientOcclusion=1,Decals=1,CameraImperfections=1,OnScreenDebug=1,OverrideDiffuseAndSpecular=0,LightingOnlyOverride=0,ReflectionOverride=0,VisualizeBuffer=0,VisualizeNanite=0,VisualizeLumen=0,VisualizeSubstrate=0,VisualizeGroom=0,VisualizeVirtualShadowMap=0,DirectLighting=1,DirectionalLights=1,PointLights=1,SpotLights=1,RectLights=1,ColorGrading=1,VectorFields=0,DepthOfField=1,GBufferHints=0,MotionBlur=0,CompositeEditorPrimitives=1,OpaqueCompositeEditorPrimitives=0,TestImage=0,VisualizeDOF=0,VertexColors=0,PhysicalMaterialMasks=0,Refraction=1,CameraInterpolation=1,SceneColorFringe=1,ToneCurve=1,SeparateTranslucency=1,ScreenPercentage=0,VisualizeMotionBlur=0,VisualizeMotionVectors=0,VisualizeReprojection=0,VisualizeTemporalUpscaler=0,VisualizeTSR=0,ReflectionEnvironment=1,VisualizeOutOfBoundsPixels=0,Diffuse=1,Specular=1,SelectionOutline=1,SelectionOutlineColor0=0,SelectionOutlineColor1=0,SelectionOutlineColor2=0,SelectionOutlineColor3=0,SelectionOutlineColor4=0,SelectionOutlineColor5=0,ScreenSpaceReflections=1,LumenReflections=1,ContactShadows=1,RayTracedDistanceFieldShadows=1,CapsuleShadows=1,SubsurfaceScattering=1,VisualizeSSS=0,VolumetricLightmap=1,IndirectLightingCache=1,DebugAI=0,VisLog=1,Navigation=0,GameplayDebug=1,TexturedLightProfiles=1,LightFunctions=1,InstancedStaticMeshes=1,InstancedFoliage=1,HISMCOcclusionBounds=0,HISMCClusterTree=0,VisualizeInstanceUpdates=0,InstancedGrass=1,DynamicShadows=1,Particles=1,Niagara=1,HeterogeneousVolumes=1,SkeletalMeshes=1,BuilderBrush=1,Translucency=1,BillboardSprites=1,LOD=1,LightComplexity=0,ShaderComplexity=0,StationaryLightOverlap=0,LightMapDensity=0,StreamingBounds=0,Constraints=0,MassProperties=0,CameraFrustums=0,AudioRadius=1,ForceFeedbackRadius=1,BSPSplit=0,Brushes=1,Lighting=1,DeferredLighting=1,Editor=1,BSPTriangles=0,LargeVertices=0,Grid=1,Snap=0,MeshEdges=0,Cover=0,Splines=1,Selection=1,VisualizeLevelInstanceEditing=1,ModeWidgets=1,Bounds=0,HitProxies=0,LightInfluences=0,Pivot=1,ShadowFrustums=0,Wireframe=1,Materials=1,StaticMeshes=1,Landscape=1,LightRadius=1,Fog=1,Volumes=1,Game=0,BSP=1,Collision=0,CollisionVisibility=0,CollisionPawn=0,LightShafts=1,PostProcessMaterial=1,Atmosphere=1,Cloud=1,CameraAspectRatioBars=0,CameraSafeFrames=0,TextRender=1,Rendering=1,HMDDistortion=0,StereoRendering=0,DistanceCulledPrimitives=1,VisualizeLightCulling=0,PrecomputedVisibility=1,SkyLighting=1,PreviewShadowsIndicator=1,PrecomputedVisibilityCells=0,VisualizeVolumetricLightmap=0,VolumeLightingSamples=0,Paper2DSprites=1,VisualizeDistanceFieldAO=0,VisualizeMeshDistanceFields=0,PhysicsField=0,VisualizeGlobalDistanceField=0,VisualizeLightingOnProbes=0,ScreenSpaceAO=1,DistanceFieldAO=1,LumenGlobalIllumination=1,VolumetricFog=1,VisualizeSSR=0,VisualizeShadingModels=0,VisualizeSenses=1,LODColoration=0,HLODColoration=0,QuadOverdraw=0,ShaderComplexityWithQuadOverdraw=0,PrimitiveDistanceAccuracy=0,MeshUVDensityAccuracy=0,MaterialTextureScaleAccuracy=0,OutputMaterialTextureScales=0,RequiredTextureResolution=0,VirtualTexturePendingMips=0,WidgetComponents=1,Bones=0,ServerDrawDebug=0,MediaPlanes=1,VREditing=0,OcclusionMeshes=0,VisualizeInstanceOcclusionQueries=0,DisableOcclusionQueries=0,PathTracing=0,RayTracingDebug=0,VisualizeSkyAtmosphere=0,VisualizeLightFunctionAtlas=0,VisualizeCalibrationColor=0,VisualizeCalibrationGrayscale=0,VisualizeCalibrationCustom=0,VisualizePostProcessStack=0,VirtualTexturePrimitives=0,VisualizeVolumetricCloudConservativeDensity=0,VisualizeVolumetricCloudEmptySpaceSkipping=0,VirtualShadowMapPersistentData=1,DebugDrawDistantVirtualSMLights=0,VirtualTextureResidency=1,InputDebugVisualizer=1,LumenScreenTraces=1,LumenDetailTraces=1,LumenGlobalTraces=1,LumenFarFieldTraces=1,LumenSecondaryBounces=1,LumenShortRangeAmbientOcclusion=1,NaniteMeshes=1,NaniteStreamingGeometry=1,VisualizeGPUSkinCache=0,ShaderPrint=1",GameShowFlagsString="PostProcessing=0,Bloom=1,LocalExposure=1,Tonemapper=1,AntiAliasing=1,TemporalAA=1,AmbientCubemap=1,EyeAdaptation=1,VisualizeHDR=0,VisualizeSkyLightIlluminance=0,VisualizeLocalExposure=0,LensFlares=1,GlobalIllumination=1,Vignette=1,Grain=1,AmbientOcclusion=1,Decals=1,CameraImperfections=1,OnScreenDebug=1,OverrideDiffuseAndSpecular=0,LightingOnlyOverride=0,ReflectionOverride=0,VisualizeBuffer=0,VisualizeNanite=0,VisualizeLumen=0,VisualizeSubstrate=0,VisualizeGroom=0,VisualizeVirtualShadowMap=0,DirectLighting=1,DirectionalLights=1,PointLights=1,SpotLights=1,RectLights=1,ColorGrading=1,VectorFields=0,DepthOfField=1,GBufferHints=0,MotionBlur=1,CompositeEditorPrimitives=0,OpaqueCompositeEditorPrimitives=0,TestImage=0,VisualizeDOF=0,VertexColors=0,PhysicalMaterialMasks=0,Refraction=1,CameraInterpolation=1,SceneColorFringe=1,ToneCurve=1,SeparateTranslucency=1,ScreenPercentage=1,VisualizeMotionBlur=0,VisualizeMotionVectors=0,VisualizeReprojection=0,VisualizeTemporalUpscaler=0,VisualizeTSR=0,ReflectionEnvironment=1,VisualizeOutOfBoundsPixels=0,Diffuse=1,Specular=1,SelectionOutline=0,SelectionOutlineColor0=0,SelectionOutlineColor1=0,SelectionOutlineColor2=0,SelectionOutlineColor3=0,SelectionOutlineColor4=0,SelectionOutlineColor5=0,ScreenSpaceReflections=1,LumenReflections=1,ContactShadows=1,RayTracedDistanceFieldShadows=1,CapsuleShadows=1,SubsurfaceScattering=1,VisualizeSSS=0,VolumetricLightmap=1,IndirectLightingCache=1,DebugAI=0,VisLog=1,Navigation=0,GameplayDebug=1,TexturedLightProfiles=1,LightFunctions=1,InstancedStaticMeshes=1,InstancedFoliage=1,HISMCOcclusionBounds=0,HISMCClusterTree=0,VisualizeInstanceUpdates=0,InstancedGrass=1,DynamicShadows=1,Particles=1,Niagara=1,HeterogeneousVolumes=1,SkeletalMeshes=1,BuilderBrush=1,Translucency=1,BillboardSprites=1,LOD=1,LightComplexity=0,ShaderComplexity=0,StationaryLightOverlap=0,LightMapDensity=0,StreamingBounds=0,Constraints=0,MassProperties=0,CameraFrustums=0,AudioRadius=0,ForceFeedbackRadius=1,BSPSplit=0,Brushes=1,Lighting=1,DeferredLighting=1,Editor=0,BSPTriangles=0,LargeVertices=0,Grid=0,Snap=0,MeshEdges=0,Cover=0,Splines=0,Selection=0,VisualizeLevelInstanceEditing=1,ModeWidgets=0,Bounds=0,HitProxies=0,LightInfluences=0,Pivot=0,ShadowFrustums=0,Wireframe=1,Materials=1,StaticMeshes=1,Landscape=1,LightRadius=0,Fog=1,Volumes=0,Game=1,BSP=1,Collision=0,CollisionVisibility=0,CollisionPawn=0,LightShafts=1,PostProcessMaterial=1,Atmosphere=1,Cloud=1,CameraAspectRatioBars=0,CameraSafeFrames=0,TextRender=1,Rendering=1,HMDDistortion=0,StereoRendering=0,DistanceCulledPrimitives=0,VisualizeLightCulling=0,PrecomputedVisibility=1,SkyLighting=1,PreviewShadowsIndicator=1,PrecomputedVisibilityCells=0,VisualizeVolumetricLightmap=0,VolumeLightingSamples=0,Paper2DSprites=1,VisualizeDistanceFieldAO=0,VisualizeMeshDistanceFields=0,PhysicsField=0,VisualizeGlobalDistanceField=0,VisualizeLightingOnProbes=0,ScreenSpaceAO=1,DistanceFieldAO=1,LumenGlobalIllumination=1,VolumetricFog=1,VisualizeSSR=0,VisualizeShadingModels=0,VisualizeSenses=1,LODColoration=0,HLODColoration=0,QuadOverdraw=0,ShaderComplexityWithQuadOverdraw=0,PrimitiveDistanceAccuracy=0,MeshUVDensityAccuracy=0,MaterialTextureScaleAccuracy=0,OutputMaterialTextureScales=0,RequiredTextureResolution=0,VirtualTexturePendingMips=0,WidgetComponents=1,Bones=0,ServerDrawDebug=0,MediaPlanes=1,VREditing=0,OcclusionMeshes=0,VisualizeInstanceOcclusionQueries=0,DisableOcclusionQueries=0,PathTracing=0,RayTracingDebug=0,VisualizeSkyAtmosphere=0,VisualizeLightFunctionAtlas=0,VisualizeCalibrationColor=0,VisualizeCalibrationGrayscale=0,VisualizeCalibrationCustom=0,VisualizePostProcessStack=0,VirtualTexturePrimitives=0,VisualizeVolumetricCloudConservativeDensity=0,VisualizeVolumetricCloudEmptySpaceSkipping=0,VirtualShadowMapPersistentData=1,DebugDrawDistantVirtualSMLights=0,VirtualTextureResidency=1,InputDebugVisualizer=1,LumenScreenTraces=1,LumenDetailTraces=1,LumenGlobalTraces=1,LumenFarFieldTraces=1,LumenSecondaryBounces=1,LumenShortRangeAmbientOcclusion=1,NaniteMeshes=1,NaniteStreamingGeometry=1,VisualizeGPUSkinCache=0,ShaderPrint=1",BufferVisualizationMode="",NaniteVisualizationMode="",LumenVisualizationMode="",SubstrateVisualizationMode="",GroomVisualizationMode="",VirtualShadowMapVisualizationMode="",RayTracingDebugVisualizationMode="",GPUSkinCacheVisualizationMode="",ExposureSettings=(FixedEV100=1.000000,bFixed=False),FOVAngle=90.000000,FarViewPlane=0.000000,bIsRealtime=False,bShowOnScreenStats=True,EnabledStats=,bShowFullToolbar=True,bAllowCinematicControl=True)) - -[MRU] -MRUItem0=/Game/level_01_firstMap -MRUItem1=/Game/level_03_landscape - -[EditorStartup] -LastLevel=/Game/level_01_firstMap - -[ModuleFileTracking] -UnrealNewtonProject1.TimeStamp=2024.10.16-22.58.57 -UnrealNewtonProject1.LastCompileMethod=External -StorageServerClient.TimeStamp=2024.09.06-17.40.58 -StorageServerClient.LastCompileMethod=Unknown -CookOnTheFly.TimeStamp=2024.09.06-17.40.45 -CookOnTheFly.LastCompileMethod=Unknown -StreamingFile.TimeStamp=2024.09.06-17.40.58 -StreamingFile.LastCompileMethod=Unknown -NetworkFile.TimeStamp=2024.09.06-17.40.53 -NetworkFile.LastCompileMethod=Unknown -PakFile.TimeStamp=2024.09.06-17.40.53 -PakFile.LastCompileMethod=Unknown -RSA.TimeStamp=2024.09.06-17.40.56 -RSA.LastCompileMethod=Unknown -SandboxFile.TimeStamp=2024.09.06-17.40.56 -SandboxFile.LastCompileMethod=Unknown -CoreUObject.TimeStamp=2024.09.06-17.40.45 -CoreUObject.LastCompileMethod=Unknown -Engine.TimeStamp=2024.09.06-17.40.49 -Engine.LastCompileMethod=Unknown -UniversalObjectLocator.TimeStamp=2024.09.06-17.40.59 -UniversalObjectLocator.LastCompileMethod=Unknown -Renderer.TimeStamp=2024.09.06-17.40.56 -Renderer.LastCompileMethod=Unknown -AnimGraphRuntime.TimeStamp=2024.09.06-17.40.42 -AnimGraphRuntime.LastCompileMethod=Unknown -SlateRHIRenderer.TimeStamp=2024.09.06-17.40.57 -SlateRHIRenderer.LastCompileMethod=Unknown -Landscape.TimeStamp=2024.09.06-17.40.51 -Landscape.LastCompileMethod=Unknown -RenderCore.TimeStamp=2024.09.06-17.40.55 -RenderCore.LastCompileMethod=Unknown -TextureCompressor.TimeStamp=2024.09.06-17.40.58 -TextureCompressor.LastCompileMethod=Unknown -OpenColorIOWrapper.TimeStamp=2024.09.06-17.40.53 -OpenColorIOWrapper.LastCompileMethod=Unknown -Virtualization.TimeStamp=2024.09.06-17.41.00 -Virtualization.LastCompileMethod=Unknown -MessageLog.TimeStamp=2024.09.06-17.40.52 -MessageLog.LastCompileMethod=Unknown -AudioEditor.TimeStamp=2024.09.06-17.40.43 -AudioEditor.LastCompileMethod=Unknown -PropertyEditor.TimeStamp=2024.09.06-17.40.55 -PropertyEditor.LastCompileMethod=Unknown -AnimationModifiers.TimeStamp=2024.09.06-17.40.42 -AnimationModifiers.LastCompileMethod=Unknown -IoStoreOnDemand.TimeStamp=2024.09.06-17.40.50 -IoStoreOnDemand.LastCompileMethod=Unknown -FastBuildController.TimeStamp=2024.09.06-17.51.20 -FastBuildController.LastCompileMethod=Unknown -XGEController.TimeStamp=2024.09.06-17.53.53 -XGEController.LastCompileMethod=Unknown -PlatformCrypto.TimeStamp=2024.09.06-17.50.10 -PlatformCrypto.LastCompileMethod=Unknown -PlatformCryptoTypes.TimeStamp=2024.09.06-17.50.10 -PlatformCryptoTypes.LastCompileMethod=Unknown -PlatformCryptoOpenSSL.TimeStamp=2024.09.06-17.50.10 -PlatformCryptoOpenSSL.LastCompileMethod=Unknown -PythonScriptPluginPreload.TimeStamp=2024.09.06-17.50.10 -PythonScriptPluginPreload.LastCompileMethod=Unknown -PerforceSourceControl.TimeStamp=2024.09.06-17.48.02 -PerforceSourceControl.LastCompileMethod=Unknown -SourceControl.TimeStamp=2024.09.06-17.40.57 -SourceControl.LastCompileMethod=Unknown -PlasticSourceControl.TimeStamp=2024.09.06-17.48.02 -PlasticSourceControl.LastCompileMethod=Unknown -DesktopPlatform.TimeStamp=2024.09.06-17.40.46 -DesktopPlatform.LastCompileMethod=Unknown -ChaosCloth.TimeStamp=2024.09.06-17.47.55 -ChaosCloth.LastCompileMethod=Unknown -AISupportModule.TimeStamp=2024.09.06-17.47.48 -AISupportModule.LastCompileMethod=Unknown -ExrReaderGpu.TimeStamp=2024.09.06-17.51.50 -ExrReaderGpu.LastCompileMethod=Unknown -WmfMedia.TimeStamp=2024.09.06-17.51.52 -WmfMedia.LastCompileMethod=Unknown -Media.TimeStamp=2024.09.06-17.40.52 -Media.LastCompileMethod=Unknown -ACLPlugin.TimeStamp=2024.09.06-17.47.49 -ACLPlugin.LastCompileMethod=Unknown -LauncherChunkInstaller.TimeStamp=2024.09.06-17.52.12 -LauncherChunkInstaller.LastCompileMethod=Unknown -AnalyticsLog.TimeStamp=2024.09.06-17.50.13 -AnalyticsLog.LastCompileMethod=Unknown -AnalyticsHorde.TimeStamp=2024.09.06-17.50.13 -AnalyticsHorde.LastCompileMethod=Unknown -StudioTelemetry.TimeStamp=2024.09.06-17.50.13 -StudioTelemetry.LastCompileMethod=Unknown -Analytics.TimeStamp=2024.09.06-17.40.42 -Analytics.LastCompileMethod=Unknown -TelemetryUtils.TimeStamp=2024.09.06-17.40.58 -TelemetryUtils.LastCompileMethod=Unknown -PixWinPlugin.TimeStamp=2024.09.06-17.48.02 -PixWinPlugin.LastCompileMethod=Unknown -RenderDocPlugin.TimeStamp=2024.09.06-17.48.02 -RenderDocPlugin.LastCompileMethod=Unknown -ChunkDownloader.TimeStamp=2024.09.06-17.52.20 -ChunkDownloader.LastCompileMethod=Unknown -ExampleDeviceProfileSelector.TimeStamp=2024.09.06-17.52.21 -ExampleDeviceProfileSelector.LastCompileMethod=Unknown -WindowsDeviceProfileSelector.TimeStamp=2024.09.06-17.53.39 -WindowsDeviceProfileSelector.LastCompileMethod=Unknown -DatasmithContent.TimeStamp=2024.09.06-17.48.20 -DatasmithContent.LastCompileMethod=Unknown -GLTFExporter.TimeStamp=2024.09.06-17.48.29 -GLTFExporter.LastCompileMethod=Unknown -VariantManagerContent.TimeStamp=2024.09.06-17.48.32 -VariantManagerContent.LastCompileMethod=Unknown -NiagaraShader.TimeStamp=2024.09.06-17.51.21 -NiagaraShader.LastCompileMethod=Unknown -NiagaraVertexFactories.TimeStamp=2024.09.06-17.51.21 -NiagaraVertexFactories.LastCompileMethod=Unknown -OnlineServicesInterface.TimeStamp=2024.09.06-17.52.03 -OnlineServicesInterface.LastCompileMethod=Unknown -OnlineServicesCommon.TimeStamp=2024.09.06-17.52.03 -OnlineServicesCommon.LastCompileMethod=Unknown -OnlineServicesCommonEngineUtils.TimeStamp=2024.09.06-17.52.03 -OnlineServicesCommonEngineUtils.LastCompileMethod=Unknown -OnlineSubsystem.TimeStamp=2024.09.06-17.52.05 -OnlineSubsystem.LastCompileMethod=Unknown -HTTP.TimeStamp=2024.09.06-17.40.50 -HTTP.LastCompileMethod=Unknown -SSL.TimeStamp=2024.09.06-17.40.58 -SSL.LastCompileMethod=Unknown -XMPP.TimeStamp=2024.09.06-17.41.01 -XMPP.LastCompileMethod=Unknown -WebSockets.TimeStamp=2024.09.06-17.41.01 -WebSockets.LastCompileMethod=Unknown -OnlineSubsystemNULL.TimeStamp=2024.09.06-17.52.06 -OnlineSubsystemNULL.LastCompileMethod=Unknown -Sockets.TimeStamp=2024.09.06-17.40.57 -Sockets.LastCompileMethod=Unknown -OnlineSubsystemUtils.TimeStamp=2024.09.06-17.52.07 -OnlineSubsystemUtils.LastCompileMethod=Unknown -OnlineBlueprintSupport.TimeStamp=2024.09.06-17.52.07 -OnlineBlueprintSupport.LastCompileMethod=Unknown -D3D12RHI.TimeStamp=2024.09.06-17.40.46 -D3D12RHI.LastCompileMethod=Unknown -WindowsPlatformFeatures.TimeStamp=2024.09.06-17.41.01 -WindowsPlatformFeatures.LastCompileMethod=Unknown -GameplayMediaEncoder.TimeStamp=2024.09.06-17.40.49 -GameplayMediaEncoder.LastCompileMethod=Unknown -AVEncoder.TimeStamp=2024.09.06-17.40.43 -AVEncoder.LastCompileMethod=Unknown -Chaos.TimeStamp=2024.09.06-17.40.44 -Chaos.LastCompileMethod=Unknown -GeometryCore.TimeStamp=2024.09.06-17.40.50 -GeometryCore.LastCompileMethod=Unknown -ChaosSolverEngine.TimeStamp=2024.09.06-17.40.44 -ChaosSolverEngine.LastCompileMethod=Unknown -FieldSystemEngine.TimeStamp=2024.09.06-17.40.49 -FieldSystemEngine.LastCompileMethod=Unknown -ChaosVDRuntime.TimeStamp=2024.09.06-17.40.44 -ChaosVDRuntime.LastCompileMethod=Unknown -DirectoryWatcher.TimeStamp=2024.09.06-17.40.47 -DirectoryWatcher.LastCompileMethod=Unknown -Settings.TimeStamp=2024.09.06-17.40.56 -Settings.LastCompileMethod=Unknown -InputCore.TimeStamp=2024.09.06-17.40.50 -InputCore.LastCompileMethod=Unknown -TargetPlatform.TimeStamp=2024.09.06-17.40.58 -TargetPlatform.LastCompileMethod=Unknown -TurnkeySupport.TimeStamp=2024.09.06-17.40.59 -TurnkeySupport.LastCompileMethod=Unknown -TextureFormat.TimeStamp=2024.09.06-17.40.58 -TextureFormat.LastCompileMethod=Unknown -TextureFormatASTC.TimeStamp=2024.09.06-17.40.58 -TextureFormatASTC.LastCompileMethod=Unknown -TextureFormatDXT.TimeStamp=2024.09.06-17.40.58 -TextureFormatDXT.LastCompileMethod=Unknown -TextureFormatETC2.TimeStamp=2024.09.06-17.40.58 -TextureFormatETC2.LastCompileMethod=Unknown -TextureFormatIntelISPCTexComp.TimeStamp=2024.09.06-17.40.58 -TextureFormatIntelISPCTexComp.LastCompileMethod=Unknown -TextureFormatUncompressed.TimeStamp=2024.09.06-17.40.58 -TextureFormatUncompressed.LastCompileMethod=Unknown -TextureFormatOodle.TimeStamp=2024.09.06-17.48.02 -TextureFormatOodle.LastCompileMethod=Unknown -ImageWrapper.TimeStamp=2024.09.06-17.40.50 -ImageWrapper.LastCompileMethod=Unknown -AndroidTargetPlatform.TimeStamp=2024.09.06-17.40.08 -AndroidTargetPlatform.LastCompileMethod=Unknown -AndroidTargetPlatformSettings.TimeStamp=2024.09.06-17.40.08 -AndroidTargetPlatformSettings.LastCompileMethod=Unknown -AndroidTargetPlatformControls.TimeStamp=2024.09.06-17.40.08 -AndroidTargetPlatformControls.LastCompileMethod=Unknown -IOSTargetPlatform.TimeStamp=2024.09.06-17.40.17 -IOSTargetPlatform.LastCompileMethod=Unknown -LinuxTargetPlatform.TimeStamp=2024.09.06-17.40.17 -LinuxTargetPlatform.LastCompileMethod=Unknown -LinuxArm64TargetPlatform.TimeStamp=2024.09.06-17.40.17 -LinuxArm64TargetPlatform.LastCompileMethod=Unknown -MacTargetPlatform.TimeStamp=2024.09.06-17.40.52 -MacTargetPlatform.LastCompileMethod=Unknown -TVOSTargetPlatform.TimeStamp=2024.09.06-17.40.17 -TVOSTargetPlatform.LastCompileMethod=Unknown -WindowsTargetPlatform.TimeStamp=2024.09.06-17.41.01 -WindowsTargetPlatform.LastCompileMethod=Unknown -AudioFormatOPUS.TimeStamp=2024.09.06-17.40.43 -AudioFormatOPUS.LastCompileMethod=Unknown -AudioFormatOGG.TimeStamp=2024.09.06-17.40.43 -AudioFormatOGG.LastCompileMethod=Unknown -AudioFormatADPCM.TimeStamp=2024.09.06-17.40.43 -AudioFormatADPCM.LastCompileMethod=Unknown -AudioFormatBINK.TimeStamp=2024.09.06-17.40.43 -AudioFormatBINK.LastCompileMethod=Unknown -AudioFormatRAD.TimeStamp=2024.09.06-17.40.43 -AudioFormatRAD.LastCompileMethod=Unknown -ShaderFormatVectorVM.TimeStamp=2024.09.06-17.40.57 -ShaderFormatVectorVM.LastCompileMethod=Unknown -ShaderFormatD3D.TimeStamp=2024.09.06-17.40.57 -ShaderFormatD3D.LastCompileMethod=Unknown -ShaderFormatOpenGL.TimeStamp=2024.09.06-17.40.57 -ShaderFormatOpenGL.LastCompileMethod=Unknown -VulkanShaderFormat.TimeStamp=2024.09.06-17.41.00 -VulkanShaderFormat.LastCompileMethod=Unknown -MetalShaderFormat.TimeStamp=2024.09.06-17.40.52 -MetalShaderFormat.LastCompileMethod=Unknown -DerivedDataCache.TimeStamp=2024.09.06-17.40.46 -DerivedDataCache.LastCompileMethod=Unknown -ShaderPreprocessor.TimeStamp=2024.09.06-17.40.57 -ShaderPreprocessor.LastCompileMethod=Unknown -NullInstallBundleManager.TimeStamp=2024.09.06-17.40.53 -NullInstallBundleManager.LastCompileMethod=Unknown -AssetRegistry.TimeStamp=2024.09.06-17.40.42 -AssetRegistry.LastCompileMethod=Unknown -TargetDeviceServices.TimeStamp=2024.09.06-17.40.58 -TargetDeviceServices.LastCompileMethod=Unknown -MeshUtilities.TimeStamp=2024.09.06-17.40.52 -MeshUtilities.LastCompileMethod=Unknown -MaterialBaking.TimeStamp=2024.09.06-17.40.52 -MaterialBaking.LastCompileMethod=Unknown -MeshMergeUtilities.TimeStamp=2024.09.06-17.40.52 -MeshMergeUtilities.LastCompileMethod=Unknown -MeshReductionInterface.TimeStamp=2024.09.06-17.40.52 -MeshReductionInterface.LastCompileMethod=Unknown -QuadricMeshReduction.TimeStamp=2024.09.06-17.40.55 -QuadricMeshReduction.LastCompileMethod=Unknown -ProxyLODMeshReduction.TimeStamp=2024.09.06-17.48.04 -ProxyLODMeshReduction.LastCompileMethod=Unknown -SkeletalMeshReduction.TimeStamp=2024.09.06-17.50.11 -SkeletalMeshReduction.LastCompileMethod=Unknown -MeshBoneReduction.TimeStamp=2024.09.06-17.40.52 -MeshBoneReduction.LastCompileMethod=Unknown -StaticMeshDescription.TimeStamp=2024.09.06-17.40.58 -StaticMeshDescription.LastCompileMethod=Unknown -GeometryProcessingInterfaces.TimeStamp=2024.09.06-17.40.50 -GeometryProcessingInterfaces.LastCompileMethod=Unknown -NaniteBuilder.TimeStamp=2024.09.06-17.40.53 -NaniteBuilder.LastCompileMethod=Unknown -MeshBuilder.TimeStamp=2024.09.06-17.40.52 -MeshBuilder.LastCompileMethod=Unknown -KismetCompiler.TimeStamp=2024.09.06-17.40.51 -KismetCompiler.LastCompileMethod=Unknown -MovieSceneTools.TimeStamp=2024.09.06-17.40.53 -MovieSceneTools.LastCompileMethod=Unknown -Sequencer.TimeStamp=2024.09.06-17.40.56 -Sequencer.LastCompileMethod=Unknown -CurveEditor.TimeStamp=2024.09.06-17.40.46 -CurveEditor.LastCompileMethod=Unknown -AssetDefinition.TimeStamp=2024.09.06-17.40.42 -AssetDefinition.LastCompileMethod=Unknown -Core.TimeStamp=2024.09.06-17.40.45 -Core.LastCompileMethod=Unknown -Networking.TimeStamp=2024.09.06-17.40.53 -Networking.LastCompileMethod=Unknown -LiveCoding.TimeStamp=2024.09.06-17.40.52 -LiveCoding.LastCompileMethod=Unknown -HeadMountedDisplay.TimeStamp=2024.09.06-17.40.50 -HeadMountedDisplay.LastCompileMethod=Unknown -SourceCodeAccess.TimeStamp=2024.09.06-17.40.57 -SourceCodeAccess.LastCompileMethod=Unknown -Messaging.TimeStamp=2024.09.06-17.40.52 -Messaging.LastCompileMethod=Unknown -MRMesh.TimeStamp=2024.09.06-17.40.53 -MRMesh.LastCompileMethod=Unknown -UnrealEd.TimeStamp=2024.09.06-17.41.00 -UnrealEd.LastCompileMethod=Unknown -LandscapeEditorUtilities.TimeStamp=2024.09.06-17.40.51 -LandscapeEditorUtilities.LastCompileMethod=Unknown -SubobjectDataInterface.TimeStamp=2024.09.06-17.40.58 -SubobjectDataInterface.LastCompileMethod=Unknown -SlateCore.TimeStamp=2024.09.06-17.40.57 -SlateCore.LastCompileMethod=Unknown -Slate.TimeStamp=2024.09.06-17.40.57 -Slate.LastCompileMethod=Unknown -SlateReflector.TimeStamp=2024.09.06-17.40.57 -SlateReflector.LastCompileMethod=Unknown -EditorStyle.TimeStamp=2024.09.06-17.40.47 -EditorStyle.LastCompileMethod=Unknown -UMG.TimeStamp=2024.09.06-17.40.59 -UMG.LastCompileMethod=Unknown -UMGEditor.TimeStamp=2024.09.06-17.40.59 -UMGEditor.LastCompileMethod=Unknown -AssetTools.TimeStamp=2024.09.06-17.40.43 -AssetTools.LastCompileMethod=Unknown -ScriptableEditorWidgets.TimeStamp=2024.09.06-17.40.56 -ScriptableEditorWidgets.LastCompileMethod=Unknown -CollisionAnalyzer.TimeStamp=2024.09.06-17.40.44 -CollisionAnalyzer.LastCompileMethod=Unknown -WorkspaceMenuStructure.TimeStamp=2024.09.06-17.41.01 -WorkspaceMenuStructure.LastCompileMethod=Unknown -FunctionalTesting.TimeStamp=2024.09.06-17.40.49 -FunctionalTesting.LastCompileMethod=Unknown -BehaviorTreeEditor.TimeStamp=2024.09.06-17.40.43 -BehaviorTreeEditor.LastCompileMethod=Unknown -GameplayTasksEditor.TimeStamp=2024.09.06-17.40.49 -GameplayTasksEditor.LastCompileMethod=Unknown -StringTableEditor.TimeStamp=2024.09.06-17.40.58 -StringTableEditor.LastCompileMethod=Unknown -VREditor.TimeStamp=2024.09.06-17.41.00 -VREditor.LastCompileMethod=Unknown -Overlay.TimeStamp=2024.09.06-17.40.53 -Overlay.LastCompileMethod=Unknown -OverlayEditor.TimeStamp=2024.09.06-17.40.53 -OverlayEditor.LastCompileMethod=Unknown -MediaAssets.TimeStamp=2024.09.06-17.40.52 -MediaAssets.LastCompileMethod=Unknown -ClothingSystemRuntimeNv.TimeStamp=2024.09.06-17.40.44 -ClothingSystemRuntimeNv.LastCompileMethod=Unknown -ClothingSystemEditor.TimeStamp=2024.09.06-17.40.44 -ClothingSystemEditor.LastCompileMethod=Unknown -AnimationDataController.TimeStamp=2024.09.06-17.40.42 -AnimationDataController.LastCompileMethod=Unknown -TimeManagement.TimeStamp=2024.09.06-17.40.58 -TimeManagement.LastCompileMethod=Unknown -AnimGraph.TimeStamp=2024.09.06-17.40.42 -AnimGraph.LastCompileMethod=Unknown -WorldPartitionEditor.TimeStamp=2024.09.06-17.41.01 -WorldPartitionEditor.LastCompileMethod=Unknown -PacketHandler.TimeStamp=2024.09.06-17.40.53 -PacketHandler.LastCompileMethod=Unknown -NetworkReplayStreaming.TimeStamp=2024.09.06-17.40.53 -NetworkReplayStreaming.LastCompileMethod=Unknown -AndroidFileServer.TimeStamp=2024.09.06-17.52.16 -AndroidFileServer.LastCompileMethod=Unknown -WebMMoviePlayer.TimeStamp=2024.09.06-17.53.39 -WebMMoviePlayer.LastCompileMethod=Unknown -WindowsMoviePlayer.TimeStamp=2024.09.06-17.53.39 -WindowsMoviePlayer.LastCompileMethod=Unknown -EnhancedInput.TimeStamp=2024.09.06-17.48.11 -EnhancedInput.LastCompileMethod=Unknown -InputBlueprintNodes.TimeStamp=2024.09.06-17.48.11 -InputBlueprintNodes.LastCompileMethod=Unknown -BlueprintGraph.TimeStamp=2024.09.06-17.40.43 -BlueprintGraph.LastCompileMethod=Unknown -EnvironmentQueryEditor.TimeStamp=2024.09.06-17.47.48 -EnvironmentQueryEditor.LastCompileMethod=Unknown -ImgMediaEngine.TimeStamp=2024.09.06-17.51.50 -ImgMediaEngine.LastCompileMethod=Unknown -AnimationData.TimeStamp=2024.09.06-17.47.49 -AnimationData.LastCompileMethod=Unknown -ControlRig.TimeStamp=2024.09.06-17.47.49 -ControlRig.LastCompileMethod=Unknown -Constraints.TimeStamp=2024.09.06-17.40.44 -Constraints.LastCompileMethod=Unknown -ControlRigDeveloper.TimeStamp=2024.09.06-17.47.49 -ControlRigDeveloper.LastCompileMethod=Unknown -IKRig.TimeStamp=2024.09.06-17.47.52 -IKRig.LastCompileMethod=Unknown -IKRigDeveloper.TimeStamp=2024.09.06-17.47.52 -IKRigDeveloper.LastCompileMethod=Unknown -ChaosCaching.TimeStamp=2024.09.06-17.49.03 -ChaosCaching.LastCompileMethod=Unknown -LevelSequence.TimeStamp=2024.09.06-17.40.52 -LevelSequence.LastCompileMethod=Unknown -ChaosCachingEditor.TimeStamp=2024.09.06-17.49.03 -ChaosCachingEditor.LastCompileMethod=Unknown -LevelEditor.TimeStamp=2024.09.06-17.40.52 -LevelEditor.LastCompileMethod=Unknown -MainFrame.TimeStamp=2024.09.06-17.40.52 -MainFrame.LastCompileMethod=Unknown -HotReload.TimeStamp=2024.09.06-17.40.50 -HotReload.LastCompileMethod=Unknown -CommonMenuExtensions.TimeStamp=2024.09.06-17.40.44 -CommonMenuExtensions.LastCompileMethod=Unknown -PixelInspectorModule.TimeStamp=2024.09.06-17.40.54 -PixelInspectorModule.LastCompileMethod=Unknown -TakeRecorder.TimeStamp=2024.09.06-17.53.52 -TakeRecorder.LastCompileMethod=Unknown -FullBodyIK.TimeStamp=2024.09.06-17.49.06 -FullBodyIK.LastCompileMethod=Unknown -PBIK.TimeStamp=2024.09.06-17.49.06 -PBIK.LastCompileMethod=Unknown -PythonScriptPlugin.TimeStamp=2024.09.06-17.50.10 -PythonScriptPlugin.LastCompileMethod=Unknown -StructUtils.TimeStamp=2024.09.06-17.50.13 -StructUtils.LastCompileMethod=Unknown -AnimationSharing.TimeStamp=2024.09.06-17.47.58 -AnimationSharing.LastCompileMethod=Unknown -PropertyAccessNode.TimeStamp=2024.09.06-17.48.02 -PropertyAccessNode.LastCompileMethod=Unknown -TraceDataFiltering.TimeStamp=2024.09.06-17.48.02 -TraceDataFiltering.LastCompileMethod=Unknown -InterchangeNodes.TimeStamp=2024.09.06-17.51.46 -InterchangeNodes.LastCompileMethod=Unknown -InterchangeFactoryNodes.TimeStamp=2024.09.06-17.51.46 -InterchangeFactoryNodes.LastCompileMethod=Unknown -InterchangeImport.TimeStamp=2024.09.06-17.51.46 -InterchangeImport.LastCompileMethod=Unknown -InterchangePipelines.TimeStamp=2024.09.06-17.51.46 -InterchangePipelines.LastCompileMethod=Unknown -AudioSynesthesiaCore.TimeStamp=2024.09.06-17.52.20 -AudioSynesthesiaCore.LastCompileMethod=Unknown -SignalProcessing.TimeStamp=2024.09.06-17.40.57 -SignalProcessing.LastCompileMethod=Unknown -AudioSynesthesia.TimeStamp=2024.09.06-17.52.20 -AudioSynesthesia.LastCompileMethod=Unknown -AudioAnalyzer.TimeStamp=2024.09.06-17.40.43 -AudioAnalyzer.LastCompileMethod=Unknown -CableComponent.TimeStamp=2024.09.06-17.52.20 -CableComponent.LastCompileMethod=Unknown -CustomMeshComponent.TimeStamp=2024.09.06-17.52.20 -CustomMeshComponent.LastCompileMethod=Unknown -LocationServicesBPLibrary.TimeStamp=2024.09.06-17.52.56 -LocationServicesBPLibrary.LastCompileMethod=Unknown -MetasoundGraphCore.TimeStamp=2024.09.06-17.52.58 -MetasoundGraphCore.LastCompileMethod=Unknown -MetasoundGenerator.TimeStamp=2024.09.06-17.52.58 -MetasoundGenerator.LastCompileMethod=Unknown -MetasoundFrontend.TimeStamp=2024.09.06-17.52.58 -MetasoundFrontend.LastCompileMethod=Unknown -MetasoundStandardNodes.TimeStamp=2024.09.06-17.52.58 -MetasoundStandardNodes.LastCompileMethod=Unknown -MetasoundEngine.TimeStamp=2024.09.06-17.52.58 -MetasoundEngine.LastCompileMethod=Unknown -WaveTable.TimeStamp=2024.09.06-17.53.39 -WaveTable.LastCompileMethod=Unknown -MetasoundEngineTest.TimeStamp=2024.09.06-17.52.58 -MetasoundEngineTest.LastCompileMethod=Unknown -MetasoundEditor.TimeStamp=2024.09.06-17.52.58 -MetasoundEditor.LastCompileMethod=Unknown -AudioWidgets.TimeStamp=2024.09.06-17.52.20 -AudioWidgets.LastCompileMethod=Unknown -AdvancedWidgets.TimeStamp=2024.09.06-17.40.42 -AdvancedWidgets.LastCompileMethod=Unknown -MsQuicRuntime.TimeStamp=2024.09.06-17.53.00 -MsQuicRuntime.LastCompileMethod=Unknown -ProceduralMeshComponent.TimeStamp=2024.09.06-17.53.32 -ProceduralMeshComponent.LastCompileMethod=Unknown -PropertyAccessEditor.TimeStamp=2024.09.06-17.53.32 -PropertyAccessEditor.LastCompileMethod=Unknown -RigVM.TimeStamp=2024.09.06-17.53.33 -RigVM.LastCompileMethod=Unknown -RigVMDeveloper.TimeStamp=2024.09.06-17.53.33 -RigVMDeveloper.LastCompileMethod=Unknown -ResonanceAudio.TimeStamp=2024.09.06-17.53.32 -ResonanceAudio.LastCompileMethod=Unknown -SignificanceManager.TimeStamp=2024.09.06-17.53.34 -SignificanceManager.LastCompileMethod=Unknown -SoundFields.TimeStamp=2024.09.06-17.53.34 -SoundFields.LastCompileMethod=Unknown -Synthesis.TimeStamp=2024.09.06-17.53.39 -Synthesis.LastCompileMethod=Unknown -ActorSequence.TimeStamp=2024.09.06-17.51.54 -ActorSequence.LastCompileMethod=Unknown -Paper2D.TimeStamp=2024.09.06-17.47.47 -Paper2D.LastCompileMethod=Unknown -AssetManagerEditor.TimeStamp=2024.09.06-17.48.02 -AssetManagerEditor.LastCompileMethod=Unknown -TreeMap.TimeStamp=2024.09.06-17.40.59 -TreeMap.LastCompileMethod=Unknown -ContentBrowser.TimeStamp=2024.09.06-17.40.45 -ContentBrowser.LastCompileMethod=Unknown -ContentBrowserData.TimeStamp=2024.09.06-17.40.45 -ContentBrowserData.LastCompileMethod=Unknown -ToolMenus.TimeStamp=2024.09.06-17.40.58 -ToolMenus.LastCompileMethod=Unknown -GameplayCameras.TimeStamp=2024.09.06-17.47.54 -GameplayCameras.LastCompileMethod=Unknown -DataValidation.TimeStamp=2024.09.06-17.48.03 -DataValidation.LastCompileMethod=Unknown -GameplayTagsEditor.TimeStamp=2024.09.06-17.48.03 -GameplayTagsEditor.LastCompileMethod=Unknown -FacialAnimation.TimeStamp=2024.09.06-17.48.03 -FacialAnimation.LastCompileMethod=Unknown -FacialAnimationEditor.TimeStamp=2024.09.06-17.48.03 -FacialAnimationEditor.LastCompileMethod=Unknown -NiagaraCore.TimeStamp=2024.09.06-17.51.20 -NiagaraCore.LastCompileMethod=Unknown -Niagara.TimeStamp=2024.09.06-17.51.20 -Niagara.LastCompileMethod=Unknown -NiagaraEditor.TimeStamp=2024.09.06-17.51.21 -NiagaraEditor.LastCompileMethod=Unknown -NiagaraAnimNotifies.TimeStamp=2024.09.06-17.51.20 -NiagaraAnimNotifies.LastCompileMethod=Unknown -NiagaraSimCaching.TimeStamp=2024.09.06-17.51.33 -NiagaraSimCaching.LastCompileMethod=Unknown -NiagaraSimCachingEditor.TimeStamp=2024.09.06-17.51.33 -NiagaraSimCachingEditor.LastCompileMethod=Unknown -UdpMessaging.TimeStamp=2024.09.06-17.51.54 -UdpMessaging.LastCompileMethod=Unknown -TcpMessaging.TimeStamp=2024.09.06-17.51.54 -TcpMessaging.LastCompileMethod=Unknown -ChaosClothEditor.TimeStamp=2024.09.06-17.47.56 -ChaosClothEditor.LastCompileMethod=Unknown -ChaosVD.TimeStamp=2024.09.06-17.47.57 -ChaosVD.LastCompileMethod=Unknown -InputEditor.TimeStamp=2024.09.06-17.48.11 -InputEditor.LastCompileMethod=Unknown -MeshPaintEditorMode.TimeStamp=2024.09.06-17.51.53 -MeshPaintEditorMode.LastCompileMethod=Unknown -MeshPaintingToolset.TimeStamp=2024.09.06-17.51.54 -MeshPaintingToolset.LastCompileMethod=Unknown -RenderGraphInsights.TimeStamp=2024.09.06-17.52.12 -RenderGraphInsights.LastCompileMethod=Unknown -TraceUtilities.TimeStamp=2024.09.06-17.53.40 -TraceUtilities.LastCompileMethod=Unknown -EditorTraceUtilities.TimeStamp=2024.09.06-17.53.40 -EditorTraceUtilities.LastCompileMethod=Unknown -WorldMetricsCore.TimeStamp=2024.09.06-17.53.53 -WorldMetricsCore.LastCompileMethod=Unknown -WorldMetricsTest.TimeStamp=2024.09.06-17.53.53 -WorldMetricsTest.LastCompileMethod=Unknown -CsvMetrics.TimeStamp=2024.09.06-17.53.53 -CsvMetrics.LastCompileMethod=Unknown -ImgMedia.TimeStamp=2024.09.06-17.51.50 -ImgMedia.LastCompileMethod=Unknown -MediaCompositing.TimeStamp=2024.09.06-17.51.50 -MediaCompositing.LastCompileMethod=Unknown -MediaPlate.TimeStamp=2024.09.06-17.51.51 -MediaPlate.LastCompileMethod=Unknown -MediaPlateEditor.TimeStamp=2024.09.06-17.51.51 -MediaPlateEditor.LastCompileMethod=Unknown -ACLPluginEditor.TimeStamp=2024.09.06-17.47.49 -ACLPluginEditor.LastCompileMethod=Unknown -AnimationModifierLibrary.TimeStamp=2024.09.06-17.47.49 -AnimationModifierLibrary.LastCompileMethod=Unknown -BlendSpaceMotionAnalysis.TimeStamp=2024.09.06-17.47.49 -BlendSpaceMotionAnalysis.LastCompileMethod=Unknown -ControlRigSpline.TimeStamp=2024.09.06-17.47.51 -ControlRigSpline.LastCompileMethod=Unknown -OodleNetworkHandlerComponent.TimeStamp=2024.09.06-17.47.58 -OodleNetworkHandlerComponent.LastCompileMethod=Unknown -AutomationUtils.TimeStamp=2024.09.06-17.48.42 -AutomationUtils.LastCompileMethod=Unknown -AutomationUtilsEditor.TimeStamp=2024.09.06-17.48.42 -AutomationUtilsEditor.LastCompileMethod=Unknown -FractureEditor.TimeStamp=2024.09.06-17.49.03 -FractureEditor.LastCompileMethod=Unknown -BackChannel.TimeStamp=2024.09.06-17.49.03 -BackChannel.LastCompileMethod=Unknown -ChaosSolverEditor.TimeStamp=2024.09.06-17.49.03 -ChaosSolverEditor.LastCompileMethod=Unknown -ChaosUserDataPT.TimeStamp=2024.09.06-17.49.03 -ChaosUserDataPT.LastCompileMethod=Unknown -ChaosNiagara.TimeStamp=2024.09.06-17.49.03 -ChaosNiagara.LastCompileMethod=Unknown -DataflowEditor.TimeStamp=2024.09.06-17.49.05 -DataflowEditor.LastCompileMethod=Unknown -DataflowAssetTools.TimeStamp=2024.09.06-17.49.05 -DataflowAssetTools.LastCompileMethod=Unknown -DataflowEnginePlugin.TimeStamp=2024.09.06-17.49.05 -DataflowEnginePlugin.LastCompileMethod=Unknown -DataflowNodes.TimeStamp=2024.09.06-17.49.05 -DataflowNodes.LastCompileMethod=Unknown -GeometryCollectionEditor.TimeStamp=2024.09.06-17.49.06 -GeometryCollectionEditor.LastCompileMethod=Unknown -GeometryCollectionTracks.TimeStamp=2024.09.06-17.49.06 -GeometryCollectionTracks.LastCompileMethod=Unknown -GeometryCollectionSequencer.TimeStamp=2024.09.06-17.49.06 -GeometryCollectionSequencer.LastCompileMethod=Unknown -GeometryCollectionEngine.TimeStamp=2024.09.06-17.40.49 -GeometryCollectionEngine.LastCompileMethod=Unknown -GeometryCollectionNodes.TimeStamp=2024.09.06-17.49.06 -GeometryCollectionNodes.LastCompileMethod=Unknown -GeometryFlowCore.TimeStamp=2024.09.06-17.49.06 -GeometryFlowCore.LastCompileMethod=Unknown -GeometryFlowMeshProcessing.TimeStamp=2024.09.06-17.49.06 -GeometryFlowMeshProcessing.LastCompileMethod=Unknown -GeometryFlowMeshProcessingEditor.TimeStamp=2024.09.06-17.49.06 -GeometryFlowMeshProcessingEditor.LastCompileMethod=Unknown -LocalizableMessage.TimeStamp=2024.09.06-17.49.12 -LocalizableMessage.LastCompileMethod=Unknown -LocalizableMessageBlueprint.TimeStamp=2024.09.06-17.49.12 -LocalizableMessageBlueprint.LastCompileMethod=Unknown -MeshModelingToolsExp.TimeStamp=2024.09.06-17.49.12 -MeshModelingToolsExp.LastCompileMethod=Unknown -MeshModelingToolsEditorOnlyExp.TimeStamp=2024.09.06-17.49.12 -MeshModelingToolsEditorOnlyExp.LastCompileMethod=Unknown -GeometryProcessingAdapters.TimeStamp=2024.09.06-17.49.12 -GeometryProcessingAdapters.LastCompileMethod=Unknown -ModelingEditorUI.TimeStamp=2024.09.06-17.49.12 -ModelingEditorUI.LastCompileMethod=Unknown -SkeletalMeshModifiers.TimeStamp=2024.09.06-17.49.12 -SkeletalMeshModifiers.LastCompileMethod=Unknown -OpenImageDenoise.TimeStamp=2024.09.06-17.50.05 -OpenImageDenoise.LastCompileMethod=Unknown -StructUtilsEngine.TimeStamp=2024.09.06-17.50.13 -StructUtilsEngine.LastCompileMethod=Unknown -StructUtilsEditor.TimeStamp=2024.09.06-17.50.13 -StructUtilsEditor.LastCompileMethod=Unknown -StructUtilsNodes.TimeStamp=2024.09.06-17.50.13 -StructUtilsNodes.LastCompileMethod=Unknown -StructUtilsTestSuite.TimeStamp=2024.09.06-17.50.13 -StructUtilsTestSuite.LastCompileMethod=Unknown -ToolPresetAsset.TimeStamp=2024.09.06-17.50.37 -ToolPresetAsset.LastCompileMethod=Unknown -ToolPresetEditor.TimeStamp=2024.09.06-17.50.37 -ToolPresetEditor.LastCompileMethod=Unknown -InterchangeTests.TimeStamp=2024.09.06-17.53.40 -InterchangeTests.LastCompileMethod=Unknown -InterchangeTestEditor.TimeStamp=2024.09.06-17.53.40 -InterchangeTestEditor.LastCompileMethod=Unknown -AnimationSharingEd.TimeStamp=2024.09.06-17.47.58 -AnimationSharingEd.LastCompileMethod=Unknown -CLionSourceCodeAccess.TimeStamp=2024.09.06-17.47.58 -CLionSourceCodeAccess.LastCompileMethod=Unknown -DumpGPUServices.TimeStamp=2024.09.06-17.48.02 -DumpGPUServices.LastCompileMethod=Unknown -GitSourceControl.TimeStamp=2024.09.06-17.48.02 -GitSourceControl.LastCompileMethod=Unknown -N10XSourceCodeAccess.TimeStamp=2024.09.06-17.48.02 -N10XSourceCodeAccess.LastCompileMethod=Unknown -PluginUtils.TimeStamp=2024.09.06-17.48.02 -PluginUtils.LastCompileMethod=Unknown -RiderSourceCodeAccess.TimeStamp=2024.09.06-17.48.02 -RiderSourceCodeAccess.LastCompileMethod=Unknown -VisualStudioCodeSourceCodeAccess.TimeStamp=2024.09.06-17.48.02 -VisualStudioCodeSourceCodeAccess.LastCompileMethod=Unknown -VisualStudioSourceCodeAccess.TimeStamp=2024.09.06-17.48.02 -VisualStudioSourceCodeAccess.LastCompileMethod=Unknown -SubversionSourceControl.TimeStamp=2024.09.06-17.48.02 -SubversionSourceControl.LastCompileMethod=Unknown -InterchangeEditor.TimeStamp=2024.09.06-17.51.46 -InterchangeEditor.LastCompileMethod=Unknown -InterchangeEditorPipelines.TimeStamp=2024.09.06-17.51.46 -InterchangeEditorPipelines.LastCompileMethod=Unknown -InterchangeEditorUtilities.TimeStamp=2024.09.06-17.51.46 -InterchangeEditorUtilities.LastCompileMethod=Unknown -ActorLayerUtilities.TimeStamp=2024.09.06-17.52.12 -ActorLayerUtilities.LastCompileMethod=Unknown -ActorLayerUtilitiesEditor.TimeStamp=2024.09.06-17.52.12 -ActorLayerUtilitiesEditor.LastCompileMethod=Unknown -UObjectPlugin.TimeStamp=2024.09.06-17.48.02 -UObjectPlugin.LastCompileMethod=Unknown -AlembicImporter.TimeStamp=2024.09.06-17.51.33 -AlembicImporter.LastCompileMethod=Unknown -AlembicLibrary.TimeStamp=2024.09.06-17.51.33 -AlembicLibrary.LastCompileMethod=Unknown -GeometryCache.TimeStamp=2024.09.06-17.52.23 -GeometryCache.LastCompileMethod=Unknown -GeometryCacheEd.TimeStamp=2024.09.06-17.52.23 -GeometryCacheEd.LastCompileMethod=Unknown -GLTFCore.TimeStamp=2024.09.06-17.51.46 -GLTFCore.LastCompileMethod=Unknown -InterchangeMessages.TimeStamp=2024.09.06-17.51.46 -InterchangeMessages.LastCompileMethod=Unknown -InterchangeExport.TimeStamp=2024.09.06-17.51.46 -InterchangeExport.LastCompileMethod=Unknown -InterchangeDispatcher.TimeStamp=2024.09.06-17.51.46 -InterchangeDispatcher.LastCompileMethod=Unknown -InterchangeCommon.TimeStamp=2024.09.06-17.51.46 -InterchangeCommon.LastCompileMethod=Unknown -InterchangeCommonParser.TimeStamp=2024.09.06-17.51.46 -InterchangeCommonParser.LastCompileMethod=Unknown -InterchangeFbxParser.TimeStamp=2024.09.06-17.51.46 -InterchangeFbxParser.LastCompileMethod=Unknown -ArchVisCharacter.TimeStamp=2024.09.06-17.52.19 -ArchVisCharacter.LastCompileMethod=Unknown -AssetTags.TimeStamp=2024.09.06-17.52.19 -AssetTags.LastCompileMethod=Unknown -AudioCapture.TimeStamp=2024.09.06-17.52.19 -AudioCapture.LastCompileMethod=Unknown -AudioCaptureWasapi.TimeStamp=2024.09.06-17.40.43 -AudioCaptureWasapi.LastCompileMethod=Unknown -AppleImageUtils.TimeStamp=2024.09.06-17.52.16 -AppleImageUtils.LastCompileMethod=Unknown -AppleImageUtilsBlueprintSupport.TimeStamp=2024.09.06-17.52.16 -AppleImageUtilsBlueprintSupport.LastCompileMethod=Unknown -AndroidPermission.TimeStamp=2024.09.06-17.52.16 -AndroidPermission.LastCompileMethod=Unknown -GeometryCacheSequencer.TimeStamp=2024.09.06-17.52.23 -GeometryCacheSequencer.LastCompileMethod=Unknown -GeometryCacheStreamer.TimeStamp=2024.09.06-17.52.23 -GeometryCacheStreamer.LastCompileMethod=Unknown -GeometryCacheTracks.TimeStamp=2024.09.06-17.52.23 -GeometryCacheTracks.LastCompileMethod=Unknown -GeometryAlgorithms.TimeStamp=2024.09.06-17.52.23 -GeometryAlgorithms.LastCompileMethod=Unknown -DynamicMesh.TimeStamp=2024.09.06-17.52.23 -DynamicMesh.LastCompileMethod=Unknown -GooglePAD.TimeStamp=2024.09.06-17.52.37 -GooglePAD.LastCompileMethod=Unknown -InputDebugging.TimeStamp=2024.09.06-17.52.56 -InputDebugging.LastCompileMethod=Unknown -InputDebuggingEditor.TimeStamp=2024.09.06-17.52.56 -InputDebuggingEditor.LastCompileMethod=Unknown -MeshModelingTools.TimeStamp=2024.09.06-17.52.56 -MeshModelingTools.LastCompileMethod=Unknown -MeshModelingToolsEditorOnly.TimeStamp=2024.09.06-17.52.56 -MeshModelingToolsEditorOnly.LastCompileMethod=Unknown -ModelingComponents.TimeStamp=2024.09.06-17.52.56 -ModelingComponents.LastCompileMethod=Unknown -GeometryFramework.TimeStamp=2024.09.06-17.40.50 -GeometryFramework.LastCompileMethod=Unknown -ModelingComponentsEditorOnly.TimeStamp=2024.09.06-17.52.56 -ModelingComponentsEditorOnly.LastCompileMethod=Unknown -ModelingOperators.TimeStamp=2024.09.06-17.52.56 -ModelingOperators.LastCompileMethod=Unknown -ModelingOperatorsEditorOnly.TimeStamp=2024.09.06-17.52.56 -ModelingOperatorsEditorOnly.LastCompileMethod=Unknown -MobilePatchingUtils.TimeStamp=2024.09.06-17.53.00 -MobilePatchingUtils.LastCompileMethod=Unknown -ProceduralMeshComponentEditor.TimeStamp=2024.09.06-17.53.32 -ProceduralMeshComponentEditor.LastCompileMethod=Unknown -SynthesisEditor.TimeStamp=2024.09.06-17.53.39 -SynthesisEditor.LastCompileMethod=Unknown -DatasmithContentEditor.TimeStamp=2024.09.06-17.48.20 -DatasmithContentEditor.LastCompileMethod=Unknown -VariantManager.TimeStamp=2024.09.06-17.48.32 -VariantManager.LastCompileMethod=Unknown -VariantManagerContentEditor.TimeStamp=2024.09.06-17.48.32 -VariantManagerContentEditor.LastCompileMethod=Unknown -SequencerScripting.TimeStamp=2024.09.06-17.51.55 -SequencerScripting.LastCompileMethod=Unknown -SequencerScriptingEditor.TimeStamp=2024.09.06-17.51.55 -SequencerScriptingEditor.LastCompileMethod=Unknown -TemplateSequence.TimeStamp=2024.09.06-17.51.55 -TemplateSequence.LastCompileMethod=Unknown -TakeMovieScene.TimeStamp=2024.09.06-17.53.52 -TakeMovieScene.LastCompileMethod=Unknown -TakeSequencer.TimeStamp=2024.09.06-17.53.52 -TakeSequencer.LastCompileMethod=Unknown -Paper2DEditor.TimeStamp=2024.09.06-17.47.48 -Paper2DEditor.LastCompileMethod=Unknown -PaperSpriteSheetImporter.TimeStamp=2024.09.06-17.47.48 -PaperSpriteSheetImporter.LastCompileMethod=Unknown -PaperTiledImporter.TimeStamp=2024.09.06-17.47.48 -PaperTiledImporter.LastCompileMethod=Unknown -BlueprintHeaderView.TimeStamp=2024.09.06-17.48.02 -BlueprintHeaderView.LastCompileMethod=Unknown -ChangelistReview.TimeStamp=2024.09.06-17.48.03 -ChangelistReview.LastCompileMethod=Unknown -CryptoKeys.TimeStamp=2024.09.06-17.48.03 -CryptoKeys.LastCompileMethod=Unknown -CryptoKeysOpenSSL.TimeStamp=2024.09.06-17.48.03 -CryptoKeysOpenSSL.LastCompileMethod=Unknown -CurveEditorTools.TimeStamp=2024.09.06-17.48.03 -CurveEditorTools.LastCompileMethod=Unknown -EditorDebugTools.TimeStamp=2024.09.06-17.48.03 -EditorDebugTools.LastCompileMethod=Unknown -EditorScriptingUtilities.TimeStamp=2024.09.06-17.48.03 -EditorScriptingUtilities.LastCompileMethod=Unknown -MaterialAnalyzer.TimeStamp=2024.09.06-17.48.03 -MaterialAnalyzer.LastCompileMethod=Unknown -MeshLODToolset.TimeStamp=2024.09.06-17.48.03 -MeshLODToolset.LastCompileMethod=Unknown -MobileLauncherProfileWizard.TimeStamp=2024.09.06-17.48.03 -MobileLauncherProfileWizard.LastCompileMethod=Unknown -ModelingToolsEditorMode.TimeStamp=2024.09.06-17.48.03 -ModelingToolsEditorMode.LastCompileMethod=Unknown -PluginBrowser.TimeStamp=2024.09.06-17.48.04 -PluginBrowser.LastCompileMethod=Unknown -SequencerAnimTools.TimeStamp=2024.09.06-17.48.04 -SequencerAnimTools.LastCompileMethod=Unknown -SpeedTreeImporter.TimeStamp=2024.09.06-17.48.04 -SpeedTreeImporter.LastCompileMethod=Unknown -UVEditor.TimeStamp=2024.09.06-17.48.04 -UVEditor.LastCompileMethod=Unknown -UVEditorTools.TimeStamp=2024.09.06-17.48.04 -UVEditorTools.LastCompileMethod=Unknown -UVEditorToolsEditorOnly.TimeStamp=2024.09.06-17.48.04 -UVEditorToolsEditorOnly.LastCompileMethod=Unknown -WorldPartitionHLODUtilities.TimeStamp=2024.09.06-17.48.11 -WorldPartitionHLODUtilities.LastCompileMethod=Unknown -NiagaraBlueprintNodes.TimeStamp=2024.09.06-17.51.20 -NiagaraBlueprintNodes.LastCompileMethod=Unknown -NiagaraEditorWidgets.TimeStamp=2024.09.06-17.51.21 -NiagaraEditorWidgets.LastCompileMethod=Unknown -OnlineBase.TimeStamp=2024.09.06-17.52.03 -OnlineBase.LastCompileMethod=Unknown -XInputDevice.TimeStamp=2024.09.06-17.53.39 -XInputDevice.LastCompileMethod=Unknown -LightMixer.TimeStamp=2024.09.06-17.48.04 -LightMixer.LastCompileMethod=Unknown -ObjectMixerEditor.TimeStamp=2024.09.06-17.48.04 -ObjectMixerEditor.LastCompileMethod=Unknown -MetaHumanProjectUtilities.TimeStamp=2024.09.06-17.49.13 -MetaHumanProjectUtilities.LastCompileMethod=Unknown -ContentBrowserAssetDataSource.TimeStamp=2024.09.06-17.48.03 -ContentBrowserAssetDataSource.LastCompileMethod=Unknown -CollectionManager.TimeStamp=2024.09.06-17.40.44 -CollectionManager.LastCompileMethod=Unknown -ContentBrowserFileDataSource.TimeStamp=2024.09.06-17.48.03 -ContentBrowserFileDataSource.LastCompileMethod=Unknown -PortableObjectFileDataSource.TimeStamp=2024.09.06-17.48.03 -PortableObjectFileDataSource.LastCompileMethod=Unknown -BaseCharacterFXEditor.TimeStamp=2024.09.06-17.49.03 -BaseCharacterFXEditor.LastCompileMethod=Unknown -ContentBrowserClassDataSource.TimeStamp=2024.09.06-17.48.03 -ContentBrowserClassDataSource.LastCompileMethod=Unknown -Bridge.TimeStamp=2024.09.06-18.05.53 -Bridge.LastCompileMethod=Unknown -MegascansPlugin.TimeStamp=2024.09.06-18.05.55 -MegascansPlugin.LastCompileMethod=Unknown -CmdLinkServer.TimeStamp=2024.09.06-17.47.57 -CmdLinkServer.LastCompileMethod=Unknown -AudioSynesthesiaEditor.TimeStamp=2024.09.06-17.52.20 -AudioSynesthesiaEditor.LastCompileMethod=Unknown -TakesCore.TimeStamp=2024.09.06-17.53.52 -TakesCore.LastCompileMethod=Unknown -TakeTrackRecorders.TimeStamp=2024.09.06-17.53.52 -TakeTrackRecorders.LastCompileMethod=Unknown -TakeRecorderSources.TimeStamp=2024.09.06-17.53.52 -TakeRecorderSources.LastCompileMethod=Unknown -CacheTrackRecorder.TimeStamp=2024.09.06-17.53.52 -CacheTrackRecorder.LastCompileMethod=Unknown -ProfileVisualizer.TimeStamp=2024.09.06-17.40.54 -ProfileVisualizer.LastCompileMethod=Unknown -ProfilerService.TimeStamp=2024.09.06-17.40.54 -ProfilerService.LastCompileMethod=Unknown -ImageWriteQueue.TimeStamp=2024.09.06-17.40.50 -ImageWriteQueue.LastCompileMethod=Unknown -TypedElementFramework.TimeStamp=2024.09.06-17.40.59 -TypedElementFramework.LastCompileMethod=Unknown -TypedElementRuntime.TimeStamp=2024.09.06-17.40.59 -TypedElementRuntime.LastCompileMethod=Unknown -LevelInstanceEditor.TimeStamp=2024.09.06-17.40.52 -LevelInstanceEditor.LastCompileMethod=Unknown -AIModule.TimeStamp=2024.09.06-17.40.42 -AIModule.LastCompileMethod=Unknown -NavigationSystem.TimeStamp=2024.09.06-17.40.53 -NavigationSystem.LastCompileMethod=Unknown -AITestSuite.TimeStamp=2024.09.06-17.40.42 -AITestSuite.LastCompileMethod=Unknown -GameplayDebugger.TimeStamp=2024.09.06-17.40.49 -GameplayDebugger.LastCompileMethod=Unknown -MessagingRpc.TimeStamp=2024.09.06-17.40.52 -MessagingRpc.LastCompileMethod=Unknown -PortalRpc.TimeStamp=2024.09.06-17.40.54 -PortalRpc.LastCompileMethod=Unknown -PortalServices.TimeStamp=2024.09.06-17.40.54 -PortalServices.LastCompileMethod=Unknown -AnalyticsET.TimeStamp=2024.09.06-17.40.42 -AnalyticsET.LastCompileMethod=Unknown -LauncherPlatform.TimeStamp=2024.09.06-17.40.51 -LauncherPlatform.LastCompileMethod=Unknown -AudioMixerXAudio2.TimeStamp=2024.09.06-17.40.43 -AudioMixerXAudio2.LastCompileMethod=Unknown -AudioMixer.TimeStamp=2024.09.06-17.40.43 -AudioMixer.LastCompileMethod=Unknown -AudioMixerCore.TimeStamp=2024.09.06-17.40.43 -AudioMixerCore.LastCompileMethod=Unknown -OpusAudioDecoder.TimeStamp=2024.09.06-17.40.53 -OpusAudioDecoder.LastCompileMethod=Unknown -VorbisAudioDecoder.TimeStamp=2024.09.06-17.41.00 -VorbisAudioDecoder.LastCompileMethod=Unknown -AdpcmAudioDecoder.TimeStamp=2024.09.06-17.40.42 -AdpcmAudioDecoder.LastCompileMethod=Unknown -BinkAudioDecoder.TimeStamp=2024.09.06-17.40.43 -BinkAudioDecoder.LastCompileMethod=Unknown -RadAudioDecoder.TimeStamp=2024.09.06-17.40.55 -RadAudioDecoder.LastCompileMethod=Unknown -StreamingPauseRendering.TimeStamp=2024.09.06-17.40.58 -StreamingPauseRendering.LastCompileMethod=Unknown -MovieScene.TimeStamp=2024.09.06-17.40.52 -MovieScene.LastCompileMethod=Unknown -MovieSceneTracks.TimeStamp=2024.09.06-17.40.53 -MovieSceneTracks.LastCompileMethod=Unknown -CinematicCamera.TimeStamp=2024.09.06-17.40.44 -CinematicCamera.LastCompileMethod=Unknown -SparseVolumeTexture.TimeStamp=2024.09.06-17.40.58 -SparseVolumeTexture.LastCompileMethod=Unknown -Documentation.TimeStamp=2024.09.06-17.40.47 -Documentation.LastCompileMethod=Unknown -OutputLog.TimeStamp=2024.09.06-17.40.53 -OutputLog.LastCompileMethod=Unknown -SourceControlWindows.TimeStamp=2024.09.06-17.40.57 -SourceControlWindows.LastCompileMethod=Unknown -SourceControlWindowExtender.TimeStamp=2024.09.06-17.40.57 -SourceControlWindowExtender.LastCompileMethod=Unknown -UncontrolledChangelists.TimeStamp=2024.09.06-17.40.59 -UncontrolledChangelists.LastCompileMethod=Unknown -ClassViewer.TimeStamp=2024.09.06-17.40.44 -ClassViewer.LastCompileMethod=Unknown -StructViewer.TimeStamp=2024.09.06-17.40.58 -StructViewer.LastCompileMethod=Unknown -GraphEditor.TimeStamp=2024.09.06-17.40.50 -GraphEditor.LastCompileMethod=Unknown -Kismet.TimeStamp=2024.09.06-17.40.51 -Kismet.LastCompileMethod=Unknown -KismetWidgets.TimeStamp=2024.09.06-17.40.51 -KismetWidgets.LastCompileMethod=Unknown -Persona.TimeStamp=2024.09.06-17.40.54 -Persona.LastCompileMethod=Unknown -AdvancedPreviewScene.TimeStamp=2024.09.06-17.40.42 -AdvancedPreviewScene.LastCompileMethod=Unknown -AnimationBlueprintEditor.TimeStamp=2024.09.06-17.40.42 -AnimationBlueprintEditor.LastCompileMethod=Unknown -PackagesDialog.TimeStamp=2024.09.06-17.40.53 -PackagesDialog.LastCompileMethod=Unknown -DetailCustomizations.TimeStamp=2024.09.06-17.40.46 -DetailCustomizations.LastCompileMethod=Unknown -ComponentVisualizers.TimeStamp=2024.09.06-17.40.44 -ComponentVisualizers.LastCompileMethod=Unknown -Layers.TimeStamp=2024.09.06-17.40.51 -Layers.LastCompileMethod=Unknown -AutomationWindow.TimeStamp=2024.09.06-17.40.43 -AutomationWindow.LastCompileMethod=Unknown -AutomationController.TimeStamp=2024.09.06-17.40.43 -AutomationController.LastCompileMethod=Unknown -DeviceManager.TimeStamp=2024.09.06-17.40.46 -DeviceManager.LastCompileMethod=Unknown -ProfilerClient.TimeStamp=2024.09.06-17.40.54 -ProfilerClient.LastCompileMethod=Unknown -SessionFrontend.TimeStamp=2024.09.06-17.40.56 -SessionFrontend.LastCompileMethod=Unknown -ProjectLauncher.TimeStamp=2024.09.06-17.40.54 -ProjectLauncher.LastCompileMethod=Unknown -SettingsEditor.TimeStamp=2024.09.06-17.40.56 -SettingsEditor.LastCompileMethod=Unknown -EditorSettingsViewer.TimeStamp=2024.09.06-17.40.47 -EditorSettingsViewer.LastCompileMethod=Unknown -InternationalizationSettings.TimeStamp=2024.09.06-17.40.50 -InternationalizationSettings.LastCompileMethod=Unknown -ProjectSettingsViewer.TimeStamp=2024.09.06-17.40.54 -ProjectSettingsViewer.LastCompileMethod=Unknown -ProjectTargetPlatformEditor.TimeStamp=2024.09.06-17.40.54 -ProjectTargetPlatformEditor.LastCompileMethod=Unknown -Blutility.TimeStamp=2024.09.06-17.40.43 -Blutility.LastCompileMethod=Unknown -XmlParser.TimeStamp=2024.09.06-17.41.01 -XmlParser.LastCompileMethod=Unknown -UndoHistory.TimeStamp=2024.09.06-17.40.59 -UndoHistory.LastCompileMethod=Unknown -DeviceProfileEditor.TimeStamp=2024.09.06-17.40.47 -DeviceProfileEditor.LastCompileMethod=Unknown -HardwareTargeting.TimeStamp=2024.09.06-17.40.50 -HardwareTargeting.LastCompileMethod=Unknown -LocalizationDashboard.TimeStamp=2024.09.06-17.40.52 -LocalizationDashboard.LastCompileMethod=Unknown -LocalizationService.TimeStamp=2024.09.06-17.40.52 -LocalizationService.LastCompileMethod=Unknown -MergeActors.TimeStamp=2024.09.06-17.40.52 -MergeActors.LastCompileMethod=Unknown -InputBindingEditor.TimeStamp=2024.09.06-17.40.50 -InputBindingEditor.LastCompileMethod=Unknown -EditorInteractiveToolsFramework.TimeStamp=2024.09.06-17.40.47 -EditorInteractiveToolsFramework.LastCompileMethod=Unknown -InteractiveToolsFramework.TimeStamp=2024.09.06-17.40.50 -InteractiveToolsFramework.LastCompileMethod=Unknown -TraceInsights.TimeStamp=2024.09.06-17.40.59 -TraceInsights.LastCompileMethod=Unknown -TraceServices.TimeStamp=2024.09.06-17.40.59 -TraceServices.LastCompileMethod=Unknown -TraceAnalysis.TimeStamp=2024.09.06-17.40.58 -TraceAnalysis.LastCompileMethod=Unknown -StaticMeshEditor.TimeStamp=2024.09.06-17.40.58 -StaticMeshEditor.LastCompileMethod=Unknown -EditorFramework.TimeStamp=2024.09.06-17.40.47 -EditorFramework.LastCompileMethod=Unknown -EditorConfig.TimeStamp=2024.09.06-17.40.47 -EditorConfig.LastCompileMethod=Unknown -DerivedDataEditor.TimeStamp=2024.09.06-17.40.46 -DerivedDataEditor.LastCompileMethod=Unknown -CSVtoSVG.TimeStamp=2024.09.06-17.40.45 -CSVtoSVG.LastCompileMethod=Unknown -VirtualizationEditor.TimeStamp=2024.09.06-17.41.00 -VirtualizationEditor.LastCompileMethod=Unknown -AnimationSettings.TimeStamp=2024.09.06-17.40.42 -AnimationSettings.LastCompileMethod=Unknown -GameplayDebuggerEditor.TimeStamp=2024.09.06-17.40.49 -GameplayDebuggerEditor.LastCompileMethod=Unknown -RenderResourceViewer.TimeStamp=2024.09.06-17.40.56 -RenderResourceViewer.LastCompileMethod=Unknown -UniversalObjectLocatorEditor.TimeStamp=2024.09.06-17.40.59 -UniversalObjectLocatorEditor.LastCompileMethod=Unknown -AndroidRuntimeSettings.TimeStamp=2024.09.06-17.40.08 -AndroidRuntimeSettings.LastCompileMethod=Unknown -IOSRuntimeSettings.TimeStamp=2024.09.06-17.40.17 -IOSRuntimeSettings.LastCompileMethod=Unknown -MacPlatformEditor.TimeStamp=2024.09.06-17.40.52 -MacPlatformEditor.LastCompileMethod=Unknown -WindowsPlatformEditor.TimeStamp=2024.09.06-17.41.01 -WindowsPlatformEditor.LastCompileMethod=Unknown -AndroidPlatformEditor.TimeStamp=2024.09.06-17.40.08 -AndroidPlatformEditor.LastCompileMethod=Unknown -AndroidDeviceDetection.TimeStamp=2024.09.06-17.40.08 -AndroidDeviceDetection.LastCompileMethod=Unknown -PIEPreviewDeviceProfileSelector.TimeStamp=2024.09.06-17.40.54 -PIEPreviewDeviceProfileSelector.LastCompileMethod=Unknown -IOSPlatformEditor.TimeStamp=2024.09.06-17.40.17 -IOSPlatformEditor.LastCompileMethod=Unknown -LogVisualizer.TimeStamp=2024.09.06-17.40.52 -LogVisualizer.LastCompileMethod=Unknown -WidgetRegistration.TimeStamp=2024.09.06-17.41.01 -WidgetRegistration.LastCompileMethod=Unknown -ClothPainter.TimeStamp=2024.09.06-17.40.44 -ClothPainter.LastCompileMethod=Unknown -SkeletalMeshEditor.TimeStamp=2024.09.06-17.40.57 -SkeletalMeshEditor.LastCompileMethod=Unknown -ViewportInteraction.TimeStamp=2024.09.06-17.41.00 -ViewportInteraction.LastCompileMethod=Unknown -EditorWidgets.TimeStamp=2024.09.06-17.40.47 -EditorWidgets.LastCompileMethod=Unknown -ViewportSnapping.TimeStamp=2024.09.06-17.41.00 -ViewportSnapping.LastCompileMethod=Unknown -MeshPaint.TimeStamp=2024.09.06-17.40.52 -MeshPaint.LastCompileMethod=Unknown -PlacementMode.TimeStamp=2024.09.06-17.40.54 -PlacementMode.LastCompileMethod=Unknown -SessionServices.TimeStamp=2024.09.06-17.40.56 -SessionServices.LastCompileMethod=Unknown -AvfMediaEditor.TimeStamp=2024.09.06-17.51.49 -AvfMediaEditor.LastCompileMethod=Unknown -AvfMediaFactory.TimeStamp=2024.09.06-17.51.49 -AvfMediaFactory.LastCompileMethod=Unknown -AndroidMediaEditor.TimeStamp=2024.09.06-17.51.48 -AndroidMediaEditor.LastCompileMethod=Unknown -AndroidMediaFactory.TimeStamp=2024.09.06-17.51.48 -AndroidMediaFactory.LastCompileMethod=Unknown -ImgMediaEditor.TimeStamp=2024.09.06-17.51.50 -ImgMediaEditor.LastCompileMethod=Unknown -ImgMediaFactory.TimeStamp=2024.09.06-17.51.50 -ImgMediaFactory.LastCompileMethod=Unknown -OpenExrWrapper.TimeStamp=2024.09.06-17.51.50 -OpenExrWrapper.LastCompileMethod=Unknown -MediaCompositingEditor.TimeStamp=2024.09.06-17.51.50 -MediaCompositingEditor.LastCompileMethod=Unknown -SequenceRecorder.TimeStamp=2024.09.06-17.40.56 -SequenceRecorder.LastCompileMethod=Unknown -MediaPlayerEditor.TimeStamp=2024.09.06-17.51.51 -MediaPlayerEditor.LastCompileMethod=Unknown -WebMMedia.TimeStamp=2024.09.06-17.51.52 -WebMMedia.LastCompileMethod=Unknown -WebMMediaEditor.TimeStamp=2024.09.06-17.51.52 -WebMMediaEditor.LastCompileMethod=Unknown -WebMMediaFactory.TimeStamp=2024.09.06-17.51.52 -WebMMediaFactory.LastCompileMethod=Unknown -WmfMediaEditor.TimeStamp=2024.09.06-17.51.52 -WmfMediaEditor.LastCompileMethod=Unknown -WmfMediaFactory.TimeStamp=2024.09.06-17.51.52 -WmfMediaFactory.LastCompileMethod=Unknown -ControlRigEditor.TimeStamp=2024.09.06-17.47.49 -ControlRigEditor.LastCompileMethod=Unknown -IKRigEditor.TimeStamp=2024.09.06-17.47.52 -IKRigEditor.LastCompileMethod=Unknown -CharacterAI.TimeStamp=2024.09.06-17.49.03 -CharacterAI.LastCompileMethod=Unknown -FractureEngine.TimeStamp=2024.09.06-17.49.06 -FractureEngine.LastCompileMethod=Unknown -PlanarCut.TimeStamp=2024.09.06-17.50.09 -PlanarCut.LastCompileMethod=Unknown -AudioCaptureEditor.TimeStamp=2024.09.06-17.52.19 -AudioCaptureEditor.LastCompileMethod=Unknown -AndroidFileServerEditor.TimeStamp=2024.09.06-17.52.16 -AndroidFileServerEditor.LastCompileMethod=Unknown -GooglePADEditor.TimeStamp=2024.09.06-17.52.37 -GooglePADEditor.LastCompileMethod=Unknown -RigVMEditor.TimeStamp=2024.09.06-17.53.33 -RigVMEditor.LastCompileMethod=Unknown -ResonanceAudioEditor.TimeStamp=2024.09.06-17.53.32 -ResonanceAudioEditor.LastCompileMethod=Unknown -WaveTableEditor.TimeStamp=2024.09.06-17.53.39 -WaveTableEditor.LastCompileMethod=Unknown -LevelSequenceEditor.TimeStamp=2024.09.06-17.51.54 -LevelSequenceEditor.LastCompileMethod=Unknown -TemplateSequenceEditor.TimeStamp=2024.09.06-17.51.55 -TemplateSequenceEditor.LastCompileMethod=Unknown -ActorSequenceEditor.TimeStamp=2024.09.06-17.51.54 -ActorSequenceEditor.LastCompileMethod=Unknown -CameraShakePreviewer.TimeStamp=2024.09.06-17.47.54 -CameraShakePreviewer.LastCompileMethod=Unknown -SmartSnapping.TimeStamp=2024.09.06-17.47.48 -SmartSnapping.LastCompileMethod=Unknown -GameplayCamerasEditor.TimeStamp=2024.09.06-17.47.54 -GameplayCamerasEditor.LastCompileMethod=Unknown -EngineAssetDefinitions.TimeStamp=2024.09.06-17.48.03 -EngineAssetDefinitions.LastCompileMethod=Unknown -GeometryMode.TimeStamp=2024.09.06-17.48.03 -GeometryMode.LastCompileMethod=Unknown -BspMode.TimeStamp=2024.09.06-17.48.03 -BspMode.LastCompileMethod=Unknown -TextureAlignMode.TimeStamp=2024.09.06-17.48.03 -TextureAlignMode.LastCompileMethod=Unknown -ActorPickerMode.TimeStamp=2024.09.06-17.40.41 -ActorPickerMode.LastCompileMethod=Unknown -SceneDepthPickerMode.TimeStamp=2024.09.06-17.40.56 -SceneDepthPickerMode.LastCompileMethod=Unknown -LandscapeEditor.TimeStamp=2024.09.06-17.40.51 -LandscapeEditor.LastCompileMethod=Unknown -FoliageEdit.TimeStamp=2024.09.06-17.40.49 -FoliageEdit.LastCompileMethod=Unknown -VirtualTexturingEditor.TimeStamp=2024.09.06-17.41.00 -VirtualTexturingEditor.LastCompileMethod=Unknown -AutomationWorker.TimeStamp=2024.09.06-17.40.43 -AutomationWorker.LastCompileMethod=Unknown -SequenceRecorderSections.TimeStamp=2024.09.06-17.40.56 -SequenceRecorderSections.LastCompileMethod=Unknown -AddContentDialog.TimeStamp=2024.09.06-17.40.42 -AddContentDialog.LastCompileMethod=Unknown -WidgetCarousel.TimeStamp=2024.09.06-17.41.01 -WidgetCarousel.LastCompileMethod=Unknown -StatsViewer.TimeStamp=2024.09.06-17.40.58 -StatsViewer.LastCompileMethod=Unknown -DataLayerEditor.TimeStamp=2024.09.06-17.40.46 -DataLayerEditor.LastCompileMethod=Unknown -AndroidDeviceProfileSelector.TimeStamp=2024.09.06-17.52.16 -AndroidDeviceProfileSelector.LastCompileMethod=Unknown -GameProjectGeneration.TimeStamp=2024.09.06-17.40.49 -GameProjectGeneration.LastCompileMethod=Unknown -UnsavedAssetsTracker.TimeStamp=2024.09.06-17.41.00 -UnsavedAssetsTracker.LastCompileMethod=Unknown -StatusBar.TimeStamp=2024.09.06-17.40.58 -StatusBar.LastCompileMethod=Unknown -SceneOutliner.TimeStamp=2024.09.06-17.40.56 -SceneOutliner.LastCompileMethod=Unknown -SubobjectEditor.TimeStamp=2024.09.06-17.40.58 -SubobjectEditor.LastCompileMethod=Unknown -HierarchicalLODOutliner.TimeStamp=2024.09.06-17.40.50 -HierarchicalLODOutliner.LastCompileMethod=Unknown -HierarchicalLODUtilities.TimeStamp=2024.09.06-17.40.50 -HierarchicalLODUtilities.LastCompileMethod=Unknown -NewLevelDialog.TimeStamp=2024.09.06-17.40.53 -NewLevelDialog.LastCompileMethod=Unknown -ExternalImagePicker.TimeStamp=2024.09.06-17.40.49 -ExternalImagePicker.LastCompileMethod=Unknown -Voice.TimeStamp=2024.09.06-17.41.00 -Voice.LastCompileMethod=Unknown -MovieSceneCapture.TimeStamp=2024.09.06-17.40.52 -MovieSceneCapture.LastCompileMethod=Unknown -newton.TimeStamp=2024.10.16-22.59.55 -newton.LastCompileMethod=Unknown - -[AssetEditorSubsystem] -CleanShutdown=True -DebuggerAttached=True -RecentAssetEditors=BlueprintEditor -RecentAssetEditors=BlueprintEditor - -[DetailCategories] -LandscapeStreamingProxy.TransformCommon=True -LandscapeStreamingProxy.Information=True -LandscapeStreamingProxy.LandscapeProxy=True -LandscapeStreamingProxy.Landscape=True -LandscapeStreamingProxy.Nanite=True -LandscapeStreamingProxy.LOD=True -LandscapeStreamingProxy.LOD Distribution=True -LandscapeStreamingProxy.Lighting=True -LandscapeStreamingProxy.VirtualTexture=True -LandscapeStreamingProxy.Rendering=True -LandscapeStreamingProxy.Lightmass=True -LandscapeStreamingProxy.Collision=True -LandscapeStreamingProxy.Navigation=True -LandscapeStreamingProxy.HLOD=True -LandscapeStreamingProxy.Replication=True -LandscapeStreamingProxy.Networking=True -LandscapeStreamingProxy.Input=True -LandscapeStreamingProxy.Actor=True -StaticMeshActor.TransformCommon=True -StaticMeshActor.StaticMesh=True -StaticMeshActor.Materials=True -StaticMeshActor.Physics=True -StaticMeshActor.Collision=True -StaticMeshActor.Lighting=True -StaticMeshActor.Rendering=True -StaticMeshActor.HLOD=True -StaticMeshActor.Navigation=True -StaticMeshActor.VirtualTexture=True -StaticMeshActor.Tags=True -StaticMeshActor.Cooking=True -StaticMeshActor.Replication=True -StaticMeshActor.Networking=True -StaticMeshActor.Actor=True -GeneralProjectSettings.About=True -GeneralProjectSettings.Publisher=True -GeneralProjectSettings.Legal=True -GeneralProjectSettings.Displayed=True -GeneralProjectSettings.Settings=True -CryptoKeysSettings.Encryption=True -CryptoKeysSettings.Signing=True -GameplayTagsSettings.GameplayTags=True -GameplayTagsSettings.Advanced Gameplay Tags=True -GameplayTagsSettings.Advanced Replication=True -GameMapsSettings.DefaultModes=True -GameMapsSettings.DefaultMaps=True -GameMapsSettings.LocalMultiplayer=True -GameMapsSettings.GameInstance=True -MoviePlayerSettings.Movies=True -ProjectPackagingSettings.Packaging=True -ProjectPackagingSettings.Project=True -ProjectPackagingSettings.Prerequisites=True -HardwareTargetingSettings.Target Hardware=True -HardwareTargetingSettings.Pending Changes=True -AssetManagerSettings.Asset Manager=True -AssetManagerSettings.Redirects=True -AssetToolsSettings.Advanced Copy=True -SlateRHIRendererSettings.PostProcessing=True -AISystem.AISystem=True -AISystem.Movement=True -AISystem.EQS=True -AISystem.Blackboard=True -AISystem.Behavior Tree=True -AISystem.PerceptionSystem=True -AnimationSettings.Compression=True -AnimationSettings.Performance=True -AnimationSettings.AnimationAttributes=True -AnimationSettings.Mirroring=True -AnimationSettings.AnimationData=True -AnimationModifierSettings.Modifiers=True -AudioSettings.Dialogue=True -AudioSettings.Audio=True -AudioSettings.Mix=True -AudioSettings.Quality=True -AudioSettings.Debug=True -ChaosSolverSettings.GameInstance=True -CineCameraSettings.Lens=True -CineCameraSettings.Filmback=True -CineCameraSettings.Crop=True -CollisionProfile.Object Channels=True -CollisionProfile.Trace Channels=True -ConsoleSettings.General=True -ConsoleSettings.AutoComplete=True -ConsoleSettings.Colors=True -ControlRigSettings.Shapes=True -ControlRigSettings.ModularRigging=True -CookerSettings.Cooker=True -CookerSettings.Textures=True -CookerSettings.Editor=True -CrowdManager.Config=True -DataDrivenConsoleVariableSettings.DataDrivenCVar=True -DebugCameraControllerSettings.General=True -EnhancedInputDeveloperSettings.Enhanced Input=True -InputModifierSmoothDelta.Settings=True -InputModifierDeadZone.Settings=True -InputModifierResponseCurveExponential.Settings=True -InputModifierFOVScaling.Settings=True -EnhancedInputDeveloperSettings.Modifier Default Values=True -InputTriggerDown.Trigger Settings=True -InputTriggerPressed.Trigger Settings=True -InputTriggerReleased.Trigger Settings=True -InputTriggerHold.Trigger Settings=True -InputTriggerHoldAndRelease.Trigger Settings=True -InputTriggerTap.Trigger Settings=True -InputTriggerPulse.Trigger Settings=True -EnhancedInputDeveloperSettings.Trigger Default Values=True -EnhancedInputEditorProjectSettings.Default=True -GameplayDebuggerConfig.Input=True -GameplayDebuggerConfig.Display=True -GameplayDebuggerConfig.AddOns=True -GarbageCollectionSettings.General=True -GarbageCollectionSettings.Optimization=True -GarbageCollectionSettings.Debug=True -Engine.Fonts=True -Engine.DefaultClasses=True -Engine.DefaultMaterials=True -Engine.Settings=True -Engine.Subtitles=True -Engine.Blueprints=True -Engine.Anim Blueprints=True -Engine.Framerate=True -Engine.Timecode=True -Engine.Screenshots=True -HierarchicalLODSettings.HLODSystem=True -InputSettings.Bindings=True -InputSettings.Platforms=True -InputSettings.ViewportProperties=True -InputSettings.Input=True -InputSettings.Mobile=True -InputSettings.Virtual Keyboard (Mobile)=True -InputSettings.DefaultClasses=True -InputSettings.Console=True -InterchangeProjectSettings.ImportContent=True -InterchangeProjectSettings.ImportIntoLevel=True -InterchangeProjectSettings.EditorInterface=True -InterchangeProjectSettings.Generic=True -InterchangeProjectSettings.Editor Generic Pipeline Class=True -GLTFPipelineSettings.PredefinedglTFMaterialLibrary=True -MaterialXPipelineSettings.MaterialXPredefined . Surface Shaders=True -MaterialXPipelineSettings.MaterialXPredefined . BSDF=True -MaterialXPipelineSettings.MaterialXPredefined . EDF=True -MaterialXPipelineSettings.MaterialXPredefined . VDF=True -LandscapeSettings.Layers=True -LandscapeSettings.Configuration=True -LandscapeSettings.Materials=True -LandscapeSettings.HLOD=True -LevelSequenceProjectSettings.Timeline=True -MeshBudgetProjectSettings.StaticMesh=True -MeshDrawCommandStatsSettings.Engine=True -MetaSoundSettings.AutoUpdate=True -MetaSoundSettings.Registration=True -MetaSoundSettings.Quality=True -RecastNavMesh.Display=True -RecastNavMesh.Generation=True -RecastNavMesh.Query=True -RecastNavMesh.Runtime=True -RecastNavMesh.Tick=True -RecastNavMesh.Collision=True -RecastNavMesh.HLOD=True -RecastNavMesh.Physics=True -RecastNavMesh.Networking=True -NavigationSystemV1.Navigation=True -NavigationSystemV1.NavigationSystem=True -NavigationSystemV1.Navigation Enforcing=True -NavigationSystemV1.Agents=True -NetworkSettings.libcurl=True -NetworkSettings.World=True -PhysicsSettings.Replication=True -PhysicsSettings.Simulation=True -PhysicsSettings.Optimization=True -PhysicsSettings.Framerate=True -PhysicsSettings.Broadphase=True -PhysicsSettings.ChaosPhysics=True -PhysicsSettings.Constants=True -PhysicsSettings.Physical Surface=True -RendererSettings.Mobile=True -RendererSettings.Materials=True -RendererSettings.Culling=True -RendererSettings.Textures=True -RendererSettings.VirtualTextures=True -RendererSettings.WorkingColorSpace=True -RendererSettings.GlobalIllumination=True -RendererSettings.Reflections=True -RendererSettings.Lumen=True -RendererSettings.Shadows=True -RendererSettings.HardwareRayTracing=True -RendererSettings.SoftwareRayTracing=True -RendererSettings.Nanite=True -RendererSettings.MiscLighting=True -RendererSettings.ForwardRenderer=True -RendererSettings.Translucency=True -RendererSettings.VR=True -RendererSettings.Postprocessing=True -RendererSettings.DefaultSettings=True -RendererSettings.DefaultScreenPercentage=True -RendererSettings.Optimizations=True -RendererSettings.LightFunctionAtlas=True -RendererSettings.Debugging=True -RendererSettings.Mesh Streaming=True -RendererSettings.Heterogeneous Volumes=True -RendererSettings.Editor=True -RendererSettings.ShaderPermutationReduction=True -RendererSettings.Substrate=True -RendererSettings.HairStrands=True -RendererSettings.MobileShaderPermutationReduction=True -RendererSettings.Skinning=True -RendererSettings.PostProcessCalibrationMaterials=True -RendererOverrideSettings.ShaderPermutationReduction=True -SlateSettings.ConstraintCanvas=True -StreamingSettings.PackageStreaming=True -StreamingSettings.LevelStreaming=True -StreamingSettings.General=True -StreamingSettings.Deprecated Settings=True -TextureEncodingProjectSettings.EncodeSettings=True -TextureEncodingProjectSettings.EncodeSpeedSettings=True -TextureEncodingProjectSettings.EncodeSpeeds=True -UserInterfaceSettings.Focus=True -UserInterfaceSettings.Hardware Cursors=True -UserInterfaceSettings.Software Cursors=True -UserInterfaceSettings.DPI Scaling=True -UserInterfaceSettings.Widgets=True -UserInterfaceSettings.UMG Fonts=True -VirtualTexturePoolConfig.PoolConfig=True -WorldPartitionSettings.WorldPartition=True -LevelEditor2DSettings.General=True -LevelEditor2DSettings.LayerSnapping=True -EditorProjectAppearanceSettings.Units=True -EditorProjectAppearanceSettings.ReferenceViewer=True -EditorProjectAssetSettings.Redirectors=True -BlueprintEditorProjectSettings.Blueprints=True -BlueprintEditorProjectSettings.Actors=True -BlueprintEditorProjectSettings.Experimental=True -BlueprintEditorProjectSettings.Play=True -ClassViewerProjectSettings.ClassVisibilityManagement=True -DataValidationSettings.Data Validation=True -DDCProjectSettings.Warnings=True -EditorUtilityWidgetProjectSettings.Designer=True -EditorUtilityWidgetProjectSettings.Compiler=True -EditorUtilityWidgetProjectSettings.Class Filtering=True -EditorUtilityWidgetProjectSettings.Class Settings=True -ProxyLODMeshSimplificationSettings.General=True -LevelEditorProjectSettings.Editing=True -LevelInstanceEditorSettings.World Partition=True -MovieSceneToolsProjectSettings.Timeline=True -MovieSceneToolsProjectSettings.Shots=True -MovieSceneToolsProjectSettings.TrackSettings=True -MeshSimplificationSettings.General=True -PaperImporterSettings.NewAssetSettings=True -PaperImporterSettings.ImportSettings=True -PaperImporterSettings.MaterialSettings=True -EditorPerformanceProjectSettings.ViewportResolution=True -SourceControlPreferences.SourceControl=True -SkeletalMeshSimplificationSettings.General=True -PlasticSourceControlProjectSettings.Unity Version Control=True -StructViewerProjectSettings.StructVisibilityManagement=True -TextureImportSettings.VirtualTextures=True -TextureImportSettings.ImportSettings=True -UMGEditorProjectSettings.Compiler=True -UMGEditorProjectSettings.Class Filtering=True -UMGEditorProjectSettings.Designer=True -UMGEditorProjectSettings.Class Settings=True -AndroidRuntimeSettings.APK Packaging=True -AndroidRuntimeSettings.App Bundles=True -AndroidRuntimeSettings.Build=True -AndroidRuntimeSettings.Advanced APK Packaging=True -AndroidRuntimeSettings.DistributionSigning=True -AndroidRuntimeSettings.GooglePlayServices=True -AndroidRuntimeSettings.Icons=True -AndroidRuntimeSettings.LaunchImages=True -AndroidRuntimeSettings.GraphicsDebugger=True -AndroidRuntimeSettings.Input=True -AndroidRuntimeSettings.Audio=True -AndroidRuntimeSettings.MultiTextureFormats=True -AndroidRuntimeSettings.TextureFormatPriorities=True -AndroidRuntimeSettings.Misc=True -ShaderPlatformQualitySettings.Forward Rendering Overrides=True -AndroidSDKSettings.SDKConfig=True -IOSRuntimeSettings.Mobile Provision=True -IOSRuntimeSettings.BundleInformation=True -IOSRuntimeSettings.PowerUsage=True -IOSRuntimeSettings.Orientation=True -IOSRuntimeSettings.FileSystem=True -IOSRuntimeSettings.Input=True -IOSRuntimeSettings.Rendering=True -IOSRuntimeSettings.Build=True -IOSRuntimeSettings.Online=True -IOSRuntimeSettings.RequiredIOSIcons=True -IOSRuntimeSettings.OptionalIOSIcons=True -IOSRuntimeSettings.RequiredTVOSAssets=True -IOSRuntimeSettings.OptionalTVOSAssets=True -IOSRuntimeSettings.LaunchScreen=True -IOSRuntimeSettings.Remote Build=True -IOSRuntimeSettings.Audio=True -LinuxTargetSettings.Targeted RHIs=True -LinuxTargetSettings.Splash=True -LinuxTargetSettings.Icon=True -LinuxTargetSettings.Audio=True -MacTargetSettings.Targeted RHIs=True -MacTargetSettings.Rendering=True -MacTargetSettings.Packaging=True -MacTargetSettings.Splash=True -MacTargetSettings.Icon=True -MacTargetSettings.Audio=True -WindowsTargetSettings.D3D12 Targeted Shader Formats=True -WindowsTargetSettings.D3D11 Targeted Shader Formats=True -WindowsTargetSettings.Vulkan Targeted Shader Formats=True -WindowsTargetSettings.Targeted RHIs=True -WindowsTargetSettings.Toolchain=True -WindowsTargetSettings.Splash=True -WindowsTargetSettings.Icon=True -WindowsTargetSettings.Audio=True -XcodeProjectSettings.Xcode=True -XcodeProjectSettings.Plist Files=True -XcodeProjectSettings.Entitlements=True -XcodeProjectSettings.Code Signing=True -XcodeProjectSettings.Privacy Manifests=True -AndroidFileServerRuntimeSettings.Packaging=True -AndroidFileServerRuntimeSettings.Deployment=True -AndroidFileServerRuntimeSettings.Connection=True -AvfMediaSettings.Debug=True -DataflowSettings.PinColors=True -DataflowSettings.NodeColors=True -FractureModeSettings.Fracture Mode=True -GeometryCacheStreamerSettings.Geometry Cache Streamer=True -GooglePADRuntimeSettings.Packaging=True -ImgMediaSettings.General=True -ImgMediaSettings.Caching=True -ImgMediaSettings.EXR=True -ImgMediaSettings.Proxies=True -ToolPresetProjectSettings.Interactive Tool Presets=True -LevelSequenceEditorSettings.Tracks=True -LevelSequenceEditorSettings.Playback=True -ModelingToolsEditorModeSettings.Modeling Mode=True -ModelingComponentsSettings.Modeling Tools=True -NiagaraSettings.Niagara=True -NiagaraSettings.Viewport=True -NiagaraSettings.SimulationCaching=True -NiagaraSettings.Scalability=True -NiagaraSettings.Renderer=True -NiagaraSettings.LightRenderer=True -NiagaraSettings.SkeletalMeshDI=True -NiagaraSettings.StaticMeshDI=True -NiagaraSettings.AsyncGpuTraceDI=True -NiagaraSettings.SimCache=True -NiagaraEditorSettings.Niagara=True -NiagaraEditorSettings.SimulationOptions=True -NiagaraEditorSettings.Niagara Colors=True -PaperRuntimeSettings.Experimental=True -PaperRuntimeSettings.Settings=True -PythonScriptPluginSettings.Python=True -PythonScriptPluginSettings.PythonPipInstall=True -PythonScriptPluginSettings.PythonRemoteExecution=True -RenderDocPluginSettings.Frame Capture Settings=True -RenderDocPluginSettings.Advanced Settings=True -ResonanceAudioSettings.Reverb=True -ResonanceAudioSettings.General=True -TakeRecorderProjectSettings.Take Recorder=True -TakeRecorderProjectSettings.Movie Scene Take Settings=True -TakeRecorderProjectSettings.Microphone Audio Recorder=True -TakeRecorderProjectSettings.Audio Input Device=True -TakeRecorderProjectSettings.Animation Recorder=True -TakeRecorderProjectSettings.World Recorder=True -TcpMessagingSettings.Transport=True -UdpMessagingSettings.Availability=True -UdpMessagingSettings.Transport=True -UdpMessagingSettings.Tunnel=True -WmfMediaSettings.Media=True -WmfMediaSettings.Debug=True -NewtonWorldActor.Newton=True -NewtonWorldActor.Rendering=True -NewtonWorldActor.Replication=True -NewtonWorldActor.Collision=True -NewtonWorldActor.HLOD=True -NewtonWorldActor.Physics=True -NewtonWorldActor.Networking=True -NewtonWorldActor.Input=True -NewtonWorldActor.Actor=True -testSphere_C.Tick=True -testSphere_C.Replication=True -testSphere_C.Rendering=True -testSphere_C.Collision=True -testSphere_C.Actor=True -testSphere_C.Input=True -testSphere_C.HLOD=True -testSphere_C.Physics=True -testSphere_C.Events=True -SceneComponent.Variable=True -SceneComponent.TransformCommon=True -SceneComponent.Sockets=True -SceneComponent.Rendering=True -SceneComponent.ComponentTick=True -SceneComponent.Tags=True -SceneComponent.ComponentReplication=True -SceneComponent.Activation=True -SceneComponent.Cooking=True -SceneComponent.Events=True -NewtonRigidBody.Variable=True -NewtonRigidBody.TransformCommon=True -NewtonRigidBody.Sockets=True -NewtonRigidBody.Newton=True -NewtonRigidBody.Rendering=True -NewtonRigidBody.ComponentTick=True -NewtonRigidBody.Tags=True -NewtonRigidBody.ComponentReplication=True -NewtonRigidBody.Activation=True -NewtonRigidBody.Cooking=True -NewtonRigidBody.Events=True -StaticMeshComponent.Variable=True -StaticMeshComponent.TransformCommon=True -StaticMeshComponent.Sockets=True -StaticMeshComponent.StaticMesh=True -StaticMeshComponent.ComponentTick=True -StaticMeshComponent.Physics=True -StaticMeshComponent.Collision=True -StaticMeshComponent.HLOD=True -StaticMeshComponent.Lighting=True -StaticMeshComponent.Rendering=True -StaticMeshComponent.Navigation=True -StaticMeshComponent.VirtualTexture=True -StaticMeshComponent.Tags=True -StaticMeshComponent.ComponentReplication=True -StaticMeshComponent.Cooking=True -StaticMeshComponent.Events=True -StaticMeshComponent.Materials=True -NewtonCollisionSphere.Variable=True -NewtonCollisionSphere.TransformCommon=True -NewtonCollisionSphere.Sockets=True -NewtonCollisionSphere.Newton=True -NewtonCollisionSphere.Events=True -testSphere_C.TransformCommon=True -testSphere_C.Networking=True -PlayerStart.TransformCommon=True -PlayerStart.Object=True -PlayerStart.Rendering=True -PlayerStart.Replication=True -PlayerStart.HLOD=True -PlayerStart.Physics=True -PlayerStart.Networking=True -PlayerStart.Input=True -PlayerStart.Actor=True -testBox_C.Tick=True -testBox_C.Replication=True -testBox_C.Rendering=True -testBox_C.Collision=True -testBox_C.Actor=True -testBox_C.Input=True -testBox_C.HLOD=True -testBox_C.Physics=True -testBox_C.Events=True -NewtonCollisionBox.Variable=True -NewtonCollisionBox.TransformCommon=True -NewtonCollisionBox.Sockets=True -NewtonCollisionBox.Newton=True -NewtonCollisionBox.Events=True -testBox_C.TransformCommon=True -testBox_C.Networking=True - -[ContentBrowser] -AssetDialog.ThumbnailSize=2 -AssetDialog.CurrentViewType=1 -AssetPropertyPicker.ThumbnailSize=2 -AssetPropertyPicker.CurrentViewType=0 -ContentBrowserTab1.SourcesExpanded=True -ContentBrowserTab1.FavoritesAreaExpanded=False -ContentBrowserTab1.PathAreaExpanded=True -ContentBrowserTab1.CollectionAreaExpanded=False -ContentBrowserTab1.FavoritesSearchAreaExpanded=False -ContentBrowserTab1.PathSearchAreaExpanded=False -ContentBrowserTab1.CollectionSearchAreaExpanded=False -ContentBrowserTab1.VerticalSplitter.SlotSize0=0.150000006 -ContentBrowserTab1.VerticalSplitter.SlotSize1=0.75 -ContentBrowserTab1.FavoriteSplitter.SlotSize0=0.200000003 -ContentBrowserTab1.FavoriteSplitter.SlotSize1=0.800000012 -ContentBrowserTab1.FavoriteSplitter.SlotSize2=0.400000006 -ContentBrowserTab1.SelectedPaths=/Game/StarterContent/HDRI -ContentBrowserTab1.PluginFilters= -ContentBrowserTab1.Favorites.SelectedPaths= -FavoritePaths= -ContentBrowserTab1.SelectedCollections= -ContentBrowserTab1.ExpandedCollections= -ContentBrowserTab1.ThumbnailSize=2 -ContentBrowserTab1.CurrentViewType=1 -ContentBrowserTab1.JumpMRU=/All/Game/StarterContent/HDRI -ContentBrowserDrawer.SourcesExpanded=True -ContentBrowserDrawer.FavoritesAreaExpanded=False -ContentBrowserDrawer.PathAreaExpanded=True -ContentBrowserDrawer.CollectionAreaExpanded=False -ContentBrowserDrawer.FavoritesSearchAreaExpanded=False -ContentBrowserDrawer.PathSearchAreaExpanded=False -ContentBrowserDrawer.CollectionSearchAreaExpanded=False -ContentBrowserDrawer.VerticalSplitter.SlotSize0=0.150000006 -ContentBrowserDrawer.VerticalSplitter.SlotSize1=0.75 -ContentBrowserDrawer.FavoriteSplitter.SlotSize0=0.200000003 -ContentBrowserDrawer.FavoriteSplitter.SlotSize1=0.800000012 -ContentBrowserDrawer.FavoriteSplitter.SlotSize2=0.400000006 -ContentBrowserDrawer.SelectedPaths=/Game/blueprints -ContentBrowserDrawer.PluginFilters= -ContentBrowserDrawer.Favorites.SelectedPaths= -ContentBrowserDrawer.SelectedCollections= -ContentBrowserDrawer.ExpandedCollections= -ContentBrowserDrawer.ThumbnailSize=2 -ContentBrowserDrawer.CurrentViewType=1 -ContentBrowserDrawer.JumpMRU=/All/Game/blueprints -ContentBrowserDrawer.JumpMRU=/All/Game - -[/Script/Engine.WorldPartitionEditorPerProjectUserSettings] -bHideEditorDataLayers=False -bHideRuntimeDataLayers=False -bHideDataLayerActors=True -bHideUnloadedActors=False -bShowOnlySelectedActors=False -bHighlightSelectedDataLayers=True -bHideLevelInstanceContent=True -bDisableLoadingOfLastLoadedRegions=False -bBugItGoLoadRegion=False -bShowCellCoords=False -MinimapUnloadedOpacity=0.660000 -PerWorldEditorSettings=(("/Game/level_03_landscape.level_03_landscape", (LoadedEditorRegions=((Min=(X=-102480.867188,Y=-102536.195312,Z=-2097152.000000),Max=(X=102491.187500,Y=102276.851562,Z=2097152.000000),IsValid=True),(Min=(X=-102480.867188,Y=-102536.195312,Z=-2097152.000000),Max=(X=102491.187500,Y=102276.851562,Z=2097152.000000),IsValid=True))))) - -[DetailMultiObjectNodeExpansion] -GeneralProjectSettings=True -GameMapsSettings=True - -[RootWindow] -ScreenPosition=X=320.000 Y=160.000 -WindowSize=X=1280.000 Y=720.000 -InitiallyMaximized=True - -[SlateAdditionalLayoutConfig] -Viewport 1.LayoutType=FourPanes2x2 -FourPanes2x2.Viewport 1.Percentages0=X=0.500 Y=0.500 -FourPanes2x2.Viewport 1.Percentages1=X=0.500 Y=0.500 -FourPanes2x2.Viewport 1.Percentages2=X=0.500 Y=0.500 -FourPanes2x2.Viewport 1.Percentages3=X=0.500 Y=0.500 -FourPanes2x2.Viewport 1.Viewport0.TypeWithinLayout=Default -FourPanes2x2.Viewport 1.Viewport1.TypeWithinLayout=Default -FourPanes2x2.Viewport 1.Viewport2.TypeWithinLayout=Default -FourPanes2x2.Viewport 1.Viewport3.TypeWithinLayout=Default -FourPanes2x2.Viewport 1.bIsMaximized=True -FourPanes2x2.Viewport 1.MaximizedViewport=FourPanes2x2.Viewport 1.Viewport1 - -[Directories2] -UNR=../../../../../../Development/newton-dynamics/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Content -BRUSH=../../../../../../unrealProjectVideos/UnrealNewtonProject1/Content/ -FBX=../../../../../../unrealProjectVideos/UnrealNewtonProject1/Content/ -FBXAnim=../../../../../../unrealProjectVideos/UnrealNewtonProject1/Content/ -GenericImport=../../../../../../unrealProjectVideos/UnrealNewtonProject1/Content/ -GenericExport=../../../../../../unrealProjectVideos/UnrealNewtonProject1/Content/ -GenericOpen=../../../../../../unrealProjectVideos/UnrealNewtonProject1/Content/ -GenericSave=../../../../../../unrealProjectVideos/UnrealNewtonProject1/Content/ -MeshImportExport=../../../../../../unrealProjectVideos/UnrealNewtonProject1/Content/ -WorldRoot=../../../../../../unrealProjectVideos/UnrealNewtonProject1/Content/ -Level=../../../../../../unrealProjectVideos/UnrealNewtonProject1/Content -Project=C:/Program Files/Epic Games/UE_5.4/ - -[Python] -LastDirectory= -RecentsFiles=C:/Program Files/Epic Games/UE_5.4/Engine/Plugins/Animation/ControlRig/Content/Python/init_unreal.py - -[PluginBrowser] -InstalledPlugins=WMFCodecs -InstalledPlugins=newton - -[PlacementMode] -RecentlyPlaced=/Game/blueprints/testBox.testBox; -RecentlyPlaced=/Game/blueprints/testSphere.testSphere; -RecentlyPlaced=/Script/newton.NewtonWorldActor; - -[AssetEditorSubsystemRecents] -MRUItem0=/Game/blueprints/testBox -MRUItem1=/Game/blueprints/testSphere - -[/Script/BlueprintGraph.BlueprintEditorSettings] -bDrawMidpointArrowsInBlueprints=False -bShowGraphInstructionText=True -bHideUnrelatedNodes=False -bShowShortTooltips=True -bEnableInputTriggerSupportWarnings=False -bSplitContextTargetSettings=True -bExposeAllMemberComponentFunctions=True -bShowContextualFavorites=False -bExposeDeprecatedFunctions=False -bCompactCallOnMemberNodes=False -bFlattenFavoritesMenus=True -bAutoCastObjectConnections=False -bShowViewportOnSimulate=False -bSpawnDefaultBlueprintNodes=True -bHideConstructionScriptComponentsInDetailsView=True -bHostFindInBlueprintsInGlobalTab=True -bNavigateToNativeFunctionsFromCallNodes=True -bDoubleClickNavigatesToParent=True -bEnableTypePromotion=True -TypePromotionPinDenyList=string -TypePromotionPinDenyList=text -BreakpointReloadMethod=RestoreAll -bEnablePinValueInspectionTooltips=True -bEnableNamespaceEditorFeatures=True -bEnableContextMenuTimeSlicing=True -ContextMenuTimeSlicingThresholdMs=50 -bIncludeActionsForSelectedAssetsInContextMenu=False -bLimitAssetActionBindingToSingleSelectionOnly=False -bLoadSelectedAssetsForContextMenuActionBinding=True -bDoNotMarkAllInstancesDirtyOnDefaultValueChange=True -bFavorPureCastNodes=False -SaveOnCompile=SoC_Never -bJumpToNodeErrors=False -bAllowExplicitImpureNodeDisabling=False -bShowActionMenuItemSignatures=False -bBlueprintNodeUniqueNames=False -NodeTemplateCacheCapMB=20.000000 -AllowIndexAllBlueprints=LoadOnly -bShowInheritedVariables=False -bAlwaysShowInterfacesInOverrides=True -bShowParentClassInOverrides=True -bShowEmptySections=True -bShowAccessSpecifier=False -Bookmarks=() -PerBlueprintSettings=() -bIncludeCommentNodesInBookmarksTab=True -bShowBookmarksForCurrentDocumentOnlyInTab=False -GraphEditorQuickJumps=() - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/Game.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/Game.ini deleted file mode 100644 index 0e2255aea5..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/Game.ini +++ /dev/null @@ -1,3 +0,0 @@ -[StartupActions] -bAddPacks=False - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/GameUserSettings.ini b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/GameUserSettings.ini deleted file mode 100644 index b2bd352d99..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/Config/WindowsEditor/GameUserSettings.ini +++ /dev/null @@ -1,29 +0,0 @@ -[/Script/Engine.GameUserSettings] -bUseVSync=False -bUseDynamicResolution=False -ResolutionSizeX=1920 -ResolutionSizeY=1080 -LastUserConfirmedResolutionSizeX=1920 -LastUserConfirmedResolutionSizeY=1080 -WindowPosX=-1 -WindowPosY=-1 -FullscreenMode=1 -LastConfirmedFullscreenMode=1 -PreferredFullscreenMode=1 -Version=5 -AudioQualityLevel=0 -LastConfirmedAudioQualityLevel=0 -FrameRateLimit=0.000000 -DesiredScreenWidth=1280 -bUseDesiredScreenHeight=False -DesiredScreenHeight=720 -LastUserConfirmedDesiredScreenWidth=1280 -LastUserConfirmedDesiredScreenHeight=720 -LastRecommendedScreenWidth=-1.000000 -LastRecommendedScreenHeight=-1.000000 -LastCPUBenchmarkResult=-1.000000 -LastGPUBenchmarkResult=-1.000000 -LastGPUBenchmarkMultiplier=1.000000 -bUseHDRDisplayOutput=False -HDRDisplayOutputNits=1000 - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/ShaderDebugInfo/PCD3D_SM6/WorldGridMaterial_ea5d70b5306083b5/Default/DDCKey-Editor.txt b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/ShaderDebugInfo/PCD3D_SM6/WorldGridMaterial_ea5d70b5306083b5/Default/DDCKey-Editor.txt deleted file mode 100644 index dd96272739..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/ShaderDebugInfo/PCD3D_SM6/WorldGridMaterial_ea5d70b5306083b5/Default/DDCKey-Editor.txt +++ /dev/null @@ -1,2 +0,0 @@ -MATSM_F352F674A0D503790A5235582FBA6412_PCD3D_SM6_-467229472__BC5N_NoCCBN_NoIris_DEV_SL_LWC2_PreExp_DBuf_UnInt_DXC1_VFO_LFV_LTRRT_SKYATM_SKYHF_SLWSMDLT_STRDSTRIP_gs1_sdct_VRS_VT-0-0-1-0_MIN_PJC_SHRC_DF_MS_T0_MS_T1_VED_Aniso-1_ComprOodle_Compr2_Lev4_ExclNonPipSh-1_LWC-2097152_2613239799_SLWDP_SKPassThrough0_Nanite-Tess0CSMat1PSMat1DB6FCC63A5C44EA751315CBC3EF5DDED_Num_SM6_FL_0000000d_MFA_00000008_V_B6A0A753ED62499D8F30931E61FCAB05_0_DB3E993F4E2E98B305AD13B92D8C5DA5_9107FBCE4C95329989F3AF1F988A1B948D5415DB___TShadowDepthPSPixelShadowDepth_PerspectiveCorrect0_0_00BA6C9B8E198325012E7CF76CB7C5291CF229D0DC42029D3A7877F6520B43A3D0406C57469EABB8F_FLumenCardPS0_0_03E16DC0C5BF41EC01552ED84CD1509555C29050BC4CE29BE25F7A4B1586CA4C1685BCF80731FE636_TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQSkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA5BAA7BEC98F764475D732E99CBF54AC272E7E1B0_TShadowDepthPSPixelShadowDepth_NonPerspectiveCorrect0_0_00BA6C9B8E198325012E7CF76CB7C5291CF229D0D9FC66713AD9ABF570AFA2305B93FC5C738D84F68_TBasePassCSFCachedPointIndirectLightingPolicy0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA10FAD6B0AF33452512BCC17223D6E15F730B5448_TShadowDepthVSVertexShadowDepth_OutputDepthPositionOnly0_0_0FDDDD7613D94ED7AF910F85982311631DB4EF378BB459A7F0DBAC5232AC3C6813D7A1C9C1E037A6F_FMicropolyRasterizeCS0_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS1_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS2_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS3_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS4_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS5_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS6_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS7_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS8_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS9_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS10_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS11_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS12_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS13_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS14_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS15_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS16_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS17_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS18_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS19_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS20_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS21_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS22_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS23_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS24_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS25_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS26_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS27_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS28_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS29_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS30_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS31_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS32_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS33_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS34_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS35_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS36_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS37_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS38_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS39_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS40_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS41_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS42_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS43_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS44_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS45_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS46_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS47_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS48_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS49_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS50_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS51_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS52_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS53_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS54_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS55_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS56_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS57_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS58_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS59_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS60_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS61_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS62_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS63_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS64_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS65_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS66_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS67_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS68_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS69_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS70_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS71_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS72_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS73_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS74_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS75_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS76_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS77_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS78_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS79_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS80_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS81_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS82_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS83_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS84_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS85_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS86_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS87_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS88_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS89_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS90_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS91_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS92_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS93_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS94_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS95_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS96_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS97_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS98_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS99_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS100_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS101_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS102_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS103_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS104_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS105_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS106_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS107_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS108_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS109_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS110_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS111_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS112_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS113_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS114_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS115_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS116_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS117_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS118_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS119_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS120_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS121_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS122_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS123_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS124_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS125_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS126_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS127_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS128_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS129_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS130_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS131_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS132_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS133_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS134_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS135_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS136_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS137_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS138_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS139_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS140_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS141_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS142_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS143_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS144_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS145_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS146_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS147_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS148_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS149_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS150_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS151_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS152_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS153_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS154_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS155_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS156_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS157_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS158_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS159_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS160_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS161_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS162_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS163_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS164_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS165_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS166_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS167_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS168_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS169_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS170_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS171_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS172_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS173_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS174_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS175_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS176_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS177_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS178_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS179_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS180_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS181_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS182_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS183_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS184_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS185_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS186_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS187_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS188_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS189_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS190_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS191_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS192_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS193_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS194_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS195_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS196_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS197_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS198_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS199_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS200_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS201_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS202_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS203_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS204_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS205_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS206_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS207_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS208_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS209_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS210_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS211_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS212_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS213_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS214_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS215_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS216_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS217_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS218_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS219_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS220_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS221_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS222_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS223_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS224_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS225_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS226_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS227_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS228_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS229_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS230_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS231_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS232_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS233_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS234_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS235_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS236_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS237_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS238_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS239_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS240_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS241_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS242_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS243_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS244_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS245_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS246_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS247_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS248_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS249_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS250_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS251_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS252_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS253_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS254_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS255_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS256_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS257_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS258_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS259_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS260_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS261_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS262_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS263_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS264_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS265_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS266_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS267_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS268_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS269_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS270_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS271_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS272_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS273_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS274_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS275_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS276_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS277_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS278_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS279_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS280_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS281_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS282_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS283_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS284_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS285_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS286_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS287_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS288_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS289_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS290_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS291_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS292_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS293_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS294_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS295_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS296_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS297_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS298_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS299_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS300_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS301_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS302_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS303_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS304_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS305_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS306_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS307_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS308_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS309_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS310_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS311_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS312_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS313_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS314_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS315_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS316_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS317_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS318_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS319_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS320_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS321_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS322_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS323_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS324_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS325_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS326_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS327_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS328_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS329_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS330_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS331_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS332_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS333_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS334_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS335_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS336_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS337_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS338_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS339_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS340_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS341_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS342_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS343_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS344_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS345_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS346_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS347_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS348_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS349_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS350_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS351_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS352_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS353_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS354_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS355_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS356_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS357_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS358_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS359_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS360_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS361_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS362_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS363_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS364_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS365_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS366_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS367_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS368_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS369_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS370_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS371_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS372_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS373_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS374_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS375_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS376_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS377_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS378_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS379_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS380_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS381_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS382_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS383_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS384_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS385_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS386_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS387_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS388_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS389_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS390_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS391_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS392_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS393_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS394_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS395_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS396_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS397_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS398_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS399_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS400_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS401_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS402_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS403_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS404_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS405_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS406_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS407_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS408_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS409_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS410_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS411_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS412_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS413_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS414_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS415_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS416_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS417_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS418_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS419_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS420_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS421_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS422_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS423_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS424_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS425_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS426_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS427_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS428_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS429_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS430_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS431_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS432_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS433_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS434_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS435_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS436_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS437_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS438_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS439_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS440_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS441_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS442_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS443_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS444_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS445_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS446_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS447_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS448_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS449_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS450_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS451_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS452_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS453_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS454_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS455_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS456_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS457_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS458_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS459_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS460_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS461_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS462_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS463_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS464_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS465_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS466_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS467_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS468_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS469_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS470_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS471_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS472_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS473_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS474_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS475_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS476_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS477_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS478_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS479_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS480_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS481_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS482_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS483_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS484_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS485_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS486_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS487_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS488_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS489_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS490_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS491_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS492_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS493_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS494_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS495_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS496_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS497_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS498_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS499_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS500_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS501_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS502_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS503_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS504_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS505_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS506_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS507_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS508_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS509_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS510_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_FMicropolyRasterizeCS511_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCC4CF70EE3E9D2361C4B0CCCB0C8655C5681D2719_TLightMapDensityPSTLightMapPolicyHQ0_0_07222847C70AF7BEA9FD37D98F0C14F49953E8400AA270EEF413621E0C116C79AC656F988F24413AF_TBasePassCSTLightMapPolicyHQSkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDAF62472048A5E16C3CBF33ED0FD5D68D095CFF9C2_TBasePassPSFPrecomputedVolumetricLightmapLightingPolicySkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA1885C6BD5C13C615A2D1CC7B629C1649D7904633_TBasePassPSFPrecomputedVolumetricLightmapLightingPolicySkylight1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA1885C6BD5C13C615A2D1CC7B629C1649D7904633_TBasePassPSTLightMapPolicyLQSkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA5B3BB4576FCE1858D2FA513C5CF3DFFA9D6231E6_TBasePassPSTLightMapPolicyLQSkylight1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA5B3BB4576FCE1858D2FA513C5CF3DFFA9D6231E6_FLandscapeGrassWeightVS0_0_048D8060A4E964C5C787E9DD6490BE40950B996DA1F4AE6CD573C588EA0E0A5701A067C736DB871F2_TBasePassCSFNoLightMapPolicySkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA8D7073ED51131A1D51B71F1E395D180C8D86505D_TBasePassCSFCachedVolumeIndirectLightingPolicy0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDAF4FB311566AE8F6DFE7AB4096D5758200F66028D_TLightMapDensityVSFNoLightMapPolicy0_0_07222847C70AF7BEA9FD37D98F0C14F49953E8400E68740D56C01795CB8F3A41716DC323A4B0E4A02_TBasePassPSTDistanceFieldShadowsAndLightMapPolicyHQ0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA58C0ACF387F70E172DF585AA01C84B8418428E2B_TBasePassPSTDistanceFieldShadowsAndLightMapPolicyHQ1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA58C0ACF387F70E172DF585AA01C84B8418428E2B_FHWRasterizeVS0_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS1_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS2_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS3_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS4_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS5_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS6_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS7_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS8_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS9_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS10_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS11_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS12_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS13_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS14_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS15_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS16_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS17_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS18_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS19_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS20_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS21_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS22_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS23_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS24_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS25_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS26_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS27_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS28_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS29_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS30_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS31_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS32_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS33_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS34_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS35_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS36_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS37_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS38_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS39_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS40_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS41_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS42_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS43_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS44_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS45_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS46_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS47_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS48_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS49_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS50_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS51_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS52_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS53_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS54_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS55_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS56_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS57_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS58_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS59_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS60_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS61_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS62_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHWRasterizeVS63_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCAE68DA4B25EFEFA26644774180E6251B931D8D30_FHitProxyVS0_0_0E4C9B6397777DE153A14DB50DC6BC36366094557B310836A0A5C4DC6F9C6787D82A95787504887EA_FHitProxyPS0_0_00B92DFC1B903E7D52866045E7E066F0D424133E398FD96E02A532D7E415E04CB58A1437B3DE55B9E_TBasePassCSTLightMapPolicyLQSkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDAC99AA8DA6866F0CAC845FA4EC09F90254C3FC957_FLandscapeGrassWeightPS0_0_048D8060A4E964C5C787E9DD6490BE40950B996DA06AC8289474264FCB183613EA9196A3F141417F9_TBasePassCSTLightMapPolicyLQ0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA24FA8EB12306802CDCB1C8854B6802D350A9DE4E_TBasePassPSFNoLightMapPolicy0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA79B90F6A1A762E35DCA6B7044315B042B3A9DE8B_TBasePassPSFNoLightMapPolicy1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA79B90F6A1A762E35DCA6B7044315B042B3A9DE8B_TBasePassCSFPrecomputedVolumetricLightmapLightingPolicy0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA82D5FE621DAEABFC2A60179EE290F06C7DDEEE5C_FHWRasterizePS0_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS1_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS2_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS3_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS4_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS5_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS6_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS7_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS8_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS9_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS10_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS11_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS12_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS13_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS14_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS15_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS16_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS17_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS18_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS19_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS20_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS21_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS22_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS23_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS24_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS25_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS26_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS27_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS28_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS29_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS30_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS31_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS32_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS33_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS34_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS35_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS36_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS37_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS38_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS39_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS40_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS41_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS42_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS43_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS44_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS45_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS46_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS47_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS48_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS49_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS50_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS51_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS52_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS53_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS54_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS55_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS56_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS57_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS58_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS59_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS60_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS61_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS62_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS63_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS64_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS65_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS66_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS67_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS68_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS69_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS70_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS71_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS72_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS73_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS74_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS75_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS76_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS77_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS78_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS79_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS80_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS81_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS82_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS83_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS84_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS85_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS86_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS87_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS88_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS89_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS90_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS91_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS92_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS93_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS94_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS95_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS96_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS97_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS98_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS99_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS100_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS101_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS102_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS103_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS104_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS105_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS106_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS107_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS108_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS109_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS110_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS111_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS112_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS113_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS114_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS115_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS116_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS117_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS118_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS119_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS120_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS121_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS122_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS123_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS124_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS125_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS126_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS127_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS128_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS129_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS130_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS131_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS132_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS133_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS134_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS135_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS136_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS137_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS138_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS139_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS140_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS141_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS142_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS143_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS144_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS145_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS146_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS147_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS148_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS149_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS150_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS151_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS152_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS153_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS154_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS155_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS156_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS157_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS158_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS159_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS160_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS161_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS162_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS163_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS164_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS165_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS166_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS167_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS168_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS169_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS170_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS171_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS172_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS173_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS174_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS175_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS176_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS177_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS178_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS179_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS180_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS181_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS182_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS183_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS184_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS185_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS186_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS187_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS188_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS189_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS190_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS191_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS192_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS193_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS194_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS195_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS196_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS197_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS198_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS199_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS200_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS201_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS202_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS203_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS204_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS205_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS206_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS207_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS208_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS209_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS210_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS211_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS212_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS213_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS214_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS215_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS216_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS217_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS218_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS219_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS220_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS221_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS222_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS223_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS224_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS225_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS226_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS227_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS228_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS229_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS230_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS231_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS232_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS233_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS234_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS235_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS236_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS237_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS238_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS239_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS240_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS241_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS242_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS243_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS244_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS245_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS246_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS247_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS248_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS249_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS250_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS251_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS252_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS253_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS254_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_FHWRasterizePS255_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCC9C130E689B3132814C20D8BE52E9E3E559C3B15E_TShadowDepthVSVertexShadowDepth_OutputDepth0_0_0FDDDD7613D94ED7AF910F85982311631DB4EF378D282FE23662B6F8212138E16FD40FFF30C979CA0_TDepthOnlyVS0_0_03809D327566D79B7D003D609F3FFBC28CB24CA5DBE22A860DB786AA9A7DE7C711953CC3F484404A4_FLandscapePhysicalMaterialPS0_0_01BFCB38015EA018875516BDAB9AA63886CC221D1989E524D02800C279740896F656A4B888BE14513_TBasePassCSFPrecomputedVolumetricLightmapLightingPolicySkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA83CAF2761B69086FAFC74A14A2412E5D27743EA1_TLightMapDensityVSFDummyLightMapPolicy0_0_07222847C70AF7BEA9FD37D98F0C14F49953E840018803B83B28CDED9C48845B0B2ABC57FE549565C_FLumenCardVS0_0_009BA6531C9DF6B65C5602013A7552F40E0F93A69ABD0E94E9F2FDE303EA0054320ED4096AB87BEA7_TShadowDepthPSPixelShadowDepth_VirtualShadowMap0_0_00BA6C9B8E198325012E7CF76CB7C5291CF229D0D0F80ED0D9DD10768D803FB60ECF1149D03939C33_TBasePassVSFPrecomputedVolumetricLightmapLightingPolicy0_0_04309B802513C0E1FA208A859F63E1C63721CF5AE68F0B29CECEC60752AD4E2F4479E3479A9544217_TBasePassPSTDistanceFieldShadowsAndLightMapPolicyHQSkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDAD125B9380CFE1C82C03BB907DBE95DE267E4AA1F_TBasePassPSTDistanceFieldShadowsAndLightMapPolicyHQSkylight1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDAD125B9380CFE1C82C03BB907DBE95DE267E4AA1F_TBasePassPSFPrecomputedVolumetricLightmapLightingPolicy0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDACA38D76CBB88E8E35C9A8EC7B1CB5EB263A39605_TBasePassPSFPrecomputedVolumetricLightmapLightingPolicy1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDACA38D76CBB88E8E35C9A8EC7B1CB5EB263A39605_TBasePassPSTLightMapPolicyHQ0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA804894D114BDC7D7CCA483C383426229EB505ECB_TBasePassPSTLightMapPolicyHQ1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA804894D114BDC7D7CCA483C383426229EB505ECB_FLumenCardPS0_0_03E16DC0C5BF41EC01552ED84CD1509555C29050B1AF1B19445283C34D121B7362E8009A5D5541AB8_TLightMapDensityPSFDummyLightMapPolicy0_0_07222847C70AF7BEA9FD37D98F0C14F49953E8400155D979E9D1F3559A69AB78660BE10F9E4ABAB2D_TBasePassPSFCachedPointIndirectLightingPolicySkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDACBB5826133D9E53D0E6872AEE7FE4451B5DA3340_TBasePassPSFCachedPointIndirectLightingPolicySkylight1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDACBB5826133D9E53D0E6872AEE7FE4451B5DA3340_FTranslucentLightingInjectPS0_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS1_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS2_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS3_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS4_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS5_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS6_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS7_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS8_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS9_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS10_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS11_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS12_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS13_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS14_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS15_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS16_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS17_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS18_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS19_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS20_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS21_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS22_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS23_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS24_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS25_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS26_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS27_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS28_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS29_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS30_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_FTranslucentLightingInjectPS31_0_0F7BEB51EF1AB4ADCC04A1AC0202D1951EA605A291C6338A978F9356F36802E13F8A3E50683C0C140_TBasePassVSFCachedPointIndirectLightingPolicy0_0_04309B802513C0E1FA208A859F63E1C63721CF5AEBC455CF5461179D683FC22723024276683512BF2_FHWRasterizeMS0_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS1_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS2_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS3_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS4_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS5_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS6_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS7_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS8_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS9_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS10_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS11_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS12_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS13_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS14_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS15_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS16_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS17_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS18_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS19_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS20_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS21_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS22_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS23_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS24_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS25_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS26_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS27_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS28_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS29_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS30_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS31_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS32_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS33_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS34_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS35_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS36_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS37_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS38_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS39_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS40_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS41_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS42_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS43_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS44_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS45_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS46_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS47_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS48_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS49_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS50_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS51_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS52_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS53_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS54_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS55_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS56_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS57_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS58_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS59_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS60_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS61_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS62_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_FHWRasterizeMS63_0_002C4366D99330C457B947CA0DC2AB1C7E2F20DCCCD5E985AAFF8C6C3B50AA6E6DB0D2F39915796C5_TBasePassPSFCachedPointIndirectLightingPolicy0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA567497BE8A730EE9D61E10D7F18B32D891846AC8_TBasePassPSFCachedPointIndirectLightingPolicy1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA567497BE8A730EE9D61E10D7F18B32D891846AC8_FVelocityPS0_0_0E7FCCF430B01758CCFED8AA8F94A4AEF0020B7BC71766E222D75D9042433F7E54424227CD4AF7F85_TBasePassPSFCachedVolumeIndirectLightingPolicy0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDAE8E63E50D815609BA40DD40A8C088E2387FA3BF0_TBasePassPSFCachedVolumeIndirectLightingPolicy1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDAE8E63E50D815609BA40DD40A8C088E2387FA3BF0_TShadowDepthVSVertexShadowDepth_PerspectiveCorrect0_0_0FDDDD7613D94ED7AF910F85982311631DB4EF3787188663C9C337316BBABCDC605C6F3CE449BB27D_TBasePassCSFCachedPointIndirectLightingPolicySkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA0C7FD39629725BF10F5002E314BB3E867EF677C5_TBasePassCSTLightMapPolicyHQ0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA9BAF65E5209CF99A77340822E17460F228CC1592_TBasePassPSFCachedVolumeIndirectLightingPolicySkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA27C2A77E6D84B54989B82D51CEC865B004FB6010_TBasePassPSFCachedVolumeIndirectLightingPolicySkylight1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA27C2A77E6D84B54989B82D51CEC865B004FB6010_TLightMapDensityPSFNoLightMapPolicy0_0_07222847C70AF7BEA9FD37D98F0C14F49953E840076F07DBCFA0AC7DA5684426030FD7E2B83F8BFEB_TLightMapDensityVSTLightMapPolicyLQ0_0_07222847C70AF7BEA9FD37D98F0C14F49953E8400AEC27E29B9DAB2C6DACEED2C9FEB36BF92895105_TBasePassCSFNoLightMapPolicy0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA807FB3714E5A3A9E3E0EEA1A4840CB803FBA9C62_TBasePassVSTLightMapPolicyHQ0_0_04309B802513C0E1FA208A859F63E1C63721CF5AE5F272A7585E9FFDC79C7571A81C3C439883833B4_FLandscapePhysicalMaterialVS0_0_01BFCB38015EA018875516BDAB9AA63886CC221D130384436A244F15C2A1AC2311008523E497AAEF3_TBasePassPSFNoLightMapPolicySkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDABA5E9450E4A86AA1AF225295A8E1A3A9DBADD643_TBasePassPSFNoLightMapPolicySkylight1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDABA5E9450E4A86AA1AF225295A8E1A3A9DBADD643_TBasePassVSFCachedVolumeIndirectLightingPolicy0_0_04309B802513C0E1FA208A859F63E1C63721CF5AE131E76D986983209B45EA2D142B5BD6EC0D7641E_TShadowDepthPSPixelShadowDepth_OnePassPointLight0_0_00BA6C9B8E198325012E7CF76CB7C5291CF229D0D3C048F707CE1A01E3684B1A19B1BE149828CE519_TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQ0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA6E6C9AE012081A60817E6B7ADB8E5B3E3B3380EC_TShadowDepthVSVertexShadowDepth_PerspectiveCorrectPositionOnly0_0_0FDDDD7613D94ED7AF910F85982311631DB4EF3786F63A2867FA005A1D9974353C1F05C64FB02CAA1_TBasePassVSTDistanceFieldShadowsAndLightMapPolicyHQ0_0_04309B802513C0E1FA208A859F63E1C63721CF5AEBB50094D0051C52FF7242BC71DAD0BEFD0CC10E9_TShadowDepthVSVertexShadowDepth_VirtualShadowMap0_0_0FDDDD7613D94ED7AF910F85982311631DB4EF3789C66C30DD52CE816CB3314A5C799E41309269280_TShadowDepthVSVertexShadowDepth_OnePassPointLight0_0_0FDDDD7613D94ED7AF910F85982311631DB4EF37879BBC5F9C26CAC4ECD0A28D008BDC971EA966340_TBasePassCSFCachedVolumeIndirectLightingPolicySkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA63E8D85622155FEAEC018E134E09795EC767E3D8_TBasePassPSTLightMapPolicyLQ0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDABB2FAE6C3703A6FD3741EA0B7E1660D21FC30A92_TBasePassPSTLightMapPolicyLQ1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDABB2FAE6C3703A6FD3741EA0B7E1660D21FC30A92_TLightMapDensityPSTLightMapPolicyLQ0_0_07222847C70AF7BEA9FD37D98F0C14F49953E84005D8ED7FF1587BDFFD7ADCB8D75DD623ADF66D618_TBasePassVSTLightMapPolicyLQ0_0_04309B802513C0E1FA208A859F63E1C63721CF5AE78D60CAF7896988BA3EE748764C473DF7D87A225_TLightMapDensityVSTLightMapPolicyHQ0_0_07222847C70AF7BEA9FD37D98F0C14F49953E8400D34D34F5B8BAE168699B8A5F94ABC294AED01E82_TShadowDepthVSVertexShadowDepth_VirtualShadowMapPositionOnly0_0_0FDDDD7613D94ED7AF910F85982311631DB4EF37854CCF0F0329BEB98E3834B9B0E1CAAB6B4587848_FDebugViewModePS0_0_0E42838508A53E1FED4CE1CF8514B114D784FFBCDDF0CA379DEB49D5A761AF88AFBFA2D788472C2A8_TBasePassPSTLightMapPolicyHQSkylight0_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA7EB3FD4458D6647359B2220BD6EF34740007D430_TBasePassPSTLightMapPolicyHQSkylight1_0_03517BACA44D85EF64B75C82220BE571DFDE6FEDA7EB3FD4458D6647359B2220BD6EF34740007D430_TDepthOnlyVS0_0_0BB7F1C2084BC625A88ECD1AF94860160E1D3B695B3153FF105D7471808BB3B136D47DA9F9C9D7EB3_FVelocityVS0_0_0E7FCCF430B01758CCFED8AA8F94A4AEF0020B7BCC5B3590AE58B27781A1B627B03D72564730B8C51_FDebugViewModeVS0_0_0958E8C037DDBBDC48ADD101352D6EA76BD79C59798A189555FB5DFA3B16EC9000FC35B7613C050B9_TShadowDepthVSVertexShadowDepth_OnePassPointLightPositionOnly0_0_0FDDDD7613D94ED7AF910F85982311631DB4EF3784449D1779A17BA029521B676974C013CAD4F1D63_TBasePassVSFNoLightMapPolicy0_0_04309B802513C0E1FA208A859F63E1C63721CF5AE2FFFCF4957148C3B70889CC78A43EF8951CBB13C_DepthPosOnlyNoPixelPipeline3809D327566D79B7D003D609F3FFBC28CB24CA5D_VelocityPipelineEC3AE026EDE631CE2396DB75C122B625C60F6328_DepthNoPixelPipelineBB7F1C2084BC625A88ECD1AF94860160E1D3B695_FGPUSpriteVertexFactory245FB466A2A94E1A1436B691BFD0A7AD3AAB15226F4AA5ED14228FB7E8DA60EA4B587BD3239FAD94B9CA513CCBA4F1E3AF7D9556DD0F2FF45E951E1A_FNiagaraRibbonVertexFactoryD19292AE439B9BA2AF405539D8C979D72ADDB9DAA5C2BD7C8E1CB8C2C0438E13767AF67A0D5B5966DE03DD13CEAD2D60503F2AAC85D4762994EF4025A5C2BD7C8E1CB8C2C0438E13767AF67A0D5B5966A5C2BD7C8E1CB8C2C0438E13767AF67A0D5B5966_TGPUSkinAPEXClothVertexFactoryDefault0F340724BA3C76DE470CCD6BD08D3B137D0CF9D7BBEDF5F2F99060D3A4E705A02AFC0D4CFF550703_FParticleSpriteVertexFactory50F1F3C21861C59B390701CCEFB63753852D229FF99E1B0FB635933CEEAC41CF9441DF5EA4A994CA9DAE5A7C55936FD50BC3B20BD063C1832A4D4247_TGPUSkinVertexFactoryUnlimited0F340724BA3C76DE470CCD6BD08D3B137D0CF9D7180376A7171B50BD465E9983F32BCB5A07542FE7_FVectorFieldVisualizationVertexFactory36404C380DD96CD0872E9BBEDDFAD1A6E72AA01DCC854D8E74FEAEF90804D69AF6B78BD07A141ACC_FNiagaraMeshVertexFactoryF3FBD77A8F4B4A38338B697D58BDAC7AB8D5B27C4B3A20E0CA93D5CA5A60C16EF2EB14EA073FC9571BD81B2CBA1F364F28A837532353718EB814537B4B3A20E0CA93D5CA5A60C16EF2EB14EA073FC9574B3A20E0CA93D5CA5A60C16EF2EB14EA073FC957_FParticleBeamTrailVertexFactory9B4864381849C227417F59C2CD595ADF65DE8972378BBDDEC2CEAC35A309C357B38D702E7981D5D3_FNaniteVertexFactoryCE87BE868444FAE47D331D246D86B99B2795BDC9_TGPUSkinVertexFactoryDefault0F340724BA3C76DE470CCD6BD08D3B137D0CF9D7180376A7171B50BD465E9983F32BCB5A07542FE7_TGPUSkinAPEXClothVertexFactoryUnlimited0F340724BA3C76DE470CCD6BD08D3B137D0CF9D7BBEDF5F2F99060D3A4E705A02AFC0D4CFF550703_FGeometryCollectionVertexFactory74DF12C20858E13A6E65317951D0E79E184025DB49D716CAD02F0AC031CC93ACB2AFCB9C42E7DC4149D716CAD02F0AC031CC93ACB2AFCB9C42E7DC4149D716CAD02F0AC031CC93ACB2AFCB9C42E7DC41_FLandscapeXYOffsetVertexFactory9C72E626AD265877B69662468B699912974F6255B1684FBEF19B946A8709F4309D7CC4E5FC6044ADEBA49461CECB1EA5D21E2BF8918B91C7C3994DCEB1684FBEF19B946A8709F4309D7CC4E5FC6044ADB1684FBEF19B946A8709F4309D7CC4E5FC6044AD_FMeshParticleVertexFactory8E5462CD108F3ACF9C2D93B79DB64B3906833D1AF773920348F231C490A74B1A551F8CE3ABF04791_FInstancedStaticMeshVertexFactory1808145E713BFCB3CC3257922C12D5C1B321869739A00A3AF8434811E9EA9890B934C37C364D15CD39A00A3AF8434811E9EA9890B934C37C364D15CD39A00A3AF8434811E9EA9890B934C37C364D15CD39A00A3AF8434811E9EA9890B934C37C364D15CD_FSplineMeshVertexFactory1808145E713BFCB3CC3257922C12D5C1B3218697A747D67BD07743C1BEA1DE549F682B82EB7B9965A747D67BD07743C1BEA1DE549F682B82EB7B9965A747D67BD07743C1BEA1DE549F682B82EB7B9965_FLocalVertexFactory1808145E713BFCB3CC3257922C12D5C1B321869781418F8992AC49B8E2AFD31AF3B57530A23E085E81418F8992AC49B8E2AFD31AF3B57530A23E085E81418F8992AC49B8E2AFD31AF3B57530A23E085E_FLandscapeVertexFactory9C72E626AD265877B69662468B699912974F6255B1684FBEF19B946A8709F4309D7CC4E5FC6044ADEBA49461CECB1EA5D21E2BF8918B91C7C3994DCEB1684FBEF19B946A8709F4309D7CC4E5FC6044ADB1684FBEF19B946A8709F4309D7CC4E5FC6044AD_FNiagaraSpriteVertexFactoryACB1629DF3CA3124277348B8C5E6DFA8BCE4390C5957CFEE095AEFFBA7F83F09F020F15CF6555718EFF166204144512228FF7A163011544EEF3FD2265957CFEE095AEFFBA7F83F09F020F15CF65557185957CFEE095AEFFBA7F83F09F020F15CF6555718_Nanite::FVertexFactoryCE87BE868444FAE47D331D246D86B99B2795BDC9_FGeometryCacheVertexVertexFactory74ADC0A3F4354AA5B6F6B8CDE88F0843E005C5DD76143182082C57C6F98756E7AE927ED26DD4479A76143182082C57C6F98756E7AE927ED26DD4479A_FLandscapeFixedGridVertexFactory9C72E626AD265877B69662468B699912974F62553F5F45F5620EF6411E27211E3D675CEA50B38DFBEBA49461CECB1EA5D21E2BF8918B91C7C3994DCE3F5F45F5620EF6411E27211E3D675CEA50B38DFB3F5F45F5620EF6411E27211E3D675CEA50B38DFB_FLandscapeTileVertexFactory9C72E626AD265877B69662468B699912974F6255B1684FBEF19B946A8709F4309D7CC4E5FC6044ADEBA49461CECB1EA5D21E2BF8918B91C7C3994DCESPM_d0dd0cfdf09b3e581937333562ee3ff1fabbcfe52ef2e02d62fb52ae9e62c317SPM_89d2e11bbb81b3f9ca7deb28b92d425dba5b46b2826ca1b3f62062fb141a9055SPM_4313f3f49766b482d25abee0729864e2637caaa2c8359ca9a5ec5e52b19a4a74SPM_9ad64688c87d417670bf84d9164b7ff0c7fd5648d64f90605d4f5ccd62b1582fSPM_2c57d0a836509d36c7c166415bfeb15e0ef573dcd9b4603cf1538f7314f9243dSPM_6317586e85ff33e53f3e2a8924a75b9a477bf2856e71b76add6e9afa5b77a4b4SPM_e6cac58906497aa6a3240ec32a5b52a2e9e97391b9a24e44a022e67fcade440bSPM_86d0c84beb6cce721197426e35f24a231b8d3b3dcfaad4ac7e7cb5869ec16cb2SPM_ff7b878748b7492a8bfbb1d213e0de922e7d1ad4e5c007d89539a25e116fe2a5SPM_f246e4150b5da0c4990d8d9cde3e7bc9ee28109026282556e7079fb5bfdac477SPM_aa661c84dbf8f659fa074577f1cbf28605bf282f383c32fbea060da3d871c48bSPM_54a1312cf73db2c90c5ed5f36724cf7f386b575e0cdac7da6333551840860f28SPM_b902cb58365a597ab0b6fe8cf87ae04d551e6747d32c37d928b8157fd3eba5c0SPM_8067665b18a33a3fe76b4d2cb7efaae4a7d5d674bfcd16014ec75d22aa43e477SPM_e2f081515cc3d0ef0996e2c8f9e1a75166b3cc6cdf0f28a7851d4ec175056c74SPM_36d1d796bf3fb73ccd892afb1b779f503d696f05fd480468b72f5ef66020825cSPM_83dbf399e330e02ba06c94ef9626063f802e7dad4acecf70bd8dc6046d1c22bbSPM_4a9d07239f86cc5310d60e8af0f25edf06a7d9ea4a2cac6d8cec6a1602c017a9SPM_16580fe885dc965c263d5eaad54b525a074fe46b65804a2a9a8eeb6c60d81eccSPM_1da6a996912903dde41c496fbb90ab8b7a56a37d91e64fd22c93b23c3291cf38SPM_39378479a4394fe666719b48f96d91dd0fee16fbd4d833039c8057d35bfe994eSPM_117e6119542e172878eb8d8df821dc98b3b1a14df286a76bb6d7944757abb01cSPM_1abdcf528b27ee15ea112606f7deb0e2bf1615c76e72788521d73027ce1f58d5SPM_d7362c400bb066129c0a26e9fd812e883f0c4289c0407b8538c36ce3ffffc6beSPM_558881d4ac12138fcbcdfe48514387b4d97e3917d7af9d06e82d66a738436156SPM_c950e2748d33543963b877521828efae284bd631b6d3208cb86d15e3d6ac302fSPM_9cdc2e108d4933f77f45b419a1ff9766781d1e07d02f2ea021820a33f42561adSPM_8f2515f426db488db7287a059c05dc2cec22cfd7015d224934fbfbdf45e2c2fdSPM_555ae49bc0bf3433782cfddb991b9368a60e332df25860d228a3a8a615d5a301SPM_555ae49bc0bf3433782cfddb991b9368a60e332df25860d228a3a8a615d5a301SPM_eb8cf9f28765a64d7c29571f94e23818d215aa32f207f5e51332108f6fb34b41SPM_9429704e8be195f35baecc89e09a1d838ba2a5bd5531c47e77f0c1021d0ea3faSPM_f848405a4bb32d0fbb35c92b345a9c5ffbd711de556a9112d23792383b0ae532SPM_44cfd7856989e0d50b86ae467107f8cb1927d4c4ac69e4400cc83861f7c2587fSPM_5ba0c5b7c5677cfc80f9c206abf3f2281b0c59cf7534bc2c0c3040647bc959d3SPM_0f404960686934579767c414c4832022399bdada3fdee85648dd5ddc66cdc18bSPM_32f96e6e78e74918b7a804031de07f41b26a0f4e028cfbf2d1f67a366b3b4653SPM_35ddf07c29b7ba174b82f284a0659e75175dffbdb1e5bcfbb8be87ef8e1351f9SPM_1cb9f91b85bc88250891e97b8ee57a007548ecc77f178fd11b011f742ada03c3SPM_3b8fafd4358c1af5a086884104678b1dfd2e193bfae2d80ab85be9b6ad7bd2f2SPM_8668a6a7bc90628c6b9b7bc642165f78499f54c0bad7054bd40be5d5b16027a9SPM_1b6a9f1a9b735e886581d6d6dcf008a2c7fc72bafbf9099d1f86d7fbd8c9844cSPM_d325b6eff66cabe6e04198f43035cf6635b9b462dff8ae44df5c0cbe3de6cf30SPM_039985d77c1c1471b03049c2bf8ef2d29fea7464cb33519e9049b37ddcda731fSPM_2379ae40c9a93d1354f571759773506590e9bd6d2be3b959dc2ab0dca7e60fe4SPM_f6481c86c24d5e8e86b711ed96952ba756b1b40357dd9cadb41c22ae0d52834bSPM_a2ca952d5d0c16a12b0eca91df068d9ce926000b17be062f97ba31ac64039a67SPM_e99122b96c86762ba069e73393d36dd9e7886cd1e40a4c23c10949dc4144ff77SPM_c4fd33b245ca554105394a55a3b11ebe5ab14de075817620e79925a15f1d4e79SPM_43a005e78e6f2c8487fe442a8b0f2ecb2a8396fdd0dd05d0d6830486fa5280c9SPM_debd3b9cc3bd312d9214df237fa1d9744029bd0edcad0840bb3b5c8029fcd238SPM_729f279cb55c14a86674481c57e40fb61e9dd97072c662bfef60a2a568940f4eSPM_bb4e74f7221fb542e41cb3df0f9f9e4a99fd5f726e8d57fbd7664cc2c2b4d227SPM_212dd557778bf53736b95bebf4695b9895831af7743bf4f024d9b511e0c2d54bSPM_c1b18e33b7dee0ef9484fb4cee1d3ba679afd1eda5bbd346e54a3cd3e78c744aSPM_48630cd959fe3e36f7956b88e42d315bae59f4c944e73ebc00038e7f30cdd0b2SPM_8aba731ad44e3a707b51569410dec477ae09100f5bc6b0ad01ae6ac470b3876aSPM_caf44f3686659bb5161b05d968c1b10a21cd0bf51ac06bc73dc9d1492630313bSPM_5ca6927bd2331ea4a166686786263efa114a15c4a923633fb1e6b2fbca1005f0SPM_7a8859af6bf08dbff30fc6fcf3aa44eae2b5708485554da1535146f5ab7d1e6cSPM_1abeee29937f4f1f7bcbd889e379941b812ccb972f89fc23883577de1d19934eSPM_79a3f872f11713ceb40a20a8ae2879efe8627b56b619c57fe7eaba8446f9cb7aSPM_83c91dc56084b394948dc5f6a1c235b7d1705b51e910473043ea3e465b2aebc6SPM_8917a03e1e52e3b2c09594c402821ccaaabba029aebfa0f444faeb2c184f9501SPM_98e11b36ef3d6e4dc166bfc6020842cb5ad6481ef73003a086fd4cdf34885068SPM_b1aea2149ccb4b0d4c0ab0341778dc129f23e5e950bac882f27aec0133e7868aSPM_9495972c6977dcdfbe9b612c8d4675322b440b71427e749eb2ec568af89d8126SPM_dab238b1b2d52a66c17a2ac261384aaf7ace7ffc6cecacd7b12495131d73b305SPM_db11416980d7f513dc0e1e08a8df85b346a02b99b3dfcc1a6c49176898f046c7SPM_541c1655b0d68ad383b066d35023f38d7a2cce3fb8721a555664c6c209d5210bSPM_ff1dbf153d71c358113cfa5bf6cb96774cf6bd6258a13262cea51a28b5b08912433AFC833894B7681A1D3DDBA35F7F5A9509A899DA39A3EE5E6B4B0D3255BFEF95601890AFD8070900000000000000000000000000000000000000006E2AD9D86FE73F9DF5783D7E68BD0915331357DA_001_101_5; -_MatTransl_3B7A55D3409170328211A060FC2E3BB1E263C720_BBD650804D314CE7A44ADF9BB4F3F5F9_ \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/UnrealBuildTool/BuildConfiguration.xml b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/UnrealBuildTool/BuildConfiguration.xml deleted file mode 100644 index 261cb7a443..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Saved/UnrealBuildTool/BuildConfiguration.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1.Target.cs b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1.Target.cs deleted file mode 100644 index 77f7d7bfae..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1.Target.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -using UnrealBuildTool; -using System.Collections.Generic; - -public class UnrealNewtonProject1Target : TargetRules -{ - public UnrealNewtonProject1Target(TargetInfo Target) : base(Target) - { - Type = TargetType.Game; - DefaultBuildSettings = BuildSettingsVersion.V5; - IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_4; - ExtraModuleNames.Add("UnrealNewtonProject1"); - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1/UnrealNewtonProject1.Build.cs b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1/UnrealNewtonProject1.Build.cs deleted file mode 100644 index ab893f4b21..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1/UnrealNewtonProject1.Build.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -using UnrealBuildTool; - -public class UnrealNewtonProject1 : ModuleRules -{ - public UnrealNewtonProject1(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput" }); - - PrivateDependencyModuleNames.AddRange(new string[] { }); - - // Uncomment if you are using Slate UI - // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); - - // Uncomment if you are using online features - // PrivateDependencyModuleNames.Add("OnlineSubsystem"); - - // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1/UnrealNewtonProject1.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1/UnrealNewtonProject1.cpp deleted file mode 100644 index 3140617dda..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1/UnrealNewtonProject1.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#include "UnrealNewtonProject1.h" -#include "Modules/ModuleManager.h" - -IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, UnrealNewtonProject1, "UnrealNewtonProject1" ); diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1/UnrealNewtonProject1.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1/UnrealNewtonProject1.h deleted file mode 100644 index 677c8e25ba..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1/UnrealNewtonProject1.h +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#pragma once - -#include "CoreMinimal.h" - diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1Editor.Target.cs b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1Editor.Target.cs deleted file mode 100644 index a2fdc8ee72..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/Source/UnrealNewtonProject1Editor.Target.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -using UnrealBuildTool; -using System.Collections.Generic; - -public class UnrealNewtonProject1EditorTarget : TargetRules -{ - public UnrealNewtonProject1EditorTarget( TargetInfo Target) : base(Target) - { - Type = TargetType.Editor; - DefaultBuildSettings = BuildSettingsVersion.V5; - IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_4; - ExtraModuleNames.Add("UnrealNewtonProject1"); - } -} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/UnrealNewtonProject1.sln b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/UnrealNewtonProject1.sln deleted file mode 100644 index 775f310746..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/UnrealNewtonProject1.sln +++ /dev/null @@ -1,1695 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31314.256 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Automation", "Automation", "{0BFBE63A-B98A-3411-8EEB-8918FEC737B3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{233774A8-CC9D-3FA9-86D1-90573E92B704}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Games", "Games", "{DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Programs", "Programs", "{A338B9E2-A559-34BE-A46D-F789DD488FAD}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Rules", "Rules", "{C2F57ECE-B26F-39D8-BDA7-C1D40BD8F180}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{57713676-9DBE-331C-AD10-26632AC9EE0C}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnrealBuildTool.Plugins", "UnrealBuildTool.Plugins", "{7B5CFB44-F0FB-31DF-AE62-C3C096A29A7B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnrealNewtonProject1", "Intermediate\ProjectFiles\UnrealNewtonProject1.vcxproj", "{84B02190-1FCF-33EF-89EF-80E9C5CE429C}" - ProjectSection(ProjectDependencies) = postProject - {43E57E52-04E5-3257-88A5-50632C412FDC} = {43E57E52-04E5-3257-88A5-50632C412FDC} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UE5", "Intermediate\ProjectFiles\UE5.vcxproj", "{946A1CC0-A2A3-3A77-8951-222D020517D6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnrealBuildTool", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj", "{43E57E52-04E5-3257-88A5-50632C412FDC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutomationTool", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\AutomationTool.csproj", "{BFE7E08E-7837-341D-BC77-3E71777923FF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Android.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\Android\Android.Automation.csproj", "{A589F961-898E-3EBA-91E1-3B8019962EE5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apple.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\Apple\Apple.Automation.csproj", "{DF5C5E19-909F-365D-A6D8-DB22D187EB72}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutomationUtils.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\AutomationUtils\AutomationUtils.Automation.csproj", "{D034040A-F317-347E-A81B-DE5A4308E94C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildGraph.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\BuildGraph\BuildGraph.Automation.csproj", "{57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CookedEditor.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\CookedEditor\CookedEditor.Automation.csproj", "{D32C9219-DCBB-3AF4-BB16-F5539FD023EF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowdinLocalization.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\CrowdinLocalization\CrowdinLocalization.Automation.csproj", "{6A9855AA-1744-3D80-A76F-DD6D720664DE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gauntlet.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\Gauntlet\Gauntlet.Automation.csproj", "{5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IOS.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\IOS\IOS.Automation.csproj", "{6FC07F62-9C95-3BE7-88BD-6698278B1C2A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Linux.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\Linux\Linux.Automation.csproj", "{2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Localization.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\Localization\Localization.Automation.csproj", "{FB71B73F-1CDF-310C-97E3-F48509BD95E6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LowLevelTests.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\LowLevelTests\LowLevelTests.Automation.csproj", "{D614D47E-15EB-395E-92FE-9103D3ECEC87}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mac.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\Mac\Mac.Automation.csproj", "{2394F351-1451-3CE6-AD6C-88F8494ED347}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneSkyLocalization.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\OneSkyLocalization\OneSkyLocalization.Automation.csproj", "{B900E2A0-9249-3C7E-B322-9079936652F3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutomationScripts.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\Scripts\AutomationScripts.Automation.csproj", "{8CD34826-6580-3C58-8E33-39B97714492F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartlingLocalization.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\SmartlingLocalization\SmartlingLocalization.Automation.csproj", "{BF3D533F-DE13-3ABB-A71A-6EED5310FC22}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SteamDeck.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\SteamDeck\SteamDeck.Automation.csproj", "{8BE77053-A431-39E8-9BE8-EB652075B8D3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TVOS.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\TVOS\TVOS.Automation.csproj", "{625F44D8-435A-350B-90D2-0C9FD88B1A02}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Turnkey.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\Turnkey\Turnkey.Automation.csproj", "{F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Win.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\Win\Win.Automation.csproj", "{107CCFD7-38D4-3F69-9888-BFDBB2327123}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XLocLocalization.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\AutomationTool\XLocLocalization\XLocLocalization.Automation.csproj", "{C475C301-055A-3664-B0AC-69C6E976B23A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisionOS.Automation", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Platforms\VisionOS\Source\Programs\AutomationTool\VisionOS.Automation.csproj", "{C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScriptGeneratorUbtPlugin.ubtplugin", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Plugins\ScriptPlugin\Source\ScriptGeneratorUbtPlugin\ScriptGeneratorUbtPlugin.ubtplugin.csproj", "{C1A415AA-21AB-3E86-831C-7AB6504230F5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.AspNet", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.AspNet\EpicGames.AspNet.csproj", "{7CEA1861-395D-3324-87D8-07F08BA87627}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Build", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Build\EpicGames.Build.csproj", "{E0302B34-E7F8-3044-845E-FB3E7891E383}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.BuildGraph", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.BuildGraph\EpicGames.BuildGraph.csproj", "{4D561E9F-690D-3523-9569-02447B96CB71}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Core", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Core\EpicGames.Core.csproj", "{4A6787C3-BCFD-3183-A9BA-3C865DED66A6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Horde", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Horde\EpicGames.Horde.csproj", "{D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.IoHash", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.IoHash\EpicGames.IoHash.csproj", "{B6A42E3E-4470-300E-B2BE-829F485953D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Jupiter", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Jupiter\EpicGames.Jupiter.csproj", "{92186E5B-6D47-371B-9E53-9206A2CEA89D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.MongoDB", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.MongoDB\EpicGames.MongoDB.csproj", "{53211AF7-F542-387E-A2DF-A75D2B82F39C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.MsBuild", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.MsBuild\EpicGames.MsBuild.csproj", "{AA0BFCC0-404F-3653-B7F7-9648C8D23C05}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.OIDC", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.OIDC\EpicGames.OIDC.csproj", "{A9B62012-4EAF-34A1-9323-E142679B1ACA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Oodle", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Oodle\EpicGames.Oodle.csproj", "{A8AC81D3-6265-3755-9147-493C254FF6C4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Perforce", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Perforce\EpicGames.Perforce.csproj", "{451D771D-C99E-335B-958A-27F67F58DE8F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Perforce.Fixture", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Perforce.Fixture\EpicGames.Perforce.Fixture.csproj", "{4F28FB94-E997-3D55-AB03-CF19DB275D80}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Perforce.Managed", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Perforce.Managed\EpicGames.Perforce.Managed.csproj", "{1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.ProjectStore", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.ProjectStore\EpicGames.ProjectStore.csproj", "{59FC365F-CDA3-3A94-827D-67BBF3813353}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Redis", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Redis\EpicGames.Redis.csproj", "{91FEBD14-808F-38CD-978A-E857A7BAAC5D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Serialization", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Serialization\EpicGames.Serialization.csproj", "{5349E287-4240-3E67-9897-FED50C2AE556}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Slack", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Slack\EpicGames.Slack.csproj", "{79F94956-8D6F-306D-A577-7F99AD139572}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.Tracing", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Tracing\EpicGames.Tracing.csproj", "{B4B0903B-6890-3551-948C-438EA4F2BEB6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.UBA", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.UBA\EpicGames.UBA.csproj", "{59FB50D8-8426-3564-84FA-3E22E00F80FC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EpicGames.UHT", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.UHT\EpicGames.UHT.csproj", "{7B378AEC-A757-3495-A0F1-03DF2B52CED1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnrealNewtonProject1ModuleRules", "Intermediate\Build\BuildRulesProjects\UnrealNewtonProject1ModuleRules\UnrealNewtonProject1ModuleRules.csproj", "{6688DE01-06D0-37B8-A7E8-7DCB0B73C467}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UE5ProgramRules", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Intermediate\Build\BuildRulesProjects\UE5ProgramRules\UE5ProgramRules.csproj", "{31A51F5F-A35D-3F09-9CDE-A31564BF803C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UE5Rules", "..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Intermediate\Build\BuildRulesProjects\UE5Rules\UE5Rules.csproj", "{A8675E24-7134-30DD-8AF0-1872B14FCA4D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Visualizers", "Visualizers", "{1CCEC849-CC72-4C59-8C36-2F7C38706D4C}" - ProjectSection(SolutionItems) = preProject - ..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Extras\VisualStudioDebugging\Unreal.natvis = ..\..\..\..\..\..\..\Program Files\Epic Games\UE_5.4\Engine\Extras\VisualStudioDebugging\Unreal.natvis - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DebugGame Editor|Win64 = DebugGame Editor|Win64 - DebugGame Editor|Win64-arm64 = DebugGame Editor|Win64-arm64 - DebugGame Editor|Win64-arm64ec = DebugGame Editor|Win64-arm64ec - DebugGame|Win64 = DebugGame|Win64 - DebugGame|Win64-arm64 = DebugGame|Win64-arm64 - DebugGame|Win64-arm64ec = DebugGame|Win64-arm64ec - Development Editor|Win64 = Development Editor|Win64 - Development Editor|Win64-arm64 = Development Editor|Win64-arm64 - Development Editor|Win64-arm64ec = Development Editor|Win64-arm64ec - Development|Win64 = Development|Win64 - Development|Win64-arm64 = Development|Win64-arm64 - Development|Win64-arm64ec = Development|Win64-arm64ec - Shipping|Win64 = Shipping|Win64 - Shipping|Win64-arm64 = Shipping|Win64-arm64 - Shipping|Win64-arm64ec = Shipping|Win64-arm64ec - EndGlobalSection - # UnrealVS Section - GlobalSection(ddbf523f-7eb6-4887-bd51-85a714ff87eb) = preSolution - AvailablePlatforms=Win64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame Editor|Win64.ActiveCfg = DebugGame_Editor|x64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame Editor|Win64.Build.0 = DebugGame_Editor|x64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame Editor|Win64-arm64.ActiveCfg = DebugGame_Editor|arm64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame Editor|Win64-arm64.Build.0 = DebugGame_Editor|arm64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame Editor|Win64-arm64ec.ActiveCfg = DebugGame_Editor|arm64ec - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame Editor|Win64-arm64ec.Build.0 = DebugGame_Editor|arm64ec - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame|Win64.ActiveCfg = DebugGame|x64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame|Win64.Build.0 = DebugGame|x64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame|Win64-arm64.ActiveCfg = DebugGame|arm64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame|Win64-arm64.Build.0 = DebugGame|arm64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame|Win64-arm64ec.ActiveCfg = DebugGame|arm64ec - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.DebugGame|Win64-arm64ec.Build.0 = DebugGame|arm64ec - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development Editor|Win64.ActiveCfg = Development_Editor|x64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development Editor|Win64.Build.0 = Development_Editor|x64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development Editor|Win64-arm64.ActiveCfg = Development_Editor|arm64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development Editor|Win64-arm64.Build.0 = Development_Editor|arm64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development Editor|Win64-arm64ec.ActiveCfg = Development_Editor|arm64ec - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development Editor|Win64-arm64ec.Build.0 = Development_Editor|arm64ec - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development|Win64.ActiveCfg = Development|x64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development|Win64.Build.0 = Development|x64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development|Win64-arm64.ActiveCfg = Development|arm64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development|Win64-arm64.Build.0 = Development|arm64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development|Win64-arm64ec.ActiveCfg = Development|arm64ec - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Development|Win64-arm64ec.Build.0 = Development|arm64ec - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Shipping|Win64.ActiveCfg = Shipping|x64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Shipping|Win64.Build.0 = Shipping|x64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Shipping|Win64-arm64.ActiveCfg = Shipping|arm64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Shipping|Win64-arm64.Build.0 = Shipping|arm64 - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Shipping|Win64-arm64ec.ActiveCfg = Shipping|arm64ec - {84B02190-1FCF-33EF-89EF-80E9C5CE429C}.Shipping|Win64-arm64ec.Build.0 = Shipping|arm64ec - {946A1CC0-A2A3-3A77-8951-222D020517D6}.DebugGame Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.DebugGame Editor|Win64-arm64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.DebugGame Editor|Win64-arm64ec.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.DebugGame|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.DebugGame|Win64-arm64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.DebugGame|Win64-arm64ec.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.Development Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.Development Editor|Win64-arm64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.Development Editor|Win64-arm64ec.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.Development|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.Development|Win64-arm64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.Development|Win64-arm64ec.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.Shipping|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.Shipping|Win64-arm64.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {946A1CC0-A2A3-3A77-8951-222D020517D6}.Shipping|Win64-arm64ec.ActiveCfg = BuiltWithUnrealBuildTool|Win64 - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame|Win64.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development Editor|Win64.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development|Win64.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development|Win64.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development|Win64-arm64.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Shipping|Win64.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Shipping|Win64.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {43E57E52-04E5-3257-88A5-50632C412FDC}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame|Win64.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development Editor|Win64.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development|Win64.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development|Win64.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development|Win64-arm64.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Shipping|Win64.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Shipping|Win64.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {BFE7E08E-7837-341D-BC77-3E71777923FF}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame|Win64.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development Editor|Win64.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development|Win64.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development|Win64.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development|Win64-arm64.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Shipping|Win64.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Shipping|Win64.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A589F961-898E-3EBA-91E1-3B8019962EE5}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame|Win64.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development Editor|Win64.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development|Win64.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development|Win64.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development|Win64-arm64.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Shipping|Win64.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Shipping|Win64.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {DF5C5E19-909F-365D-A6D8-DB22D187EB72}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame|Win64.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development Editor|Win64.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development|Win64.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development|Win64.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development|Win64-arm64.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Shipping|Win64.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Shipping|Win64.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D034040A-F317-347E-A81B-DE5A4308E94C}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame|Win64.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development Editor|Win64.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development|Win64.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development|Win64.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development|Win64-arm64.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Shipping|Win64.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Shipping|Win64.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame|Win64.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development Editor|Win64.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development|Win64.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development|Win64.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development|Win64-arm64.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Shipping|Win64.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Shipping|Win64.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame|Win64.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development Editor|Win64.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development|Win64.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development|Win64.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development|Win64-arm64.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Shipping|Win64.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Shipping|Win64.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6A9855AA-1744-3D80-A76F-DD6D720664DE}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame|Win64.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development Editor|Win64.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development|Win64.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development|Win64.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development|Win64-arm64.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Shipping|Win64.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Shipping|Win64.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame|Win64.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development Editor|Win64.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development|Win64.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development|Win64.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development|Win64-arm64.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Shipping|Win64.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Shipping|Win64.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame|Win64.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development Editor|Win64.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development|Win64.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development|Win64.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development|Win64-arm64.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Shipping|Win64.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Shipping|Win64.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame|Win64.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development Editor|Win64.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development|Win64.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development|Win64.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development|Win64-arm64.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Shipping|Win64.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Shipping|Win64.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {FB71B73F-1CDF-310C-97E3-F48509BD95E6}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame|Win64.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development Editor|Win64.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development|Win64.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development|Win64.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development|Win64-arm64.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Shipping|Win64.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Shipping|Win64.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D614D47E-15EB-395E-92FE-9103D3ECEC87}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame|Win64.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development Editor|Win64.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development|Win64.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development|Win64.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development|Win64-arm64.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Shipping|Win64.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Shipping|Win64.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {2394F351-1451-3CE6-AD6C-88F8494ED347}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame|Win64.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development Editor|Win64.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development|Win64.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development|Win64.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development|Win64-arm64.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Shipping|Win64.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Shipping|Win64.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B900E2A0-9249-3C7E-B322-9079936652F3}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame|Win64.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development Editor|Win64.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development|Win64.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development|Win64.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development|Win64-arm64.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Shipping|Win64.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Shipping|Win64.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {8CD34826-6580-3C58-8E33-39B97714492F}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame|Win64.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development Editor|Win64.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development|Win64.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development|Win64.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development|Win64-arm64.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Shipping|Win64.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Shipping|Win64.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame|Win64.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development Editor|Win64.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development|Win64.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development|Win64.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development|Win64-arm64.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Shipping|Win64.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Shipping|Win64.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {8BE77053-A431-39E8-9BE8-EB652075B8D3}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame|Win64.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development Editor|Win64.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development|Win64.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development|Win64.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development|Win64-arm64.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Shipping|Win64.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Shipping|Win64.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {625F44D8-435A-350B-90D2-0C9FD88B1A02}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame|Win64.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development Editor|Win64.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development|Win64.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development|Win64.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development|Win64-arm64.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Shipping|Win64.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Shipping|Win64.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame|Win64.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development Editor|Win64.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development|Win64.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development|Win64.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development|Win64-arm64.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Shipping|Win64.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Shipping|Win64.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {107CCFD7-38D4-3F69-9888-BFDBB2327123}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame|Win64.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development Editor|Win64.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development|Win64.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development|Win64.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development|Win64-arm64.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Shipping|Win64.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Shipping|Win64.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C475C301-055A-3664-B0AC-69C6E976B23A}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame|Win64.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development Editor|Win64.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development|Win64.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development|Win64.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development|Win64-arm64.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Shipping|Win64.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Shipping|Win64.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame|Win64.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development Editor|Win64.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development|Win64.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development|Win64.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development|Win64-arm64.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Shipping|Win64.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Shipping|Win64.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {C1A415AA-21AB-3E86-831C-7AB6504230F5}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame|Win64.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development Editor|Win64.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development|Win64.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development|Win64.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development|Win64-arm64.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Shipping|Win64.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Shipping|Win64.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {7CEA1861-395D-3324-87D8-07F08BA87627}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame|Win64.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development Editor|Win64.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development|Win64.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development|Win64.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development|Win64-arm64.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Shipping|Win64.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Shipping|Win64.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {E0302B34-E7F8-3044-845E-FB3E7891E383}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame|Win64.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development Editor|Win64.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development|Win64.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development|Win64.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development|Win64-arm64.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Shipping|Win64.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Shipping|Win64.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4D561E9F-690D-3523-9569-02447B96CB71}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame|Win64.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development Editor|Win64.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development|Win64.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development|Win64.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development|Win64-arm64.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Shipping|Win64.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Shipping|Win64.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame|Win64.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development Editor|Win64.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development|Win64.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development|Win64.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development|Win64-arm64.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Shipping|Win64.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Shipping|Win64.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame|Win64.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development Editor|Win64.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development|Win64.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development|Win64.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development|Win64-arm64.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Shipping|Win64.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Shipping|Win64.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B6A42E3E-4470-300E-B2BE-829F485953D1}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame|Win64.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development Editor|Win64.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development|Win64.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development|Win64.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development|Win64-arm64.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Shipping|Win64.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Shipping|Win64.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {92186E5B-6D47-371B-9E53-9206A2CEA89D}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame|Win64.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development Editor|Win64.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development|Win64.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development|Win64.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development|Win64-arm64.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Shipping|Win64.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Shipping|Win64.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {53211AF7-F542-387E-A2DF-A75D2B82F39C}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame|Win64.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development Editor|Win64.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development|Win64.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development|Win64.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development|Win64-arm64.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Shipping|Win64.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Shipping|Win64.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame|Win64.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development Editor|Win64.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development|Win64.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development|Win64.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development|Win64-arm64.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Shipping|Win64.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Shipping|Win64.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A9B62012-4EAF-34A1-9323-E142679B1ACA}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame|Win64.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development Editor|Win64.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development|Win64.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development|Win64.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development|Win64-arm64.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Shipping|Win64.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Shipping|Win64.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A8AC81D3-6265-3755-9147-493C254FF6C4}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame|Win64.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development Editor|Win64.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development|Win64.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development|Win64.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development|Win64-arm64.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Shipping|Win64.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Shipping|Win64.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {451D771D-C99E-335B-958A-27F67F58DE8F}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame|Win64.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development Editor|Win64.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development|Win64.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development|Win64.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development|Win64-arm64.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Shipping|Win64.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Shipping|Win64.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {4F28FB94-E997-3D55-AB03-CF19DB275D80}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame|Win64.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development Editor|Win64.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development|Win64.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development|Win64.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development|Win64-arm64.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Shipping|Win64.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Shipping|Win64.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame|Win64.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development Editor|Win64.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development|Win64.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development|Win64.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development|Win64-arm64.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Shipping|Win64.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Shipping|Win64.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {59FC365F-CDA3-3A94-827D-67BBF3813353}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame|Win64.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development Editor|Win64.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development|Win64.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development|Win64.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development|Win64-arm64.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Shipping|Win64.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Shipping|Win64.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {91FEBD14-808F-38CD-978A-E857A7BAAC5D}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame|Win64.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development Editor|Win64.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development|Win64.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development|Win64.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development|Win64-arm64.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Shipping|Win64.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Shipping|Win64.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {5349E287-4240-3E67-9897-FED50C2AE556}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame|Win64.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development Editor|Win64.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development|Win64.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development|Win64.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development|Win64-arm64.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Shipping|Win64.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Shipping|Win64.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {79F94956-8D6F-306D-A577-7F99AD139572}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame|Win64.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development Editor|Win64.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development|Win64.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development|Win64.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development|Win64-arm64.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Shipping|Win64.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Shipping|Win64.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {B4B0903B-6890-3551-948C-438EA4F2BEB6}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame|Win64.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development Editor|Win64.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development|Win64.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development|Win64.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development|Win64-arm64.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Shipping|Win64.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Shipping|Win64.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {59FB50D8-8426-3564-84FA-3E22E00F80FC}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame|Win64.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development Editor|Win64.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development|Win64.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development|Win64.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development|Win64-arm64.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Shipping|Win64.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Shipping|Win64.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {7B378AEC-A757-3495-A0F1-03DF2B52CED1}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame|Win64.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development Editor|Win64.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development|Win64.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development|Win64.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development|Win64-arm64.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Shipping|Win64.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Shipping|Win64.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame|Win64.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development Editor|Win64.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development|Win64.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development|Win64.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development|Win64-arm64.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Shipping|Win64.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Shipping|Win64.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {31A51F5F-A35D-3F09-9CDE-A31564BF803C}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame Editor|Win64.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame Editor|Win64.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame Editor|Win64-arm64.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame|Win64.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame|Win64.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame|Win64-arm64.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame|Win64-arm64.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.DebugGame|Win64-arm64ec.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development Editor|Win64.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development Editor|Win64.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development Editor|Win64-arm64.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development Editor|Win64-arm64.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development Editor|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development Editor|Win64-arm64ec.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development|Win64.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development|Win64.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development|Win64-arm64.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development|Win64-arm64.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Development|Win64-arm64ec.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Shipping|Win64.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Shipping|Win64.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Shipping|Win64-arm64.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Shipping|Win64-arm64.Build.0 = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Shipping|Win64-arm64ec.ActiveCfg = Development|Any CPU - {A8675E24-7134-30DD-8AF0-1872B14FCA4D}.Shipping|Win64-arm64ec.Build.0 = Development|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {946A1CC0-A2A3-3A77-8951-222D020517D6} = {233774A8-CC9D-3FA9-86D1-90573E92B704} - {84B02190-1FCF-33EF-89EF-80E9C5CE429C} = {DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6} - {43E57E52-04E5-3257-88A5-50632C412FDC} = {A338B9E2-A559-34BE-A46D-F789DD488FAD} - {BFE7E08E-7837-341D-BC77-3E71777923FF} = {A338B9E2-A559-34BE-A46D-F789DD488FAD} - {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} = {A338B9E2-A559-34BE-A46D-F789DD488FAD} - {7B5CFB44-F0FB-31DF-AE62-C3C096A29A7B} = {A338B9E2-A559-34BE-A46D-F789DD488FAD} - {57713676-9DBE-331C-AD10-26632AC9EE0C} = {A338B9E2-A559-34BE-A46D-F789DD488FAD} - {A589F961-898E-3EBA-91E1-3B8019962EE5} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {DF5C5E19-909F-365D-A6D8-DB22D187EB72} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {D034040A-F317-347E-A81B-DE5A4308E94C} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {57076FBC-3CBF-3D59-81D7-2B052C9A4ABF} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {D32C9219-DCBB-3AF4-BB16-F5539FD023EF} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {6A9855AA-1744-3D80-A76F-DD6D720664DE} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {5FD7ADAB-C355-3595-B9B8-59CD9D8B3522} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {6FC07F62-9C95-3BE7-88BD-6698278B1C2A} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {2488E2C3-DEEA-3AEF-A0E8-6D30B64E4FC2} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {FB71B73F-1CDF-310C-97E3-F48509BD95E6} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {D614D47E-15EB-395E-92FE-9103D3ECEC87} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {2394F351-1451-3CE6-AD6C-88F8494ED347} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {B900E2A0-9249-3C7E-B322-9079936652F3} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {8CD34826-6580-3C58-8E33-39B97714492F} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {BF3D533F-DE13-3ABB-A71A-6EED5310FC22} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {8BE77053-A431-39E8-9BE8-EB652075B8D3} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {625F44D8-435A-350B-90D2-0C9FD88B1A02} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {F5FF918F-3AC8-36D9-B581-89E91EA2F2D0} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {107CCFD7-38D4-3F69-9888-BFDBB2327123} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {C475C301-055A-3664-B0AC-69C6E976B23A} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {C1F8D193-FFC0-32CB-BA2B-9DB5716FE3C5} = {0BFBE63A-B98A-3411-8EEB-8918FEC737B3} - {C1A415AA-21AB-3E86-831C-7AB6504230F5} = {7B5CFB44-F0FB-31DF-AE62-C3C096A29A7B} - {7CEA1861-395D-3324-87D8-07F08BA87627} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {E0302B34-E7F8-3044-845E-FB3E7891E383} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {4D561E9F-690D-3523-9569-02447B96CB71} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {4A6787C3-BCFD-3183-A9BA-3C865DED66A6} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {D54AA9CE-DD1A-359E-98BB-8C9C304A07A3} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {B6A42E3E-4470-300E-B2BE-829F485953D1} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {92186E5B-6D47-371B-9E53-9206A2CEA89D} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {53211AF7-F542-387E-A2DF-A75D2B82F39C} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {AA0BFCC0-404F-3653-B7F7-9648C8D23C05} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {A9B62012-4EAF-34A1-9323-E142679B1ACA} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {A8AC81D3-6265-3755-9147-493C254FF6C4} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {451D771D-C99E-335B-958A-27F67F58DE8F} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {4F28FB94-E997-3D55-AB03-CF19DB275D80} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {1B762D57-1F64-3E71-9C2C-105EAD1D6BF4} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {59FC365F-CDA3-3A94-827D-67BBF3813353} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {91FEBD14-808F-38CD-978A-E857A7BAAC5D} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {5349E287-4240-3E67-9897-FED50C2AE556} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {79F94956-8D6F-306D-A577-7F99AD139572} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {B4B0903B-6890-3551-948C-438EA4F2BEB6} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {59FB50D8-8426-3564-84FA-3E22E00F80FC} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {7B378AEC-A757-3495-A0F1-03DF2B52CED1} = {57713676-9DBE-331C-AD10-26632AC9EE0C} - {6688DE01-06D0-37B8-A7E8-7DCB0B73C467} = {C2F57ECE-B26F-39D8-BDA7-C1D40BD8F180} - {31A51F5F-A35D-3F09-9CDE-A31564BF803C} = {C2F57ECE-B26F-39D8-BDA7-C1D40BD8F180} - {A8675E24-7134-30DD-8AF0-1872B14FCA4D} = {C2F57ECE-B26F-39D8-BDA7-C1D40BD8F180} - EndGlobalSection -EndGlobal diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/UnrealNewtonProject1.uproject b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/UnrealNewtonProject1.uproject deleted file mode 100644 index 9c29ffb0fa..0000000000 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/UnrealNewtonProject1/UnrealNewtonProject1.uproject +++ /dev/null @@ -1,22 +0,0 @@ -{ - "FileVersion": 3, - "EngineAssociation": "5.4", - "Category": "", - "Description": "", - "Modules": [ - { - "Name": "UnrealNewtonProject1", - "Type": "Runtime", - "LoadingPhase": "Default" - } - ], - "Plugins": [ - { - "Name": "ModelingToolsEditorMode", - "Enabled": true, - "TargetAllowList": [ - "Editor" - ] - } - ] -} \ No newline at end of file diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.dll b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.dll index 38d65ef835..f84c880ed0 100644 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.dll and b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.dll differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/ExampleLibrary.dll.recipe b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/ExampleLibrary.dll.recipe index 60a4bfd45c..15083e3fda 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/ExampleLibrary.dll.recipe +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/ExampleLibrary.dll.recipe @@ -2,7 +2,7 @@ - C:\Unreal Projects\newtonPlugin\Plugins\newton\Source\ThirdParty\newtonLibrary\x64\Release\ExampleLibrary.dll + C:\Development\newton-dynamics\newton-4.00\applications\toolsAndWrapers\newtonUnreal\newton\Source\ThirdParty\newtonLibrary\x64\Release\ExampleLibrary.dll diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/vc143.pdb b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/vc143.pdb index 93c00f3082..aa419e986b 100644 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/vc143.pdb and b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/vc143.pdb differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.cpp index 3ab38ddf8f..2ff383a59b 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.cpp +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.cpp @@ -54,6 +54,64 @@ ndShape::~ndShape() ndAssert(m_refCount.load() == 0); } +ndShapeInfo::ndShapeInfo() + :m_offsetMatrix(ndGetIdentityMatrix()) + , m_scale(ndFloat32(1.0f)) + , m_shapeMaterial() + , m_collisionType(::m_box) +{ + for (ndInt32 i = 0; i < sizeof(m_paramArray) / sizeof(m_paramArray[0]); ++i) + { + m_paramArray[i] = ndFloat32(0); + } +} + +ndUnsigned64 ndShapeInfo::GetHash(ndUnsigned64 hash) +{ + ndInt32 id = m_collisionType; + hash = ndCRC64(m_paramArray, sizeof(m_paramArray), hash); + hash = ndCRC64(&id, sizeof(id), hash); + return hash; +} + +ndInt32 ndShape::GetConvexVertexCount() const +{ + return 0; +} + +ndFloat32 ndShape::CalculateMassProperties(const ndMatrix&, ndVector&, ndVector&, ndVector&) const +{ + ndAssert(0); + return 0; +} + +ndMatrix ndShape::CalculateInertiaAndCenterOfMass(const ndMatrix&, const ndVector&, const ndMatrix&) const +{ + ndAssert(0); + return ndGetZeroMatrix(); +} + +ndVector ndShape::GetObbOrigin() const +{ + return m_boxOrigin; +} + +ndVector ndShape::GetObbSize() const +{ + return m_boxSize; +} + +ndFloat32 ndShape::GetUmbraClipSize() const +{ + return ndFloat32(3.0f) * GetBoxMaxRadius(); +} + +ndUnsigned64 ndShape::GetHash(ndUnsigned64 hash) const +{ + ndAssert(0); + return hash; +} + void ndShape::MassProperties() { // using general central theorem, to extract the Inertia relative to the center of mass diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.h index c6c1dc5541..f0fc05191e 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.h +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShape.h @@ -176,7 +176,6 @@ struct ndHeighfieldInfo ndInt32 m_width; ndInt32 m_height; ndInt32 m_gridsDiagonals; - ndFloat32 m_verticalScale; ndFloat32 m_horizonalScale_x; ndFloat32 m_horizonalScale_z; ndReal* m_elevation; @@ -210,7 +209,6 @@ class ndShapeInfo ndChamferCylinderInfo m_chamferCylinder; ndFloat32 m_paramArray[32]; }; - } D_GCC_NEWTON_ALIGN_32; D_MSV_NEWTON_ALIGN_32 @@ -240,17 +238,17 @@ class ndShape: public ndContainersFreeListAlloc virtual ndShapeChamferCylinder* GetAsShapeChamferCylinder() { return nullptr; } virtual ndShapeStaticProceduralMesh* GetAsShapeStaticProceduralMesh() { return nullptr; } - virtual ndInt32 GetConvexVertexCount() const; + D_COLLISION_API virtual ndInt32 GetConvexVertexCount() const; - ndVector GetObbSize() const; - ndVector GetObbOrigin() const; - ndFloat32 GetUmbraClipSize() const; + D_COLLISION_API ndVector GetObbSize() const; + D_COLLISION_API ndVector GetObbOrigin() const; + D_COLLISION_API ndFloat32 GetUmbraClipSize() const; D_COLLISION_API virtual void MassProperties(); + D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; + D_COLLISION_API virtual ndMatrix CalculateInertiaAndCenterOfMass(const ndMatrix& alignMatrix, const ndVector& localScale, const ndMatrix& matrix) const; + D_COLLISION_API virtual ndFloat32 CalculateMassProperties(const ndMatrix& offset, ndVector& inertia, ndVector& crossInertia, ndVector& centerOfMass) const; - virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const = 0; - - virtual ndShapeInfo GetShapeInfo() const; virtual ndFloat32 GetVolume() const = 0; virtual ndFloat32 GetBoxMinRadius() const = 0; virtual ndFloat32 GetBoxMaxRadius() const = 0; @@ -263,9 +261,7 @@ class ndShape: public ndContainersFreeListAlloc virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const = 0; virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& globalPlane, const ndShapeInstance& parentScale) const = 0; virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const = 0; - - virtual ndMatrix CalculateInertiaAndCenterOfMass(const ndMatrix& alignMatrix, const ndVector& localScale, const ndMatrix& matrix) const; - virtual ndFloat32 CalculateMassProperties(const ndMatrix& offset, ndVector& inertia, ndVector& crossInertia, ndVector& centerOfMass) const; + virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const = 0; protected: D_COLLISION_API ndShape(ndShapeID id); @@ -281,64 +277,6 @@ class ndShape: public ndContainersFreeListAlloc static ndVector m_flushZero; } D_GCC_NEWTON_ALIGN_32; -inline ndShapeInfo::ndShapeInfo() - :m_offsetMatrix(ndGetIdentityMatrix()) - ,m_scale(ndFloat32 (1.0f)) - ,m_shapeMaterial() - ,m_collisionType(::m_box) -{ - for (ndInt32 i = 0; i < sizeof(m_paramArray) / sizeof(m_paramArray[0]); ++i) - { - m_paramArray[i] = ndFloat32(0); - } -} - -inline ndUnsigned64 ndShapeInfo::GetHash(ndUnsigned64 hash) -{ - ndInt32 id = m_collisionType; - hash = ndCRC64(m_paramArray, sizeof (m_paramArray), hash); - hash = ndCRC64(&id, sizeof(id), hash); - return hash; -} - -inline ndInt32 ndShape::GetConvexVertexCount() const -{ - return 0; -} - -inline ndFloat32 ndShape::CalculateMassProperties(const ndMatrix&, ndVector&, ndVector&, ndVector&) const -{ - ndAssert(0); - return 0; -} - -inline ndMatrix ndShape::CalculateInertiaAndCenterOfMass(const ndMatrix&, const ndVector&, const ndMatrix&) const -{ - ndAssert(0); - return ndGetZeroMatrix(); -} - -inline ndVector ndShape::GetObbOrigin() const -{ - return m_boxOrigin; -} - -inline ndVector ndShape::GetObbSize() const -{ - return m_boxSize; -} - -inline ndFloat32 ndShape::GetUmbraClipSize() const -{ - return ndFloat32(3.0f) * GetBoxMaxRadius(); -} - -inline ndUnsigned64 ndShape::GetHash(ndUnsigned64 hash) const -{ - ndAssert(0); - return hash; -} - #endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.cpp index 395c493858..eeabd3d311 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.cpp +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.cpp @@ -35,6 +35,66 @@ ndShapeStaticMesh::~ndShapeStaticMesh() { } +ndFloat32 ndShapeStaticMesh::GetVolume() const +{ + return ndFloat32(0.0f); +} + +ndFloat32 ndShapeStaticMesh::GetBoxMinRadius() const +{ + return ndFloat32(0.0f); +} + +ndFloat32 ndShapeStaticMesh::GetBoxMaxRadius() const +{ + return ndFloat32(0.0f); +} + +ndVector ndShapeStaticMesh::SupportVertex(const ndVector&) const +{ + ndAssert(0); + return ndVector::m_zero; +} + +ndVector ndShapeStaticMesh::SupportVertexSpecial(const ndVector& dir, ndFloat32) const +{ + ndAssert(0); + return SupportVertex(dir); +} + +ndVector ndShapeStaticMesh::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector&) const +{ + return point; +} + +ndInt32 ndShapeStaticMesh::CalculatePlaneIntersection(const ndVector&, const ndVector&, ndVector* const) const +{ + return 0; +} + +ndVector ndShapeStaticMesh::CalculateVolumeIntegral(const ndMatrix&, const ndVector&, const ndShapeInstance&) const +{ + return ndVector::m_zero; +} + +ndShapeStaticMesh* ndShapeStaticMesh::GetAsShapeStaticMesh() +{ + return this; +} + +void ndShapeStaticMesh::DebugShape(const ndMatrix&, ndShapeDebugNotify&) const +{ +} + +ndFloat32 ndShapeStaticMesh::RayCast(ndRayCastNotify&, const ndVector&, const ndVector&, ndFloat32, const ndBody* const, ndContactPoint&) const +{ + return ndFloat32(1.2f); +} + +void ndShapeStaticMesh::GetCollidingFaces(ndPolygonMeshDesc* const) const +{ +} + void ndShapeStaticMesh::CalculateAabb(const ndMatrix& matrix, ndVector &p0, ndVector &p1) const { ndVector origin(matrix.TransformVector(m_boxOrigin)); diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.h index 8a974b7a5f..1cce5fc1ef 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.h +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStaticMesh.h @@ -35,20 +35,20 @@ class ndShapeStaticMesh: public ndShape D_COLLISION_API ndShapeStaticMesh(ndShapeID id); D_COLLISION_API virtual ~ndShapeStaticMesh(); - virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; + D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; + D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; + D_COLLISION_API virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; protected: - virtual ndFloat32 GetVolume() const; - virtual ndFloat32 GetBoxMinRadius() const; - virtual ndFloat32 GetBoxMaxRadius() const; - virtual ndShapeStaticMesh* GetAsShapeStaticMesh(); - virtual ndVector SupportVertex(const ndVector& dir) const; - virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& plane, const ndShapeInstance& parentScale) const; + D_COLLISION_API virtual ndFloat32 GetVolume() const; + D_COLLISION_API virtual ndFloat32 GetBoxMinRadius() const; + D_COLLISION_API virtual ndFloat32 GetBoxMaxRadius() const; + D_COLLISION_API virtual ndShapeStaticMesh* GetAsShapeStaticMesh(); + D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const; + D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; + D_COLLISION_API virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; + D_COLLISION_API virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; + D_COLLISION_API virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& plane, const ndShapeInstance& parentScale) const; D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; D_COLLISION_API ndInt32 CalculatePlaneIntersection(const ndFloat32* const vertex, const ndInt32* const index, ndInt32 indexCount, ndInt32 strideInFloat, const ndPlane& localPlane, ndVector* const contactsOut) const; @@ -67,66 +67,6 @@ class ndShapeStaticMesh: public ndShape } D_GCC_NEWTON_ALIGN_32; }; -inline ndFloat32 ndShapeStaticMesh::GetVolume() const -{ - return ndFloat32(0.0f); -} - -inline ndFloat32 ndShapeStaticMesh::GetBoxMinRadius() const -{ - return ndFloat32(0.0f); -} - -inline ndFloat32 ndShapeStaticMesh::GetBoxMaxRadius() const -{ - return ndFloat32(0.0f); -} - -inline ndVector ndShapeStaticMesh::SupportVertex(const ndVector&) const -{ - ndAssert(0); - return ndVector::m_zero; -} - -inline ndVector ndShapeStaticMesh::SupportVertexSpecial(const ndVector& dir, ndFloat32) const -{ - ndAssert(0); - return SupportVertex(dir); -} - -inline ndVector ndShapeStaticMesh::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector&) const -{ - return point; -} - -inline ndInt32 ndShapeStaticMesh::CalculatePlaneIntersection(const ndVector&, const ndVector&, ndVector* const) const -{ - return 0; -} - -inline ndVector ndShapeStaticMesh::CalculateVolumeIntegral(const ndMatrix&, const ndVector&, const ndShapeInstance&) const -{ - return ndVector::m_zero; -} - -inline ndShapeStaticMesh* ndShapeStaticMesh::GetAsShapeStaticMesh() -{ - return this; -} - - -inline void ndShapeStaticMesh::DebugShape(const ndMatrix&, ndShapeDebugNotify&) const -{ -} - -inline ndFloat32 ndShapeStaticMesh::RayCast(ndRayCastNotify&, const ndVector&, const ndVector&, ndFloat32, const ndBody* const, ndContactPoint&) const -{ - return ndFloat32(1.2f); -} - -inline void ndShapeStaticMesh::GetCollidingFaces(ndPolygonMeshDesc* const) const -{ -} #endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.cpp index f171ae768e..df643bed57 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.cpp +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.cpp @@ -90,6 +90,16 @@ ndShapeStatic_bvh::~ndShapeStatic_bvh(void) { } +void* ndShapeStatic_bvh::operator new (size_t size) +{ + return ndShapeStaticMesh::operator new (size); +} + +void ndShapeStatic_bvh::operator delete (void* ptr) +{ + ndShapeStaticMesh::operator delete(ptr); +} + ndIntersectStatus ndShapeStatic_bvh::GetTriangleCount(void* const context, const ndFloat32* const, ndInt32, const ndInt32* const, ndInt32 indexCount, ndFloat32) { ndMeshVertexListIndexList& data = (*(ndMeshVertexListIndexList*)context); diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.h index 52298735a2..67daea96ed 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.h +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCollision/ndShapeStatic_bvh.h @@ -33,18 +33,17 @@ class ndShapeStatic_bvh: public ndShapeStaticMesh, public ndAabbPolygonSoup D_COLLISION_API ndShapeStatic_bvh(); D_COLLISION_API ndShapeStatic_bvh(const ndPolygonSoupBuilder& builder); D_COLLISION_API virtual ~ndShapeStatic_bvh(); - - void *operator new (size_t size); - void operator delete (void* ptr); + D_COLLISION_API void *operator new (size_t size); + D_COLLISION_API void operator delete (void* ptr); protected: D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; virtual ndShapeStatic_bvh* GetAsShapeStaticBVH() { return this; } - virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; + D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; + D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; + D_COLLISION_API virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; static ndFloat32 RayHit(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount); static ndIntersectStatus ShowDebugPolygon(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); @@ -52,7 +51,6 @@ class ndShapeStatic_bvh: public ndShapeStaticMesh, public ndAabbPolygonSoup static ndIntersectStatus GetPolygon(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); private: - static ndIntersectStatus CalculateHash ( void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); @@ -62,15 +60,4 @@ class ndShapeStatic_bvh: public ndShapeStaticMesh, public ndAabbPolygonSoup friend class ndContactSolver; }; -inline void* ndShapeStatic_bvh::operator new (size_t size) -{ - return ndShapeStaticMesh::operator new (size); -} - -inline void ndShapeStatic_bvh::operator delete (void* ptr) -{ - ndShapeStaticMesh::operator delete(ptr); -} - - #endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.cpp index 689df33657..7da34dc6cd 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.cpp +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.cpp @@ -33,6 +33,62 @@ #define D_RAY_TOL_ERROR (ndFloat32 (-1.0e-3f)) #define D_RAY_TOL_ADAPTIVE_ERROR (ndFloat32 (1.0e-1f)) +ndFastAabb::ndFastAabb() + :ndMatrix(ndGetIdentityMatrix()) + ,m_absDir(ndGetIdentityMatrix()) + ,m_p0(ndVector::m_zero) + ,m_p1(ndVector::m_zero) + ,m_size(ndVector::m_zero) + ,m_separationDistance(ndFloat32(1.0e10f)) +{ +} + +ndFastAabb::ndFastAabb(const ndMatrix& matrix, const ndVector& size) + :ndMatrix(matrix) + ,m_separationDistance(ndFloat32(1.0e10f)) +{ + SetTransposeAbsMatrix(matrix); + m_size = ndVector(matrix[0].Abs().Scale(size.m_x) + matrix[1].Abs().Scale(size.m_y) + matrix[2].Abs().Scale(size.m_z)); + m_p0 = (matrix[3] - m_size) & ndVector::m_triplexMask; + m_p1 = (matrix[3] + m_size) & ndVector::m_triplexMask; +} + +ndFastAabb::ndFastAabb(const ndVector& p0, const ndVector& p1) + :ndMatrix(ndGetIdentityMatrix()) + ,m_absDir(ndGetIdentityMatrix()) + ,m_p0(p0) + ,m_p1(p1) + ,m_size(ndVector::m_half* (p1 - p0)) + ,m_separationDistance(ndFloat32(1.0e10f)) +{ + m_posit = (ndVector::m_half * (p1 + p0)) | ndVector::m_wOne; + ndAssert(m_size.m_w == ndFloat32(0.0f)); + ndAssert(m_posit.m_w == ndFloat32(1.0f)); +} + +const ndVector& ndFastAabb::GetOrigin() const +{ + return m_p0; +} + +const ndVector& ndFastAabb::GetTarget() const +{ + return m_p1; +} + +void ndFastAabb::SetSeparatingDistance(const ndFloat32 distance) +{ + m_separationDistance = distance; +} + +void ndFastAabb::SetTransposeAbsMatrix(const ndMatrix& matrix) +{ + m_absDir = matrix.Transpose3x3(); + m_absDir[0] = m_absDir[0].Abs(); + m_absDir[1] = m_absDir[1].Abs(); + m_absDir[2] = m_absDir[2].Abs(); +} + void ndFastAabb::MakeBox1(ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray, ndVector& minBox, ndVector& maxBox) const { ndVector faceBoxP0(&vertexArray[indexArray[0] * stride]); diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.h index e45278b89b..0ad736b9aa 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.h +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndFastAabb.h @@ -31,15 +31,15 @@ D_MSV_NEWTON_ALIGN_32 class ndFastAabb : public ndMatrix { public: - ndFastAabb(); - ndFastAabb(const ndVector& p0, const ndVector& p1); - ndFastAabb(const ndMatrix& matrix, const ndVector& size); + D_CORE_API ndFastAabb(); + D_CORE_API ndFastAabb(const ndVector& p0, const ndVector& p1); + D_CORE_API ndFastAabb(const ndMatrix& matrix, const ndVector& size); - const ndVector& GetOrigin() const; - const ndVector& GetTarget() const; + D_CORE_API const ndVector& GetOrigin() const; + D_CORE_API const ndVector& GetTarget() const; - void SetSeparatingDistance(const ndFloat32 distance); - void SetTransposeAbsMatrix(const ndMatrix& matrix); + D_CORE_API void SetSeparatingDistance(const ndFloat32 distance); + D_CORE_API void SetTransposeAbsMatrix(const ndMatrix& matrix); D_CORE_API ndFloat32 PolygonBoxDistance(const ndVector& faceNormal, ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray) const; D_CORE_API ndFloat32 PolygonBoxRayDistance(const ndVector& faceNormal, ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray, const ndFastRay& ray) const; @@ -59,61 +59,6 @@ class ndFastAabb : public ndMatrix friend class ndAabbPolygonSoup; } D_GCC_NEWTON_ALIGN_32 ; -inline ndFastAabb::ndFastAabb() - :ndMatrix(ndGetIdentityMatrix()) - ,m_absDir(ndGetIdentityMatrix()) - ,m_p0(ndVector::m_zero) - ,m_p1(ndVector::m_zero) - ,m_size(ndVector::m_zero) - ,m_separationDistance(ndFloat32(1.0e10f)) -{ -} - -inline ndFastAabb::ndFastAabb(const ndMatrix& matrix, const ndVector& size) - :ndMatrix(matrix) - ,m_separationDistance(ndFloat32(1.0e10f)) -{ - SetTransposeAbsMatrix(matrix); - m_size = ndVector(matrix[0].Abs().Scale(size.m_x) + matrix[1].Abs().Scale(size.m_y) + matrix[2].Abs().Scale(size.m_z)); - m_p0 = (matrix[3] - m_size) & ndVector::m_triplexMask; - m_p1 = (matrix[3] + m_size) & ndVector::m_triplexMask; -} - -inline ndFastAabb::ndFastAabb(const ndVector& p0, const ndVector& p1) - :ndMatrix(ndGetIdentityMatrix()) - ,m_absDir(ndGetIdentityMatrix()) - ,m_p0(p0) - ,m_p1(p1) - ,m_size(ndVector::m_half * (p1 - p0)) - ,m_separationDistance(ndFloat32(1.0e10f)) -{ - m_posit = (ndVector::m_half * (p1 + p0)) | ndVector::m_wOne; - ndAssert(m_size.m_w == ndFloat32(0.0f)); - ndAssert(m_posit.m_w == ndFloat32(1.0f)); -} - -inline const ndVector& ndFastAabb::GetOrigin() const -{ - return m_p0; -} - -inline const ndVector& ndFastAabb::GetTarget() const -{ - return m_p1; -} - -inline void ndFastAabb::SetSeparatingDistance(const ndFloat32 distance) -{ - m_separationDistance = distance; -} - -inline void ndFastAabb::SetTransposeAbsMatrix(const ndMatrix& matrix) -{ - m_absDir = matrix.Transpose3x3(); - m_absDir[0] = m_absDir[0].Abs(); - m_absDir[1] = m_absDir[1].Abs(); - m_absDir[2] = m_absDir[2].Abs(); -} #endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.cpp index 75403f9a93..2ccec82193 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.cpp +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.cpp @@ -50,4 +50,28 @@ void ndPolygonSoupDatabase::SetTagId(const ndInt32* const facePtr, ndInt32 index face[indexCount] = newID; } +ndInt32 ndPolygonSoupDatabase::GetVertexCount() const +{ + return m_vertexCount; +} + +ndFloat32* ndPolygonSoupDatabase::GetLocalVertexPool() const +{ + return m_localVertex; +} + +ndInt32 ndPolygonSoupDatabase::GetStrideInBytes() const +{ + return m_strideInBytes; +} + +ndFloat32 ndPolygonSoupDatabase::GetRadius() const +{ + return ndFloat32(0.0f); +} + +ndUnsigned32 ndPolygonSoupDatabase::GetTagId(const ndInt32* const face, ndInt32 indexCount) const +{ + return ndUnsigned32(face[indexCount]); +} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.h index fc2418432c..2bfed7cf51 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.h +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndPolygonSoupDatabase.h @@ -26,50 +26,27 @@ #include "ndTypes.h" #include "ndClassAlloc.h" +D_MSV_NEWTON_ALIGN_32 class ndPolygonSoupDatabase: public ndClassAlloc { public: - ndFloat32 GetRadius() const; - ndInt32 GetVertexCount() const; - ndInt32 GetStrideInBytes() const; - ndFloat32* GetLocalVertexPool() const; + D_CORE_API ndFloat32 GetRadius() const; + D_CORE_API ndInt32 GetVertexCount() const; + D_CORE_API ndInt32 GetStrideInBytes() const; + D_CORE_API ndFloat32* GetLocalVertexPool() const; - ndUnsigned32 GetTagId(const ndInt32* const face, ndInt32 indexCount) const; - void SetTagId(const ndInt32* const face, ndInt32 indexCount, ndUnsigned32 newID) const; + D_CORE_API ndUnsigned32 GetTagId(const ndInt32* const face, ndInt32 indexCount) const; + D_CORE_API void SetTagId(const ndInt32* const face, ndInt32 indexCount, ndUnsigned32 newID) const; protected: - ndPolygonSoupDatabase(const char* const name = nullptr); - virtual ~ndPolygonSoupDatabase (); + D_CORE_API ndPolygonSoupDatabase(const char* const name = nullptr); + D_CORE_API virtual ~ndPolygonSoupDatabase (); ndInt32 m_vertexCount; ndInt32 m_strideInBytes; ndFloat32* m_localVertex; }; - -inline ndInt32 ndPolygonSoupDatabase::GetVertexCount() const -{ - return m_vertexCount; -} - -inline ndFloat32* ndPolygonSoupDatabase::GetLocalVertexPool() const -{ - return m_localVertex; -} - -inline ndInt32 ndPolygonSoupDatabase::GetStrideInBytes() const -{ - return m_strideInBytes; -} - -inline ndFloat32 ndPolygonSoupDatabase::GetRadius() const -{ - return ndFloat32 (0.0f); -} - -inline ndUnsigned32 ndPolygonSoupDatabase::GetTagId(const ndInt32* const face, ndInt32 indexCount) const -{ - return ndUnsigned32(face[indexCount]); -} +D_GCC_NEWTON_ALIGN_32; #endif diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.dll b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.dll index 38d65ef835..f84c880ed0 100644 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.dll and b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.dll differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.lib b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.lib index 3ab6edd242..2f3dac11da 100644 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.lib and b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.lib differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.pdb b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.pdb index bd739b1953..68966eca90 100644 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.pdb and b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.pdb differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.lib b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.lib index c748360f82..89f2d7c411 100644 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.lib and b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.lib differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.pdb b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.pdb index 2c77eef9db..b720da04be 100644 Binary files a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.pdb and b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.pdb differ diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollision.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollision.cpp index 0a36b6d377..27b546e0ec 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollision.cpp +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollision.cpp @@ -7,17 +7,12 @@ #include "Newton.h" #include "NewtonRigidBody.h" #include "NewtonWorldActor.h" -#include "NewtonSceneActor.h" #include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" // Sets default values for this component's properties UNewtonCollision::UNewtonCollision() :Super() { - // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features - // off to improve performance if you don't need them. - //PrimaryComponentTick.bCanEverTick = true; - m_hash = 0; m_shape = nullptr; m_showDebug = false; @@ -26,8 +21,8 @@ UNewtonCollision::UNewtonCollision() BestFit = false; CastShadow = 0; + m_savedMeshComponent = nullptr; bExplicitShowWireframe = true; - m_geometryMesh = TObjectPtr(nullptr); m_visualMesh = TSharedPtr(nullptr); ConstructorHelpers::FObjectFinder TexObj(TEXT("/newton/NewtonTransparentMaterial")); @@ -50,25 +45,13 @@ void UNewtonCollision::OnUnregister() m_shape = nullptr; } m_hash = 0; + m_savedMeshComponent = nullptr; m_visualMesh = TSharedPtr(nullptr); } -//USceneComponent* UNewtonCollision::GetGeometryMesh() const -TObjectPtr UNewtonCollision::GetGeometryMesh() const -{ - return m_geometryMesh; -} - -//void UNewtonCollision::SetGeometryMesh(USceneComponent* const geometry) -void UNewtonCollision::SetGeometryMesh(const TObjectPtr& geometry) +void UNewtonCollision::SetGeometryMesh(USceneComponent* const staticMesh) { - m_geometryMesh = geometry; -} - -void UNewtonCollision::Serialize(FArchive& ar) -{ - Super::Serialize(ar); - ar << m_geometryMesh; + m_savedMeshComponent = staticMesh; } void UNewtonCollision::PostLoad() @@ -131,15 +114,6 @@ ndShape* UNewtonCollision::CreateShape() const void UNewtonCollision::BuildNewtonShape() { - const ANewtonSceneActor* const owner = Cast(GetOwner()); - if (owner) - { - const FTransform bodyTransform(owner->GetRootComponent()->GetComponentToWorld()); - const FTransform meshTransform(m_geometryMesh->GetComponentToWorld()); - const FTransform transform(meshTransform * bodyTransform.Inverse()); - SetComponentToWorld(transform); - } - long long hash = CalculateHash(); if (m_hash != hash) { @@ -256,11 +230,6 @@ void UNewtonCollision::ApplyPropertyChanges() ndArray m_points; }; - if (m_geometryMesh.Get()) - { - m_debugVisualIsDirty = true; - } - m_propertyChanged = false; if (m_shape) @@ -321,6 +290,40 @@ void UNewtonCollision::ApplyPropertyChanges() } } +UStaticMesh* UNewtonCollision::FindStaticMesh() const +{ + if (m_savedMeshComponent) + { + UStaticMeshComponent* const staticMesh = Cast(m_savedMeshComponent); + return staticMesh ? staticMesh->GetStaticMesh().Get() : (UStaticMesh*) nullptr; + } + + const UStaticMeshComponent* const mesh = Cast(GetAttachParent()); + if (mesh && mesh->GetStaticMesh().Get()) + { + return mesh->GetStaticMesh().Get(); + } + + return nullptr; +} + +void UNewtonCollision::SetGlobalTransform() +{ + UStaticMesh* const staticMesh = FindStaticMesh(); + if (staticMesh && m_savedMeshComponent) + { + //const ANewtonSceneActor* const owner = Cast(GetOwner()); + const AActor* const owner = GetOwner(); + check(owner); + const FTransform bodyTransform(owner->GetRootComponent()->GetComponentToWorld()); + const FTransform globalTransform(m_savedMeshComponent->GetComponentToWorld()); + const FTransform localTransform(globalTransform * bodyTransform.Inverse()); + + SetRelativeTransform(localTransform); + SetComponentToWorld(globalTransform); + } +} + ndVector UNewtonCollision::GetVolumePosition() const { ndVector posit(0.0f); diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollision.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollision.h index 68858b6f88..5c50abcbb3 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollision.h +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollision.h @@ -26,9 +26,9 @@ class UNewtonCollision : public UDynamicMeshComponent // Sets default values for this component's properties UNewtonCollision(); + virtual void SetGlobalTransform(); virtual ndVector GetVolumePosition() const; - TObjectPtr GetGeometryMesh() const; - void SetGeometryMesh(const TObjectPtr& tile); + void SetGeometryMesh(USceneComponent* const staticMesh); virtual void SetWireFrameColor(const FLinearColor& color); protected: @@ -41,12 +41,13 @@ class UNewtonCollision : public UDynamicMeshComponent virtual void PostLoad() override; virtual void OnAttachmentChanged(); virtual void BeginDestroy() override; - virtual void Serialize(FArchive& Ar) override; virtual bool ShouldCreatePhysicsState() const override; virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; virtual void BuildNewtonShape(); virtual void ApplyPropertyChanges(); + virtual UStaticMesh* FindStaticMesh() const; + virtual ndShape* CreateShape() const; virtual long long CalculateHash() const; virtual ndShapeInstance* CreateInstanceShape() const; @@ -55,7 +56,7 @@ class UNewtonCollision : public UDynamicMeshComponent //public: long long m_hash; ndShape* m_shape; - TObjectPtr m_geometryMesh; + USceneComponent* m_savedMeshComponent; TSharedPtr m_visualMesh; UMaterial* m_transparentMaterial; bool m_propertyChanged; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionConvexHull.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionConvexHull.cpp index ff62126b67..71b4c8138a 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionConvexHull.cpp +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionConvexHull.cpp @@ -42,50 +42,8 @@ long long UNewtonCollisionConvexHull::CalculateHash() const long long hash = ndCRC64(ndShapeConvexHull::StaticClassName(), strlen(ndShapeConvexHull::StaticClassName()), 0); if (m_proceduralData.Num()) { - for (int i = m_proceduralData.Num() - 1; i >= 0; --i) - { - const FVector3f point(m_proceduralData[i]); - hash = ndCRC64(&point, sizeof(point), hash); - } - } - else - { - auto FindStaticMesh = [this]() - { - const UStaticMeshComponent* const mesh = Cast(GetAttachParent()); - if (mesh && mesh->GetStaticMesh().Get()) - { - return mesh->GetStaticMesh().Get(); - } - UStaticMeshComponent* const staticMesh = Cast(GetGeometryMesh()); - if (staticMesh) - { - - } - return staticMesh ? staticMesh->GetStaticMesh().Get() : (UStaticMesh*) nullptr; - }; - - const UStaticMesh* const staticMesh = FindStaticMesh(); - if (staticMesh) - { - const FStaticMeshRenderData* const renderData = staticMesh->GetRenderData(); - const FStaticMeshLODResourcesArray& renderResource = renderData->LODResources; - - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(0.0f)); - const ndVector bakedScale(scale.Scale(UNREAL_INV_UNIT_SYSTEM)); - - const FStaticMeshLODResources& renderLOD = renderResource[0]; - const FStaticMeshVertexBuffers& staticMeshVertexBuffer = renderLOD.VertexBuffers;; - const FPositionVertexBuffer& positBuffer = staticMeshVertexBuffer.PositionVertexBuffer; - for (int i = positBuffer.GetNumVertices() - 1; i >= 0; --i) - { - const FVector3f p(positBuffer.VertexPosition(i)); - const ndVector q(ndFloat32(p.X), ndFloat32(p.Y), ndFloat32(p.Z), ndFloat32(0.0f)); - const ndVector hashPoint(bakedScale * q); - hash = ndCRC64(&hashPoint, sizeof(hashPoint), hash); - } - } + const FVector3f* const vexterBuffer = &m_proceduralData[0]; + hash = ndCRC64(vexterBuffer, m_proceduralData.Num() * sizeof(FVector3f), hash); } return hash; } @@ -103,22 +61,27 @@ ndShape* UNewtonCollisionConvexHull::CreateShape() const ndShape* const shape = new ndShapeConvexHull(m_proceduralData.Num(), sizeof(ndVector), Tolerance, &points[0].m_x, MaxVertexCount); return shape; } - else + return new ndShapeNull(); +} + +void UNewtonCollisionConvexHull::ApplyPropertyChanges() +{ + if (m_proceduralData.Num() == 0) { - auto FindStaticMesh = [this]() - { - const UStaticMeshComponent* const mesh = Cast(GetAttachParent()); - if (mesh && mesh->GetStaticMesh().Get()) - { - return mesh->GetStaticMesh().Get(); - } - UStaticMeshComponent* const staticMesh = Cast(GetGeometryMesh()); - return staticMesh ? staticMesh->GetStaticMesh().Get() : (UStaticMesh*) nullptr; - }; + m_debugVisualIsDirty = true; const UStaticMesh* const staticMesh = FindStaticMesh(); if (staticMesh) { + const ANewtonSceneActor* const owner = Cast(GetOwner()); + if (owner && m_savedMeshComponent) + { + const FTransform bodyTransform(owner->GetRootComponent()->GetComponentToWorld()); + const FTransform meshTransform(m_savedMeshComponent->GetComponentToWorld()); + const FTransform transform(meshTransform * bodyTransform.Inverse()); + SetComponentToWorld(transform); + } + const FStaticMeshRenderData* const renderData = staticMesh->GetRenderData(); const FStaticMeshLODResourcesArray& renderResource = renderData->LODResources; @@ -130,25 +93,27 @@ ndShape* UNewtonCollisionConvexHull::CreateShape() const const FStaticMeshVertexBuffers& staticMeshVertexBuffer = renderLOD.VertexBuffers;; const FPositionVertexBuffer& positBuffer = staticMeshVertexBuffer.PositionVertexBuffer; - ndArray points; + ndArray points; for (int i = positBuffer.GetNumVertices() - 1; i >= 0; --i) { const FVector3f p(positBuffer.VertexPosition(i)); const ndVector q(ndFloat32(p.X), ndFloat32(p.Y), ndFloat32(p.Z), ndFloat32(0.0f)); points.PushBack(q * bakedScale); } - ndShape* const shape = new ndShapeConvexHull(positBuffer.GetNumVertices(), sizeof(ndVector), Tolerance, &points[0].m_x, MaxVertexCount); - return shape; - } - } - return new ndShapeNull(); -} + ndConvexHull3d convexHull(&points[0].m_x, sizeof(ndBigVector), points.GetCount(), Tolerance, MaxVertexCount); + const ndArray& convexVertex = convexHull.GetVertexPool(); -void UNewtonCollisionConvexHull::ApplyPropertyChanges() -{ - if (m_proceduralData.Num()) - { - m_debugVisualIsDirty = true; + ndHullOutput hullMesh; + for (ndInt32 i = convexVertex.GetCount() - 1; i >= 0; --i) + { + ndHullPoint p; + p.m_x = convexVertex[i].m_x; + p.m_y = convexVertex[i].m_y; + p.m_z = convexVertex[i].m_z; + hullMesh.PushBack(p); + } + SetProceduralData(hullMesh); + } } BuildNewtonShape(); Super::ApplyPropertyChanges(); diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionLandscape.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionLandscape.cpp index ccba839e8b..a224089926 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionLandscape.cpp +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionLandscape.cpp @@ -3,6 +3,7 @@ #include "NewtonCollisionLandscape.h" +#include "Landscape.h" #include "Landscape.h" #include "LandscapeProxy.h" #include "Chaos/HeightField.h" @@ -14,77 +15,141 @@ UNewtonCollisionLandscape::UNewtonCollisionLandscape() :Super() { - //SetMobility(EComponentMobility::Static); + m_scale_x = 0.0f; + m_scale_y = 0.0f; + m_scale_z = 0.0f; + m_tileSize_x = 32; + m_tileSize_y = 32; } -long long UNewtonCollisionLandscape::CalculateHash() const +void UNewtonCollisionLandscape::Serialize(FArchive& ar) { - const ULandscapeHeightfieldCollisionComponent* const tile = Cast(GetGeometryMesh().Get()); - check(tile); + Super::Serialize(ar); - const ULandscapeHeightfieldCollisionComponent::FHeightfieldGeometryRef* const heightfieldRef = tile->HeightfieldRef; - const Chaos::FHeightField* const mapData = heightfieldRef->HeightfieldGeometry; - const Chaos::FHeightField::FData& elevationData = mapData->GeomData; + ar << m_scale_x; + ar << m_scale_y; + ar << m_scale_z; + ar << m_tileSize_x; + ar << m_tileSize_y; - const Chaos::FVec3 elevationScale(elevationData.Scale); - ndFloat32 xScale = elevationScale[0] * UNREAL_INV_UNIT_SYSTEM; - // this is not a bug, y and z are swapped after the mapping - ndFloat32 zScale = elevationScale[1] * UNREAL_INV_UNIT_SYSTEM; - ndFloat32 yScale = elevationScale[2] * UNREAL_INV_UNIT_SYSTEM; + ar << m_materials; + ar << m_heightfield; +} + +void UNewtonCollisionLandscape::SetGlobalTransform() +{ + if (m_savedMeshComponent) + { + const AActor* const owner = GetOwner(); + check(owner); + const FTransform bodyTransform(owner->GetRootComponent()->GetComponentToWorld()); + const FTransform globalTransform(m_savedMeshComponent->GetComponentToWorld()); + const FTransform localTransform(globalTransform * bodyTransform.Inverse()); + + SetRelativeTransform(localTransform); + SetComponentToWorld(globalTransform); + } +} +long long UNewtonCollisionLandscape::CalculateHash() const +{ long long hash = ndCRC64(ndShapeHeightfield::StaticClassName(), strlen(ndShapeHeightfield::StaticClassName()), 0); - hash = ndCRC64(&xScale, sizeof(float), hash); - hash = ndCRC64(&yScale, sizeof(float), hash); - hash = ndCRC64(&zScale, sizeof(float), hash); - hash = ndCRC64(&elevationData.Heights[0], sizeof(uint16) * elevationData.Heights.Num(), hash); + + if (m_heightfield.Num()) + { + const char* const materialBuffer = &m_materials[0]; + const float* const elevations = &m_heightfield[0]; + hash = ndCRC64(materialBuffer, m_materials.Num() * sizeof(char), hash); + hash = ndCRC64(elevations, m_heightfield.Num() * sizeof(float), hash); + } return hash; } void UNewtonCollisionLandscape::ApplyPropertyChanges() { + if (m_savedMeshComponent && (m_heightfield.Num() == 0)) + { + const ULandscapeHeightfieldCollisionComponent* const tile = Cast(m_savedMeshComponent); + check(tile); + + const ULandscapeHeightfieldCollisionComponent::FHeightfieldGeometryRef* const heightfieldRef = tile->HeightfieldRef; + const Chaos::FHeightField* const mapData = heightfieldRef->HeightfieldGeometry; + check(mapData); + const Chaos::FHeightField::FData& elevationData = mapData->GeomData; + + const Chaos::FVec3 elevationScale(elevationData.Scale); + // this is not a bug, y and z are swapped after the mapping + ndFloat32 xScale = elevationScale[0] * UNREAL_INV_UNIT_SYSTEM; + ndFloat32 zScale = elevationScale[1] * UNREAL_INV_UNIT_SYSTEM; + + ndShapeHeightfield* const heightfield = new ndShapeHeightfield( + ndInt32(mapData->GetNumCols()), ndInt32(mapData->GetNumRows()), + ndShapeHeightfield::m_normalDiagonals, xScale, zScale); + + ndReal minValue = elevationData.MinValue; + ndReal highScale = elevationData.HeightPerUnit; + + const ndShape* const shape = heightfield; + const ndShapeInfo info(shape->GetShapeInfo()); + ndInt8* const attributes = info.m_heightfield.m_atributes; + ndReal* const dstHeigh = info.m_heightfield.m_elevation; + ndReal yScale = ndReal(elevationScale[2] * UNREAL_INV_UNIT_SYSTEM); + + ndInt32 dstRow = 0; + ndInt32 srcRow = (ndInt32(elevationData.NumRows) - 1) * elevationData.NumCols; + for (ndInt32 row = ndInt32(elevationData.NumRows) - 1; row >= 0; --row) + { + for (ndInt32 colum = elevationData.NumCols - 1; colum >= 0; --colum) + { + ndReal h = minValue + ndReal(elevationData.Heights[srcRow + colum]) * highScale; + dstHeigh[dstRow + colum] = h * yScale; + attributes[dstRow + colum] = 0; + } + srcRow -= elevationData.NumCols; + dstRow += elevationData.NumCols; + } + + m_scale_z = 1.0f; + m_scale_x = info.m_heightfield.m_horizonalScale_x; + m_scale_y = info.m_heightfield.m_horizonalScale_z; + m_tileSize_x = info.m_heightfield.m_width; + m_tileSize_y = info.m_heightfield.m_height; + + ndInt32 size = info.m_heightfield.m_width * info.m_heightfield.m_height; + for (ndInt32 i = 0; i < size; ++i) + { + m_heightfield.Push(dstHeigh[i]); + m_materials.Push(attributes[i]); + } + + delete heightfield; + } + BuildNewtonShape(); Super::ApplyPropertyChanges(); } ndShape* UNewtonCollisionLandscape::CreateShape() const { - const ULandscapeHeightfieldCollisionComponent* const tile = Cast(GetGeometryMesh().Get()); - check(tile); - - const ULandscapeHeightfieldCollisionComponent::FHeightfieldGeometryRef* const heightfieldRef = tile->HeightfieldRef; - const Chaos::FHeightField* const mapData = heightfieldRef->HeightfieldGeometry; - check(mapData); - const Chaos::FHeightField::FData& elevationData = mapData->GeomData; - - const Chaos::FVec3 elevationScale(elevationData.Scale); - // this is not a bug, y and z are swapped after the mapping - ndFloat32 xScale = elevationScale[0] * UNREAL_INV_UNIT_SYSTEM; - ndFloat32 zScale = elevationScale[1] * UNREAL_INV_UNIT_SYSTEM; - + if (!m_heightfield.Num()) + { + return new ndShapeNull(); + } + ndShapeHeightfield* const shape = new ndShapeHeightfield( - ndInt32(mapData->GetNumCols()), ndInt32(mapData->GetNumRows()), - ndShapeHeightfield::m_normalDiagonals, xScale, zScale); - - ndReal minValue = elevationData.MinValue; - ndReal highScale = elevationData.HeightPerUnit; + m_tileSize_x, m_tileSize_y, + ndShapeHeightfield::m_normalDiagonals, m_scale_x, m_scale_z); const ndShapeInfo info(((ndShape*)shape)->GetShapeInfo()); + ndInt8* const attributes = info.m_heightfield.m_atributes; ndReal* const dstHeigh = info.m_heightfield.m_elevation; - ndReal yScale = ndReal(elevationScale[2] * UNREAL_INV_UNIT_SYSTEM); - ndInt32 dstRow = 0; - ndInt32 srcRow = (ndInt32(elevationData.NumRows) - 1) * elevationData.NumCols; - for (ndInt32 row = ndInt32(elevationData.NumRows) - 1; row >= 0; --row) + ndInt32 size = m_tileSize_x * m_tileSize_y; + for (ndInt32 i = 0; i < size; ++i) { - for (ndInt32 colum = elevationData.NumCols - 1; colum >= 0; --colum) - { - ndReal h = minValue + ndReal(elevationData.Heights[srcRow + colum]) * highScale; - dstHeigh[dstRow + colum] = h * yScale; - } - srcRow -= elevationData.NumCols; - dstRow += elevationData.NumCols; + dstHeigh[i] = ndReal(m_heightfield[i]); + attributes[i] = ndInt8(m_materials[i]); } - shape->UpdateElevationMapAabb(); return shape; } @@ -92,17 +157,15 @@ ndShape* UNewtonCollisionLandscape::CreateShape() const ndShapeInstance* UNewtonCollisionLandscape::CreateInstanceShape() const { ndShapeInstance* const instance = new ndShapeInstance(m_shape); - ULandscapeHeightfieldCollisionComponent* const tile = Cast(GetGeometryMesh().Get()); - check(tile); const FVector uScale(GetComponentToWorld().GetScale3D()); ndMatrix origin(ndGetIdentityMatrix()); //origin.m_posit.m_x = ndFloat32(tile->SectionBaseX * tile->CollisionScale * uScale.X * UNREAL_INV_UNIT_SYSTEM); - origin.m_posit.m_y = ndFloat32(tile->CollisionSizeQuads * tile->CollisionScale * uScale.Y * UNREAL_INV_UNIT_SYSTEM); + origin.m_posit.m_y = ndFloat32(ndFloat32(m_tileSize_y - 1) * m_scale_y * uScale.Y * UNREAL_INV_UNIT_SYSTEM); const ndMatrix aligment(ndPitchMatrix(ndPi * 0.5f)); const ndMatrix tileMatrix(aligment * origin); instance->SetLocalMatrix(tileMatrix); - + ndMatrix scaleMatrix(ndGetIdentityMatrix()); scaleMatrix[0][0] = ndFloat32(1.0f / uScale.X); scaleMatrix[1][1] = ndFloat32(1.0f / uScale.Y); @@ -115,24 +178,15 @@ ndShapeInstance* UNewtonCollisionLandscape::CreateInstanceShape() const ndShapeInstance* UNewtonCollisionLandscape::CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const { ndShapeInstance* const instance = new ndShapeInstance(m_shape); - ULandscapeHeightfieldCollisionComponent* const tile = Cast(GetGeometryMesh().Get()); - check(tile); const FTransform transform(GetComponentToWorld()); const ndMatrix matrix (UNewtonRigidBody::ToNewtonMatrix(transform)); const FVector uScale(transform.GetScale3D()); ndMatrix origin(ndGetIdentityMatrix()); - //origin.m_posit.m_x = ndFloat32(tile->SectionBaseX * tile->CollisionScale * uScale.X); - origin.m_posit.m_y = ndFloat32(tile->CollisionSizeQuads * tile->CollisionScale * uScale.Y * UNREAL_INV_UNIT_SYSTEM); - + origin.m_posit.m_y = ndFloat32(ndFloat32(m_tileSize_y - 1) * m_scale_y * uScale.Y * UNREAL_INV_UNIT_SYSTEM); + const ndMatrix aligment(ndPitchMatrix(ndPi * 0.5f)); const ndMatrix tileMatrix(aligment * origin * matrix * bodyMatrix); instance->SetLocalMatrix(tileMatrix); - - //ndMatrix scaleMatrix(ndGetIdentityMatrix()); - //scaleMatrix[0][0] = ndFloat32(1.0f / uScale.X); - //scaleMatrix[1][1] = ndFloat32(1.0f / uScale.Y); - //scaleMatrix[2][2] = ndFloat32(1.0f / uScale.Z); - //const ndMatrix instanceMatrix(tileMatrix * scaleMatrix * tileMatrix.OrthoInverse()); - //instance->SetGlobalScale(instanceMatrix); + return instance; } diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionLandscape.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionLandscape.h index 3b32dfe19e..dd1584878c 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionLandscape.h +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionLandscape.h @@ -24,10 +24,21 @@ class UNewtonCollisionLandscape : public UNewtonCollision // Sets default values for this component's properties UNewtonCollisionLandscape(); - private: - virtual void ApplyPropertyChanges(); - virtual ndShape* CreateShape() const; - virtual long long CalculateHash() const; - virtual ndShapeInstance* CreateInstanceShape() const; - virtual ndShapeInstance* CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const; + virtual void SetGlobalTransform() override; + + protected: + virtual void Serialize(FArchive& Ar) override; + virtual void ApplyPropertyChanges() override; + virtual ndShape* CreateShape() const override; + virtual long long CalculateHash() const override; + virtual ndShapeInstance* CreateInstanceShape() const override; + virtual ndShapeInstance* CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const override;; + + TArray m_materials; + TArray m_heightfield; + float m_scale_x; + float m_scale_y; + float m_scale_z; + int m_tileSize_x; + int m_tileSize_y; }; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.cpp index e494001d33..4f6719afaf 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.cpp +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.cpp @@ -5,6 +5,7 @@ #include "Newton.h" #include "NewtonRigidBody.h" +#include "NewtonSceneActor.h" #include "ThirdParty/newtonLibrary/Public/dNewton/ndNewton.h" UNewtonCollisionPolygonalMesh::UNewtonCollisionPolygonalMesh() @@ -12,90 +13,126 @@ UNewtonCollisionPolygonalMesh::UNewtonCollisionPolygonalMesh() { } -long long UNewtonCollisionPolygonalMesh::CalculateHash() const +void UNewtonCollisionPolygonalMesh::Serialize(FArchive& ar) { - auto FindStaticMesh = [this]() - { - UStaticMeshComponent* const mesh = Cast(GetAttachParent()); - if (mesh && mesh->GetStaticMesh().Get()) - { - return mesh->GetStaticMesh().Get(); - } - return (UStaticMesh*) nullptr; - }; + Super::Serialize(ar); - long long hash = ndCRC64(ndShapeHeightfield::StaticClassName(), strlen(ndShapeHeightfield::StaticClassName()), 0); + ar << m_vetexData; + ar << m_indexData; +} - UStaticMesh* const staticMesh = FindStaticMesh(); - if (staticMesh) +long long UNewtonCollisionPolygonalMesh::CalculateHash() const +{ + long long hash = ndCRC64(ndShapeHeightfield::StaticClassName(), strlen(ndShapeHeightfield::StaticClassName()), 0); + if (m_indexData.Num()) { - #if 1 - FTriMeshCollisionData collisionData; - bool data = staticMesh->GetPhysicsTriMeshData(&collisionData, true); - if (data) - { - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(0.0f)); - const ndVector bakedScale(scale.Scale(UNREAL_INV_UNIT_SYSTEM)); + const int* const indexBuffer = &m_indexData[0]; + const FVector3f* const vexterBuffer = &m_vetexData[0]; + hash = ndCRC64(indexBuffer, m_indexData.Num() * sizeof(int), hash); + hash = ndCRC64(vexterBuffer, m_vetexData.Num() * sizeof(FVector3f), hash); + } + return hash; +} - for (int i = collisionData.Vertices.Num() - 1; i >= 0; --i) - { - const FVector3f p(collisionData.Vertices[i]); - const ndVector q(ndFloat32(p.X), ndFloat32(p.Y), ndFloat32(p.Z), ndFloat32(0.0f)); - const ndVector hashPoint(bakedScale * q); - hash = ndCRC64(&hashPoint, sizeof(hashPoint), hash); - } - } - #else - //using actual render LOD0 geometry, maybe not a good idea. - const FStaticMeshRenderData* const renderData = staticMesh->GetRenderData(); - const FStaticMeshLODResourcesArray& renderResource = renderData->LODResources; +ndShape* UNewtonCollisionPolygonalMesh::CreateShape() const +{ + if (!m_indexData.Num()) + { + return new ndShapeNull(); + } + ndPolygonSoupBuilder meshBuilder; + meshBuilder.Begin(); + ndVector face[8]; + for (int i = m_indexData.Num() - 3; i >= 0; i -= 3) + { + ndInt32 i0 = m_indexData[i + 0]; + ndInt32 i1 = m_indexData[i + 1]; + ndInt32 i2 = m_indexData[i + 2]; + const FVector3f p0(m_vetexData[i0]); + const FVector3f p1(m_vetexData[i1]); + const FVector3f p2(m_vetexData[i2]); + const ndVector q0(ndFloat32(p0.X), ndFloat32(p0.Y), ndFloat32(p0.Z), ndFloat32(0.0f)); + const ndVector q1(ndFloat32(p1.X), ndFloat32(p1.Y), ndFloat32(p1.Z), ndFloat32(0.0f)); + const ndVector q2(ndFloat32(p2.X), ndFloat32(p2.Y), ndFloat32(p2.Z), ndFloat32(0.0f)); + face[0] = q0; + face[1] = q1; + face[2] = q2; + //for now MaterialIndex = 0 + ndInt32 materialIndex = 0; + meshBuilder.AddFace(&face[0].m_x, sizeof(ndVector), 3, materialIndex); + } + meshBuilder.End(true); + ndShape* const shape = new ndShapeStatic_bvh(meshBuilder); + return shape; +} - const FVector uScale(GetComponentTransform().GetScale3D()); - const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(0.0f)); - const ndVector bakedScale(scale.Scale(UNREAL_INV_UNIT_SYSTEM)); +class UNewtonCollisionPolygonalMesh::ndShapeStatic : public ndShapeStatic_bvh +{ + public: + ndShapeStatic(const ndPolygonSoupBuilder& meshBuilder, UNewtonCollisionPolygonalMesh* const self) + :ndShapeStatic_bvh(meshBuilder) + ,m_self(self) + ,m_vertexCount(0) + { + } - const FStaticMeshLODResources& renderLOD = renderResource[0]; - const FStaticMeshVertexBuffers& staticMeshVertexBuffer = renderLOD.VertexBuffers;; - const FPositionVertexBuffer& positBuffer = staticMeshVertexBuffer.PositionVertexBuffer; - for (int i = positBuffer.GetNumVertices() - 1; i >= 0; --i) + static ndIntersectStatus AaabbIntersectCallback( + void* const context, + const ndFloat32* const polygon, ndInt32 strideInBytes, + const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance) + { + ndShapeStatic* const self = (ndShapeStatic*)context; + UNewtonCollisionPolygonalMesh* const polyMesh = self->m_self; + for (ndInt32 i = 2; i < indexCount; ++i) { - const FVector3f p(positBuffer.VertexPosition(i)); - const ndVector q(ndFloat32(p.X), ndFloat32(p.Y), ndFloat32(p.Z), ndFloat32(0.0f)); - const ndVector hashPoint(bakedScale * q); - - hash = ndCRC64(&hashPoint, sizeof(hashPoint), hash); + polyMesh->m_indexData.Push(indexArray[0]); + polyMesh->m_indexData.Push(indexArray[i - 1]); + polyMesh->m_indexData.Push(indexArray[i + 0]); + self->m_vertexCount = ndMax(self->m_vertexCount, indexArray[0]); + self->m_vertexCount = ndMax(self->m_vertexCount, indexArray[i + 0]); + self->m_vertexCount = ndMax(self->m_vertexCount, indexArray[i + 1]); } - #endif + return m_continueSearh; } - return hash; -} - -ndShape* UNewtonCollisionPolygonalMesh::CreateShape() const -{ - auto FindStaticMesh = [this]() + void ScanMesh() { - UStaticMeshComponent* const mesh = Cast(GetAttachParent()); - if (mesh && mesh->GetStaticMesh().Get()) + ndInt32 vCount = GetVertexCount(); + ndInt32 stride = GetStrideInBytes() / sizeof(ndFloat32); + const ndFloat32* const points = GetLocalVertexPool(); + + ndVector p0(-1.0e10f, -1.0e10f, -1.0e10f, 0.0f); + ndVector p1( 1.0e10f, 1.0e10f, 1.0e10f, 0.0f); + const ndFastAabb aabb(p0, p1); + m_vertexCount = -1; + ForAllSectors(aabb, ndVector(0.0f), 1.0f, AaabbIntersectCallback, this); + m_vertexCount++; + for (ndInt32 j = 0; j < m_vertexCount; ++j) { - return mesh->GetStaticMesh().Get(); + int i = j * stride; + FVector3f p(points[i + 0], points[i + 1], points[i + 2]); + m_self->m_vetexData.Push(p); } - return (UStaticMesh*) nullptr; - }; + } + UNewtonCollisionPolygonalMesh* m_self; + int m_vertexCount; +}; + +void UNewtonCollisionPolygonalMesh::ApplyPropertyChanges() +{ UStaticMesh* const staticMesh = FindStaticMesh(); - if (staticMesh) + if (staticMesh && (m_vetexData.Num() == 0)) { + ndVector face[8]; + ndPolygonSoupBuilder meshBuilder; meshBuilder.Begin(); - ndVector face[8]; const FVector uScale(GetComponentTransform().GetScale3D()); const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(0.0f)); const ndVector bakedScale(scale.Scale(UNREAL_INV_UNIT_SYSTEM)); - #if 1 FTriMeshCollisionData collisionData; bool data = staticMesh->GetPhysicsTriMeshData(&collisionData, true); if (data) @@ -103,8 +140,9 @@ ndShape* UNewtonCollisionPolygonalMesh::CreateShape() const for (int i = collisionData.Indices.Num() - 1; i >= 0; --i) { ndInt32 i0 = collisionData.Indices[i].v0; - ndInt32 i1 = collisionData.Indices[i].v1; - ndInt32 i2 = collisionData.Indices[i].v2; + ndInt32 i1 = collisionData.Indices[i].v2; + ndInt32 i2 = collisionData.Indices[i].v1; + const FVector3f p0(collisionData.Vertices[i0]); const FVector3f p1(collisionData.Vertices[i1]); const FVector3f p2(collisionData.Vertices[i2]); @@ -113,58 +151,21 @@ ndShape* UNewtonCollisionPolygonalMesh::CreateShape() const const ndVector q2(ndFloat32(p2.X), ndFloat32(p2.Y), ndFloat32(p2.Z), ndFloat32(0.0f)); face[0] = q0 * bakedScale; - face[2] = q1 * bakedScale; - face[1] = q2 * bakedScale; + face[1] = q1 * bakedScale; + face[2] = q2 * bakedScale; //for now MaterialIndex = 0 ndInt32 materialIndex = 0; meshBuilder.AddFace(&face[0].m_x, sizeof(ndVector), 3, materialIndex); } } - - #else - const FStaticMeshRenderData* const renderData = staticMesh->GetRenderData(); - const FStaticMeshLODResourcesArray& renderResource = renderData->LODResources; - - const FStaticMeshLODResources& renderLOD = renderResource[0]; - const FRawStaticIndexBuffer& staticMeshIndexBuffer = renderLOD.IndexBuffer; - const FStaticMeshVertexBuffers& staticMeshVertexBuffer = renderLOD.VertexBuffers;; - const FPositionVertexBuffer& positBuffer = staticMeshVertexBuffer.PositionVertexBuffer; - - int32 indexCount = staticMeshIndexBuffer.GetNumIndices(); - for (ndInt32 i = 0; i < indexCount; i += 3) - { - ndInt32 i0 = staticMeshIndexBuffer.GetIndex(i + 0); - ndInt32 i1 = staticMeshIndexBuffer.GetIndex(i + 1); - ndInt32 i2 = staticMeshIndexBuffer.GetIndex(i + 2); - const FVector3f p0(positBuffer.VertexPosition(i0)); - const FVector3f p1(positBuffer.VertexPosition(i1)); - const FVector3f p2(positBuffer.VertexPosition(i2)); - const ndVector q0(ndFloat32(p0.X), ndFloat32(p0.Y), ndFloat32(p0.Z), ndFloat32(0.0f)); - const ndVector q1(ndFloat32(p1.X), ndFloat32(p1.Y), ndFloat32(p1.Z), ndFloat32(0.0f)); - const ndVector q2(ndFloat32(p2.X), ndFloat32(p2.Y), ndFloat32(p2.Z), ndFloat32(0.0f)); - - face[0] = q0 * bakedScale; - face[1] = q1 * bakedScale; - face[2] = q2 * bakedScale; - - //for now MaterialIndex = 0 - ndInt32 materialIndex = 0; - meshBuilder.AddFace(&face[0].m_x, sizeof(ndVector), 3, materialIndex); - } - #endif - meshBuilder.End(true); - ndShape* const shape = new ndShapeStatic_bvh(meshBuilder); - return shape; + ndShapeStatic* const polyTree= new ndShapeStatic(meshBuilder, this); + polyTree->ScanMesh(); + delete polyTree; } - return new ndShapeNull(); -} -void UNewtonCollisionPolygonalMesh::ApplyPropertyChanges() -{ BuildNewtonShape(); - Super::ApplyPropertyChanges(); } diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.h index ffca7b46d7..396b5423b0 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.h +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonCollisionPolygonalMesh.h @@ -6,6 +6,7 @@ #include "NewtonCollision.h" #include "NewtonCollisionPolygonalMesh.generated.h" + /** * */ @@ -13,15 +14,22 @@ UCLASS(ClassGroup=(NewtonCollision), meta=(BlueprintSpawnableComponent)) class UNewtonCollisionPolygonalMesh : public UNewtonCollision { GENERATED_BODY() + + class ndShapeStatic; public: // Sets default values for this component's properties UNewtonCollisionPolygonalMesh(); protected: + virtual void Serialize(FArchive& Ar) override; + virtual void ApplyPropertyChanges(); virtual ndShape* CreateShape() const; virtual long long CalculateHash() const; virtual ndShapeInstance* CreateInstanceShape() const; virtual ndShapeInstance* CreateBodyInstanceShape(const ndMatrix& bodyMatrix) const; + + TArray m_indexData; + TArray m_vetexData; }; diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonRigidBody.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonRigidBody.h index a7d07218e9..58e3f3af27 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonRigidBody.h +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonRigidBody.h @@ -10,8 +10,8 @@ class ndWorld; class ndMatrix; class ndBodyDynamic; class ndShapeInstance; -class ANewtonWorldActor; class UNewtonCollision; +class ANewtonWorldActor; USTRUCT() struct FConvexApproximationStruct diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneActor.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneActor.cpp index ef5e7a1f6c..8268840dc0 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneActor.cpp +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneActor.cpp @@ -5,6 +5,7 @@ #include "LevelEditor.h" #include "EngineUtils.h" #include "LandscapeProxy.h" +#include "LandscapeStreamingProxy.h" #include "Newton.h" #include "NewtonCollision.h" @@ -52,7 +53,6 @@ void ANewtonSceneActor::CreateCollisionFromUnrealPrimitive(TObjectPtrGetOwner(); const UStaticMesh* const staticMesh = staticComponent->GetStaticMesh().Get(); const UBodySetup* const bodySetup = staticMesh->GetBodySetup(); @@ -64,9 +64,10 @@ void ANewtonSceneActor::CreateCollisionFromUnrealPrimitive(TObjectPtrAttachToComponent(RootBody, FAttachmentTransformRules::KeepRelativeTransform); + childComp->SetGeometryMesh(staticComponent); + childComp->SetGlobalTransform(); childComp->MarkRenderDynamicDataDirty(); childComp->NotifyMeshUpdated(); - childComp->SetGeometryMesh(staticComponent); }; for (int i = aggGeom.SphereElems.Num() - 1; i >= 0; --i) @@ -117,24 +118,14 @@ void ANewtonSceneActor::CreateCollisionFromUnrealPrimitive(TObjectPtrGetOwner(); - auto AddComponent = [this, staticComponent](UNewtonCollision* const childComp) - { - FinishAddComponent(childComp, false, FTransform()); - AddInstanceComponent(childComp); - childComp->AttachToComponent(RootBody, FAttachmentTransformRules::KeepRelativeTransform); - childComp->MarkRenderDynamicDataDirty(); - childComp->NotifyMeshUpdated(); - childComp->SetGeometryMesh(staticComponent); - - //const FTransform bodyTransform(RootBody->GetComponentToWorld()); - //const FTransform meshTransform(staticComponent->GetComponentToWorld()); - //const FTransform transform(meshTransform * bodyTransform.Inverse()); - //childComp->SetComponentToWorld(transform); - }; - - UNewtonCollisionPolygonalMesh* const child = Cast(AddComponentByClass(UNewtonCollisionPolygonalMesh::StaticClass(), false, FTransform(), true)); - AddComponent(child); + UNewtonCollisionPolygonalMesh* const childComp = Cast(AddComponentByClass(UNewtonCollisionPolygonalMesh::StaticClass(), false, FTransform(), true)); + FinishAddComponent(childComp, false, FTransform()); + AddInstanceComponent(childComp); + childComp->AttachToComponent(RootBody, FAttachmentTransformRules::KeepRelativeTransform); + childComp->SetGeometryMesh(staticComponent); + childComp->SetGlobalTransform(); + childComp->MarkRenderDynamicDataDirty(); + childComp->NotifyMeshUpdated(); }; const UBodySetup* const bodySetup = staticMesh->GetBodySetup(); @@ -165,7 +156,6 @@ void ANewtonSceneActor::CreateCollisionFromUnrealPrimitive(TObjectPtr(); + if (!staticSceneBody) + { + return; + } + FFolder folder(GetFolder()); if (folder.IsNone()) { @@ -208,9 +204,21 @@ void ANewtonSceneActor::ApplyPropertyChanges() { actorList.PushBack(actor); } + else if (Cast(actor)) + { + const ALandscapeStreamingProxy* const streamingProxy = Cast(actor); + const AActor* const parent = streamingProxy->GetSceneOutlinerParent(); + const FString streamingKey(parent->GetFolder().ToString()); + index = streamingKey.Find(key); + if (index == 0) + { + actorList.PushBack(actor); + } + } } } + staticSceneBody->RemoveAllCollisions(); for (ndInt32 i = ndInt32(actorList.GetCount()) - 1; i >= 0; --i) { AActor* const sceneActor = actorList[i]; @@ -251,62 +259,28 @@ void ANewtonSceneActor::GenerateStaticMeshCollision(const AActor* const actor) } } - const TArray>& children = RootBody->GetAttachChildren(); - auto HasCollision = [this, &children](const UStaticMeshComponent* const meshComp) - { - for (ndInt32 i = children.Num() - 1; i >= 0; --i) - { - const UNewtonCollision* const collision = Cast(children[i]); - if (collision && (collision->GetGeometryMesh() == meshComp)) - { - return true; - } - } - return false; - }; - for (ndInt32 i = staticMesh.Num() - 1; i >= 0; --i) { TObjectPtrmeshComponent(staticMesh[i]); - if (!HasCollision(meshComponent.Get())) - { - CreateCollisionFromUnrealPrimitive(meshComponent); - } + CreateCollisionFromUnrealPrimitive(meshComponent); } } void ANewtonSceneActor::GenerateLandScapeCollision(const ALandscapeProxy* const landscapeProxy) { const TArray>& landScapeTiles = landscapeProxy->CollisionComponents; - check(landScapeTiles.Num()); - const TArray>& children = RootBody->GetAttachChildren(); - - auto HasCollision = [this, &children](const TObjectPtr& tile) - { - for (ndInt32 i = children.Num() - 1; i >= 0; --i) - { - UNewtonCollisionLandscape* const collision = Cast(children[i]); - if (collision && (collision->GetGeometryMesh() == tile)) - { - return true; - } - } - return false; - }; - - for (ndInt32 i = landScapeTiles.Num() - 1; i >= 0; --i) - //for (ndInt32 i = 0; i < 1; ++i) + for (ndInt32 i = 0; i < landScapeTiles.Num(); ++i) { const TObjectPtr& tile = landScapeTiles[i]; - if (!HasCollision(tile)) - { - UNewtonCollisionLandscape* const collisionTile = Cast(AddComponentByClass(UNewtonCollisionLandscape::StaticClass(), false, FTransform(), true)); - FinishAddComponent(collisionTile, false, FTransform()); - AddInstanceComponent(collisionTile); - collisionTile->AttachToComponent(RootBody, FAttachmentTransformRules::KeepRelativeTransform); - collisionTile->MarkRenderDynamicDataDirty(); - collisionTile->NotifyMeshUpdated(); - collisionTile->SetGeometryMesh(tile); - } + UNewtonCollisionLandscape* const collisionTile = Cast(AddComponentByClass(UNewtonCollisionLandscape::StaticClass(), false, FTransform(), true)); + FinishAddComponent(collisionTile, false, FTransform()); + AddInstanceComponent(collisionTile); + collisionTile->AttachToComponent(RootBody, FAttachmentTransformRules::KeepRelativeTransform); + + collisionTile->SetGeometryMesh(tile); + collisionTile->SetGlobalTransform(); + collisionTile->MarkRenderDynamicDataDirty(); + collisionTile->NotifyMeshUpdated(); } -} \ No newline at end of file +} + diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneActor.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneActor.h index 05817a0b70..c24c3a5307 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneActor.h +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneActor.h @@ -6,7 +6,6 @@ #include "GameFramework/Actor.h" #include "NewtonSceneActor.generated.h" - class ALandscapeProxy; UCLASS(ClassGroup = NewtonScene, meta=(BlueprintSpawnableComponent), HideCategories = (Physics, Collision), MinimalAPI) diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneRigidBody.cpp b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneRigidBody.cpp index a2a1e8f709..a154cdb89b 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneRigidBody.cpp +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneRigidBody.cpp @@ -16,6 +16,15 @@ UNewtonSceneRigidBody::UNewtonSceneRigidBody() { } +void UNewtonSceneRigidBody::RemoveAllCollisions() +{ + const TArray>& chidren = GetAttachChildren(); + for (int i = chidren.Num() - 1; i >= 0; --i) + { + chidren[i]->DestroyComponent(); + } +} + ndShapeInstance* UNewtonSceneRigidBody::CreateCollision(const ndMatrix& bodyMatrix) const { ndArray subShapes; @@ -51,4 +60,4 @@ ndShapeInstance* UNewtonSceneRigidBody::CreateCollision(const ndMatrix& bodyMatr } compound->EndAddRemove(); return compoundInstance; -} \ No newline at end of file +} diff --git a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneRigidBody.h b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneRigidBody.h index 3f01833e19..df7fecf4e4 100644 --- a/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneRigidBody.h +++ b/newton-4.00/applications/toolsAndWrapers/newtonUnreal/newton/Source/newton/Private/NewtonSceneRigidBody.h @@ -17,6 +17,6 @@ class UNewtonSceneRigidBody : public UNewtonRigidBody public: UNewtonSceneRigidBody(); - //virtual void ApplyPropertyChanges() override; + void RemoveAllCollisions(); virtual ndShapeInstance* CreateCollision(const ndMatrix& bodyMatrix) const override; }; diff --git a/newton-4.00/sdk/dCollision/ndShape.cpp b/newton-4.00/sdk/dCollision/ndShape.cpp index 3ab38ddf8f..2ff383a59b 100644 --- a/newton-4.00/sdk/dCollision/ndShape.cpp +++ b/newton-4.00/sdk/dCollision/ndShape.cpp @@ -54,6 +54,64 @@ ndShape::~ndShape() ndAssert(m_refCount.load() == 0); } +ndShapeInfo::ndShapeInfo() + :m_offsetMatrix(ndGetIdentityMatrix()) + , m_scale(ndFloat32(1.0f)) + , m_shapeMaterial() + , m_collisionType(::m_box) +{ + for (ndInt32 i = 0; i < sizeof(m_paramArray) / sizeof(m_paramArray[0]); ++i) + { + m_paramArray[i] = ndFloat32(0); + } +} + +ndUnsigned64 ndShapeInfo::GetHash(ndUnsigned64 hash) +{ + ndInt32 id = m_collisionType; + hash = ndCRC64(m_paramArray, sizeof(m_paramArray), hash); + hash = ndCRC64(&id, sizeof(id), hash); + return hash; +} + +ndInt32 ndShape::GetConvexVertexCount() const +{ + return 0; +} + +ndFloat32 ndShape::CalculateMassProperties(const ndMatrix&, ndVector&, ndVector&, ndVector&) const +{ + ndAssert(0); + return 0; +} + +ndMatrix ndShape::CalculateInertiaAndCenterOfMass(const ndMatrix&, const ndVector&, const ndMatrix&) const +{ + ndAssert(0); + return ndGetZeroMatrix(); +} + +ndVector ndShape::GetObbOrigin() const +{ + return m_boxOrigin; +} + +ndVector ndShape::GetObbSize() const +{ + return m_boxSize; +} + +ndFloat32 ndShape::GetUmbraClipSize() const +{ + return ndFloat32(3.0f) * GetBoxMaxRadius(); +} + +ndUnsigned64 ndShape::GetHash(ndUnsigned64 hash) const +{ + ndAssert(0); + return hash; +} + void ndShape::MassProperties() { // using general central theorem, to extract the Inertia relative to the center of mass diff --git a/newton-4.00/sdk/dCollision/ndShape.h b/newton-4.00/sdk/dCollision/ndShape.h index c6c1dc5541..f0fc05191e 100644 --- a/newton-4.00/sdk/dCollision/ndShape.h +++ b/newton-4.00/sdk/dCollision/ndShape.h @@ -176,7 +176,6 @@ struct ndHeighfieldInfo ndInt32 m_width; ndInt32 m_height; ndInt32 m_gridsDiagonals; - ndFloat32 m_verticalScale; ndFloat32 m_horizonalScale_x; ndFloat32 m_horizonalScale_z; ndReal* m_elevation; @@ -210,7 +209,6 @@ class ndShapeInfo ndChamferCylinderInfo m_chamferCylinder; ndFloat32 m_paramArray[32]; }; - } D_GCC_NEWTON_ALIGN_32; D_MSV_NEWTON_ALIGN_32 @@ -240,17 +238,17 @@ class ndShape: public ndContainersFreeListAlloc virtual ndShapeChamferCylinder* GetAsShapeChamferCylinder() { return nullptr; } virtual ndShapeStaticProceduralMesh* GetAsShapeStaticProceduralMesh() { return nullptr; } - virtual ndInt32 GetConvexVertexCount() const; + D_COLLISION_API virtual ndInt32 GetConvexVertexCount() const; - ndVector GetObbSize() const; - ndVector GetObbOrigin() const; - ndFloat32 GetUmbraClipSize() const; + D_COLLISION_API ndVector GetObbSize() const; + D_COLLISION_API ndVector GetObbOrigin() const; + D_COLLISION_API ndFloat32 GetUmbraClipSize() const; D_COLLISION_API virtual void MassProperties(); + D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; + D_COLLISION_API virtual ndMatrix CalculateInertiaAndCenterOfMass(const ndMatrix& alignMatrix, const ndVector& localScale, const ndMatrix& matrix) const; + D_COLLISION_API virtual ndFloat32 CalculateMassProperties(const ndMatrix& offset, ndVector& inertia, ndVector& crossInertia, ndVector& centerOfMass) const; - virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const = 0; - - virtual ndShapeInfo GetShapeInfo() const; virtual ndFloat32 GetVolume() const = 0; virtual ndFloat32 GetBoxMinRadius() const = 0; virtual ndFloat32 GetBoxMaxRadius() const = 0; @@ -263,9 +261,7 @@ class ndShape: public ndContainersFreeListAlloc virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const = 0; virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& globalPlane, const ndShapeInstance& parentScale) const = 0; virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const = 0; - - virtual ndMatrix CalculateInertiaAndCenterOfMass(const ndMatrix& alignMatrix, const ndVector& localScale, const ndMatrix& matrix) const; - virtual ndFloat32 CalculateMassProperties(const ndMatrix& offset, ndVector& inertia, ndVector& crossInertia, ndVector& centerOfMass) const; + virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const = 0; protected: D_COLLISION_API ndShape(ndShapeID id); @@ -281,64 +277,6 @@ class ndShape: public ndContainersFreeListAlloc static ndVector m_flushZero; } D_GCC_NEWTON_ALIGN_32; -inline ndShapeInfo::ndShapeInfo() - :m_offsetMatrix(ndGetIdentityMatrix()) - ,m_scale(ndFloat32 (1.0f)) - ,m_shapeMaterial() - ,m_collisionType(::m_box) -{ - for (ndInt32 i = 0; i < sizeof(m_paramArray) / sizeof(m_paramArray[0]); ++i) - { - m_paramArray[i] = ndFloat32(0); - } -} - -inline ndUnsigned64 ndShapeInfo::GetHash(ndUnsigned64 hash) -{ - ndInt32 id = m_collisionType; - hash = ndCRC64(m_paramArray, sizeof (m_paramArray), hash); - hash = ndCRC64(&id, sizeof(id), hash); - return hash; -} - -inline ndInt32 ndShape::GetConvexVertexCount() const -{ - return 0; -} - -inline ndFloat32 ndShape::CalculateMassProperties(const ndMatrix&, ndVector&, ndVector&, ndVector&) const -{ - ndAssert(0); - return 0; -} - -inline ndMatrix ndShape::CalculateInertiaAndCenterOfMass(const ndMatrix&, const ndVector&, const ndMatrix&) const -{ - ndAssert(0); - return ndGetZeroMatrix(); -} - -inline ndVector ndShape::GetObbOrigin() const -{ - return m_boxOrigin; -} - -inline ndVector ndShape::GetObbSize() const -{ - return m_boxSize; -} - -inline ndFloat32 ndShape::GetUmbraClipSize() const -{ - return ndFloat32(3.0f) * GetBoxMaxRadius(); -} - -inline ndUnsigned64 ndShape::GetHash(ndUnsigned64 hash) const -{ - ndAssert(0); - return hash; -} - #endif diff --git a/newton-4.00/sdk/dCollision/ndShapeStaticMesh.cpp b/newton-4.00/sdk/dCollision/ndShapeStaticMesh.cpp index 395c493858..eeabd3d311 100644 --- a/newton-4.00/sdk/dCollision/ndShapeStaticMesh.cpp +++ b/newton-4.00/sdk/dCollision/ndShapeStaticMesh.cpp @@ -35,6 +35,66 @@ ndShapeStaticMesh::~ndShapeStaticMesh() { } +ndFloat32 ndShapeStaticMesh::GetVolume() const +{ + return ndFloat32(0.0f); +} + +ndFloat32 ndShapeStaticMesh::GetBoxMinRadius() const +{ + return ndFloat32(0.0f); +} + +ndFloat32 ndShapeStaticMesh::GetBoxMaxRadius() const +{ + return ndFloat32(0.0f); +} + +ndVector ndShapeStaticMesh::SupportVertex(const ndVector&) const +{ + ndAssert(0); + return ndVector::m_zero; +} + +ndVector ndShapeStaticMesh::SupportVertexSpecial(const ndVector& dir, ndFloat32) const +{ + ndAssert(0); + return SupportVertex(dir); +} + +ndVector ndShapeStaticMesh::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector&) const +{ + return point; +} + +ndInt32 ndShapeStaticMesh::CalculatePlaneIntersection(const ndVector&, const ndVector&, ndVector* const) const +{ + return 0; +} + +ndVector ndShapeStaticMesh::CalculateVolumeIntegral(const ndMatrix&, const ndVector&, const ndShapeInstance&) const +{ + return ndVector::m_zero; +} + +ndShapeStaticMesh* ndShapeStaticMesh::GetAsShapeStaticMesh() +{ + return this; +} + +void ndShapeStaticMesh::DebugShape(const ndMatrix&, ndShapeDebugNotify&) const +{ +} + +ndFloat32 ndShapeStaticMesh::RayCast(ndRayCastNotify&, const ndVector&, const ndVector&, ndFloat32, const ndBody* const, ndContactPoint&) const +{ + return ndFloat32(1.2f); +} + +void ndShapeStaticMesh::GetCollidingFaces(ndPolygonMeshDesc* const) const +{ +} + void ndShapeStaticMesh::CalculateAabb(const ndMatrix& matrix, ndVector &p0, ndVector &p1) const { ndVector origin(matrix.TransformVector(m_boxOrigin)); diff --git a/newton-4.00/sdk/dCollision/ndShapeStaticMesh.h b/newton-4.00/sdk/dCollision/ndShapeStaticMesh.h index 8a974b7a5f..1cce5fc1ef 100644 --- a/newton-4.00/sdk/dCollision/ndShapeStaticMesh.h +++ b/newton-4.00/sdk/dCollision/ndShapeStaticMesh.h @@ -35,20 +35,20 @@ class ndShapeStaticMesh: public ndShape D_COLLISION_API ndShapeStaticMesh(ndShapeID id); D_COLLISION_API virtual ~ndShapeStaticMesh(); - virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; + D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; + D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; + D_COLLISION_API virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; protected: - virtual ndFloat32 GetVolume() const; - virtual ndFloat32 GetBoxMinRadius() const; - virtual ndFloat32 GetBoxMaxRadius() const; - virtual ndShapeStaticMesh* GetAsShapeStaticMesh(); - virtual ndVector SupportVertex(const ndVector& dir) const; - virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; - virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; - virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& plane, const ndShapeInstance& parentScale) const; + D_COLLISION_API virtual ndFloat32 GetVolume() const; + D_COLLISION_API virtual ndFloat32 GetBoxMinRadius() const; + D_COLLISION_API virtual ndFloat32 GetBoxMaxRadius() const; + D_COLLISION_API virtual ndShapeStaticMesh* GetAsShapeStaticMesh(); + D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const; + D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const; + D_COLLISION_API virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const; + D_COLLISION_API virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; + D_COLLISION_API virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& plane, const ndShapeInstance& parentScale) const; D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const; D_COLLISION_API ndInt32 CalculatePlaneIntersection(const ndFloat32* const vertex, const ndInt32* const index, ndInt32 indexCount, ndInt32 strideInFloat, const ndPlane& localPlane, ndVector* const contactsOut) const; @@ -67,66 +67,6 @@ class ndShapeStaticMesh: public ndShape } D_GCC_NEWTON_ALIGN_32; }; -inline ndFloat32 ndShapeStaticMesh::GetVolume() const -{ - return ndFloat32(0.0f); -} - -inline ndFloat32 ndShapeStaticMesh::GetBoxMinRadius() const -{ - return ndFloat32(0.0f); -} - -inline ndFloat32 ndShapeStaticMesh::GetBoxMaxRadius() const -{ - return ndFloat32(0.0f); -} - -inline ndVector ndShapeStaticMesh::SupportVertex(const ndVector&) const -{ - ndAssert(0); - return ndVector::m_zero; -} - -inline ndVector ndShapeStaticMesh::SupportVertexSpecial(const ndVector& dir, ndFloat32) const -{ - ndAssert(0); - return SupportVertex(dir); -} - -inline ndVector ndShapeStaticMesh::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector&) const -{ - return point; -} - -inline ndInt32 ndShapeStaticMesh::CalculatePlaneIntersection(const ndVector&, const ndVector&, ndVector* const) const -{ - return 0; -} - -inline ndVector ndShapeStaticMesh::CalculateVolumeIntegral(const ndMatrix&, const ndVector&, const ndShapeInstance&) const -{ - return ndVector::m_zero; -} - -inline ndShapeStaticMesh* ndShapeStaticMesh::GetAsShapeStaticMesh() -{ - return this; -} - - -inline void ndShapeStaticMesh::DebugShape(const ndMatrix&, ndShapeDebugNotify&) const -{ -} - -inline ndFloat32 ndShapeStaticMesh::RayCast(ndRayCastNotify&, const ndVector&, const ndVector&, ndFloat32, const ndBody* const, ndContactPoint&) const -{ - return ndFloat32(1.2f); -} - -inline void ndShapeStaticMesh::GetCollidingFaces(ndPolygonMeshDesc* const) const -{ -} #endif diff --git a/newton-4.00/sdk/dCollision/ndShapeStatic_bvh.cpp b/newton-4.00/sdk/dCollision/ndShapeStatic_bvh.cpp index f171ae768e..df643bed57 100644 --- a/newton-4.00/sdk/dCollision/ndShapeStatic_bvh.cpp +++ b/newton-4.00/sdk/dCollision/ndShapeStatic_bvh.cpp @@ -90,6 +90,16 @@ ndShapeStatic_bvh::~ndShapeStatic_bvh(void) { } +void* ndShapeStatic_bvh::operator new (size_t size) +{ + return ndShapeStaticMesh::operator new (size); +} + +void ndShapeStatic_bvh::operator delete (void* ptr) +{ + ndShapeStaticMesh::operator delete(ptr); +} + ndIntersectStatus ndShapeStatic_bvh::GetTriangleCount(void* const context, const ndFloat32* const, ndInt32, const ndInt32* const, ndInt32 indexCount, ndFloat32) { ndMeshVertexListIndexList& data = (*(ndMeshVertexListIndexList*)context); diff --git a/newton-4.00/sdk/dCollision/ndShapeStatic_bvh.h b/newton-4.00/sdk/dCollision/ndShapeStatic_bvh.h index 52298735a2..67daea96ed 100644 --- a/newton-4.00/sdk/dCollision/ndShapeStatic_bvh.h +++ b/newton-4.00/sdk/dCollision/ndShapeStatic_bvh.h @@ -33,18 +33,17 @@ class ndShapeStatic_bvh: public ndShapeStaticMesh, public ndAabbPolygonSoup D_COLLISION_API ndShapeStatic_bvh(); D_COLLISION_API ndShapeStatic_bvh(const ndPolygonSoupBuilder& builder); D_COLLISION_API virtual ~ndShapeStatic_bvh(); - - void *operator new (size_t size); - void operator delete (void* ptr); + D_COLLISION_API void *operator new (size_t size); + D_COLLISION_API void operator delete (void* ptr); protected: D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const; D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const; virtual ndShapeStatic_bvh* GetAsShapeStaticBVH() { return this; } - virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; - virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; + D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const; + D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; + D_COLLISION_API virtual void GetCollidingFaces(ndPolygonMeshDesc* const data) const; static ndFloat32 RayHit(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount); static ndIntersectStatus ShowDebugPolygon(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); @@ -52,7 +51,6 @@ class ndShapeStatic_bvh: public ndShapeStaticMesh, public ndAabbPolygonSoup static ndIntersectStatus GetPolygon(void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); private: - static ndIntersectStatus CalculateHash ( void* const context, const ndFloat32* const polygon, ndInt32 strideInBytes, const ndInt32* const indexArray, ndInt32 indexCount, ndFloat32 hitDistance); @@ -62,15 +60,4 @@ class ndShapeStatic_bvh: public ndShapeStaticMesh, public ndAabbPolygonSoup friend class ndContactSolver; }; -inline void* ndShapeStatic_bvh::operator new (size_t size) -{ - return ndShapeStaticMesh::operator new (size); -} - -inline void ndShapeStatic_bvh::operator delete (void* ptr) -{ - ndShapeStaticMesh::operator delete(ptr); -} - - #endif diff --git a/newton-4.00/sdk/dCore/ndFastAabb.cpp b/newton-4.00/sdk/dCore/ndFastAabb.cpp index 689df33657..7da34dc6cd 100644 --- a/newton-4.00/sdk/dCore/ndFastAabb.cpp +++ b/newton-4.00/sdk/dCore/ndFastAabb.cpp @@ -33,6 +33,62 @@ #define D_RAY_TOL_ERROR (ndFloat32 (-1.0e-3f)) #define D_RAY_TOL_ADAPTIVE_ERROR (ndFloat32 (1.0e-1f)) +ndFastAabb::ndFastAabb() + :ndMatrix(ndGetIdentityMatrix()) + ,m_absDir(ndGetIdentityMatrix()) + ,m_p0(ndVector::m_zero) + ,m_p1(ndVector::m_zero) + ,m_size(ndVector::m_zero) + ,m_separationDistance(ndFloat32(1.0e10f)) +{ +} + +ndFastAabb::ndFastAabb(const ndMatrix& matrix, const ndVector& size) + :ndMatrix(matrix) + ,m_separationDistance(ndFloat32(1.0e10f)) +{ + SetTransposeAbsMatrix(matrix); + m_size = ndVector(matrix[0].Abs().Scale(size.m_x) + matrix[1].Abs().Scale(size.m_y) + matrix[2].Abs().Scale(size.m_z)); + m_p0 = (matrix[3] - m_size) & ndVector::m_triplexMask; + m_p1 = (matrix[3] + m_size) & ndVector::m_triplexMask; +} + +ndFastAabb::ndFastAabb(const ndVector& p0, const ndVector& p1) + :ndMatrix(ndGetIdentityMatrix()) + ,m_absDir(ndGetIdentityMatrix()) + ,m_p0(p0) + ,m_p1(p1) + ,m_size(ndVector::m_half* (p1 - p0)) + ,m_separationDistance(ndFloat32(1.0e10f)) +{ + m_posit = (ndVector::m_half * (p1 + p0)) | ndVector::m_wOne; + ndAssert(m_size.m_w == ndFloat32(0.0f)); + ndAssert(m_posit.m_w == ndFloat32(1.0f)); +} + +const ndVector& ndFastAabb::GetOrigin() const +{ + return m_p0; +} + +const ndVector& ndFastAabb::GetTarget() const +{ + return m_p1; +} + +void ndFastAabb::SetSeparatingDistance(const ndFloat32 distance) +{ + m_separationDistance = distance; +} + +void ndFastAabb::SetTransposeAbsMatrix(const ndMatrix& matrix) +{ + m_absDir = matrix.Transpose3x3(); + m_absDir[0] = m_absDir[0].Abs(); + m_absDir[1] = m_absDir[1].Abs(); + m_absDir[2] = m_absDir[2].Abs(); +} + void ndFastAabb::MakeBox1(ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray, ndVector& minBox, ndVector& maxBox) const { ndVector faceBoxP0(&vertexArray[indexArray[0] * stride]); diff --git a/newton-4.00/sdk/dCore/ndFastAabb.h b/newton-4.00/sdk/dCore/ndFastAabb.h index e45278b89b..0ad736b9aa 100644 --- a/newton-4.00/sdk/dCore/ndFastAabb.h +++ b/newton-4.00/sdk/dCore/ndFastAabb.h @@ -31,15 +31,15 @@ D_MSV_NEWTON_ALIGN_32 class ndFastAabb : public ndMatrix { public: - ndFastAabb(); - ndFastAabb(const ndVector& p0, const ndVector& p1); - ndFastAabb(const ndMatrix& matrix, const ndVector& size); + D_CORE_API ndFastAabb(); + D_CORE_API ndFastAabb(const ndVector& p0, const ndVector& p1); + D_CORE_API ndFastAabb(const ndMatrix& matrix, const ndVector& size); - const ndVector& GetOrigin() const; - const ndVector& GetTarget() const; + D_CORE_API const ndVector& GetOrigin() const; + D_CORE_API const ndVector& GetTarget() const; - void SetSeparatingDistance(const ndFloat32 distance); - void SetTransposeAbsMatrix(const ndMatrix& matrix); + D_CORE_API void SetSeparatingDistance(const ndFloat32 distance); + D_CORE_API void SetTransposeAbsMatrix(const ndMatrix& matrix); D_CORE_API ndFloat32 PolygonBoxDistance(const ndVector& faceNormal, ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray) const; D_CORE_API ndFloat32 PolygonBoxRayDistance(const ndVector& faceNormal, ndInt32 indexCount, const ndInt32* const indexArray, ndInt32 stride, const ndFloat32* const vertexArray, const ndFastRay& ray) const; @@ -59,61 +59,6 @@ class ndFastAabb : public ndMatrix friend class ndAabbPolygonSoup; } D_GCC_NEWTON_ALIGN_32 ; -inline ndFastAabb::ndFastAabb() - :ndMatrix(ndGetIdentityMatrix()) - ,m_absDir(ndGetIdentityMatrix()) - ,m_p0(ndVector::m_zero) - ,m_p1(ndVector::m_zero) - ,m_size(ndVector::m_zero) - ,m_separationDistance(ndFloat32(1.0e10f)) -{ -} - -inline ndFastAabb::ndFastAabb(const ndMatrix& matrix, const ndVector& size) - :ndMatrix(matrix) - ,m_separationDistance(ndFloat32(1.0e10f)) -{ - SetTransposeAbsMatrix(matrix); - m_size = ndVector(matrix[0].Abs().Scale(size.m_x) + matrix[1].Abs().Scale(size.m_y) + matrix[2].Abs().Scale(size.m_z)); - m_p0 = (matrix[3] - m_size) & ndVector::m_triplexMask; - m_p1 = (matrix[3] + m_size) & ndVector::m_triplexMask; -} - -inline ndFastAabb::ndFastAabb(const ndVector& p0, const ndVector& p1) - :ndMatrix(ndGetIdentityMatrix()) - ,m_absDir(ndGetIdentityMatrix()) - ,m_p0(p0) - ,m_p1(p1) - ,m_size(ndVector::m_half * (p1 - p0)) - ,m_separationDistance(ndFloat32(1.0e10f)) -{ - m_posit = (ndVector::m_half * (p1 + p0)) | ndVector::m_wOne; - ndAssert(m_size.m_w == ndFloat32(0.0f)); - ndAssert(m_posit.m_w == ndFloat32(1.0f)); -} - -inline const ndVector& ndFastAabb::GetOrigin() const -{ - return m_p0; -} - -inline const ndVector& ndFastAabb::GetTarget() const -{ - return m_p1; -} - -inline void ndFastAabb::SetSeparatingDistance(const ndFloat32 distance) -{ - m_separationDistance = distance; -} - -inline void ndFastAabb::SetTransposeAbsMatrix(const ndMatrix& matrix) -{ - m_absDir = matrix.Transpose3x3(); - m_absDir[0] = m_absDir[0].Abs(); - m_absDir[1] = m_absDir[1].Abs(); - m_absDir[2] = m_absDir[2].Abs(); -} #endif diff --git a/newton-4.00/sdk/dCore/ndPolygonSoupDatabase.cpp b/newton-4.00/sdk/dCore/ndPolygonSoupDatabase.cpp index 75403f9a93..2ccec82193 100644 --- a/newton-4.00/sdk/dCore/ndPolygonSoupDatabase.cpp +++ b/newton-4.00/sdk/dCore/ndPolygonSoupDatabase.cpp @@ -50,4 +50,28 @@ void ndPolygonSoupDatabase::SetTagId(const ndInt32* const facePtr, ndInt32 index face[indexCount] = newID; } +ndInt32 ndPolygonSoupDatabase::GetVertexCount() const +{ + return m_vertexCount; +} + +ndFloat32* ndPolygonSoupDatabase::GetLocalVertexPool() const +{ + return m_localVertex; +} + +ndInt32 ndPolygonSoupDatabase::GetStrideInBytes() const +{ + return m_strideInBytes; +} + +ndFloat32 ndPolygonSoupDatabase::GetRadius() const +{ + return ndFloat32(0.0f); +} + +ndUnsigned32 ndPolygonSoupDatabase::GetTagId(const ndInt32* const face, ndInt32 indexCount) const +{ + return ndUnsigned32(face[indexCount]); +} diff --git a/newton-4.00/sdk/dCore/ndPolygonSoupDatabase.h b/newton-4.00/sdk/dCore/ndPolygonSoupDatabase.h index fc2418432c..2bfed7cf51 100644 --- a/newton-4.00/sdk/dCore/ndPolygonSoupDatabase.h +++ b/newton-4.00/sdk/dCore/ndPolygonSoupDatabase.h @@ -26,50 +26,27 @@ #include "ndTypes.h" #include "ndClassAlloc.h" +D_MSV_NEWTON_ALIGN_32 class ndPolygonSoupDatabase: public ndClassAlloc { public: - ndFloat32 GetRadius() const; - ndInt32 GetVertexCount() const; - ndInt32 GetStrideInBytes() const; - ndFloat32* GetLocalVertexPool() const; + D_CORE_API ndFloat32 GetRadius() const; + D_CORE_API ndInt32 GetVertexCount() const; + D_CORE_API ndInt32 GetStrideInBytes() const; + D_CORE_API ndFloat32* GetLocalVertexPool() const; - ndUnsigned32 GetTagId(const ndInt32* const face, ndInt32 indexCount) const; - void SetTagId(const ndInt32* const face, ndInt32 indexCount, ndUnsigned32 newID) const; + D_CORE_API ndUnsigned32 GetTagId(const ndInt32* const face, ndInt32 indexCount) const; + D_CORE_API void SetTagId(const ndInt32* const face, ndInt32 indexCount, ndUnsigned32 newID) const; protected: - ndPolygonSoupDatabase(const char* const name = nullptr); - virtual ~ndPolygonSoupDatabase (); + D_CORE_API ndPolygonSoupDatabase(const char* const name = nullptr); + D_CORE_API virtual ~ndPolygonSoupDatabase (); ndInt32 m_vertexCount; ndInt32 m_strideInBytes; ndFloat32* m_localVertex; }; - -inline ndInt32 ndPolygonSoupDatabase::GetVertexCount() const -{ - return m_vertexCount; -} - -inline ndFloat32* ndPolygonSoupDatabase::GetLocalVertexPool() const -{ - return m_localVertex; -} - -inline ndInt32 ndPolygonSoupDatabase::GetStrideInBytes() const -{ - return m_strideInBytes; -} - -inline ndFloat32 ndPolygonSoupDatabase::GetRadius() const -{ - return ndFloat32 (0.0f); -} - -inline ndUnsigned32 ndPolygonSoupDatabase::GetTagId(const ndInt32* const face, ndInt32 indexCount) const -{ - return ndUnsigned32(face[indexCount]); -} +D_GCC_NEWTON_ALIGN_32; #endif