Creating Particle Systems

shaym

16-10-2011 16:16:57

Hi all,

I'm a newbie to MOGRE and I'm having some troubles with creating a particle system.
My code is as follows:


ParticleSystem particles = sceneManager.CreateParticleSystem("Particles");
ParticleEmitter emitter = particles.AddEmitter("Point");
emitter.SetTimeToLive(5.0f, 5.0f);
emitter.SetParticleVelocity(5.0f, 5.0f);
emitter.SetColour(ColourValue.Red, ColourValue.Green);
emitter.Position = zNode.Position;
emitter.Direction = Vector3.NEGATIVE_UNIT_Y;


When I run this code I get an exception on the 2nd line of code, which is:
A first chance exception of type 'System.Runtime.InteropServices.SEHException' occurred in Mogre.dll

Additional information: External component has thrown an exception.


What am I doing wrong? Can anyone please help?

Thanks

smiley80

16-10-2011 17:23:58

You need the ParticleFX plugin for that.
Put 'Plugin_ParticleFX.dll' in your plugins folder and add
Plugin=Plugin_ParticleFX
to 'plugins.cfg'.

shaym

16-10-2011 20:51:36

Hi,

Thanks for your reply.
I tried what you've said, but unfortunately, now I get a different exception (even before - It appears to be thrown from the .Go() method of the tutorial's BaseApplication class).
This time, the exception is:
A first chance exception of type 'System.AccessViolationException' occurred in Mogre.dll

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


It appears to happen in the process of loading the plugins, I guess.

Do you have any idea what's the reason?

Thanks

McDonte

17-10-2011 11:06:36

When you are getting this error it's hard to find out what the problem was becase it always appears when something is not working.

The problem came up when the plugins were loaded, so maybe the files do not work correctly with each other (compiled against different versions of Ogre or dependencies). I suggest to take a new set of binaries compiled all together and replace the existing ones (better delete everything first besides of the .cfg files and then copy-paste the new files into your working directory).
You could use the SDK or binaries provided by a users (for example here by Cygon).