|
CARLA
|
#include <CarlaLightSubsystem.h>
Inheritance diagram for UCarlaLightSubsystem:Public Member Functions | |
| void | Deinitialize () override |
| bool | GetDayNightCycle () const |
| bool | GetDayTimeState (bool &bOutIsDay) const |
| The day/night state last broadcast, if any. | |
| UCarlaLight * | GetLight (int Id) |
| TMap< int, UCarlaLight * > & | GetLights () |
| std::vector< carla::rpc::LightState > | GetLights (FString Client) |
| void | Initialize (FSubsystemCollectionBase &Collection) override |
| bool | IsUpdatePending () const |
| void | NotifyDayTimeChange (bool bIsDay) |
| Broadcast a day/night change and then re-apply the UE4->UE5 component intensity conversion on every registered light. | |
| int32 | NumLights () const |
| void | RegisterLight (UCarlaLight *CarlaLight) |
| void | SetClientStatesdirty (FString ClientThatUpdate) |
| Flag every registered client (except ClientThatUpdate) so their LightManager re-queries light states. | |
| void | SetDayNightCycle (const bool active) |
| void | SetLights (FString Client, std::vector< carla::rpc::LightState > LightsToSet, bool DiscardClient=false) |
| void | UnregisterLight (UCarlaLight *CarlaLight) |
Public Attributes | |
| FDayTimeChanged | DayTimeChangeEvent |
Private Member Functions | |
| void | ScheduleDayTimeState (UCarlaLight *CarlaLight) |
Private Attributes | |
| bool | bDayNightCycle = true |
| bool | bHasDayTimeState = false |
| bool | bLastIsDay = true |
| TMap< FString, bool > | ClientStates |
| TMap< int, UCarlaLight * > | Lights |
| TSet< TWeakObjectPtr< UCarlaLight > > | PendingDayTimeLights |
Definition at line 32 of file CarlaLightSubsystem.h.
|
override |
Definition at line 22 of file CarlaLightSubsystem.cpp.
|
inline |
Definition at line 73 of file CarlaLightSubsystem.h.
Referenced by FFrameData::AddWorldState(), and FFrameData::PlayWorldState().
|
inline |
The day/night state last broadcast, if any.
Definition at line 79 of file CarlaLightSubsystem.h.
Referenced by FFrameData::AddWorldState(), and FFrameData::PlayWorldState().
| UCarlaLight * UCarlaLightSubsystem::GetLight | ( | int | Id | ) |
Definition at line 200 of file CarlaLightSubsystem.cpp.
References Lights.
Referenced by FFrameData::AddWorldState(), FFrameData::ProcessReplayerLightScene(), and CarlaReplayerHelper::ProcessReplayerLightScene().
|
inline |
Definition at line 66 of file CarlaLightSubsystem.h.
| std::vector< carla::rpc::LightState > UCarlaLightSubsystem::GetLights | ( | FString | Client | ) |
Definition at line 155 of file CarlaLightSubsystem.cpp.
References ClientStates, IsValid(), and Lights.
Referenced by ACarlaRecorder::AddExistingActors(), FFrameData::AddWorldState(), ULightDefaultsJsonUtils::ApplyLightDefaultToClassLive(), FCarlaServer::FPimpl::BindActions(), ULightDefaultsJsonUtils::ReapplyLightDefaultsToLevel(), ULightDefaultsJsonUtils::ScanLightAssetsInLevel(), and ULightDefaultsJsonUtils::SetClassActorsSelected().
|
override |
Definition at line 17 of file CarlaLightSubsystem.cpp.
| bool UCarlaLightSubsystem::IsUpdatePending | ( | ) | const |
Definition at line 143 of file CarlaLightSubsystem.cpp.
References ClientStates.
Referenced by FCarlaEngine::OnPostTick().
| void UCarlaLightSubsystem::NotifyDayTimeChange | ( | bool | bIsDay | ) |
Broadcast a day/night change and then re-apply the UE4->UE5 component intensity conversion on every registered light.
Use this instead of broadcasting DayTimeChangeEvent directly: blueprint-bound handlers push raw authored intensities into the light components, undoing any conversion applied earlier in the same broadcast.
Definition at line 109 of file CarlaLightSubsystem.cpp.
References bDayNightCycle, bHasDayTimeState, bLastIsDay, DayTimeChangeEvent, Lights, and SetClientStatesdirty().
Referenced by FFrameData::PlayWorldState(), and AWeather::UpdateStreetLightsForDayNight().
|
inline |
Definition at line 53 of file CarlaLightSubsystem.h.
Referenced by AWeather::UpdateStreetLightsForDayNight().
| void UCarlaLightSubsystem::RegisterLight | ( | UCarlaLight * | CarlaLight | ) |
Definition at line 27 of file CarlaLightSubsystem.cpp.
References bDayNightCycle, bHasDayTimeState, DayTimeChangeEvent, Lights, ScheduleDayTimeState(), and SetClientStatesdirty().
|
private |
Definition at line 68 of file CarlaLightSubsystem.cpp.
References bLastIsDay, IsValid(), Lights, PendingDayTimeLights, and SetClientStatesdirty().
Referenced by RegisterLight().
| void UCarlaLightSubsystem::SetClientStatesdirty | ( | FString | ClientThatUpdate | ) |
Flag every registered client (except ClientThatUpdate) so their LightManager re-queries light states.
Must be called after any server-side state change made outside a client request (day/night broadcast, recorder replay), or clients keep serving stale cached values.
Definition at line 228 of file CarlaLightSubsystem.cpp.
References ClientStates.
Referenced by NotifyDayTimeChange(), CarlaReplayerHelper::ProcessReplayerLightScene(), RegisterLight(), ScheduleDayTimeState(), and UnregisterLight().
| void UCarlaLightSubsystem::SetDayNightCycle | ( | const bool | active | ) |
Definition at line 209 of file CarlaLightSubsystem.cpp.
References bDayNightCycle, and bHasDayTimeState.
Referenced by FCarlaServer::FPimpl::BindActions(), and FFrameData::PlayWorldState().
| void UCarlaLightSubsystem::SetLights | ( | FString | Client, |
| std::vector< carla::rpc::LightState > | LightsToSet, | ||
| bool | DiscardClient = false |
||
| ) |
Definition at line 176 of file CarlaLightSubsystem.cpp.
References ClientStates, and Lights.
Referenced by FCarlaServer::FPimpl::BindActions().
| void UCarlaLightSubsystem::UnregisterLight | ( | UCarlaLight * | CarlaLight | ) |
Definition at line 99 of file CarlaLightSubsystem.cpp.
References DayTimeChangeEvent, Lights, and SetClientStatesdirty().
|
private |
Definition at line 114 of file CarlaLightSubsystem.h.
Referenced by NotifyDayTimeChange(), RegisterLight(), and SetDayNightCycle().
|
private |
Definition at line 111 of file CarlaLightSubsystem.h.
Referenced by NotifyDayTimeChange(), RegisterLight(), and SetDayNightCycle().
|
private |
Definition at line 112 of file CarlaLightSubsystem.h.
Referenced by NotifyDayTimeChange(), and ScheduleDayTimeState().
|
private |
Definition at line 118 of file CarlaLightSubsystem.h.
Referenced by GetLights(), IsUpdatePending(), SetClientStatesdirty(), and SetLights().
| FDayTimeChanged UCarlaLightSubsystem::DayTimeChangeEvent |
Definition at line 86 of file CarlaLightSubsystem.h.
Referenced by NotifyDayTimeChange(), RegisterLight(), and UnregisterLight().
|
private |
Definition at line 107 of file CarlaLightSubsystem.h.
Referenced by GetLight(), GetLights(), NotifyDayTimeChange(), RegisterLight(), ScheduleDayTimeState(), SetLights(), and UnregisterLight().
|
private |
Definition at line 115 of file CarlaLightSubsystem.h.
Referenced by ScheduleDayTimeState().