CRESSim / data /Assets /Scripts /Learning /Agents /SuctionAgentSoftBody.cs
introvoyz042's picture
Migrated from GitHub
41791c1 verified
Raw History Blame Contribute Delete
858 Bytes
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;
}