getMorphTargetNames method

  1. @override
Future<List<String>> getMorphTargetNames(
  1. ThermionEntity entity,
  2. ThermionEntity childEntity
)
override

Implementation

@override
Future<List<String>> getMorphTargetNames(
    ThermionEntity entity, ThermionEntity childEntity) async {
  var names = <String>[];

  var count = await withIntCallback((callback) =>
      get_morph_target_name_count_ffi(
          _sceneManager!, entity, childEntity, callback));
  var outPtr = allocator<Char>(255);
  for (int i = 0; i < count; i++) {
    get_morph_target_name(_sceneManager!, entity, childEntity, outPtr, i);
    names.add(outPtr.cast<Utf8>().toDartString());
  }
  allocator.free(outPtr);
  return names.cast<String>();
}