File size: 858 Bytes
41791c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Collections;
using System.Collections.Generic;
using PhysX5ForUnity;
using Unity.MLAgents;
using UnityEngine;

public class SuctionAgentSoftBody : SuctionAgent
{
    protected override void ResetTissue()
    {
        // If using soft body for tissue
        foreach (PhysxFEMSoftRigidOverlapAttachment attachment in m_softRigidAttachments)
        {
            attachment.enabled = false;
        }
        m_meshGenerator.NumControlPoints = 11;
        Mesh mesh = m_meshGenerator.GenerateMesh();
        ((PhysxFEMSoftBodyActor)m_tissue).ReferenceMesh = mesh;
        m_tissue.Recreate();
        foreach (PhysxFEMSoftRigidOverlapAttachment attachment in m_softRigidAttachments)
        {
            attachment.enabled = true;
        }
    }

    [SerializeField]
    private PhysxFEMSoftRigidOverlapAttachment[] m_softRigidAttachments;
}