public void HandleInput(Vector3 screenPosition)
    {
        if (jointTrans == null)
        {
            return;
        }
        var worldPos = Camera.main.ScreenToWorldPoint(screenPosition);

        jointTrans.position = CameraPlane.ScreenToWorldPlanePoint(Camera.main, dragDepth, screenPosition);
    }
Beispiel #2
0
    public void HandleInput(Vector3 screenPosition, int touchIndex)
    {
        if (jointTrans == null)
        {
            return;
        }
        Vector3 worldPos  = Camera.main.ScreenToWorldPoint(screenPosition);
        Vector3 targetPos = CameraPlane.ScreenToWorldPlanePoint(Camera.main, dragDepth, screenPosition);

        Debug.LogFormat("targetPos = {0} ; worldPos = {1}", targetPos, worldPos);
        jointTrans[touchIndex].position = worldPos;
    }
Beispiel #3
0
    public void HandleInputBegin(Vector3 screenPosition, int touchIndex)
    {
        var        ray = Camera.main.ScreenPointToRay(screenPosition);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit))
        {
//			if (hit.transform.gameObject.layer == LayerMask.NameToLayer ("Interactive")) {
            dragDepth = CameraPlane.CameraToPointDepth(Camera.main, hit.point);
            Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPosition);
            jointTrans[touchIndex] = AttachJoint(hit.rigidbody, worldPos);
            Vector3 targetPos = CameraPlane.ScreenToWorldPlanePoint(Camera.main, dragDepth, screenPosition);
            Debug.LogFormat("targetPos = {0} ; worldPos = {1}", targetPos, worldPos);
//			}
        }
    }