getBoneNames method

Future<List<String>> getBoneNames(
  1. ThermionEntity entity, {
  2. int skinIndex = 0,
})
override

Gets the names of all bones for the armature at skinIndex under the specified entity.

Implementation

Future<List<String>> getBoneNames(ThermionEntity entity,
    {int skinIndex = 0}) async {
  var count = get_bone_count(_sceneManager!, entity, skinIndex);
  var out = allocator<Pointer<Char>>(count);
  for (int i = 0; i < count; i++) {
    out[i] = allocator<Char>(255);
  }

  get_bone_names(_sceneManager!, entity, out, skinIndex);
  var names = <String>[];
  for (int i = 0; i < count; i++) {
    var namePtr = out[i];
    names.add(namePtr.cast<Utf8>().toDartString());
  }
  return names;
}