//public List<CIwVec3> Vertices = new List<CIwVec3>(); //public List<Cb4aCollisionMeshSoupEdge> Edges = new List<Cb4aCollisionMeshSoupEdge>(); public override void WrtieBodyToStream(CTextWriter writer) { base.WrtieBodyToStream(writer); writer.WriteKeyVal("num_planes", Planes.Count); foreach (var v in Planes) writer.WriteArray("plane", new int[] { v.v.x, v.v.y, v.v.z,v.k }); //writer.WriteKeyVal("num_vertices", Vertices.Count); //foreach (var v in Vertices) // writer.WriteVec3("v",v); //writer.WriteKeyVal("num_edges", Edges.Count); //foreach (var e in Edges) //{ // CIwVec3 d = e.V1 - e.V0; // writer.BeginWriteLine(); // writer.Write(string.Format(CultureInfo.InvariantCulture, "e {0}",d.Length)); // writer.Write(string.Format(CultureInfo.InvariantCulture, " {{{0},{1},{2}}}", e.V0.x, e.V0.y, e.V0.z)); // writer.Write(string.Format(CultureInfo.InvariantCulture, " {{{0},{1},{2}}}", d.x, d.y, d.z)); // writer.EndWriteLine(); //} writer.WriteKeyVal("num_faces", Faces.Count); foreach (var f in Faces) { writer.WriteArray("face ", new int[] { f.startPlane,f.numPlanes }); //writer.WriteLine("next_face"); //writer.WriteArray("face_p", new int[] { f.Normal.x, f.Normal.y, f.Normal.z, f.Distance }); //writer.WriteKeyVal("num_face_edges", f.edges.Count); //foreach (var e in f.edges) //{ // writer.WriteArray("edge_p", new int[] { e.Normal.x, e.Normal.y, e.Normal.z, e.Distance }); //} } }
public override void WrtieBodyToStream(CTextWriter writer) { base.WrtieBodyToStream(writer); writer.WriteKeyVal("num_planes", Planes.Count); foreach (var v in Planes) writer.WriteArray("plane", new int[] { v.v.x, v.v.y, v.v.z, v.k }); }
public override void WrtieBodyToStream(CTextWriter writer) { base.WrtieBodyToStream(writer); writer.WriteKeyVal("num_materials", Materials.Count); foreach (var l in Materials) { l.WrtieToStream(writer); } if (Planes.Count > 0) { writer.WriteKeyVal("num_planes", Planes.Count); foreach (var l in Planes) { writer.WriteArray("plane", new int[] { (int)l.v.x, (int)l.v.y, (int)l.v.z, (int)(l.k * AirplaySDKMath.IW_GEOM_ONE) }); } } writer.WriteKeyVal("num_vbs", VertexBuffers.Count); foreach (var l in VertexBuffers) { l.WrtieToStream(writer); } writer.WriteKeyVal("num_clusters", subclusters.Count); foreach (var l in subclusters) { l.WrtieToStream(writer); } writer.WriteKeyVal("num_leaves", Leaves.Count); foreach (var l in Leaves) { l.WrtieToStream(writer); } writer.WriteKeyVal("num_nodes", Nodes.Count); foreach (var l in Nodes) { l.WrtieToStream(writer); } writer.WriteKeyVal("num_entities", Entities.Count); foreach (var l in Entities) { l.WrtieToStream(writer); } }