Exemplo n.º 1
0
        public static String FindMeshName(SimObject simObject)
        {
            String name = null;

            foreach (var element in simObject.getElementIter())
            {
                SceneNodeElement sceneElement = element as SceneNodeElement;
                if (sceneElement != null)
                {
                    foreach (var movable in sceneElement.MovableObjects)
                    {
                        Entity entity = movable as Entity;
                        if (entity != null)
                        {
                            using (MeshPtr mesh = entity.getMesh())
                            {
                                String meshName = mesh.Value.getName();
                                if (meshName != null)
                                {
                                    name = Path.GetFileNameWithoutExtension(meshName);
                                    break;
                                }
                            }
                        }
                    }
                    break;
                }
            }
            return(name);
        }