Exemple #1
0
        void UpdateClothDeformation(FlexContainer.ParticleData _particleData)
        {
            if (m_deformationTarget && m_actor.handle)
            {
                Matrix4x4 xform = transform.worldToLocalMatrix;
                FlexUtils.UpdateClothVertices(ref m_particles[0], ref m_vertices[0], m_particles.Length,
                                              ref m_actor.indices[0], _particleData.particleData.particles, _particleData.particleData.normals, ref xform,
                                              ref m_meshVertices[0], ref m_meshNormals[0]);

                m_mesh.vertices = m_meshVertices;
                m_mesh.normals  = m_meshNormals;
                m_mesh.RecalculateBounds();
            }
        }