using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class fingertip_interaction_manager : MonoBehaviour
{
    Vector3 collision_point;
    Vector3 internal_point;
    private double internal_displacement;
    public GameObject cube;


    public double getDisplacement()
    {
        return internal_displacement;
    }

    private void OnTriggerEnter(Collider other)
    {
        collision_point = this.transform.position - cube.transform.position;

    }

    private void OnTriggerStay(Collider other)
    {
        internal_point = this.transform.position - cube.transform.position;
       // Vector3 collision_point_ = collision_point - cube.transform.position;

        internal_displacement = Vector3.Magnitude(collision_point - internal_point);
        print("posizione cubo" + cube.transform.position.ToString("F3") +
        "\t posizione cp" + collision_point.ToString("F3") +
        // "posizione cp_" + collision_point_.ToString("F3")+
        "\t internalPoin" + internal_point.ToString("F3") +
        "\t internal_displacement" + internal_displacement.ToString("F3") 
        );

    }

    private void OnTriggerExit(Collider other)
    {
        internal_displacement = 0f;
    }

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
