Package com.esotericsoftware.spine

Examples of com.esotericsoftware.spine.Skeleton


    if (region == null) throw new IllegalStateException("Region has not been set: " + this);
    return region;
  }

  public void updateVertices (Slot slot) {
    Skeleton skeleton = slot.getSkeleton();
    Color skeletonColor = skeleton.getColor();
    Color slotColor = slot.getColor();
    float color = NumberUtils.intToFloatColor( //
      ((int)(255 * skeletonColor.a * slotColor.a) << 24) //
        | ((int)(255 * skeletonColor.b * slotColor.b) << 16) //
        | ((int)(255 * skeletonColor.g * slotColor.g) << 8) //
        | ((int)(255 * skeletonColor.r * slotColor.r)));
    float[] vertices = this.vertices;
    vertices[C1] = color;
    vertices[C2] = color;
    vertices[C3] = color;
    vertices[C4] = color;

    float[] offset = this.offset;
    Bone bone = slot.getBone();
    float x = bone.getWorldX() + skeleton.getX();
    float y = bone.getWorldY() + skeleton.getY();
    float m00 = bone.getM00();
    float m01 = bone.getM01();
    float m10 = bone.getM10();
    float m11 = bone.getM11();
    vertices[X1] = offset[0] * m00 + offset[1] * m01 + x;
View Full Code Here


    if (region == null) throw new IllegalStateException("Region has not been set: " + this);
    return region;
  }

  public void updateWorldVertices (Slot slot, boolean premultipliedAlpha) {
    Skeleton skeleton = slot.getSkeleton();
    Color skeletonColor = skeleton.getColor();
    Color slotColor = slot.getColor();
    Color regionColor = color;
    float a = skeletonColor.a * slotColor.a * regionColor.a * 255;
    float multiplier = premultipliedAlpha ? a : 255;
    float color = NumberUtils.intToFloatColor( //
      ((int)a << 24) //
        | ((int)(skeletonColor.b * slotColor.b * regionColor.b * multiplier) << 16) //
        | ((int)(skeletonColor.g * slotColor.g * regionColor.g * multiplier) << 8) //
        | (int)(skeletonColor.r * slotColor.r * regionColor.r * multiplier));

    float[] vertices = this.vertices;
    float[] offset = this.offset;
    Bone bone = slot.getBone();
    float x = skeleton.getX() + bone.getWorldX(), y = skeleton.getY() + bone.getWorldY();
    float m00 = bone.getM00(), m01 = bone.getM01(), m10 = bone.getM10(), m11 = bone.getM11();
    float offsetX, offsetY;

    offsetX = offset[BRX];
    offsetY = offset[BRY];
View Full Code Here

  public BoundingBoxAttachment (String name) {
    super(name);
  }

  public void computeWorldVertices (Bone bone, float[] worldVertices) {
    Skeleton skeleton = bone.getSkeleton();
    float x = skeleton.getX() + bone.getWorldX(), y = skeleton.getY() + bone.getWorldY();
    float m00 = bone.getM00();
    float m01 = bone.getM01();
    float m10 = bone.getM10();
    float m11 = bone.getM11();
    float[] vertices = this.vertices;
View Full Code Here

      }
    }
  }

  public void updateWorldVertices (Slot slot, boolean premultipliedAlpha) {
    Skeleton skeleton = slot.getSkeleton();
    Color skeletonColor = skeleton.getColor();
    Color meshColor = slot.getColor();
    Color regionColor = color;
    float a = skeletonColor.a * meshColor.a * regionColor.a * 255;
    float multiplier = premultipliedAlpha ? a : 255;
    float color = NumberUtils.intToFloatColor( //
      ((int)a << 24) //
        | ((int)(skeletonColor.b * meshColor.b * regionColor.b * multiplier) << 16) //
        | ((int)(skeletonColor.g * meshColor.g * regionColor.g * multiplier) << 8) //
        | (int)(skeletonColor.r * meshColor.r * regionColor.r * multiplier));

    float[] worldVertices = this.worldVertices;
    float x = skeleton.getX(), y = skeleton.getY();
    Object[] skeletonBones = skeleton.getBones().items;
    float[] weights = this.weights;
    int[] bones = this.bones;

    FloatArray ffdArray = slot.getAttachmentVertices();
    if (ffdArray.size == 0) {
View Full Code Here

      }
    }
  }

  public void updateWorldVertices (Slot slot, boolean premultipliedAlpha) {
    Skeleton skeleton = slot.getSkeleton();
    Color skeletonColor = skeleton.getColor();
    Color slotColor = slot.getColor();
    Color meshColor = color;
    float a = skeletonColor.a * slotColor.a * meshColor.a * 255;
    float multiplier = premultipliedAlpha ? a : 255;
    float color = NumberUtils.intToFloatColor( //
      ((int)a << 24) //
        | ((int)(skeletonColor.b * slotColor.b * meshColor.b * multiplier) << 16) //
        | ((int)(skeletonColor.g * slotColor.g * meshColor.g * multiplier) << 8) //
        | (int)(skeletonColor.r * slotColor.r * meshColor.r * multiplier));

    float[] worldVertices = this.worldVertices;
    FloatArray slotVertices = slot.getAttachmentVertices();
    float[] vertices = this.vertices;
    if (slotVertices.size == vertices.length) vertices = slotVertices.items;
    Bone bone = slot.getBone();
    float x = skeleton.getX() + bone.getWorldX(), y = skeleton.getY() + bone.getWorldY();
    float m00 = bone.getM00(), m01 = bone.getM01(), m10 = bone.getM10(), m11 = bone.getM11();
    for (int v = 0, w = 0, n = worldVertices.length; w < n; v += 2, w += 5) {
      float vx = vertices[v];
      float vy = vertices[v + 1];
      worldVertices[w] = vx * m00 + vy * m01 + x;
View Full Code Here

TOP

Related Classes of com.esotericsoftware.spine.Skeleton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.