Skip to content

Commit

Permalink
bop
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-blackbird committed Aug 28, 2022
1 parent 2300fa5 commit 5d1c36e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
6 changes: 2 additions & 4 deletions crates/bevy_render/src/spatial_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,15 @@ impl SpatialBundle {
/// A visible [`SpatialBundle`], with no translation, rotation, and a scale of 1 on all axes.
pub const VISIBLE_IDENTITY: Self = SpatialBundle {
visibility: Visibility::VISIBLE,
computed: ComputedVisibility::NOT_VISIBLE,
computed: ComputedVisibility::DEFAULT,
transform: Transform::IDENTITY,
global_transform: GlobalTransform::IDENTITY,
};

/// An invisible [`SpatialBundle`], with no translation, rotation, and a scale of 1 on all axes.
pub const INVISIBLE_IDENTITY: Self = SpatialBundle {
visibility: Visibility::INVISIBLE,
computed: ComputedVisibility::NOT_VISIBLE,
transform: Transform::IDENTITY,
global_transform: GlobalTransform::IDENTITY,
..Self::VISIBLE_IDENTITY
};
}

Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_render/src/view/visibility/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ pub struct ComputedVisibility {

impl Default for ComputedVisibility {
fn default() -> Self {
Self::NOT_VISIBLE
Self::DEFAULT
}
}

impl ComputedVisibility {
/// Creates a new [`ComputedVisibility`], set as not visible
pub const NOT_VISIBLE: Self = ComputedVisibility {
/// A [`ComputedVisibility`], set as invisible.
pub const DEFAULT: Self = ComputedVisibility {
is_visible_in_hierarchy: false,
is_visible_in_view: false,
};
Expand Down
10 changes: 1 addition & 9 deletions crates/bevy_transform/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub struct TransformBundle {

impl TransformBundle {
/// An identity [`TransformBundle`] with no translation, rotation, and a scale of 1 on all axes.
pub const IDENTITY: Self = Self {
pub const IDENTITY: Self = TransformBundle {
local: Transform::IDENTITY,
global: GlobalTransform::IDENTITY,
};
Expand All @@ -63,14 +63,6 @@ impl TransformBundle {
..Self::IDENTITY
}
}

/// Creates a new identity [`TransformBundle`], with no translation, rotation, and a scale of 1
/// on all axes.
#[inline]
#[deprecated = "Use `TransformBundle::IDENTITY` instead."]
pub const fn identity() -> Self {
TransformBundle::IDENTITY
}
}

impl From<Transform> for TransformBundle {
Expand Down
2 changes: 1 addition & 1 deletion examples/animation/animated_transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fn setup(
.insert_bundle((planet, player))
.with_children(|p| {
// This entity is just used for animation, but doesn't display anything
p.spawn_bundle(SpatialBundle::default())
p.spawn_bundle(SpatialBundle::VISIBLE_IDENTITY)
// Add the Name component
.insert(orbit_controller)
.with_children(|p| {
Expand Down

0 comments on commit 5d1c36e

Please sign in to comment.