(C++) what is the best way of getting a child class from parent class for example: im making a game engine so i have classes called mesh, light, and camera and they are all different but they have 1 thing in common, thay all have transformations, so i made a class called node and mesh, light and camera all extend node. (node holds common data like transformations and can only hold ONE of these 3 types). so i will have a heirarchy of these nodes(transforms). so later after i iterate through this heirarchy, at a certain node how can i get my mesh or light, because how do i know if a particular node is holding a mesh or light or camera because node is a generic class and can hold all 3 of these. long story short is there a way to know what type of object node is holding, and if I find that out how can i get the mesh object or light object from node??? thanks in advance!
Example Code:
class Node // generic class
{
private:
//hold transformation data
};
class Mesh : public Node
{
//mesh information
};
class Light : public Node
{
//mesh information
};
...
int Main()
{
Node node;
//node will be initialized with a mesh, light or camera
//so how do i know if this node is a mesh, light, or etc...
//and how to get the mesh/light/camera data
}