Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }