Move FloatOrd into bevy_math (#12732)

# Objective

- Fixes #12712

## Solution

- Move the `float_ord.rs` file to `bevy_math`
- Change any `bevy_utils::FloatOrd` statements to `bevy_math::FloatOrd`

---

## Changelog

- Moved `FloatOrd` from `bevy_utils` to `bevy_math`

## Migration Guide

- References to `bevy_utils::FloatOrd` should be changed to
`bevy_math::FloatOrd`
This commit is contained in:
Jacques Schutte 2024-03-27 20:30:11 +02:00 committed by GitHub
parent 56bcbb0975
commit 4508077297
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 19 additions and 19 deletions

View File

@ -4,7 +4,6 @@ use bevy_ecs::world::World;
use bevy_math::*;
use bevy_reflect::Reflect;
use bevy_transform::prelude::Transform;
use bevy_utils::FloatOrd;
/// An individual input for [`Animatable::blend`].
pub struct BlendInput<T> {

View File

@ -31,6 +31,7 @@ pub use main_pass_2d_node::*;
use bevy_app::{App, Plugin};
use bevy_ecs::prelude::*;
use bevy_math::FloatOrd;
use bevy_render::{
camera::Camera,
extract_component::ExtractComponentPlugin,
@ -42,7 +43,6 @@ use bevy_render::{
render_resource::CachedRenderPipelineId,
Extract, ExtractSchedule, Render, RenderApp, RenderSet,
};
use bevy_utils::FloatOrd;
use nonmax::NonMaxU32;
use crate::{tonemapping::TonemappingNode, upscaling::UpscalingNode};

View File

@ -48,6 +48,7 @@ pub use main_transparent_pass_3d_node::*;
use bevy_app::{App, Plugin, PostUpdate};
use bevy_ecs::prelude::*;
use bevy_math::FloatOrd;
use bevy_render::{
camera::{Camera, ExtractedCamera},
extract_component::ExtractComponentPlugin,
@ -67,7 +68,7 @@ use bevy_render::{
view::{ExtractedView, ViewDepthTexture, ViewTarget},
Extract, ExtractSchedule, Render, RenderApp, RenderSet,
};
use bevy_utils::{tracing::warn, FloatOrd, HashMap};
use bevy_utils::{tracing::warn, HashMap};
use nonmax::NonMaxU32;
use crate::{

View File

@ -14,6 +14,7 @@ use bevy_ecs::{
system::{Query, Res, ResMut, Resource},
world::{FromWorld, World},
};
use bevy_math::FloatOrd;
use bevy_render::{
render_asset::{prepare_assets, RenderAssets},
render_phase::{AddRenderCommand, DrawFunctions, RenderPhase, SetItemPipeline},
@ -24,7 +25,6 @@ use bevy_render::{
};
use bevy_sprite::{Mesh2dPipeline, Mesh2dPipelineKey, SetMesh2dViewBindGroup};
use bevy_utils::tracing::error;
use bevy_utils::FloatOrd;
pub struct LineGizmo2dPlugin;

View File

@ -16,6 +16,7 @@ mod aspect_ratio;
pub mod bounding;
pub mod cubic_splines;
mod direction;
mod float_ord;
pub mod primitives;
mod ray;
mod rects;
@ -26,6 +27,7 @@ mod shape_sampling;
pub use affine3::*;
pub use aspect_ratio::AspectRatio;
pub use direction::*;
pub use float_ord::*;
pub use ray::{Ray2d, Ray3d};
pub use rects::*;
pub use rotation2d::Rotation2d;

View File

@ -12,7 +12,7 @@ use bevy_ecs::{
schedule::IntoSystemConfigs,
system::{Commands, Local, Query, Res, ResMut, Resource},
};
use bevy_math::{Affine3A, Mat4, Vec3A, Vec4};
use bevy_math::{Affine3A, FloatOrd, Mat4, Vec3A, Vec4};
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{
extract_instances::ExtractInstancesPlugin,
@ -26,7 +26,7 @@ use bevy_render::{
Extract, ExtractSchedule, Render, RenderApp, RenderSet,
};
use bevy_transform::prelude::GlobalTransform;
use bevy_utils::{tracing::error, FloatOrd, HashMap};
use bevy_utils::{tracing::error, HashMap};
use std::hash::Hash;
use std::ops::Deref;

View File

@ -10,6 +10,7 @@ use bevy_ecs::{
prelude::*,
system::{lifetimeless::SRes, SystemParamItem},
};
use bevy_math::FloatOrd;
use bevy_render::{
mesh::{Mesh, MeshVertexBufferLayoutRef},
prelude::Image,
@ -30,7 +31,7 @@ use bevy_render::{
};
use bevy_transform::components::{GlobalTransform, Transform};
use bevy_utils::tracing::error;
use bevy_utils::{FloatOrd, HashMap, HashSet};
use bevy_utils::{HashMap, HashSet};
use std::hash::Hash;
use std::marker::PhantomData;

View File

@ -15,7 +15,7 @@ use bevy_ecs::{
prelude::*,
system::{lifetimeless::*, SystemParamItem, SystemState},
};
use bevy_math::{Affine3A, Quat, Rect, Vec2, Vec4};
use bevy_math::{Affine3A, FloatOrd, Quat, Rect, Vec2, Vec4};
use bevy_render::{
render_asset::RenderAssets,
render_phase::{
@ -37,7 +37,7 @@ use bevy_render::{
Extract,
};
use bevy_transform::components::GlobalTransform;
use bevy_utils::{FloatOrd, HashMap};
use bevy_utils::HashMap;
use bytemuck::{Pod, Zeroable};
use fixedbitset::FixedBitSet;

View File

@ -3,11 +3,10 @@ use ab_glyph::{GlyphId, OutlinedGlyph, Point};
use bevy_asset::{AssetEvent, AssetId};
use bevy_asset::{Assets, Handle};
use bevy_ecs::prelude::*;
use bevy_math::UVec2;
use bevy_math::{FloatOrd, UVec2};
use bevy_reflect::Reflect;
use bevy_render::texture::Image;
use bevy_sprite::TextureAtlasLayout;
use bevy_utils::FloatOrd;
use bevy_utils::HashMap;
type FontSizeKey = FloatOrd;

View File

@ -24,7 +24,7 @@ use bevy_app::prelude::*;
use bevy_asset::{load_internal_asset, AssetEvent, AssetId, Assets, Handle};
use bevy_ecs::entity::EntityHashMap;
use bevy_ecs::prelude::*;
use bevy_math::{Mat4, Rect, URect, UVec4, Vec2, Vec3, Vec3Swizzles, Vec4, Vec4Swizzles};
use bevy_math::{FloatOrd, Mat4, Rect, URect, UVec4, Vec2, Vec3, Vec3Swizzles, Vec4, Vec4Swizzles};
use bevy_render::{
camera::Camera,
render_asset::RenderAssets,
@ -40,7 +40,7 @@ use bevy_sprite::TextureAtlasLayout;
#[cfg(feature = "bevy_text")]
use bevy_text::{PositionedGlyph, Text, TextLayoutInfo};
use bevy_transform::components::GlobalTransform;
use bevy_utils::{FloatOrd, HashMap};
use bevy_utils::HashMap;
use bytemuck::{Pod, Zeroable};
use std::ops::Range;

View File

@ -6,6 +6,7 @@ use bevy_ecs::{
prelude::*,
system::{lifetimeless::*, SystemParamItem},
};
use bevy_math::FloatOrd;
use bevy_render::{
camera::ExtractedCamera,
render_graph::*,
@ -14,7 +15,6 @@ use bevy_render::{
renderer::*,
view::*,
};
use bevy_utils::FloatOrd;
use nonmax::NonMaxU32;
pub struct UiPassNode {

View File

@ -9,7 +9,7 @@ use bevy_ecs::{
system::lifetimeless::{Read, SRes},
system::*,
};
use bevy_math::{Mat4, Rect, Vec2, Vec4Swizzles};
use bevy_math::{FloatOrd, Mat4, Rect, Vec2, Vec4Swizzles};
use bevy_render::{
extract_component::ExtractComponentPlugin,
globals::{GlobalsBuffer, GlobalsUniform},
@ -22,7 +22,7 @@ use bevy_render::{
Extract, ExtractSchedule, Render, RenderSet,
};
use bevy_transform::prelude::GlobalTransform;
use bevy_utils::{FloatOrd, HashMap, HashSet};
use bevy_utils::{HashMap, HashSet};
use bevy_window::{PrimaryWindow, Window};
use bytemuck::{Pod, Zeroable};

View File

@ -24,7 +24,6 @@ pub mod syncunsafecell;
mod cow_arc;
mod default;
mod float_ord;
pub mod intern;
mod once;
mod parallel_queue;
@ -33,7 +32,6 @@ pub use ahash::{AHasher, RandomState};
pub use bevy_utils_proc_macros::*;
pub use cow_arc::*;
pub use default::default;
pub use float_ord::*;
pub use hashbrown;
pub use parallel_queue::*;
pub use tracing;

View File

@ -8,6 +8,7 @@
use bevy::{
color::palettes::basic::YELLOW,
core_pipeline::core_2d::Transparent2d,
math::FloatOrd,
prelude::*,
render::{
mesh::{Indices, MeshVertexAttribute},
@ -28,7 +29,6 @@ use bevy::{
Mesh2dPipelineKey, Mesh2dTransforms, MeshFlags, RenderMesh2dInstance,
RenderMesh2dInstances, SetMesh2dBindGroup, SetMesh2dViewBindGroup,
},
utils::FloatOrd,
};
use std::f32::consts::PI;