UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PhysicsTestHelpers.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "EngineGlobals.h"
6#include "Engine/Engine.h"
7
9{
10 static UWorld* GetWorld()
11 {
12#if WITH_EDITOR
13 if (GIsEditor)
14 {
15 return GWorld;
16 }
17#endif // WITH_EDITOR
18 return GEngine->GetWorldContexts()[0].World();
19 }
20};
ENGINE_API class UEngine * GEngine
Definition UnrealEngine.cpp:427
#define GIsEditor
Definition CoreGlobals.h:233
ENGINE_API class UWorldProxy GWorld
Definition World.cpp:749
const TIndirectArray< FWorldContext > & GetWorldContexts() const
Definition Engine.h:3522
Definition World.h:918
Definition PhysicsTestHelpers.h:9
static UWorld * GetWorld()
Definition PhysicsTestHelpers.h:10