Link to home
Start Free TrialLog in
Avatar of directxBOB
directxBOBFlag for Ireland

asked on

Type / Pointer Question

Octree      *m_children[8];

Is this:

A pointer to an array of OCTree's

ASKER CERTIFIED SOLUTION
Avatar of itsmeandnobodyelse
itsmeandnobodyelse
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of directxBOB

ASKER

Any idea on how to port this to C#

Vector OcTreeNode::dirs[8] = {Vector(-1,1,1),Vector(-1,1,-1),Vector(1,1,1),Vector(1,1,-1),Vector(-1,-1,1),Vector(-1,-1,-1),Vector(1,-1,1),Vector(1,-1,-1)};

Basically its the 8 directions for an OCtree
Avatar of jitendra_wadhwani
jitendra_wadhwani

Very fine Alex....




sizeof(m_children/sizeof(Octree*);
 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.....