Пример #1
0
  public IkConstraint(IkConstraintData data, Skeleton skeleton) {
    this.data = data;
    mix = data.mix;
    bendDirection = data.bendDirection;

    bones = new Array(data.bones.size);
    if (skeleton != null) {
      for (BoneData boneData : data.bones) bones.add(skeleton.findBone(boneData.name));
      target = skeleton.findBone(data.target.name);
    }
  }
 public TransformConstraint(TransformConstraintData data, Skeleton skeleton) {
   if (data == null) throw new IllegalArgumentException("data cannot be null.");
   if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null.");
   this.data = data;
   rotateMix = data.rotateMix;
   translateMix = data.translateMix;
   scaleMix = data.scaleMix;
   shearMix = data.shearMix;
   bones = new Array(data.bones.size);
   for (BoneData boneData : data.bones) bones.add(skeleton.findBone(boneData.name));
   target = skeleton.findBone(data.target.name);
 }