HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  

Share | 
 

 Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)

View previous topic View next topic Go down 
AuthorMessage
Nova
Guest



PostSubject: Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)   Tue Sep 07, 2010 5:40 pm

Hi everyone.

First of all thank you for your great system and also for the Irrlicht support.

To get to know your engine I started porting the ExplosionDemo to Irrlicht. Everything compiles fine but the behaviour is strange.
Once the program starts one explosion is immediatly started. (The base system maybe?) Then, when I press Space to create a new explosion, the new system doesn't start from scratch but also "copies" the progress of the first explosion. So basically the first explosion just gets brighter as more textures are added on top of one another.
When the explosion finishes I also cannot produce any new explosions.

Since I don't know your system very well, yet, I cannot explain myself any better so I created a video to show my problem.



I'd appreciate any help you can give.
Back to top Go down
Nova
Guest



PostSubject: Re: Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)   Tue Sep 07, 2010 5:48 pm

Fogot to post any code.

Since I didn't just replaced the System with IRRSystem but copied each line I might need over, I may have missed something important.

Here are the snippets that I think are important

This is the changed code for the system, everything else (the groups, models etc) are just copied and pasted. (Well, the QuadRenderes have been changed too, of course)
Code:
SPK::System* system = SPK::IRR::IRRSystem::create( Env::Smgr->getRootSceneNode(), Env::Smgr );
   system->addGroup( waveGroup );
   system->addGroup( smokeGroup );
   system->addGroup( flameGroup );
   system->addGroup( flashGroup );
   system->addGroup( spark1Group );
   system->addGroup( spark2Group );
   system->enableAABBComputing( true );

   // Gets a pointer to the base
   return system->getID();

The create method, basically the same
Code:
SPK::IRR::IRRSystem* CGame::createParticleSystem( const SPK::Vector3D& pos )
{
   // Creates a copy of the base system
   SPK::IRR::IRRSystem* system = SPK_Copy( SPK::IRR::IRRSystem, BaseSystemID );

   // Locates the system at the given position
   system->setTransformPosition(pos);
   system->updateTransform(); // updates the world transform of system and its children

   return system;
}

And each time space is pressed, this function is called
Code:
void CGame::createExplosion()
{
   createParticleSystem( SPK::Vector3D() );
}

I dont handle any updates/destruction yet.
Back to top Go down
Juff
Developer


Messages : 539
Date d'inscription : 2009-07-14
Age : 34

PostSubject: Re: Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)   Tue Sep 07, 2010 6:07 pm

Hi,

I need a few precsions first :

What version of SPARK are you using ? of Irrlicht ?
What compiler, what OS ?
Are you linking spark dynamically or statically ?

Thx
Back to top Go down
View user profile http://spark.developpez.com
Nova
Guest



PostSubject: Re: Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)   Tue Sep 07, 2010 6:11 pm

I am using Visual Studio 2010 (recompiled Spark with the VS08 project file, no problems)
Statically linked Spark V 1.05.03
Irrlicht V 1.7.1
Windows 7 - 64Bit
Back to top Go down
Juff
Developer


Messages : 539
Date d'inscription : 2009-07-14
Age : 34

PostSubject: Re: Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)   Tue Sep 07, 2010 6:31 pm

You have a windows 64 bits but have you compiled SPARK in 32 bits ? and Irrlicht in 32 bits as well ?

Moreover I suggest you switch to version 1.05.04 which fixes a few bugs (It might not resolve your issue though).

You didnt set the groups of the base system to be shared ? If no, can you check the value of the isShared() method of the group of the base system.

EDIT : I ll try to port the Explosion demo to Irrlicht tomorrow to see if I got the same issue.
Back to top Go down
View user profile http://spark.developpez.com
Nova
Guest



PostSubject: Re: Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)   Tue Sep 07, 2010 6:49 pm

Yes, both projects compiled for 32-Bit Systems.

The groups aren't set to be shared and isShared() also returns false.

I am not sure if I somehow have to stop the basesystem from simulating the effect so I can copy the system in its initial state and then run the simulation for each system individually?
It seems a little bit strange to me that one explosion (possible the base system) is immediatly shown after I start the application without ever calling SPK_Copy on the base systems ID.
Back to top Go down
Juff
Developer


Messages : 539
Date d'inscription : 2009-07-14
Age : 34

PostSubject: Re: Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)   Tue Sep 07, 2010 7:01 pm

Yes you re right. THe problem happens because you re updating the base system. Therefore its emitters are already copied with an empty tank (as the flow is set to -1) and the groups are copied with some particles in them. That totally matches the symptoms.

What you have to to is to not attach the base system to the scene graph (by passing an null parent) and when copying the base system, setting the parent of the newly created system to "Env::Smgr->getRootSceneNode()".

This should work.

Finally dont forget to update to 1.05.04 to be able to set the transform of the systems by using directly system->setPosition(pos) (method of irrlich scene node) instead of system->setTransformPosition(pos) which wont work for IRRSystems anyway.
Back to top Go down
View user profile http://spark.developpez.com
Nova
Guest



PostSubject: Re: Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)   Tue Sep 07, 2010 7:06 pm

That works beatifully. Thank you very much.
Both Irrlicht demos attach their base systems to the scene graph, so I thought I have to do that, too.
It makes sense of course, since both demos use single particle systems which don't have to be copied.

Thank you!
Back to top Go down
Nova



Messages : 1
Date d'inscription : 2010-09-07

PostSubject: Re: Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)   Tue Sep 07, 2010 7:09 pm

Btw, all the download links for 1.05.04 don't seem to work for me?
Back to top Go down
View user profile
Juff
Developer


Messages : 539
Date d'inscription : 2009-07-14
Age : 34

PostSubject: Re: Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)   Tue Sep 07, 2010 7:18 pm

The FTP server seems to be down atm. You gonna have to wait a bit im afraid
Back to top Go down
View user profile http://spark.developpez.com
Sponsored content




PostSubject: Re: Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)   Today at 9:30 am

Back to top Go down
 
Copying Base System does not start a new explosion (Porting ExplosionDemo to Irrlicht)
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» [SOLVED] Can't start winreducer 8.1 on reduced windows 8.1
» Dell System Recovery Partition Hotkey & Instructions (Dell PC Restore)
» do not run browser, when start selenium testing
» start selenium 2 with Internet Explorer.
» Could not start Selenium session: Connection timed out: connect

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