Exemplo n.º 1
0
    private void ProjectLocalVelocity()
    {
        Vector3 localVelocity = Vector3.zero;

        localVelocity.x = Vector3.Dot(_Car.ProjectedWorldVelocity, _Car.FrictionAxis.right);
        localVelocity.y = Vector3.Dot(_Car.ProjectedWorldVelocity, Vector3.Cross(_Car.FrictionAxis.right, _Car.FrictionAxis.forward));
        localVelocity.z = Vector3.Dot(_Car.ProjectedWorldVelocity, _Car.FrictionAxis.forward);
        _Car.SetLocalVelocity(localVelocity);
    }