MCPcopy Create free account
hub / github.com/URLab-Sim/UnrealRoboticsLab / ReadTtl

Function ReadTtl

Source/URLabEditor/Private/MjEditorOpHandlers.cpp:1092–1111  ·  view source on GitHub ↗

Translate wire ttl into (bPersistent, LifeTime) pair UE's DrawDebug* * helpers expect. ttl > 0: bPersistent=true, lifetime=ttl (auto-expires). * ttl == -1: bPersistent=true, lifetime=-1 (kept until clear_markers). * ttl == 0 or missing: bPersistent=false, lifetime=-1 (single frame). */

Source from the content-addressed store, hash-verified

1090 * ttl == -1: bPersistent=true, lifetime=-1 (kept until clear_markers).
1091 * ttl == 0 or missing: bPersistent=false, lifetime=-1 (single frame). */
1092void ReadTtl(const TSharedPtr<FJsonObject>& Req, bool& bOutPersistent, float& OutLifetime)
1093{
1094 double Ttl = 0.0;
1095 Req->TryGetNumberField(TEXT("ttl"), Ttl);
1096 if (Ttl > 0.0)
1097 {
1098 bOutPersistent = true;
1099 OutLifetime = (float)Ttl;
1100 }
1101 else if (Ttl < 0.0)
1102 {
1103 bOutPersistent = true;
1104 OutLifetime = -1.0f;
1105 }
1106 else
1107 {
1108 bOutPersistent = false;
1109 OutLifetime = -1.0f;
1110 }
1111}
1112
1113TSharedPtr<FJsonObject> HandleDrawMarker(const TSharedPtr<FJsonObject>& Req)
1114{

Callers 5

HandleDrawMarkerFunction · 0.85
HandleDrawLineFunction · 0.85
HandleDrawBoxFunction · 0.85
HandleDrawArrowFunction · 0.85
HandleDrawAxesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected