MrGVSV / bevy_proto

Create config files for entities in Bevy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow Transform rotations to be defined in euler angles

Occuros opened this issue · comments

Current Issue:

Rotations in transformations can only be defined using quaternions (Quat). While this is suitable for engine representation, it is less than ideal for human readability and ease of input.

Desired Solution:

Introduce a custom input type called ProtoTransform that utilizes an enum to specify the rotation type. This would be adopted by all existing custom implementations.

enum ProtoTransform {
    TranformWithQuaternionRotation {
        translation: Vec3,
        rotation: Quat,
        scale: Vec3,
    },
    TransformWithEulerXYZRotation {
        translation: Vec3,
        rotation: Vec3,
        scale: Vec3,
    },
}

I think another way of representing this is to have something like:

impl_external_schematic! {
  #[schematic(from = TransformInput)]
  struct Transform {}

  #[derive(Reflect)]
  struct TransformInput {
    translation: Vec3,
    rotation: RotationInput,
    scale: Vec3,
  }

  enum RotationInput {
    Quat(Quat),
    Euler(Vec3)
  }
}