Example #1
0
    void Start()
    {
        sites    = new List <Point>();
        voronoi  = new FortuneVoronoi();
        chunks   = new List <GameObject>();
        handlers = new List <HapticHandler> ();

        CreateSites(true, false);
        CreateChunks();

        OSCHandler.Instance.Init();         //init OSC
        servers = new Dictionary <string, ServerLog>();

        if (doInitializeNiw)
        {
            OSCHandler.Instance.SendMessageToClient("NiwServer", "/niw/server/config/invert/low/avg/zero", 0);
            OSCHandler.Instance.SendMessageToClient("NiwServer", "/niw/server/push/invert/low/avg/zero/contactdetect", "aggregator/floorcontact");
            OSCHandler.Instance.SendMessageToClient("NiwServer", "/niw/server/config/invert/low", 0.025f);
            OSCHandler.Instance.SendMessageToClient("NiwServer", "/niw/server/config/invert/low/avg/zero/contactdetect", 10000);
        }

        GameObject bubbles = GameObject.Find("Bubbles");

        bubbleGenerator = bubbles.GetComponent <BubbleGenerator> ();
    }
Example #2
0
    void Start()
    {
        sites      = new List <Point>();
        voronoi    = new FortuneVoronoi();
        chunks     = new List <FractureChunk>();
        chunksPool = new Queue <FractureChunk>();

        CreateMap();
    }
Example #3
0
    // Use this for initialization
    void Start()
    {
        _sites = new List <Point>();
        //_bounds = new BoundingRect(){ xmin = 0, ymin = 0, xmax = 100, ymax = 100 };
        _bounds = new BoundingRect()
        {
            xmin = -50, ymin = 0, xmax = 50, ymax = 100
        };
        _voronoi = new FortuneVoronoi();

        Debug.Log("The Bounds: " + _bounds.ToString());
    }
Example #4
0
        void Start()
        {
            AmountOfSites.onSubmit.AddListener(value => numSites = int.Parse(value));
            AmountOfSites.text.text = "" + numSites;

            sites   = new List <Point>();
            voronoi = new FortuneVoronoi();

            CreateSites(true, true, numSites);

            CreateLines();
        }
Example #5
0
    // Use this for initialization
    void Start()
    {
        _sites       = new List <Point>();
        _siteObjects = new List <GameObject>();
        _voronoi     = new FortuneVoronoi();
        _bounds      = new BoundingRect()
        {
            xmin = this.transform.position.x - this.transform.localScale.x / 2,
            ymin = this.transform.position.y - this.transform.localScale.y / 2,
            xmax = this.transform.position.x + this.transform.localScale.x / 2,
            ymax = this.transform.position.y + this.transform.localScale.y / 2
        };

        Debug.Log("The Bounds: " + _bounds.ToString());
    }
    private bool gizmos; // drawing diagram separately

    /*
     * Constructor (can't set up normally since extending MonoBehaviour)
     */
    public void init(Bounds bounds, GameObject fracPiece, GameObject startObj, GameObject piecesContainer,
                     int nSites = 10, bool randSites = false, int relaxIter = 1, bool gizmos = false)
    {
        objectBounds            = bounds;
        this.fracPiece          = fracPiece;
        this.startObj           = startObj;
        this.piecesContainer    = piecesContainer;
        fullRand                = randSites;
        standardRelaxIterations = relaxIter;
        this.nSites             = nSites;
        this.gizmos             = gizmos;

        sites           = new List <Site>();
        fv              = new FortuneVoronoi();
        fracturedPieces = new List <GameObject>();
    }
Example #7
0
 void Start()
 {
     sites   = new List <Point>();
     voronoi = new FortuneVoronoi();
     chunks  = new List <GameObject>();
 }
Example #8
0
 void Start()
 {
     sites   = new List <Point>();
     voronoi = new FortuneVoronoi();
 }