| 57 | } |
| 58 | } |
| 59 | void enableBoneBoundingBoxMode( bool enable ) |
| 60 | { |
| 61 | // update bone bounding box mode for all models |
| 62 | mBoneBoundingBoxes = enable; |
| 63 | for (int iModel = 0; iModel < NUM_MODELS; iModel++) |
| 64 | { |
| 65 | SceneNode* node = mModelNodes[iModel]; |
| 66 | for (unsigned int iObj = 0; iObj < node->numAttachedObjects(); ++iObj) |
| 67 | { |
| 68 | if (Entity* ent = dynamic_cast<Entity*>( node->getAttachedObject( iObj ) )) |
| 69 | { |
| 70 | ent->setUpdateBoundingBoxFromSkeleton( mBoneBoundingBoxes ); |
| 71 | Node::queueNeedUpdate( node ); // when turning off bone bounding boxes, need to force an update |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | // update status panel |
| 76 | if ( mStatusPanel ) |
| 77 | { |
| 78 | mStatusPanel->setParamValue(mBoneBoundingBoxesItemName, mBoneBoundingBoxes ? "On" : "Off"); |
| 79 | } |
| 80 | } |
| 81 | bool keyPressed(const KeyboardEvent& evt) override |
| 82 | { |
| 83 | if ( !mTrayMgr->isDialogVisible() ) |
no test coverage detected