add setBoneTransform method

This commit is contained in:
Nick Fisher
2023-11-17 16:40:17 +08:00
parent daf319bf2c
commit f5d5a36f22
13 changed files with 182 additions and 70 deletions

View File

@@ -1160,4 +1160,18 @@ class FilamentControllerFFI extends FilamentController {
return frustum;
}
@override
Future setBoneTransform(FilamentEntity entity, String meshName, int boneIndex,
Matrix4 data) async {
var ptr = calloc<Float>(16);
for (int i = 0; i < 16; i++) {
ptr.elementAt(i).value = data.storage[i];
}
set_bone_transform(_assetManager!, entity,
meshName.toNativeUtf8().cast<Char>(), ptr, boneIndex);
calloc.free(ptr);
}
}