private static void ConvertSETItem(List <COL> newcollist, SETItem item, bool solid, int ind) { NJS_OBJECT obj = new NJS_OBJECT() { Scale = new Vertex(1, 1, 1), Name = item.InternalName + " " + ind }; BasicAttach attach = new BasicAttach(); obj.Attach = attach; foreach (ModelTransform mt in item.GetObjectDefinition().GetModels(item, new MatrixStack())) { MatrixStack transform = new MatrixStack(); transform.LoadMatrix(mt.Transform); ProcessModel(mt.Model.Clone(), transform, attach); } attach.ProcessVertexData(); attach.CalculateBounds(); COL col = new COL() { Model = obj, SurfaceFlags = SurfaceFlags.Visible }; if (solid) { col.SurfaceFlags |= SurfaceFlags.Solid | SurfaceFlags.Unclimbable; } col.CalculateBounds(); ConvertCOL(newcollist, new Dictionary <string, Attach>(), col); }
public void CreateMeshes() { List <Mesh> meshlist = new List <Mesh>(); for (int i = 0; i < WrapZ; i++) { BasicAttach att = GenerateAttach(Primitives[i].Vertices); att.ProcessVertexData(); meshlist.Add(att.CreateD3DMesh()); Bounds = SharpDX.BoundingSphere.Merge(Bounds.ToSharpDX(), att.Bounds.ToSharpDX()).ToSAModel(); // Awkward... } Meshes = meshlist.ToArray(); }