70 using System.Collections.Generic;
86 public List<float[]> alist=
new List<float[]>();
88 private List<AtomModel> typelist=
new List<AtomModel>();
90 public ArrayList clubLocationalist=
new ArrayList();
91 private ArrayList clubRotationList =
new ArrayList();
92 private string Atoms=
"";
93 private string Clubs=
"";
113 Debug.Log(num0+
"|"+num1);
115 for(
int k=0;k<num0+num1;k++)
124 Atoms+=sonAtoms.Trim();
133 Clubs+=sonClubs.Trim();
137 string [] sArray=Atoms.Split(
'$');
138 Debug.Log(
"length:"+sArray.Length);
139 for(
int i=0;i<sArray.Length-1;i++)
141 if(sArray[i]==
"")
continue;
142 string [] ssArray=sArray[i].Split(
'#');
146 float[] vect=
new float[3];
148 float.TryParse(ssArray[0],out vect[0]);
149 float.TryParse(ssArray[1],out vect[1]);
150 float.TryParse(ssArray[2],out vect[2]);
161 Vector3 minPoint=Vector3.zero;
162 Vector3 maxPoint=Vector3.zero;
178 for(
int i=0; i<alist.Count; i++)
180 float[] position= alist[i] as
float[];
181 minPoint = Vector3.Min(minPoint,
new Vector3(position[0],position[1],position[2]));
182 maxPoint = Vector3.Max(maxPoint,
new Vector3(position[0],position[1],position[2]));
184 Vector3 centerPoint = minPoint + ((maxPoint - minPoint) / 2);
190 for(
int i=0; i<alist.Count; i++)
192 float[] position= alist[i] as
float[];
193 float[] vect=
new float[3];
221 string [] sClubArray=Clubs.Split(
'$');
222 for(
int i=0;i<sClubArray.Length-1;i++)
224 string [] ssClubArray=sClubArray[i].Split(
'#');
225 float[] vect=
new float[3];
226 vect[0]=
float.Parse(ssClubArray[0]);
227 vect[1]=
float.Parse(ssClubArray[1]);
228 vect[2]=
float.Parse(ssClubArray[2]);
229 clubLocationalist.Add(vect);
232 float[] vectRotation=
new float[3];
233 vectRotation[0]=
float.Parse(ssClubArray[3]);
234 vectRotation[1]=
float.Parse(ssClubArray[4]);
237 clubRotationList.Add(vectRotation);
240 Debug.Log(clubRotationList.Count);
259 return clubLocationalist;
265 return clubRotationList;
static AtomModel GetModel(string type)
static void Send(short data)
List< AtomModel > getTypes()
static Vector3 Offset
The offset for the molecule.
static List< int[]> CreateBondsEPList(List< float[]> atomsLocationlist, List< AtomModel > atomsTypelist)
ArrayList getClubRotation()
List< float[]> getAtoms()
static List< AtomModel > atomsTypelist
The type of each atom.
static List< float[]> atomsSugarLocationlist
ArrayList getClubLocation()
static Vector3 cameraLocation
static List< AtomModel > atomsSugarTypelist
static List< int[]> bondEPSugarList
static List< int[]> bondEPList
The bonds between atoms.
static string ReceiveString(int length)
static List< float[]> atomsLocationlist
The coordinates of each atom.