MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / play

Method play

Source/Node/Model.cpp:123–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123float Model::play(uint32_t index, bool loop) {
124 Model::stop();
125 if (index == Animation::None || index >= _animationGroups.size()) {
126 return 0;
127 }
128 _loop = loop;
129 _isPlaying = true;
130 _currentAnimation = index;
131 if (_recoveryTime > 0.0f) {
132 _isRecovering = true;
133 _resetAnimation.run(_recoveryTime / std::max(_speed, FLT_EPSILON), _currentAnimation);
134 } else {
135 Model::resetActions();
136 Model::onResetAnimationEnd();
137 }
138 return (_animationGroups[_currentAnimation]->duration + _recoveryTime) / std::max(_speed, FLT_EPSILON);
139}
140
141float Model::play(String name, bool loop) {
142 int index = _modelDef->getAnimationIndexByName(name);

Callers 14

openMethod · 0.45
handlePlayableAttributeFunction · 0.45
DoraX.tsFile · 0.45
patchPlayablePropsFunction · 0.45
patchAudioSourcePropsFunction · 0.45
initMethod · 0.45
runMethod · 0.45
updateMethod · 0.45
effeknode_playFunction · 0.45
audiosource_playFunction · 0.45

Calls 5

stopFunction · 0.85
runMethod · 0.65
maxFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected