Examples of Bone


Examples of com.esotericsoftware.spine.Bone

    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;
    vertices[Y1] = offset[0] * m10 + offset[1] * m11 + y;
    vertices[X2] = offset[2] * m00 + offset[3] * m01 + x;
    vertices[Y2] = offset[2] * m10 + offset[3] * m11 + y;
    vertices[X3] = offset[4] * m00 + offset[5] * m01 + x;
View Full Code Here

Examples of com.esotericsoftware.spine.Bone

    if (ffdArray.size == 0) {
      for (int w = 0, v = 0, b = 0, n = bones.length; v < n; w += 5) {
        float wx = 0, wy = 0;
        int nn = bones[v++] + v;
        for (; v < nn; v++, b += 3) {
          Bone bone = (Bone)skeletonBones[bones[v]];
          float vx = weights[b], vy = weights[b + 1], weight = weights[b + 2];
          wx += (vx * bone.getM00() + vy * bone.getM01() + bone.getWorldX()) * weight;
          wy += (vx * bone.getM10() + vy * bone.getM11() + bone.getWorldY()) * weight;
        }
        worldVertices[w] = wx + x;
        worldVertices[w + 1] = wy + y;
        worldVertices[w + 2] = color;
      }
    } else {
      float[] ffd = ffdArray.items;
      for (int w = 0, v = 0, b = 0, f = 0, n = bones.length; v < n; w += 5) {
        float wx = 0, wy = 0;
        int nn = bones[v++] + v;
        for (; v < nn; v++, b += 3, f += 2) {
          Bone bone = (Bone)skeletonBones[bones[v]];
          float vx = weights[b] + ffd[f], vy = weights[b + 1] + ffd[f + 1], weight = weights[b + 2];
          wx += (vx * bone.getM00() + vy * bone.getM01() + bone.getWorldX()) * weight;
          wy += (vx * bone.getM10() + vy * bone.getM11() + bone.getWorldY()) * weight;
        }
        worldVertices[w] = wx + x;
        worldVertices[w + 1] = wy + y;
        worldVertices[w + 2] = color;
      }
View Full Code Here

Examples of com.esotericsoftware.spine.Bone

    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;
      worldVertices[w + 1] = vx * m10 + vy * m11 + y;
View Full Code Here

Examples of com.esotericsoftware.spine.Bone

        | ((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];
    vertices[X1] = offsetX * m00 + offsetY * m01 + x; // br
View Full Code Here

Examples of com.jme3.animation.Bone

  @Override
  protected void doTimedControlUpdate(float tpf) {
    if(skeleton != null && spatial != null) {
      Vector3f extents = new Vector3f();
          for (int i = 0; i < skeleton.getBoneCount(); i++){
              Bone bone = skeleton.getBone(i);
              Vector3f bonePos = bone.getModelSpacePosition();
              extents.x = Math.max(extents.x, FastMath.abs(bonePos.getX()));
              extents.y = Math.max(extents.y, FastMath.abs(bonePos.getY()));
              extents.z = Math.max(extents.z, FastMath.abs(bonePos.getZ()));
          }
          BoundingBox b = new BoundingBox(new Vector3f(0f,0f,0f), extents.x, extents.y , extents.z);
View Full Code Here

Examples of com.jme3.animation.Bone

    public void updateGeometry() {
        VertexBuffer vb = this.getBuffer(Type.Position);
        FloatBuffer posBuf = this.getFloatBuffer(Type.Position);
        posBuf.clear();
        for (int i = 0; i < skeleton.getBoneCount(); ++i) {
            Bone bone = skeleton.getBone(i);
            Vector3f head = bone.getModelSpacePosition();

            posBuf.put(head.getX()).put(head.getY()).put(head.getZ());
            if (boneLengths != null) {
                Vector3f tail = head.add(bone.getModelSpaceRotation().mult(Vector3f.UNIT_Y.mult(boneLengths.get(i))));
                posBuf.put(tail.getX()).put(tail.getY()).put(tail.getZ());
            }
        }
        posBuf.flip();
        vb.updateData(posBuf);
View Full Code Here

Examples of com.jme3.animation.Bone

    public void updateGeometry() {
        VertexBuffer vb = this.getBuffer(Type.Position);
        FloatBuffer posBuf = this.getFloatBuffer(Type.Position);
        posBuf.clear();
        for (int i = 0; i < skeleton.getBoneCount(); ++i) {
            Bone bone = skeleton.getBone(i);
            Vector3f parentTail = bone.getModelSpacePosition().add(bone.getModelSpaceRotation().mult(Vector3f.UNIT_Y.mult(boneLengths.get(i))));

            for (Bone child : bone.getChildren()) {
                Vector3f childHead = child.getModelSpacePosition();
                Vector3f v = childHead.subtract(parentTail);
                float pointDelta = v.length() / POINT_AMOUNT;
                v.normalizeLocal().multLocal(pointDelta);
                Vector3f pointPosition = parentTail.clone();
View Full Code Here

Examples of com.jme3.animation.Bone

    public void updateGeometry() {
        VertexBuffer vb = this.getBuffer(Type.Position);
        FloatBuffer posBuf = this.getFloatBuffer(Type.Position);
        posBuf.clear();
        for (int i = 0; i < skeleton.getBoneCount(); ++i) {
            Bone bone = skeleton.getBone(i);
            Vector3f head = bone.getModelSpacePosition();

            posBuf.put(head.getX()).put(head.getY()).put(head.getZ());
            if (boneLengths != null) {
                Vector3f tail = head.add(bone.getModelSpaceRotation().mult(Vector3f.UNIT_Y.mult(boneLengths.get(i))));
                posBuf.put(tail.getX()).put(tail.getY()).put(tail.getZ());
            }
        }
        posBuf.flip();
        vb.updateData(posBuf);
View Full Code Here

Examples of com.jme3.animation.Bone

        }

        skeleton = animControl.getSkeleton();
        skeleton.resetAndUpdate();
        for (int i = 0; i < skeleton.getRoots().length; i++) {
            Bone childBone = skeleton.getRoots()[i];
            if (childBone.getParent() == null) {
                logger.log(Level.FINE, "Found root bone in skeleton {0}", skeleton);
                boneRecursion(model, childBone, baseRigidBody, 1, pointsMap);
            }
        }
    }
View Full Code Here

Examples of com.jme3.animation.Bone

            shapeNode.setUserObject(link);
            parentShape = shapeNode;
        }

        for (Iterator<Bone> it = bone.getChildren().iterator(); it.hasNext();) {
            Bone childBone = it.next();
            boneRecursion(model, childBone, parentShape, reccount + 1, pointsMap);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.