Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InterpCallback ¶
type InterpCallback func(alpha float64)
InterpCallback is called whenever the timestep has overstepped the actual time and linear interpolation needs to be performed.
type Segmenter ¶
type Segmenter struct {
// contains filtered or unexported fields
}
Segmenter is a mechanism to get reliable fixed-interval ticks, sincefor some algorithms (like physics) having consistent intervals is a necessity.
func NewSegmenter ¶
NewSegmenter creates a new Segmenter that produces the specified fixed-interval updates.
func (*Segmenter) Update ¶
func (t *Segmenter) Update(delta time.Duration, fixedCallback UpdateCallback, interpCallback InterpCallback)
Update should be called with the actual delta time elapsed. The callback function will be called a number of times with fixed delta intervals.
type UpdateCallback ¶
UpdateCallback is a mechanism to receive delta time increments.
type UpdateSubscription ¶
type UpdateSubscription = observer.Subscription[UpdateCallback]
UpdateSubscription represents a notification subscription for updates.
type UpdateSubscriptionSet ¶ added in v0.18.0
type UpdateSubscriptionSet = observer.SubscriptionSet[UpdateCallback]
UpdateSubscriptionSet represents a set of update subscriptions.
func NewUpdateSubscriptionSet ¶ added in v0.18.0
func NewUpdateSubscriptionSet() *UpdateSubscriptionSet
NewUpdateSubscriptionSet creates a new UpdateSubscriptionSet.