public void Load(DataStreamPtr reader) { if (globalVersion == 0) { index = MBOgreUtil.LoadInt32(reader); col = MBOgreUtil.LoadUInt32(reader); // color x vert! as 4 bytes AABBGGRR __norm = MBOgreUtil.LoadPoint3F(reader); ta = MBOgreUtil.LoadPoint2F(reader); ta.Y = 1 - ta.Y; tb = MBOgreUtil.LoadPoint2F(reader); tb.Y = 1 - tb.Y; } else if (globalVersion == 1) { index = MBOgreUtil.LoadInt32(reader); col = MBOgreUtil.LoadUInt32(reader); // color x vert! as 4 bytes AABBGGRR __norm = MBOgreUtil.LoadPoint3F(reader); tang = MBOgreUtil.LoadPoint3F(reader); tangi = MBOgreUtil.LoadByte(reader); ta = MBOgreUtil.LoadPoint2F(reader); ta.Y = 1 - ta.Y; tb = ta; } else if (globalVersion == 2) { index = MBOgreUtil.LoadInt32(reader); col = MBOgreUtil.LoadUInt32(reader); // color x vert! as 4 bytes AABBGGRR __norm = MBOgreUtil.LoadPoint3F(reader); ta = MBOgreUtil.LoadPoint2F(reader); ta.Y = 1 - ta.Y; tb = ta; } }
public void Load(DataStreamPtr reader) { attach = MBOgreUtil.LoadInt32(reader); if (!string.IsNullOrEmpty(MBOgreUtil.LoadStringMaybe(reader, "bone"))) { b = MBOgreUtil.LoadInt32(reader); } x = MBOgreUtil.LoadPoint3F(reader); y = MBOgreUtil.LoadPoint3F(reader); z = MBOgreUtil.LoadPoint3F(reader); t = MBOgreUtil.LoadPoint3F(reader); }
public void Load(DataStreamPtr reader) { findex = MBOgreUtil.LoadInt32(reader); rot = MBOgreUtil.LoadPoint3F(reader); }
public void Load(DataStreamPtr reader, string str = null) { string firstWord = null; if (string.IsNullOrEmpty(str)) { firstWord = MBOgreUtil.LoadString(reader); } else { faces = new List <List <int> >(); firstWord = str; if (firstWord == "manifold") { type = Type.MANIFOLD; MBOgreUtil.LoadVector(reader, ref pos); int k = MBOgreUtil.LoadInt32(reader); for (int i = 0; i < k; i++) { ori = MBOgreUtil.LoadInt32(reader); int h = MBOgreUtil.LoadInt32(reader); List <int> v = new List <int>(); for (int j = 0; j < h; j++) { int pp = MBOgreUtil.LoadInt32(reader); v.Add(pp); } faces.Add(v); } } else if (firstWord == "capsule") { type = Type.CAPSULE; radius = MBOgreUtil.LoadFloat(reader); center = MBOgreUtil.LoadPoint3F(reader); dir = MBOgreUtil.LoadPoint3F(reader); flags = MBOgreUtil.LoadUInt32(reader); } else if (firstWord == "sphere") { type = Type.SPHERE; radius = MBOgreUtil.LoadFloat(reader); center = MBOgreUtil.LoadPoint3F(reader); flags = MBOgreUtil.LoadUInt32(reader); } else if (firstWord == "face") { type = Type.FACE; MBOgreUtil.LoadVector(reader, ref pos); int k = pos.Count; List <int> aface = new List <int>(); for (int i = 0; i < k; i++) { aface.Add(i); } faces.Add(aface); flags = MBOgreUtil.LoadUInt32(reader); } else { Console.WriteLine(string.Format("Unknown body (collision mesh) type `{0}`\n", firstWord)); } } }