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

Function MjSetDoubleVec

Source/URLab/Public/MuJoCo/Utils/MjUtils.h:232–243  ·  view source on GitHub ↗

* @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. * * @

Source from the content-addressed store, hash-verified

230 * @param Src The float source array. Each element is widened to double.
231 */
232inline 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}

Callers 2

ExportToMethod · 0.85
RegisterToSpecMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected