コード例 #1
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)
                {
                    UrdfCollision.Create(urdfCollisions.transform, collision);
                }
            }
        }
コード例 #2
0
        public static UrdfLink Create(Transform parent, Link link = null, Joint joint = null)
        {
            GameObject linkObject = new GameObject("link");

            linkObject.transform.SetParentAndAlign(parent);
            UrdfLink urdfLink = linkObject.AddComponent <UrdfLink>();

            UrdfVisuals.Create(linkObject.transform, link?.visuals);
            UrdfCollisions.Create(linkObject.transform, link?.collisions);

            if (link != null)
            {
                urdfLink.ImportLinkData(link, joint);
            }
            else
            {
                UrdfInertial.Create(linkObject);
                EditorGUIUtility.PingObject(linkObject);
            }

            return(urdfLink);
        }
コード例 #3
0
        public void AddCorrespondingCollision()
        {
            UrdfCollisions collisions = GetComponentInParent <UrdfLink>().GetComponentInChildren <UrdfCollisions>();

            UrdfCollision.Create(collisions.transform, geometryType, transform);
        }