Files

1487 lines
54 KiB
C++
Raw Permalink Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
#include "GeometryCollection/GeometryCollectionSceneProxy.h"
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
#include "Async/ParallelFor.h"
#include "Engine/Engine.h"
#include "GeometryCollection/GeometryCollection.h"
#include "GeometryCollection/GeometryCollectionObject.h"
#include "MaterialDomain.h"
#include "MaterialShaderType.h"
#include "MaterialShared.h"
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
#include "Materials/Material.h"
#include "Materials/MaterialRenderProxy.h"
#include "CommonRenderResources.h"
#include "Rendering/NaniteResources.h"
#include "PrimitiveSceneInfo.h"
#include "GeometryCollection/GeometryCollectionComponent.h"
#include "GeometryCollection/GeometryCollectionAlgo.h"
#include "GeometryCollection/GeometryCollectionHitProxy.h"
#include "GeometryCollection/GeometryCollectionDebugDraw.h"
#include "RHIDefinitions.h"
#include "ComponentReregisterContext.h"
#include "ComponentRecreateRenderStateContext.h"
#include "RenderGraphBuilder.h"
#include "MeshPaintVisualize.h"
#if RHI_RAYTRACING
#include "RayTracingInstance.h"
#endif
#if INTEL_ISPC
#if USING_CODE_ANALYSIS
MSVC_PRAGMA( warning( push ) )
MSVC_PRAGMA( warning( disable : ALL_CODE_ANALYSIS_WARNINGS ) )
#endif // USING_CODE_ANALYSIS
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnonportable-include-path"
#endif
#include "GeometryCollectionSceneProxy.ispc.generated.h"
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#if USING_CODE_ANALYSIS
MSVC_PRAGMA( warning( pop ) )
#endif // USING_CODE_ANALYSIS
static_assert(sizeof(ispc::FMatrix44f) == sizeof(FMatrix44f), "sizeof(ispc::FMatrix44f) != sizeof(FMatrix44f)");
static_assert(sizeof(ispc::FVector3f) == sizeof(FVector3f), "sizeof(ispc::FVector3f) != sizeof(FVector3f)");
#endif
static int32 GParallelGeometryCollectionBatchSize = 1024;
static TAutoConsoleVariable<int32> CVarParallelGeometryCollectionBatchSize(
TEXT("r.ParallelGeometryCollectionBatchSize"),
GParallelGeometryCollectionBatchSize,
TEXT("The number of vertices per thread dispatch in a single collection. \n"),
ECVF_Default
);
static int32 GGeometryCollectionTripleBufferUploads = 1;
FAutoConsoleVariableRef CVarGeometryCollectionTripleBufferUploads(
TEXT("r.GeometryCollectionTripleBufferUploads"),
GGeometryCollectionTripleBufferUploads,
TEXT("Whether to triple buffer geometry collection uploads, which allows Lock_NoOverwrite uploads which are much faster on the GPU with large amounts of data."),
ECVF_Default
);
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
static int32 GRayTracingGeometryCollectionProxyMeshes = 0;
FAutoConsoleVariableRef CVarRayTracingGeometryCollectionProxyMeshes(
TEXT("r.RayTracing.Geometry.GeometryCollection"),
GRayTracingGeometryCollectionProxyMeshes,
TEXT("Include geometry collection proxy meshes in ray tracing effects (default = 0 (Geometry collection meshes disabled in ray tracing))"),
ECVF_RenderThreadSafe
);
#if !defined(CHAOS_GEOMETRY_COLLECTION_SET_DYNAMIC_DATA_ISPC_ENABLED_DEFAULT)
#define CHAOS_GEOMETRY_COLLECTION_SET_DYNAMIC_DATA_ISPC_ENABLED_DEFAULT 1
#endif
// Support run-time toggling on supported platforms in non-shipping configurations
#if !INTEL_ISPC || UE_BUILD_SHIPPING
static constexpr bool bGeometryCollection_SetDynamicData_ISPC_Enabled = INTEL_ISPC && CHAOS_GEOMETRY_COLLECTION_SET_DYNAMIC_DATA_ISPC_ENABLED_DEFAULT;
#else
static bool bGeometryCollection_SetDynamicData_ISPC_Enabled = CHAOS_GEOMETRY_COLLECTION_SET_DYNAMIC_DATA_ISPC_ENABLED_DEFAULT;
static FAutoConsoleVariableRef CVarGeometryCollectionSetDynamicDataISPCEnabled(TEXT("r.GeometryCollectionSetDynamicData.ISPC"), bGeometryCollection_SetDynamicData_ISPC_Enabled, TEXT("Whether to use ISPC optimizations to set dynamic data in geometry collections"));
#endif
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
DEFINE_LOG_CATEGORY_STATIC(FGeometryCollectionSceneProxyLogging, Log, All);
2021-04-20 10:45:04 -04:00
FGeometryCollectionDynamicDataPool GDynamicDataPool;
class FGeometryCollectionMeshCollectorResources : public FOneFrameResource
{
public:
FGeometryCollectionVertexFactory VertexFactory;
FGeometryCollectionMeshCollectorResources(ERHIFeatureLevel::Type InFeatureLevel)
: VertexFactory(InFeatureLevel,true)
{
}
virtual ~FGeometryCollectionMeshCollectorResources()
{
VertexFactory.ReleaseResource();
}
virtual FGeometryCollectionVertexFactory& GetVertexFactory() { return VertexFactory; }
};
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
FGeometryCollectionSceneProxy::FGeometryCollectionSceneProxy(UGeometryCollectionComponent* Component)
: FPrimitiveSceneProxy(Component)
, MaterialRelevance(Component->GetMaterialRelevance(GetScene().GetFeatureLevel()))
, MeshResource(Component->GetRestCollection()->RenderData->MeshResource)
, MeshDescription(Component->GetRestCollection()->RenderData->MeshDescription)
, VertexFactory(GetScene().GetFeatureLevel())
, bSupportsManualVertexFetch(VertexFactory.SupportsManualVertexFetch(GetScene().GetFeatureLevel()))
, bSupportsTripleBufferVertexUpload(GRHISupportsMapWriteNoOverwrite)
#if WITH_EDITOR
, bShowBoneColors(Component->GetShowBoneColors())
, bSuppressSelectionMaterial(Component->GetSuppressSelectionMaterial())
, VertexFactoryDebugColor(GetScene().GetFeatureLevel())
#endif
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
if (Component->GetRestCollection())
{
GeometryCollection = Component->GetRestCollection()->GetGeometryCollection();
}
EnableGPUSceneSupportFlags();
Materials.Empty();
const int32 NumMaterials = Component->GetNumMaterials();
for (int MaterialIndex = 0; MaterialIndex < NumMaterials; ++MaterialIndex)
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
Materials.Push(Component->GetMaterial(MaterialIndex));
if (Materials[MaterialIndex] == nullptr || !Materials[MaterialIndex]->CheckMaterialUsage_Concurrent(MATUSAGE_GeometryCollections))
{
Materials[MaterialIndex] = UMaterial::GetDefaultMaterial(MD_Surface);
}
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
NumTransforms = GeometryCollection? GeometryCollection->NumElements(FTransformCollection::TransformGroup) : 0;
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
// Render by SubSection if we are in the rigid body picker.
bUsesSubSections = Component->GetIsTransformSelectionMode() && MeshDescription.SubSections.Num();
// Enable bone hit selection proxies if we are in the rigid body picker or in the fracture modes.
bEnableBoneSelection = Component->GetEnableBoneSelection();
if (bEnableBoneSelection || bUsesSubSections)
{
for (int32 TransformIndex = 0; TransformIndex < NumTransforms; ++TransformIndex)
{
HGeometryCollection* HitProxy = new HGeometryCollection(Component, TransformIndex);
HitProxies.Add(HitProxy);
}
}
#endif
#if WITH_EDITOR
if (bShowBoneColors || bEnableBoneSelection)
{
Component->GetBoneColors(BoneColors);
ColorVertexBuffer.InitFromColorArray(BoneColors);
if (Component->GetRestCollection())
{
BoneSelectedMaterial = Component->GetRestCollection()->GetBoneSelectedMaterial();
}
if (BoneSelectedMaterial && !BoneSelectedMaterial->CheckMaterialUsage_Concurrent(MATUSAGE_GeometryCollections))
{
// If we have an invalid BoneSelectedMaterial, switch it back to null to skip its usage in GetDynamicMeshElements below
BoneSelectedMaterial = nullptr;
}
// Make sure the vertex color material has the usage flag for rendering geometry collections
if (GEngine->VertexColorMaterial)
{
GEngine->VertexColorMaterial->CheckMaterialUsage_Concurrent(MATUSAGE_GeometryCollections);
}
}
#endif
// #todo(dmp): This flag means that when motion blur is turned on, it will always render geometry collections into the
// velocity buffer. Note that the way around this is to loop through the global matrices and test whether they have
// changed from the prev to curr frame, but this is expensive. We should revisit this if the draw calls for velocity
// rendering become a problem. One solution could be to use internal solver sleeping state to drive motion blur.
bAlwaysHasVelocity = true;
DynamicData = Component->InitDynamicData(true);
SetWireframeColor(Component->GetWireframeColorForSceneProxy());
CollisionResponse = Component->GetCollisionResponseToChannels();
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
FGeometryCollectionSceneProxy::~FGeometryCollectionSceneProxy()
{
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
if (DynamicData != nullptr)
{
GDynamicDataPool.Release(DynamicData);
DynamicData = nullptr;
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
}
SIZE_T FGeometryCollectionSceneProxy::GetTypeHash() const
{
static size_t UniquePointer;
return reinterpret_cast<size_t>(&UniquePointer);
}
static void UpdateLooseParameter(
FGeometryCollectionVertexFactory& VertexFactory,
FRHIShaderResourceView* BoneTransformSRV,
FRHIShaderResourceView* BonePrevTransformSRV,
FRHIShaderResourceView* BoneMapSRV)
{
FGCBoneLooseParameters LooseParameters;
LooseParameters.VertexFetch_BoneTransformBuffer = BoneTransformSRV;
LooseParameters.VertexFetch_BonePrevTransformBuffer = BonePrevTransformSRV;
LooseParameters.VertexFetch_BoneMapBuffer = BoneMapSRV;
EUniformBufferUsage UniformBufferUsage = VertexFactory.EnableLooseParameter ? UniformBuffer_SingleFrame : UniformBuffer_MultiFrame;
VertexFactory.LooseParameterUniformBuffer = FGCBoneLooseParametersRef::CreateUniformBufferImmediate(LooseParameters, UniformBufferUsage);
}
void FGeometryCollectionSceneProxy::SetupVertexFactory(FRHICommandListBase& RHICmdList, FGeometryCollectionVertexFactory& GeometryCollectionVertexFactory, FColorVertexBuffer* ColorOverride) const
{
FGeometryCollectionVertexFactory::FDataType Data;
FPositionVertexBuffer const& PositionVB = bSupportsManualVertexFetch ? MeshResource.PositionVertexBuffer : SkinnedPositionVertexBuffer;
PositionVB.BindPositionVertexBuffer(&GeometryCollectionVertexFactory, Data);
MeshResource.StaticMeshVertexBuffer.BindTangentVertexBuffer(&GeometryCollectionVertexFactory, Data);
MeshResource.StaticMeshVertexBuffer.BindPackedTexCoordVertexBuffer(&GeometryCollectionVertexFactory, Data);
MeshResource.StaticMeshVertexBuffer.BindLightMapVertexBuffer(&GeometryCollectionVertexFactory, Data, 0);
FColorVertexBuffer const& ColorVB = ColorOverride ? *ColorOverride : MeshResource.ColorVertexBuffer;
ColorVB.BindColorVertexBuffer(&GeometryCollectionVertexFactory, Data);
if (bSupportsManualVertexFetch)
{
Data.BoneMapSRV = MeshResource.BoneMapVertexBuffer.GetSRV();
Data.BoneTransformSRV = TransformBuffers[CurrentTransformBufferIndex].VertexBufferSRV;
Data.BonePrevTransformSRV = Data.BoneTransformSRV; // setup : both prev and crrent are the same
}
else
{
// Make sure these are not null to pass UB validation
Data.BoneMapSRV = GNullColorVertexBuffer.VertexBufferSRV;
Data.BoneTransformSRV = GNullColorVertexBuffer.VertexBufferSRV;
Data.BonePrevTransformSRV = GNullColorVertexBuffer.VertexBufferSRV;
}
GeometryCollectionVertexFactory.SetData(RHICmdList, Data);
if (!GeometryCollectionVertexFactory.IsInitialized())
{
GeometryCollectionVertexFactory.InitResource(RHICmdList);
}
else
{
GeometryCollectionVertexFactory.UpdateRHI(RHICmdList);
}
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
void FGeometryCollectionSceneProxy::CreateRenderThreadResources(FRHICommandListBase& RHICmdList)
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
if (bSupportsManualVertexFetch)
{
// Initialize transform buffers and upload rest transforms.
TransformBuffers.AddDefaulted(1);
TransformBuffers[0].NumTransforms = NumTransforms;
TransformBuffers[0].InitResource(RHICmdList);
const bool bLocalGeometryCollectionTripleBufferUploads = (GGeometryCollectionTripleBufferUploads != 0) && bSupportsTripleBufferVertexUpload;
const EResourceLockMode LockMode = bLocalGeometryCollectionTripleBufferUploads ? RLM_WriteOnly_NoOverwrite : RLM_WriteOnly;
FGeometryCollectionTransformBuffer& TransformBuffer = GetCurrentTransformBuffer();
TransformBuffer.UpdateDynamicData(RHICmdList, DynamicData->Transforms, LockMode);
}
else
{
// Initialize CPU skinning buffer with rest transforms.
SkinnedPositionVertexBuffer.Init(MeshResource.PositionVertexBuffer.GetNumVertices(), false);
SkinnedPositionVertexBuffer.InitResource(RHICmdList);
UpdateSkinnedPositions(RHICmdList, DynamicData->Transforms);
}
SetupVertexFactory(RHICmdList, VertexFactory);
#if WITH_EDITOR
if (bShowBoneColors || bEnableBoneSelection)
{
// Initialize debug color buffer and associated vertex factory.
ColorVertexBuffer.InitResource(RHICmdList);
SetupVertexFactory(RHICmdList, VertexFactoryDebugColor, &ColorVertexBuffer);
}
#endif
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
if (MeshDescription.NumVertices && HitProxies.Num())
{
// Create buffer containing per vertex hit proxy IDs.
HitProxyIdBuffer.Init(MeshDescription.NumVertices);
HitProxyIdBuffer.InitResource(RHICmdList);
uint16 const* BoneMapData = &MeshResource.BoneMapVertexBuffer.BoneIndex(0);
ParallelFor(MeshDescription.NumVertices, [&](int32 i)
{
// Note that some fracture undo/redo operations can: recreate scene proxy, then update render data, then recreate proxy again.
// In that case we can come here the first time with too few hit proxy objects for the bone map which hasn't updated.
// But we then enter here a second time with the render data correct.
int16 ProxyIndex = BoneMapData[i];
ProxyIndex = HitProxies.IsValidIndex(ProxyIndex) ? ProxyIndex : 0;
HitProxyIdBuffer.VertexColor(i) = HitProxies[ProxyIndex]->Id.GetColor();
});
void* VertexBufferData = RHICmdList.LockBuffer(HitProxyIdBuffer.VertexBufferRHI, 0, HitProxyIdBuffer.GetNumVertices() * HitProxyIdBuffer.GetStride(), RLM_WriteOnly);
FMemory::Memcpy(VertexBufferData, HitProxyIdBuffer.GetVertexData(), HitProxyIdBuffer.GetNumVertices() * HitProxyIdBuffer.GetStride());
RHICmdList.UnlockBuffer(HitProxyIdBuffer.VertexBufferRHI);
}
#endif
#if RHI_RAYTRACING
if (IsRayTracingEnabled())
{
FRayTracingGeometryInitializer Initializer;
Initializer.DebugName = FName(TEXT("GeometryCollection"));
Initializer.GeometryType = RTGT_Triangles;
Initializer.bFastBuild = true;
Initializer.bAllowUpdate = false;
Initializer.TotalPrimitiveCount = 0;
RayTracingGeometry.SetInitializer(Initializer);
RayTracingGeometry.InitResource(RHICmdList);
bGeometryResourceUpdated = true;
}
#endif
bRenderResourcesCreated = true;
SetDynamicData_RenderThread(RHICmdList, DynamicData);
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
void FGeometryCollectionSceneProxy::DestroyRenderThreadResources()
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
if (bSupportsManualVertexFetch)
{
for (int32 i = 0; i < TransformBuffers.Num(); i++)
{
TransformBuffers[i].ReleaseResource();
}
TransformBuffers.Reset();
}
else
{
SkinnedPositionVertexBuffer.ReleaseResource();
}
VertexFactory.ReleaseResource();
#if WITH_EDITOR
VertexFactoryDebugColor.ReleaseResource();
ColorVertexBuffer.ReleaseResource();
#endif
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
HitProxyIdBuffer.ReleaseResource();
#endif
#if RHI_RAYTRACING
if (IsRayTracingAllowed())
{
RayTracingGeometry.ReleaseResource();
RayTracingDynamicVertexBuffer.Release();
}
#endif
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
void FGeometryCollectionSceneProxy::SetDynamicData_RenderThread(FRHICommandListBase& RHICmdList, FGeometryCollectionDynamicData* NewDynamicData)
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
if (NewDynamicData != DynamicData)
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
if (DynamicData)
{
GDynamicDataPool.Release(DynamicData);
DynamicData = nullptr;
}
DynamicData = NewDynamicData;
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
if (MeshDescription.NumVertices == 0 || !DynamicData || !bRenderResourcesCreated)
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
return;
}
if (bSupportsManualVertexFetch)
{
const bool bLocalGeometryCollectionTripleBufferUploads = (GGeometryCollectionTripleBufferUploads != 0) && bSupportsTripleBufferVertexUpload;
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
if (bLocalGeometryCollectionTripleBufferUploads && TransformBuffers.Num() == 1)
{
TransformBuffers.AddDefaulted(2);
check(TransformBuffers.Num() == 3);
for (int32 i = 1; i < TransformBuffers.Num(); i++)
{
TransformBuffers[i].NumTransforms = NumTransforms;
TransformBuffers[i].InitResource(RHICmdList);
}
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
// Copy the transform data over to the vertex buffer
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
const EResourceLockMode LockMode = bLocalGeometryCollectionTripleBufferUploads ? RLM_WriteOnly_NoOverwrite : RLM_WriteOnly;
CycleTransformBuffers(bLocalGeometryCollectionTripleBufferUploads);
FGeometryCollectionTransformBuffer& TransformBuffer = GetCurrentTransformBuffer();
FGeometryCollectionTransformBuffer& PrevTransformBuffer = GetCurrentPrevTransformBuffer();
VertexFactory.SetBoneTransformSRV(TransformBuffer.VertexBufferSRV);
VertexFactory.SetBonePrevTransformSRV(PrevTransformBuffer.VertexBufferSRV);
TransformBuffer.UpdateDynamicData(RHICmdList, DynamicData->Transforms, LockMode);
UpdateLooseParameter(VertexFactory, TransformBuffer.VertexBufferSRV, PrevTransformBuffer.VertexBufferSRV, MeshResource.BoneMapVertexBuffer.GetSRV());
#if WITH_EDITOR
if (bShowBoneColors || bEnableBoneSelection)
{
VertexFactoryDebugColor.SetBoneTransformSRV(TransformBuffer.VertexBufferSRV);
VertexFactoryDebugColor.SetBonePrevTransformSRV(PrevTransformBuffer.VertexBufferSRV);
UpdateLooseParameter(VertexFactoryDebugColor, TransformBuffer.VertexBufferSRV, PrevTransformBuffer.VertexBufferSRV, MeshResource.BoneMapVertexBuffer.GetSRV());
}
#endif
}
}
else
{
UpdateSkinnedPositions(RHICmdList, DynamicData->Transforms);
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
#if RHI_RAYTRACING
if (IsRayTracingEnabled())
{
bGeometryResourceUpdated = true;
}
#endif
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
void FGeometryCollectionSceneProxy::UpdateSkinnedPositions(FRHICommandListBase& RHICmdList, TArray<FMatrix44f> const& Transforms)
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
const int32 VertexStride = SkinnedPositionVertexBuffer.GetStride();
const int32 VertexCount = SkinnedPositionVertexBuffer.GetNumVertices();
check (VertexCount == MeshDescription.NumVertices)
void* VertexBufferData = RHICmdList.LockBuffer(SkinnedPositionVertexBuffer.VertexBufferRHI, 0, VertexCount * VertexStride, RLM_WriteOnly);
check(VertexBufferData != nullptr);
FPositionVertexBuffer const& SourcePositionVertexBuffer = MeshResource.PositionVertexBuffer;
FBoneMapVertexBuffer const& SourceBoneMapVertexBuffer = MeshResource.BoneMapVertexBuffer;
bool bParallelGeometryCollection = true;
int32 ParallelGeometryCollectionBatchSize = CVarParallelGeometryCollectionBatchSize.GetValueOnRenderThread();
int32 NumBatches = (VertexCount / ParallelGeometryCollectionBatchSize);
if (VertexCount != ParallelGeometryCollectionBatchSize)
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
NumBatches++;
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
// Batch too small, don't bother with parallel
if (ParallelGeometryCollectionBatchSize > VertexCount)
{
bParallelGeometryCollection = false;
ParallelGeometryCollectionBatchSize = VertexCount;
}
auto GeometryCollectionBatch([&](int32 BatchNum)
{
uint32 IndexOffset = ParallelGeometryCollectionBatchSize * BatchNum;
uint32 ThisBatchSize = ParallelGeometryCollectionBatchSize;
// Check for final batch
if (IndexOffset + ParallelGeometryCollectionBatchSize > MeshDescription.NumVertices)
{
ThisBatchSize = VertexCount - IndexOffset;
}
if (ThisBatchSize > 0)
{
const FMatrix44f* RESTRICT BoneTransformsPtr = Transforms.GetData();
if (bGeometryCollection_SetDynamicData_ISPC_Enabled)
{
#if INTEL_ISPC
uint8* VertexBufferOffset = (uint8*)VertexBufferData + (IndexOffset * VertexStride);
ispc::SetDynamicData_RenderThread(
(ispc::FVector3f*)VertexBufferOffset,
ThisBatchSize,
VertexStride,
&SourceBoneMapVertexBuffer.BoneIndex(IndexOffset),
(ispc::FMatrix44f*)BoneTransformsPtr,
(ispc::FVector3f*)&SourcePositionVertexBuffer.VertexPosition(IndexOffset));
#endif
}
else
{
for (uint32 i = IndexOffset; i < IndexOffset + ThisBatchSize; i++)
{
FVector3f Transformed = BoneTransformsPtr[SourceBoneMapVertexBuffer.BoneIndex(i)].TransformPosition(SourcePositionVertexBuffer.VertexPosition(i));
FMemory::Memcpy((uint8*)VertexBufferData + (i * VertexStride), &Transformed, sizeof(FVector3f));
}
}
}
});
ParallelFor(NumBatches, GeometryCollectionBatch, !bParallelGeometryCollection);
RHICmdList.UnlockBuffer(SkinnedPositionVertexBuffer.VertexBufferRHI);
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
FMaterialRenderProxy* FGeometryCollectionSceneProxy::GetMaterial(FMeshElementCollector& Collector, int32 MaterialIndex) const
{
FMaterialRenderProxy* MaterialProxy = nullptr;
#if WITH_EDITOR
if (bShowBoneColors && GEngine->VertexColorMaterial)
{
// Material for colored bones
UMaterial* VertexColorVisualizationMaterial = GEngine->VertexColorMaterial;
FMaterialRenderProxy* VertexColorVisualizationMaterialInstance = new FColoredMaterialRenderProxy(
VertexColorVisualizationMaterial->GetRenderProxy(),
GetSelectionColor(FLinearColor::White, false, false)
);
Collector.RegisterOneFrameMaterialProxy(VertexColorVisualizationMaterialInstance);
MaterialProxy = VertexColorVisualizationMaterialInstance;
}
else
#endif
if(Materials.IsValidIndex(MaterialIndex))
{
MaterialProxy = Materials[MaterialIndex]->GetRenderProxy();
}
if (MaterialProxy == nullptr)
{
MaterialProxy = UMaterial::GetDefaultMaterial(MD_Surface)->GetRenderProxy();
}
return MaterialProxy;
}
FVertexFactory const* FGeometryCollectionSceneProxy::GetVertexFactory() const
{
#if WITH_EDITOR
return bShowBoneColors ? &VertexFactoryDebugColor : &VertexFactory;
#else
return &VertexFactory;
#endif
}
bool FGeometryCollectionSceneProxy::ShowCollisionMeshes(const FEngineShowFlags& EngineShowFlags) const
{
if (IsCollisionEnabled())
{
if (EngineShowFlags.CollisionPawn && CollisionResponse.GetResponse(ECC_Pawn) != ECR_Ignore)
{
return true;
}
if (EngineShowFlags.CollisionVisibility && CollisionResponse.GetResponse(ECC_Visibility) != ECR_Ignore)
{
return true;
}
if (EngineShowFlags.Collision)
{
return true;
}
}
return false;
}
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
void FGeometryCollectionSceneProxy::GetDynamicMeshElements(const TArray<const FSceneView*>& Views, const FSceneViewFamily& ViewFamily, uint32 VisibilityMap, FMeshElementCollector& Collector) const
{
QUICK_SCOPE_CYCLE_COUNTER(STAT_GeometryCollectionSceneProxy_GetDynamicMeshElements);
if (MeshDescription.NumVertices == 0)
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
return;
}
const FEngineShowFlags& EngineShowFlags = ViewFamily.EngineShowFlags;
const bool bWireframe = AllowDebugViewmodes() && EngineShowFlags.Wireframe;
const bool bProxyIsSelected = IsSelected();
const bool bDrawOnlyCollisionMeshes = EngineShowFlags.CollisionPawn || EngineShowFlags.CollisionVisibility;
const bool bDrawWireframeCollision = EngineShowFlags.Collision && IsCollisionEnabled();
auto SetDebugMaterial = [this, &Collector, &EngineShowFlags, bProxyIsSelected](FMeshBatch& Mesh) -> void
{
#if UE_ENABLE_DEBUG_DRAWING
// flag to indicate whether we've set a debug material yet
// Note: Will be used if we add more debug material options
// (compare to variable of same name in StaticMeshRender.cpp)
bool bDebugMaterialRenderProxySet = false;
if (!bDebugMaterialRenderProxySet && bProxyIsSelected && EngineShowFlags.VertexColors && AllowDebugViewmodes())
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
{
// Note: static mesh renderer does something more complicated involving per-section selection, but whole component selection seems ok for now.
if (FMaterialRenderProxy* VertexColorVisualizationMaterialInstance = MeshPaintVisualize::GetMaterialRenderProxy(bProxyIsSelected, IsHovered()))
{
Collector.RegisterOneFrameMaterialProxy(VertexColorVisualizationMaterialInstance);
Mesh.MaterialRenderProxy = VertexColorVisualizationMaterialInstance;
bDebugMaterialRenderProxySet = true;
}
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
#endif
};
const bool bDrawGeometryCollectionMesh = !bDrawOnlyCollisionMeshes;
if (bDrawGeometryCollectionMesh)
{
for (int32 ViewIndex = 0; ViewIndex < Views.Num(); ViewIndex++)
{
if ((VisibilityMap & (1 << ViewIndex)) == 0)
{
continue;
}
// If hiding geometry in editor then we don't remove hidden faces.
const bool bRemoveInternalFaces = false;
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
// If using subsections then use the subsection array.
TArray<FGeometryCollectionMeshElement> const& SectionArray = bUsesSubSections
? MeshDescription.SubSections
: bRemoveInternalFaces ? MeshDescription.SectionsNoInternal : MeshDescription.Sections;
#else
TArray<FGeometryCollectionMeshElement> const& SectionArray = bRemoveInternalFaces ? MeshDescription.SectionsNoInternal : MeshDescription.Sections;
#endif
// Grab the material proxies we'll be using for each section.
TArray<FMaterialRenderProxy*, TInlineAllocator<32>> MaterialProxies;
for (int32 SectionIndex = 0; SectionIndex < SectionArray.Num(); ++SectionIndex)
{
const FGeometryCollectionMeshElement& Section = SectionArray[SectionIndex];
FMaterialRenderProxy* MaterialProxy = GetMaterial(Collector, Section.MaterialIndex);
MaterialProxies.Add(MaterialProxy);
}
// Draw the meshes.
for (int32 SectionIndex = 0; SectionIndex < SectionArray.Num(); ++SectionIndex)
{
const FGeometryCollectionMeshElement& Section = SectionArray[SectionIndex];
FMeshBatch& Mesh = Collector.AllocateMesh();
Mesh.bWireframe = bWireframe;
Mesh.VertexFactory = GetVertexFactory();
Mesh.MaterialRenderProxy = MaterialProxies[SectionIndex];
Mesh.ReverseCulling = IsLocalToWorldDeterminantNegative();
Mesh.Type = PT_TriangleList;
Mesh.DepthPriorityGroup = SDPG_World;
Mesh.bCanApplyViewModeOverrides = true;
SetDebugMaterial(Mesh);
FMeshBatchElement& BatchElement = Mesh.Elements[0];
BatchElement.IndexBuffer = &MeshResource.IndexBuffer;
BatchElement.PrimitiveUniformBuffer = GetUniformBuffer();
BatchElement.FirstIndex = Section.TriangleStart * 3;
BatchElement.NumPrimitives = Section.TriangleCount;
BatchElement.MinVertexIndex = Section.VertexStart;
BatchElement.MaxVertexIndex = Section.VertexEnd;
Collector.AddMesh(ViewIndex, Mesh);
}
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
// Highlight selected bone using specialized material.
// #note: This renders the geometry again but with the bone selection material. Ideally we'd have one render pass and one material.
if (bEnableBoneSelection && !bSuppressSelectionMaterial && BoneSelectedMaterial)
{
FMaterialRenderProxy* MaterialRenderProxy = BoneSelectedMaterial->GetRenderProxy();
FMeshBatch& Mesh = Collector.AllocateMesh();
Mesh.bWireframe = bWireframe;
Mesh.VertexFactory = &VertexFactoryDebugColor;
Mesh.MaterialRenderProxy = MaterialRenderProxy;
Mesh.ReverseCulling = IsLocalToWorldDeterminantNegative();
Mesh.Type = PT_TriangleList;
Mesh.DepthPriorityGroup = SDPG_World;
Mesh.bCanApplyViewModeOverrides = false;
FMeshBatchElement& BatchElement = Mesh.Elements[0];
BatchElement.IndexBuffer = &MeshResource.IndexBuffer;
BatchElement.PrimitiveUniformBuffer = GetUniformBuffer();
BatchElement.FirstIndex = 0;
BatchElement.NumPrimitives = MeshDescription.NumTriangles;
BatchElement.MinVertexIndex = 0;
BatchElement.MaxVertexIndex = MeshDescription.NumVertices;
Collector.AddMesh(ViewIndex, Mesh);
}
#endif // GEOMETRYCOLLECTION_EDITOR_SELECTION
}
}
// draw extra stuff ( collision , bounds ... )
for (int32 ViewIndex = 0; ViewIndex < Views.Num(); ViewIndex++)
{
if (VisibilityMap & (1 << ViewIndex))
{
// collision modes
if (ShowCollisionMeshes(EngineShowFlags) && GeometryCollection && AllowDebugViewmodes())
{
FTransform GeomTransform(GetLocalToWorld());
if (bDrawWireframeCollision)
{
GeometryCollectionDebugDraw::DrawWireframe(*GeometryCollection, GeomTransform, Collector, ViewIndex, GetWireframeColor().ToFColor(true));
}
else
{
FMaterialRenderProxy* CollisionMaterialInstance = new FColoredMaterialRenderProxy(GEngine->ShadedLevelColorationUnlitMaterial->GetRenderProxy(), GetWireframeColor());
Collector.RegisterOneFrameMaterialProxy(CollisionMaterialInstance);
GeometryCollectionDebugDraw::DrawSolid(*GeometryCollection, GeomTransform, Collector, ViewIndex, CollisionMaterialInstance);
}
}
// render bounds
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
RenderBounds(Collector.GetPDI(ViewIndex), ViewFamily.EngineShowFlags, GetBounds(), IsSelected());
#endif
}
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
}
}
#if RHI_RAYTRACING
void FGeometryCollectionSceneProxy::GetDynamicRayTracingInstances(FRayTracingInstanceCollector& Collector)
{
if (GRayTracingGeometryCollectionProxyMeshes == 0 || MeshDescription.NumVertices == 0)
{
return;
}
QUICK_SCOPE_CYCLE_COUNTER(STAT_GeometryCollectionSceneProxy_GetDynamicRayTracingInstances);
const uint32 LODIndex = 0;
const bool bWireframe = false;
//Loose parameter needs to be updated every frame
FGeometryCollectionMeshCollectorResources* CollectorResources;
CollectorResources = &Collector.AllocateOneFrameResource<FGeometryCollectionMeshCollectorResources>(GetScene().GetFeatureLevel());
FGeometryCollectionVertexFactory& GeometryCollectionVertexFactory = CollectorResources->GetVertexFactory();
// Render dynamic objects
if (!GeometryCollectionVertexFactory.GetType()->SupportsRayTracingDynamicGeometry())
{
return;
}
SetupVertexFactory(Collector.GetRHICommandList(), GeometryCollectionVertexFactory);
TArray<FGeometryCollectionMeshElement> const& SectionArray = MeshDescription.Sections;
UpdatingRayTracingGeometry_RenderingThread(SectionArray);
if (SectionArray.Num() && RayTracingGeometry.IsValid())
{
FRayTracingInstance RayTracingInstance;
RayTracingInstance.Geometry = &RayTracingGeometry;
RayTracingInstance.InstanceTransforms.Emplace(GetLocalToWorld());
// Grab the material proxies we'll be using for each section
TArray<FMaterialRenderProxy*, TInlineAllocator<32>> MaterialProxies;
for (int32 SectionIndex = 0; SectionIndex < SectionArray.Num(); ++SectionIndex)
{
const FGeometryCollectionMeshElement& Section = SectionArray[SectionIndex];
//TODO: Add BoneColor support in Path/Ray tracing?
FMaterialRenderProxy* MaterialProxy= Materials[Section.MaterialIndex]->GetRenderProxy();
if (MaterialProxy == nullptr)
{
MaterialProxy = UMaterial::GetDefaultMaterial(MD_Surface)->GetRenderProxy();
}
MaterialProxies.Add(MaterialProxy);
}
uint32 MaxVertexIndex = 0;
for (int32 SectionIndex = 0; SectionIndex < SectionArray.Num(); ++SectionIndex)
{
const FGeometryCollectionMeshElement& Section = SectionArray[SectionIndex];
// Draw the mesh
FMeshBatch& Mesh = RayTracingInstance.Materials.AddDefaulted_GetRef();
Mesh.bWireframe = bWireframe;
Mesh.SegmentIndex = SectionIndex;
Mesh.VertexFactory = &GeometryCollectionVertexFactory;
Mesh.MaterialRenderProxy = MaterialProxies[SectionIndex];
Mesh.LODIndex = LODIndex;
Mesh.bDisableBackfaceCulling = true;
Mesh.Type = PT_TriangleList;
Mesh.DepthPriorityGroup = SDPG_World;
Mesh.bCanApplyViewModeOverrides = true;
FMeshBatchElement& BatchElement = Mesh.Elements[0];
BatchElement.IndexBuffer = &MeshResource.IndexBuffer;
BatchElement.PrimitiveUniformBuffer = GetUniformBuffer();
BatchElement.FirstIndex = Section.TriangleStart * 3;
BatchElement.NumPrimitives = Section.TriangleCount;
BatchElement.MinVertexIndex = Section.VertexStart;
BatchElement.MaxVertexIndex = Section.VertexEnd;
BatchElement.NumInstances = 1;
MaxVertexIndex = std::max(Section.VertexEnd, MaxVertexIndex);
//#TODO: bone color, bone selection and render bound?
}
FRWBuffer* VertexBuffer = RayTracingDynamicVertexBuffer.NumBytes > 0 ? &RayTracingDynamicVertexBuffer : nullptr;
const uint32 VertexCount = MaxVertexIndex + 1;
Collector.AddRayTracingGeometryUpdate(
FRayTracingDynamicGeometryUpdateParams
{
RayTracingInstance.Materials,
false,
VertexCount,
VertexCount * (uint32)sizeof(FVector3f),
RayTracingGeometry.Initializer.TotalPrimitiveCount,
&RayTracingGeometry,
VertexBuffer,
true
}
);
Collector.AddRayTracingInstance(MoveTemp(RayTracingInstance));
}
}
void FGeometryCollectionSceneProxy::UpdatingRayTracingGeometry_RenderingThread(TArray<FGeometryCollectionMeshElement> const& InSectionArray)
{
FRHICommandList& RHICmdList = FRHICommandListImmediate::Get();
if (bGeometryResourceUpdated)
{
RayTracingGeometry.Initializer.Segments.Empty();
RayTracingGeometry.Initializer.TotalPrimitiveCount = 0;
for (int SectionIndex = 0; SectionIndex < InSectionArray.Num(); ++SectionIndex)
{
const FGeometryCollectionMeshElement& Section = InSectionArray[SectionIndex];
FRayTracingGeometrySegment Segment;
Segment.FirstPrimitive = Section.TriangleStart;
Segment.VertexBuffer = MeshResource.PositionVertexBuffer.VertexBufferRHI;
Segment.NumPrimitives = Section.TriangleCount;
Segment.MaxVertices = Section.VertexEnd;
RayTracingGeometry.Initializer.Segments.Add(Segment);
RayTracingGeometry.Initializer.TotalPrimitiveCount += Section.TriangleCount;
}
if (RayTracingGeometry.Initializer.TotalPrimitiveCount > 0)
{
RayTracingGeometry.Initializer.IndexBuffer = MeshResource.IndexBuffer.IndexBufferRHI;
// Create the ray tracing geometry but delay the acceleration structure build.
RayTracingGeometry.CreateRayTracingGeometry(RHICmdList, ERTAccelerationStructureBuildPriority::Skip);
}
bGeometryResourceUpdated = false;
}
}
#endif // RHI_RAYTRACING
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
FPrimitiveViewRelevance FGeometryCollectionSceneProxy::GetViewRelevance(const FSceneView* View) const
{
FPrimitiveViewRelevance Result;
Result.bDrawRelevance = IsShown(View);
Result.bShadowRelevance = IsShadowCast(View);
Result.bDynamicRelevance = true;
Result.bRenderInMainPass = ShouldRenderInMainPass();
Result.bUsesLightingChannels = GetLightingChannelMask() != GetDefaultLightingChannelMask();
Result.bRenderCustomDepth = ShouldRenderCustomDepth();
Result.bTranslucentSelfShadow = bCastVolumetricTranslucentShadow;
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
MaterialRelevance.SetPrimitiveViewRelevance(Result);
Result.bVelocityRelevance = DrawsVelocity() && Result.bOpaque && Result.bRenderInMainPass;
Copying //UE4/Dev-Physics to //UE4/Dev-Main (Source: //UE4/Dev-Physics @ 4242698) #rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4023283 by Michael.Lentine Fix memory leak. Change 4024243 by Michael.Lentine Add debugging output code from github #4533. #jira ue-55764 Change 4026362 by Michael.Lentine Merged github #3704. #jira ue-463394 Change 4026545 by Michael.Lentine Fix ordering of collision settings changed callback #jira ue-50475 Change 4026609 by Michael.Lentine Fix crash in destruction for when world is not valid #jira ue-53989 Change 4026786 by Michael.Lentine Merging github #4632 to fix memory leak. #jira ue-57255 Change 4027293 by Michael.Lentine Integrate github #4338. #jira ue-53497 Change 4033517 by Michael.Lentine Fix collision body creation for spline merging. #jira ue-53956 Change 4039750 by Michael.Lentine Add basic error message if cooking fails. Change 4040210 by Michael.Lentine Check for nullptr Change 4098887 by Michael.Lentine Fix warnings. Change 4103511 by Michael.Lentine Prevent crash when BodyInstance is invalid. Change 4117826 by Michael.Lentine Fix check for body being fixed. Change 4122307 by Benn.Gallagher PS4/clang build fixes Change 4124479 by Benn.Gallagher Fix non-portable filename used as an include (Linux editor build CIS error) Change 4125450 by Benn.Gallagher Fixup Ocean Change 4127210 by Michael.Lentine Update the PreviousBoneTransforms array when setting transforms in DestructibleComponent #jira ue-58813 Change 4127309 by Benn.Gallagher Fix Win32 shipping builds Change 4134570 by Michael.Lentine Missed fixes for WITH_UEPHYSICS. Change 4134585 by Michael.Lentine Missed a few more files. Change 4134670 by Michael.Lentine Update formatting. Change 4134671 by Michael.Lentine More formatting. Change 4150615 by Benn.Gallagher Moved immediate mode into engine, as it is now depended on by the physics engine. Change 4150680 by Benn.Gallagher Missed file Change 4150980 by Benn.Gallagher Rename kinematic target for immediate mode to avoid ambiguous symbols in engine Change 4151400 by Brice.Criswell Apeiron Levelset initilization issue. ---- Change 4157880 by Benn.Gallagher More fixing unresolved template specialisations for FN editor. Change 4159128 by Michael.Lentine Compile fixes Change 4159786 by Brice.Criswell Apeiron Levelset curvature initialization fix, clamps out of bounds phi values to phi[i]. ------ Change 4160382 by Michael.Lentine Fix node initialization Change 4160463 by Brice.Criswell Apeiron Levelset index fix. ---- Change 4161425 by Benn.Gallagher Added package, class and struct redirects for moving immediate physics into engine. Change 4164195 by Brice.Criswell GeometryCollection : Code review updates - Removed typedef for GeometryCollection::ManagedArray<T> - Renamed Enumerations to begin with E prefix, retyped to be uint8. - Removed EArrayScoipe::FScopeNone, now defautls to FScopeShared - Formatted type modifiers to follow UE4 coding standard. - Derived the ManagedArrayBase from FNonCopyable - Disabled TManagedArrays copy constructor and assignment operator. - Converted most accessors on GeometryCollection to TSharedRef. - Added .inl style definitions to simplify the management of the ManagedArrayTypes ----- Change 4164235 by Brice.Criswell GeometryCollection : Added New Files - Added the ManagedArrayTypes files. ---- Change 4164309 by Brice.Criswell GeometryCollection : Moved the initialization of the RigidBodyIdArray and CenterOfMassArray into the WITH_APEIRON definition. ----- Change 4166133 by Brice.Criswell GeometryCollection Added GeometryCollectionEdit class to protect access to the rest and dynamic collections. ----- Change 4171540 by Michael.Lentine Fix reset #robomerge destruction Change 4171912 by Michael.Lentine Rename BVHParticles #robomerge destruction Change 4172445 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4172623 by Brice.Criswell GeometryCollection Debugging ToString to inspect the GeometryCollection ---- Change 4172711 by Michael.Lentine Add Immediate Path to Geometry Collection Change 4172778 by Michael.Lentine Update LL Interface to use Simulation type. #robomerge destruction Change 4172780 by Michael.Lentine Missed files #robomerge destruction Change 4173238 by Benn.Gallagher Missed file from last checkin Change 4173554 by Benn.Gallagher Few extra changes for const correctness and actor counts Change 4174153 by Benn.Gallagher Fixed non-unity build issue from Geom Collection. Change 4175355 by Brice.Criswell GeometryCollection Separated the GeometryCollection from USE_APEIRON flag. ----- Change 4175533 by Brice.Criswell GeometryCollection Defaulting Aperion to off. ----- Change 4175761 by Michael.Lentine Fix collisions. Change 4177105 by Benn.Gallagher Another geom collection CIS fix when running without PCHs Change 4177796 by Brice.Criswell GeometryCollection - Added parenting function to manage the BoneHierarchy Array - Split collection along yz-plane. ----- Change 4177989 by Brice.Criswell GeometryCollection - Moved Hierarchy and Transform array elements into base class TransformCollection - Renamed ParticleGroup to TransformGroup. ----- Change 4178826 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ---- Change 4178840 by Brice.Criswell Geometry Collection Removed FORCEINLINE from GeometryCollectionEdit.GetRestCollection ---- Change 4179493 by Brice.Criswell GeometryCollection New icons. ----- Change 4182428 by Brice.Criswell Build Configuration Apeiron configuration. - Modified bCompileApeiron to enable the compilation of the Apeiron plugin. - Added bUseApeiron to enable Apeiron in the physics interfaces. Changed PhysScene_Apeiron to enable when bCompileApeiron is enabled. Disabled the GeometryCollection* Plugins in the build. ------- Change 4185886 by Brice.Criswell GeometryCollection Renaming TransformGroup. --- Change 4186389 by michael.lentine Don't create in parallel for immediate mode. Change 4186457 by michael.lentine Hack to prevent crashing when Visible is nullptr. Change 4198872 by Brice.Criswell Apeiron Clustering changes - Clustering based on hierarchy's defined within the Geometry Collection ----- Change 4199861 by Brice.Criswell GeometryCollection Disable Apeiron in the Collection. ------ Change 4200089 by Brice.Criswell GeometryCollection Updated to enable Apeiron in the GeometryCollection when the bCompileAperion flag is enabled in the UnrealBuildTool. --- Change 4200333 by Brice.Criswell Copying //UE4/Dev-Destruction to Dev-Physics (//UE4/Dev-Physics) ----- Change 4202231 by Michael.Lentine Disable collisions between adjacent bodies connected by a joint. This typically would be specified by an artist but classic PhysX always does this uncondintionally so our clients are used to this. Change 4202748 by Michael.Lentine Fix 2015 compile. Change 4204528 by Michael.Lentine Disable Apeiron. Change 4206396 by Michael.Lentine Fix 2015 build. Static cast apparently is not an accetible conversion from uint32 to bool. #robomerge destruction Change 4206604 by Michael.Lentine Fix for using ccd and kinematic. #jira UE-61694 #robomerge destruction Change 4206711 by mason.seay Refreshed Set Angular Drive nodes to clear out orphan pins Change 4207286 by Brice.Criswell GeometryCollection Transform hierarchy evaluation within BoneHierarchy of the Collection. Parenting operations are implemented on an updated morphology using : ParentTransforms(UGeometryCollection* GeometryCollection, const int32 InsertAtIndex, const TArray<int32>& SelectedBones); To parent a new transform: int32 RootIndex << within len( TransformGroup ) or -1 for a non-parented node. int32 BoneIndex = Collection->AddElements(1, UGeometryCollection::TransformGroup); GeometryCollectionAlgo::ParentTransform(Collection, RootIndex, BoneIndex); Transform[BoneIndex] = <some transform within local space of the RootIndex> Default collections have all geometry not parented. The function EnsureSingleRoot was added to guarantee that the collection has at least one parent node. FGeometryCollectionCommands::EnsureSinglRoot(UGeometryCollection* RestCollection) Then matrices relative to the collections root are calculated using: GlobalMatrices(UGeometryCollection* GeometryCollection, TArray<FTransform> & Transforms); Added Damage Threshold to GeometryCollectionActor ------ Change 4208039 by Brice.Criswell GeometryCollection Fix for static include failure. --- Change 4208170 by Brice.Criswell GeometryCache SplitAlongYZ to support multiple levels and orientations. --- Change 4208174 by Michael.Lentine Avoid shadow warnings and switch logs to verbose instead of warnings. #robomerge destruction Change 4210255 by Benn.Gallagher Static analysis fixes Change 4210394 by Michael.Lentine Use correct particle type for updateconstraints. Change 4211153 by Brice.Criswell Apeiron Exposing friction and coefficient of restitution to the actor. ----- Change 4213034 by michael.lentine Rename bounding volume Change 4216783 by Michael.Lentine Committing cooking fix to Dev-Physics in order to get smoke tests running. Change 4218078 by Benn.Gallagher Fixed memory and TLS slot leak caused by previous change to physics scene cleanup while cooking #jira UE-61633 Change 4219206 by Michael.Lentine Use the adaptor to get the rotation. #jira ue-61748 Change 4220469 by Benn.Gallagher Fixed overlaps re-triggering on movement due to bad transform chaining from component to phys actor to shape #jira UE-61703 Change 4220538 by Benn.Gallagher Fixed PhysX errors when setting global transforms of kinematic and static objects. #jira none Change 4222138 by Michael.Lentine Update use of Vulkan on android. Change 4222139 by Michael.Lentine Update OculusHMD plugin to use correct vulkan search path. Change 4225740 by Michael.Lentine Integrate changes to update rotation and mass. Change 4225928 by michael.lentine Use more accurate collision point. Change 4226560 by michael.lentine Enable contact graph Change 4227397 by Michael.Lentine If we don't have a global scene we need to not detect collisions. #robomerge destruction Change 4227410 by Michael.Lentine Missing include #robomerge destruction Change 4228107 by Michael.Lentine Integrate static contact changes. Change 4228612 by michael.lentine Use more correct thresholding. Change 4228734 by Benn.Gallagher Getting LLImmediate high level stood up and simulating Implementation is incomplete, only what is required to get simple scenes simulating under immediate mode Change 4228748 by Benn.Gallagher Missed file from checkin Change 4228885 by Ori.Cohen Added base physics interface class to help provide default behavior and easily chain functionality together Change 4228992 by Ori.Cohen Fix cis Change 4229921 by Benn.Gallagher Fixed contact pre-filter performance regression Change 4230825 by Benn.Gallagher Moved WIP physics interfaces to Experimental/ folders Change 4230853 by Benn.Gallagher Fixup includes after moving WIP physics interfaces Change 4231414 by Michael.Lentine Use global namespace to avoid mac compile errors. #jira ue-62137 [CL 4242847 by Michael Lentine in Main branch]
2018-07-31 02:23:26 -04:00
return Result;
}
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
HHitProxy* FGeometryCollectionSceneProxy::CreateHitProxies(UPrimitiveComponent* Component, TArray<TRefCountPtr<HHitProxy> >& OutHitProxies)
{
HHitProxy* DefaultHitProxy = FPrimitiveSceneProxy::CreateHitProxies(Component, OutHitProxies);
OutHitProxies.Append(HitProxies);
return DefaultHitProxy;
}
#endif
void FGeometryCollectionSceneProxy::GetPreSkinnedLocalBounds(FBoxSphereBounds& OutBounds) const
{
OutBounds = MeshDescription.PreSkinnedBounds;
}
uint32 FGeometryCollectionSceneProxy::GetAllocatedSize() const
{
return FPrimitiveSceneProxy::GetAllocatedSize()
+ Materials.GetAllocatedSize()
+ MeshDescription.Sections.GetAllocatedSize()
+ MeshDescription.SubSections.GetAllocatedSize()
+ (SkinnedPositionVertexBuffer.GetAllowCPUAccess() ? SkinnedPositionVertexBuffer.GetStride() * SkinnedPositionVertexBuffer.GetNumVertices() : 0)
#if WITH_EDITOR
+ BoneColors.GetAllocatedSize()
+ (ColorVertexBuffer.GetAllowCPUAccess() ? ColorVertexBuffer.GetStride() * ColorVertexBuffer.GetNumVertices() : 0)
#endif
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
+ HitProxies.GetAllocatedSize()
+ (HitProxyIdBuffer.GetAllowCPUAccess() ? HitProxyIdBuffer.GetStride() * HitProxyIdBuffer.GetNumVertices() : 0)
#endif
#if RHI_RAYTRACING
+ RayTracingGeometry.RawData.GetAllocatedSize()
#endif
;
}
FNaniteGeometryCollectionSceneProxy::FNaniteGeometryCollectionSceneProxy(UGeometryCollectionComponent* Component)
: Nanite::FSceneProxyBase(Component)
, GeometryCollection(Component->GetRestCollection())
, bRequiresGPUSceneUpdate(false)
, bEnableBoneSelection(false)
{
LLM_SCOPE_BYTAG(Nanite);
// Nanite requires GPUScene
Fixes for the horrible Nanite "black material" shading and broken hit proxies. Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1. From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead. Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously). The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots. While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies. #rb ola.olsson #fyi brian.karis, rune.stubbe, juan.canada #jira FROST-1224 #robomerge Release-5.0-EarlyAccess [CL 15736080 by graham wihlidal in ue5-main branch]
2021-03-18 05:41:34 -04:00
checkSlow(UseGPUScene(GMaxRHIShaderPlatform, GetScene().GetFeatureLevel()));
checkSlow(DoesPlatformSupportNanite(GMaxRHIShaderPlatform));
checkSlow(GeometryCollection->HasNaniteData());
More instance data memory and CPU optimizations, and general refactoring. * Moved Nanite resource ID and hierarchy offset back to primitive data (indirection cost is largely noise these days, and memory savings is more important - GetInstanceData() fetches this data and stores in the pre-existing registers so all the callsites don't have to worry about it). * Removed FNaniteInfo from FPrimitiveInfo (and the type itself) in favor of just having a 32bit per-instance hierarchy root offset. Hierarchy offset and runtime resource ID just sourced from primitive. * Removed PrimitiveID from CPU instance data (GPU still needs it). This value was redundantly stored per-instance, and now the GPU Scene upload just blits it over from primitive when the instance data is uploaded. * Added new virtual GetNaniteResourceInfo on FPrimitiveSceneProxy that retrieves the Nanite resource ID and hierarchy offset stored on a given primitive (needed now that FPrimitiveInstance doesn't cache a copy). The non-virtual FPrimitiveSceneProxy::IsNaniteMesh() helper is used to avoid this virtual function call for non-Nanite proxies. * Removed deprecated and no longer referenced Nanite::FResources array on FNaniteGeometryCollectionSceneProxy * Removed expensive per-instance checks() in a few spots * Stubbed out upcoming per instance payload allocator offset * Removed deprecated and never referenced non-GPUScene GetInstanceData uniform buffer path * Significantly cleaned up and optimized a lot of ISM instance data retrieval, including avoiding unnecessary FRenderTransform <-> FMatrix conversions. * Removed GetInstanceShaderValues API, it was inefficient and annoying to require retrieval of all parameters when often only one or two of them were ever used. In some cases even the origin was unused but .w was needed because of the per-instance random packing. * Implemented explicit GetInstanceRandomID() accessor to fetch (under current packing) Origin.W without exposing this to the callsites * Implemented public API for GetInstanceLightMapData(), since the internal version was only accessible by GetInstanceShaderValues() * Renamed GetInstanceShaderCustomDataValues() -> GetInstanceCustomDataValues() for API consistency #rb jason.nadro, krzysztof.narkowicz [FYI] rune.stubbe, brian.karis #ROBOMERGE-OWNER: graham.wihlidal #ROBOMERGE-AUTHOR: graham.wihlidal #ROBOMERGE-SOURCE: CL 16583156 #ROBOMERGE-BOT: (v828-16531559) #ROBOMERGE-CONFLICT from-shelf [CL 16583193 by graham wihlidal in ue5-main branch]
2021-06-07 23:55:28 -04:00
MaterialRelevance = Component->GetMaterialRelevance(Component->GetScene()->GetFeatureLevel());
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
bEnableBoneSelection = Component->GetEnableBoneSelection();
#endif
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
FInstanceSceneDataBuffers::FAccessTag AccessTag(PointerHash(this));
FInstanceSceneDataBuffers::FWriteView ProxyData = InstanceSceneDataBuffersImpl.BeginWriteAccess(AccessTag);
ProxyData.Flags.bHasPerInstanceHierarchyOffset = true;
ProxyData.Flags.bHasPerInstanceLocalBounds = true;
ProxyData.Flags.bHasPerInstanceDynamicData = true;
ProxyData.Flags.bHasPerInstanceEditorData = bEnableBoneSelection;
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
InstanceSceneDataBuffersImpl.EndWriteAccess(AccessTag);
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
// Note: ideally this would be picked up from the Flags.bHasPerInstanceDynamicData above, but that path is not great at the moment.
bAlwaysHasVelocity = true;
// Nanite supports the GPUScene instance data buffer.
SetupInstanceSceneDataBuffers(&InstanceSceneDataBuffersImpl);
bSupportsDistanceFieldRepresentation = false;
// Dynamic draw path without Nanite isn't supported by Lumen
bVisibleInLumenScene = false;
// Use fast path that does not update static draw lists.
bStaticElementsAlwaysUseProxyPrimitiveUniformBuffer = true;
// Nanite always uses GPUScene, so we can skip expensive primitive uniform buffer updates.
bVFRequiresPrimitiveUniformBuffer = false;
// Indicates if 1 or more materials contain settings not supported by Nanite.
bHasMaterialErrors = false;
// Check if the assigned material can be rendered in Nanite. If not, default.
// TODO: Handle cases like geometry collections adding a "selected geometry" material with translucency.
const bool IsRenderable = true;// Nanite::FSceneProxy::IsNaniteRenderable(MaterialRelevance);
if (!IsRenderable)
{
bHasMaterialErrors = true;
}
const TSharedPtr<FGeometryCollection, ESPMode::ThreadSafe> Collection = GeometryCollection->GetGeometryCollection();
const TManagedArray<int32>& TransformToGeometryIndices = Collection->TransformToGeometryIndex;
const TManagedArray<int32>& SimulationType = Collection->SimulationType;
const TManagedArray<FGeometryCollectionSection>& SectionsArray = Collection->Sections;
MaterialSections.SetNum(SectionsArray.Num());
Fixes for the horrible Nanite "black material" shading and broken hit proxies. Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1. From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead. Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously). The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots. While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies. #rb ola.olsson #fyi brian.karis, rune.stubbe, juan.canada #jira FROST-1224 #robomerge Release-5.0-EarlyAccess [CL 15736080 by graham wihlidal in ue5-main branch]
2021-03-18 05:41:34 -04:00
for (int32 SectionIndex = 0; SectionIndex < SectionsArray.Num(); ++SectionIndex)
{
Fixes for the horrible Nanite "black material" shading and broken hit proxies. Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1. From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead. Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously). The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots. While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies. #rb ola.olsson #fyi brian.karis, rune.stubbe, juan.canada #jira FROST-1224 #robomerge Release-5.0-EarlyAccess [CL 15736080 by graham wihlidal in ue5-main branch]
2021-03-18 05:41:34 -04:00
const FGeometryCollectionSection& MeshSection = SectionsArray[SectionIndex];
const bool bValidMeshSection = MeshSection.MaterialID != INDEX_NONE;
// Keep track of highest observed material index.
MaterialMaxIndex = FMath::Max(MeshSection.MaterialID, MaterialMaxIndex);
Fixes for the horrible Nanite "black material" shading and broken hit proxies. Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1. From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead. Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously). The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots. While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies. #rb ola.olsson #fyi brian.karis, rune.stubbe, juan.canada #jira FROST-1224 #robomerge Release-5.0-EarlyAccess [CL 15736080 by graham wihlidal in ue5-main branch]
2021-03-18 05:41:34 -04:00
UMaterialInterface* MaterialInterface = bValidMeshSection ? Component->GetMaterial(MeshSection.MaterialID) : nullptr;
// TODO: PROG_RASTER (Implement programmable raster support)
const bool bInvalidMaterial = !MaterialInterface || !IsOpaqueOrMaskedBlendMode(*MaterialInterface) || MaterialInterface->GetShadingModels().HasShadingModel(MSM_SingleLayerWater);
if (bInvalidMaterial)
{
bHasMaterialErrors = true;
Fixes for the horrible Nanite "black material" shading and broken hit proxies. Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1. From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead. Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously). The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots. While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies. #rb ola.olsson #fyi brian.karis, rune.stubbe, juan.canada #jira FROST-1224 #robomerge Release-5.0-EarlyAccess [CL 15736080 by graham wihlidal in ue5-main branch]
2021-03-18 05:41:34 -04:00
if (MaterialInterface)
{
UE_LOG
(
LogStaticMesh, Warning,
TEXT("Invalid material [%s] used on Nanite geometry collection [%s] - forcing default material instead. Only opaque blend mode and a shading model that is not SingleLayerWater is currently supported, [%s] blend mode and [%s] shading model was specified."),
Fixes for the horrible Nanite "black material" shading and broken hit proxies. Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1. From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead. Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously). The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots. While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies. #rb ola.olsson #fyi brian.karis, rune.stubbe, juan.canada #jira FROST-1224 #robomerge Release-5.0-EarlyAccess [CL 15736080 by graham wihlidal in ue5-main branch]
2021-03-18 05:41:34 -04:00
*MaterialInterface->GetName(),
*GeometryCollection->GetName(),
*GetBlendModeString(MaterialInterface->GetBlendMode()),
*GetShadingModelFieldString(MaterialInterface->GetShadingModels())
);
}
}
const bool bForceDefaultMaterial = /*!!FORCE_NANITE_DEFAULT_MATERIAL ||*/ bHasMaterialErrors;
if (bForceDefaultMaterial)
{
Fixes for the horrible Nanite "black material" shading and broken hit proxies. Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1. From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead. Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously). The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots. While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies. #rb ola.olsson #fyi brian.karis, rune.stubbe, juan.canada #jira FROST-1224 #robomerge Release-5.0-EarlyAccess [CL 15736080 by graham wihlidal in ue5-main branch]
2021-03-18 05:41:34 -04:00
MaterialInterface = UMaterial::GetDefaultMaterial(MD_Surface);
}
// Should never be null here
Fixes for the horrible Nanite "black material" shading and broken hit proxies. Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1. From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead. Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously). The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots. While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies. #rb ola.olsson #fyi brian.karis, rune.stubbe, juan.canada #jira FROST-1224 #robomerge Release-5.0-EarlyAccess [CL 15736080 by graham wihlidal in ue5-main branch]
2021-03-18 05:41:34 -04:00
check(MaterialInterface != nullptr);
// Should always be opaque blend mode here.
check(IsOpaqueOrMaskedBlendMode(*MaterialInterface));
Fixes for the horrible Nanite "black material" shading and broken hit proxies. Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1. From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead. Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously). The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots. While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies. #rb ola.olsson #fyi brian.karis, rune.stubbe, juan.canada #jira FROST-1224 #robomerge Release-5.0-EarlyAccess [CL 15736080 by graham wihlidal in ue5-main branch]
2021-03-18 05:41:34 -04:00
MaterialSections[SectionIndex].ShadingMaterialProxy = MaterialInterface->GetRenderProxy();
MaterialSections[SectionIndex].RasterMaterialProxy = MaterialInterface->GetRenderProxy(); // TODO: PROG_RASTER (Implement programmable raster support)
Fixes for the horrible Nanite "black material" shading and broken hit proxies. Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1. From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead. Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously). The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots. While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies. #rb ola.olsson #fyi brian.karis, rune.stubbe, juan.canada #jira FROST-1224 #robomerge Release-5.0-EarlyAccess [CL 15736080 by graham wihlidal in ue5-main branch]
2021-03-18 05:41:34 -04:00
MaterialSections[SectionIndex].MaterialIndex = MeshSection.MaterialID;
MaterialSections[SectionIndex].bCastShadow = true;
}
const bool bHasGeometryBoundingBoxes =
Collection->HasAttribute("BoundingBox", FGeometryCollection::GeometryGroup) &&
Collection->NumElements(FGeometryCollection::GeometryGroup);
const bool bHasTransformBoundingBoxes =
Collection->NumElements(FGeometryCollection::TransformGroup) &&
Collection->HasAttribute("BoundingBox", FGeometryCollection::TransformGroup) &&
Collection->HasAttribute("TransformToGeometryIndex", FGeometryCollection::TransformGroup);
int32 NumGeometry = 0;
if (bHasGeometryBoundingBoxes)
{
NumGeometry = Collection->NumElements(FGeometryCollection::GeometryGroup);
GeometryNaniteData.SetNumUninitialized(NumGeometry);
const TManagedArray<FBox>& BoundingBoxes = Collection->GetAttribute<FBox>("BoundingBox", FGeometryCollection::GeometryGroup);
for (int32 GeometryIndex = 0; GeometryIndex < NumGeometry; ++GeometryIndex)
{
FGeometryNaniteData& Instance = GeometryNaniteData[GeometryIndex];
More instance data memory and CPU optimizations, and general refactoring. * Moved Nanite resource ID and hierarchy offset back to primitive data (indirection cost is largely noise these days, and memory savings is more important - GetInstanceData() fetches this data and stores in the pre-existing registers so all the callsites don't have to worry about it). * Removed FNaniteInfo from FPrimitiveInfo (and the type itself) in favor of just having a 32bit per-instance hierarchy root offset. Hierarchy offset and runtime resource ID just sourced from primitive. * Removed PrimitiveID from CPU instance data (GPU still needs it). This value was redundantly stored per-instance, and now the GPU Scene upload just blits it over from primitive when the instance data is uploaded. * Added new virtual GetNaniteResourceInfo on FPrimitiveSceneProxy that retrieves the Nanite resource ID and hierarchy offset stored on a given primitive (needed now that FPrimitiveInstance doesn't cache a copy). The non-virtual FPrimitiveSceneProxy::IsNaniteMesh() helper is used to avoid this virtual function call for non-Nanite proxies. * Removed deprecated and no longer referenced Nanite::FResources array on FNaniteGeometryCollectionSceneProxy * Removed expensive per-instance checks() in a few spots * Stubbed out upcoming per instance payload allocator offset * Removed deprecated and never referenced non-GPUScene GetInstanceData uniform buffer path * Significantly cleaned up and optimized a lot of ISM instance data retrieval, including avoiding unnecessary FRenderTransform <-> FMatrix conversions. * Removed GetInstanceShaderValues API, it was inefficient and annoying to require retrieval of all parameters when often only one or two of them were ever used. In some cases even the origin was unused but .w was needed because of the per-instance random packing. * Implemented explicit GetInstanceRandomID() accessor to fetch (under current packing) Origin.W without exposing this to the callsites * Implemented public API for GetInstanceLightMapData(), since the internal version was only accessible by GetInstanceShaderValues() * Renamed GetInstanceShaderCustomDataValues() -> GetInstanceCustomDataValues() for API consistency #rb jason.nadro, krzysztof.narkowicz [FYI] rune.stubbe, brian.karis #ROBOMERGE-OWNER: graham.wihlidal #ROBOMERGE-AUTHOR: graham.wihlidal #ROBOMERGE-SOURCE: CL 16583156 #ROBOMERGE-BOT: (v828-16531559) #ROBOMERGE-CONFLICT from-shelf [CL 16583193 by graham wihlidal in ue5-main branch]
2021-06-07 23:55:28 -04:00
Instance.HierarchyOffset = GeometryCollection->GetNaniteHierarchyOffset(GeometryIndex);
Instance.LocalBounds = BoundingBoxes[GeometryIndex];
}
}
else if (bHasTransformBoundingBoxes)
{
NumGeometry = GeometryCollection->RenderData->NaniteResourcesPtr->HierarchyRootOffsets.Num();
GeometryNaniteData.SetNumUninitialized(NumGeometry);
const TManagedArray<FBox>& BoundingBoxes = Collection->GetAttribute<FBox>("BoundingBox", FGeometryCollection::TransformGroup);
const TManagedArray<int32>& TransformToGeometry = Collection->GetAttribute<int32>("TransformToGeometryIndex", FGeometryCollection::TransformGroup);
const int32 NumTransforms = TransformToGeometry.Num();
for (int32 TransformIndex = 0; TransformIndex < NumTransforms; ++TransformIndex)
{
const int32 GeometryIndex = TransformToGeometry[TransformIndex];
if (GeometryIndex > INDEX_NONE)
{
FGeometryNaniteData& Instance = GeometryNaniteData[GeometryIndex];
More instance data memory and CPU optimizations, and general refactoring. * Moved Nanite resource ID and hierarchy offset back to primitive data (indirection cost is largely noise these days, and memory savings is more important - GetInstanceData() fetches this data and stores in the pre-existing registers so all the callsites don't have to worry about it). * Removed FNaniteInfo from FPrimitiveInfo (and the type itself) in favor of just having a 32bit per-instance hierarchy root offset. Hierarchy offset and runtime resource ID just sourced from primitive. * Removed PrimitiveID from CPU instance data (GPU still needs it). This value was redundantly stored per-instance, and now the GPU Scene upload just blits it over from primitive when the instance data is uploaded. * Added new virtual GetNaniteResourceInfo on FPrimitiveSceneProxy that retrieves the Nanite resource ID and hierarchy offset stored on a given primitive (needed now that FPrimitiveInstance doesn't cache a copy). The non-virtual FPrimitiveSceneProxy::IsNaniteMesh() helper is used to avoid this virtual function call for non-Nanite proxies. * Removed deprecated and no longer referenced Nanite::FResources array on FNaniteGeometryCollectionSceneProxy * Removed expensive per-instance checks() in a few spots * Stubbed out upcoming per instance payload allocator offset * Removed deprecated and never referenced non-GPUScene GetInstanceData uniform buffer path * Significantly cleaned up and optimized a lot of ISM instance data retrieval, including avoiding unnecessary FRenderTransform <-> FMatrix conversions. * Removed GetInstanceShaderValues API, it was inefficient and annoying to require retrieval of all parameters when often only one or two of them were ever used. In some cases even the origin was unused but .w was needed because of the per-instance random packing. * Implemented explicit GetInstanceRandomID() accessor to fetch (under current packing) Origin.W without exposing this to the callsites * Implemented public API for GetInstanceLightMapData(), since the internal version was only accessible by GetInstanceShaderValues() * Renamed GetInstanceShaderCustomDataValues() -> GetInstanceCustomDataValues() for API consistency #rb jason.nadro, krzysztof.narkowicz [FYI] rune.stubbe, brian.karis #ROBOMERGE-OWNER: graham.wihlidal #ROBOMERGE-AUTHOR: graham.wihlidal #ROBOMERGE-SOURCE: CL 16583156 #ROBOMERGE-BOT: (v828-16531559) #ROBOMERGE-CONFLICT from-shelf [CL 16583193 by graham wihlidal in ue5-main branch]
2021-06-07 23:55:28 -04:00
Instance.HierarchyOffset = GeometryCollection->GetNaniteHierarchyOffset(GeometryIndex);
Instance.LocalBounds = BoundingBoxes[TransformIndex];
}
}
}
SetWireframeColor(Component->GetWireframeColorForSceneProxy());
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
if (bEnableBoneSelection)
{
// Generate a hit proxy per geometry section so that we can perform per bone hit tests.
HitProxyMode = EHitProxyMode::PerInstance;
HitProxies.Reserve(NumGeometry);
for (int32 GeometryIndex = 0; GeometryIndex < NumGeometry; ++GeometryIndex)
{
HGeometryCollection* HitProxy = new HGeometryCollection(Component, GeometryIndex);
HitProxies.Add(HitProxy);
}
}
else if (AActor* Actor = Component->GetOwner())
{
// Generate default material hit proxies for simple selection.
HitProxyMode = Nanite::FSceneProxyBase::EHitProxyMode::MaterialSection;
for (int32 SectionIndex = 0; SectionIndex < MaterialSections.Num(); ++SectionIndex)
{
FMaterialSection& Section = MaterialSections[SectionIndex];
HHitProxy* HitProxy = new HActor(Actor, Component, SectionIndex, SectionIndex);
Section.HitProxy = HitProxy;
HitProxies.Add(HitProxy);
}
}
#endif
// Initialize to rest transforms.
TArray<FMatrix44f> RestTransforms;
Component->GetRestTransforms(RestTransforms);
CollisionResponse = Component->GetCollisionResponseToChannels();
FGeometryCollectionDynamicData* InitDynamicData = Component->InitDynamicData(true);
SetDynamicData_RenderThread(InitDynamicData, Component->GetRenderMatrix());
}
FNaniteGeometryCollectionSceneProxy::~FNaniteGeometryCollectionSceneProxy()
{
if (DynamicData != nullptr)
{
GDynamicDataPool.Release(DynamicData);
DynamicData = nullptr;
}
}
void FNaniteGeometryCollectionSceneProxy::CreateRenderThreadResources(FRHICommandListBase& RHICmdList)
{
// Should have valid Nanite data at this point.
NaniteResourceID = GeometryCollection->GetNaniteResourceID();
NaniteHierarchyOffset = GeometryCollection->GetNaniteHierarchyOffset();
check(NaniteResourceID != INDEX_NONE && NaniteHierarchyOffset != INDEX_NONE);
}
SIZE_T FNaniteGeometryCollectionSceneProxy::GetTypeHash() const
{
static size_t UniquePointer;
return reinterpret_cast<size_t>(&UniquePointer);
}
FPrimitiveViewRelevance FNaniteGeometryCollectionSceneProxy::GetViewRelevance(const FSceneView* View) const
{
LLM_SCOPE_BYTAG(Nanite);
FPrimitiveViewRelevance Result;
Result.bDrawRelevance = IsShown(View) && View->Family->EngineShowFlags.NaniteMeshes;
Result.bShadowRelevance = IsShadowCast(View);
Result.bRenderCustomDepth = Nanite::GetSupportsCustomDepthRendering() && ShouldRenderCustomDepth();
Result.bUsesLightingChannels = GetLightingChannelMask() != GetDefaultLightingChannelMask();
// Always render the Nanite mesh data with static relevance.
Result.bStaticRelevance = true;
// dynamic still relevance still must be used when drawing collisions
Result.bDynamicRelevance = ShowCollisionMeshes(View->Family->EngineShowFlags);
// Should always be covered by constructor of Nanite scene proxy.
Result.bRenderInMainPass = true;
#if WITH_EDITOR
// Only check these in the editor
Result.bEditorVisualizeLevelInstanceRelevance = IsEditingLevelInstanceChild();
Result.bEditorStaticSelectionRelevance = (IsSelected() || IsHovered());
#endif
bool bSetDynamicRelevance = false;
Result.bOpaque = true;
MaterialRelevance.SetPrimitiveViewRelevance(Result);
Result.bVelocityRelevance = Result.bOpaque && Result.bRenderInMainPass && DrawsVelocity();
return Result;
}
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
HHitProxy* FNaniteGeometryCollectionSceneProxy::CreateHitProxies(UPrimitiveComponent* Component, TArray<TRefCountPtr<HHitProxy>>& OutHitProxies)
{
LLM_SCOPE_BYTAG(Nanite);
OutHitProxies.Append(HitProxies);
return Super::CreateHitProxies(Component, OutHitProxies);
}
#endif
void FNaniteGeometryCollectionSceneProxy::DrawStaticElements(FStaticPrimitiveDrawInterface* PDI)
{
Fixes for the horrible Nanite "black material" shading and broken hit proxies. Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1. From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead. Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously). The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots. While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies. #rb ola.olsson #fyi brian.karis, rune.stubbe, juan.canada #jira FROST-1224 #robomerge Release-5.0-EarlyAccess [CL 15736080 by graham wihlidal in ue5-main branch]
2021-03-18 05:41:34 -04:00
const FLightCacheInterface* LCI = nullptr;
DrawStaticElementsInternal(PDI, LCI);
}
uint32 FNaniteGeometryCollectionSceneProxy::GetMemoryFootprint() const
{
return sizeof(*this) + GetAllocatedSize();
}
void FNaniteGeometryCollectionSceneProxy::GetNaniteResourceInfo(uint32& ResourceID, uint32& HierarchyOffset, uint32& ImposterIndex) const
More instance data memory and CPU optimizations, and general refactoring. * Moved Nanite resource ID and hierarchy offset back to primitive data (indirection cost is largely noise these days, and memory savings is more important - GetInstanceData() fetches this data and stores in the pre-existing registers so all the callsites don't have to worry about it). * Removed FNaniteInfo from FPrimitiveInfo (and the type itself) in favor of just having a 32bit per-instance hierarchy root offset. Hierarchy offset and runtime resource ID just sourced from primitive. * Removed PrimitiveID from CPU instance data (GPU still needs it). This value was redundantly stored per-instance, and now the GPU Scene upload just blits it over from primitive when the instance data is uploaded. * Added new virtual GetNaniteResourceInfo on FPrimitiveSceneProxy that retrieves the Nanite resource ID and hierarchy offset stored on a given primitive (needed now that FPrimitiveInstance doesn't cache a copy). The non-virtual FPrimitiveSceneProxy::IsNaniteMesh() helper is used to avoid this virtual function call for non-Nanite proxies. * Removed deprecated and no longer referenced Nanite::FResources array on FNaniteGeometryCollectionSceneProxy * Removed expensive per-instance checks() in a few spots * Stubbed out upcoming per instance payload allocator offset * Removed deprecated and never referenced non-GPUScene GetInstanceData uniform buffer path * Significantly cleaned up and optimized a lot of ISM instance data retrieval, including avoiding unnecessary FRenderTransform <-> FMatrix conversions. * Removed GetInstanceShaderValues API, it was inefficient and annoying to require retrieval of all parameters when often only one or two of them were ever used. In some cases even the origin was unused but .w was needed because of the per-instance random packing. * Implemented explicit GetInstanceRandomID() accessor to fetch (under current packing) Origin.W without exposing this to the callsites * Implemented public API for GetInstanceLightMapData(), since the internal version was only accessible by GetInstanceShaderValues() * Renamed GetInstanceShaderCustomDataValues() -> GetInstanceCustomDataValues() for API consistency #rb jason.nadro, krzysztof.narkowicz [FYI] rune.stubbe, brian.karis #ROBOMERGE-OWNER: graham.wihlidal #ROBOMERGE-AUTHOR: graham.wihlidal #ROBOMERGE-SOURCE: CL 16583156 #ROBOMERGE-BOT: (v828-16531559) #ROBOMERGE-CONFLICT from-shelf [CL 16583193 by graham wihlidal in ue5-main branch]
2021-06-07 23:55:28 -04:00
{
ResourceID = NaniteResourceID;
HierarchyOffset = NaniteHierarchyOffset;
ImposterIndex = INDEX_NONE; // Imposters are not supported (yet?)
More instance data memory and CPU optimizations, and general refactoring. * Moved Nanite resource ID and hierarchy offset back to primitive data (indirection cost is largely noise these days, and memory savings is more important - GetInstanceData() fetches this data and stores in the pre-existing registers so all the callsites don't have to worry about it). * Removed FNaniteInfo from FPrimitiveInfo (and the type itself) in favor of just having a 32bit per-instance hierarchy root offset. Hierarchy offset and runtime resource ID just sourced from primitive. * Removed PrimitiveID from CPU instance data (GPU still needs it). This value was redundantly stored per-instance, and now the GPU Scene upload just blits it over from primitive when the instance data is uploaded. * Added new virtual GetNaniteResourceInfo on FPrimitiveSceneProxy that retrieves the Nanite resource ID and hierarchy offset stored on a given primitive (needed now that FPrimitiveInstance doesn't cache a copy). The non-virtual FPrimitiveSceneProxy::IsNaniteMesh() helper is used to avoid this virtual function call for non-Nanite proxies. * Removed deprecated and no longer referenced Nanite::FResources array on FNaniteGeometryCollectionSceneProxy * Removed expensive per-instance checks() in a few spots * Stubbed out upcoming per instance payload allocator offset * Removed deprecated and never referenced non-GPUScene GetInstanceData uniform buffer path * Significantly cleaned up and optimized a lot of ISM instance data retrieval, including avoiding unnecessary FRenderTransform <-> FMatrix conversions. * Removed GetInstanceShaderValues API, it was inefficient and annoying to require retrieval of all parameters when often only one or two of them were ever used. In some cases even the origin was unused but .w was needed because of the per-instance random packing. * Implemented explicit GetInstanceRandomID() accessor to fetch (under current packing) Origin.W without exposing this to the callsites * Implemented public API for GetInstanceLightMapData(), since the internal version was only accessible by GetInstanceShaderValues() * Renamed GetInstanceShaderCustomDataValues() -> GetInstanceCustomDataValues() for API consistency #rb jason.nadro, krzysztof.narkowicz [FYI] rune.stubbe, brian.karis #ROBOMERGE-OWNER: graham.wihlidal #ROBOMERGE-AUTHOR: graham.wihlidal #ROBOMERGE-SOURCE: CL 16583156 #ROBOMERGE-BOT: (v828-16531559) #ROBOMERGE-CONFLICT from-shelf [CL 16583193 by graham wihlidal in ue5-main branch]
2021-06-07 23:55:28 -04:00
}
Nanite::FResourceMeshInfo FNaniteGeometryCollectionSceneProxy::GetResourceMeshInfo() const
{
Nanite::FResources& NaniteResources = *GeometryCollection->RenderData->NaniteResourcesPtr.Get();
Nanite::FResourceMeshInfo OutInfo;
OutInfo.NumClusters = NaniteResources.NumClusters;
OutInfo.NumNodes = NaniteResources.NumHierarchyNodes;
OutInfo.NumVertices = NaniteResources.NumInputVertices;
OutInfo.NumTriangles = NaniteResources.NumInputTriangles;
OutInfo.NumMaterials = MaterialMaxIndex + 1;
OutInfo.DebugName = GeometryCollection->GetFName();
OutInfo.NumResidentClusters = NaniteResources.NumResidentClusters;
// TODO: SegmentMapping
OutInfo.NumSegments = 0;
return MoveTemp(OutInfo);
}
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
void FNaniteGeometryCollectionSceneProxy::SetDynamicData_RenderThread(FGeometryCollectionDynamicData* NewDynamicData, const FMatrix &PrimitiveLocalToWorld)
{
if (NewDynamicData != DynamicData)
{
if (DynamicData)
{
GDynamicDataPool.Release(DynamicData);
DynamicData = nullptr;
}
DynamicData = NewDynamicData;
}
FInstanceSceneDataBuffers::FAccessTag AccessTag(PointerHash(this));
FInstanceSceneDataBuffers::FWriteView ProxyData = InstanceSceneDataBuffersImpl.BeginWriteAccess(AccessTag);
InstanceSceneDataBuffersImpl.SetPrimitiveLocalToWorld(PrimitiveLocalToWorld, AccessTag);
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
const TSharedPtr<FGeometryCollection, ESPMode::ThreadSafe> Collection = GeometryCollection->GetGeometryCollection();
const TManagedArray<int32>& TransformToGeometryIndices = Collection->TransformToGeometryIndex;
const TManagedArray<TSet<int32>>& TransformChildren = Collection->Children;
const TManagedArray<int32>& SimulationType = Collection->SimulationType;
const int32 TransformCount = NewDynamicData->Transforms.Num();
check(TransformCount == TransformToGeometryIndices.Num());
check(TransformCount == TransformChildren.Num());
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
// set the prev by copying the last current
ProxyData.PrevInstanceToPrimitiveRelative = ProxyData.InstanceToPrimitiveRelative;
bCanSkipRedundantTransformUpdates = false; // shoudl we compare the transform to better decide about this ?
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
ProxyData.InstanceToPrimitiveRelative.Reset(TransformCount);
ProxyData.InstanceLocalBounds.Reset(TransformCount);
ProxyData.InstanceHierarchyOffset.Reset(TransformCount);
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
ProxyData.InstanceEditorData.Reset(bEnableBoneSelection ? TransformCount : 0);
#endif
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
ProxyData.Flags.bHasPerInstanceDynamicData = true;
ProxyData.Flags.bHasPerInstanceLocalBounds = true;
ProxyData.Flags.bHasPerInstanceHierarchyOffset = true;
for (int32 TransformIndex = 0; TransformIndex < TransformCount; ++TransformIndex)
{
const int32 TransformToGeometryIndex = TransformToGeometryIndices[TransformIndex];
if (SimulationType[TransformIndex] != FGeometryCollection::ESimulationTypes::FST_Rigid)
{
continue;
}
const FGeometryNaniteData& NaniteData = GeometryNaniteData[TransformToGeometryIndex];
const FRenderTransform& InstanceToPrimitiveRelative = ProxyData.InstanceToPrimitiveRelative.Emplace_GetRef(InstanceSceneDataBuffersImpl.ComputeInstanceToPrimitiveRelative(NewDynamicData->Transforms[TransformIndex], AccessTag));
ProxyData.InstanceLocalBounds.Emplace(PadInstanceLocalBounds(NaniteData.LocalBounds));
ProxyData.InstanceHierarchyOffset.Emplace(NaniteData.HierarchyOffset);
#if GEOMETRYCOLLECTION_EDITOR_SELECTION
if (bEnableBoneSelection)
{
ProxyData.InstanceEditorData.Emplace(FInstanceEditorData::Pack(HitProxies[TransformToGeometryIndex]->Id.GetColor(), false));
}
#endif
}
// make sure the previous transform count do match the current one
// if not simply use the current as previous
if (ProxyData.PrevInstanceToPrimitiveRelative.Num() != ProxyData.InstanceToPrimitiveRelative.Num())
{
ProxyData.PrevInstanceToPrimitiveRelative = ProxyData.InstanceToPrimitiveRelative;
bCanSkipRedundantTransformUpdates = true;
}
InstanceSceneDataBuffersImpl.EndWriteAccess(AccessTag);
2021-04-20 10:45:04 -04:00
}
void FNaniteGeometryCollectionSceneProxy::ResetPreviousTransforms_RenderThread()
{
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
FInstanceSceneDataBuffers::FAccessTag AccessTag(PointerHash(this));
FInstanceSceneDataBuffers::FWriteView ProxyData = InstanceSceneDataBuffersImpl.BeginWriteAccess(AccessTag);
// Reset previous transforms to avoid locked motion vectors
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
// TODO: we should be able to just turn off & delete the prev transforms instead.
check(ProxyData.InstanceToPrimitiveRelative.Num() == ProxyData.PrevInstanceToPrimitiveRelative.Num()); // Sanity check, should always have matching associated arrays
for (int32 InstanceIndex = 0; InstanceIndex < ProxyData.InstanceToPrimitiveRelative.Num(); ++InstanceIndex)
{
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
ProxyData.PrevInstanceToPrimitiveRelative[InstanceIndex] = ProxyData.InstanceToPrimitiveRelative[InstanceIndex];
}
ISM Renderer Data refactor, phase 1. - Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data - Made the instance data persistent over scene proxy re-creates. - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices). - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene. - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these. - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame. - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy. - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData - Removed FInstanceUpdateCmdBuffer - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space. - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another. - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface - PCG: minor changes to avoid touching ISM internals. #jira UE-191955,PLAY-11918 #rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell [CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
InstanceSceneDataBuffersImpl.EndWriteAccess(AccessTag);
}
void FNaniteGeometryCollectionSceneProxy::FlushGPUSceneUpdate_GameThread()
{
ENQUEUE_RENDER_COMMAND(NaniteProxyUpdateGPUScene)(
[this](FRHICommandListImmediate& RHICmdList)
{
FPrimitiveSceneInfo* NanitePrimitiveInfo = GetPrimitiveSceneInfo();
if (NanitePrimitiveInfo && GetRequiresGPUSceneUpdate_RenderThread())
{
// Attempt to queue up a GPUScene update - maintain dirty flag if the request fails.
const bool bRequiresUpdate = !NanitePrimitiveInfo->RequestGPUSceneUpdate();
SetRequiresGPUSceneUpdate_RenderThread(bRequiresUpdate);
}
}
);
}
bool FNaniteGeometryCollectionSceneProxy::ShowCollisionMeshes(const FEngineShowFlags& EngineShowFlags) const
{
if (IsCollisionEnabled())
{
if (EngineShowFlags.CollisionPawn && CollisionResponse.GetResponse(ECC_Pawn) != ECR_Ignore)
{
return true;
}
if (EngineShowFlags.CollisionVisibility && CollisionResponse.GetResponse(ECC_Visibility) != ECR_Ignore)
{
return true;
}
if (EngineShowFlags.Collision)
{
return true;
}
}
return false;
}
void FNaniteGeometryCollectionSceneProxy::GetDynamicMeshElements(const TArray<const FSceneView*>& Views, const FSceneViewFamily& ViewFamily, uint32 VisibilityMap, FMeshElementCollector& Collector) const
{
QUICK_SCOPE_CYCLE_COUNTER(STAT_NaniteGeometryCollectionSceneProxy_GetDynamicMeshElements);
const FEngineShowFlags& EngineShowFlags = ViewFamily.EngineShowFlags;
const bool bDrawWireframeCollision = EngineShowFlags.Collision && IsCollisionEnabled();
// draw extra stuff ( collision , bounds ... )
for (int32 ViewIndex = 0; ViewIndex < Views.Num(); ViewIndex++)
{
if (VisibilityMap & (1 << ViewIndex))
{
// collision modes
if (ShowCollisionMeshes(EngineShowFlags) && GeometryCollection && GeometryCollection->GetGeometryCollection() && AllowDebugViewmodes())
{
FTransform GeomTransform(GetLocalToWorld());
if (bDrawWireframeCollision)
{
GeometryCollectionDebugDraw::DrawWireframe(*GeometryCollection->GetGeometryCollection(), GeomTransform, Collector, ViewIndex, GetWireframeColor().ToFColor(true));
}
else
{
FMaterialRenderProxy* CollisionMaterialInstance = new FColoredMaterialRenderProxy(GEngine->ShadedLevelColorationUnlitMaterial->GetRenderProxy(), GetWireframeColor());
Collector.RegisterOneFrameMaterialProxy(CollisionMaterialInstance);
GeometryCollectionDebugDraw::DrawSolid(*GeometryCollection->GetGeometryCollection(), GeomTransform, Collector, ViewIndex, CollisionMaterialInstance);
}
}
// render bounds
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
RenderBounds(Collector.GetPDI(ViewIndex), ViewFamily.EngineShowFlags, GetBounds(), IsSelected());
#endif
}
}
}
2021-04-20 10:45:04 -04:00
FGeometryCollectionDynamicDataPool::FGeometryCollectionDynamicDataPool()
{
FreeList.SetNum(32);
for (int32 ListIndex = 0; ListIndex < FreeList.Num(); ++ListIndex)
{
FreeList[ListIndex] = new FGeometryCollectionDynamicData;
}
}
FGeometryCollectionDynamicDataPool::~FGeometryCollectionDynamicDataPool()
{
FScopeLock ScopeLock(&ListLock);
for (FGeometryCollectionDynamicData* Entry : FreeList)
{
delete Entry;
}
for (FGeometryCollectionDynamicData* Entry : UsedList)
{
delete Entry;
}
FreeList.Empty();
UsedList.Empty();
}
FGeometryCollectionDynamicData* FGeometryCollectionDynamicDataPool::Allocate()
{
FScopeLock ScopeLock(&ListLock);
FGeometryCollectionDynamicData* NewEntry = nullptr;
if (FreeList.Num() > 0)
{
NewEntry = FreeList.Pop(EAllowShrinking::No);
2021-04-20 10:45:04 -04:00
}
if (NewEntry == nullptr)
{
NewEntry = new FGeometryCollectionDynamicData;
}
NewEntry->Reset();
UsedList.Push(NewEntry);
return NewEntry;
}
void FGeometryCollectionDynamicDataPool::Release(FGeometryCollectionDynamicData* DynamicData)
{
FScopeLock ScopeLock(&ListLock);
int32 UsedIndex = UsedList.Find(DynamicData);
if (ensure(UsedIndex != INDEX_NONE))
{
UsedList.RemoveAt(UsedIndex, EAllowShrinking::No);
2021-04-20 10:45:04 -04:00
FreeList.Push(DynamicData);
}
}
void FGeometryCollectionTransformBuffer::UpdateDynamicData(FRHICommandListBase& RHICmdList, const TArray<FMatrix44f>& Transforms, EResourceLockMode LockMode)
{
check(NumTransforms == Transforms.Num());
void* VertexBufferData = RHICmdList.LockBuffer(VertexBufferRHI, 0, Transforms.Num() * sizeof(FMatrix44f), LockMode);
FMemory::Memcpy(VertexBufferData, Transforms.GetData(), Transforms.Num() * sizeof(FMatrix44f));
RHICmdList.UnlockBuffer(VertexBufferRHI);
}
FNaniteGeometryCollectionSceneProxy::FEmptyLightCacheInfo FNaniteGeometryCollectionSceneProxy::EmptyLightCacheInfo;
FLightInteraction FNaniteGeometryCollectionSceneProxy::FEmptyLightCacheInfo::GetInteraction(const FLightSceneProxy* LightSceneProxy) const
{
// Ask base class
TArray<FGuid> Empty_IrrelevantLights;
ELightInteractionType LightInteraction = GetStaticInteraction(LightSceneProxy, Empty_IrrelevantLights);
if (LightInteraction != LIT_MAX)
{
return FLightInteraction(LightInteraction);
}
// Use dynamic lighting if the light doesn't have static lighting.
return FLightInteraction::Dynamic();
}