pub struct FlowFieldTilesBundle {
pub sector_cost_fields: SectorCostFields,
pub sector_portals: SectorPortals,
pub portal_graph: PortalGraph,
pub map_dimensions: MapDimensions,
pub route_cache: RouteCache,
pub flow_field_cache: FlowFieldCache,
}Expand description
Defines all required components for generating FlowField Tiles
Fields§
§sector_cost_fields: SectorCostFieldsCostFields of all sectors
sector_portals: SectorPortalsPortals for all sectors
portal_graph: PortalGraphGraph describing how to get from one sector to another
map_dimensions: MapDimensionsSize of the world
route_cache: RouteCacheCache of overarching portal-portal routes
flow_field_cache: FlowFieldCacheCache of FlowFields that can be queried in a steering pipeline
Implementations§
Source§impl FlowFieldTilesBundle
impl FlowFieldTilesBundle
Sourcepub fn get_sector_cost_fields(&self) -> &SectorCostFields
pub fn get_sector_cost_fields(&self) -> &SectorCostFields
Get a reference to the SectorCostFields
Sourcepub fn get_sector_portals(&self) -> &SectorPortals
pub fn get_sector_portals(&self) -> &SectorPortals
Get a reference to the SectorPortals
Sourcepub fn get_portal_graph(&self) -> &PortalGraph
pub fn get_portal_graph(&self) -> &PortalGraph
Get a reference to the PortalGraph
Sourcepub fn get_map_dimensions(&self) -> &MapDimensions
pub fn get_map_dimensions(&self) -> &MapDimensions
Get a reference to the MapDimensions
Sourcepub fn get_route_cache(&self) -> &RouteCache
pub fn get_route_cache(&self) -> &RouteCache
Get a reference to the RouteCache
Sourcepub fn get_route_cache_mut(&mut self) -> &mut RouteCache
pub fn get_route_cache_mut(&mut self) -> &mut RouteCache
Get a mutable reference to the RouteCache
Sourcepub fn get_flowfield_cache(&self) -> &FlowFieldCache
pub fn get_flowfield_cache(&self) -> &FlowFieldCache
Get a reference to the FlowFieldCache
Sourcepub fn get_flowfield_cache_mut(&mut self) -> &mut FlowFieldCache
pub fn get_flowfield_cache_mut(&mut self) -> &mut FlowFieldCache
Get a mutable reference to the FlowFieldCache
Sourcepub fn new(
map_length: u32,
map_depth: u32,
sector_resolution: u32,
actor_size: f32,
) -> Self
pub fn new( map_length: u32, map_depth: u32, sector_resolution: u32, actor_size: f32, ) -> Self
Create a new instance of FlowFieldTilesBundle based on map dimensions
Sourcepub fn from_ron(
map_length: u32,
map_depth: u32,
sector_resolution: u32,
actor_size: f32,
path: &str,
) -> Self
pub fn from_ron( map_length: u32, map_depth: u32, sector_resolution: u32, actor_size: f32, path: &str, ) -> Self
Create a new instance of FlowFieldTilesBundle based on map dimensions where the SectorCostFields are derived from a .ron file
Sourcepub fn from_csv(
map_length: u32,
map_depth: u32,
sector_resolution: u32,
actor_size: f32,
directory: &str,
) -> Self
pub fn from_csv( map_length: u32, map_depth: u32, sector_resolution: u32, actor_size: f32, directory: &str, ) -> Self
Create a new instance of FlowFieldTilesBundle from a directory containing CSV CostField files
Sourcepub fn from_heightmap(
map_length: u32,
map_depth: u32,
sector_resolution: u32,
actor_size: f32,
file_path: &str,
) -> Self
pub fn from_heightmap( map_length: u32, map_depth: u32, sector_resolution: u32, actor_size: f32, file_path: &str, ) -> Self
From a greyscale heightmap image initialise a bundle where the CostFields are derived from the pixel values of the image
Sourcepub fn from_bevy_2d_meshes(
meshes: Vec<(&Mesh, Vec2)>,
map_length: u32,
map_depth: u32,
sector_resolution: u32,
actor_size: f32,
internal_cost: u8,
external_cost: u8,
) -> Self
pub fn from_bevy_2d_meshes( meshes: Vec<(&Mesh, Vec2)>, map_length: u32, map_depth: u32, sector_resolution: u32, actor_size: f32, internal_cost: u8, external_cost: u8, ) -> Self
From a list of 2d meshes and their translation initialise a bundle. The vertex points of the meshes must be within the map_length and map_depth of the world.
The default cell Costs can be set with internal_cost and
external_cost for cells within any meshs and for cells outside of any
meshes
Trait Implementations§
Source§impl Bundle for FlowFieldTilesBundle
impl Bundle for FlowFieldTilesBundle
Source§fn get_component_ids(
components: &Components,
ids: &mut impl FnMut(Option<ComponentId>),
)
fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>), )
Source§impl<'de> Deserialize<'de> for FlowFieldTilesBundle
impl<'de> Deserialize<'de> for FlowFieldTilesBundle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl DynamicBundle for FlowFieldTilesBundle
impl DynamicBundle for FlowFieldTilesBundle
Source§unsafe fn get_components(
ptr: MovingPtr<'_, Self>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
)
unsafe fn get_components( ptr: MovingPtr<'_, Self>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), )
Source§unsafe fn apply_effect(
ptr: MovingPtr<'_, MaybeUninit<Self>>,
func: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( ptr: MovingPtr<'_, MaybeUninit<Self>>, func: &mut EntityWorldMut<'_>, )
Source§impl Serialize for FlowFieldTilesBundle
impl Serialize for FlowFieldTilesBundle
impl BundleFromComponents for FlowFieldTilesBundle
Auto Trait Implementations§
impl Freeze for FlowFieldTilesBundle
impl RefUnwindSafe for FlowFieldTilesBundle
impl Send for FlowFieldTilesBundle
impl Sync for FlowFieldTilesBundle
impl Unpin for FlowFieldTilesBundle
impl UnwindSafe for FlowFieldTilesBundle
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more