You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made an entity with a position that has a child which also has a position. Both of them have a nonzero z component for draw ordering. That caused the z component of the transform to go off like crazy.
I think this is caused by position_to_transform taking the z coordinate of the child's original transform and treating it as a global transform.
let new_transform = GlobalTransform::from(
Transform::from_translation(pos.as_f32().extend(transform.translation.z))
.with_rotation(Quaternion::from(*rot).as_f32()),
)
.reparented_to(&GlobalTransform::from(parent_transform));
I changed this to
let new_transform = GlobalTransform::from(
Transform::from_translation(pos.as_f32().extend(transform.translation.z + parent_transform.translation.z))
.with_rotation(Quaternion::from(*rot).as_f32()),
)
.reparented_to(&GlobalTransform::from(parent_transform));
but I don't know if that still works if the parent is scaled. Maybe it would be best to just set it after doing the GlobalTransform::from?
The text was updated successfully, but these errors were encountered:
I made an entity with a position that has a child which also has a position. Both of them have a nonzero z component for draw ordering. That caused the z component of the transform to go off like crazy.
I think this is caused by
position_to_transform
taking the z coordinate of the child's original transform and treating it as a global transform.I changed this to
but I don't know if that still works if the parent is scaled. Maybe it would be best to just set it after doing the
GlobalTransform::from
?The text was updated successfully, but these errors were encountered: