Skip to content

Commit

Permalink
Reflect Default for GlobalTransform (bevyengine#6200)
Browse files Browse the repository at this point in the history
# Objective

Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187.

## Solution

- Use the derive macro to reflect default

---

## Changelog

> This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section.

- `GlobalTransform` now reflects the `Default` trait.
  • Loading branch information
zicklag authored and james7132 committed Oct 28, 2022
1 parent 7b93442 commit 65edc7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_transform/src/components/global_transform.rs
Expand Up @@ -3,7 +3,7 @@ use std::ops::Mul;
use super::Transform;
use bevy_ecs::{component::Component, reflect::ReflectComponent};
use bevy_math::{Affine3A, Mat4, Quat, Vec3, Vec3A};
use bevy_reflect::{FromReflect, Reflect};
use bevy_reflect::{std_traits::ReflectDefault, FromReflect, Reflect};

/// Describe the position of an entity relative to the reference frame.
///
Expand Down Expand Up @@ -32,7 +32,7 @@ use bevy_reflect::{FromReflect, Reflect};
///
/// [`global_vs_local_translation`]: https://github.com/bevyengine/bevy/blob/latest/examples/transforms/global_vs_local_translation.rs
#[derive(Component, Debug, PartialEq, Clone, Copy, Reflect, FromReflect)]
#[reflect(Component, PartialEq)]
#[reflect(Component, Default, PartialEq)]
pub struct GlobalTransform(Affine3A);

macro_rules! impl_local_axis {
Expand Down

0 comments on commit 65edc7a

Please sign in to comment.