You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
75 lines
2.2 KiB
C++
75 lines
2.2 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "AnimNode_AnimDynamics.h"
|
|
#include "AnimGraphNode_SkeletalControlBase.h"
|
|
#include "AnimPhysicsSolver.h"
|
|
|
|
#include "AnimGraphNode_AnimDynamics.generated.h"
|
|
|
|
namespace AnimDynamicsNodeConstants
|
|
{
|
|
const FLinearColor ShapeDrawColor = FLinearColor::White;
|
|
const FLinearColor ActiveBodyDrawColor = FLinearColor::Yellow;
|
|
const float ShapeLineWidth = 0.07f;
|
|
const float BodyLineWidth = 0.07f;
|
|
const float TransformLineWidth = 0.05f;
|
|
const float TransformBasisScale = 10.0f;
|
|
}
|
|
|
|
UCLASS()
|
|
class UAnimGraphNode_AnimDynamics : public UAnimGraphNode_SkeletalControlBase
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY(EditAnywhere, Category = Settings)
|
|
FAnimNode_AnimDynamics Node;
|
|
|
|
UPROPERTY(EditAnywhere, Category = Preview)
|
|
bool bPreviewLive;
|
|
|
|
UPROPERTY(EditAnywhere, Category = Preview)
|
|
bool bShowLinearLimits;
|
|
|
|
UPROPERTY(EditAnywhere, Category = Preview)
|
|
bool bShowAngularLimits;
|
|
|
|
UPROPERTY(Transient)
|
|
mutable USkeletalMeshComponent* LastPreviewComponent;
|
|
|
|
public:
|
|
|
|
virtual void PostLoad() override;
|
|
|
|
FReply ResetButtonClicked();
|
|
void ResetSim();
|
|
|
|
// UObject
|
|
virtual void Serialize(FArchive& Ar) override;
|
|
|
|
// UEdGraphNode_Base
|
|
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
|
|
virtual FText GetTooltipText() const override;
|
|
|
|
// UAnimGraphNode_Base
|
|
virtual void ValidateAnimNodeDuringCompilation(USkeleton* ForSkeleton, FCompilerResultsLog& MessageLog) override;
|
|
virtual void CustomizeDetails(IDetailLayoutBuilder& DetailBuilder) override;
|
|
|
|
// UAnimGraphNode_SkeletalControlBase
|
|
virtual void Draw(FPrimitiveDrawInterface* PDI, USkeletalMeshComponent * PreviewSkelMeshComp) const override;
|
|
|
|
FAnimNode_AnimDynamics* GetPreviewDynamicsNode() const;
|
|
|
|
protected:
|
|
|
|
// Keep a version of the current shape for rendering
|
|
FAnimPhysShape EditPreviewShape;
|
|
|
|
virtual FText GetControllerDescription() const override;
|
|
|
|
virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
|
|
|
|
void DrawLinearLimits(FPrimitiveDrawInterface* PDI, FTransform ShapeTransform, const FAnimNode_AnimDynamics& NodeToVisualise) const;
|
|
void DrawAngularLimits(FPrimitiveDrawInterface* PDI, FTransform JointTransform, const FAnimNode_AnimDynamics& NodeToVisualize) const;
|
|
}; |