Animation controller uses now the singleton pattern

This commit is contained in:
devZoGok
2022-03-01 20:51:40 +02:00
parent 78f43e11bd
commit f64a3e13df
19 changed files with 46 additions and 44 deletions
+2 -2
View File
@@ -65,7 +65,7 @@ int main(){
text->setHorizontal(horizontal[i]);
text->setMaterial(textMat);
Node *textNode = new Node(Vector3(0, 50 * (i + 1), 0), Quaternion::QUAT_W, Vector3::VEC_IJK, "", new AnimationController());
Node *textNode = new Node(Vector3(0, 50 * (i + 1), 0), Quaternion::QUAT_W, Vector3::VEC_IJK, "");
textNode->addText(text);
guiNode->attachChild(textNode);
@@ -103,7 +103,7 @@ int main(){
* The AnimationController plays the animations set in the AnimationChannel objects.
* AnimationChannel objects require an animation and animatable objects, e.g. textures to work.
*/
AnimationController *controller = textNode->getAnimationController();
AnimationController *controller = AnimationController::getSingleton();
controller->addAnimation(anim);
AnimationChannel *channel = new AnimationChannel();
controller->addAnimationChannel(channel);