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

Function ReadVec3

Source/URLab/Public/Bridge/OpHelpers.h:64–79  ·  view source on GitHub ↗

Read a 3-element float array under Key. Falls back to Default * if missing or wrong size. Returns true if the field was present * and well-formed. */

Source from the content-addressed store, hash-verified

62 * if missing or wrong size. Returns true if the field was present
63 * and well-formed. */
64inline bool ReadVec3(const TSharedPtr<FJsonObject>& Obj,
65 const TCHAR* Key,
66 FVector& Out,
67 const FVector& Default)
68{
69 const TArray<TSharedPtr<FJsonValue>>* Arr = nullptr;
70 if (!Obj->TryGetArrayField(Key, Arr) || !Arr || Arr->Num() != 3)
71 {
72 Out = Default;
73 return false;
74 }
75 Out.X = (*Arr)[0]->AsNumber();
76 Out.Y = (*Arr)[1]->AsNumber();
77 Out.Z = (*Arr)[2]->AsNumber();
78 return true;
79}
80
81/** Read a rotation from the request: `rotation_quat` (xyzw) preferred,
82 * fall back to `rotation_euler` (degrees). Returns true if either

Callers 15

HandleSpawnActorFunction · 0.85
HandleSpawnGridFunction · 0.85
HandleSpawnLightFunction · 0.85
HandleSetActorTransformFunction · 0.85
HandleDuplicateActorFunction · 0.85
HandleAddQuickConvertFunction · 0.85
ReadColorFunction · 0.85
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