public void RecordCodomain(float time, Vector3 appliedForce, Vector3 appliedTorque, string objname) { DatasetKey key = new DatasetKey(time, objname); codomainMap.Add(key, new List <float> { appliedForce.x, appliedForce.y, appliedForce.z, appliedTorque.x, appliedTorque.y, appliedTorque.z }); }
List <string> testOrderConsistency(float time) { List <string> data = new List <string>(); foreach (string name in rigidbodiesOrder) { DatasetKey key = new DatasetKey(time, name); data.Add(name); data.Add(name); data.Add(name); data.Add(name); data.Add(name); data.Add(name); } return(data); }
List <float> getCodomainByTime(float time) { List <float> data = new List <float>(); foreach (string name in rigidbodiesOrder) { DatasetKey key = new DatasetKey(time, name); List <float> values = new List <float>(); if (codomainMap.TryGetValue(key, out values)) { data.AddRange(values); } else { Debug.LogError("key not found: " + key.timestep + key.gameObjectName); } } return(data); }
public void RecordDomain(float time, Vector3 errorPos, Vector3 errorAngle, Vector3 velocity, Vector3 angularVelo, string objname) { DatasetKey key = new DatasetKey(time, objname); if (domainMap.ContainsKey(key)) { Debug.LogError("Error! set contains key already, missing one insert"); } if (!recordVelocities) { domainMap.Add(key, new List <float> { errorPos.x, errorPos.y, errorPos.z, errorAngle.x, errorAngle.y, errorAngle.z }); } else { domainMap.Add(key, new List <float> { errorPos.x, errorPos.y, errorPos.z, errorAngle.x, errorAngle.y, errorAngle.z, velocity.x, velocity.y, velocity.z, angularVelo.x, angularVelo.y, angularVelo.z }); } }