Base class for defining operations to perform on each part, in hierarchy order.
More...
Base class for defining operations to perform on each part, in hierarchy order.
Example:
class ExtractVertexCallback : public ArticulatedModel::PartCallback {
public:
Array<Point3>& vertexArray;
ExtractVertexCallback(Array<Point3>& vertexArray) : vertexArray(vertexArray) {}
void operator()(ArticulatedModel::Part *
part,
const CFrame &worldToPartFrame, shared_ptr<ArticulatedModel> model,
const int treeDepth) {
for (
int i = 0; i <
part->cpuVertexArray.size(); ++i) {
vertexArray.append(worldToPartFrame.pointToObjectSpace(
part->cpuVertexArray.vertex[i].position));
}
}
} callback(vertexArray);
model->forEachPart(callback);