void FixedUpdate() { delta_time += Time.deltaTime; if (frame < nv_data[0].positions.Length) { for (int k = 0; k < body.Length; ++k) { if (body[k] != null) { body[k].transform.localPosition = nv_data[k].positions[frame] / 1000; } else continue; } if (frame < forces_dup.Length) { if (frame >= 1) { float delta_x = (((nv_data[59].positions[frame] - nv_data[59].positions[frame-1]).z)*0.001f); vitesse = delta_x/Time.deltaTime; acceleration = (vitesse-ancienne_vitesse)/Time.deltaTime; ancienne_vitesse = vitesse; indice_3 ++; StreamWriter writer = new StreamWriter ("Masse-fois-Accelerations_FR_5Hz", true); using (writer) { writer.WriteLine(Time.time + "\t" + 80*acceleration + "\t" + forces_dup[indice_3].x); } } } frame++; } }
void FixedUpdate() { delta_time += Time.deltaTime; if (frame < nv_data [0].positions.Length) { if ((frame % 20) == 0) { Debug.Log (frame); for (int k = 0; k < body.Length; ++k) { if (body [k] != null) { body [k].transform.localPosition = nv_data [k].positions [frame] / 1000; } else continue; } if (frame < forces_dup.Length) { if (frame >= 1) { float delta_x = (((nv_data [59].positions [frame] - nv_data [59].positions [frame - 1]).z) * 0.001f); vitesse = delta_x / Time.deltaTime; acceleration = (vitesse - ancienne_vitesse) / Time.deltaTime; ancienne_vitesse = vitesse; indice_3 ++; StreamWriter writer = new StreamWriter ("Masse-fois-Accelerations_FR_5Hz", true); using (writer) { writer.WriteLine (Time.time + "\t" + 80 * acceleration + "\t" + forces_dup [indice_3].x); } } } frame++; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)