This commit is contained in:
devZoGok
2022-03-31 19:09:10 +03:00
parent ad494c7720
commit 5a84db2267
+9
View File
@@ -46,6 +46,11 @@ int main(){
Texture *texture = new Texture(images, 1, false); Texture *texture = new Texture(images, 1, false);
mat->addTexUniform("tex", texture, false); mat->addTexUniform("tex", texture, false);
/*
* Sets emitter properties, such as the color gradient of the
* grayscale particle image, particle lifetime in seconds and
* their speed
*/
emitter->setMaterial(mat); emitter->setMaterial(mat);
emitter->setStartColor(Vector4(1, 1, 1, 1)); emitter->setStartColor(Vector4(1, 1, 1, 1));
emitter->setEndColor(Vector4(1, 0, 1, 1)); emitter->setEndColor(Vector4(1, 0, 1, 1));
@@ -84,6 +89,10 @@ int main(){
animation->addKeyframeChannel(startRedChan); animation->addKeyframeChannel(startRedChan);
animation->addKeyframeChannel(endRedChan); animation->addKeyframeChannel(endRedChan);
/*
* 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 = AnimationController::getSingleton(); AnimationController *controller = AnimationController::getSingleton();
controller->addAnimation(animation); controller->addAnimation(animation);
AnimationChannel *animChan = new AnimationChannel(); AnimationChannel *animChan = new AnimationChannel();