Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 언리얼 커스텀 플러그인
- UnrealMP
- 백준 1253번
- C++
- hackerank
- 1253번
- 데이터베이스 배움터
- 트랜잭션 관리
- 실습
- oracle
- 오손데이터읽기
- SQL
- 5639
- 언리얼 플러그인
- Linux
- 1967번
- 셰그먼트트리
- command not found
- 2단계로킹
- UActor
- 의미와 무의미의 경계에서
- Security
- 민겸수
- 1759번
- FBX
- objtofbx
- Unreal
- 비재귀셰그먼트
- 백준
- OS
Archives
- Today
- Total
fatalite
언리얼 MoveComponent (작성중) 본문
목적
언리얼의 움직임을 담당하는 MoveComponent와 그 파생 클래스들의 관계와 역할을 알아보자.
소스코드 분석
- Update할 Component의 Object Ptr
/**
* The component we move and update.
* If this is null at startup and bAutoRegisterUpdatedComponent is true, the owning Actor's root component will automatically be set as our UpdatedComponent at startup.
* @see bAutoRegisterUpdatedComponent, SetUpdatedComponent(), UpdatedPrimitive
*/
UPROPERTY(BlueprintReadOnly, Transient, DuplicateTransient, Category=MovementComponent)
TObjectPtr<USceneComponent> UpdatedComponent;
- 해당 컴포넌트의 포인터를 이용해서 Move를 업데이트한다.
/**
* Moves our UpdatedComponent by the given Delta, and sets rotation to NewRotation. Respects the plane constraint, if enabled.
* @note This simply calls the virtual MoveUpdatedComponentImpl() which can be overridden to implement custom behavior.
* @note The overload taking rotation as an FQuat is slightly faster than the version using FRotator (which will be converted to an FQuat).
* @note The 'Teleport' flag is currently always treated as 'None' (not teleporting) when used in an active FScopedMovementUpdate.
* @return True if some movement occurred, false if no movement occurred. Result of any impact will be stored in OutHit.
*/
bool MoveUpdatedComponent(const FVector& Delta, const FQuat& NewRotation, bool bSweep, FHitResult* OutHit = NULL, ETeleportType Teleport = ETeleportType::None);
bool MoveUpdatedComponent(const FVector& Delta, const FRotator& NewRotation, bool bSweep, FHitResult* OutHit = NULL, ETeleportType Teleport = ETeleportType::None);
bool USceneComponent::MoveComponentImpl(const FVector& Delta, const FQuat& NewRotation, bool bSweep, FHitResult* OutHit, EMoveComponentFlags MoveFlags, ETeleportType Teleport)
{
SCOPE_CYCLE_COUNTER(STAT_MoveComponentSceneComponentTime);
// static things can move before they are registered (e.g. immediately after streaming), but not after.
if (!IsValid(this) || CheckStaticMobilityAndWarn(SceneComponentStatics::MobilityWarnText))
{
if (OutHit)
{
*OutHit = FHitResult();
}
return false;
}
// Fill in optional output param. SceneComponent doesn't sweep, so this is just an empty result.
if (OutHit)
{
*OutHit = FHitResult(1.f);
}
ConditionalUpdateComponentToWorld();
// early out for zero case
if( Delta.IsZero() )
{
// Skip if no vector or rotation.
if (NewRotation.Equals(GetComponentTransform().GetRotation(), SCENECOMPONENT_QUAT_TOLERANCE))
{
return true;
}
}
// just teleport, sweep is supported for PrimitiveComponents. This will update child components as well.
const bool bMoved = InternalSetWorldLocationAndRotation(GetComponentLocation() + Delta, NewRotation, false, Teleport);
// Only update overlaps if not deferring updates within a scope
if (bMoved && !IsDeferringMovementUpdates())
{
// need to update overlap detection in case PrimitiveComponents are attached.
UpdateOverlaps();
}
return true;
}
/** Current transform of the component, relative to the world */
FTransform ComponentToWorld;
References
Character Movement Component Architecture | Epic Developer Community (epicgames.com)
'게임 > Unreal' 카테고리의 다른 글
Unreal Custom Plugin 사용법 (0) | 2023.09.12 |
---|---|
언리얼 엔진 프레임 워크 : int main()에서 Begin Play까지 (0) | 2023.08.30 |
Unreal Optimization Overview Reference (0) | 2023.07.10 |
Unreal Optimization - Cull Distance Volume (0) | 2023.07.10 |
Unreal Optimization - GPU Profiling (0) | 2023.07.07 |