Tabnine Logo
Skeleton.getBoneIndex
Code IndexAdd Tabnine to your IDE (free)

How to use
getBoneIndex
method
in
com.jme3.animation.Skeleton

Best Java code snippets using com.jme3.animation.Skeleton.getBoneIndex (Showing top 20 results out of 315)

origin: jMonkeyEngine/jmonkeyengine

public void setSkeleton(Skeleton skeleton) {
  if(bone != null)
    boneIndex = skeleton.getBoneIndex(bone);
}

origin: jMonkeyEngine/jmonkeyengine

  /**
   * The method writes the indexes for the connection vertices. Used in non-length mode.
   * @param indexBuf
   *            the index buffer
   * @param bone
   *            the bone
   */
  private void writeConnections(ShortBuffer indexBuf, Bone bone) {
    for (Bone child : bone.getChildren()) {
      // write myself
      indexBuf.put((short) skeleton.getBoneIndex(bone));
      // write the child
      indexBuf.put((short) skeleton.getBoneIndex(child));

      this.writeConnections(indexBuf, child);
    }
  }
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Enumerate the bone indices of the specified bone and all its descendents.
 *
 * @param bone the input bone (not null)
 * @param skeleton the skeleton containing the bone (not null)
 * @param boneList a set of bone names (not null, unaffected)
 *
 * @return a new list (not null)
 */
public static List<Integer> getBoneIndices(Bone bone, Skeleton skeleton, Set<String> boneList) {
  List<Integer> list = new LinkedList<Integer>();
  if (boneList.isEmpty()) {
    list.add(skeleton.getBoneIndex(bone));
  } else {
    list.add(skeleton.getBoneIndex(bone));
    for (Bone chilBone : bone.getChildren()) {
      if (!boneList.contains(chilBone.getName())) {
        list.addAll(getBoneIndices(chilBone, skeleton, boneList));
      }
    }
  }
  return list;
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Enumerate the bone indices of the specified bone and all its descendents.
 *
 * @param bone the input bone (not null)
 * @param skeleton the skeleton containing the bone (not null)
 * @param boneList a set of bone names (not null, unaffected)
 *
 * @return a new list (not null)
 */
public static List<Integer> getBoneIndices(Bone bone, Skeleton skeleton, Set<String> boneList) {
  List<Integer> list = new LinkedList<Integer>();
  if (boneList.isEmpty()) {
    list.add(skeleton.getBoneIndex(bone));
  } else {
    list.add(skeleton.getBoneIndex(bone));
    for (Bone chilBone : bone.getChildren()) {
      if (!boneList.contains(chilBone.getName())) {
        list.addAll(getBoneIndices(chilBone, skeleton, boneList));
      }
    }
  }
  return list;
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Add a single bone to be influenced by this animation channel.
 */
public void addBone(Bone bone) {
  int boneIndex = control.getSkeleton().getBoneIndex(bone);
  if(affectedBones == null) {
    affectedBones = new BitSet(control.getSkeleton().getBoneCount());
  }
  affectedBones.set(boneIndex);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Converts the action into JME bone animation tracks.
 * 
 * @param skeleton
 *            the skeleton that will be animated
 * @return the bone tracks for the node
 */
public BoneTrack[] toTracks(Skeleton skeleton, BlenderContext blenderContext) {
  List<BoneTrack> tracks = new ArrayList<BoneTrack>(featuresTracks.size());
  for (Entry<String, Ipo> entry : featuresTracks.entrySet()) {
    int boneIndex = skeleton.getBoneIndex(entry.getKey());
    BoneContext boneContext = blenderContext.getBoneContext(skeleton.getBone(boneIndex));
    tracks.add((BoneTrack) entry.getValue().calculateTrack(boneIndex, boneContext, boneContext.getBone().getBindPosition(), boneContext.getBone().getBindRotation(), boneContext.getBone().getBindScale(), 1, stopFrame, fps, false));
  }
  return tracks.toArray(new BoneTrack[tracks.size()]);
}
origin: jMonkeyEngine/jmonkeyengine

Bone bone = limb.getJmeBone();
Skeleton skeleton = limb.getSkeletonHolder().getJmeSkeleton();
int boneIndex = skeleton.getBoneIndex(bone);
origin: jMonkeyEngine/jmonkeyengine

/**
 * Access the attachments node of the named bone. If the bone doesn't
 * already have an attachments node, create one and attach it to the scene
 * graph. Models and effects attached to the attachments node will follow
 * the bone's motions.
 *
 * @param boneName the name of the bone
 * @return the attachments node of the bone
 */
public Node getAttachmentsNode(String boneName) {
  Bone b = skeleton.getBone(boneName);
  if (b == null) {
    throw new IllegalArgumentException("Given bone name does not exist "
        + "in the skeleton.");
  }
  updateTargetsAndMaterials(spatial);
  int boneIndex = skeleton.getBoneIndex(b);
  Node n = b.getAttachmentsNode(boneIndex, targets);
  /*
   * Select a node to parent the attachments node.
   */
  Node parent;
  if (spatial instanceof Node) {
    parent = (Node) spatial; // the usual case
  } else {
    parent = spatial.getParent();
  }
  parent.attachChild(n);
  return n;
}
origin: jMonkeyEngine/jmonkeyengine

for (Bone rootBone : skeleton.getRoots()) {
  if (skeleton.getBoneIndex(rootBone) > 0) {
    this.applyConstraints(rootBone, alteredOmas, applied, frame, new Stack<Bone>());
  int boneIndex = skeleton.getBoneIndex(boneContext.getBone());
  if (!tracks.containsKey(boneIndex)) {
    tracks.put(boneIndex, new VirtualTrack(boneContext.getBone().getName(), maxFrame, maxTime));
origin: jMonkeyEngine/jmonkeyengine

int index = skeleton.getBoneIndex(bone);
Joint joint = joints[index];
if (joint == null) {
origin: jMonkeyEngine/jmonkeyengine

int boneIndex = skeleton.getBoneIndex(bone);
origin: org.jmonkeyengine/jme3-plugins

public void setSkeleton(Skeleton skeleton) {
  if(bone != null)
    boneIndex = skeleton.getBoneIndex(bone);
}

origin: info.projectkyoto/mms-engine

private void writeConnections(ShortBuffer indexBuf, Bone bone){
  for (Bone child : bone.getChildren()){
    // write myself
    indexBuf.put( (short) skeleton.getBoneIndex(bone) );
    // write the child
    indexBuf.put( (short) skeleton.getBoneIndex(child) );
    writeConnections(indexBuf, child);
  }
}
origin: org.jmonkeyengine/jme3-core

  /**
   * The method writes the indexes for the connection vertices. Used in non-length mode.
   * @param indexBuf
   *            the index buffer
   * @param bone
   *            the bone
   */
  private void writeConnections(ShortBuffer indexBuf, Bone bone) {
    for (Bone child : bone.getChildren()) {
      // write myself
      indexBuf.put((short) skeleton.getBoneIndex(bone));
      // write the child
      indexBuf.put((short) skeleton.getBoneIndex(child));

      this.writeConnections(indexBuf, child);
    }
  }
}
origin: info.projectkyoto/mms-engine

public static List<Integer> getBoneIndices(Bone bone, Skeleton skeleton, Set<String> boneList) {
  List<Integer> list = new LinkedList<Integer>();
  if (boneList.isEmpty()) {
    list.add(skeleton.getBoneIndex(bone));
  } else {
    list.add(skeleton.getBoneIndex(bone));
    for (Bone chilBone : bone.getChildren()) {
      if (!boneList.contains(chilBone.getName())) {
        list.addAll(getBoneIndices(chilBone, skeleton, boneList));
      }
    }
  }
  return list;
}
origin: org.jmonkeyengine/jme3-bullet

public static List<Integer> getBoneIndices(Bone bone, Skeleton skeleton, Set<String> boneList) {
  List<Integer> list = new LinkedList<Integer>();
  if (boneList.isEmpty()) {
    list.add(skeleton.getBoneIndex(bone));
  } else {
    list.add(skeleton.getBoneIndex(bone));
    for (Bone chilBone : bone.getChildren()) {
      if (!boneList.contains(chilBone.getName())) {
        list.addAll(getBoneIndices(chilBone, skeleton, boneList));
      }
    }
  }
  return list;
}
origin: org.jmonkeyengine/jme3-core

/**
 * Add a single bone to be influenced by this animation channel.
 */
public void addBone(Bone bone) {
  int boneIndex = control.getSkeleton().getBoneIndex(bone);
  if(affectedBones == null) {
    affectedBones = new BitSet(control.getSkeleton().getBoneCount());
  }
  affectedBones.set(boneIndex);
}
origin: info.projectkyoto/mms-engine

/**
 * Add a single bone to be influenced by this animation channel.
 */
public void addBone(Bone bone) {
  int boneIndex = control.getSkeleton().getBoneIndex(bone);
  if(affectedBones == null) {
    affectedBones = new BitSet(control.getSkeleton().getBoneCount());
  }
  affectedBones.set(boneIndex);
}
origin: org.jmonkeyengine/jme3-core

private void computeLength(Bone b, Map<Integer, Float> boneLengths, Skeleton skeleton) {
  if (b.getChildren().isEmpty()) {
    if (b.getParent() != null) {
      boneLengths.put(skeleton.getBoneIndex(b), boneLengths.get(skeleton.getBoneIndex(b.getParent())) * 0.75f);
    } else {
      boneLengths.put(skeleton.getBoneIndex(b), 0.1f);
    }
  } else {
    float length = Float.MAX_VALUE;
    for (Bone bone : b.getChildren()) {
      float len = b.getModelSpacePosition().subtract(bone.getModelSpacePosition()).length();
      if (len < length) {
        length = len;
      }
    }
    boneLengths.put(skeleton.getBoneIndex(b), length);
    for (Bone bone : b.getChildren()) {
      computeLength(bone, boneLengths, skeleton);
    }
  }
}
origin: org.jmonkeyengine/jme3-plugins

Bone bone = limb.getJmeBone();
Skeleton skeleton = limb.getSkeletonHolder().getJmeSkeleton();
int boneIndex = skeleton.getBoneIndex(bone);
com.jme3.animationSkeletongetBoneIndex

Javadoc

returns the bone index of the given bone

Popular methods of Skeleton

  • getBone
    returns the bone with the given name
  • getRoots
    returns the array of all root bones of this skeleton
  • resetAndUpdate
    Reset the skeleton to bind pose and updates the bones
  • <init>
    Creates a skeleton from a bone list. The root bones are found automatically. Note that using this c
  • getBoneCount
    returns the number of bones of this skeleton
  • updateWorldVectors
    Updates world transforms for all bones in this skeleton. Typically called after setting local animat
  • computeSkinningMatrices
    Compute the skining matrices for each bone of the skeleton that would be used to transform vertices
  • reset
    Reset the skeleton to bind pose.
  • setBindingPose
    Saves the current skeleton state as its binding pose.
  • createSkinningMatrices
  • recreateBoneStructure
  • recreateBoneStructure

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now