Ogre Version: 1.12
The title is self explanatory. I have a ParticleSystem and I want to attach it to my node. It was possible using Mogre, but I couldn't find any example of how to do it with ogre itself
How can I attach a particle system to a node?
-
- Halfling
- Posts: 44
- Joined: Mon Feb 22, 2021 6:25 pm
- x 2
- sercero
- Bronze Sponsor
- Posts: 450
- Joined: Sun Jan 18, 2015 4:20 pm
- Location: Buenos Aires, Argentina
- x 156
Re: How can I attach a particle system to a node?
Particle Systems are movable objects, so it is just a matter of attaching it to the node:
References:
https://ogrecave.github.io/ogre/api/1.1 ... ystem.html
https://ogrecave.github.io/ogre/api/1.1 ... _node.html
Code: Select all
Ogre::SceneNode* node = mSceneMgr->getRootSceneNode()->createChildSceneNode("Node");
node->attachObject(particleSystem );
https://ogrecave.github.io/ogre/api/1.1 ... ystem.html
https://ogrecave.github.io/ogre/api/1.1 ... _node.html
-
- Halfling
- Posts: 44
- Joined: Mon Feb 22, 2021 6:25 pm
- x 2
Re: How can I attach a particle system to a node?
It throws me an error that I can't convert a ParticleSystem to a MovableObject. I'm using the C# bindings btw
- sercero
- Bronze Sponsor
- Posts: 450
- Joined: Sun Jan 18, 2015 4:20 pm
- Location: Buenos Aires, Argentina
- x 156
Re: How can I attach a particle system to a node?
Ogre::ParticleSystem inherits from Ogre::MovableObject so it should work.
Isn't there a cast operator for C#?
Perhaps the problem is that it is using multiple inheritance...
Check the graph here:
https://ogrecave.github.io/ogre/api/1.1 ... ystem.html
Isn't there a cast operator for C#?
Perhaps the problem is that it is using multiple inheritance...
Check the graph here:
https://ogrecave.github.io/ogre/api/1.1 ... ystem.html
-
- Halfling
- Posts: 44
- Joined: Mon Feb 22, 2021 6:25 pm
- x 2
Re: How can I attach a particle system to a node?
I'll have a look on this and yes, C# doesn't support multiple inheritance
-
- Halfling
- Posts: 44
- Joined: Mon Feb 22, 2021 6:25 pm
- x 2
Re: How can I attach a particle system to a node?
The ParticleSystem class is inheriting from StringInterface only. I guess I will need to create another class with all the methods
-
- OGRE Team Member
- Posts: 1995
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: How can I attach a particle system to a node?
ah, then indeed SWIG is stumbling over multiple inheritance. Does it help if you swap the parent classes here?
https://github.com/OGRECave/ogre/blob/5 ... stem.h#L65
https://github.com/OGRECave/ogre/blob/5 ... stem.h#L65
-
- Halfling
- Posts: 44
- Joined: Mon Feb 22, 2021 6:25 pm
- x 2
Re: How can I attach a particle system to a node?
It does in my case! But I don't think it will work if you need something from StringInterface
-
- OGRE Team Member
- Posts: 1995
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: How can I attach a particle system to a node?
then probably something like this is needed:
https://github.com/OGRECave/ogre/blob/8 ... #L685-L690
https://github.com/OGRECave/ogre/blob/8 ... #L685-L690