Allow mocap bodies to be loaded by the Unity plugin.
PiperOrigin-RevId: 558735711 Change-Id: Ibc9a81cbf8ec4b979d5b325c822c1bffc1408509
This commit is contained in:
committed by
Copybara-Service
parent
ed4bb2aab5
commit
ef699d4b6d
@@ -19,7 +19,11 @@ using UnityEngine;
|
||||
namespace Mujoco {
|
||||
public class MjMocapBody : MjBaseBody {
|
||||
protected override void OnParseMjcf(XmlElement mjcf) {
|
||||
throw new Exception("parsing mocap bodies isn't supported.");
|
||||
// Transform
|
||||
transform.localPosition =
|
||||
MjEngineTool.UnityVector3(mjcf.GetVector3Attribute("pos", defaultValue: Vector3.zero));
|
||||
transform.localRotation = MjEngineTool.UnityQuaternion(
|
||||
mjcf.GetQuaternionAttribute("quat", defaultValue: MjEngineTool.MjQuaternionIdentity));
|
||||
}
|
||||
|
||||
protected override unsafe void OnBindToRuntime(MujocoLib.mjModel_* model, MujocoLib.mjData_* data) {
|
||||
|
||||
Reference in New Issue
Block a user