HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  

Share | 
 

 changing emitter type dynamically, possible?

View previous topic View next topic Go down 
AuthorMessage
enrac



Messages : 1
Date d'inscription : 2013-05-10

PostSubject: changing emitter type dynamically, possible?   Fri May 10, 2013 3:26 pm

Hi there, I'm using Spark (and loving it so far), and I had a question. I'm trying to implement a system that creates one emitter object, which feeds into a group. I want to be able to change the emitter type dynamically. In my class, I have something like this:

Emitter* pointerToCurrentEmitterObject;
pointerToCurrentEmitterObject = SphericalEmitter::Create(...);

and the Group class adds this pointer later. Now, at some point, I want to change this to a Straight emitter:

Emitter* tmpEmitter = pointerToCurrentEmitterObject;
pointerToCurrentEmitterObject = StraightEmitter::Create(...);

if (tmpEmitter) delete tmpEmitter;

However, what happens is that the Spherical emitter stops, and the Striaght emitter doesn't work. I'm guessing that something underneath needs updating. Any thoughts on how I could do this?

cheers.
Back to top Go down
View user profile
Darktib
Committer


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

PostSubject: Re: changing emitter type dynamically, possible?   Tue May 14, 2013 3:44 am

Well, you are just changing a pointer - this cannot work like this.

The best approach is:
- remove emitter from group
- (optional) delete it
- add the new emitter to the group

Also, I'm finalizing a part of SPARK 2.0, where such tasks will be a lot more easier to do (controls & attributes)

_________________
Back to top Go down
View user profile
 
changing emitter type dynamically, possible?
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» How can i type content whose id is changed dynamically
» What type of Fae are you?
» trouble finding element with xpath
» Web driver not supporting xpath element ids
» treatment for cervicogenic headache / doctors specializing in this type of headache

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