Exemplo n.º 1
0
    void onARMarkerUpdate(Vector3 pos, Quaternion rot)
    {
        if (markerUpdateCount <= 0)
        {
            return;
        }
        markerUpdateCount--;
        RootID = 0;
        Debug.Log("MarkerPosition:" + pos.ToString());
        Debug.Log("MarkerEulerAngle:" + rot.eulerAngles.ToString());
        var marker_in_world = TransformUtils.GetTMatrix(pos, rot);
        var world_in_marker = Matrix4x4.Inverse(marker_in_world);

        transform.position = TransformUtils.GetPositionFromTMatrix(world_in_marker);
        transform.rotation = TransformUtils.GetRotationFromTMatrix(world_in_marker);
        if (onlyUseEuler_Y)
        {
            transform.eulerAngles = Vector3.up * transform.eulerAngles.y;
        }
    }