Vector of IAnimatedMesh or similar

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
Jgwman
Posts: 12
Joined: Sat Dec 29, 2012 6:26 pm

Vector of IAnimatedMesh or similar

Post by Jgwman »

First, sorry if this is in the wrong forum, I wasn't sure...
My problem was that I was trying to make a vector of type IAnimatedMesh to contain all the level "pieces" (floors, walls, etc) in the drawn instance (object of struct instances), and have that vector be resized in the constructor of the instance struct:

Code: Select all

struct instances{
 
    vector <irr::scene:IAnimatedMesh> structures; 
 
    instances(int floors, int rows, int columns){
    structures.resize(floors*rows*columns);
    }
 
    };

or something like that. However, the line

Code: Select all

vector <irr::scene:IAnimatedMesh> structures; 
returns

Code: Select all

error: template argument 1 is invalid
and

Code: Select all

error: template argument 2 is invalid
. It was returning something different before I changed something - I don't remember what it said but I got the point that IAnimatedMesh's can't be used as a vector type. I'm not sure how I can do this without a vector; an array won't work because the size has to be changed in the constructor. If anyone has a suggestion, that would be great. Thanks.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Vector of IAnimatedMesh or similar

Post by serengeor »

irr::scene:IAnimatedMesh is an abstract class, you can't create such object, thus you can't have it as template parameter. Instead you should use pointer of this type.
Working on game: Marrbles (Currently stopped).
Jgwman
Posts: 12
Joined: Sat Dec 29, 2012 6:26 pm

Re: Vector of IAnimatedMesh or similar

Post by Jgwman »

Oh, yeah! Thanks!
Post Reply