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
@@ -69,8 +69,7 @@ public class MjSiteVectorSensor : MjBaseSensor {
|
||||
}
|
||||
|
||||
public override unsafe void OnSyncState(MujocoLib.mjData_* data) {
|
||||
Vector3 mjReading = new Vector3((float)data->sensordata[_sensorAddress], (float)data->sensordata[_sensorAddress + 1], (float)data->sensordata[_sensorAddress + 2]);
|
||||
SensorReading = MjEngineTool.UnityVector3(mjReading);
|
||||
SensorReading = MjEngineTool.UnityVector3(data->sensordata + _sensorAddress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user