public void ActivateGizmo(PickingResultGizmo pickingResult) { _mode = pickingResult.Mode; _scaleBase = SupportScale ? Scale : Vector3.One; _rotationPickAngle = SimplifyAngle(pickingResult.RotationPickAngle); _rotationPickAngleOffset = SimplifyAngle( (pickingResult.Mode == GizmoMode.RotateY ? RotationY : pickingResult.Mode == GizmoMode.RotateX ? RotationX : pickingResult.Mode == GizmoMode.RotateZ ? RotationZ : 0.0f) - pickingResult.RotationPickAngle); _rotationLastMouseAngle = SimplifyAngle(pickingResult.RotationPickAngle); _rotationLastMouseRadius = pickingResult.Distance; }
/// <returns>If the parent should be redrawn</returns> public bool GizmoUpdateHoverEffect(PickingResultGizmo pickingResult) { GizmoMode oldHoveredMode = _hoveredMode; // Disable hover mode if (pickingResult == null) { _hoveredMode = GizmoMode.None; return(oldHoveredMode != _hoveredMode); } // Set hover mode _hoveredMode = pickingResult.Mode; return(oldHoveredMode != _hoveredMode); }