getBone method

  1. @override
Future<ThermionEntity> getBone(
  1. ThermionEntity parent,
  2. int boneIndex, {
  3. int skinIndex = 0,
})
override

Gets the entity representing the bone at boneIndex/skinIndex. The returned entity is only intended for use with getWorldTransform.

Implementation

@override
Future<ThermionEntity> getBone(ThermionEntity parent, int boneIndex,
    {int skinIndex = 0}) async {
  final boneId = _module.ccall(
      "get_bone",
      "int",
      ["void*".toJS, "int32_t".toJS, "int32_t".toJS, "int32_t".toJS].toJS,
      [_sceneManager!, parent.toJS, skinIndex.toJS, boneIndex.toJS].toJS,
      null) as JSNumber;
  if (boneId.toDartInt == -1) {
    throw Exception("Failed to get bone");
  }
  return boneId.toDartInt;
}