コード例 #1
0
        public override void OnInspectorGUI()
        {
            urdfCollisions = (UrdfCollisions)target;

            GUILayout.Space(10);
            geometryType = (GeometryTypes)EditorGUILayout.EnumPopup("Type of collision", geometryType);

            if (GUILayout.Button("Add collision"))
            {
                UrdfCollisionExtensions.Create(urdfCollisions.transform, geometryType);
            }
        }
コード例 #2
0
        public static void Create(Transform parent, List <Link.Collision> collisions = null)
        {
            GameObject collisionsObject = new GameObject("Collisions");

            collisionsObject.transform.SetParentAndAlign(parent);
            UrdfCollisions urdfCollisions = collisionsObject.AddComponent <UrdfCollisions>();

            collisionsObject.hideFlags = HideFlags.NotEditable;
            urdfCollisions.hideFlags   = HideFlags.None;

            if (collisions != null)
            {
                foreach (Link.Collision collision in collisions)
                {
                    UrdfCollisionExtensions.Create(urdfCollisions.transform, collision);
                }
            }
        }
コード例 #3
0
        public static void AddCorrespondingCollision(this UrdfVisual urdfVisual)
        {
            UrdfCollisions collisions = urdfVisual.GetComponentInParent <UrdfLink>().GetComponentInChildren <UrdfCollisions>();

            UrdfCollisionExtensions.Create(collisions.transform, urdfVisual.GeometryType, urdfVisual.transform);
        }