public static UrdfCollision Create(Transform parent, Link.Collision collision) { GameObject collisionObject = new GameObject("unnamed"); collisionObject.transform.SetParentAndAlign(parent); UrdfCollision urdfCollision = collisionObject.AddComponent <UrdfCollision>(); urdfCollision.geometryType = UrdfGeometry.GetGeometryType(collision.geometry); UrdfGeometryCollision.Create(collisionObject.transform, urdfCollision.geometryType, collision.geometry); UrdfOrigin.ImportOriginData(collisionObject.transform, collision.origin); return(urdfCollision); }
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); }