CARLA
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Private Types | Private Member Functions | List of all members
carla::multigpu::FrameTime Struct Reference

Frame data packet 25: the primary's clocks and episode settings for one frame. More...

#include <frameTime.h>

Public Member Functions

bool Read (std::istream &in, uint32_t size)
 Reads a payload of size bytes.
 
void Write (std::ostream &out) const
 

Public Attributes

float actor_active_distance = 200000.0f
 
bool adjust_signs_height_to_ground = false
 
float delta_seconds = 0.0f
 The raw DeltaSeconds that UWorld::Tick(N) received, before time dilation and clamping.
 
bool deterministic_ragdolls = true
 
double elapsed_game_time = 0.0
 UCarlaEpisode clocks at the end of frame N.
 
std::optional< double > fixed_delta_seconds
 
uint64_t frame = 0u
 Frame counter of frame N; equal to the frame's FrameCounter packet.
 
bool full_resync = false
 Set on the frame that rebuilds a secondary from scratch (a new or reconnected secondary, or the first frame after a map load).
 
float max_culling_distance = 0.0f
 
double max_substep_delta_time = 0.01
 
int32_t max_substeps = 10
 
bool no_rendering_mode = false
 
uint8_t protocol_version = kMultiGpuProtocolVersion
 
bool spectator_as_ego = true
 
bool substepping = true
 
bool synchronous_mode = false
 The primary's episode settings after frame N (FEpisodeSettings, in UE units).
 
float tile_streaming_distance = 300000.0f
 
float time_dilation = 1.0f
 AWorldSettings::GetEffectiveTimeDilation() of frame N.
 
double visual_game_time = 0.0
 
double world_audio_time_seconds = 0.0
 
double world_real_time_seconds = 0.0
 
double world_time_seconds = 0.0
 UWorld clocks at the start of frame N, before UWorld::Tick adds the delta to them.
 
double world_unpaused_time_seconds = 0.0
 

Static Public Attributes

static constexpr uint8_t kPacketId = 25u
 
static constexpr uint32_t kPayloadSizeV1 = 98u
 Size of the version 1 payload; later versions only append fields.
 

Private Types

enum  Flag : uint8_t {
  kSynchronousMode = 1u << 0u , kFixedDelta = 1u << 1u , kSubstepping = 1u << 2u , kDeterministicRagdolls = 1u << 3u ,
  kSpectatorAsEgo = 1u << 4u , kAdjustSignsHeight = 1u << 5u , kNoRenderingMode = 1u << 6u , kFullResync = 1u << 7u
}
 

Private Member Functions

uint8_t PackFlags () const
 
void UnpackFlags (uint8_t flags)
 

Detailed Description

Frame data packet 25: the primary's clocks and episode settings for one frame.

A secondary plays frame N with exactly this delta and these times, so whatever it computes is stamped and integrated like on the primary.

Definition at line 20 of file frameTime.h.

Member Enumeration Documentation

◆ Flag

enum carla::multigpu::FrameTime::Flag : uint8_t
private
Enumerator
kSynchronousMode 
kFixedDelta 
kSubstepping 
kDeterministicRagdolls 
kSpectatorAsEgo 
kAdjustSignsHeight 
kNoRenderingMode 
kFullResync 

Definition at line 132 of file frameTime.h.

Member Function Documentation

◆ PackFlags()

uint8_t carla::multigpu::FrameTime::PackFlags ( ) const
inlineprivate

◆ Read()

bool carla::multigpu::FrameTime::Read ( std::istream &  in,
uint32_t  size 
)
inline

Reads a payload of size bytes.

Fails (and fails in) on a payload shorter than version 1; bytes beyond the fields known here are left for the packet loop to skip.

Definition at line 93 of file frameTime.h.

References actor_active_distance, delta_seconds, elapsed_game_time, fixed_delta_seconds, frame, kFixedDelta, kPayloadSizeV1, max_culling_distance, max_substep_delta_time, max_substeps, protocol_version, carla::multigpu::BoundedReader::Read(), tile_streaming_distance, time_dilation, UnpackFlags(), visual_game_time, world_audio_time_seconds, world_real_time_seconds, world_time_seconds, and world_unpaused_time_seconds.

Referenced by FFrameData::Read().

◆ UnpackFlags()

void carla::multigpu::FrameTime::UnpackFlags ( uint8_t  flags)
inlineprivate

◆ Write()

void carla::multigpu::FrameTime::Write ( std::ostream &  out) const
inline

Member Data Documentation

◆ actor_active_distance

float carla::multigpu::FrameTime::actor_active_distance = 200000.0f

Definition at line 58 of file frameTime.h.

Referenced by FrameTimeFromSettings(), Read(), SettingsFromFrameTime(), and Write().

◆ adjust_signs_height_to_ground

bool carla::multigpu::FrameTime::adjust_signs_height_to_ground = false

Definition at line 60 of file frameTime.h.

Referenced by FrameTimeFromSettings(), PackFlags(), SettingsFromFrameTime(), and UnpackFlags().

◆ delta_seconds

float carla::multigpu::FrameTime::delta_seconds = 0.0f

The raw DeltaSeconds that UWorld::Tick(N) received, before time dilation and clamping.

Definition at line 34 of file frameTime.h.

Referenced by FCarlaEngine::OnPostTick(), FCarlaEngine::PlayPrimaryFrame(), Read(), and Write().

◆ deterministic_ragdolls

bool carla::multigpu::FrameTime::deterministic_ragdolls = true

Definition at line 56 of file frameTime.h.

Referenced by FrameTimeFromSettings(), PackFlags(), SettingsFromFrameTime(), and UnpackFlags().

◆ elapsed_game_time

double carla::multigpu::FrameTime::elapsed_game_time = 0.0

UCarlaEpisode clocks at the end of frame N.

Definition at line 37 of file frameTime.h.

Referenced by FCarlaEngine::OnPostTick(), FCarlaEngine::PlayPrimaryFrame(), Read(), and Write().

◆ fixed_delta_seconds

std::optional<double> carla::multigpu::FrameTime::fixed_delta_seconds

Definition at line 51 of file frameTime.h.

Referenced by FrameTimeFromSettings(), PackFlags(), Read(), SettingsFromFrameTime(), and Write().

◆ frame

uint64_t carla::multigpu::FrameTime::frame = 0u

Frame counter of frame N; equal to the frame's FrameCounter packet.

Definition at line 30 of file frameTime.h.

Referenced by FCarlaEngine::OnPostTick(), Read(), and Write().

◆ full_resync

bool carla::multigpu::FrameTime::full_resync = false

Set on the frame that rebuilds a secondary from scratch (a new or reconnected secondary, or the first frame after a map load).

Definition at line 67 of file frameTime.h.

Referenced by FCarlaEngine::OnPostTick(), PackFlags(), FCarlaEngine::PlayPrimaryFrame(), and UnpackFlags().

◆ kPacketId

constexpr uint8_t carla::multigpu::FrameTime::kPacketId = 25u
staticconstexpr

Definition at line 22 of file frameTime.h.

Referenced by FFrameData::Read(), and Write().

◆ kPayloadSizeV1

constexpr uint32_t carla::multigpu::FrameTime::kPayloadSizeV1 = 98u
staticconstexpr

Size of the version 1 payload; later versions only append fields.

Definition at line 25 of file frameTime.h.

Referenced by Read(), and Write().

◆ max_culling_distance

float carla::multigpu::FrameTime::max_culling_distance = 0.0f

Definition at line 55 of file frameTime.h.

Referenced by FrameTimeFromSettings(), Read(), SettingsFromFrameTime(), and Write().

◆ max_substep_delta_time

double carla::multigpu::FrameTime::max_substep_delta_time = 0.01

Definition at line 53 of file frameTime.h.

Referenced by FrameTimeFromSettings(), Read(), SettingsFromFrameTime(), and Write().

◆ max_substeps

int32_t carla::multigpu::FrameTime::max_substeps = 10

Definition at line 54 of file frameTime.h.

Referenced by FrameTimeFromSettings(), Read(), SettingsFromFrameTime(), and Write().

◆ no_rendering_mode

bool carla::multigpu::FrameTime::no_rendering_mode = false

Definition at line 50 of file frameTime.h.

Referenced by FrameTimeFromSettings(), PackFlags(), and UnpackFlags().

◆ protocol_version

uint8_t carla::multigpu::FrameTime::protocol_version = kMultiGpuProtocolVersion

Definition at line 27 of file frameTime.h.

Referenced by Read(), and Write().

◆ spectator_as_ego

bool carla::multigpu::FrameTime::spectator_as_ego = true

Definition at line 59 of file frameTime.h.

Referenced by FrameTimeFromSettings(), PackFlags(), SettingsFromFrameTime(), and UnpackFlags().

◆ substepping

bool carla::multigpu::FrameTime::substepping = true

Definition at line 52 of file frameTime.h.

Referenced by FrameTimeFromSettings(), PackFlags(), SettingsFromFrameTime(), and UnpackFlags().

◆ synchronous_mode

bool carla::multigpu::FrameTime::synchronous_mode = false

The primary's episode settings after frame N (FEpisodeSettings, in UE units).

no_rendering_mode is informational: secondaries keep their own.

Definition at line 49 of file frameTime.h.

Referenced by FrameTimeFromSettings(), PackFlags(), SettingsFromFrameTime(), and UnpackFlags().

◆ tile_streaming_distance

float carla::multigpu::FrameTime::tile_streaming_distance = 300000.0f

Definition at line 57 of file frameTime.h.

Referenced by FrameTimeFromSettings(), Read(), SettingsFromFrameTime(), and Write().

◆ time_dilation

float carla::multigpu::FrameTime::time_dilation = 1.0f

AWorldSettings::GetEffectiveTimeDilation() of frame N.

Definition at line 63 of file frameTime.h.

Referenced by FCarlaEngine::OnPostTick(), FCarlaEngine::PlayPrimaryFrame(), Read(), and Write().

◆ visual_game_time

double carla::multigpu::FrameTime::visual_game_time = 0.0

Definition at line 38 of file frameTime.h.

Referenced by FCarlaEngine::OnPostTick(), FCarlaEngine::PlayPrimaryFrame(), Read(), and Write().

◆ world_audio_time_seconds

double carla::multigpu::FrameTime::world_audio_time_seconds = 0.0

Definition at line 45 of file frameTime.h.

Referenced by FCarlaEngine::OnPostTick(), FCarlaEngine::PlayPrimaryFrame(), Read(), and Write().

◆ world_real_time_seconds

double carla::multigpu::FrameTime::world_real_time_seconds = 0.0

Definition at line 44 of file frameTime.h.

Referenced by FCarlaEngine::OnPostTick(), FCarlaEngine::PlayPrimaryFrame(), Read(), and Write().

◆ world_time_seconds

double carla::multigpu::FrameTime::world_time_seconds = 0.0

UWorld clocks at the start of frame N, before UWorld::Tick adds the delta to them.

Definition at line 42 of file frameTime.h.

Referenced by FCarlaEngine::OnPostTick(), FCarlaEngine::PlayPrimaryFrame(), Read(), and Write().

◆ world_unpaused_time_seconds

double carla::multigpu::FrameTime::world_unpaused_time_seconds = 0.0

Definition at line 43 of file frameTime.h.

Referenced by FCarlaEngine::OnPostTick(), FCarlaEngine::PlayPrimaryFrame(), Read(), and Write().


The documentation for this struct was generated from the following file: