transformMatrix property

Matrix4 get transformMatrix

The total transformation matrix for the component. This matrix combines translation, rotation and scale transforms into a single entity. The matrix is cached and gets recalculated only when necessary.

The returned matrix must not be modified by the user.

Implementation

Matrix4 get transformMatrix {
  if (_recalculate) {
    _transformMatrix.setFromTranslationRotationScale(
      _position,
      _rotation,
      _scale,
    );
    _recalculate = false;
  }
  return _transformMatrix;
}