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
@@ -40,8 +40,10 @@ public class MjSite : MjShapeComponent {
|
||||
|
||||
// Synchronize the state of the component.
|
||||
public override unsafe void OnSyncState(MujocoLib.mjData_* data) {
|
||||
transform.position = MjEngineTool.UnityVector3(data->site_xpos, MujocoId);
|
||||
transform.rotation = MjEngineTool.UnityQuaternionFromMatrix(data->site_xmat, MujocoId);
|
||||
transform.position = MjEngineTool.UnityVector3(
|
||||
MjEngineTool.MjVector3AtEntry(data->site_xpos, MujocoId));
|
||||
transform.rotation = MjEngineTool.UnityQuaternionFromMatrix(
|
||||
MjEngineTool.MjMatrixAtEntry(data->site_xmat, MujocoId));
|
||||
}
|
||||
|
||||
public void OnDrawGizmosSelected() {
|
||||
|
||||
Reference in New Issue
Block a user