Пример #1
0
        public static void Create(Transform parent, UrdfGeometry.GeometryTypes type)
        {
            GameObject visualObject = new GameObject("unnamed");

            visualObject.transform.SetParentAndAlign(parent);
            UrdfVisual urdfVisual = visualObject.AddComponent <UrdfVisual>();

            urdfVisual.geometryType = type;
            UrdfGeometryVisual.Create(visualObject.transform, type);

            EditorGUIUtility.PingObject(visualObject);
        }
Пример #2
0
        public static void Create(Transform parent, Link.Visual visual)
        {
            GameObject visualObject = new GameObject(visual.name ?? "unnamed");

            visualObject.transform.SetParentAndAlign(parent);
            UrdfVisual urdfVisual = visualObject.AddComponent <UrdfVisual>();

            urdfVisual.geometryType = UrdfGeometry.GetGeometryType(visual.geometry);
            UrdfGeometryVisual.Create(visualObject.transform, urdfVisual.geometryType, visual.geometry);

            UrdfMaterial.SetUrdfMaterial(visualObject, visual.material);
            UrdfOrigin.ImportOriginData(visualObject.transform, visual.origin);
        }
Пример #3
0
        public static void Create(Transform parent, List <Link.Visual> visuals = null)
        {
            GameObject visualsObject = new GameObject("Visuals");

            visualsObject.transform.SetParentAndAlign(parent);
            UrdfVisuals urdfVisuals = visualsObject.AddComponent <UrdfVisuals>();

            visualsObject.hideFlags = HideFlags.NotEditable;
            urdfVisuals.hideFlags   = HideFlags.None;

            if (visuals != null)
            {
                foreach (Link.Visual visual in visuals)
                {
                    UrdfVisual.Create(urdfVisuals.transform, visual);
                }
            }
        }