This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| /// Implementation for 3D from Gregory Schlomoff's Unity source: http://gregschlom.com/devlog/2014/06/29/Poisson-disc-sampling-Unity.html | |
| /// | |
| /// Usage: | |
| /// PoissonDiskSampler3D sampler = new PoissonDiskSampler3D(10, 5, 7.5f, 0.3f); | |
| /// foreach (Vector3 sample in sampler.Samples()) { | |
| /// // ... do something, like instantiate an object at (sample.x, sample.y, sample.z) for example: |