MjOrientationUtils¶
If true, angles (euler, axisangle, joint range) are in degrees.
MuJoCo's upstream default when no meshdir attribute). Empty = same dir as XML. /
FString MeshDir;
/ Base directory for all asset paths (from assetdir attribute). Overrides meshdir for meshes if both present. /
FString AssetDir;
/ If true, joints/tendons with a range attribute are automatically treated as limited (from autolimits). */
bool bAutoLimits = false;
/ Helper: resolve a relative mesh path using MeshDir / AssetDir with the given XML directory as the root. /
FString ResolveMeshPath(const FString& RelPath, const FString& XmlDir) const
{
if (RelPath.IsEmpty())
return RelPath;
// AssetDir takes priority for mesh lookups
FString Base = AssetDir.IsEmpty() ? MeshDir : AssetDir;
if (Base.IsEmpty())
Base = XmlDir;
return FPaths::Combine(Base, RelPath);
}
};
/*
Centralized utility for converting MuJoCo orientation attributes to quaternions.
MuJoCo supports 5 orientation representations on spatial-frame elements:
quat, axisangle, euler, xyaxes, zaxis
Only one should be specified per element. Priority order (matching MuJoCo):
quat > axisangle > euler > xyaxes > zaxis
All functions produce MuJoCo-frame quaternions (w, x, y, z).
Use MjUtils::MjToUERotation() to convert to Unreal frame afterwards.
| Attribute | Value |
|---|---|
| Kind | Class |
Properties¶
Public Properties¶
| Property | Type | Description |
|---|---|---|
Lowercase |
* |
Lowercase¶
- Type: *
Functions¶
Public Functions¶
General¶
| Function | Returns | Description |
|---|---|---|
ParseCompilerSettings() |
FMjCompilerSettings | Parse |
OrientationToMjQuat() |
bool |
Read orientation attributes from an XML element and convert to a MuJoCo-frame quaternion. |
AxisAngleToQuat() |
void | Convert axis-angle (x, y, z, angle_rad) to quaternion. Axis need not be normalized. |
EulerToQuat() |
void | Convert Euler angles to quaternion given a 3-character euler sequence string. |
XYAxesToQuat() |
void | Convert xyaxes (6 values: x-axis 3, y-axis 3) to quaternion. Y is orthogonalized. |
ZAxisToQuat() |
void | Convert zaxis (3 values) to quaternion via minimal rotation from (0,0,1). |
ParseCompilerSettings¶
Parse
settings from an MJCF XML root and extract orientation-related settings.
- Signature:
ParseCompilerSettings(const FXmlNode*RootNode,const FString&XMLDir) - Returns: FMjCompilerSettings
OrientationToMjQuat¶
Read orientation attributes from an XML element and convert to a MuJoCo-frame quaternion.
- Signature:
OrientationToMjQuat(const FXmlNode*Node, const FMjCompilerSettings& Settings,doubleOutQuat[4]) - Returns: bool
AxisAngleToQuat¶
Convert axis-angle (x, y, z, angle_rad) to quaternion. Axis need not be normalized.
- Signature:
AxisAngleToQuat(doublex,doubley,doublez,doubleAngleRad,doubleOutQuat[4])
EulerToQuat¶
Convert Euler angles to quaternion given a 3-character euler sequence string.
- Signature:
EulerToQuat(doublee1,doublee2,doublee3,const FString&EulerSeq,doubleOutQuat[4])
XYAxesToQuat¶
Convert xyaxes (6 values: x-axis 3, y-axis 3) to quaternion. Y is orthogonalized.
- Signature:
XYAxesToQuat(const doubleXYAxes[6],doubleOutQuat[4])
ZAxisToQuat¶
Convert zaxis (3 values) to quaternion via minimal rotation from (0,0,1).
- Signature:
ZAxisToQuat(const doubleZAxis[3],doubleOutQuat[4])