MCPcopy
hub / github.com/g3n/engine / AddChannel

Method AddChannel

animation/animation.go:136–153  ·  view source on GitHub ↗

AddChannel adds a channel to the animation.

(ch IChannel)

Source from the content-addressed store, hash-verified

134
135// AddChannel adds a channel to the animation.
136func (anim *Animation) AddChannel(ch IChannel) {
137
138 // TODO (maybe) prevent user from adding two channels of the same type that share target ?
139
140 // Add the channel
141 anim.channels = append(anim.channels, ch)
142
143 // Update maxTime and minTime values
144 kf := ch.Keyframes()
145 firstTime := kf[0]
146 if anim.minTime > firstTime {
147 anim.minTime = firstTime
148 }
149 lastTime := kf[len(kf)-1]
150 if anim.maxTime < lastTime {
151 anim.maxTime = lastTime
152 }
153}

Callers 1

LoadAnimationMethod · 0.95

Calls 1

KeyframesMethod · 0.65

Tested by

no test coverage detected