DiTreDiController class

A widget that controls DiTreDi camera state - position, rotation, zoom.

Inheritance

Constructors

DiTreDiController({double modelScale = 1, double viewScale = 1, double userScale = 1, double minUserScale = 0.8, double maxUserScale = 3.0, double rotationX = -45, double rotationY = 45, double rotationZ = 0, Offset translation = const Offset(0, 0), Vector3? light, double lightStrength = 1.0, double ambientLightStrength = 0.1})
Creates a new DiTreDiController instance.

Properties

ambientLightStrength double
Ambient light strength. Varies from 0.0 to 1.0. Set to 1.0 to use colors without light effect. Defaults to 0.1.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
light ↔ Vector3
Light direction for 3D objects.
getter/setter pair
lightStrength double
light strength. Varies from 0.0 to infinity. Defaults to 1.0.
getter/setter pair
maxUserScale double
Maximum scale applied by user. By default it's 3.0.
getter/setter pair
minUserScale double
Minimum scale applied by user. By default it's 0.8.
getter/setter pair
modelScale double
Scale factor for the model to fit in -1, 1 bounds.
getter/setter pair
rotationX double
Camera rotation around X-axis (vertical). Minus moves camera "above" the model, with plus it's "below".
getter/setter pair
rotationY double
Camera rotation around Y-axis (horizontal).
getter/setter pair
rotationZ double
Camera rotation around Z-axis (roll).
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
Combination of all scale factors to pixel coordinates.
no setter
translation Offset
Translation of the displayed model on the screen.
getter/setter pair
userScale double
User scale. By default it's 1.0.
getter/setter pair
viewScale double
Scale factor for the screen to draw -1, 1 bounded model.
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() String
A string representation of this object.
inherited
update({double? viewScale, double? userScale, double? minUserScale, double? maxUserScale, double? rotationX, double? rotationY, double? rotationZ, Offset? translation, Vector3? light, double? lightStrength, double? ambientLightStrength}) → void
Updates controller and notifies listeners (including DiTreDi widget).

Operators

operator ==(Object other) bool
The equality operator.
inherited