Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 disable/enable/hide particle system

Go down 
3 posters
AuthorMessage
mmortall




Messages : 6
Date d'inscription : 2011-04-11

disable/enable/hide particle system Empty
PostSubject: disable/enable/hide particle system   disable/enable/hide particle system Icon_minitimeTue Apr 12, 2011 5:38 am

I need to disable/enable/hide/unhide particle system at any time.
How can I do that?
Back to top Go down
takezo02




Messages : 10
Date d'inscription : 2010-11-23

disable/enable/hide particle system Empty
PostSubject: Re: disable/enable/hide particle system   disable/enable/hide particle system Icon_minitimeThu Apr 14, 2011 5:44 am

I think you can to do this with this method in Core/SPK_Renderer.h

void setActive(bool active);

Apply to all renderer that you want enable/disable in any system or group.

Else implement a new bool or mask in order to enable/disable the render of system.
Back to top Go down
Darktib
Committer
Darktib


Messages : 389
Date d'inscription : 2009-07-20
Localisation : A coté de Paris

disable/enable/hide particle system Empty
PostSubject: Re: disable/enable/hide particle system   disable/enable/hide particle system Icon_minitimeThu Apr 14, 2011 12:14 pm

If you are rendering and updating manually:
Code:
// In your app loop:
    if(systemIsEnabled) system->update(deltaT);
    if(systemIsVisible) system->render();

If you're using Irrlicht:
Code:
    SPK::IRRSystem* system;

    // ...

// Anywere you want
    system->setVisible(v); // v = false to hide it, true to show it
    system->setAutoUpdateEnabled(aue); // aue = false to disable, true to enable the system

@takezo02: Calling setActive on a renderer will only activate/deactivate a specific renderer, and that is useful if you want to disable only some parts of your system. I think mmortall asked for a solution hiding/showing the whole system...
Back to top Go down
mmortall




Messages : 6
Date d'inscription : 2011-04-11

disable/enable/hide particle system Empty
PostSubject: Re: disable/enable/hide particle system   disable/enable/hide particle system Icon_minitimeFri Apr 15, 2011 6:38 am

Thank your very mach for your help. My mistake was in using System class (no IRRSystem).
Back to top Go down
Darktib
Committer
Darktib


Messages : 389
Date d'inscription : 2009-07-20
Localisation : A coté de Paris

disable/enable/hide particle system Empty
PostSubject: Re: disable/enable/hide particle system   disable/enable/hide particle system Icon_minitimeFri Apr 15, 2011 1:18 pm

You're welcome!

Btw, the first solution I wrote is only requiring SPK::System Wink
Back to top Go down
Sponsored content





disable/enable/hide particle system Empty
PostSubject: Re: disable/enable/hide particle system   disable/enable/hide particle system Icon_minitime

Back to top Go down
 
disable/enable/hide particle system
Back to top 
Page 1 of 1
 Similar topics
-
» Action Particle getAge() always zero
» particle vs particle collision demo
» Particle editor
» Spark Particle Engine with D3D API
» Problem when set particle position

Permissions in this forum:You cannot reply to topics in this forum
 :: English Forum :: Questions (en)-
Jump to: