private boolean isBodyDone() { final boolean ok_triangles = this.header.triangles().triangleCount() == this.parsed_triangles; final boolean attribute_size_ok = this.attributes_ok.size() == this.header.attributesByName().size(); final boolean attribute_all_done = this.attributes_ok.foldRight( Boolean.TRUE, (p, x) -> Boolean.valueOf(p._2.booleanValue() && x.booleanValue())).booleanValue(); this.log().trace( "triangles done: {}", Boolean.valueOf(ok_triangles)); this.log().trace( "attributes size: {}", Boolean.valueOf(attribute_size_ok)); this.log().trace( "attributes done: {}", Boolean.valueOf(attribute_all_done)); return ok_triangles && attribute_size_ok && attribute_all_done; }
final int named_size = this.attributesByName().size(); if (order_size != named_size) { final StringBuilder sb = new StringBuilder(128);
final int named_size = this.attributesByName().size(); if (order_size != named_size) { final StringBuilder sb = new StringBuilder(128);
@Override public void onFinish() { if (this.errors.isEmpty()) { Invariants.checkInvariantI( this.attr_buffers.size(), this.attr_buffers.size() == this.config.size(), x -> "Must have correct number of buffers"); final SMFByteBufferPackedMesh.Builder mb = SMFByteBufferPackedMesh.builder(); for (final Tuple2<Integer, ByteBuffer> p : this.attr_buffers) { mb.addAttributeSets(SMFByteBufferPackedAttributeSet.of( p._1.intValue(), this.config.get(p._1).get(), p._2)); } if (this.tri_buffer != null) { final SMFTriangles triangles = this.header.triangles(); mb.setTriangles(SMFByteBufferPackedTriangles.of( this.tri_buffer, triangles.triangleCount(), Math.toIntExact(triangles.triangleIndexSizeBits()))); } mb.setHeader(this.header); this.mesh = mb.build(); } }