pub fn axis_align_drag(axis_align: bool, position: DVec2, start: DVec2) -> DVec2 {
	if axis_align {
		let mouse_position = position - start;
		let snap_resolution = SELECTION_DRAG_ANGLE.to_radians();
		let angle = -mouse_position.angle_between(DVec2::X);
		let snapped_angle = (angle / snap_resolution).round() * snap_resolution;
		DVec2::new(snapped_angle.cos(), snapped_angle.sin()) * mouse_position.length() + start
	} else {
		position
	}
}
/// Aligns the mouse position to the closest axis
Aligns the mouse position to the closest axis
Aligns the mouse position to the closest axis
pub fn axis_align_drag(axis_align: bool, position: DVec2, start: DVec2) -> DVec2 {
	if axis_align {
		let mouse_position = position - start;
		let snap_resolution = SELECTION_DRAG_ANGLE.to_radians();
		let angle = -mouse_position.angle_between(DVec2::X);
		let snapped_angle = (angle / snap_resolution).round() * snap_resolution;
		DVec2::new(snapped_angle.cos(), snapped_angle.sin()) * mouse_position.length() + start
	} else {
		position
	}
}
pub fn axis_align_drag ( axis_align : bool , position : DVec2 , start : DVec2 ) -> DVec2 { if axis_align { let mouse_position = position - start ; let snap_resolution = SELECTION_DRAG_ANGLE . to_radians ( ) ; let angle = - mouse_position . angle_between ( DVec2 :: X ) ; let snapped_angle = ( angle / snap_resolution ) . round ( ) * snap_resolution ; DVec2 :: new ( snapped_angle . cos ( ) , snapped_angle . sin ( ) ) * mouse_position . length ( ) + start } else { position } }
Aligns the mouse position to the closest axis
Aligns the mouse position to the closest axis
axis_align
bool
position
DVec2
start
DVec2
axis_align
bool
position
DVec2
start
DVec2