modelWorldTransform property

  1. @override
VrmMatrix4 get modelWorldTransform

Current transform from source glTF model space to renderer world space.

Implementation

@override
VrmMatrix4 get modelWorldTransform {
  for (final rootIndex in defaultGltfSceneRoots(model.gltf)) {
    final binding = _nodeBindings[rootIndex];
    if (binding == null) continue;
    final inverseLocal = vm.Matrix4.tryInvert(
      _toSceneMatrix(binding.localTransform),
    );
    if (inverseLocal == null) continue;
    return _fromSceneMatrix(
      _toSceneMatrix(binding.worldTransform)..multiply(inverseLocal),
    );
  }
  return _modelRootMotionTransform;
}