• Actor
    • 의미 : 레벨에 배치할 수 있는 게임플레이 Object ( class AActor )
    • 구조 : Component들의 그룹
  • Component
    • 의미 : 기능의 단위가 되는 Object
  • Object
    • 의미 : 모든 형태의 인스턴스 ( class UObject )
    • 구조 : Component, Actor 등 하나의 class로부터 파생된 모든 instance의 총칭
      • AActor를 가리키지 않은 instance를 총칭하기도 함

 

기본 모듈

'Unreal > UE Architecture' 카테고리의 다른 글

Cpp -> BP Pipeline 1  (0) 2024.05.17
문자열 처리  (0) 2024.05.16
UE Macro & Reflection System  (0) 2024.05.16
Smart Pointer & Container & Serialize  (0) 2024.05.16
Input  (0) 2024.05.16

Actor

  • actor
  • widget : UI widget

Component

  • Charactor
    • PlayerController : 플레이어 입력성 반응
    • AIController : 외부 환경성 반응
    • ThirdPersonCharactor : 3인칭 플레이어캐릭터, 조작, 카메라 프리셋

UMG : 언리얼 모션 그래픽

  • widget : 미리 만들어진 함수 시리즈 ( 버튼, 체크박스 등 )
    • UI  : 위젯들을 통해 만들어진 인터페이스
    • widget blueprint : 위젯 편집 도구 및 편집 데이터
      • designer : 시각적 레이아웃, 기본 함수
      • graph : 위젯들의 함수기능

AI

  • blackboard key selector : 블랙보드의 key(var)값을 받을 변수 ( instance editable 필수 )
  • Charactor actor
  • AI Controller
  • AI
  • BT ( Behavior Tree)
  • BTTask
  • BTService
  • BTDecoration

Component _ detail

  • common actor
    • actor
      • initial life span ( int n ) : n초 후 destroy self
  • projectile
    • projectile
      • init spd : 시작속도
      • max spd : 최대속도
  • Collision
    • collision
      • collision presets : 충돌관리
        • overlapAllDynamic
        • BlockAll  : 
  • Widget
    • User interface
      • widget class : 적용할 BluePrint
      • Draw size : 사용자 지정 크기
      • space
        • world : world base rotation
        • screen : 항상 카메라를 바라봄
  • ProgressBar
    • Progress
      • percent : 0 ~ 1 프로그레스 바 비율
        • Bind : Event Dispatcher를 통해 스크립트에서 접근 가능 / 연동될 변수를 선택
  • BluePrint Charactor
    • pawn
      • ai controller class : 사용자 지정 BP AIController 연결 가능
  • FloatingPawnMovement : Pawn에 이동기능(nav)을 주기 위한 component
  • AIPerception : AI의 적 인지구조 설계 ( ai controller의 component )
  • UI
    • Slot
      • Zorder : 화면출력 우선순위

'Unreal > UE Class :: UObject' 카테고리의 다른 글

Subsystem  (0) 2024.05.16
Field  (0) 2024.05.16
Procedural Mesh  (0) 2024.05.16

BluePrint Interface(BPI)

BP 내 interface 상속

 

BP 내 Interface 함수 호출

 

Cast와 달리 타입정보가 불분명하거나 다양할 때 Type 체크 없이 Message로 Call 시도할 수 있음

'Unreal > BP & UE Library' 카테고리의 다른 글

Class Name 접두  (0) 2024.05.17
code 내장 함수  (0) 2024.05.17
BP node list 1  (0) 2024.05.16
UE Dispatch & Delegate  (0) 2024.05.16
BP Node 리스트  (0) 2024.05.16
  • Time
    • Get world delta seconds : global delta sec
    • Get time Seconds : global stacked sec
  • Is Valid
    • 할당여부 판정 ( isNull / isNone )
  • (F/R/T/V) Interp
    • deltaTime + TotalTime 받아서 보간시켜줌 ( float, rotator, transfrom, vector? )
    • deltaTime값 알아서 누적시켜줘서 편함
  • dot
    • 내적
  • 흐름제어
    • Switch
    • Branch
    • Sequence
    • DoN ( DoOnce )
      • N번까지만 flow True, 이후 reset 전까지 flow False
    • FlipFlop : A부터 시작해서 호출될때마다 다음 시퀀스 A ↔ B 스위치
    • For Loop ( For Loop With Break )
    • While Loop
    • Gate
      • 별개 flow에 의해 Trigger되어 Open/Close가 switch 되는 Flow
    • MultiGate
      • 호출할때마다 순차적으로 다음 Flow 활성
        • Loop : 마지막 Flow 사용 시 첫 Flow 사용
        • IsRandom : 아직 이번Loop에서 안쓴 Flow중 랜덤 Flow 사용
  • PlayerController
    • Get current Mouse cursor : 마우스 커서 모양 get/set
      • Enum Type
  • Set View Target with Blend
    • 카메라 전환 ( to actor )
    • 타겟의 활성화된 맨 위 카메라컴포넌트 적용
  • Math::Transform : world loc to local loc
  • Math::Invert Transform : local loc to world loc
  • Draw material to render target
  • Timeline
 

타임라인

언리얼 엔진 4 블루프린트의 타임라인에 대한 개요서입니다.

docs.unrealengine.com

 

'Unreal > BP & UE Library' 카테고리의 다른 글

Class Name 접두  (0) 2024.05.17
code 내장 함수  (0) 2024.05.17
BP Interface  (0) 2024.05.16
UE Dispatch & Delegate  (0) 2024.05.16
BP Node 리스트  (0) 2024.05.16

1. 파츠별로 나뉜 메쉬 (사실 각메쉬는 전체 스켈레톤 트리정보를 가지고있음)

 

2. Character Actor BP에서 드래곤볼

 

3. BP에서 Master로 설정한 SKM component의 값, 포인터 호출 공유

 

작동 테스트

 

 

'Unreal > Animation' 카테고리의 다른 글

UE Animation 구조  (0) 2024.05.20
Anim Asset 구조  (0) 2024.05.16

기본 구조

Construction Flow / [F]Create Mesh Section
Procedural mesh node들 / Update Flow

일반적인 그래픽스 기본 도형 생성 과정과 비슷

  1. Create Mesh Section
    1. Target : Procedural Mesh Component ( A )
    2. Section Index : mesh 내 해당 polygon의 index num ( 겹칠경우, 기존 polygon 덮어씌움 )
    3. Vertices : 참조할 vertex array ( 더미 포함되어있어도 상관없음 )
    4. Triangles : vertices(c) 중 이 노드에서 만들 polygon의 edge로 참조할 vertex vector 3개
    5. 추가항목 : vertices의 각 vertex와 매치되어 기능하는 항목들 ( linear interpolation 기반으로 보임, 노랑은 vector(flaot3) array / 파랑은 float2 array )
      1. normal

         

        Normal Map과 동일한 효과

        • vectex단위로 normal vector를 저장한 다음, polygon위의 각 점에 대해, 3개의 edge의 normal값을 Linear interpolation 하여 적용하는 형태로 보임
      2. UV

        UVn ( n은 채널명, 각 material을 원하는 channel에 적용할 수 있음 )

        • 몰라.. float2 array니까 mesh의 n채널 uv맵(정사각형)에서 각 버텍스와 매치시키겠지..
        • uv map 구조static mesh와 할당된 UV map

        • 좌상단 : [0, 0] / 우하단 : [1, 1]
      3. Tangents : 더모름.. polygon 내에서 곡률을 주는건 불가능할꺼고(nurbs나 subdivision처리..? , normal map처럼 mat처리도아닐꺼고 texture stretching?)
  2. Update Mesh Sction
    • polygon 단위로 update
    • node는 create mesh section(1)과 동일
  3. Create StaticMesh
    1. Actor 내 ProcedurealMeshComponent 선택
    2. (1) Procedural Mesh category의 create staticmesh 버튼 클릭
    3. (2) 경로 선택
    4. (3) static mesh 생성됨 ( construction script 내용 기준인걸로 보임 )
  4. 기타 mesh reference

 

 

 

'Unreal > UE Class :: UObject' 카테고리의 다른 글

Subsystem  (0) 2024.05.16
Field  (0) 2024.05.16
기본 구성 리스트  (0) 2024.05.16

구조

 

 

BP 샘플

부모 ( 호출자 ) < - > 자식 ( 반응자 )

 

코드 구성


부모 자식
부모.h 부모(호출).cpp 자식.h 자식(실행).cpp
DECLARE_MULTICAST_DELEGATE([Delegate 클래스명 선언]);
UClass()
{ [Delegate 클래스명]
[Delegate 객체]; }
호출
[Delegate 객체]
.
Broadcast(); ( multi일 경우 )
[Delegate 객체].ExcuteIfBound(); ( single일 경우 )
  [부모class]->[Delegate 객체].AddUObject([자식](타겟 함수를 보유한 class의 객체), &[타겟 함수]);
( multi일 경우 )
( single은 BindUObject // UObject 외에도 TsharedReference, Function 등 존재 )
       

 

BP에서 delegate에 Binding 하기

- static 함수로 BlueprintCallable함수를 만듬 ( delegate를 포함한 class의 생성 함수 )

- dynamic delegate는 BlueprintAssignable로 지정

 

상호참조 ( circular dependency )

  1. 문제 : Header 파일은 상호참조가 불가능함 
  2. 예시
    1. A.h : # include B.h
    2. B.h : # include A.h

  3. 방법
    1. 한쪽에서는 소스파일에서 include
    2. 예시
      1. A.h : # include B.h
      2. B.cpp : # include A.h

 

 

전방선언 ( forward declaration )

  1. 문제 : 함수가 상호참조할 경우
    1. 같은 파일 내의 두 함수 중 하나는 상대방을 인식할 수 없음
    2. 다른 파일간의 두 함수 중 하나는 header에서 include를 못하므로, header에서 함수선언시 type을 정의할 수 없음

  2. 예시
    1. 본문의 경우, child.h에서 InitFunction 선언 시 argument로 dispatcherTest를 가질 수 없음

  3. 방법
    1. 동일한 명칭의 가상(더미) 클래스를 만듬
      1. 헤더파일에서만 사용됨
      2. 소스파일에서는 #include가 되어있을 경우, 자동으로 대체되는걸로 보임
      3. DisPatchChild.h - 
        class ADispatcherTest;

 

자신 클래스에 대한 참조 ( Self reference )

  1. 문제
    1. cpp에서 this는 const var* 형태 이므로 다른 class에 reference로 전달 시, 내부에 접근하지 못하는 문제

  2. 예시
    1. this를 통해 얻은 pointer를 그대로 전달 시, 해당 객체가 보유한 [delegate] 객체를 call만 가능하고 bind는 불가능

  3. 해결
    1. const_cast로 const 제거
      1. CustomClass* [var] = const_cast<CustomClass*>(this)

  4. 추가정보
    1. const [Ptr] : 해당 ptr을 통해 내용물의 set 불가
    2. [Ptr] const : 해당 ptr의 참조 대상(메모리 주소) 변경 불가(재할당 불가)
    3. const [Ptr] const 가능

 

샘플 코드

부모.h

더보기
// Fill out your copyright notice in the Description page of Project Settings.
 
#pragma once
 
#include "CoreMinimal.h"
 
#include "Components/BoxComponent.h"
#include "Components/SceneComponent.h"
#include "Components/ArrowComponent.h"
#include "DisPatcherChild.h"
 
#include "GameFramework/Actor.h"
#include "DispatcherTest.generated.h"
 
DECLARE_MULTICAST_DELEGATE(TurnLightDelegate);
 
UCLASS()
class MYPROJECT_API ADispatcherTest final : public AActor
{
    GENERATED_BODY()
     
public:
    // Sets default values for this actor's properties
    ADispatcherTest();
    UPROPERTY(EditAnywhere, blueprintReadWrite, Category = "Dispatcher")
        USceneComponent* RootComp;
    UPROPERTY(EditAnywhere, blueprintReadWrite, Category = "Dispatcher")
        UBoxComponent* BoxComp;
    UPROPERTY(EditAnywhere, blueprintReadWrite, Category = "Dispatcher")
        UArrowComponent* ArrowComp;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
        UStaticMeshComponent* BoxMesh;
     
protected:
    // Called when the game starts or when spawned
    virtual void BeginPlay() override;
     
public:
    // Called every frame
    virtual void Tick(float DeltaTime) override;
     
    bool bIsOn = false;
    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Dispatcher")
        TArray<ADisPatcherChild*> MyChildren;
     
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
        int32 ChildCount=5;
 
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
        TSubclassOf<ADisPatcherChild> ChildClass;
 
    UFUNCTION(BlueprintCallable, Category = "Dispatcher")
    void CreateChildActor(int Count, TArray<ADisPatcherChild*>& ChildrenArr) const;
 
    UFUNCTION()
        void OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor,
            UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep,
            const FHitResult& SweepResult);
     
    TurnLightDelegate TurnLightDelegatePtr; // 1. Declare a delegate pointer
         
};

 

부모.cpp

더보기
// Fill out your copyright notice in the Description page of Project Settings.
 
 
#include "DispatcherTest.h"
 
#include "ActorReferencesUtils.h"
 
 
// Sets default values
ADispatcherTest::ADispatcherTest()
{
    // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
    PrimaryActorTick.bCanEverTick = true;
 
    RootComp = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
    RootComponent = RootComp;
    BoxComp = CreateDefaultSubobject<UBoxComponent>(TEXT("BoxComp"));
    BoxComp->SetupAttachment(RootComponent);
    BoxComp->SetRelativeScale3D(FVector(2, 2, 2));
    ArrowComp = CreateDefaultSubobject<UArrowComponent>(TEXT("ArrowComp"));
    ArrowComp->SetRelativeRotation(FRotator(0, 90, 0));
    ArrowComp->SetupAttachment(RootComponent);
    BoxMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("BoxMesh"));
    BoxMesh->SetRelativeScale3D(FVector(0.64, 0.64, 0.64));
    BoxMesh->SetCollisionEnabled(ECollisionEnabled::NoCollision);
    BoxMesh->SetupAttachment(BoxComp);
 
    BoxComp->OnComponentBeginOverlap.AddDynamic(this, &ADispatcherTest::OnOverlapBegin);
}
 
// Called when the game starts or when spawned
void ADispatcherTest::BeginPlay()
{
    Super::BeginPlay();
 
    CreateChildActor(ChildCount, MyChildren);  
}
 
// Called every frame
void ADispatcherTest::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);
 
}
 
void ADispatcherTest::CreateChildActor(const int Count, TArray<ADisPatcherChild*>& ChildrenArr) const
{
    for (int i = 0; i <= Count; i++)
    {
        FVector TargetLoc = GetActorLocation() + FVector(0, 100*i, 0);
        TargetLoc -= this->GetActorLocation();
        TargetLoc = FRotationMatrix(RootComponent->GetComponentTransform().Rotator()).TransformPosition(TargetLoc);
        TargetLoc += this->GetActorLocation();
 
         
        AActor* TempChild;
        TempChild = GetWorld()->SpawnActorDeferred<AActor>(ChildClass, FTransform(TargetLoc), nullptr, nullptr, ESpawnActorCollisionHandlingMethod::AlwaysSpawn);
        TempChild->FinishSpawning(FTransform(TargetLoc));
 
        if (ADisPatcherChild* Child = Cast<ADisPatcherChild>(TempChild))
        {
            ADispatcherTest* SelfRef = const_cast<ADispatcherTest*>(this);
            Child->InitFunction( SelfRef );
            ChildrenArr.Add(Child);
        }
         
         
    }
    //ParentActor->TurnLightDelegatePtr.BindSP(this, &ADisPatcherChild::TurnLight);
}
 
 
void ADispatcherTest::OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor,
    UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
    UE_LOG(LogTemp, Log, TEXT("Overlap Begin"));
    TurnLightDelegatePtr.Broadcast();
    //TurnLightDelegatePtr.ExecuteIfBound();

 

 

자식.h

더보기
// Fill out your copyright notice in the Description page of Project Settings.
 
#pragma once
 
#include "CoreMinimal.h"
 
//#include "DispatcherTest.h"
#include "Components/ArrowComponent.h"
#include "Components/SphereComponent.h"
#include "Components/SceneComponent.h"
#include "Components/StaticMeshComponent.h"
#include "Components/PointLightComponent.h"
 
#include "GameFramework/Actor.h"
#include "DisPatcherChild.generated.h"
 
class ADispatcherTest;
 
UCLASS()
class MYPROJECT_API ADisPatcherChild : public AActor
{
    GENERATED_BODY()
     
public:
    // Sets default values for this actor's properties
    ADisPatcherChild();
 
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
        USceneComponent* RootComp;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
        USphereComponent* SphereComp;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
        UStaticMeshComponent* SphereMesh;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
        UPointLightComponent* PointLightComp;
 
    bool bIsOn = false;
protected:
    // Called when the game starts or when spawned
    virtual void BeginPlay() override;
 
public:
    // Called every frame
    virtual void Tick(float DeltaTime) override;
     
     
    UFUNCTION(BlueprintCallable, Category = "Dispatcher")
        void TurnLight();
     
    void InitFunction(ADispatcherTest* ParentActor);
     
};

자식.cpp

더보기
// Fill out your copyright notice in the Description page of Project Settings.
 
#include "DisPatcherChild.h"
 
#include "DispatcherTest.h"
 
 
 
 
// Sets default values
ADisPatcherChild::ADisPatcherChild()
{
     
    // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
    PrimaryActorTick.bCanEverTick = true;
 
    RootComp = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
    RootComponent = RootComp;
     
    SphereComp = CreateDefaultSubobject<USphereComponent>(TEXT("sphereComp"));
    SphereComp->SetupAttachment(RootComponent);
 
    SphereMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("SphereMesh"));
    SphereMesh->SetRelativeLocation(FVector(0, 0, 0));
    SphereMesh->SetRelativeScale3D(FVector(0.5, 0.5, 0.5));
    SphereMesh->SetupAttachment(SphereComp);
    //SphereMesh->SetStaticMesh(ConstructorHelpers::FObjectFinder<UStaticMesh>(TEXT("StaticMesh'/Engine/BasicShapes/Sphere.Sphere'")).Object);
 
    PointLightComp = CreateDefaultSubobject<UPointLightComponent>(TEXT("PointLightComp"));
    PointLightComp->SetRelativeLocation(FVector(0, 0, 100));
    PointLightComp->SetupAttachment(RootComponent);
    PointLightComp->SetIntensity(1000);
     
}
 
// Called when the game starts or when spawned
void ADisPatcherChild::BeginPlay()
{
    Super::BeginPlay();
     
}
 
// Called every frame
void ADisPatcherChild::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);
 
}
 
void ADisPatcherChild::TurnLight()
{
     
    if (bIsOn == false) // 불켜기
    {
        UE_LOG(LogTemp, Log, TEXT("TurnOn"));
        PointLightComp->SetIntensity(100000);
        bIsOn = true;
    }
    else// if (bIsOn == true) // 불끄기
    {
        UE_LOG(LogTemp, Log, TEXT("TurnOff"));
        PointLightComp->SetIntensity(1000);
        bIsOn = false;
    }
}
 
void ADisPatcherChild::InitFunction(ADispatcherTest* ParentActor)
{
    ADispatcherTest* ParentIns = Cast<ADispatcherTest>(ParentActor);
    UE_LOG(LogTemp, Log, TEXT("Initted Child"));
     
    //ParentIns->TurnLightDelegatePtr.BindUObject( this , &ADisPatcherChild::TurnLight);
    //ParentIns->TurnLightDelegatePtr.BindUFunction(this, FName("TurnLight"));
    ParentIns->TurnLightDelegatePtr.AddUObject(this, &ADisPatcherChild::TurnLight);
    //ParentIns->TurnLightDelegatePtr.BindUObject(this, &ADisPatcherChild::TurnLight);
     
}

'Unreal > BP & UE Library' 카테고리의 다른 글

Class Name 접두  (0) 2024.05.17
code 내장 함수  (0) 2024.05.17
BP Interface  (0) 2024.05.16
BP node list 1  (0) 2024.05.16
BP Node 리스트  (0) 2024.05.16
  • SK
    • Bones ( hierachy )
      • Name
      • Transform ( Location / Rotation / Scale )
      • float variable
        •  
        • time-bone weight(0~1), bone-bone weight(transform)(1~10), mask(alpha?)(0~1) 값 등 제어하기 위한 듯
    • Virtual Bones : 몰?루 _ IK, retargetting 등 동적으로 구조 혹은 관계 변화/계산 필요할때 참조하기 위한?
      •  
    • Sockets
      • 다른 mesh 혹은 BP에서 접근하기 위한 bone hierachy내의 local transform 값?
  • SKM
    • Bones ( hierachy )
      • name
      • weight ( skin )
        • SK
          • Bones ( hierachy )
            • Name
            • Transform ( Location / Rotation / Scale )
            • float variable
              • time-bone weight(0~1), bone-bone weight(transform)(1~10), mask(alpha?)(0~1) 값 등 제어하기 위한 듯
          • Virtual Bones : 몰?루 _ IK, retargetting 등 동적으로 구조 혹은 관계 변화/계산 필요할때 참조하기 위한?
          • Sockets
            • 다른 mesh 혹은 BP에서 접근하기 위한 bone hierachy내의 local transform 값?
        • SKM
          • Bones ( hierachy )
            • name
            • weight ( skin )

관계도

'Unreal > Animation' 카테고리의 다른 글

UE Animation 구조  (0) 2024.05.20
Skeletal Mesh 모듈화 기능 ( Set Leader Pose Component )  (0) 2024.05.16

+ Recent posts