예제 #1
0
    private unsafe void remove()
    {
        Debug.Log(index);
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        if (Physics.Raycast(ray, out raycastHit))
        {
            switch (raycastHit.transform.gameObject.name)
            {
            case "TriangleTopologyVisual":
                break;

            case "QuadTopologyVisual":
                break;

            case "TetrahedraTopologyVisual":
                Debug.Log("triangle index:" + raycastHit.triangleIndex);
                int tetrahedraIndex = Mathf.FloorToInt(raycastHit.triangleIndex / 4);
                Debug.Log("remove:" + tetrahedraIndex);
                SofaPhysicsAPI.RemoveTetrahedra(SofaPhysics.ToChar("TetraModifier"), tetrahedraIndex);
                break;

            default:
                break;
            }
        }
    }
예제 #2
0
 private unsafe void remove1()
 {
     Debug.Log(index);
     SofaPhysicsAPI.RemoveTetrahedra(SofaPhysics.ToChar("TetraModifier"), index);
 }