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

Implement the Vectorized trait to allow for overloaded constructors and dynamic arguments. #3

Open
LunaticWyrm467 opened this issue Jun 2, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@LunaticWyrm467
Copy link
Owner

Features

Such a trait would add special conversions of types that can be represented as vectors with a very simple syntax:

// Vec2
let _vec2: Vec2<u8> = 1.vec2();
let _vec2: Vec2<u8> = (1, 2).vec2();

// Vec3
let _vec3: Vec3<u8> = 1.vec3();
let _vec3: Vec3<u8> = (1, 2, 3).vec3();
let _vec3: Vec3<u8> = (Vec2(1, 2), 3).vec3();
let _vec3: Vec3<u8> = (1, Vec2(2, 3)).vec3();

// Vec4
let _vec4: Vec4<u8> = 1.vec4();
let _vec4: Vec4<u8> = (1, 2, 3, 4).vec4();
let _vec4: Vec4<u8> = (Vec2(1, 2), 3, 4).vec4();
let _vec4: Vec4<u8> = (1, 2, Vec2(3, 4)).vec4();
let _vec4: Vec4<u8> = (Vec3(1, 2, 3), 4).vec4();
let _vec4: Vec4<u8> = (1, Vec3(2, 3, 4)).vec4();

// Note: This trait would allow vectors to be converted to their own type as a sort of identity function for obvious reasons.

Deprecations

Any scalar counterpart of functions such as pow or log, and functions such as ones_like() will be removed. This will be done in an effort to simplify syntax.

@LunaticWyrm467 LunaticWyrm467 added the enhancement New feature or request label Jun 2, 2024
@LunaticWyrm467 LunaticWyrm467 self-assigned this Jun 2, 2024
@LunaticWyrm467 LunaticWyrm467 moved this to Backlog in Cascadia Engine Jun 2, 2024
@LunaticWyrm467 LunaticWyrm467 moved this from Backlog to Ready in Cascadia Engine Jun 2, 2024
@LunaticWyrm467 LunaticWyrm467 moved this from Ready to In progress in Cascadia Engine Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In progress
Development

No branches or pull requests

1 participant