When creating a QuadNode by giving it an id and t (time variable),
I want to use back the original TimeAStarNode and QuadNode properties.
Do I have to call back TimeAStarNode constructor like this and all other QuadNode properties will retain?
Thanks
Jack
class QuadNode : public TimeAStarNode
{
public:
QuadNode(const quad::vec2* bb, QuadTree* tree, QuadNode* parent, const Point<int>& top_right, const Point<int>& bottom_left, float fHeightThresHold, bool bRegularGridMode = false, int currentDepth = 0, int maxDepth = 0, bool init = false);
QuadNode(const QuadNode& node)
// ancestor is used to build quadtree, which is the parent of current node
: TimeAStarNode(node.ancestor, node.m_quadNode, node.path_cost, node.estimated_cost, node.t, node.depth)
{
// overwrites current id
this->id = node.id;
// used to build paths
this->parent = node.parent;
this->m_pivot.x = node.m_pivot.x;
this->m_pivot.y = node.m_pivot.y;
this->m_boundingBox[0] = node.m_boundingBox[0];
this->m_boundingBox[1] = node.m_boundingBox[1];
this->m_vSize = node.m_vSize;
this->m_vPos = node.m_vPos;
this->m_tree = node.m_tree;
this->m_bitRegions = node.m_bitRegions;
this->m_bRegularGridMode = node.m_bRegularGridMode;
this->m_fCurrentSize = node.m_fCurrentSize;
///////
this->northeast = node.northeast;
this->northwest = node.northwest;
this->southeast = node.southeast;
this->southwest = node.southwest;
this->status = node.status;
this->m_OverHangTris = node.m_OverHangTris;
this->transitions = node.transitions;
}
public:
QuadNode(int id, long t)
: TimeAStarNode(this->ancestor, this->m_quadNode, this->path_cost, this->estimated_cost, this->t, this->depth)
{
// overwrites current id
this->id = id;
this->parent = NULL; ;
this->transition = 0;
}