Page 1 of 1

n00b question on actors

Posted: Sat Jan 03, 2009 8:13 am
by Raden Mu'az
Hi. I'm quite n00b in 3d game programming.

In 2d games, we can subclass a base sprite class to our own sprites like this:

Code: Select all

class BoxThingy(BaseSprite):
  def __init__(self):
    self.xy = (0,0)
    self.image = "box.png"
Can someone help me by giving his/her base 'actor' class to show something like this? - Where the actor has scene node, meshes, material, position, rotation , etc?

Posted: Sat Jan 03, 2009 5:32 pm
by Acki
I think the ISceneNode class is a good point to start for this... ;)
study this class (functions and variables) first !!!
you can subclass it and define additional stuff later if you need... ;)

Posted: Sat Jan 03, 2009 7:22 pm
by Strong99
Doesn't the tutorial page provide the answer to that?

like this one?
http://irrlicht.sourceforge.net/docu/example001.html

Look to ISceneNode/IAnimatedMeshSceneNode

Posted: Sat Jan 03, 2009 10:38 pm
by Raden Mu'az
Uh-oh. Need more help.

I tried to make an Actor class like this:

Code: Select all

class Actor : public scene::ISceneNode

{


public:

        Actor(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id)
                : scene::ISceneNode(parent, mgr, id)
        {

        }

}
But got error:

Code: Select all

C:\Documents and Settings\Raden Muaz\My Documents\Belajar Irrlicht\TaikBintang\main.cpp|26|error: base `Actor' with only non-default constructor in class without a constructor|
Please help! :(

Posted: Sun Jan 04, 2009 10:14 am
by arras
If you work in 2D it would probably be more sensfull to base your actor class at IGUIElement and made it part of GUI not scene. ISceneNode contain 3D stuff and most of it you don't need. Some of it you even want to avoid.

Or you can made your own 2D actor manager and made it part of it.