Exemplo n.º 1
0
        public void Clear()
        {
            if (_children != null && _children.Length != 0)
            {
                ClearChildren();
            }

            _meshTriangle.ClearTriangle();
            _pool.ReturnTriangle(_meshTriangle);
            _pool         = null;
            _meshTriangle = null;
        }
Exemplo n.º 2
0
        public SmartTriangle(TriangleData triangle, TrianglesPool pool, float minimumArea)
        {
            IsSet            = false;
            _triangle        = triangle;
            _currentVertices = _targetVertices = new TriangleVertices(_triangle);
            _pool            = pool;

            _hasChildren = _targetVertices.GetArea() > minimumArea;
            if (_hasChildren)
            {
                GenerateChildren(minimumArea);
            }
        }
Exemplo n.º 3
0
        public static SmartTriangle[] SubDivideTriangle(TriangleData triangle, TrianglesPool pool, float targetArea)
        {
            var tds = new TriangleData[] { new TriangleData(), new TriangleData(), new TriangleData(), new TriangleData() };

            SubDivideTriangles(ref tds);
            SubDivideVertices(triangle, ref tds);
            SubDivideNormals(triangle, ref tds);
            SubDivideUvs(triangle, ref tds);

            var sts = new SmartTriangle[4];

            for (int i = 0; i < sts.Length; i++)
            {
                sts[i] = new SmartTriangle(tds[i], pool, targetArea);
            }

            return(sts);
        }
Exemplo n.º 4
0
        private void Awake()
        {
            _meshFilter = GetComponent <MeshFilter>();

            _radialController = new TextureController(_meshFilter, _texture, false);
            return;

            _mesh             = _meshFilter.mesh;
            _originalMeshData = new MeshData(_mesh);
            _newMeshData      = new MeshData();
            _trianglesPool    = new TrianglesPool(_newMeshData);

            _meshFilter.mesh.Clear();

            GenerateTriangles();

            ProcessDirection();

            _directionValue = _unfoldDirection.Min;
        }