/** * Creates a points with bone lengths data. If the data is supplied then the points will show both head and tail of each bone. * @param skeleton * the skeleton that will be shown * @param boneLengths * a map between the bone's index and the bone's length */ public SkeletonPoints(Skeleton skeleton, Map<Integer, Float> boneLengths) { this.skeleton = skeleton; this.setMode(Mode.Points); int pointsCount = skeleton.getBoneCount(); if (boneLengths != null) { this.boneLengths = boneLengths; pointsCount *= 2; } VertexBuffer pb = new VertexBuffer(Type.Position); FloatBuffer fpb = BufferUtils.createFloatBuffer(pointsCount * 3); pb.setupData(Usage.Stream, 3, Format.Float, fpb); this.setBuffer(pb); this.updateCounts(); }
public SkeletonPoints(Skeleton skeleton){ this.skeleton = skeleton; setMode(Mode.Points); VertexBuffer pb = new VertexBuffer(Type.Position); FloatBuffer fpb = BufferUtils.createFloatBuffer(skeleton.getBoneCount() * 3); pb.setupData(Usage.Stream, 3, Format.Float, fpb); setBuffer(pb); setPointSize(7); updateCounts(); }
/** * Creates a points with bone lengths data. If the data is supplied then the points will show both head and tail of each bone. * @param skeleton * the skeleton that will be shown * @param boneLengths * a map between the bone's index and the bone's length */ public SkeletonPoints(Skeleton skeleton, Map<Integer, Float> boneLengths) { this.skeleton = skeleton; this.setMode(Mode.Points); int pointsCount = skeleton.getBoneCount(); if (boneLengths != null) { this.boneLengths = boneLengths; pointsCount *= 2; } VertexBuffer pb = new VertexBuffer(Type.Position); FloatBuffer fpb = BufferUtils.createFloatBuffer(pointsCount * 3); pb.setupData(Usage.Stream, 3, Format.Float, fpb); this.setBuffer(pb); this.updateCounts(); }