| 629 | } |
| 630 | |
| 631 | void Model::forEachPrimitiveInScene( |
| 632 | int32_t sceneID, |
| 633 | std::function<ForEachPrimitiveInSceneCallback>&& callback) { |
| 634 | return const_cast<const Model*>(this)->forEachPrimitiveInScene( |
| 635 | sceneID, |
| 636 | [&callback]( |
| 637 | const Model& gltf, |
| 638 | const Node& node, |
| 639 | const Mesh& mesh, |
| 640 | const MeshPrimitive& primitive, |
| 641 | const glm::dmat4& transform) { |
| 642 | callback( |
| 643 | const_cast<Model&>(gltf), |
| 644 | const_cast<Node&>(node), |
| 645 | const_cast<Mesh&>(mesh), |
| 646 | const_cast<MeshPrimitive&>(primitive), |
| 647 | transform); |
| 648 | }); |
| 649 | } |
| 650 | |
| 651 | void Model::forEachPrimitiveInScene( |
| 652 | int32_t sceneID, |