Exemplo n.º 1
0
        //Sets up base body
        public CharacterPart()
        {
            partName = "base";

            texture    = null;
            deltaAngle = BodyAngle.zero;
        }
Exemplo n.º 2
0
        public float getAngle(BodyAngle angle)
        {
            if (angles.ContainsKey(angle))
            {
                return(angles[angle] + baseAngles[angle]);
            }

            return(baseAngles[angle]);
        }
Exemplo n.º 3
0
        protected override void Setup(SukiSchemaInfo info)
        {
            if (info.SchemaMetric != NodeMetric.SingleJointAngle)
            {
                throw new System.Exception("Schema does not match node metric.");
            }
            if (null == info.BodyAngles || info.BodyAngles.Count != 1)
            {
                throw new System.Exception("SingleJointAngleSchema requires one angle.");
            }
            target = info.BodyAngles[0];

            base.Setup(info);
        }
Exemplo n.º 4
0
        //Sets a part rotating about its center
        public CharacterPart(String name, BodyAngle delta, Texture2D img, double depth, Render.TexturePoint point, Vector2 deltaAxis, Vector2 dimentions)
        {
            //Info on part
            partName   = name;
            deltaAngle = delta;
            texture    = img;
            layer      = depth;

            //Position
            size = dimentions;

            //Axis location info
            axis         = deltaAxis;
            axisAngle    = getAngle(axis);
            axisDistance = axis.Length();
            this.point   = point;
        }
Exemplo n.º 5
0
        protected float JointAngle(SkeletonData skeleton, BodyAngle joint)
        {
            int jointAngleIndex = (int)joint;

            return(skeleton.jointAng[jointAngleIndex]);
        }