コード例 #1
0
ファイル: ModelAdapter.cs プロジェクト: marmalade/bsp4Airplay
 public void Convert(string modelFilePath, string groupFilePath)
 {
     var doc = ModelDocument.Load(modelFilePath);
     var group = new CIwResGroup();
     group.Name = doc.Name;
     Convert(doc, group);
     using (var w = new CTextWriter(groupFilePath))
     {
         group.WrtieToStream(w);
         w.Close();
     }
 }
コード例 #2
0
ファイル: Adapter.cs プロジェクト: marmalade/bsp4Airplay
        public void Convert(BspDocument bsp, CIwResGroup group)
        {
            this.group = group;
            this.level = new Cb4aLevel();
            level.Name = bsp.Name;
            group.AddRes(new CIwTexture() { FilePath = "../textures/checkers.png" });
            group.AddRes(level);
            writer = new LevelVBWriter(level);

            CollectAllLeaves(bsp.Tree);
            CollectAllClusters();
            BuildLightmapAtlas(bsp);
            BuildClusters();

            //level.Materials.Add(new Cb4aLevelMaterial() { Texture="checkers" });

            foreach (var e in bsp.Entities)
            {
                level.Entities.Add(new Cb4aEntity() { classname = e.ClassName, origin = GetVec3(e.Origin), values = e.Values });
            }
            AddLeaves(level);
            if (bsp.Tree != null)
                AddTreeNode(level, bsp.Tree);
        }
コード例 #3
0
ファイル: ModelAdapter.cs プロジェクト: marmalade/bsp4Airplay
        public void Convert(ModelDocument model, CIwResGroup group)
        {
            this.group = group;
            this.modelMesh = new CIwModel();
            modelMesh.Name = model.Name;

            group.AddRes(new CIwTexture() { FilePath = "../textures/checkers.png" });
            group.AddRes(modelMesh);

            var mesh = new CMesh();
            mesh.Scale = 1.0f / scale;
            modelMesh.ModelBlocks.Add(mesh);
            writer = new ModelWriter(modelMesh);

            WriteSkeleton(model);
            WriteMaterials(model);
            //WriteMesh(model.Meshes[1]);
            foreach (var m in model.Meshes)
            {
                WriteMesh(m);
                //break;
            }
            WriteAnimations(model,modelMesh);
        }
コード例 #4
0
ファイル: CIwResGroup.cs プロジェクト: marmalade/bsp4Airplay
 public void AddChild(CIwResGroup pGroup)
 {
     throw new NotImplementedException();
 }