Skip to content

Commit

Permalink
remove: SteerBundle Target
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchantey committed Sep 27, 2024
1 parent 5b632eb commit 055c828
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
3 changes: 2 additions & 1 deletion crates/beet_examples/src/scenes/spatial/seek.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ pub fn seek(mut commands: Commands) {
AssetLoadBlockAppReady,
RotateToVelocity2d,
ForceBundle::default(),
SteerBundle::default().scaled_dist(500.).with_target(target),
SteerBundle::default().scaled_dist(500.),
SteerTarget::Entity(target),
))
.with_children(|parent| {
parent.spawn((
Expand Down
4 changes: 2 additions & 2 deletions crates/beet_examples/src/scenes/spatial/seek_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ pub fn seek_3d(mut commands: Commands) {
max_force: MaxForce(0.05),
..default()
}
.scaled_dist(10.)
.with_target(target),
.scaled_dist(10.),
SteerTarget::Entity(target),
))
.with_children(|parent| {
let agent = parent.parent_entity();
Expand Down
3 changes: 2 additions & 1 deletion crates/beet_spatial/src/steer/steer_actions/seek.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ mod test {
.spawn((
TransformBundle::default(),
ForceBundle::default(),
SteerBundle::default().with_target(Vec3::new(1.0, 0., 0.)),
SteerBundle::default(),
SteerTarget::Position(Vec3::new(1.0, 0., 0.)),
))
.with_children(|parent| {
parent.spawn((
Expand Down
4 changes: 0 additions & 4 deletions crates/beet_spatial/src/steer/steer_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,4 @@ impl SteerBundle {
self.arrive_radius.0 *= val;
self
}

pub fn with_target(self, target: impl Into<SteerTarget>) -> impl Bundle {
(self, target.into())
}
}

0 comments on commit 055c828

Please sign in to comment.