Original Post
I am using a linked list to contain all of the objects in my 3d engine, but I never really learned how to use templates. I used a book I have to understand the syntax, but I am getting errors from msvc when I try to access the members of an object embedded deep within templated classes.
The Linked list class can accept any kind of object (camera, light, or just a regular 3dobject) in its Insert member function, and then sends this to the constructor for the Node class which is also templated. The problem is when I try to access individual data members of an object.
ObjectList.GetCurrentNode()->object.(here''s the problem)pos.x;
ObjectList: instance of linked list class
GetCurrentNode(): returns current Node
object: some kind of 3d object
pos: instance(?) of struct that only occurs in one of the 3 kinds of 3d objects I am using
x: member of pos struct
I think the reason I am having problems is that I might not be able to access things like the struct inside of the object because not every kind of object I''m using has that struct as a member.
If anyone could quickly give me an answer to my problem or suggest a better way of handling this stuff, I would be most appreciative.
Thank you,
Mike Griffin
griff@umr.edu