public void Load(DataStreamPtr reader) { name = MBOgreUtil.LoadString(reader); flags = MBOgreUtil.LoadUInt32(reader); shader = MBOgreUtil.LoadString(reader); diffuseA = MBOgreUtil.LoadString(reader); diffuseB = MBOgreUtil.LoadString(reader); bump = MBOgreUtil.LoadString(reader); enviro = MBOgreUtil.LoadString(reader); spec = MBOgreUtil.LoadStringMaybe(reader, "none"); specular = MBOgreUtil.LoadFloat(reader); r = MBOgreUtil.LoadFloat(reader); g = MBOgreUtil.LoadFloat(reader); b = MBOgreUtil.LoadFloat(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)); } } }
public void Load(DataStreamPtr reader) { vindex = MBOgreUtil.LoadInt32(reader); weight = MBOgreUtil.LoadFloat(reader); }