Esempio n. 1
0
        public static Link.Collision ExportCollisionData(this UrdfCollision urdfCollision)
        {
            UrdfGeometry.CheckForUrdfCompatibility(urdfCollision.transform, urdfCollision.geometryType);

            Link.Geometry geometry      = UrdfGeometry.ExportGeometryData(urdfCollision.geometryType, urdfCollision.transform, true);
            string        collisionName = urdfCollision.name == "unnamed" ? null : urdfCollision.name;

            return(new Link.Collision(geometry, collisionName, UrdfOrigin.ExportOriginData(urdfCollision.transform)));
        }
        public static Link.Visual ExportVisualData(this UrdfVisual urdfVisual)
        {
            UrdfGeometry.CheckForUrdfCompatibility(urdfVisual.transform, urdfVisual.geometryType);

            Link.Geometry geometry = UrdfGeometry.ExportGeometryData(urdfVisual.geometryType, urdfVisual.transform);

            Link.Visual.Material material = null;
            if ((geometry.mesh != null))
            {
                material = UrdfMaterial.ExportMaterialData(urdfVisual.GetComponentInChildren <MeshRenderer>().sharedMaterial);
            }
            string visualName = urdfVisual.name == "unnamed" ? null : urdfVisual.name;

            return(new Link.Visual(geometry, visualName, UrdfOrigin.ExportOriginData(urdfVisual.transform), material));
        }