* @brief Overwrite an mjDoubleVec* with the contents of a TArray . * * The mjs spec exposes mjsKey::qpos / qvel / ... as ``mjDoubleVec*`` * (a std::vector * in disguise). The standard write pattern is * ``clear() + push_back per element``; this helper packages that. * Used both by codegen-emitted exports and by URLab's hand-written * freejoint-padding path in MjKeyframe. * * @
| 230 | * @param Src The float source array. Each element is widened to double. |
| 231 | */ |
| 232 | inline void MjSetDoubleVec(mjDoubleVec* Dest, const TArray<float>& Src) |
| 233 | { |
| 234 | if (!Dest) |
| 235 | { |
| 236 | return; |
| 237 | } |
| 238 | Dest->clear(); |
| 239 | for (float V : Src) |
| 240 | { |
| 241 | Dest->push_back(static_cast<double>(V)); |
| 242 | } |
| 243 | } |
no outgoing calls
no test coverage detected