Inheritance Problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
katze555
Posts: 28
Joined: Tue Mar 23, 2010 7:13 pm

Inheritance Problem

Post by katze555 »

i have this class:

Code: Select all

class _wallParticleEffect : public irr::scene::IParticleSystemSceneNode
{
.....

and this is the constructor:

Code: Select all

_wallParticleEffect::_wallParticleEffect(ISceneManager* smgr, IVideoDriver* driver, vector3df collisionPoint, triangle3df hitTriangle, int timer) : IParticleSystemSceneNode(0, smgr, 1)
{
    IParticleEmitter* _em = this->createPointEmitter(hitTriangle.getNormal().setLength(0.15), 9999, 12222, SColor(0,222,222,222), SColor(0,333,333,333), 222, 333, 15, dimension2df(0.f,0.f), dimension2df(1.5f,1.5f));
    this->setEmitter(_em);
    _em->drop();
    
    /*
    IParticleAffector* paf = this->createFadeOutParticleAffector();
    IParticleAffector* gaf = this->createGravityAffector(vector3df(0.0f,-0.1f, 0.0f));
    this->addAffector(paf);
    this->addAffector(gaf);
    paf->drop();
    gaf->drop();
    */
    
    this->setPosition(collisionPoint);
    this->setScale(vector3df(2,2,2));
    this->setMaterialFlag(EMF_LIGHTING, false);
    this->setMaterialTexture(0, driver->getTexture("particles/wallDust.bmp"));
    this->setMaterialType(EMT_TRANSPARENT_VERTEX_ALPHA);
    
    _timeToDie = timer + 200;
}

i get errors in the lines "IParticleEmitter* _em....." and "this->setEmitter(_em);". The errors are "undefined reference to 'irr::scene.....". What am i doing wrong?
________
Dc Medical Marijuana
Last edited by katze555 on Thu Feb 24, 2011 7:43 am, edited 1 time in total.
CuteAlien
Admin
Posts: 9679
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Inheritance Problem

Post by CuteAlien »

katze555 wrote: i get errors in the lines "IParticleEmitter* _em....." and "this->setEmitter(_em);". The errors are "undefined reference to 'irr::scene.....". What am i doing wrong?
The thing you are doing wrong is trying to shorten an error message instead of simply doing a copy&paste when you have one. And so you throw out the most important part of information, replacing it with a series of way less informative points. In general the error tells you that you haven't implemented (or linked) a function of a certain name.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
katze555
Posts: 28
Joined: Tue Mar 23, 2010 7:13 pm

Post by katze555 »

undefined reference to `irr::scene::IParticleSystemSceneNode::createPointEmitter(irr::core::vector3d<float> const&, unsigned int, unsigned int, irr::video::SColor const&, irr::video::SColor const&, unsigned int, unsigned int, int, irr::core::dimension2d<float> const&, irr::core::dimension2d<float> const&)'


undefined reference to `irr::scene::IParticleSystemSceneNode::setEmitter(irr::scene::IParticleEmitter*)'
________
Swed
Last edited by katze555 on Thu Feb 24, 2011 7:43 am, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You are not supposed to inherit from ParticleSystemSceneNode. The system will simply aggregate particles, affectors, and emitters. If you want to change the behavior of a particle system, implement or use other emitters and affectors. Changing the material does not require a new particle system implementation either.
katze555
Posts: 28
Joined: Tue Mar 23, 2010 7:13 pm

Post by katze555 »

theres a lot more i wanna do with this class, its just not in the example i posted.
so it is just impossible to inherit from ParticleSystemSceneNode??
________
MEDICAL CANNABIS
Last edited by katze555 on Thu Feb 24, 2011 7:43 am, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, but you will have to provide loads of methods which you don't really want to care about. Things like the mentioned createSomething methods, which are convenience methods for the emitters and affectors provided by Irrlicht.
If you copy those over from the implementation, or just leave empty bodies and avoid to use the methods it should still work.
Post Reply