Refactor: separate buffer indexing and swizzling.
This also fixes a sensor data reading bug: previously, _sensorIndex was multiplied by 3 by MjEngineTool. PiperOrigin-RevId: 451699887 Change-Id: I864bcbf8159857764854b25311a26ec5672125d9
This commit is contained in:
committed by
Copybara-Service
parent
5cc73c30bf
commit
02f300c762
@@ -159,7 +159,8 @@ namespace Mujoco {
|
||||
MujocoLib.mj_objectVelocity(
|
||||
scene.Model, scene.Data, (int)MujocoLib.mjtObj.mjOBJ_BODY, body.MujocoId, res, 0);
|
||||
// linear velocity is in the last 3 entries
|
||||
bodyVel = MjEngineTool.UnityVector3(res, 1);
|
||||
bodyVel = MjEngineTool.UnityVector3(
|
||||
MjEngineTool.MjVector3AtEntry(res, 1));
|
||||
}
|
||||
|
||||
float springStiffness = 100;
|
||||
|
||||
Reference in New Issue
Block a user