/// <summary>Initializes the struct with default values.</summary> public static D6JointDrive Default() { D6JointDrive value = new D6JointDrive(); value.stiffness = 0f; value.damping = 0f; value.forceLimit = 3.40282347E+38f; value.acceleration = false; return(value); }
/// <inheritdoc/> public override bool Equals(object rhs) { if (rhs is D6JointDrive) { D6JointDrive other = (D6JointDrive)rhs; return(Stiffness == other.Stiffness && Damping == other.Damping && ForceLimit == other.ForceLimit && Acceleration == other.Acceleration); } return(false); }
/// <summary> /// Constructs a new set of GUI elements for inspecting the drive object. /// </summary> /// <param name="drive">Initial values to assign to the GUI elements.</param> /// <param name="layout">Layout to append the GUI elements to.</param> public D6JointDriveGUI(D6JointDrive drive, GUILayout layout) { driveData = drive.Data; stiffnessField.OnChanged += x => { driveData.stiffness = x; MarkAsModified(); }; stiffnessField.OnFocusLost += ConfirmModify; stiffnessField.OnConfirmed += ConfirmModify; dampingField.OnChanged += x => { driveData.damping = x; MarkAsModified(); }; dampingField.OnFocusLost += ConfirmModify; dampingField.OnConfirmed += ConfirmModify; forceLimitField.OnChanged += x => { driveData.forceLimit = x; MarkAsModified(); }; forceLimitField.OnFocusLost += ConfirmModify; forceLimitField.OnConfirmed += ConfirmModify; accelerationField.OnChanged += x => { driveData.acceleration = x; MarkAsModified(); ConfirmModify(); }; layout.AddElement(stiffnessField); layout.AddElement(dampingField); layout.AddElement(forceLimitField); layout.AddElement(accelerationField); }
public void SetDrive(D6JointDriveType type, D6JointDrive drive) { Internal_SetDrive(mCachedPtr, type, drive); }
private static extern void Internal_SetDrive(IntPtr thisPtr, D6JointDriveType type, D6JointDrive drive);
private static extern void Internal_getDrive(IntPtr thisPtr, D6JointDriveType type, out D6JointDrive __output);