Merge pull request #1759 from Balint-H:fix/unity-multi-dof-axes
PiperOrigin-RevId: 653173396 Change-Id: Iedd13dc23ccdd370ba0237bbe278d3bde755bb84
This commit is contained in:
@@ -37,7 +37,14 @@ namespace Mujoco {
|
||||
public MjJointSettings Settings = MjJointSettings.Default;
|
||||
|
||||
// World space rotation axis.
|
||||
public Vector3 RotationAxis => transform.rotation * Vector3.right;
|
||||
public unsafe Vector3 RotationAxis {
|
||||
get {
|
||||
if (MjScene.InstanceExists) {
|
||||
return MjEngineTool.UnityVector3(MjScene.Instance.Data->xaxis + 3 * MujocoId);
|
||||
}
|
||||
return transform.rotation * Vector3.right;
|
||||
}
|
||||
}
|
||||
|
||||
protected override unsafe void OnBindToRuntime(MujocoLib.mjModel_* model, MujocoLib.mjData_* data) {
|
||||
base.OnBindToRuntime(model, data);
|
||||
|
||||
@@ -35,7 +35,14 @@ namespace Mujoco {
|
||||
public MjJointSettings Settings = MjJointSettings.Default;
|
||||
|
||||
// World space slide axis.
|
||||
public Vector3 SlideAxis => transform.rotation * Vector3.right;
|
||||
public unsafe Vector3 SlideAxis {
|
||||
get {
|
||||
if (MjScene.InstanceExists) {
|
||||
return MjEngineTool.UnityVector3(MjScene.Instance.Data->xaxis + 3 * MujocoId);
|
||||
}
|
||||
return transform.rotation * Vector3.right;
|
||||
}
|
||||
}
|
||||
|
||||
protected override unsafe void OnBindToRuntime(MujocoLib.mjModel_* model, MujocoLib.mjData_* data) {
|
||||
base.OnBindToRuntime(model, data);
|
||||
|
||||
Reference in New Issue
Block a user