Exemple #1
0
 private void Block(bool bStatic)
 {
     if (m_collider && m_fluid)
     {
         points = m_collider.points;
         int size = points.Length;
         if (size >= 3)
         {
             ray1 = new Ray(transform.TransformPoint(points[0]), Vector3.forward);
             if (m_tempCol.Raycast(ray1, out h1, distance))
             {
                 ray2 = new Ray(transform.TransformPoint(points[1]), Vector3.forward);
                 if (m_tempCol.Raycast(ray2, out h2, distance))
                 {
                     for (int i = 2; i < size; ++i)
                     {
                         ray3 = new Ray(transform.TransformPoint(points[i]), Vector3.forward);
                         if (m_tempCol.Raycast(ray3, out h3, distance))
                         {
                             m_fluid.AddObstacleTriangle(h1.textureCoord, h2.textureCoord, h3.textureCoord, bStatic);
                         }
                         h2 = h3;
                     }
                 }
             }
         }
     }
 }