Exemple #1
0
 protected override void create()
 {
     entity = sceneManager.CreateEntity(Guid.NewGuid().ToString(), meshName);
     entity.SetMaterialName(materialName);
     entNode = sceneManager.RootSceneNode.CreateChildSceneNode();
     entNode.AttachObject(entity);
     entNode.Position = position;
     for (int i = 0; i < entity.NumSubEntities; i++)
     {
         SubEntity subEnt = entity.GetSubEntity((uint)i);
         subEnt.SetMaterialName(materialName);
     }
 }
Exemple #2
0
        public Entity CreateEntityWithMaterial(string name, string entityMeshName, string materialName)
        {
            Entity ent = sceneManager.CreateEntity(name, entityMeshName);

            ent.SetMaterialName(materialName);
            uint subEntNum = ent.NumSubEntities;

            for (uint i = 0; i < subEntNum; i++)
            {
                SubEntity subEnt = ent.GetSubEntity(i);
                subEnt.SetMaterialName(materialName);
            }
            return(ent);
        }
Exemple #3
0
 public void Spawn()
 {
     foreach (var childModel in childModelData)
     {
         mesh.Entity = mesh.SceneManager.CreateEntity(Guid.NewGuid().ToString(), childModel.Mesh);
         mesh.Entity.SetMaterialName(childModel.Material);
         mesh.EntityNode = mesh.SceneManager.RootSceneNode.CreateChildSceneNode();
         mesh.EntityNode.AttachObject(mesh.Entity);
         mesh.EntityNode.Position = position;
         for (int i = 0; i < mesh.Entity.NumSubEntities; i++)
         {
             SubEntity subEnt = mesh.Entity.GetSubEntity((uint)i);
             subEnt.SetMaterialName(childModel.Material);
         }
         entities.Add(mesh.Entity);
     }
 }
Exemple #4
0
        public void Spawn()
        {
            var model = world.ModData.ModelInfos.Where(o => o.ID == lotData.Model.Resource).FirstOrDefault();

            if (model != null)
            {
                mesh.Entity = mesh.SceneManager.CreateEntity(Guid.NewGuid().ToString(), model.Mesh);
                mesh.Entity.SetMaterialName(model.Material);
                mesh.EntityNode = mesh.SceneManager.RootSceneNode.CreateChildSceneNode();
                mesh.EntityNode.AttachObject(mesh.Entity);
                mesh.EntityNode.Position = position;
                for (int i = 0; i < mesh.Entity.NumSubEntities; i++)
                {
                    SubEntity subEnt = mesh.Entity.GetSubEntity((uint)i);
                    subEnt.SetMaterialName(model.Material);
                }
            }
        }