Esempio n. 1
0
    public Vector3 MeasureNormalForce()
    {
        Vector3    normalForce = Vector3.zero;
        RaycastHit hit         = rayCaster.GetCollisionData(velocity, 0);

        normalForce = PhysicsCalculator.CalculateNormalForce(velocity, hit);
        return(normalForce);
    }
Esempio n. 2
0
    public Vector3 ProcessVerticalInput()
    {
        RaycastHit hit           = rayCaster.GetCollisionData(Vector3.down, 0.5f);
        Vector3    velocity      = physComp.velocity;
        float      skinWidth     = physComp.skinWidth;
        float      verticalInput = Input.GetAxisRaw("Vertical");

        Vector3 input = new Vector3(0, 0, verticalInput);

        input = Camera.main.transform.rotation * input.normalized;

        input = Vector3.ProjectOnPlane(input, hit.normal);
        input = input.normalized;

        return(input);
    }