Now that our StartBlink has been called once explicitly, and our LastBlinkTime has been set, we can implement a **ShouldBlink **method to check on each update whether it’s time to blink again.
ShouldBlink is defined as a pure method and returns a boolean which we use to trigger the blink.
Its implementation uses a simplification of the heuristic defined in Itti, Dhavale and Pighin’s paper (Section 4.4):
There’s plenty of room to add more to this. The current heuristic, crude by the authors’ own admission, doesn’t take into account normal vs. attentive states or recent eye movement actions, but it’s a good foundation, and the encapsulated ShouldBlink method gives us an easy place to add that additional detail when we want it.