Repository URL to install this package:
|
Version:
1.0.0 ▾
|
using Mujoco;
using UnityEngine;
namespace Fluctio.FluctioSim.Core.MujocoExtensions.MujocoDataProxy
{
public class FreeJointData : JointData<MjFreeJoint>
{
public FreeJointData(MjFreeJoint component) : base(component) { }
protected override int PosSize => 7;
protected override int DofSize => 6;
public unsafe Vector3 Position
{
get
{
MujocoComponentsExtensions.CheckMjScene();
return MjEngineTool.UnityVector3(PosPointer + PosOffset);
}
set
{
MujocoComponentsExtensions.CheckMjScene();
MjEngineTool.SetMjVector3(PosPointer + PosOffset, value);
}
}
public unsafe Quaternion Rotation
{
get
{
MujocoComponentsExtensions.CheckMjScene();
return MjEngineTool.UnityQuaternion(PosPointer + PosOffset + 3);
}
set
{
MujocoComponentsExtensions.CheckMjScene();
MjEngineTool.SetMjQuaternion(PosPointer + PosOffset + 3, value);
}
}
public unsafe Vector3 LinearVelocity
{
get
{
MujocoComponentsExtensions.CheckMjScene();
return MjEngineTool.UnityVector3(VelPointer + DofOffset);
}
set
{
MujocoComponentsExtensions.CheckMjScene();
MjEngineTool.SetMjVector3(VelPointer + DofOffset, value);
}
}
public unsafe Vector3 AngularVelocity
{
get
{
MujocoComponentsExtensions.CheckMjScene();
return MjEngineTool.UnityVector3(VelPointer + DofOffset + 3);
}
set
{
MujocoComponentsExtensions.CheckMjScene();
MjEngineTool.SetMjVector3(VelPointer + DofOffset + 3, value);
}
}
public unsafe Vector3 LinearAcceleration
{
get
{
MujocoComponentsExtensions.CheckMjScene();
return MjEngineTool.UnityVector3(AccPointer + DofOffset);
}
set
{
MujocoComponentsExtensions.CheckMjScene();
MjEngineTool.SetMjVector3(AccPointer + DofOffset, value);
}
}
public unsafe Vector3 AngularAcceleration
{
get
{
MujocoComponentsExtensions.CheckMjScene();
return MjEngineTool.UnityVector3(AccPointer + DofOffset + 3);
}
set
{
MujocoComponentsExtensions.CheckMjScene();
MjEngineTool.SetMjVector3(AccPointer + DofOffset + 3, value);
}
}
}
}