Update
This commit is contained in:
@@ -8,6 +8,123 @@
|
||||
class UDismembermentGraphNode;
|
||||
class UDismembermentGraph;
|
||||
|
||||
/**
|
||||
* Dismemberment node type enum
|
||||
*/
|
||||
UENUM(BlueprintType)
|
||||
enum class EDismembermentNodeType : uint8
|
||||
{
|
||||
None UMETA(DisplayName = "None"),
|
||||
Cut UMETA(DisplayName = "Cut"),
|
||||
BloodEffect UMETA(DisplayName = "Blood Effect"),
|
||||
Physics UMETA(DisplayName = "Physics"),
|
||||
Organ UMETA(DisplayName = "Organ"),
|
||||
Wound UMETA(DisplayName = "Wound"),
|
||||
BoneSelection UMETA(DisplayName = "Bone Selection")
|
||||
};
|
||||
|
||||
/**
|
||||
* Dismemberment node data structure
|
||||
*/
|
||||
USTRUCT(BlueprintType)
|
||||
struct FDismembermentNodeData
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
// Node name
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dismemberment")
|
||||
FName NodeName;
|
||||
|
||||
// Node type
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dismemberment")
|
||||
EDismembermentNodeType NodeType;
|
||||
|
||||
// Node parameters
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dismemberment")
|
||||
TMap<FName, float> FloatParameters;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dismemberment")
|
||||
TMap<FName, FVector> VectorParameters;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dismemberment")
|
||||
TMap<FName, FRotator> RotatorParameters;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dismemberment")
|
||||
TMap<FName, bool> BoolParameters;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dismemberment")
|
||||
TMap<FName, FName> NameParameters;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dismemberment")
|
||||
TMap<FName, UObject*> ObjectParameters;
|
||||
|
||||
// Constructor
|
||||
FDismembermentNodeData()
|
||||
: NodeType(EDismembermentNodeType::None)
|
||||
{
|
||||
}
|
||||
|
||||
// Get float parameter
|
||||
float GetFloatParameter(const FName& ParamName, float DefaultValue = 0.0f) const
|
||||
{
|
||||
if (const float* Value = FloatParameters.Find(ParamName))
|
||||
{
|
||||
return *Value;
|
||||
}
|
||||
return DefaultValue;
|
||||
}
|
||||
|
||||
// Get vector parameter
|
||||
FVector GetVectorParameter(const FName& ParamName, const FVector& DefaultValue = FVector::ZeroVector) const
|
||||
{
|
||||
if (const FVector* Value = VectorParameters.Find(ParamName))
|
||||
{
|
||||
return *Value;
|
||||
}
|
||||
return DefaultValue;
|
||||
}
|
||||
|
||||
// Get rotator parameter
|
||||
FRotator GetRotatorParameter(const FName& ParamName, const FRotator& DefaultValue = FRotator::ZeroRotator) const
|
||||
{
|
||||
if (const FRotator* Value = RotatorParameters.Find(ParamName))
|
||||
{
|
||||
return *Value;
|
||||
}
|
||||
return DefaultValue;
|
||||
}
|
||||
|
||||
// Get bool parameter
|
||||
bool GetBoolParameter(const FName& ParamName, bool DefaultValue = false) const
|
||||
{
|
||||
if (const bool* Value = BoolParameters.Find(ParamName))
|
||||
{
|
||||
return *Value;
|
||||
}
|
||||
return DefaultValue;
|
||||
}
|
||||
|
||||
// Get name parameter
|
||||
FName GetNameParameter(const FName& ParamName, const FName& DefaultValue = NAME_None) const
|
||||
{
|
||||
if (const FName* Value = NameParameters.Find(ParamName))
|
||||
{
|
||||
return *Value;
|
||||
}
|
||||
return DefaultValue;
|
||||
}
|
||||
|
||||
// Get object parameter
|
||||
UObject* GetObjectParameter(const FName& ParamName, UObject* DefaultValue = nullptr) const
|
||||
{
|
||||
if (UObject* const* Value = ObjectParameters.Find(ParamName))
|
||||
{
|
||||
return *Value;
|
||||
}
|
||||
return DefaultValue;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Compiled node data structure
|
||||
*/
|
||||
@@ -67,10 +184,28 @@ public:
|
||||
|
||||
/**
|
||||
* Get the execution order
|
||||
* @return Array of node indices in execution order
|
||||
* @param OutExecutionOrder - Array to fill with node indices in execution order
|
||||
* @return True if execution order is valid
|
||||
*/
|
||||
const TArray<int32>& GetExecutionOrder() const { return ExecutionOrder; }
|
||||
|
||||
bool GetExecutionOrder(TArray<int32>& OutExecutionOrder) const
|
||||
{
|
||||
if (ExecutionOrder.Num() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
OutExecutionOrder = ExecutionOrder;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get node data for a specific node index
|
||||
* @param NodeIndex - Index of the node
|
||||
* @param OutNodeData - Node data to fill
|
||||
* @return True if node data is valid
|
||||
*/
|
||||
bool GetNodeData(int32 NodeIndex, FDismembermentNodeData& OutNodeData) const;
|
||||
|
||||
/**
|
||||
* Add a bone selection
|
||||
* @param BoneName - Name of the bone to select
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "UObject/NoExportTypes.h"
|
||||
#include "DismembermentCompiler.h"
|
||||
#include "NiagaraSystem.h"
|
||||
#include "BooleanCutTool.h"
|
||||
#include "DismembermentExecutor.generated.h"
|
||||
|
||||
class AActor;
|
||||
@@ -147,6 +148,10 @@ private:
|
||||
// Selected bones
|
||||
UPROPERTY()
|
||||
TArray<FName> SelectedBones;
|
||||
|
||||
// Boolean cut tool for mesh cutting operations
|
||||
UPROPERTY()
|
||||
TObjectPtr<UBooleanCutTool> CutTool;
|
||||
|
||||
// Find the target skeletal mesh component
|
||||
bool FindTargetSkeletalMesh();
|
||||
|
Reference in New Issue
Block a user