ConstraintRotationToNode class

A Constraint that rotates a node to point towards another node. The target node is allowed to have a different parent, but they must be in the same SpriteBox.

Inheritance

Constructors

ConstraintRotationToNode({required Node targetNode, double baseRotation = 0.0, double? dampening})
Creates a new Constraint that rotates the node towards the targetNode. The baseRotation will be added to the nodes rotation, and dampening can be used to ease the rotation.

Properties

baseRotation double
The base rotation will be added after the target rotation is calculated.
final
dampening double?
The filter factor used when constraining the rotation of the node. Valid values are in the range 0.0 to 1.0
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
targetNode Node
The node to rotate towards.
final

Methods

constrain(Node node, double dt) → void
Called after update is complete, if the constraint has been added to a Node. Override this method to modify the node's property according to the constraint.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preUpdate(Node node, double dt) → void
Called before the node's update method is called. This method can be overridden to create setup work that needs to happen before the the node is updated, e.g. to calculate the node's speed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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