void LayoutHand(BoxView boxView, HandParams handParams, Point center, double radius)
        {
            double width  = handParams.Width * radius;
            double height = handParams.Height * radius;
            double offset = handParams.Offset;

            AbsoluteLayout.SetLayoutBounds(boxView, new Rectangle(center.X - 0.5 * width, center.Y - offset * height, width, height));
            boxView.AnchorY = handParams.Offset;
        }
        void LayoutHand(BoxView boxView, HandParams handParams, Point center, double radius)
        {
            double width = handParams.Width * radius;
            double height = handParams.Height * radius;
            double offset = handParams.Offset;

            AbsoluteLayout.SetLayoutBounds(boxView,
                new Rectangle(center.X - 0.5 * width,
                                center.Y - offset * height,
                                width, height));

            // Set the AnchorY property for rotations.
            boxView.AnchorY = handParams.Offset;
        }
Exemple #3
0
    public Hand(HandParams hparams, float xMult)
    {
        this.hparams = hparams;
        this.xMult   = xMult;

        spheresParent = new GameObject("Hand");
        spheres       = new GameObject[HandParams.JointsNum];
        lineRenderers = new LineRenderer[HandParams.JointsNum];
        foreach (var i in Enumerable.Range(0, HandParams.JointsNum))
        {
            spheres[i] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
            spheres[i].transform.parent     = spheresParent.transform;
            spheres[i].transform.localScale =
                new Vector3(hparams.sphereScale, hparams.sphereScale, hparams.sphereScale);
            lineRenderers[i] = spheres[i].AddComponent <LineRenderer>();
            lineRenderers[i].widthMultiplier = 0.1f;
        }

        waySumQueue = new Queue <float>();
    }