bool updateBrushAndCursorByIntersection (const ViewPointingEvent& e, bool useRecentOctree) { WingedFaceIntersection intersection; if (this->self->intersectsScene (e, intersection)) { this->cursor.enable (); this->cursor.position (intersection.position ()); if (e.primaryButton ()) { this->brush.mesh (&intersection.mesh ()); if (useRecentOctree) { Intersection octreeIntersection; if (this->self->intersectsRecentOctree (e, octreeIntersection)) { return this->brush.updatePointOfAction ( octreeIntersection.position () , octreeIntersection.normal () ); } else { return this->brush.updatePointOfAction ( intersection.position () , intersection.normal () ); } } else { return this->brush.updatePointOfAction ( intersection.position () , intersection.normal () ); } } else { return false; } } else { this->cursor.disable (); return false; } }
bool initializeDraglikeStroke (const ViewPointingEvent& e, ToolUtilMovement& movement) { if (e.primaryButton ()) { WingedFaceIntersection intersection; if (this->self->intersectsScene (e, intersection)) { this->brush.mesh (&intersection.mesh ()); this->brush.setPointOfAction (intersection.position (), intersection.normal ()); this->cursor.disable (); movement.resetPosition (intersection.position ()); return true; } else { this->cursor.enable (); this->brush.resetPointOfAction (); return false; } } else { this->cursor.enable (); this->brush.resetPointOfAction (); return false; } }