6 : _visual(visual), _fromAngle(fromAngle), _duration(duration)
9 float normalizedFrom = fmod(fromAngle, 360.0f);
10 if (normalizedFrom < 0.0f) normalizedFrom += 360.0f;
12 _delta = fmod(
toAngle - normalizedFrom + 540.0f, 360.0f) - 180.0f;
19 if (t > 1.0f) t = 1.0f;
float toAngle(Orientation orientation)
Returns the Y rotation angle (degrees) for a given orientation.
void update(float dt) override
TurnBehavior(VisualState &visual, float fromAngle, float toAngle, float duration)
bool isDone() const override
Returns true when the behavior has completed and can be removed.
static float _smoothstep(float t)
Visual-only state for an entity, driven by behaviors each frame. Logical state (x,...