directxBOB
asked on
Type / Pointer Question
Octree *m_children[8];
Is this:
A pointer to an array of OCTree's
Is this:
A pointer to an array of OCTree's
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Very fine Alex....
sizeof(m_children/sizeof(O ctree*);
has a typo error... missing one closing bracket...
should be
sizeof(m_children)/sizeof( Octree*);
and it will be always 8 as it is hardcoded in this case
anyway
Initialization in conctructor is fine
But Before deleing in destructor there should be Check for NULL
delete m_children[i];
if(m_children[i] != NULL)
delete m_children[i];
Anyway the answer given by Alex is good.....
sizeof(m_children/sizeof(O
has a typo error... missing one closing bracket...
should be
sizeof(m_children)/sizeof(
and it will be always 8 as it is hardcoded in this case
anyway
Initialization in conctructor is fine
But Before deleing in destructor there should be Check for NULL
delete m_children[i];
if(m_children[i] != NULL)
delete m_children[i];
Anyway the answer given by Alex is good.....
ASKER
Vector OcTreeNode::dirs[8] = {Vector(-1,1,1),Vector(-1,
Basically its the 8 directions for an OCtree