override visit. Don't call visit on it's children
| 130 | // override visit. |
| 131 | // Don't call visit on it's children |
| 132 | void ParticleBatchNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t parentFlags) |
| 133 | { |
| 134 | // CAREFUL: |
| 135 | // This visit is almost identical to Node#visit |
| 136 | // with the exception that it doesn't call visit on it's children |
| 137 | // |
| 138 | // The alternative is to have a void Sprite#visit, but |
| 139 | // although this is less maintainable, is faster |
| 140 | // |
| 141 | if (!_visible) |
| 142 | { |
| 143 | return; |
| 144 | } |
| 145 | |
| 146 | uint32_t flags = processParentFlags(parentTransform, parentFlags); |
| 147 | |
| 148 | if (isVisitableByVisitingCamera()) |
| 149 | { |
| 150 | // IMPORTANT:d |
| 151 | // To ease the migration to v3.0, we still support the Mat4 stack, |
| 152 | // but it is deprecated and your code should not rely on it |
| 153 | _director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); |
| 154 | _director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); |
| 155 | |
| 156 | draw(renderer, _modelViewTransform, flags); |
| 157 | |
| 158 | _director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | // override addChild: |
| 163 | void ParticleBatchNode::addChild(Node* aChild, int zOrder, int tag) |
nothing calls this directly
no test coverage detected