/** * 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); } } }
this.writeConnections(sib, 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) ); writeConnections(indexBuf, child); } }
/** * 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); } } }
this.writeConnections(sib, bone);
public SkeletonWire(Skeleton skeleton){ this.skeleton = skeleton; for (Bone bone : skeleton.getRoots()) countConnections(bone); setMode(Mode.Lines); VertexBuffer pb = new VertexBuffer(Type.Position); FloatBuffer fpb = BufferUtils.createFloatBuffer(skeleton.getBoneCount() * 3); pb.setupData(Usage.Stream, 3, Format.Float, fpb); setBuffer(pb); VertexBuffer ib = new VertexBuffer(Type.Index); ShortBuffer sib = BufferUtils.createShortBuffer(numConnections * 2); ib.setupData(Usage.Static, 2, Format.UnsignedShort, sib); setBuffer(ib); for (Bone bone : skeleton.getRoots()) writeConnections(sib, bone); sib.flip(); updateCounts(); }