update method
void
update({})
Updates controller and notifies listeners (including DiTreDi widget).
Implementation
void update({
double? viewScale,
double? userScale,
double? minUserScale,
double? maxUserScale,
double? rotationX,
double? rotationY,
double? rotationZ,
Offset? translation,
Vector3? light,
double? lightStrength,
double? ambientLightStrength,
}) {
assert(
ambientLightStrength == null ||
ambientLightStrength >= 0 && ambientLightStrength <= 1,
"ambientLight should be between 0.0 and 1.0",
);
this.viewScale = viewScale ?? this.viewScale;
this.minUserScale =
(minUserScale ?? this.minUserScale).clamp(0, double.infinity);
this.maxUserScale = (maxUserScale ?? this.maxUserScale)
.clamp(this.minUserScale, double.infinity);
this.userScale = (userScale ?? this.userScale)
.clamp(this.minUserScale, this.maxUserScale);
this.rotationX = _normalizeAngle(rotationX ?? this.rotationX);
this.rotationY = _normalizeAngle(rotationY ?? this.rotationY);
this.rotationZ = _normalizeAngle(rotationZ ?? this.rotationZ);
this.translation = translation ?? this.translation;
this.lightStrength =
(lightStrength ?? this.lightStrength).clamp(0, double.infinity);
this.ambientLightStrength =
(ambientLightStrength ?? this.ambientLightStrength).clamp(0, 1);
if (light != null) {
light.normalizeInto(this.light);
}
notifyListeners();
}