Skip to content

Instantly share code, notes, and snippets.

View fortheday's full-sized avatar
🤩

magicpotato fortheday

🤩
View GitHub Profile
@fortheday
fortheday / UE4 Animation Subsystem Architecture
Created January 30, 2019 07:12 — forked from ikrima/UE4 Animation Subsystem Architecture
Mapping Out The UE4 Animation Architecture Flow
Animation Subsystem
AnimInstance is the runtime animation class that maintains runtime data & plays shit
- This is the parent class of the animation blueprint
- Get Bone Transforms from a specific time t:
○ Sequence->GetAnimationPose(Output.Pose, Output.Curve, FAnimExtractContext(CurrentTime, Sequence->bEnableRootMotion));
UAnimationAsset is the classes that contain the actual data and also calculates bones & curves
- UAnimSequence
#include "Misc/AutomationTest.h"
#if WITH_DEV_AUTOMATION_TESTS
// 테스트들이 공통되는 기능을 갖는다.
// IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST()로 테스트당 클래스가 1개씩 생기는 개념
class FMyTestBase : public FAutomationTestBase
{
public:
FMyTestBase(const FString& InName, const bool bInComplexTask)
void TestLambda()
{
int i = 0;
double d = 0.0;
auto f0 = []() { puts("aa"); }; // sizeof(empty struct) == 1
auto f1 = [myI = i]() { }; // sizeof(struct { int }) == 4
auto f2 = [myD = d]() { }; // sizeof(struct { double }) == 8
printf("sizeof f0[%zu] f1[%zu] f2[%zu]", sizeof(f0), sizeof(f1), sizeof(f2));
#pragma warning(disable : 4100)
#define DO_NOTHING(...)
template<typename... T_VARIADIC>
void ProcessVariadicParams_T(T_VARIADIC... params)
{
DO_NOTHING(params...);
}
#pragma warning(disable : 4710 4514)
#include <stdio.h>
#include <errno.h>
class CMutable
{
private:
mutable int m_Val = 0;
public:
UCLASS()
class FORTHEDAYSANDBOX_API UMyObject : public UObject
{
GENERATED_BODY()
public:
virtual void BeginDestroy() override;
};
//------------------------------------------------------------------------------
#pragma warning(disable : 4710 4514)
#include <vector>
#include <functional>
struct SMemHolder
{
char *m_pBuf;
SMemHolder() : m_pBuf(nullptr)
{
#include <functional>
class FScopedExecuter
{
private:
using T_FUNC = std::function<void(void)>;
T_FUNC m_Func;
public:
FScopedExecuter(T_FUNC &&rvFunc) : m_Func(rvFunc) {}
class FMyTasks
{
private:
using TSinglecasterArray = TArray<FSimpleDelegate>;
TSinglecasterArray m_Singlecasters;
public:
void AddDelegate(FSimpleDelegate &&rvDelegate)
{
m_Singlecasters.Add(rvDelegate);
class CRValue
{
public:
void f() const && { puts("&&"); }
void f() const & { puts("& or inst"); }
};
CRValue inst;
CRValue &rInst = inst;
inst.f(); // & or inst