Examples of Bone


Examples of com.jme3.animation.Bone

        } else if (qName.equals("keyframes")) {
            assert elementStack.peek().equals("track");
        } else if (qName.equals("track")) {
            assert elementStack.peek().equals("tracks");
            String boneName = SAXUtil.parseString(attribs.getValue("bone"));
            Bone bone = nameToBone.get(boneName);
            int index = skeleton.getBoneIndex(bone);
            track = new BoneTrack(index);
        } else if (qName.equals("boneparent")) {
            assert elementStack.peek().equals("bonehierarchy");
            String boneName = attribs.getValue("bone");
            String parentName = attribs.getValue("parent");
            Bone bone = nameToBone.get(boneName);
            Bone parent = nameToBone.get(parentName);
            parent.addChild(bone);
        } else if (qName.equals("bone")) {
            assert elementStack.peek().equals("bones");

            // insert bone into indexed map
            bone = new Bone(attribs.getValue("name"));
            int id = SAXUtil.parseInt(attribs.getValue("id"));
            indexToBone.put(id, bone);
            nameToBone.put(bone.getName(), bone);
        } else if (qName.equals("tracks")) {
            assert elementStack.peek().equals("animation");
View Full Code Here

Examples of com.jme3.animation.Bone

        } else if (qName.equals("bonehierarchy")) {
            Bone[] bones = new Bone[indexToBone.size()];
            // find bones without a parent and attach them to the skeleton
            // also assign the bones to the bonelist
            for (Map.Entry<Integer, Bone> entry : indexToBone.entrySet()) {
                Bone bone = entry.getValue();
                bones[entry.getKey()] = bone;
            }
            indexToBone.clear();
            skeleton = new Skeleton(bones);
        } else if (qName.equals("animation")) {
View Full Code Here

Examples of com.jme3.animation.Bone

     * @return newly created bone
     */
    public Bone buildBone(List<Bone> bones, Long skeletonOwnerOma, BlenderContext blenderContext) {
        this.skeletonOwnerOma = skeletonOwnerOma;
        Long boneOMA = boneStructure.getOldMemoryAddress();
        bone = new Bone(boneName);
        bones.add(bone);
        blenderContext.addLoadedFeatures(boneOMA, boneName, boneStructure, bone);
        ObjectHelper objectHelper = blenderContext.getHelper(ObjectHelper.class);

        Structure skeletonOwnerObjectStructure = (Structure) blenderContext.getLoadedFeature(skeletonOwnerOma, LoadedFeatureDataType.LOADED_STRUCTURE);
View Full Code Here

Examples of net.br410bury.motion.Bone

 
 
  protected void recursiveSegment(int frame, Bone bone, Joint node, GraphicsMatrix global)
  {
    GraphicsMatrix local;
    Bone localbone = new Bone();
   
    local = global.times(node.getTransformation(frame, motion));
    localbone.setStart(local.times(matrixToPoint));
    bone.addEnd(localbone);
    for(Joint child : node.getChildren())
    {
      if(!child.isEndSite()) recursiveSegment(frame, localbone, child, local);
    }
View Full Code Here

Examples of net.br410bury.motion.Bone

    GraphicsMatrix global;
   
    if(rootbone == null) rootbone = new Bone[motion.getFrames()];
    if(rootbone[frame] == null)
    {
      rootbone[frame] = new Bone();

      global = root.getTransformation(frame, motion);
      rootbone[frame].setStart(global.times(matrixToPoint));
      for(Joint child : root.getChildren())
      {
View Full Code Here

Examples of net.br410bury.motion.Bone

    return eye;
  }
 
  protected void drawMotion()
  {
    Bone boneframe;
    GraphicsPoint min;
    GraphicsPoint max;
    GraphicsPoint eye;
    GraphicsPoint center;
    GraphicsPoint up;
   
    if(file.isRead())
    {
      file.segment(frame);
     
      boneframe = file.getSkeleton(frame);
      min = boneframe.getMins();
      max = boneframe.getMaxes();
     
      center = GraphicsPoint.center(min, max);
      eye = calcEye(min, max, center);
      up = new GraphicsPoint(0, 1, 0);
     
View Full Code Here

Examples of org.terasology.rendering.assets.skeletalmesh.Bone

    }

    @Override
    public boolean isValidAnimationFor(SkeletalMesh mesh) {
        for (int i = 0; i < data.getBoneNames().size(); ++i) {
            Bone bone = mesh.getBone(data.getBoneNames().get(i));
            boolean hasParent = data.getBoneParent().get(i) != MeshAnimationData.NO_PARENT;
            if (hasParent && (bone.getParent() == null || !bone.getParent().getName().equals(data.getBoneNames().get(data.getBoneParent().get(i))))) {
                return false;
            } else if (!hasParent && bone.getParent() != null) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

Examples of org.terasology.rendering.assets.skeletalmesh.Bone

            }
            if (null == joint.orientation) {
                throw new ColladaParseException("no joint orientation for joint with element id " + joint.element.id());
            }
            // index argument is not used for anything currently, so we'll just set it to -1
            joint.bone = new Bone(-1, joint.name, joint.position, joint.orientation);
        }

        for (MD5Joint joint : md5JointList) {
            for (MD5Joint childJoint : joint.childList) {
                // We can probably skip unused end nodes
View Full Code Here

Examples of org.terasology.rendering.assets.skeletalmesh.Bone

            MD5 md5 = parse(stream);
            SkeletalMeshDataBuilder skeletonBuilder = new SkeletalMeshDataBuilder();
            List<Bone> bones = Lists.newArrayListWithCapacity(md5.numJoints);
            for (int i = 0; i < md5.numJoints; ++i) {
                MD5Joint joint = md5.joints[i];
                Bone bone = new Bone(i, joint.name, joint.position, joint.orientation);
                bones.add(bone);
                if (joint.parent != -1) {
                    bones.get(joint.parent).addChild(bone);
                }
                skeletonBuilder.addBone(bone);
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.