| 30 |
30 |
import org.distorted.library.type.Static4D
|
| 31 |
31 |
import org.distorted.library.uniformblock.UniformBlockAssociation
|
| 32 |
32 |
import org.distorted.library.uniformblock.UniformBlockCenter
|
|
33 |
|
| 33 |
34 |
import java.io.DataInputStream
|
| 34 |
35 |
import java.io.DataOutputStream
|
| 35 |
36 |
import java.io.IOException
|
| 36 |
37 |
import java.nio.ByteBuffer
|
| 37 |
38 |
import java.nio.ByteOrder
|
|
39 |
|
| 38 |
40 |
import kotlin.math.min
|
| 39 |
41 |
import kotlin.math.sqrt
|
| 40 |
42 |
|
| ... | ... | |
| 457 |
459 |
mVertAttribs2?.copyInto(newAttribs2, 0 , 0 , v2)
|
| 458 |
460 |
mVertAttribs2?.copyInto(newAttribs2, v2-VERT2_ATTRIBS, v2, v2+VERT2_ATTRIBS)
|
| 459 |
461 |
*/
|
| 460 |
|
System.arraycopy(mVertAttribs1, 0, newAttribs1, 0, VERT1_ATTRIBS*numVert);
|
| 461 |
|
System.arraycopy(mVertAttribs1, v1-VERT1_ATTRIBS, newAttribs1, v1, VERT1_ATTRIBS );
|
| 462 |
|
System.arraycopy(mVertAttribs2, 0, newAttribs2, 0, VERT2_ATTRIBS*numVert);
|
| 463 |
|
System.arraycopy(mVertAttribs2, v2-VERT2_ATTRIBS, newAttribs2, v2, VERT2_ATTRIBS );
|
|
462 |
System.arraycopy(mVertAttribs1!!, 0, newAttribs1, 0, VERT1_ATTRIBS*numVert);
|
|
463 |
System.arraycopy(mVertAttribs1!!, v1-VERT1_ATTRIBS, newAttribs1, v1, VERT1_ATTRIBS );
|
|
464 |
System.arraycopy(mVertAttribs2!!, 0, newAttribs2, 0, VERT2_ATTRIBS*numVert);
|
|
465 |
System.arraycopy(mVertAttribs2!!, v2-VERT2_ATTRIBS, newAttribs2, v2, VERT2_ATTRIBS );
|
| 464 |
466 |
origVertices++
|
| 465 |
467 |
|
| 466 |
468 |
if (numVert%2==1)
|
| ... | ... | |
| 471 |
473 |
mVertAttribs1?.copyInto(newAttribs1,w1-VERT1_ATTRIBS,w1,w1+VERT1_ATTRIBS)
|
| 472 |
474 |
mVertAttribs2?.copyInto(newAttribs2,w2-VERT2_ATTRIBS,w2,w2+VERT2_ATTRIBS)
|
| 473 |
475 |
*/
|
| 474 |
|
System.arraycopy(mVertAttribs1, w1-VERT1_ATTRIBS, newAttribs1, w1, VERT1_ATTRIBS)
|
| 475 |
|
System.arraycopy(mVertAttribs2, w2-VERT2_ATTRIBS, newAttribs2, w2, VERT2_ATTRIBS)
|
|
476 |
System.arraycopy(mVertAttribs1!!, w1-VERT1_ATTRIBS, newAttribs1, w1, VERT1_ATTRIBS)
|
|
477 |
System.arraycopy(mVertAttribs2!!, w2-VERT2_ATTRIBS, newAttribs2, w2, VERT2_ATTRIBS)
|
| 476 |
478 |
origVertices++
|
| 477 |
479 |
}
|
| 478 |
480 |
}
|
| ... | ... | |
| 490 |
492 |
mesh.mVertAttribs1?.copyInto(newAttribs1,0, v1, v1+VERT1_ATTRIBS)
|
| 491 |
493 |
mesh.mVertAttribs2?.copyInto(newAttribs2,0, v2, v2+VERT2_ATTRIBS)
|
| 492 |
494 |
*/
|
| 493 |
|
System.arraycopy(mesh.mVertAttribs1, 0, newAttribs1, v1, VERT1_ATTRIBS)
|
| 494 |
|
System.arraycopy(mesh.mVertAttribs2, 0, newAttribs2, v2, VERT2_ATTRIBS)
|
|
495 |
System.arraycopy(mesh.mVertAttribs1!!, 0, newAttribs1, v1, VERT1_ATTRIBS)
|
|
496 |
System.arraycopy(mesh.mVertAttribs2!!, 0, newAttribs2, v2, VERT2_ATTRIBS)
|
| 495 |
497 |
origVertices++
|
| 496 |
498 |
}
|
| 497 |
499 |
val v1 = VERT1_ATTRIBS*origVertices
|
| ... | ... | |
| 500 |
502 |
mesh.mVertAttribs1?.copyInto(newAttribs1,0, v1, v1+VERT1_ATTRIBS*numVertices)
|
| 501 |
503 |
mesh.mVertAttribs2?.copyInto(newAttribs2,0, v2, v2+VERT2_ATTRIBS*numVertices)
|
| 502 |
504 |
*/
|
| 503 |
|
System.arraycopy(mesh.mVertAttribs1, 0, newAttribs1, v1, VERT1_ATTRIBS*numVert)
|
| 504 |
|
System.arraycopy(mesh.mVertAttribs2, 0, newAttribs2, v2, VERT2_ATTRIBS*numVert)
|
|
505 |
System.arraycopy(mesh.mVertAttribs1!!, 0, newAttribs1, v1, VERT1_ATTRIBS*numVert)
|
|
506 |
System.arraycopy(mesh.mVertAttribs2!!, 0, newAttribs2, v2, VERT2_ATTRIBS*numVert)
|
| 505 |
507 |
origVertices += numVert
|
| 506 |
508 |
|
| 507 |
509 |
if( i<numMeshes-1 && numVert>0 )
|
| ... | ... | |
| 512 |
514 |
mesh.mVertAttribs1?.copyInto(newAttribs1, VERT1_ATTRIBS*(numVertices-1), w1, w1+VERT1_ATTRIBS)
|
| 513 |
515 |
mesh.mVertAttribs2?.copyInto(newAttribs2, VERT2_ATTRIBS*(numVertices-1), w2, w2+VERT2_ATTRIBS)
|
| 514 |
516 |
*/
|
| 515 |
|
System.arraycopy(mesh.mVertAttribs1, VERT1_ATTRIBS*(numVert-1), newAttribs1, w1, VERT1_ATTRIBS)
|
| 516 |
|
System.arraycopy(mesh.mVertAttribs2, VERT2_ATTRIBS*(numVert-1), newAttribs2, w2, VERT2_ATTRIBS)
|
|
517 |
System.arraycopy(mesh.mVertAttribs1!!, VERT1_ATTRIBS*(numVert-1), newAttribs1, w1, VERT1_ATTRIBS)
|
|
518 |
System.arraycopy(mesh.mVertAttribs2!!, VERT2_ATTRIBS*(numVert-1), newAttribs2, w2, VERT2_ATTRIBS)
|
| 517 |
519 |
origVertices++
|
| 518 |
520 |
|
| 519 |
521 |
if (numVert%2==1)
|
| ... | ... | |
| 524 |
526 |
mesh.mVertAttribs1?.copyInto(newAttribs1, VERT1_ATTRIBS*(numVertices-1), z1, z1+VERT1_ATTRIBS)
|
| 525 |
527 |
mesh.mVertAttribs2?.copyInto(newAttribs2, VERT2_ATTRIBS*(numVertices-1), z2, z2+VERT2_ATTRIBS)
|
| 526 |
528 |
*/
|
| 527 |
|
System.arraycopy(mesh.mVertAttribs1, VERT1_ATTRIBS*(numVert-1), newAttribs1, z1, VERT1_ATTRIBS)
|
| 528 |
|
System.arraycopy(mesh.mVertAttribs2, VERT2_ATTRIBS*(numVert-1), newAttribs2, z2, VERT2_ATTRIBS)
|
|
529 |
System.arraycopy(mesh.mVertAttribs1!!, VERT1_ATTRIBS*(numVert-1), newAttribs1, z1, VERT1_ATTRIBS)
|
|
530 |
System.arraycopy(mesh.mVertAttribs2!!, VERT2_ATTRIBS*(numVert-1), newAttribs2, z2, VERT2_ATTRIBS)
|
| 529 |
531 |
origVertices++
|
| 530 |
532 |
}
|
| 531 |
533 |
}
|
minor