skeletal transform packing: don't copy every single float from mat4

Its batched now, the byte buffer can optimize this call.
This commit is contained in:
Moritz Zwerger 2025-03-25 20:26:09 +01:00
parent 1d742f4dff
commit 89c8e43e65
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -1,6 +1,6 @@
/*
* Minosoft
* Copyright (C) 2020-2023 Moritz Zwerger
* Copyright (C) 2020-2025 Moritz Zwerger
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
@ -48,9 +48,8 @@ class TransformInstance(
val array = value.array
val offset = this.id * Mat4.length
for (index in 0 until Mat4.length) {
buffer.put(offset + index, array[index])
}
buffer.position(offset)
buffer.put(array, 0, Mat4.length)
for (child in this.array) {
child.pack(buffer)