Exemple #1
0
        public override Wrapper VisitRotate_direction_transform(PreposeGesturesParser.Rotate_direction_transformContext context)
        {
            BodyTransform transform = new BodyTransform();
            var           direction = (Direction)this.Visit(context.direction());
            var           angleText = context.NUMBER().GetText();
            var           angle     = Convert.ToInt32(angleText);

            foreach (var b in context.body_part())
            {
                var converted = (JointGroup)this.Visit(b);
                transform = transform.Compose(
                    converted.Aggregate(j =>
                                        BodyTransformBuilder.RotateTransform(j, angle, direction)));
            }

            return(new Wrapper(transform));
        }
Exemple #2
0
        // this is the rotate action working as a transform
        // this was temporarily changed to make the rotate action work as a restriction as shown blow
        public override Wrapper VisitRotate_direction_transform(PreposeGesturesParser.Rotate_direction_transformContext context)
        {
            var delayed     = new CompositeDelayedStatement();
            var direction   = (Direction)this.Visit(context.direction());
            var degreesText = context.NUMBER().GetText();
            var degrees     = Convert.ToInt32(degreesText);

            foreach (var b in context.body_part())
            {
                var converted = (JointGroup)this.Visit(b);
                delayed = delayed.Compose(
                    converted.Aggregate(joint =>
                                        new CompositeDelayedStatement(
                                            new RotateDelayedStatement(joint, direction, degrees))));
            }

            return(new Wrapper(delayed));
        }