UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PhysicsObjectExternalInterface.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
10#include <type_traits>
11
12template<EPhysicsInterfaceScopedLockType LockType>
14{
15public:
16 using InterfaceType = std::conditional_t<LockType == EPhysicsInterfaceScopedLockType::Read, Chaos::FReadPhysicsObjectInterface_External, Chaos::FWritePhysicsObjectInterface_External>;
17
23
26
29
30 InterfaceType& GetInterface() { return Interface; }
31 InterfaceType* operator->() { return &Interface; }
32
33 // The FORCEINLINE gets around some linker issues when trying to call Destroy.
35 {
36 Lock.Release();
37 }
38
39private:
41 InterfaceType Interface;
42};
43
46
#define FORCEINLINE
Definition AndroidPlatform.h:140
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition PhysicsObjectInterface.h:189
Definition PhysicsObjectInterface.h:55
Definition PhysicsObjectInterface.h:114
Definition ChaosScene.h:88
Definition PhysicsObjectExternalInterface.h:14
FLockedPhysicsObjectExternalInterface(FLockedPhysicsObjectExternalInterface &&Other)=default
FORCEINLINE void Release()
Definition PhysicsObjectExternalInterface.h:34
FLockedPhysicsObjectExternalInterface(FChaosScene *Scene, InterfaceType &&InInterface)
Definition PhysicsObjectExternalInterface.h:18
FLockedPhysicsObjectExternalInterface(FLockedPhysicsObjectExternalInterface &Other)=delete
InterfaceType * operator->()
Definition PhysicsObjectExternalInterface.h:31
FLockedPhysicsObjectExternalInterface & operator=(FLockedPhysicsObjectExternalInterface &&Other)=default
InterfaceType & GetInterface()
Definition PhysicsObjectExternalInterface.h:30
FLockedPhysicsObjectExternalInterface & operator=(FLockedPhysicsObjectExternalInterface &Other)=delete
std::conditional_t< LockType==EPhysicsInterfaceScopedLockType::Read, Chaos::FReadPhysicsObjectInterface_External, Chaos::FWritePhysicsObjectInterface_External > InterfaceType
Definition PhysicsObjectExternalInterface.h:16
Definition PhysicsObjectExternalInterface.h:48
static ENGINE_API Chaos::FReadPhysicsObjectInterface_External GetRead_AssumesLocked()
Definition PhysicsObjectExternalInterface.cpp:32
static ENGINE_API FLockedWritePhysicsObjectExternalInterface LockWrite(FChaosScene *Scene)
Definition PhysicsObjectExternalInterface.cpp:22
static ENGINE_API UPrimitiveComponent * GetComponentFromPhysicsObject(UWorld *World, Chaos::FPhysicsObjectHandle PhysicsObject)
Definition PhysicsObjectExternalInterface.cpp:42
static ENGINE_API FLockedReadPhysicsObjectExternalInterface LockRead(FChaosScene *Scene)
Definition PhysicsObjectExternalInterface.cpp:7
static ENGINE_API Chaos::FWritePhysicsObjectInterface_External GetWrite_AssumesLocked()
Definition PhysicsObjectExternalInterface.cpp:37
Definition PhysicsObjectPhysicsCoreInterface.h:11
Definition ArrayView.h:139
Definition World.h:918
Definition PhysicsObjectInternal.h:16
Definition ChaosScopedSceneLock.h:36
ENGINE_API void Release()
Definition ChaosScopedSceneLock.cpp:165