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. */
| 62 | * if missing or wrong size. Returns true if the field was present |
| 63 | * and well-formed. */ |
| 64 | inline 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 |
no outgoing calls
no test coverage detected