//Sets up base body public CharacterPart() { partName = "base"; texture = null; deltaAngle = BodyAngle.zero; }
public float getAngle(BodyAngle angle) { if (angles.ContainsKey(angle)) { return(angles[angle] + baseAngles[angle]); } return(baseAngles[angle]); }
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); }
//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; }
protected float JointAngle(SkeletonData skeleton, BodyAngle joint) { int jointAngleIndex = (int)joint; return(skeleton.jointAng[jointAngleIndex]); }