コード例 #1
0
 void ReleaseResources()
 {
     FFDAPI.SafeDispose(ref m_points); FFDAPI.SafeDispose(ref m_pointsBase);
     FFDAPI.SafeDispose(ref m_normals); FFDAPI.SafeDispose(ref m_normalsBase);
     FFDAPI.SafeDispose(ref m_tangents); FFDAPI.SafeDispose(ref m_tangentsBase);
     FFDAPI.SafeDispose(ref m_weights);
 }
コード例 #2
0
        void ValidateLattice()
        {
            m_s = Mathf.Clamp(m_s, 2, 32);
            m_t = Mathf.Clamp(m_t, 2, 32);
            m_u = Mathf.Clamp(m_u, 2, 32);

            int numPoints = m_s * m_t * m_u;

            if (m_points == null || m_points.Length != numPoints)
            {
                m_points = new Vector3[numPoints];

                var size = GetComponent <Transform>().localScale;

                for (int z = 0; z < m_u; ++z)
                {
                    for (int y = 0; y < m_t; ++y)
                    {
                        for (int x = 0; x < m_s; ++x)
                        {
                        }
                    }
                }

                FFDAPI.SafeDispose(ref m_pinnedPoints);
                m_pinnedPoints = new PinnedList <Vector3>(m_points);
            }
        }
コード例 #3
0
        bool SetupLatticeWeights()
        {
            FFDAPI.SafeDispose(ref m_weights);
            m_weights = new PinnedList <FFDAPI.ffdWeights8>(m_pointsBase.Count);

            FFDAPI.ffdLatticeData        lattice = default(FFDAPI.ffdLatticeData);
            FFDAPI.ffdLatticeWeightsData weights = default(FFDAPI.ffdLatticeWeightsData);
            m_lattice.GetLatticeData(ref lattice);
            weights.weights      = m_weights;
            weights.num_vertices = m_weights.Count;
            FFDAPI.ffdLatticeSetup(ref lattice, ref weights, m_points);
            return(true);
        }