[UE5] TIL - 22 <UActorComponent vs USceneComponent vs PrimitiveComponents>

ChangJin·2024년 4월 17일
0

Unreal Engine5

목록 보기
50/102
post-thumbnail

2024-04-16

깃허브!
https://github.com/ChangJin-Lee/ARproject
https://github.com/ChangJin-Lee/ToonTank

느낀점
UActorComponent vs USceneComponent vs PrimitiveComponents를 조사해보았다. UActorComponent는 Actor에 부착할 수 있는 class. UActorComponent에 트랜스폼과 attach를 지원하면 USceneComponent. USceneComponent가 렌더링되면 PrimitiveComponents. 굉장히 신기했고 개발을 하면서 Actor에 Component를 부착하는 식으로 많이 만들었는데 해당 부분에 왜 어떤 component를 써야 하는건지 알게되어서 재밌었다.

TIL

  • UActorComponent vs USceneComponent vs PrimitiveComponents

UActorComponent

https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Components/UActorComponent?application_version=5.3


  • ActorComponent is the base class for components that define reusable behavior that can be added to different types of Actors.
  • 다른 타입의 액터에 추가할 수 있는 재사용 가능한 컴포넌트로 정의된 base class이다.
  • 트랜스폼을 가진 ActorComponent는 SceneComponents라고 알려져있다.
  • 그리고 그것들이 렌더링되었다면 PrimitiveComponents라고한다.

  • 공식문서 맨 아래쪽에 가보면 같이 살펴보라고 다음과같이 알려주고 있다.

  • 상당히 많은 class가 ActorComponent를 기초 클래스로 모든 특성을 물려받아 새롭게 작성된 클래스이다.



USceneComponent

  • A SceneComponent has a transform and supports attachment, but has no rendering or collision capabilities.
  • 트랜스폼을 가지고 있고 attachment를 지원한다. 그러나 렌더링되지 않고 충돌관련도 지원하지 않는다.
  • 다른 오프셋들의 계층구조에서 'dummy' 컴포넌트로서 쓰인다.


UPrimitiveComponent

https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Components/UPrimitiveComponent?application_version=5.3

  • PrimitiveComponents are SceneComponents that contain or generate some sort of geometry, generally to be rendered or used as collision data.
  • SceneComponents가 렌더링된 결과이다. 일반적으로 렌더된 결과나 혹은 충돌 정보를 사용하기위해서 쓰인다.
  • geometry에는 다양한 타입의 subclass가 있지만 가장 공통적으로 ShapeComponents, StaticMeshComponent, SkeletalMeshComponent가 있다.

ShapeComponents

  • collision detection 사용을 위해서 geometry를 생성한다.

StaticMeshComponents, SkeletalMeshComponent

  • 반면에 StaticMeshComponents, SkeletalMeshComponent는 렌더된 pre-built geometry를 가진다. 그리고 collision detection을 위해서도 사용된다.


UActorComponent vs USceneComponent vs PrimitiveComponents

최종정리

  • UActorComponent는 Actor 타입의 클래스에 부착할 수 있는 base class이다.

  • USceneComponent는 ActorComponent에서 트랜스폼을 가진 class이다. 그러나 렌더링되지 않았고, 충돌판정도 하지 않는다.

  • PrimitiveComponents는 SceneComponents가 렌더링된 결과라고 보면된다. 즉 렌더링된 결과 혹은 충돌판정을 사용할때 주로 쓴다.

  • UActorComponent가 USceneComponent의 기초 클래스이다. 즉 Inheritance Hierarchy 관계이다.

  • PrimitiveComponents는 UActorComponent가 USceneComponent 어떤 것과도 기초 클래스 같은 개념이 아니라 렌더링된 결과이다.

profile
Unreal Engine 클라이언트 개발자

0개의 댓글