2019-12-26 14:45:42 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2018-12-12 11:25:29 -05:00
# pragma once
# include "GameFramework/Actor.h"
2019-06-08 17:15:34 -04:00
# include "Components/BillboardComponent.h"
2018-12-12 11:25:29 -05:00
2020-10-21 17:56:05 -04:00
# include <type_traits>
2018-12-12 11:25:29 -05:00
# include "GeometryCollectionDebugDrawActor.generated.h"
2019-06-26 13:41:32 -04:00
class AChaosSolverActor ;
class AGeometryCollectionActor ;
2019-06-08 17:15:34 -04:00
class UGeometryCollectionComponent ;
template < class InElementType > class TManagedArray ;
2021-03-05 19:27:14 -04:00
class FGeometryCollectionParticlesData ;
2019-06-08 17:15:34 -04:00
template < class T > class TAutoConsoleVariable ;
/**
* EGeometryCollectionDebugDrawActorHideGeometry
* Visibility enum .
*/
UENUM ( )
enum class EGeometryCollectionDebugDrawActorHideGeometry : uint8
{
// Do not hide any geometry.
HideNone ,
// Hide the geometry associated with rigid bodies that are selected for collision volume visualization.
HideWithCollision ,
// Hide the geometry associated with the selected rigid bodies.
HideSelected ,
// Hide the entire geometry collection associated with the selected rigid bodies.
HideWholeCollection ,
// Hide all geometry collections.
HideAll
} ;
2019-08-07 14:56:14 -04:00
/**
* FGeometryCollectionDebugDrawWarningMessage
* Empty structure used to embed a warning message in the UI through a detail customization .
*/
USTRUCT ( )
2022-02-02 02:20:31 -05:00
struct UE_DEPRECATED ( 5.0 , " Deprecated. Use normal debug draw Chaos Physics commands " ) FGeometryCollectionDebugDrawWarningMessage
2019-08-07 14:56:14 -04:00
{
GENERATED_USTRUCT_BODY ( )
} ;
2019-06-08 17:15:34 -04:00
/**
* FGeometryCollectionDebugDrawActorSelectedRigidBody
* Structure used to select a rigid body id with a picking tool through a detail customization .
*/
USTRUCT ( )
2022-02-02 02:20:31 -05:00
struct UE_DEPRECATED ( 5.0 , " Deprecated. Use normal debug draw Chaos Physics commands " ) FGeometryCollectionDebugDrawActorSelectedRigidBody
2019-06-08 17:15:34 -04:00
{
GENERATED_USTRUCT_BODY ( )
2019-06-26 13:41:32 -04:00
explicit FGeometryCollectionDebugDrawActorSelectedRigidBody ( int32 InId = - 1 ) : Id ( InId ) , Solver ( nullptr ) , GeometryCollection ( nullptr ) { }
2019-11-08 19:47:41 -05:00
//explicit FGeometryCollectionDebugDrawActorSelectedRigidBody(FGuid InId = FGuid()) : Id(InId), Solver(nullptr), GeometryCollection(nullptr) {}
2019-07-22 08:16:50 -04:00
2019-06-08 17:15:34 -04:00
/** Id of the selected rigid body whose to visualize debug informations. Use -1 to visualize all Geometry Collections. */
2019-06-26 13:41:32 -04:00
UPROPERTY ( EditAnywhere , Category = " Selected Rigid Body " , meta = ( ClampMin = " -1 " ) )
2019-06-08 17:15:34 -04:00
int32 Id ;
2019-11-08 19:47:41 -05:00
//FGuid Id;
2019-06-17 14:53:58 -04:00
2019-06-26 13:41:32 -04:00
/** Chaos RBD Solver. Will use the world's default solver actor if null. */
UPROPERTY ( EditAnywhere , Category = " Selected Rigid Body " )
2021-01-27 17:40:25 -04:00
TObjectPtr < AChaosSolverActor > Solver ;
2019-06-26 13:41:32 -04:00
/** Currently selected geometry collection. */
UPROPERTY ( VisibleAnywhere , Category = " Selected Rigid Body " )
2021-01-27 17:40:25 -04:00
TObjectPtr < AGeometryCollectionActor > GeometryCollection ;
2019-06-26 13:41:32 -04:00
/** Return the name of selected solver, or "None" if none is selected. */
FString GetSolverName ( ) const ;
2019-06-08 17:15:34 -04:00
} ;
2018-12-12 11:25:29 -05:00
/**
* AGeometryCollectionDebugDrawActor
2019-06-08 17:15:34 -04:00
* An actor representing the collection of data necessary to visualize the
* geometry collections ' debug informations .
* Only one actor is to be used in the world , and should be automatically
* spawned by any GeometryDebugDrawComponent that needs it .
2018-12-12 11:25:29 -05:00
*/
2022-02-02 02:20:31 -05:00
class UE_DEPRECATED ( 5.0 , " Deprecated. Use normal debug draw Chaos Physics commands " ) AGeometryCollectionDebugDrawActor ;
2023-06-17 18:13:06 -04:00
UCLASS ( HideCategories = ( " Rendering " , " Replication " , " Input " , " Actor " , " Collision " , " LOD " , " Cooking " ) , MinimalAPI )
class AGeometryCollectionDebugDrawActor : public AActor
2018-12-12 11:25:29 -05:00
{
GENERATED_UCLASS_BODY ( )
public :
2022-02-02 02:20:31 -05:00
PRAGMA_DISABLE_DEPRECATION_WARNINGS
2019-07-22 08:16:50 -04:00
/** Warning message to explain that the debug draw properties have no effect until starting playing/simulating. */
2022-02-02 02:20:31 -05:00
UPROPERTY ( )
FGeometryCollectionDebugDrawWarningMessage WarningMessage_DEPRECATED ;
2019-07-22 08:16:50 -04:00
2019-06-08 17:15:34 -04:00
/** Picking tool used to select a rigid body id. */
2022-02-02 02:20:31 -05:00
UPROPERTY ( )
FGeometryCollectionDebugDrawActorSelectedRigidBody SelectedRigidBody_DEPRECATED ;
PRAGMA_ENABLE_DEPRECATION_WARNINGS
2019-06-08 17:15:34 -04:00
/** Show debug visualization for the rest of the geometry collection related to the current rigid body id selection. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw " )
bool bDebugDrawWholeCollection ;
/** Show debug visualization for the top level node rather than the bottom leaf nodes of a cluster's hierarchy. * Only affects Clustering and Geometry visualization.
2018-12-12 11:25:29 -05:00
*/
2019-06-08 17:15:34 -04:00
UPROPERTY ( EditAnywhere , Category = " Debug Draw " )
bool bDebugDrawHierarchy ;
/** Show debug visualization for all clustered children associated to the current rigid body id selection. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw " )
bool bDebugDrawClustering ;
/** Geometry visibility setting. Select the part of the geometry to hide in order to better visualize the debug information. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw " )
EGeometryCollectionDebugDrawActorHideGeometry HideGeometry ;
/** Display the selected rigid body's id. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Rigid Body " )
bool bShowRigidBodyId ;
/** Show the selected rigid body's collision volume. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Rigid Body " )
bool bShowRigidBodyCollision ;
/** Show the selected rigid body's collision volume at the origin, in local space. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Rigid Body " )
bool bCollisionAtOrigin ;
/** Show the selected rigid body's transform. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Rigid Body " )
bool bShowRigidBodyTransform ;
/** Show the selected rigid body's inertia tensor box. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Rigid Body " )
bool bShowRigidBodyInertia ;
/** Show the selected rigid body's linear and angular velocity. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Rigid Body " )
bool bShowRigidBodyVelocity ;
/** Show the selected rigid body's applied force and torque. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Rigid Body " )
bool bShowRigidBodyForce ;
/** Show the selected rigid body's on screen text information. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Rigid Body " )
bool bShowRigidBodyInfos ;
/** Show the transform index for the selected rigid body's associated cluster nodes. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Clustering " )
bool bShowTransformIndex ;
/** Show the transform for the selected rigid body's associated cluster nodes. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Clustering " )
bool bShowTransform ;
/** Show a link from the selected rigid body's associated cluster nodes to their parent's nodes. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Clustering " )
bool bShowParent ;
/** Show the hierarchical level for the selected rigid body's associated cluster nodes. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Clustering " )
bool bShowLevel ;
/** Show the connectivity edges for the selected rigid body's associated cluster nodes. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Clustering " )
bool bShowConnectivityEdges ;
/** Show the geometry index for the selected rigid body's associated geometries. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Geometry " )
bool bShowGeometryIndex ;
/** Show the geometry transform for the selected rigid body's associated geometries. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Geometry " )
bool bShowGeometryTransform ;
/** Show the bounding box for the selected rigid body's associated geometries. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Geometry " )
bool bShowBoundingBox ;
/** Show the faces for the selected rigid body's associated geometries. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Geometry " )
bool bShowFaces ;
/** Show the face indices for the selected rigid body's associated geometries. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Geometry " )
bool bShowFaceIndices ;
/** Show the face normals for the selected rigid body's associated geometries. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Geometry " )
bool bShowFaceNormals ;
/** Enable single face visualization for the selected rigid body's associated geometries. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Geometry " )
bool bShowSingleFace ;
/** The index of the single face to visualize. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Geometry " , meta = ( ClampMin = " 0 " ) )
int32 SingleFaceIndex ;
/** Show the vertices for the selected rigid body's associated geometries. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Geometry " )
bool bShowVertices ;
/** Show the vertex indices for the selected rigid body's associated geometries. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Geometry " )
bool bShowVertexIndices ;
/** Show the vertex normals for the selected rigid body's associated geometries. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Geometry " )
bool bShowVertexNormals ;
/** Adapt visualization depending of the cluster nodes' hierarchical level. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " )
bool bUseActiveVisualization ;
/** Thickness of points when visualizing vertices. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( ClampMin = " 0 " ) )
2018-12-12 11:25:29 -05:00
float PointThickness ;
2019-06-08 17:15:34 -04:00
/** Thickness of lines when visualizing faces, normals, ...etc. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( ClampMin = " 0 " ) )
2018-12-12 11:25:29 -05:00
float LineThickness ;
2019-06-08 17:15:34 -04:00
/** Draw shadows under the displayed text. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " )
2018-12-12 11:25:29 -05:00
bool bTextShadow ;
2019-06-08 17:15:34 -04:00
/** Scale of the font used to display text. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( ClampMin = " 0.0001 " ) )
2018-12-12 11:25:29 -05:00
float TextScale ;
2019-06-08 17:15:34 -04:00
/** Scale factor used for visualizing normals. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( ClampMin = " 0.0001 " ) )
2018-12-12 11:25:29 -05:00
float NormalScale ;
2019-08-07 14:56:14 -04:00
/** Scale of the axis used for visualizing all transforms. */
2019-06-08 17:15:34 -04:00
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( ClampMin = " 0.0001 " ) )
2019-08-07 14:56:14 -04:00
float AxisScale ;
2018-12-12 11:25:29 -05:00
2019-06-08 17:15:34 -04:00
/** Size of arrows used for visualizing normals, breaking information, ...etc. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( ClampMin = " 0.0001 " ) )
2018-12-12 11:25:29 -05:00
float ArrowScale ;
2019-08-07 14:56:14 -04:00
/** Color used for the visualization of the rigid body ids. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor RigidBodyIdColor ;
/** Scale for rigid body transform visualization. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( ClampMin = " 0.0001 " ) )
float RigidBodyTransformScale ;
/** Color used for collision primitives visualization. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor RigidBodyCollisionColor ;
/** Color used for the visualization of the rigid body inertia tensor box. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor RigidBodyInertiaColor ;
/** Color used for rigid body velocities visualization. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor RigidBodyVelocityColor ;
/** Color used for rigid body applied force and torque visualization. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor RigidBodyForceColor ;
/** Color used for the visualization of the rigid body infos. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor RigidBodyInfoColor ;
/** Color used for the visualization of the transform indices. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor TransformIndexColor ;
/** Scale for cluster transform visualization. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( ClampMin = " 0.0001 " ) )
float TransformScale ;
/** Color used for the visualization of the levels. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor LevelColor ;
/** Color used for the visualization of the link from the parents. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor ParentColor ;
/** Line thickness used for the visualization of the rigid clustering connectivity edges. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( ClampMin = " 0.0001 " ) )
float ConnectivityEdgeThickness ;
/** Color used for the visualization of the geometry indices. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor GeometryIndexColor ;
/** Scale for geometry transform visualization. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( ClampMin = " 0.0001 " ) )
float GeometryTransformScale ;
/** Color used for the visualization of the bounding boxes. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor BoundingBoxColor ;
/** Color used for the visualization of the faces. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor FaceColor ;
/** Color used for the visualization of the face indices. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor FaceIndexColor ;
/** Color used for the visualization of the face normals. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor FaceNormalColor ;
/** Color used for the visualization of the single face. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor SingleFaceColor ;
/** Color used for the visualization of the vertices. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor VertexColor ;
/** Color used for the visualization of the vertex indices. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor VertexIndexColor ;
/** Color used for the visualization of the vertex normals. */
UPROPERTY ( EditAnywhere , Category = " Debug Draw|Settings " , meta = ( HideAlphaChannel ) )
FColor VertexNormalColor ;
2019-06-08 17:15:34 -04:00
/** Display icon in the editor. */
UPROPERTY ( )
2021-01-27 17:40:25 -04:00
TObjectPtr < UBillboardComponent > SpriteComponent ;
2018-12-12 11:25:29 -05:00
} ;