public static Vector3 ToVector3(string str, char separator) { SysUtil.Assert(str != null, "null str to vector3"); string[] vals = str.Split(separator); SysUtil.Assert(vals.Length == 3, "bad format str \"" + str + "\" to vector3"); Vector3 vec; vec.x = Convert.ToSingle(vals[0]); vec.y = Convert.ToSingle(vals[1]); vec.z = Convert.ToSingle(vals[2]); return(vec); }
public static Quaternion ToQuaternion(string str) { SysUtil.Assert(str != null, "null str to quaternion"); string[] vals = str.Split(','); SysUtil.Assert(vals.Length == 4, "bad format str \"" + str + "\" to quaternion"); Quaternion quat = new Quaternion(); quat.x = Convert.ToSingle(vals[0]); quat.y = Convert.ToSingle(vals[1]); quat.z = Convert.ToSingle(vals[2]); quat.z = Convert.ToSingle(vals[3]); return(quat); }
public bool Create(string path) { _name = Path.GetFileName(path); _finalName = string.Empty; Size = (int)EngineFileUtil.GetFileLength(path); MD5 = string.Empty; FileStream fs = new FileStream(path, FileMode.Open); if (null != fs) { MD5 = SysUtil.GetMD5Str(fs); fs.Close(); } if (MD5 == string.Empty) { return(false); } return(true); }