public void AddObjectsForMeshes(Mesh[] meshes, DoubleVector3 originECEF, string materialName)
        {
            var id          = meshes[0].name;
            var material    = m_materialRepository.LoadOrCreateMaterial(id, materialName);
            var gameObjects = m_gameObjectCreator.CreateGameObjects(meshes, material, m_collisions);

            m_gameObjectRepository.Add(id, originECEF, gameObjects);
        }
Ejemplo n.º 2
0
        public GameObject[] AddObjectsForMeshes(string objectID, Mesh[] meshes, DoubleVector3 originECEF, Vector3 translationOffsetECEF, Quaternion rotationECEF, string materialName)
        {
            if (m_gameObjectRepository.Contains(objectID))
            {
                return(null);
            }

            var material = m_materialRepository.LoadOrCreateMaterial(objectID, materialName);
            var parent   = new GameObject(objectID);

            parent.transform.SetParent(m_gameObjectRepository.Root.transform, false);
            var gameObjects = m_gameObjectCreator.CreateGameObjects(meshes, material, parent.transform, m_collisions);

            m_gameObjectRepository.Add(objectID, originECEF, translationOffsetECEF, rotationECEF, parent);

            return(gameObjects);
        }