Download data/Assets/Scripts/Learning/Agents/SuctionAgentSoftBody.cs from introvoyz042/CRESSim: direct link, hf CLI and curl.
- Browser
- Download file 858 Bytes
-
https://huggingface.co/datasets/introvoyz042/CRESSim/resolve/main/data/Assets/Scripts/Learning/Agents/SuctionAgentSoftBody.cs
- Command line
-
hf download hf://datasets/introvoyz042/CRESSim/data/Assets/Scripts/Learning/Agents/SuctionAgentSoftBody.cs
-
curl -L -o SuctionAgentSoftBody.cs https://huggingface.co/datasets/introvoyz042/CRESSim/resolve/main/data/Assets/Scripts/Learning/Agents/SuctionAgentSoftBody.cs
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; | |
| } | |
| } | |
| [] | |
| private PhysxFEMSoftRigidOverlapAttachment[] m_softRigidAttachments; | |
| } | |