Exemplo n.º 1
0
 public bool IsConnected(ArmPlanner arm)
 {
     if (getGrasps && Arm != null && Arm == arm && HandObject != null && HandObject == arm.HandObject)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 public void Connect(ArmPlanner arm)
 {
     Arm        = arm;
     HandObject = Arm.HandObject;
     getGrasps  = true;
     SetRegionSizing();
     GetAllGripPoints();
 }
Exemplo n.º 3
0
 public void Disconnect()
 {
     getGrasps          = false;
     Arm                = null;
     HandObject         = null;
     PossibleHoldPoints = null;
     RegionSizing       = 0;
     fingerSpace        = 0;
 }
Exemplo n.º 4
0
        void MouseClickEvent()
        {
            Ray        ray = GetComponent <Camera>().ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit))
            {
                // the object identified by hit.transform was clicked
                // do whatever you want
                //LeftControlRobot.Destination = hit.transform;
                if (hit.transform.GetComponentInParent <ArmPlanner>() != null)
                {
                    m_SelectedArm = hit.transform.GetComponentInParent <ArmPlanner>();
                    //Debug.Log("Selected Arm: " + hit.transform.name);
                }
                else if (m_SelectedArm != null && hit.transform.GetComponent <GraspRegion>() != null)
                {
                    m_SelectedArm.SetNewObject(hit.transform.GetComponent <GraspRegion>());
                    //Debug.Log("Selected Object: " + hit.transform.name);
                }
            }
        }