Files
UnrealEngineUWP/Engine/Source/Runtime/AnimGraphRuntime/Public/BoneControllers/AnimNode_Trail.h
Matthew Griffin 20be235fa6 Merging //UE4/Release-4.11 to //UE4/Main (Up to 2874930)
#lockdown Nick.Penwarden

==========================
MAJOR FEATURES + CHANGES
==========================

Change 2868448 on 2016/02/16 by Mark.Satterthwaite

	Bring MetalRHI & MetalShaderFormat mostly up to Dev-Platform CL #2867146 to address JIRA UE-26181 and as the first part of addressing JIRA UE-23208. Only CL #2854142 has been omitted for compatibility with the 4.11 branch.
	#jira UE-26181

Change 2868454 on 2016/02/16 by Mark.Satterthwaite

	Shader changes necessary to properly fix Mobile Preview under Mac Metal (JIRA UE-23208) - Mac ES 3.1 doesn't support framebuffer fetch & is in fact a Mobile Emulation shader platform.
	#jira UE-23208

Change 2868650 on 2016/02/16 by Matthew.Griffin

	Allow Developer modules to be pre-compiled when the target is editor.
	#jira UE-26802

Change 2868859 on 2016/02/16 by Nick.Whiting

	Merging StereoPanorama fixes from Main to Release-4.11 (CL 2811839)

	#jira UE-25066

Change 2868927 on 2016/02/16 by Mieszko.Zielinski

	Fixed some regular-use crashes in LogVisualizer #UE4

	#rb Lukasz.Furman
	#jira UE-27003

Change 2868994 on 2016/02/16 by Lina.Halper

	Fix refresh UI issue with remove joint

	#jira : UE-26529
	#rb: Martin.Wilson

Change 2868996 on 2016/02/16 by Lina.Halper

	Fix node stop working when negative value of LODThreshold

	#jira: UE-26828
	#rb:Martin.Wilson

Change 2868998 on 2016/02/16 by Lina.Halper

	Fix with crash when invalid index has entered

	#jira : UE-26715
	#rb : Martin.Wilson

Change 2869003 on 2016/02/16 by Ori.Cohen

	- Fix thread safety issue when cloth child collision or environment collision is used.
	- Fix cloth bounds growing when stale transform data is used.

	#JIRA OR-14990
	#rb James.Golding

Change 2869109 on 2016/02/16 by mason.seay

	Updated test assets for Restitution testing

	#jira UE-24473

Change 2869223 on 2016/02/16 by Taizyd.Korambayil

	#jira UE-19083 Disabled LOD on SkySphere BP

Change 2869558 on 2016/02/16 by Dan.Oconnor

	Conservative fix for crash that occurs when adding a weak object ptr to an array of object ptrs in a blueprint
	#jira UE-25893

Change 2869891 on 2016/02/17 by Thomas.Sarkanen

	Fix crash when re-compiling anim BPs that are dependencies of 'parent' Blueprints

	Force a re-initialzation of nodes when initializing the whole anim instance. The bInitialized flag was intended as a runtime optimization - we assume our function will not change for the lifetime of the UAnimInstance. While parts of the graph will be re-initialized we dont need to re-acquire our UFunction ptrs (etc.) unless the whole instance is getting re-initialized.

	#rb Martin.Wilson
	#jira UE-26642 - Switch Skeletal Mesh node crashes the editor if the blueprint is compiled.

Change 2869956 on 2016/02/17 by Tim.Hobson

	#Jira UE-26550 - Added three new icons for Arrow, Locked, and Unlocked per request from IanS.

Change 2869965 on 2016/02/17 by Gareth.Martin

	Fix check() being hit when loading KiteDemo x1_y1 (and other old foliage maps)
	#jira UE-26930

Change 2870007 on 2016/02/17 by Richard.TalbotWatkin

	Merging from //UE4/Dev-Editor CL 2867609

	Fixed auto-generation of unique object/package names when duplicating, so they generate the same names if they the source object was named the same as its package.
	#jira UE-25769 - Crash when Copy+Pasting numbered umaps in the content browser
	#RB Bob.Tellez

Change 2870072 on 2016/02/17 by Michael.Schoell

	Level Blueprints will no longer preload newly created Blueprints that they reference when they are reloaded.

	#jira UE-23637 - Use of Blueprint delegate in sub-level script causes errors on startup

Change 2870087 on 2016/02/17 by Matthew.Griffin

	Removed Android and IOS from list of platforms to build only for UnrealMatch3, so that they can be cooked and packaged correctly.

Change 2870141 on 2016/02/17 by mason.seay

	Test content for Copy Pose From Mesh

	#jira UE-24473

Change 2870195 on 2016/02/17 by Mieszko.Zielinski

	PR #2052: Added missing Super::BeginPlay() (Contributed by Skylonxe)

	#jira UE-26915

Change 2870325 on 2016/02/17 by Steve.Robb

[CL 2882948 by Matthew Griffin in Main branch]
2016-02-26 05:49:37 -05:00

108 lines
4.0 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "AnimNode_SkeletalControlBase.h"
#include "AnimNode_Trail.generated.h"
// in the future, we might use this for stretch set up as well
// for now this is unserializable, and transient only
struct FPerJointTrailSetup
{
/** How quickly we 'relax' the bones to their animated positions. */
float TrailRelaxationSpeedPerSecond;
};
/**
* Trail Controller
*/
USTRUCT()
struct ANIMGRAPHRUNTIME_API FAnimNode_Trail : public FAnimNode_SkeletalControlBase
{
GENERATED_USTRUCT_BODY()
/** Reference to the active bone in the hierarchy to modify. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Trail)
FBoneReference TrailBone;
/** Number of bones above the active one in the hierarchy to modify. ChainLength should be at least 2. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Trail, meta = (ClampMin = "2", UIMin = "2"))
int32 ChainLength;
/** Axis of the bones to point along trail. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Trail)
TEnumAsByte<EAxis::Type> ChainBoneAxis;
/** Invert the direction specified in ChainBoneAxis. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Trail)
bool bInvertChainBoneAxis;
/** How quickly we 'relax' the bones to their animated positions. Deprecated. Replaced to TrailRelaxationCurve */
UPROPERTY()
float TrailRelaxation_DEPRECATED;
/** How quickly we 'relax' the bones to their animated positions. Time 0 will map to top root joint, time 1 will map to the bottom joint. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Trail, meta=(CustomizeProperty))
FRuntimeFloatCurve TrailRelaxationSpeed;
/** Limit the amount that a bone can stretch from its ref-pose length. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Limit)
bool bLimitStretch;
/** If bLimitStretch is true, this indicates how long a bone can stretch beyond its length in the ref-pose. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Limit)
float StretchLimit;
/** 'Fake' velocity applied to bones. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Velocity)
FVector FakeVelocity;
/** Whether 'fake' velocity should be applied in actor or world space. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Velocity)
bool bActorSpaceFakeVel;
/** Base Joint to calculate velocity from. If none, it will use Component's World Transform. . */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Velocity)
FBoneReference BaseJoint;
/** Internal use - we need the timestep to do the relaxation in CalculateNewBoneTransforms. */
float ThisTimstep;
/** Did we have a non-zero ControlStrength last frame. */
bool bHadValidStrength;
/** Component-space locations of the bones from last frame. Each frame these are moved towards their 'animated' locations. */
TArray<FVector> TrailBoneLocations;
/** LocalToWorld used last frame, used for building transform between frames. */
FTransform OldBaseTransform;
/** Per Joint Trail Set up*/
TArray<FPerJointTrailSetup> PerJointTrailData;
FAnimNode_Trail();
// FAnimNode_Base interface
virtual void Initialize(const FAnimationInitializeContext& Context) override;
virtual void UpdateInternal(const FAnimationUpdateContext& Context) override;
virtual void GatherDebugData(FNodeDebugData& DebugData) override;
// End of FAnimNode_Base interface
// FAnimNode_SkeletalControlBase interface
virtual void EvaluateBoneTransforms(USkeletalMeshComponent* SkelComp, FCSPose<FCompactPose>& MeshBases, TArray<FBoneTransform>& OutBoneTransforms) override;
virtual bool IsValidToEvaluate(const USkeleton* Skeleton, const FBoneContainer& RequiredBones) override;
// End of FAnimNode_SkeletalControlBase interface
void PostLoad();
private:
// FAnimNode_SkeletalControlBase interface
virtual void InitializeBoneReferences(const FBoneContainer& RequiredBones) override;
// End of FAnimNode_SkeletalControlBase interface
FVector GetAlignVector(EAxis::Type AxisOption, bool bInvert);
// skeleton index
TArray<int32> ChainBoneIndices;
};