public void SetData(NParticle particle) { position = particle.position; velocity = particle.velocity; acceleration = particle.acceleration; netForce = particle.netForce; massInv = particle.massInv; }
public void SetData(NParticle a, NParticle b) { positionA = a.position; positionB = b.position; mass.x = a.mass; mass.y = b.mass; output = Vector3.zero; }
public void Insert(NParticle particle) { if (baseNode == null) { } else if (baseNode.IsExternal()) { } else { } }
private void Awake() { particle = GetComponent <NParticle>(); radius = GetComponent <MeshRenderer>().bounds.size.x * .5f; }
Quadrant(Vector3 center, Vector3 halfWidths, NParticle particle = null) { this.center = center; this.halfWidths = halfWidths; this.particle = particle; }
public void RemoveItem(NParticle particle) { particles.Remove(particle); particleDataBuffer = new ParticleData[particles.Count]; physicsDataBuffer = new PhysicsData[particles.Count * particles.Count]; }
private void SolveGravity(NParticle a, NParticle b) { Vector3 distance = b.position - a.position; a.netForce = (G * a.mass * b.mass * distance.normalized) / Vector3.Dot(distance, distance); }