is there a scenenode->getmesh?

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
Phunk
Posts: 78
Joined: Sun Dec 14, 2003 8:18 pm
Location: The Netherlands

is there a scenenode->getmesh?

Post by Phunk »

As I am using the new .irr scene file loader, I would like to gain control over the mesh that a loaded mesh-scenenode posesses.

But there is only a setMesh, and no getMesh(or something like that). Would it be a problem adding this getter to the IMeshSceneNode (and CMeshSceneNode) interface? It seems to me it was just not useful before the .irr loader, but I think it is now.

Or is there some sort of other way of getting the mesh from a scenenode?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

No, there is not. There probably shouldn't be a getMesh() in ISceneNode because all scene nodes do not have meshes.

Maybe the IMeshSceneNode should expose an abstract getMesh() method and the IAnimatedMeshSceneNode should expose a getAnimatedMesh() also.

Travis
Phunk
Posts: 78
Joined: Sun Dec 14, 2003 8:18 pm
Location: The Netherlands

Post by Phunk »

yeah, I know, thats why I said IMeshSceneNode, I guess you could use getType() to see what kind of scenenode you should use, and then create a pointer of that kind to reference to it. But as most of the scene nodes have IMeshSceneNode as their parent, I feel that the getMesh() should be in there.

should I make a bug report of this?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

But as most of the scene nodes have IMeshSceneNode as their parent, I feel that the getMesh() should be in there
This is simply not true. The only class that has IMeshSceneNode as a base is CMeshSceneNode. As I said, it would not right for the ISceneNode interface to expose a getMesh() method. Very few scene node types actually have a mesh, and of those that do, some of those meshes are animated meshes.
Phunk
Posts: 78
Joined: Sun Dec 14, 2003 8:18 pm
Location: The Netherlands

Post by Phunk »

yeah, youre right. I thought that every scene node that contains a mesh (so also animatedmesh, terrainnode(allready has a getmesh) and watersurfacenode) would derive from meshscenenode, but I was wrong in that assumption.

I totally agree with you on the matter that getmesh should not be in ISceneNode, I meant with 'should be in there' that there should be a getmesh in IMeshSceneNode and a getanimatedmesh in IAnimatedMeshscenenode, like you said in your first post.

but to get these methods in, should it be made a bug report, or is there an other way?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Yeah, a post in the bug report forum will probably do. Hybrid reads almost every post that comes through, so he's probably already seen this and started to make the appropriate changes.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I've read all this, yes, but I'm currently doing other things, so I won't do something for this in the near future.
Phunk
Posts: 78
Joined: Sun Dec 14, 2003 8:18 pm
Location: The Netherlands

Post by Phunk »

ill fix it, and post a patch in the bug forum. ok?

Gr. Robin
TheC
Posts: 93
Joined: Fri May 05, 2006 7:50 am

Post by TheC »

I added my own getLocalMesh() method. I did think it was odd that there wasn't one in from the start.

it was as simple as virtual IAnimatedMesh* getLocalMesh() { return IAnimatedMesh; }
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post by Strong99 »

where did you add it? in a IScenenode?
Post Reply