UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GeometryCollectionObject.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
13#include "Misc/Crc.h"
14#include "Containers/Map.h"
15
16#include "GeometryCollectionObject.generated.h"
17
23class UDataflow;
25class UMaterial;
28
29USTRUCT(BlueprintType)
31{
33
35 FGeometryCollectionSource(const FSoftObjectPath& SourceSoftObjectPath, const FTransform& ComponentTransform, const TArray<TObjectPtr<UMaterialInterface>>& SourceMaterials, bool bSplitComponents = false, bool bSetInternalFromMaterialIndex = false)
36 : SourceGeometryObject(SourceSoftObjectPath), LocalTransform(ComponentTransform), SourceMaterial(SourceMaterials), bAddInternalMaterials(false), bSplitComponents(bSplitComponents), bSetInternalFromMaterialIndex(bSetInternalFromMaterialIndex)
37 {
38
39 }
40
41 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GeometrySource", meta=(AllowedClasses="/Script/Engine.StaticMesh, /Script/Engine.SkeletalMesh, /Script/GeometryCollectionEngine.GeometryCollection"))
42 FSoftObjectPath SourceGeometryObject;
43
44 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GeometrySource")
45 FTransform LocalTransform;
46
47 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GeometrySource")
49
50 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GeometrySource|Instance")
51 TArray<float> InstanceCustomData;
52
53 //~ Note: bAddInternalMaterials defaults to true so a 'Reset' of a geometry collection that was created before this member was added will have consistent behavior. New geometry collections should always set bAddInternalMaterials to false.
55 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GeometrySource", DisplayName = "(Legacy) Add Internal Materials")
56 bool bAddInternalMaterials = true;
57
59 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GeometrySource", DisplayName = "Split Meshes")
60 bool bSplitComponents = false;
61
63 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GeometrySource")
64 bool bSetInternalFromMaterialIndex = false;
65
66 // TODO: add primtive custom data
67};
68
69USTRUCT(BlueprintType)
71{
73
74#if WITH_EDITORONLY_DATA
75 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use Mesh instead."))
77#endif
78
79 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "AutoInstance", meta = (AllowedClasses = "/Script/Engine.StaticMesh"))
81
82 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "AutoInstance")
84
85 UPROPERTY(VisibleAnywhere, Category = "AutoInstance")
86 int32 NumInstances = 0;
87
88 UPROPERTY(VisibleAnywhere, Category = "AutoInstance")
89 TArray<float> CustomData;
90
91 GEOMETRYCOLLECTIONENGINE_API int32 GetNumDataPerInstance() const;
92
94};
95
96USTRUCT(BlueprintType)
98{
100
102 : StaticMeshExemplar(FString(TEXT("None")))
103 , StartCullDistance(0.0f)
104 , EndCullDistance(0.0f)
105 , InstanceCount(0)
106 { };
107
109 : StaticMeshExemplar(NewExemplar)
110 , StartCullDistance(0.0f)
111 , EndCullDistance(0.0f)
112 , InstanceCount(0)
113 { }
114
115 UPROPERTY(EditAnywhere, Category = "EmbeddedExemplar", meta = (AllowedClasses = "/Script/Engine.StaticMesh"))
116 FSoftObjectPath StaticMeshExemplar;
117
118 UPROPERTY(EditAnywhere, Category = "EmbeddedExemplar")
119 float StartCullDistance;
120
121 UPROPERTY(EditAnywhere, Category = "EmbeddedExemplar")
122 float EndCullDistance;
123
124 UPROPERTY(VisibleAnywhere, Category = "EmbeddedExemplar")
125 int32 InstanceCount;
126};
127
128USTRUCT()
130{
132
134
135 /*
136 * Resolution on the smallest axes for the level set. (def: 5)
137 */
138 UPROPERTY(EditAnywhere, Category = "LevelSet")
139 int32 MinLevelSetResolution;
140
141 /*
142 * Resolution on the smallest axes for the level set. (def: 10)
143 */
144 UPROPERTY(EditAnywhere, Category = "LevelSet")
145 int32 MaxLevelSetResolution;
146
147 /*
148 * Resolution on the smallest axes for the level set. (def: 5)
149 */
150 UPROPERTY(EditAnywhere, Category = "LevelSet")
151 int32 MinClusterLevelSetResolution;
152
153 /*
154 * Resolution on the smallest axes for the level set. (def: 10)
155 */
156 UPROPERTY(EditAnywhere, Category = "LevelSet")
157 int32 MaxClusterLevelSetResolution;
158};
159
160
161USTRUCT()
163{
165
167
171 UPROPERTY(EditAnywhere, Category = "Particle")
172 float CollisionParticlesFraction;
173
177 UPROPERTY(EditAnywhere, Category = "Particle")
178 int32 MaximumCollisionParticles;
179};
180
181
182
183USTRUCT()
185{
187
189
190 /*
191 * CollisionType defines how to initialize the rigid collision structures.
192 */
193 UPROPERTY(EditAnywhere, Category = "Collisions")
194 ECollisionTypeEnum CollisionType;
195
196 /*
197 * CollisionType defines how to initialize the rigid collision structures.
198 */
199 UPROPERTY(EditAnywhere, Category = "Collisions")
200 EImplicitTypeEnum ImplicitType;
201
202 /*
203 * LevelSet Resolution data for rasterization.
204 */
205 UPROPERTY(EditAnywhere, Category = "Collisions", meta = (EditCondition = "ImplicitType == EImplicitTypeEnum::Chaos_Implicit_LevelSet", EditConditionHides))
207
208 /*
209 * Collision Particle data for surface samples during Particle-LevelSet collisions.
210 */
211 UPROPERTY(EditAnywhere, Category = "Collisions", meta = (EditCondition = "CollisionType == ECollisionTypeEnum::Chaos_Surface_Volumetric", EditConditionHides))
213
214 /*
215 * Uniform scale on the collision body. (def: 0)
216 */
217 UPROPERTY(EditAnywhere, Category = "Collisions")
218 float CollisionObjectReductionPercentage;
219
225 UPROPERTY(EditAnywhere, Category = "Collisions", meta = (EditCondition = "ImplicitType == EImplicitTypeEnum::Chaos_Implicit_Convex || ImplicitType == EImplicitTypeEnum::Chaos_Implicit_Box", EditConditionHides))
226 float CollisionMarginFraction;
227
228};
229
230
231USTRUCT()
233{
235
237
239 UPROPERTY(EditAnywhere, Category = "Collisions")
241
242 /*
243 * Collision Shapes allow kfor multiple collision types per rigid body.
244 */
245 UPROPERTY(EditAnywhere, Category = "Collisions")
247
248#if WITH_EDITORONLY_DATA
249 /*
250 * CollisionType defines how to initialize the rigid collision structures.
251 */
252 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use Collision.CollisionType instead."))
254
255 /*
256 * CollisionType defines how to initialize the rigid collision structures.
257 */
258 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use Collision.ImplicitType instead."))
260
261 /*
262 * Resolution on the smallest axes for the level set. (def: 5)
263 */
264 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use Collision.LevelSet.MinLevelSetResolution instead."))
266
267 /*
268 * Resolution on the smallest axes for the level set. (def: 10)
269 */
270 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use Collision.LevelSet.MaxLevelSetResolution instead."))
272
273 /*
274 * Resolution on the smallest axes for the level set. (def: 5)
275 */
276 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use Collision.LevelSet.MinClusterLevelSetResolution instead."))
278
279 /*
280 * Resolution on the smallest axes for the level set. (def: 10)
281 */
282 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use Collision.LevelSet.MaxClusterLevelSetResolution instead."))
284
285 /*
286 * Resolution on the smallest axes for the level set. (def: 10)
287 */
288 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use Collision.CollisionObjectReductionPercentage instead."))
290
294 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use Collision.CollisionParticlesFraction instead."))
296
300 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use Collision.MaximumCollisionParticles instead."))
302#endif
303
307 UPROPERTY(EditAnywhere, Category = "Collisions")
308 int32 DamageThreshold;
309
311#if WITH_EDITORONLY_DATA
312 GEOMETRYCOLLECTIONENGINE_API void PostSerialize(const FArchive& Ar);
313#endif
314};
315
316template<>
317struct TStructOpsTypeTraits<FGeometryCollectionSizeSpecificData> : public TStructOpsTypeTraitsBase2<FGeometryCollectionSizeSpecificData>
318{
319 enum
320 {
322#if WITH_EDITORONLY_DATA
323 WithPostSerialize = true
324#endif
325 };
327};
328
329USTRUCT(BlueprintType)
331{
333
334 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Materials")
336};
337
338USTRUCT(BlueprintType)
340{
342
343
344 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering", meta = (AllowedClasses = "/Script/Engine.StaticMesh"))
346
352 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering")
354
359 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering")
361
362 GEOMETRYCOLLECTIONENGINE_API const FTransform3f& GetMeshTransform(int32 MeshIndex) const;
363
365};
366
367USTRUCT()
369{
371
372 // Total size of the arrays for the MeshResources
373 UPROPERTY()
374 uint64 MeshResourcesSize = 0;
375
376 // Total size of the arrays for the NaniteResources
377 UPROPERTY()
378 uint64 NaniteResourcesSize = 0;
379};
380
387UCLASS(BlueprintType, customconstructor, MinimalAPI)
393{
395
396public:
398
400#if WITH_EDITOR
401 GEOMETRYCOLLECTIONENGINE_API virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
402 GEOMETRYCOLLECTIONENGINE_API virtual void PostEditUndo() override;
403 GEOMETRYCOLLECTIONENGINE_API virtual bool Modify(bool bAlwaysMarkDirty = true) override;
404#endif
405 GEOMETRYCOLLECTIONENGINE_API virtual void PostInitProperties() override;
406 GEOMETRYCOLLECTIONENGINE_API virtual void PreSave(FObjectPreSaveContext SaveContext) override;
407 GEOMETRYCOLLECTIONENGINE_API virtual void PostLoad() override;
408 GEOMETRYCOLLECTIONENGINE_API virtual void BeginDestroy() override;
409 GEOMETRYCOLLECTIONENGINE_API virtual bool IsReadyForFinishDestroy() override;
413
414#if WITH_EDITOR
417#endif
418
423
426
429
433
435 GEOMETRYCOLLECTIONENGINE_API int32 NumElements(const FName& Group) const;
436 GEOMETRYCOLLECTIONENGINE_API void RemoveElements(const FName& Group, const TArray<int32>& SortedDeletionList);
437
439 GEOMETRYCOLLECTIONENGINE_API bool HasMeshData() const;
441 GEOMETRYCOLLECTIONENGINE_API bool HasNaniteData() const;
442
443 GEOMETRYCOLLECTIONENGINE_API uint32 GetNaniteResourceID() const;
444 GEOMETRYCOLLECTIONENGINE_API uint32 GetNaniteHierarchyOffset() const;
445 GEOMETRYCOLLECTIONENGINE_API uint32 GetNaniteHierarchyOffset(int32 GeometryIndex, bool bFlattened = false) const;
446
448 GEOMETRYCOLLECTIONENGINE_API void ReindexMaterialSections();
449
451 GEOMETRYCOLLECTIONENGINE_API void InitializeMaterials(bool bHasLegacyInternalMaterialsPairs = false);
452
454 GEOMETRYCOLLECTIONENGINE_API int32 AddNewMaterialSlot(bool bCopyLastMaterial = true);
455
457 GEOMETRYCOLLECTIONENGINE_API bool RemoveLastMaterialSlot();
458
459
461 GEOMETRYCOLLECTIONENGINE_API bool HasVisibleGeometry() const;
462
464 GEOMETRYCOLLECTIONENGINE_API void InvalidateCollection();
465
468
470 GEOMETRYCOLLECTIONENGINE_API int32 AttachEmbeddedGeometryExemplar(const UStaticMesh* Exemplar);
471
474
477
483
486
489
492
495
498
499#if WITH_EDITOR
502
509
512
515
518
521
524
525#endif
526
527 GEOMETRYCOLLECTIONENGINE_API void InitResources();
528 GEOMETRYCOLLECTIONENGINE_API void ReleaseResources();
529
531 GEOMETRYCOLLECTIONENGINE_API void GetSharedSimulationParams(FSharedSimulationParameters& OutParams) const;
532
538 GEOMETRYCOLLECTIONENGINE_API float GetMassOrDensity(bool& bOutIsDensity) const;
539
540 /*
541 * cache the material density used to compute attribute
542 * Warning : this should only be called after recomputing the mass based on those values
543 */
544 GEOMETRYCOLLECTIONENGINE_API void CacheMaterialDensity();
545
547 GEOMETRYCOLLECTIONENGINE_API FGuid GetIdGuid() const;
548 GEOMETRYCOLLECTIONENGINE_API FGuid GetStateGuid() const;
549
551 int32 GetRootIndex() const { return RootIndex; }
552
555
556 UPROPERTY(EditAnywhere, Category = "Clustering")
557 bool EnableClustering;
558
560 UPROPERTY(EditAnywhere, Category = "Clustering")
561 int32 ClusterGroupIndex;
562
564 UPROPERTY(EditAnywhere, Category = "Clustering")
565 int32 MaxClusterLevel;
566
568 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Damage")
570
572 UPROPERTY(EditAnywhere, Category = "Damage", meta = (EditCondition = "!bUseSizeSpecificDamageThreshold && DamageModel == EDamageModelTypeEnum::Chaos_Damage_Model_UserDefined_Damage_Threshold"))
573 TArray<float> DamageThreshold;
574
576 UPROPERTY(EditAnywhere, Category = "Damage", meta = (EditCondition = "DamageModel == EDamageModelTypeEnum::Chaos_Damage_Model_UserDefined_Damage_Threshold"))
577 bool bUseSizeSpecificDamageThreshold;
578
580 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Damage", meta = (EditCondition = "DamageModel == EDamageModelTypeEnum::Chaos_Damage_Model_UserDefined_Damage_Threshold"))
581 bool bUseMaterialDamageModifiers;
582
586 UPROPERTY(EditAnywhere, Category = "Compatibility")
587 bool PerClusterOnlyDamageThreshold;
588
590 UPROPERTY(EditAnywhere, Category = "Damage")
592
594 UPROPERTY(EditAnywhere, Category = "Clustering")
595 EClusterConnectionTypeEnum ClusterConnectionType;
596
597 UPROPERTY(EditAnywhere, Category = "Clustering")
598 float ConnectionGraphBoundsFilteringMargin;
599
600#if WITH_EDITORONLY_DATA
601 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GeometrySource")
603#endif
604
605 UPROPERTY(EditAnywhere, Category = "Materials")
607
609 UPROPERTY(EditAnywhere, Category = "EmbeddedGeometry")
611
613 UPROPERTY(EditAnywhere, Category = "Rendering")
614 bool bUseFullPrecisionUVs = false;
615
619 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering", meta = (DisplayName = "Strip Source Data On Cook"))
620 bool bStripOnCook;
621
626 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering")
627 bool bStripRenderDataOnCook;
628
630 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering", meta = (MustImplement = "/Script/GeometryCollectionEngine.GeometryCollectionExternalRenderInterface"))
631 TObjectPtr<UClass> CustomRendererType;
632
634 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Rendering")
636
638 UPROPERTY(EditAnywhere, Category = "Rendering")
640
641 UFUNCTION(BlueprintCallable, Category = "Nanite")
642 GEOMETRYCOLLECTIONENGINE_API void SetEnableNanite(bool bValue);
643
647 UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintSetter=SetEnableNanite, Category = "Nanite")
648 bool EnableNanite;
649
653 UPROPERTY(EditAnywhere, Category = "Nanite", Meta = (EditCondition = "EnableNanite"))
654 bool bEnableNaniteFallback;
655
659 UPROPERTY(EditAnywhere, Category = "Nanite", Meta = (EditCondition = "EnableNanite", DisplayName = "Nanite Minimum Residency"))
660 uint32 NaniteMinimumResidencyInKB;
661
662 UFUNCTION(BlueprintCallable, Category = "Rendering")
663 GEOMETRYCOLLECTIONENGINE_API void SetConvertVertexColorsToSRGB(bool bValue);
664
668 UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintSetter=SetConvertVertexColorsToSRGB, Category = "Rendering")
669 bool bConvertVertexColorsToSRGB = true;
670
671#if WITH_EDITORONLY_DATA
672 /*
673 * CollisionType defines how to initialize the rigid collision structures.
674 */
675 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "This property is deprecated. Use the default SizeSpecificData instead."))
677
678 /*
679 * CollisionType defines how to initialize the rigid collision structures.
680 */
681 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "This property is deprecated. Use the default SizeSpecificData instead."))
683
684 /*
685 * Resolution on the smallest axes for the level set. (def: 5)
686 */
687 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "This property is deprecated. Use the default SizeSpecificData instead."))
689
690 /*
691 * Resolution on the smallest axes for the level set. (def: 10)
692 */
693 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "This property is deprecated. Use the default SizeSpecificData instead."))
695
696 /*
697 * Resolution on the smallest axes for the level set. (def: 5)
698 */
699 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "This property is deprecated. Use the default SizeSpecificData instead."))
701
702 /*
703 * Resolution on the smallest axes for the level set. (def: 10)
704 */
705 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "This property is deprecated. Use the default SizeSpecificData instead."))
707
708 /*
709 * Resolution on the smallest axes for the level set. (def: 10)
710 */
711 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "This property is deprecated. Use the default SizeSpecificData instead."))
713
715 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "This property is deprecated. Use RootProxyData instead."))
717#endif
718
720 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Collisions")
722
726 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Collisions", meta = (EditCondition = "PhysicsMaterial != nullptr"))
727 bool bDensityFromPhysicsMaterial;
728
733 UPROPERTY()
734 float CachedDensityFromPhysicsMaterialInGCm3;
735
739 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Collisions", meta = (EditCondition = "!bDensityFromPhysicsMaterial"))
740 bool bMassAsDensity;
741
745 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Collisions", meta = (EditCondition = "!bDensityFromPhysicsMaterial"))
746 float Mass;
747
751 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Collisions")
752 float MinimumMassClamp;
753
757 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Collisions")
758 bool bImportCollisionFromSource;
759
765 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Collisions")
766 bool bOptimizeConvexes = true;
767
768#if WITH_EDITORONLY_DATA
772 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "This property is deprecated. Use the default SizeSpecificData instead."))
774
778 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "This property is deprecated. Use the default SizeSpecificData instead."))
780#endif
781
783 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Removal)
784 bool bScaleOnRemoval;
785
787 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Removal, meta = (DisplayName = "Remove on Sleep"))
788 bool bRemoveOnMaxSleep;
789
791 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Removal, meta = (EditCondition = "bRemoveOnMaxSleep"))
792 bool bAutomaticCrumblePartialClusters;
793
795 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Removal, meta = (DisplayName = "Sleep Min Max", EditCondition="bRemoveOnMaxSleep"))
796 FVector2D MaximumSleepTime;
797
799 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Removal, meta = (DisplayName = "Removal Duration", EditCondition="bRemoveOnMaxSleep"))
800 FVector2D RemovalDuration;
801
803 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Removal, meta = (DisplayName = "Slow-Moving as sleeping", EditCondition="bRemoveOnMaxSleep"))
804 bool bSlowMovingAsSleeping;
805
807 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Removal, meta = (DisplayName = "Slow-Moving Velocity Threshold", EditCondition="bRemoveOnMaxSleep && bSlowMovingAsSleeping"))
808 float SlowMovingVelocityThreshold;
809
810 /*
811 * Size Specfic Data reflects the default geometry to bind to rigid bodies smaller
812 * than the max size volume. This can also be empty to reflect no collision geometry
813 * for the collection.
814 */
815 UPROPERTY(EditAnywhere, Category = "Collisions")
817
818 GEOMETRYCOLLECTIONENGINE_API int GetDefaultSizeSpecificDataIndex() const;
820 GEOMETRYCOLLECTIONENGINE_API const FGeometryCollectionSizeSpecificData& GetDefaultSizeSpecificData() const;
821 static GEOMETRYCOLLECTIONENGINE_API FGeometryCollectionSizeSpecificData GeometryCollectionSizeSpecificDataDefaults();
822
826 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use remove on break feature instead ( Fracture editor tools )."))
828
832 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use remove on break feature instead ( Fracture editor tools )."))
834
835 UE_DEPRECATED(5.5, "Bone Selected Material does not have a material index anymore.")
836 FORCEINLINE const int32 GetBoneSelectedMaterialIndex() const { return BoneSelectedMaterialIndex; }
837
838 // Get the material to use for rendering bone selections in the editor, or nullptr
839 static UMaterialInterface* GetBoneSelectedMaterial();
840
842 static GEOMETRYCOLLECTIONENGINE_API const TCHAR* GetSelectedMaterialPath();
843
844#if WITH_EDITORONLY_DATA
846 UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, Category = ImportSettings)
848
850 UPROPERTY(VisibleAnywhere, Instanced, AdvancedDisplay, Category = GeometryCollection)
852#endif // WITH_EDITORONLY_DATA
853
854 /*
855 * Update the convex geometry on the collection.
856 */
857 GEOMETRYCOLLECTIONENGINE_API void UpdateConvexGeometry();
858 GEOMETRYCOLLECTIONENGINE_API void UpdateConvexGeometryIfMissing();
859
860 /*
861 * Update properties that depend on the geometry and clustering: Proximity, Convex Hulls, Volume and Size data.
862 */
863 GEOMETRYCOLLECTIONENGINE_API void UpdateGeometryDependentProperties();
864
865
866 //~ Begin IInterface_AssetUserData Interface
867 GEOMETRYCOLLECTIONENGINE_API virtual void AddAssetUserData(UAssetUserData* InUserData) override;
868 GEOMETRYCOLLECTIONENGINE_API virtual void RemoveUserDataOfClass(TSubclassOf<UAssetUserData> InUserDataClass) override;
870 GEOMETRYCOLLECTIONENGINE_API virtual const TArray<UAssetUserData*>* GetAssetUserDataArray() const override;
871 //~ End IInterface_AssetUserData Interface
872
873 //
874 // Dataflow
875 //
876#if WITH_EDITORONLY_DATA
877 // this is deprecated data replaced with Setter and Getter but it is exposed to blueprint
878 // so we use the Setter/Getter to make sure the blueprint will use them
879 UPROPERTY(BlueprintReadWrite, BlueprintSetter=SetDataflowAsset, BlueprintGetter = GetDataflowAsset, Category = "Dataflow")
880 TObjectPtr<UDataflow> DataflowAsset;
881
882 UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Dataflow terminal name is now stored in DataflowInstance"))
884#endif
885
886 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dataflow", DisplayName = "DataFlow Overrides", meta = (DisplayAfter = "DataflowInstance"))
887 TMap<FString, FString> Overrides;
888
889 UPROPERTY(EditAnywhere, Category = "Dataflow")
890 FDataflowInstance DataflowInstance;
891
892 UFUNCTION(BlueprintCallable, Category = "Dataflow")
893 void SetDataflowAsset(UDataflow* InDataflowAsset);
894
895 UFUNCTION(BlueprintCallable, Category = "Dataflow")
896 UDataflow* GetDataflowAsset() const;
897
898 //~ Begin IDataflowGeneratedAssetInterface
899 virtual const FDataflowInstance& GetDataflowInstance() const override { return DataflowInstance; };
900 virtual FDataflowInstance& GetDataflowInstance() override { return DataflowInstance; };
901 //~ End IDataflowGeneratedAssetInterface
902
903 //~ Begin IDataflowContentOwner interface
904 virtual TObjectPtr<UDataflowBaseContent> CreateDataflowContent() override;
905 virtual void WriteDataflowContent(const TObjectPtr<UDataflowBaseContent>& DataflowContent) const override;
906 virtual void ReadDataflowContent(const TObjectPtr<UDataflowBaseContent>& DataflowContent) override;
907 //~ End IDataflowContentOwner interface
908
909 const TArray<int32>& GetBreadthFirstTransformIndices() const { return BreadthFirstTransformIndices; }
910
911 const TArray<int32>& GetAutoInstanceTransformRemapIndices() const { return AutoInstanceTransformRemapIndices; }
912
913#if WITH_EDITOR
914 virtual bool CanEditChange(const FProperty* InProperty) const override;
915#endif // WITH_EDITOR
916
917private:
918#if WITH_EDITOR
921
924
925#endif
926
927 /*
928 * Used to transfer deprecated properties to the size specific structures during serialization
929 * and to add back the default size specific data when deleted.
930 */
931 GEOMETRYCOLLECTIONENGINE_API void ValidateSizeSpecificDataDefaults();
932
933 // update cached root index using the current hierarchy setup
934 GEOMETRYCOLLECTIONENGINE_API void UpdateRootIndex();
935
936 // fill instanced mesh instance count from geometry collection data if not done yet
937 GEOMETRYCOLLECTIONENGINE_API void FillAutoInstanceMeshesInstancesIfNeeded();
938
939 void CacheBreadthFirstTransformIndices();
940 void CacheAutoInstanceTransformRemapIndices();
941
942private:
944 UPROPERTY()
945 FGuid PersistentGuid;
946
952 UPROPERTY()
953 FGuid StateGuid;
954
955#if WITH_EDITOR
956 //Used to determine whether we need to cook simulation data
958 //Used to determine whether we need to regenerate simulation data
960
961 //Used to determine whether we need to cook render data
963 //Used to determine whether we need to regenerate render data
965#endif
966
967 // cached root index for faster queries
968 UPROPERTY(VisibleAnywhere, Category = "Clustering")
969 int32 RootIndex = INDEX_NONE;
970
971 // cache transform indices in breadth-first order
972 UPROPERTY(VisibleAnywhere, Transient, Category = "Clustering")
973 TArray<int32> BreadthFirstTransformIndices;
974
975 // cache transform remapping for instanced meshes indices
976 UPROPERTY(VisibleAnywhere, Transient, Category = "Clustering")
977 TArray<int32> AutoInstanceTransformRemapIndices;
978
979 // Legacy index of the bone selected material in the object's Materials array, or INDEX_NONE if it is not stored there.
980 // Note for new objects the bone selected material should not be stored in the Materials array, so this should be INDEX_NONE
981 // The property is kept solely to support deletion of the bone selected material from the materials list of legacy assets
982 UPROPERTY()
983 int32 BoneSelectedMaterialIndex = INDEX_NONE;
984
986
988 UPROPERTY(EditAnywhere, AdvancedDisplay, Instanced, Category = AssetUserData)
989 TArray<TObjectPtr<UAssetUserData>> AssetUserData;
990
992 FRenderCommandFence RenderResourceReleaseFence;
993
994 float GetMassOrDensityInternal(bool& bOutIsDensity, bool bCached) const;
995
996 void MigrateDeprecatedRootProxyData();
997 void MigrateDeprecatedDataflowData();
998};
#define FORCEINLINE
Definition AndroidPlatform.h:140
EClusterConnectionTypeEnum
Definition ChaosSolverActor.h:34
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
EDamageModelTypeEnum
Definition GeometryCollectionSimulationTypes.h:112
ECollisionTypeEnum
Definition GeometryCollectionSimulationTypes.h:12
EImplicitTypeEnum
Definition GeometryCollectionSimulationTypes.h:21
@ Meshes
Definition HairStrandsInterface.h:193
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define USTRUCT(...)
Definition ObjectMacros.h:746
EPropertyObjectReferenceType
Definition ObjectMacros.h:533
#define Split(a, ahi, alo)
Definition Predicates.inl:204
ESPMode
Definition SharedPointerFwd.h:12
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition GeometryCollectionRenderData.h:110
Definition GeometryCollection.h:32
Definition NameTypes.h:617
Definition UObjectGlobals.h:1292
static COREUOBJECT_API FObjectInitializer & Get()
Definition UObjectGlobals.cpp:5001
Definition ObjectSaveContext.h:244
Definition UnrealType.h:3087
Definition UnrealType.h:174
Definition RenderCommandFence.h:15
Definition DataflowContent.h:40
Definition DataflowInstance.h:288
Definition Interface_AssetUserData.h:20
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SubclassOf.h:30
Definition UniquePtr.h:107
Definition AssetUserData.h:18
Definition Class.h:3793
Definition DataflowObject.h:106
Definition GeometryCollectionCache.h:16
Definition GeometryCollectionObject.h:393
const TArray< int32 > & GetBreadthFirstTransformIndices() const
Definition GeometryCollectionObject.h:909
TUniquePtr< FGeometryCollectionRenderData > RenderData
Definition GeometryCollectionObject.h:554
TSharedPtr< FGeometryCollection, ESPMode::ThreadSafe > GetGeometryCollection()
Definition GeometryCollectionObject.h:421
virtual FDataflowInstance & GetDataflowInstance() override
Definition GeometryCollectionObject.h:900
GEOMETRYCOLLECTIONENGINE_API bool IsSimulationDataDirty() const
const TSharedPtr< FGeometryCollection, ESPMode::ThreadSafe > GetGeometryCollection() const
Definition GeometryCollectionObject.h:422
void SetGeometryCollection(TSharedPtr< FGeometryCollection, ESPMode::ThreadSafe > GeometryCollectionIn)
Definition GeometryCollectionObject.h:420
const TArray< int32 > & GetAutoInstanceTransformRemapIndices() const
Definition GeometryCollectionObject.h:911
static GEOMETRYCOLLECTIONENGINE_API TSharedPtr< FGeometryCollection, ESPMode::ThreadSafe > CopyCollectionAndRemoveGeometry(const TSharedPtr< const FGeometryCollection, ESPMode::ThreadSafe > &CollectionToCopy)
GEOMETRYCOLLECTIONENGINE_API TSharedPtr< FGeometryCollection, ESPMode::ThreadSafe > GenerateMinimalGeometryCollection() const
int32 GetRootIndex() const
Definition GeometryCollectionObject.h:551
Definition MaterialInterface.h:296
Definition Material.h:432
Definition Object.h:95
Definition PhysicalMaterial.h:104
Definition StaticMesh.h:593
Definition CollectionBoundsFacade.cpp:13
Definition ByteSwap.h:14
Definition MeshTransforms.h:21
Definition SkinnedMeshComponent.h:50
@ false
Definition radaudio_common.h:23
Definition DataflowInstance.h:207
Definition GeometryCollectionObject.h:71
Definition GeometryCollectionObject.h:163
Definition GeometryCollectionObject.h:185
Definition GeometryCollectionDamagePropagationData.h:9
Definition GeometryCollectionObject.h:98
FGeometryCollectionEmbeddedExemplar(FSoftObjectPath NewExemplar)
Definition GeometryCollectionObject.h:108
Definition GeometryCollectionObject.h:130
Definition GeometryCollectionObject.h:340
Definition GeometryCollectionObject.h:331
Definition GeometryCollectionObject.h:369
Definition GeometryCollectionSection.h:13
Definition GeometryCollectionObject.h:233
Definition GeometryCollectionObject.h:31
FGeometryCollectionSource(const FSoftObjectPath &SourceSoftObjectPath, const FTransform &ComponentTransform, const TArray< TObjectPtr< UMaterialInterface > > &SourceMaterials, bool bSplitComponents=false, bool bSetInternalFromMaterialIndex=false)
Definition GeometryCollectionObject.h:35
Definition Guid.h:109
Definition ManagedArrayCollection.h:56
Definition UnrealType.h:6865
Definition GeometryCollectionSimulationCoreTypes.h:92
Definition SoftObjectPath.h:56
Definition ObjectPtr.h:488
Definition StructOpsTypeTraits.h:11
@ WithSerializer
Definition StructOpsTypeTraits.h:23
@ WithPostSerialize
Definition StructOpsTypeTraits.h:25
static constexpr EPropertyObjectReferenceType WithSerializerObjectReferences
Definition StructOpsTypeTraits.h:41
Definition StructOpsTypeTraits.h:46
static CORE_API const TTransform< double > Identity
Definition TransformNonVectorized.h:58