2016-01-07 08:17:16 -05:00
|
|
|
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Abstract base class for a skeletal controller.
|
|
|
|
|
* A SkelControl is a module that can modify the position or orientation of a set of bones in a skeletal mesh in some programmatic way.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2015-06-10 10:57:15 -04:00
|
|
|
#include "Animation/AnimNodeBase.h"
|
|
|
|
|
#include "Animation/InputScaleBias.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "AnimNode_SkeletalControlBase.generated.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
USTRUCT()
|
2015-06-10 10:57:15 -04:00
|
|
|
struct ANIMGRAPHRUNTIME_API FAnimNode_SkeletalControlBase : public FAnimNode_Base
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-03-17 05:38:32 -04:00
|
|
|
GENERATED_USTRUCT_BODY()
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// Input link
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Links)
|
|
|
|
|
FComponentSpacePoseLink ComponentPose;
|
|
|
|
|
|
|
|
|
|
// Current strength of the skeletal control
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Settings, meta=(PinShownByDefault))
|
|
|
|
|
mutable float Alpha;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Settings)
|
|
|
|
|
FInputScaleBias AlphaScaleBias;
|
|
|
|
|
|
2015-10-31 10:55:13 -04:00
|
|
|
/*
|
|
|
|
|
* Max LOD that this node is allowed to run
|
|
|
|
|
* For example if you have LODThreadhold to be 2, it will run until LOD 2 (based on 0 index)
|
|
|
|
|
* when the component LOD becomes 3, it will stop update/evaluate
|
|
|
|
|
* currently transition would be issue and that has to be re-visited
|
|
|
|
|
*/
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Performance, meta = (DisplayName = "LOD Threshold"))
|
|
|
|
|
int32 LODThreshold;
|
|
|
|
|
|
2016-03-21 21:11:39 -04:00
|
|
|
UPROPERTY(Transient)
|
|
|
|
|
float ActualAlpha;
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
FAnimNode_SkeletalControlBase()
|
|
|
|
|
: Alpha(1.0f)
|
2015-10-31 10:55:13 -04:00
|
|
|
, LODThreshold(INDEX_NONE)
|
2016-03-21 21:11:39 -04:00
|
|
|
, ActualAlpha(0.f)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public:
|
2014-11-14 05:00:37 -05:00
|
|
|
#if WITH_EDITORONLY_DATA
|
|
|
|
|
// forwarded pose data from the wired node which current node's skeletal control is not applied yet
|
Copying //UE4/Dev-Framework to //UE4/Main @ 2830052
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2807479 on 2015/12/17 by Zak.Middleton
#ue4 - Optimize allocations in FFinalPostProcessSettings. Fix bug skipping an element when updating the ContributingCubemaps array if one is removed during an iteration.
#rb Aaron.Mcleran
#codereview Martin.Mittring
#jira UE-24485
Change 2807695 on 2015/12/17 by Aaron.McLeran
Changing the VolumeScale sound concurrency implementation to be a volume scalar on older sounds in a concurrency group rather than scale new sounds.
#rb zak.middleton
Change 2808628 on 2015/12/18 by Thomas.Sarkanen
Minor optimization: Dont call GetWorld() 3 times in a row in USceneComponent::ShouldRender()
#rb Martin.Wilson
Change 2810090 on 2015/12/21 by Ori.Cohen
Allow collision and trail particles to run off the game thread.
Clean up missing marshelled AsyncComponentToWorld
Change 2814518 on 2016/01/04 by Marc.Audy
Use Reset instead of Empty
Change 2814530 on 2016/01/04 by James.Golding
UE-2689 Hook up lots of new icons for component classes
#rb thomas.sarkanen
Change 2814665 on 2016/01/04 by Marc.Audy
PR #1860:Fix ChildActorComponent linking issue when extended from game (Contributed by lion03)
Change 2814686 on 2016/01/04 by Benn.Gallagher
Fix for radial force components applying impulses multiple times to destructible components
#rb Ori.Cohen
Change 2815221 on 2016/01/04 by Aaron.McLeran
UE-24528 Fixing focus-distance scaling and focus priority scaling working with concurrency settings.
USoundAttenuation:
- Added methods to SoundAttenuation to get focus, attenuation, and distance scale based on focus factor.
- Added NonFocusDistanceScale parameter to attenuation settings customization so its setable by users
USoundBase:
- Added function on USoundBase which checks IsLooping, which checks the duration
- Removed functions IsAudible and IsAudibleSimple from USoundBase since that functionality is accomplished differently and takes into account focus-distance scaling now.
FActiveSound:
- Caching values of FocusPriorityScale and FocusDistanceScale to Active sound so that can be used for audibility checks
- Included FocusDistanceScale when computing bIsAudible in Active sound
- Moved GetAttenuationListenerData and the accompanying private struct FAttenuationListenerData to FAudioDevice since the audio device and moved code which computes focus factor and geometry into FAudioDevice::GetFocusFactor since it needs to be computed before an active sound exist
FAudioDevice:
- Added SoundIsAudible function which queries a particular sound if its audible based on attenuation settings, focus factor, etc. Will optionally return computed MaxDistance to avoid recomputing it in certain cases.
- Added a few helper functions: FindClosestListenerIndex, GetAttenuationListenerData
- Added GetFocusFactor, which performs the vector math to determine focus factor (0.0 is in-focus, 1.0 is out of focus) for a given sound and listener and attenuation focus settings.
- Updated CreateComponent and PlaySoundAtLocation functions to use the new SoundIsAudible function rather than the old IsAudibleSimple
#rb zak.middleton
Change 2815694 on 2016/01/05 by thomas.sarkanen
Added test texture
Change 2815695 on 2016/01/05 by thomas.sarkanen
Modified test texture
Change 2815709 on 2016/01/05 by James.Golding
PR #1778 : New BP-callablle function AActor::WasRecentlyRendered, with optional tolerance in seconds
https://github.com/EpicGames/UnrealEngine/pull/1778
#github 1778
#jira UE-23674
#rb jurre.debaare
Change 2815711 on 2016/01/05 by James.Golding
PR #1534 : Add missing default tolerance value for FVector2D::Equal
https://github.com/EpicGames/UnrealEngine/pull/1534
#github 1534
#jira UE-20838
#rb jurre.debaare
Change 2815714 on 2016/01/05 by James.Golding
PR #1887 : Added 'Thickness' Parameter to all valid options in Draw Debug Helper
https://github.com/EpicGames/UnrealEngine/pull/1887
#github 1887
#jira UE-24802
#rb jurre.debaare
Change 2815725 on 2016/01/05 by James.Golding
Added comment that USkeletalMeshComponent::bEnablePhysicsOnDedicatedServer cannot be changed at runtime
#jira UE-20439
Change 2815813 on 2016/01/05 by Marc.Audy
Move dispatch of transition functions to new OnMatchStateSet virtual which is called from SetMatchState allowing subclasses to insert their own handling between the set of the variable and dispatch to GameState and Blueprints rather than having to override the entire function.
#codereview Peter.Knepley
Change 2815884 on 2016/01/05 by James.Golding
- Avoid PSC iterating over all particle emitters each tick to check for changes in DetailMode. Now remember global DetailMode when we last checked, and only iterate again if that has changed.
- Add 'WarmupTime' and 'CPUCollision' to Asset Registry Tags for Particle Systems
#rb simon.tovey
#codereview gil.gribb
Change 2816306 on 2016/01/05 by Marc.Audy
(4.11) Pass boolean to OnComponentDestroyed that indicates if the entire Actor's hierarchy is being destroyed. If so we can avoid doing a lot of expensive tear down, particularly detaching each component one at a time from the hierarchy and causing massive position/bounds updates.
#rb Zak.Middleton, James.Golding
2016-01-15 13:01:30 -05:00
|
|
|
FCSPose<FCompactHeapPose> ForwardedPose;
|
2014-11-14 05:00:37 -05:00
|
|
|
#endif //#if WITH_EDITORONLY_DATA
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
// FAnimNode_Base interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void Initialize(const FAnimationInitializeContext& Context) override;
|
2014-10-01 14:45:04 -04:00
|
|
|
virtual void CacheBones(const FAnimationCacheBonesContext& Context) override;
|
2015-10-31 10:55:13 -04:00
|
|
|
virtual void Update(const FAnimationUpdateContext& Context) final;
|
|
|
|
|
virtual void EvaluateComponentSpace(FComponentSpacePoseContext& Output) final;
|
2014-03-14 14:13:41 -04:00
|
|
|
// End of FAnimNode_Base interface
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// Interface for derived skeletal controls to implement
|
2015-10-31 10:55:13 -04:00
|
|
|
// use this function to update for skeletal control base
|
|
|
|
|
virtual void UpdateInternal(const FAnimationUpdateContext& Context);
|
2016-01-12 04:06:44 -05:00
|
|
|
// use this function to evaluate for skeletal control base
|
|
|
|
|
virtual void EvaluateComponentSpaceInternal(FComponentSpacePoseContext& Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
// Evaluate the new component-space transforms for the affected bones.
|
2015-05-19 06:19:22 -04:00
|
|
|
virtual void EvaluateBoneTransforms(USkeletalMeshComponent* SkelComp, FCSPose<FCompactPose>& MeshBases, TArray<FBoneTransform>& OutBoneTransforms) {}
|
2014-03-14 14:13:41 -04:00
|
|
|
// return true if it is valid to Evaluate
|
2014-10-01 14:45:04 -04:00
|
|
|
virtual bool IsValidToEvaluate(const USkeleton* Skeleton, const FBoneContainer& RequiredBones) { return false; }
|
2014-03-14 14:13:41 -04:00
|
|
|
// initialize any bone references you have
|
2014-10-01 14:45:04 -04:00
|
|
|
virtual void InitializeBoneReferences(const FBoneContainer& RequiredBones){};
|
2014-04-23 18:35:21 -04:00
|
|
|
|
|
|
|
|
/** Allow base to add info to the node debug output */
|
|
|
|
|
void AddDebugNodeData(FString& OutDebugData);
|
2015-10-28 08:58:16 -04:00
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
// Resused bone transform array to avoid reallocating in skeletal controls
|
|
|
|
|
TArray<FBoneTransform> BoneTransforms;
|
2014-03-14 14:13:41 -04:00
|
|
|
};
|