Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 3
0
        public static void AddCorrespondingCollision(this UrdfVisual urdfVisual)
        {
            UrdfCollisions collisions = urdfVisual.GetComponentInParent <UrdfLink>().GetComponentInChildren <UrdfCollisions>();

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