Пример #1
0
 public bool AddBone(BoneNode joinTo, String name, float angle, float length)
 {
     if (bones.ContainsKey(name))
     {
         return(false);
     }
     else if (bones.ContainsValue(joinTo.Parent))
     {
         Bone bone = new Bone(this, joinTo, length, angle);
         bones.Add(name, bone);
         bone.UpdateBone();
         return(true);
     }
     else if (joinTo == primaryNode)
     {
         Bone bone = new Bone(this, joinTo, length, angle);
         bones.Add(name, bone);
         bone.UpdateBone();
         return(true);
     }
     else
     {
         return(false);
     }
 }
Пример #2
0
 public Bone(Skeleton belongsTo, BoneNode joinTo, float length, float rotation)
 {
     this.belongsTo = belongsTo;
     this.joinedTo  = joinTo;
     this.length    = length;
     this.rootNode  = new BoneNode(this, joinedTo.Position, rotation);
     this.endNode   = new BoneNode(this, new Vector2((float)Math.Sin(angle) * length, (float)Math.Cos(angle) * length), 0);
 }
Пример #3
0
 public Skeleton(Vector2 position)
 {
     this.primaryNode = new BoneNode(null, position, 0);
 }
Пример #4
0
 public void MoveNodeKinematic(BoneNode node, Vector2 position)
 {
 }