Page 1 of 1

Inheritance Problem

Posted: Thu Apr 01, 2010 1:03 pm
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

Re: Inheritance Problem

Posted: Thu Apr 01, 2010 1:20 pm
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.

Posted: Thu Apr 01, 2010 1:36 pm
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

Posted: Thu Apr 01, 2010 2:53 pm
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.

Posted: Thu Apr 01, 2010 6:32 pm
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

Posted: Thu Apr 01, 2010 7:41 pm
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.