Skip to content

MjXmlUtils

Static utility functions for parsing MuJoCo XML nodes.

Attribute Value
Kind Class

Properties

Public Properties

Property Type Description
bOverride Each reads an attribute by name, sets

bOverride

  • Type: Each reads an attribute by name, sets

Functions

Public Functions

General

Function Returns Description
ParseVector() FVector Parses an FVector from a space-separated string "x y z".
ParseVector2D() FVector2D Parses an FVector2D from a space-separated string "x y".
ParseFloatArray() void Parses a list of floats from a space-separated string.
ParseBool() bool Parses a boolean from an XML attribute ("true"/"false" or "1"/"0").
ReadAttrFloat() bool Read a float attribute. Returns true if present.
ReadAttrDouble() bool Read a double attribute. Returns true if present.
ReadAttrInt() bool Read an int32 attribute. Returns true if present.
ReadAttrFloatArray() bool Read a space-separated float array attribute (partial OK — MuJoCo style). Returns true if present.
ReadAttrBool() bool Read a boolean attribute ("true"/"false"/"1"/"0"). Returns true if present.
ReadAttrString() bool Read a string attribute. Returns true if present (non-empty).
ParseVector

Parses an FVector from a space-separated string "x y z".

  • Signature: ParseVector(const FString& S)
  • Returns: FVector
ParseVector2D

Parses an FVector2D from a space-separated string "x y".

  • Signature: ParseVector2D(const FString& S)
  • Returns: FVector2D
ParseFloatArray

Parses a list of floats from a space-separated string.

  • Signature: ParseFloatArray(const FString& S, TArray<float>& OutArray)
ParseBool

Parses a boolean from an XML attribute ("true"/"false" or "1"/"0").

  • Signature: ParseBool(const FString& S, bool bDefault)
  • Returns: bool
ReadAttrFloat

Read a float attribute. Returns true if present.

  • Signature: ReadAttrFloat(const FXmlNode* Node, const TCHAR* Attr, float& Out, bool& bOverride)
  • Returns: bool
ReadAttrDouble

Read a double attribute. Returns true if present.

  • Signature: ReadAttrDouble(const FXmlNode* Node, const TCHAR* Attr, double& Out, bool& bOverride)
  • Returns: bool
ReadAttrInt

Read an int32 attribute. Returns true if present.

  • Signature: ReadAttrInt(const FXmlNode* Node, const TCHAR* Attr, int32& Out, bool& bOverride)
  • Returns: bool
ReadAttrFloatArray

Read a space-separated float array attribute (partial OK — MuJoCo style). Returns true if present.

  • Signature: ReadAttrFloatArray(const FXmlNode* Node, const TCHAR* Attr, TArray<float>& Out, bool& bOverride)
  • Returns: bool
ReadAttrBool

Read a boolean attribute ("true"/"false"/"1"/"0"). Returns true if present.

  • Signature: ReadAttrBool(const FXmlNode* Node, const TCHAR* Attr, bool& Out, bool& bOverride)
  • Returns: bool
ReadAttrString

Read a string attribute. Returns true if present (non-empty).

  • Signature: ReadAttrString(const FXmlNode* Node, const TCHAR* Attr, FString& Out)
  • Returns: bool