ue4 memo

Terms,

1
2
3
4
5
6
7
8
9
10
11
12
XGE
RHI: Render Hardware Interface
IncrediBuild
fastbuild
反射系统
蓝图系统
UBT: Unreal Build Tool
UHT: Unreal Heading Tool
CDO: Class Default Object
NM: Net Mode
LLM: Low Level Mem
GEngineIni: ThirdPerson01/Saved/Config/Windows/Engine.ini

Apis

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, FString::Printf(TEXT("Hello, %s."), TEXT("Euhat")));
 
TRACE_OBJECT_EVEN
UE_TRACE_CHANNELEXPR_IS_ENABLED(ObjectChannel)
 
FD3D11DynamicRHI::RHIBeginFrame
 
UWorld
	PlayerControllerList
		PlayerController_0
			AGameplayDebuggerCategoryReplicator
	for (ULevel* Level : InWorld->GetLevels())
		Level->Actors
			WorldInfo_0			{AWorldSettings}
			Brush_0				{ABrush}
			LightmassImportanceVolume_0	{ALightmassImportanceVolume}
			AtmosphericFog_1		{AAtmosphericFog}
			SkySphereBlueprint		AActor *
			SphereReflectionCapture		{ASphereReflectionCapture}
			NetworkPlayerStart		{APlayerStart}
			DocumentationActor1		{ADocumentationActor}
			Linear_Stair_StaticMesh		{AStaticMeshActor}
			Bump_StaticMesh			{AStaticMeshActor}
			LeftArm_StaticMesh		{AStaticMeshActor}
			RightArm_StaticMesh		{AStaticMeshActor}
			Ramp_StaticMesh			{AStaticMeshActor}
			CubeMesh_5			{AStaticMeshActor}
			LightSource_0			{ADirectionalLight}
			PostProcessVolume_0		{APostProcessVolume}
			SkyLight_0			{ASkyLight}
			Floor_1				{AStaticMeshActor}
			Wall7_4				{AStaticMeshActor}
			Wall9				{AStaticMeshActor}
			Wall10				{AStaticMeshActor}
			Wall11				{AStaticMeshActor}
			TextRenderActor_1		{ATextRenderActor}
			AMyActor_9			{UE4Editor-ThirdPerson01-0013-Win64-Debug.dll!AAMyActor}
			DefaultPhysicsVolume_0		{ADefaultPhysicsVolume}
			GameplayDebuggerPlayerManager_0	{UE4Editor-GameplayDebugger-Win64-Debug.dll!AGameplayDebuggerPlayerManager}
			ThirdPersonGameMode_C_0		{AGameModeBase}
			GameSession_0			{AGameSession}
			ParticleEventManager_0		{AParticleEventManager}
			GameNetworkManager_0		{AGameNetworkManager}
			ThirdPersonCharacter_167	{ACharacter}
			ThirdPersonExampleMap_C_0	{ALevelScriptActor}
			GameStateBase_0			{AGameStateBase}
			AbstractNavData-Default		{UE4Editor-NavigationSystem-Win64-Debug.dll!AAbstractNavData}
			PlayerController_0		{APlayerController}
			PlayerState_0			{APlayerState}
			PlayerCameraManager_0		{APlayerCameraManager}
			CameraActor_0			{ACameraActor}
			HUD_0				{AHUD}
 
AActor
	RootComponent
	OwnedComponents : TSet<UActorComponent*>
	InstanceComponents 
	Children
 
UActorComponent
	OnRegister
	CreateRenderState
	OnCreatePhysicsState
	OnUnregister
	DestroyRenderState
	OnDestroyPhysicsState
	TickComponent
	PrimaryComponentTick.bCanEverTick
	PrimaryComponentTick.SetTickFunctionEnable(true)
	MarkRenderStateDirty
 
USceneComponent : UActorComponent
	SetupAttachment
	AttachToComponent
 
	FTransform
 
UPrimitiveComponent : USceneComponent
	ShouldCreatePhysicsState
 
	Box Component
	Capsule Component
	Mesh Component
	Skeletal Mesh Component
 
UDrawFrustumComponent : UPrimitiveComponent

stat

1
2
3
stat unit
stat SceneRendering
stat gpu

LineTraceSingle

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void AMyCharacter::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
 
	const float TRACE_LINE_LENGTH = 1000.0f;
	FRotator actorRotator = GetActorRotation();
	const FRotator YawRotation(0, actorRotator.Yaw, 0);
	const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
	FVector lineStartPos = GetActorLocation();
	FVector lineEndPos = lineStartPos + TRACE_LINE_LENGTH * Direction;
	TArray<AActor*> arrayIgnoreActor;
	FHitResult outResult;
	if (UKismetSystemLibrary::LineTraceSingle(GetWorld(), lineStartPos, lineEndPos, 
			ETraceTypeQuery::TraceTypeQuery1, true, arrayIgnoreActor, 
			EDrawDebugTrace::ForDuration, outResult, true, 
			FLinearColor::Red, FLinearColor::Green, 0.1f))
	{
		FString locationString = outResult.Location.ToString();
		UE_LOG111(LogTemp, Error, TEXT("location = %s"), *locationString);
	}
}

refer to:
https://www.cnblogs.com/fjz13/p/5956393.html
https://blog.csdn.net/qq_29523119/article/details/85957072