// Update is called once per frame public void CFixedUpdate() { transform.position = CVector3.toV3(CVector3.multiply(position, scale)); //Debug.Log(CVector3.distance(position, masses[i].position)); for (int i = 0; i < masses.Count; i++) { if (masses[i] != this) { velocity = CVector3.add( velocity , CVector3.multiply( CVector3.subtract(masses[i].position, position) , ((g * masses[i].mass) / Math.Pow(CVector3.distance(position, masses[i].position), 3)) * timeScale)); } } }
public void C2FixedUpdate() { position = CVector3.add(position, CVector3.multiply(velocity, timeScale)); //cycle++; }