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(); } }
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); }
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); }
public void AddChild(CIwResGroup pGroup) { throw new NotImplementedException(); }