Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Transform rotations to be defined in euler angles #61

Open
Occuros opened this issue Sep 28, 2023 · 1 comment
Open

Allow Transform rotations to be defined in euler angles #61

Occuros opened this issue Sep 28, 2023 · 1 comment

Comments

@Occuros
Copy link

Occuros commented Sep 28, 2023

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,
    },
}
@MrGVSV
Copy link
Owner

MrGVSV commented Sep 28, 2023

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)
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants