n00b question on actors

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
Raden Mu'az
Posts: 12
Joined: Sat Dec 27, 2008 1:26 pm
Contact:

n00b question on actors

Post 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?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post 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
Raden Mu'az
Posts: 12
Joined: Sat Dec 27, 2008 1:26 pm
Contact:

Post 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! :(
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post 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.
Post Reply