void Voxelify::DoRecursion(BaseObject *op, BaseObject *child, GeDynamicArray<Vector> &points, Matrix ml) { BaseObject *tp; if (child){ tp = child->GetDeformCache(); ml = ml * child->GetMl(); if (tp){ DoRecursion(op,tp,points,ml); } else{ tp = child->GetCache(NULL); if (tp){ DoRecursion(op,tp,points,ml); } else{ if (!child->GetBit(BIT_CONTROLOBJECT)){ if (child->IsInstanceOf(Opoint)){ PointObject * pChild = ToPoint(child); LONG pcnt = pChild->GetPointCount(); const Vector *childVerts = pChild->GetPointR(); for(LONG i=0; i < pcnt; i++){ points.Push(childVerts[i] * ml * parentMatrix); } } } } } for (tp = child->GetDown(); tp; tp=tp->GetNext()){ DoRecursion(op,tp,points,ml); } } }