| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | using System; |
| | using System.Collections.Generic; |
| | using System.Linq; |
| | using UnityEditor; |
| | using UnityEditor.AnimatedValues; |
| | using UnityEngine; |
| |
|
| | namespace Mujoco { |
| |
|
| | [CustomEditor(typeof(MjSlideJoint))] |
| | public class MjSlideJointEditor : Editor { |
| | private MjSlideJoint _joint; |
| |
|
| | protected virtual void OnEnable() { |
| | _joint = (MjSlideJoint)target; |
| | } |
| |
|
| | protected virtual void OnSceneGUI() { |
| | DrawHandles(_joint); |
| | } |
| |
|
| | |
| | public static void DrawHandles(MjSlideJoint joint) { |
| | |
| | if (joint.Settings.Solver.Limited) { |
| | Handles.color = Color.blue; |
| | MjHandles.LinearLimits(joint.transform.position, joint.RangeLower, joint.RangeUpper, |
| | joint.SlideAxis); |
| | } |
| | Handles.color = Color.yellow; |
| | MjHandles.Axis(joint.transform.position, joint.SlideAxis); |
| | } |
| | } |
| | } |
| |
|