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

Function MjQuatToUe

Source/URLab/Public/MuJoCo/Utils/URLabAxisConv.h:72–82  ·  view source on GitHub ↗

@brief MuJoCo quaternion (wxyz, RHS) -> UE FQuat (xyzw, LHS). */

Source from the content-addressed store, hash-verified

70
71/** @brief MuJoCo quaternion (wxyz, RHS) -> UE FQuat (xyzw, LHS). */
72FORCEINLINE FQuat MjQuatToUe(const double InWXYZ[4])
73{
74 // wxyz -> xyzw + X/Z negate so the resulting LHS quat matches
75 // the converted MjPositionToUe vectors.
76 return FQuat(
77 static_cast<FQuat::FReal>(-InWXYZ[1]),
78 static_cast<FQuat::FReal>(InWXYZ[2]),
79 static_cast<FQuat::FReal>(-InWXYZ[3]),
80 static_cast<FQuat::FReal>(InWXYZ[0]))
81 .GetNormalized();
82}
83
84/** @brief UE FQuat (LHS) -> MuJoCo quaternion (wxyz, RHS). */
85FORCEINLINE void UeQuatToMj(const FQuat& In, double OutWXYZ[4])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected