Horde3D

Next-Generation Graphics Engine
It is currently 27.11.2024, 15:38

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 29.07.2009, 11:56 
Offline

Joined: 29.07.2009, 11:35
Posts: 2
Hello there,

i currently have a problem to get the param lifeMax from a particle.
My particles are getting loaded and they work like they should.

I tried the following:
Code:
lifeMax = Horde3D::getNodeParamf( nodehandle, ParticleEffectResParams::LifeMax );

But then lifeMax is returned as "-1.0737418e+008".

I also tried:
Code:
particleEffectRes = Horde3D::getNodeParami( nodehandle, EmitterNodeParams::ParticleEffectRes );
lifeMax = Horde3D::getNodeParamf( particleEffectRes, ParticleEffectResParams::LifeMax );

Which makes more sense in my opinion but particleEffectRes has the value "-2147483648" so that getNodeParamf can't work.

The particle is loaded a few lines before the above calls via:
Code:
nodehandle = Horde3D::addNodes( RootNode, ParticleResHandle );


So what am I doing wrong?
Hope someone is able to help me. Thanks


Top
 Profile  
Reply with quote  
PostPosted: 29.07.2009, 19:10 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Are you sure that nodeHandle contains an Emitter node and not a Group node as root? Furthermore, ParticleEffectResParams are resource parameters, so you should query them with getResourceParamf.

BTW, all this parameter handling will be a bit clearer with Beta4.


Top
 Profile  
Reply with quote  
PostPosted: 30.07.2009, 07:36 
Offline

Joined: 29.07.2009, 11:35
Posts: 2
Thanks! You were right. Root node was a group not an emitter.

Now it works like this:
Code:
unsigned int cnt = Horde3D::findNodes( nodehandle, "", SceneNodeTypes::Emitter );
for( int i = 0; i < cnt; i++ ) {
     particleEffectRes = Horde3D::getNodeParami( Horde3D::getNodeFindResult( i ), EmitterNodeParams::ParticleEffectRes );
     float lm = Horde3D::getResourceParamf( particleEffectRes, ParticleEffectResParams::LifeMax );
     if( lm > lifeMax ) {
          lifeMax = lm;
     }
}


That gives me the maximum lifetime of all emitters that are in the Group. Just like i wanted to have it :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group