게임엔진/Unreal

[Unreal] 충돌 관련 함수

ShovelingLife 2022. 5. 27. 21:06
/**
 * Delegate for notification of blocking collision against a specific component.  
 * NormalImpulse will be filled in for physics-simulating bodies, but will be zero for swept-component blocking collisions. 
 */
DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_FiveParams( FComponentHitSignature, UPrimitiveComponent, OnComponentHit, UPrimitiveComponent*, HitComponent, AActor*, OtherActor, UPrimitiveComponent*, OtherComp, FVector, NormalImpulse, const FHitResult&, Hit );

/** Delegate for notification of start of overlap with a specific component */
DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_SixParams( FComponentBeginOverlapSignature, UPrimitiveComponent, OnComponentBeginOverlap, UPrimitiveComponent*, OverlappedComponent,AActor*,OtherActor, UPrimitiveComponent*, OtherComp, int32, OtherBodyIndex, bool, bFromSweep, const FHitResult &, SweepResult);

/** Delegate for notification of end of overlap with a specific component */
DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_FourParams( FComponentEndOverlapSignature,UPrimitiveComponent, OnComponentEndOverlap, UPrimitiveComponent*, OverlappedComponent, AActor*, OtherActor, UPrimitiveComponent*,OtherComp, int32, OtherBodyIndex);

/** Delegate for notification when a wake event is fired by physics*/
DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_TwoParams(FComponentWakeSignature, UPrimitiveComponent, OnComponentWake, UPrimitiveComponent*,WakingComponent, FName, BoneName);

/** Delegate for notification when a sleep event is fired by physics*/
DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_TwoParams(FComponentSleepSignature, UPrimitiveComponent, OnComponentSleep, UPrimitiveComponent*, SleepingComponent, FName, BoneName);

/** Delegate for notification when collision settings change. */
DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_OneParam(FComponentCollisionSettingsChangedSignature, UPrimitiveComponent, OnComponentCollisionSettingsChangedEvent, UPrimitiveComponent*, ChangedComponent);

아래 충돌체 컴포넌트라 하면 예) 박스 콜라이더 UBoxComponent, 원형 콜라이더 USphereComponent

충돌 이벤트 활성화/비활성화

충돌체 컴포넌트->SetNotifyRigidBodyCollision 
또는
충돌체 컴포넌트->BodyInstance.bNotifyRigidBodyCollision

오버랩 이벤트 활성화/비활성화 

충돌체 컴포넌트->SetGenerateOverlapEvents

루트 컴포넌트 충돌 관련 https://devshovelinglife.tistory.com/138

 

UE Root Component 루트 컴포넌트

루트 컴포넌트는 충돌 인식과 월드 스페이스에서 오브젝트의 위치를 결정하고 항상 충돌을 탐지하는 컴포넌트(메쉬(Skeletal, Static) , 충돌체)여야 한다. 메쉬 컴포넌트를 설정했을 시 Mobility라는

devshovelinglife.tistory.com

 

함수 바인딩 방법 : https://devshovelinglife.tistory.com/15

 

UE 언리얼 충돌체 관련 함수와 이벤트(델리게이트) 바인딩 방법 #2

언리얼 엔진에선 두 가지의 충돌체가 존재한다. 하나는 메쉬(static 또는 skeletal)의 충돌체 그리고 충돌 컴포넌트(SphereComponent,BoxComponent 기타 등등). C++로 충돌체 이벤트 바인딩할 수 있는 방법 총

devshovelinglife.tistory.com