Drag the grabbed handle to the cursor's ray (origin, unit dir; root frame), held to its constraint. False (and not moved) if it isn't grabbed or the ray doesn't meet the constraint.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DragHandle), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | origin(3) |
the cursor's ray (root frame) |
||
| real(kind=wp), | intent(in) | :: | dir(3) |
the cursor's ray (root frame) |
logical function drag(self, origin, dir) result(moved) class(DragHandle), intent(inout) :: self real(wp), intent(in) :: origin(3), dir(3) !! the cursor's ray (root frame) real(wp) :: h(3), p(3) moved = .false. if (.not. self%dragged_) return if (.not. constrained(self, origin, dir, self%world_matrix(), h)) return p = h + self%offset if (self%constraint_ == HANDLE_SPHERE .and. norm2(p) > 0.0_wp) p = self%radius * p / norm2(p) call self%move_handle_point(p) moved = .true. end function drag